OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 void VisitedLinkState::invalidateStyleForAllLinks(bool invalidateVisitedLinkHash
es) | 61 void VisitedLinkState::invalidateStyleForAllLinks(bool invalidateVisitedLinkHash
es) |
62 { | 62 { |
63 if (m_linksCheckedForVisitedState.isEmpty()) | 63 if (m_linksCheckedForVisitedState.isEmpty()) |
64 return; | 64 return; |
65 for (Node& node : NodeTraversal::startsAt(document().firstChild())) { | 65 for (Node& node : NodeTraversal::startsAt(document().firstChild())) { |
66 if (node.isLink()) { | 66 if (node.isLink()) { |
67 if (invalidateVisitedLinkHashes && isHTMLAnchorElement(node)) | 67 if (invalidateVisitedLinkHashes && isHTMLAnchorElement(node)) |
68 toHTMLAnchorElement(node).invalidateCachedVisitedLinkHash(); | 68 toHTMLAnchorElement(node).invalidateCachedVisitedLinkHash(); |
69 toElement(node).pseudoStateChanged(CSSSelector::PseudoLink); | 69 toElement(node).pseudoStateChanged(CSSSelector::PseudoLink); |
70 toElement(node).pseudoStateChanged(CSSSelector::PseudoVisited); | 70 toElement(node).pseudoStateChanged(CSSSelector::PseudoVisited); |
| 71 toElement(node).pseudoStateChanged(CSSSelector::PseudoAnyLink); |
71 } | 72 } |
72 } | 73 } |
73 } | 74 } |
74 | 75 |
75 void VisitedLinkState::invalidateStyleForLink(LinkHash linkHash) | 76 void VisitedLinkState::invalidateStyleForLink(LinkHash linkHash) |
76 { | 77 { |
77 if (!m_linksCheckedForVisitedState.contains(linkHash)) | 78 if (!m_linksCheckedForVisitedState.contains(linkHash)) |
78 return; | 79 return; |
79 for (Node& node : NodeTraversal::startsAt(document().firstChild())) { | 80 for (Node& node : NodeTraversal::startsAt(document().firstChild())) { |
80 if (node.isLink() && linkHashForElement(toElement(node)) == linkHash) { | 81 if (node.isLink() && linkHashForElement(toElement(node)) == linkHash) { |
81 toElement(node).pseudoStateChanged(CSSSelector::PseudoLink); | 82 toElement(node).pseudoStateChanged(CSSSelector::PseudoLink); |
82 toElement(node).pseudoStateChanged(CSSSelector::PseudoVisited); | 83 toElement(node).pseudoStateChanged(CSSSelector::PseudoVisited); |
| 84 toElement(node).pseudoStateChanged(CSSSelector::PseudoAnyLink); |
83 } | 85 } |
84 } | 86 } |
85 } | 87 } |
86 | 88 |
87 EInsideLink VisitedLinkState::determineLinkStateSlowCase(const Element& element) | 89 EInsideLink VisitedLinkState::determineLinkStateSlowCase(const Element& element) |
88 { | 90 { |
89 ASSERT(element.isLink()); | 91 ASSERT(element.isLink()); |
90 ASSERT(document().isActive()); | 92 ASSERT(document().isActive()); |
91 ASSERT(document() == element.document()); | 93 ASSERT(document() == element.document()); |
92 | 94 |
(...skipping 17 matching lines...) Expand all Loading... |
110 | 112 |
111 return InsideUnvisitedLink; | 113 return InsideUnvisitedLink; |
112 } | 114 } |
113 | 115 |
114 DEFINE_TRACE(VisitedLinkState) | 116 DEFINE_TRACE(VisitedLinkState) |
115 { | 117 { |
116 visitor->trace(m_document); | 118 visitor->trace(m_document); |
117 } | 119 } |
118 | 120 |
119 } // namespace blink | 121 } // namespace blink |
OLD | NEW |