Bug 839927 - Update scoped style content flags correctly when SVG <style scoped=""> elements are involved. r=bz
authorCameron McCormack <cam@mcc.id.au>
Tue, 12 Feb 2013 15:48:22 +1100
changeset 121575 09ddbf34dc176542803a5f646410540a285eae5b
parent 121574 9672b9989f3436fb3792a2bc4a688a907639a984
child 121576 608f588cb3e97e478b39119c9a3eac24761e4113
push id22807
push usercmccormack@mozilla.com
push dateTue, 12 Feb 2013 04:48:52 +0000
treeherdermozilla-inbound@09ddbf34dc17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs839927
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 839927 - Update scoped style content flags correctly when SVG <style scoped=""> elements are involved. r=bz
content/base/src/nsStyleLinkElement.cpp
--- a/content/base/src/nsStyleLinkElement.cpp
+++ b/content/base/src/nsStyleLinkElement.cpp
@@ -208,17 +208,18 @@ nsStyleLinkElement::UpdateStyleSheetInte
 }
 
 static bool
 IsScopedStyleElement(nsIContent* aContent)
 {
   // This is quicker than, say, QIing aContent to nsStyleLinkElement
   // and then calling its virtual GetStyleSheetInfo method to find out
   // if it is scoped.
-  return aContent->IsHTML(nsGkAtoms::style) &&
+  return (aContent->IsHTML(nsGkAtoms::style) ||
+          aContent->IsSVG(nsGkAtoms::style)) &&
          aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::scoped);
 }
 
 static void
 SetIsElementInStyleScopeFlagOnSubtree(Element* aElement)
 {
   if (aElement->IsElementInStyleScope()) {
     return;