Bug 180729 - Update the SVG use element's shadow trees explicitly before the style recalc
Summary: Update the SVG use element's shadow trees explicitly before the style recalc
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks: 180769
  Show dependency treegraph
 
Reported: 2017-12-12 17:12 PST by Ryosuke Niwa
Modified: 2017-12-13 14:38 PST (History)
7 users (show)

See Also:


Attachments
Patch (13.80 KB, patch)
2017-12-12 20:37 PST, Ryosuke Niwa
koivisto: review+
Details | Formatted Diff | Diff
Patch for landing (15.25 KB, patch)
2017-12-13 11:20 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2017-12-12 17:12:43 PST
We should update the shadow trees of a SVG use element before starting style resolution
instead of doing it as a part of willRecalc calls.
Comment 1 Radar WebKit Bug Importer 2017-12-12 17:13:23 PST
<rdar://problem/36009806>
Comment 2 Ryosuke Niwa 2017-12-12 20:37:29 PST
Created attachment 329196 [details]
Patch
Comment 3 Antti Koivisto 2017-12-13 00:38:41 PST
Comment on attachment 329196 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=329196&action=review

Nice. I think you could also remove this from Style::TreeResolver::resolveComposedTree:

    // FIXME: SVG <use> element may cause tree mutations during style recalc.
    it.dropAssertions();

> Source/WebCore/svg/SVGUseElement.cpp:197
>  void SVGUseElement::willRecalcStyle(Style::Change change)
>  {
> -    // FIXME: Shadow tree should be updated before style recalc.
> -    if (m_shadowTreeNeedsUpdate)
> -        updateShadowTree();
>      SVGGraphicsElement::willRecalcStyle(change);
>  }

This function can be removed completely.
Comment 4 Ryosuke Niwa 2017-12-13 01:22:08 PST
Thanks for the review! This was a surprisingly easy/small patch. We should have done it ages ago given how small this patch is!

(In reply to Antti Koivisto from comment #3)
> Comment on attachment 329196 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=329196&action=review
> 
> Nice. I think you could also remove this from
> Style::TreeResolver::resolveComposedTree:
> 
>     // FIXME: SVG <use> element may cause tree mutations during style recalc.
>     it.dropAssertions();

Oh, that's a good point. I'd try running the tests with that.

> > Source/WebCore/svg/SVGUseElement.cpp:197
> >  void SVGUseElement::willRecalcStyle(Style::Change change)
> >  {
> > -    // FIXME: Shadow tree should be updated before style recalc.
> > -    if (m_shadowTreeNeedsUpdate)
> > -        updateShadowTree();
> >      SVGGraphicsElement::willRecalcStyle(change);
> >  }
> 
> This function can be removed completely.

Good point.
Comment 5 Ryosuke Niwa 2017-12-13 11:20:09 PST
Created attachment 329238 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2017-12-13 13:12:46 PST
Comment on attachment 329238 [details]
Patch for landing

Clearing flags on attachment: 329238

Committed r225868: <https://trac.webkit.org/changeset/225868>
Comment 7 WebKit Commit Bot 2017-12-13 13:12:47 PST
All reviewed patches have been landed.  Closing bug.