Bug 231477

Summary: Refactor RenderSVGBlock
Product: WebKit Reporter: Rob Buis <rbuis>
Component: SVGAssignee: Rob Buis <rbuis>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, dino, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, kondapallykalyan, pdr, rego, sabouhallawa, schenney, sergio, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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]
Patch
Comment 2 Rob Buis 2021-10-12 10:52:07 PDT
Created attachment 440957 [details]
Patch
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]
Patch

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]
Patch
Comment 6 Manuel Rego Casasnovas 2021-10-14 04:04:03 PDT
Comment on attachment 441198 [details]
Patch

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
<rdar://problem/84251970>
Comment 9 Said Abou-Hallawa 2021-10-15 10:15:36 PDT
Comment on attachment 441198 [details]
Patch

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.