Bug 996796 patch 11 - Fix the visited flag handling in ResolveStyleWithReplacement. r=heycam
authorL. David Baron <dbaron@dbaron.org>
Sat, 02 Aug 2014 19:37:44 -0700
changeset 197483 6a9de658d4b4e93101649d1e3431d0eaa2e698b5
parent 197482 720eed827027169056170ddf8ecf43be85b02fe6
child 197484 d13154302d771e887b710acb6c610f55bd32d0f0
push id47142
push userdbaron@mozilla.com
push dateSun, 03 Aug 2014 02:38:23 +0000
treeherdermozilla-inbound@1636ae2d7b53 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs996796, 1031149
milestone34.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 996796 patch 11 - Fix the visited flag handling in ResolveStyleWithReplacement. r=heycam This does the same thing as ReparentStyleContext (which thanks to the patch to bug 1031149 deals with aNewParentStyleContext being null).
layout/style/nsStyleSet.cpp
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -1426,19 +1426,23 @@ nsStyleSet::ResolveStyleWithReplacement(
     RuleNodeWithReplacement(aElement, aOldStyleContext->RuleNode(),
                             aOldStyleContext->GetPseudoType(), aReplacements);
 
   // FIXME: Does this handle visited contexts correctly???
 
   uint32_t flags = eNoFlags;
   if (aOldStyleContext->IsLinkContext()) {
     flags |= eIsLink;
-  }
-  if (aOldStyleContext->RelevantLinkVisited()) {
-    flags |= eIsVisitedLink;
+
+    // GetContext handles propagating RelevantLinkVisited state from the
+    // parent in non-link cases; all we need to pass in is if this link
+    // is visited.
+    if (aOldStyleContext->RelevantLinkVisited()) {
+      flags |= eIsVisitedLink;
+    }
   }
 
   return GetContext(aNewParentContext, ruleNode, nullptr,
                     nullptr, nsCSSPseudoElements::ePseudo_NotPseudoElement,
                     nullptr, flags);
 }