Bug 605157. Style linking elements should work in XML when set via innerHTML. r=sicking, a=blocker

This commit is contained in:
Boris Zbarsky 2010-10-18 23:45:34 -04:00
parent 7395af3488
commit 4c8043cb24
4 changed files with 25 additions and 2 deletions

View File

@ -541,9 +541,11 @@ nsXMLContentSink::CreateElement(const PRUnichar** aAtts, PRUint32 aAttsCount,
nsCOMPtr<nsIStyleSheetLinkingElement> ssle(do_QueryInterface(content));
if (ssle) {
ssle->InitStyleLinkElement(PR_FALSE);
ssle->SetEnableUpdates(PR_FALSE);
if (aFromParser) {
ssle->SetEnableUpdates(PR_FALSE);
}
if (!aNodeInfo->Equals(nsGkAtoms::link, kNameSpaceID_XHTML)) {
ssle->SetLineNumber(aLineNumber);
ssle->SetLineNumber(aFromParser ? aLineNumber : 0);
}
}
}

View File

@ -0,0 +1,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>body { color: green; }</style>
</head>
<body>
This should be green.
</body>
</html>

View File

@ -0,0 +1,12 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
This should be green.
<script>
<![CDATA[
document.head.innerHTML = "<style>body { color: green; }</style>";
]]>
</script>
</body>
</html>

View File

@ -1518,3 +1518,4 @@ fails-if(!haveTestPlugin) == 599476.html 599476-ref.html
== 600045-1.html 600045-1-ref.html
== 600803-1.html 600803-1-ref.html
== 600974-1.html 600974-1-ref.html
== 605157-1.xhtml 605157-1-ref.xhtml