Title: [140331] trunk/Source/WebCore
Revision
140331
Author
[email protected]
Date
2013-01-21 06:57:19 -0800 (Mon, 21 Jan 2013)

Log Message

Web Inspector: [REGRESSION] Forced :visited pseudoclass has no effect on A elements
https://bugs.webkit.org/show_bug.cgi?id=107448

Reviewed by Antti Koivisto.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::sortAndTransferMatchedRules): Remove totally bad code.
(WebCore::StyleResolver::styleForElement):
  Use InsideVisitedLink if PseudoVisited has been forced by Inspector.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (140330 => 140331)


--- trunk/Source/WebCore/ChangeLog	2013-01-21 14:28:11 UTC (rev 140330)
+++ trunk/Source/WebCore/ChangeLog	2013-01-21 14:57:19 UTC (rev 140331)
@@ -1,3 +1,15 @@
+2013-01-21  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: [REGRESSION] Forced :visited pseudoclass has no effect on A elements
+        https://bugs.webkit.org/show_bug.cgi?id=107448
+
+        Reviewed by Antti Koivisto.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::sortAndTransferMatchedRules): Remove totally bad code.
+        (WebCore::StyleResolver::styleForElement):
+          Use InsideVisitedLink if PseudoVisited has been forced by Inspector.
+
 2013-01-18  Andrey Adaikin  <[email protected]>
 
         Web Inspector: modify generate_protocol_externs.py to generate JSON typedef's for @constructors

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (140330 => 140331)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2013-01-21 14:28:11 UTC (rev 140330)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2013-01-21 14:57:19 UTC (rev 140331)
@@ -722,15 +722,10 @@
     }
 
     // Now transfer the set of matched rules over to our list of declarations.
-    // FIXME: This sucks, the inspector should get the style from the visited style itself.
-    bool swapVisitedUnvisited = InspectorInstrumentation::forcePseudoState(m_element, CSSSelector::PseudoVisited);
     for (unsigned i = 0; i < m_matchedRules.size(); i++) {
         if (m_style && m_matchedRules[i]->containsUncommonAttributeSelector())
             m_style->setUnique();
-        unsigned linkMatchType = m_matchedRules[i]->linkMatchType();
-        if (swapVisitedUnvisited && linkMatchType && linkMatchType != SelectorChecker::MatchAll)
-            linkMatchType = (linkMatchType == SelectorChecker::MatchVisited) ? SelectorChecker::MatchLink : SelectorChecker::MatchVisited;
-        addMatchedProperties(result, m_matchedRules[i]->rule()->properties(), m_matchedRules[i]->rule(), linkMatchType, m_matchedRules[i]->propertyWhitelistType());
+        addMatchedProperties(result, m_matchedRules[i]->rule()->properties(), m_matchedRules[i]->rule(), m_matchedRules[i]->linkMatchType(), m_matchedRules[i]->propertyWhitelistType());
     }
 }
 
@@ -1588,7 +1583,14 @@
 
     if (element->isLink()) {
         m_style->setIsLink(true);
-        m_style->setInsideLink(m_elementLinkState);
+        EInsideLink linkState = m_elementLinkState;
+        if (m_elementLinkState != NotInsideLink) {
+            bool forceVisited = InspectorInstrumentation::forcePseudoState(element, CSSSelector::PseudoVisited);
+            if (forceVisited)
+                linkState = InsideVisitedLink;
+        }
+
+        m_style->setInsideLink(linkState);
     }
 
     ensureDefaultStyleSheetsForElement(element);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to