Visited link hash should be computed only once
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Apr 2019 09:55:38 +0000 (09:55 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Apr 2019 09:55:38 +0000 (09:55 +0000)
commitae2de9b67ecd0de8ebad22650b2b24473b87f8e4
tree660d862bf04809996bd2db44d7586e89dadc2a3f
parenta91592a63a01dc05806400dcb853b435c302564f
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
LayoutTests/ChangeLog
LayoutTests/fast/history/visited-href-mutation-expected.html [new file with mode: 0644]
LayoutTests/fast/history/visited-href-mutation.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/VisitedLinkState.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLAnchorElement.h
Source/WebCore/svg/SVGAElement.cpp
Source/WebCore/svg/SVGAElement.h