2010-05-01 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 May 2010 20:23:35 +0000 (20:23 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 May 2010 20:23:35 +0000 (20:23 +0000)
commit5033a45c84955b091e5ab6aeee2b20fa749e2663
tree678bad9ed955733989ae4e01995bdf240b245a23
parent744f70e4a0432deb373653c8ef9c7a4535366267
2010-05-01  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Sam Weinig.

        REGRESSION (r58273): Visited links do not change color immediately when Cmd-clicked
        https://bugs.webkit.org/show_bug.cgi?id=38422
        <rdar://problem/7921778>

        Tests:
            manual-tests/visited-link-new-window.html

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::initElement): Only cache the visited link state
        when invoked as part of a helper call to styleForElement or pseudoStyleForElement,
        to avoid caching the visited link state beyond the scope of a single style lookup.
        (WebCore::CSSStyleSelector::styleForElement): Adjust for above change.
        (WebCore::CSSStyleSelector::pseudoStyleForElement): Adjust for above change.
        * css/CSSStyleSelector.h:
        (WebCore::CSSStyleSelector::styleForElement): Change so "visited link helper mode"
        can't accidentally be called from outside CSSStyleSelector itself.
        (WebCore::CSSStyleSelector::pseudoStyleForElement): ditto
        * manual-tests/visited-link-new-window.html: Added. I could not figure out any way
        to make an automated test that supports visited link coloring.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/css/CSSStyleSelector.cpp
WebCore/css/CSSStyleSelector.h
WebCore/manual-tests/visited-link-new-window.html [new file with mode: 0644]