Bug 231477 - Refactor RenderSVGBlock
Summary: Refactor RenderSVGBlock
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
Keywords: InRadar
Depends on:
Reported: 2021-10-09 08:39 PDT by Rob Buis
Modified: 2021-10-15 10:15 PDT (History)
15 users (show)

See Also:

Patch (14.03 KB, patch)
2021-10-09 08:41 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (14.11 KB, patch)
2021-10-12 10:52 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (14.10 KB, patch)
2021-10-14 02:46 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2021-10-09 08:39:47 PDT
Refactor RenderSVGBlock.
Comment 1 Rob Buis 2021-10-09 08:41:04 PDT
Created attachment 440710 [details]
Comment 2 Rob Buis 2021-10-12 10:52:07 PDT
Created attachment 440957 [details]
Comment 3 Rob Buis 2021-10-13 01:43:19 PDT
Niko, hopefully this would just be a small rebase for your accelerated SVG work?
Comment 4 Manuel Rego Casasnovas 2021-10-14 01:16:03 PDT
Comment on attachment 440957 [details]

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

> Source/WebCore/rendering/svg/RenderSVGBlock.h:41
> +    LayoutRect clippedOverflowRect(const RenderLayerModelObject* repaintContainer, VisibleRectContext) const final;
> +    std::optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final;
> +    std::optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const final;
> +
> +    void mapLocalToContainer(const RenderLayerModelObject* ancestorContainer, TransformState&, OptionSet<MapCoordinatesMode>, bool* wasFixed) const final;
> +    const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const final;
> +
> +    bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) final;

Some of these methods used to be "private" in one of the subclasses, and now all are public. Do we really need all of them to be public or we can restrict this somehow?
Comment 5 Rob Buis 2021-10-14 02:46:42 PDT
Created attachment 441198 [details]
Comment 6 Manuel Rego Casasnovas 2021-10-14 04:04:03 PDT
Comment on attachment 441198 [details]

Nice catch, thanks for removing the duplicated code.
Comment 7 EWS 2021-10-14 05:37:37 PDT
Committed r284154 (242974@main): <https://commits.webkit.org/242974@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441198 [details].
Comment 8 Radar WebKit Bug Importer 2021-10-14 05:38:21 PDT
Comment 9 Said Abou-Hallawa 2021-10-15 10:15:36 PDT
Comment on attachment 441198 [details]

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

> Source/WebCore/ChangeLog:8
> +        Refactor common code from RenderSVGBlock subclasses into RenderSVGBlock.

Why are we doing this refactoring? I would expect few words here saying something like "Work towards bug #..." or a link to the blocked bug in the "Blocks" editor.