Bug 1107508. Disable stylesheets in <use>-cloned subtrees for now. r=heycam

--HG--
extra : rebase_source : c29f557476e71ff9cae478b204185a40be4771d6
This commit is contained in:
Robert O'Callahan 2014-12-22 16:09:32 +13:00
parent 7fa9d2a0fe
commit b8292681d6
3 changed files with 26 additions and 0 deletions

View File

@ -305,6 +305,13 @@ nsStyleLinkElement::DoUpdateStyleSheet(nsIDocument* aOldDocument,
// All instances of nsStyleLinkElement should implement nsIContent.
NS_ENSURE_TRUE(thisContent, NS_ERROR_FAILURE);
if (thisContent->IsInAnonymousSubtree() &&
thisContent->IsAnonymousContentInSVGUseSubtree()) {
// Stylesheets in <use>-cloned subtrees are disabled until we figure out
// how they should behave.
return NS_OK;
}
// Check for a ShadowRoot because link elements are inert in a
// ShadowRoot.
ShadowRoot* containingShadow = thisContent->GetContainingShadow();

View File

@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<html>
<svg id="s">
<style>
#b { display: none; }
rect { fill:orange; }
</style>
<rect width="10" height="10" fill="lime"/>
</svg>
<style>
#b { display: block; }
rect { fill:blue; }
</style>
<div id="b" style="border:2px solid black">
<svg>
<use xlink:href="#s"/>
</svg>
</div>

View File

@ -454,3 +454,4 @@ load 973390-1.html
load 1001237.html
load 1043163-1.html
load 1061028.html
load 1107508-1.html