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

Issue 1759423003: Factor addReferenceTo()-calls out of SVGUseElement::buildShadowTree (Closed)

Created:
4 years, 9 months ago by fs
Modified:
4 years, 9 months ago
Reviewers:
pdr., Stephen Chennney
CC:
blink-reviews, chromium-reviews, krit, f(malita), gyuyoung2, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Factor addReferenceTo()-calls out of SVGUseElement::buildShadowTree This factors the registering of references to first degree nested <use> elements out of the buildShadowTree, getting rid of the |foundUse| parameter. This brings us one step closer to more streamlined shadow- tree construction. It also avoids calling isStructurallyExternal() more than once. Also cleanup the instanceTreeIsLoading() method by letting it traverse all the SVGUseElement descendants of the shadow root using the Traversal<> helpers. BUG=589682 Committed: https://crrev.com/e2422a52e0a68ea44f57cf9446408c8e6e311425 Cr-Commit-Position: refs/heads/master@{#379289}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -20 lines) Patch
M third_party/WebKit/Source/core/svg/SVGUseElement.h View 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGUseElement.cpp View 4 chunks +23 lines, -18 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 14 (5 generated)
fs
4 years, 9 months ago (2016-03-04 13:56:59 UTC) #2
Stephen Chennney
LGTM
4 years, 9 months ago (2016-03-04 15:21:43 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1759423003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1759423003/1
4 years, 9 months ago (2016-03-04 15:31:19 UTC) #5
Stephen Chennney
Sorry, not LGTM due to some confusion on my part. If using Traversal<SVGUseElement>::nextSkippingChildren, how to ...
4 years, 9 months ago (2016-03-04 15:34:35 UTC) #7
Stephen Chennney
On 2016/03/04 15:34:35, Stephen Chenney wrote: > Sorry, not LGTM due to some confusion on ...
4 years, 9 months ago (2016-03-04 15:35:59 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1759423003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1759423003/1
4 years, 9 months ago (2016-03-04 15:36:32 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 9 months ago (2016-03-04 15:41:38 UTC) #11
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/e2422a52e0a68ea44f57cf9446408c8e6e311425 Cr-Commit-Position: refs/heads/master@{#379289}
4 years, 9 months ago (2016-03-04 15:43:25 UTC) #13
fs
4 years, 9 months ago (2016-03-04 15:46:59 UTC) #14
Message was sent while issue was closed.
On 2016/03/04 at 15:34:35, schenney wrote:
> Sorry, not LGTM due to some confusion on my part. If using
Traversal<SVGUseElement>::nextSkippingChildren, how to we get the same recursive
behavior we have with buildInstanceTree?

We don't want to descend into any subtree (full or partial) that is rooted in an
SVGUseElement - this is what the |foundUse| parameter was used for in
buildShadowTree (i.e when set to 'true' we'd skip the check for all descendants
of the SVGUseElement).

So the recursive formulation would be:

void addRef...(SVGElement& target)
{
    if (isSVGUseElement(target)) {
        addReferenceTo(target);
        return;
    }
    for (SVGElement& child : childrenOf(target))
        addRef...(child);
}

which should amount to a pre-order traversal with "subtree pruning".

Not sure if that helps, but essentially:

When a <use> is seen, add a reference and continue with its next sibling - if
none walk the ancestors chain until one sibling is found (or we reached the
root)

in text form. I believe this describes nextSkippingChildren pretty well, and
hence why it's a perfect fit.

Powered by Google App Engine
This is Rietveld 408576698