Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Issue 483383002: Use NodeTraversal instead of ElementTraversal in VisitedLinkState (Closed)

Created:
6 years, 4 months ago by Inactive
Modified:
6 years, 4 months ago
Reviewers:
esprehn, adamk
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Project:
blink
Visibility:
Public.

Description

Use NodeTraversal instead of ElementTraversal in VisitedLinkState Use NodeTraversal instead of ElementTraversal in VisitedLinkState to avoid redundant Node::isElementNode() checks. Since isLink() is defined on Node, and not on Element, we can simply iterate through all Nodes and then calls isLink() on them (instead of isElementNode() && toElement(node).isLink()). R=esprehn@chromium.org, adamk@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180677

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -6 lines) Patch
M Source/core/dom/VisitedLinkState.cpp View 2 chunks +6 lines, -6 lines 3 comments Download

Messages

Total messages: 8 (0 generated)
Inactive
6 years, 4 months ago (2014-08-19 16:52:29 UTC) #1
adamk
lgtm
6 years, 4 months ago (2014-08-20 18:45:51 UTC) #2
Inactive
The CQ bit was checked by ch.dumez@samsung.com
6 years, 4 months ago (2014-08-20 18:46:12 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/483383002/1
6 years, 4 months ago (2014-08-20 18:46:34 UTC) #4
commit-bot: I haz the power
Committed patchset #1 (1) as 180677
6 years, 4 months ago (2014-08-20 18:50:50 UTC) #5
esprehn
https://codereview.chromium.org/483383002/diff/1/Source/core/dom/VisitedLinkState.cpp File Source/core/dom/VisitedLinkState.cpp (right): https://codereview.chromium.org/483383002/diff/1/Source/core/dom/VisitedLinkState.cpp#newcode68 Source/core/dom/VisitedLinkState.cpp:68: node->setNeedsStyleRecalc(SubtreeStyleChange); Note that this code is busted because it ...
6 years, 4 months ago (2014-08-20 21:44:52 UTC) #6
adamk
https://codereview.chromium.org/483383002/diff/1/Source/core/dom/VisitedLinkState.cpp File Source/core/dom/VisitedLinkState.cpp (right): https://codereview.chromium.org/483383002/diff/1/Source/core/dom/VisitedLinkState.cpp#newcode68 Source/core/dom/VisitedLinkState.cpp:68: node->setNeedsStyleRecalc(SubtreeStyleChange); On 2014/08/20 21:44:52, esprehn wrote: > Note that ...
6 years, 4 months ago (2014-08-20 21:48:46 UTC) #7
esprehn
6 years, 4 months ago (2014-08-20 21:52:03 UTC) #8
Message was sent while issue was closed.
Filed a bug for the Shadow DOM issue http://crbug.com/405707

https://codereview.chromium.org/483383002/diff/1/Source/core/dom/VisitedLinkS...
File Source/core/dom/VisitedLinkState.cpp (right):

https://codereview.chromium.org/483383002/diff/1/Source/core/dom/VisitedLinkS...
Source/core/dom/VisitedLinkState.cpp:68:
node->setNeedsStyleRecalc(SubtreeStyleChange);
On 2014/08/20 21:48:45, adamk wrote:
> On 2014/08/20 21:44:52, esprehn wrote:
> > Note that this code is busted because it doesn't walk into ShadowRoots.
> > 
> > You need to refactor the loop into a function and then do
> > 
> > for (ShadowRoot* root = node->youngestShadowRoot(); root; root =
> > root->olderShadowRoot())
> >   invalidateStyleForAllLinks(root);
> 
> This isn't newly-broken, right? The existing code already wasn't doing
anything
> special about ShadowRoots.

Correct, but there's an isElement() check inside the shadow root logic you need,
so this refactor doesn't really do much once we fix that.

Powered by Google App Engine
This is Rietveld 408576698