mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 605157. Style linking elements should work in XML when set via innerHTML. r=sicking, a=blocker
This commit is contained in:
parent
7395af3488
commit
4c8043cb24
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
8
layout/reftests/bugs/605157-1-ref.xhtml
Normal file
8
layout/reftests/bugs/605157-1-ref.xhtml
Normal 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>
|
12
layout/reftests/bugs/605157-1.xhtml
Normal file
12
layout/reftests/bugs/605157-1.xhtml
Normal 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>
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user