Changeset 140331 in webkit


Ignore:
Timestamp:
Jan 21, 2013 6:57:19 AM (11 years ago)
Author:
apavlov@chromium.org
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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140329 r140331  
     12013-01-21  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [REGRESSION] Forced :visited pseudoclass has no effect on A elements
     4        https://bugs.webkit.org/show_bug.cgi?id=107448
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * css/StyleResolver.cpp:
     9        (WebCore::StyleResolver::sortAndTransferMatchedRules): Remove totally bad code.
     10        (WebCore::StyleResolver::styleForElement):
     11          Use InsideVisitedLink if PseudoVisited has been forced by Inspector.
     12
    1132013-01-18  Andrey Adaikin  <aandrey@chromium.org>
    214
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r140231 r140331  
    723723
    724724    // Now transfer the set of matched rules over to our list of declarations.
    725     // FIXME: This sucks, the inspector should get the style from the visited style itself.
    726     bool swapVisitedUnvisited = InspectorInstrumentation::forcePseudoState(m_element, CSSSelector::PseudoVisited);
    727725    for (unsigned i = 0; i < m_matchedRules.size(); i++) {
    728726        if (m_style && m_matchedRules[i]->containsUncommonAttributeSelector())
    729727            m_style->setUnique();
    730         unsigned linkMatchType = m_matchedRules[i]->linkMatchType();
    731         if (swapVisitedUnvisited && linkMatchType && linkMatchType != SelectorChecker::MatchAll)
    732             linkMatchType = (linkMatchType == SelectorChecker::MatchVisited) ? SelectorChecker::MatchLink : SelectorChecker::MatchVisited;
    733         addMatchedProperties(result, m_matchedRules[i]->rule()->properties(), m_matchedRules[i]->rule(), linkMatchType, m_matchedRules[i]->propertyWhitelistType());
     728        addMatchedProperties(result, m_matchedRules[i]->rule()->properties(), m_matchedRules[i]->rule(), m_matchedRules[i]->linkMatchType(), m_matchedRules[i]->propertyWhitelistType());
    734729    }
    735730}
     
    15891584    if (element->isLink()) {
    15901585        m_style->setIsLink(true);
    1591         m_style->setInsideLink(m_elementLinkState);
     1586        EInsideLink linkState = m_elementLinkState;
     1587        if (m_elementLinkState != NotInsideLink) {
     1588            bool forceVisited = InspectorInstrumentation::forcePseudoState(element, CSSSelector::PseudoVisited);
     1589            if (forceVisited)
     1590                linkState = InsideVisitedLink;
     1591        }
     1592
     1593        m_style->setInsideLink(linkState);
    15921594    }
    15931595
Note: See TracChangeset for help on using the changeset viewer.