Visited link hash should be computed only once
https://bugs.webkit.org/show_bug.cgi?id=197229
<rdar://problem/
48438924>
Reviewed by Alex Christensen.
Source/WebCore:
Test: fast/history/visited-href-mutation.html
Visited link style is now based on the first target URL of the link element. Further href mutations don't affect styling.
* dom/Document.cpp:
(WebCore::Document::updateBaseURL):
* dom/VisitedLinkState.cpp:
(WebCore::linkAttribute):
(WebCore::linkHashForElement):
Visited link support is now limited to HTML and SVG <a> elements.
(WebCore::VisitedLinkState::invalidateStyleForLink):
(WebCore::VisitedLinkState::determineLinkStateSlowCase):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::HTMLAnchorElement):
(WebCore::HTMLAnchorElement::parseAttribute):
* html/HTMLAnchorElement.h:
(WebCore::HTMLAnchorElement::visitedLinkHash const):
(WebCore::HTMLAnchorElement::invalidateCachedVisitedLinkHash): Deleted.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::visitedLinkHash const):
* svg/SVGAElement.h:
LayoutTests:
* fast/history/visited-href-mutation-expected.html: Added.
* fast/history/visited-href-mutation.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244642
268f45cc-cd09-0410-ab3c-
d52691b4dbfc