parent
f711dadd63
commit
413607a991
1 changed files with 3 additions and 3 deletions
|
|
@ -122,7 +122,7 @@ exports.hasCssString = function(id, doc) {
|
||||||
|
|
||||||
if (doc.createStyleSheet && (sheets = doc.styleSheets)) {
|
if (doc.createStyleSheet && (sheets = doc.styleSheets)) {
|
||||||
while (index < sheets.length)
|
while (index < sheets.length)
|
||||||
if (sheets[index++].title === id) return true;
|
if (sheets[index++].owningElement.id === id) return true;
|
||||||
} else if ((sheets = doc.getElementsByTagName("style"))) {
|
} else if ((sheets = doc.getElementsByTagName("style"))) {
|
||||||
while (index < sheets.length)
|
while (index < sheets.length)
|
||||||
if (sheets[index++].id === id) return true;
|
if (sheets[index++].id === id) return true;
|
||||||
|
|
@ -143,7 +143,7 @@ exports.importCssString = function importCssString(cssText, id, doc) {
|
||||||
style = doc.createStyleSheet();
|
style = doc.createStyleSheet();
|
||||||
style.cssText = cssText;
|
style.cssText = cssText;
|
||||||
if (id)
|
if (id)
|
||||||
style.title = id;
|
style.owningElement.id = id;
|
||||||
} else {
|
} else {
|
||||||
style = doc.createElementNS
|
style = doc.createElementNS
|
||||||
? doc.createElementNS(XHTML_NS, "style")
|
? doc.createElementNS(XHTML_NS, "style")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue