I am currently utilizing nsIStyleSheetService within my Firefox extension to apply a custom stylesheet to every webpage. While everything is functioning properly, there are a few styles that are not being applied as expected.
One of the styles causing issues involves adding a form with inputs and textareas, but the appearance remains unchanged. I attempted to include the `important` rule, but that did not resolve the problem. Any insight into what I might be doing incorrectly?
Upon conducting some tests, I have discovered that the following styles are not being applied:
background-color:#f3f3ec;
border:1px solid #d1d1cf;
-moz-border-radius: 10px;
It is peculiar that the styles function as intended when loading the CSS directly on the page, but utilizing nsIStyleSheetService inhibits their application. I find this situation quite puzzling. :( Even after attempting to change the colors, the issue remained unresolved.
.MyToolTipWrapper input,
.MyToolTipWrapper textarea {
background-color:#f3f3ec;
border:1px solid #d1d1cf;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
width:97%;
padding:5px;
-moz-border-radius: 10px;
}
Below is my initialization script:
var sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
var uri = makeURI("resource://newtooltip/newtooltip.css");
if (sss.sheetRegistered(uri, sss.USER_SHEET))
sss.unregisterSheet(uri, sss.USER_SHEET);
if (on)
sss.loadAndRegisterSheet(uri, sss.USER_SHEET);