Bug 236184

Summary: [LBSE] Introduce RenderSVGModelObject aware geometry accessors in RenderLayerBacking
Product: WebKit Reporter: Nikolas Zimmermann <zimmermann>
Component: SVGAssignee: Nikolas Zimmermann <zimmermann>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, esprehn+autocc, ews-watchlist, fred.wang, glenn, kondapallykalyan, pdr, rbuis, sabouhallawa, simon.fraser, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 90738, 236194    
Attachments:
Description Flags
Patch, v1 rbuis: review+

Description Nikolas Zimmermann 2022-02-05 16:14:11 PST
Prepare RenderLayer/RenderLayerBacking for RenderSVGModelObject support:

Stop relying on renderBox() / downcast<RenderBox>(renderer()) to query layer geometry information, instead introduce helpers that take RenderLayerModelObject instead of RenderBox, to allow querying non-RenderBox derived renderers such as RenderSVGModelObject for geometry information.
Comment 1 Nikolas Zimmermann 2022-02-05 16:17:27 PST
Created attachment 451009 [details]
Patch, v1
Comment 2 Rob Buis 2022-02-07 04:04:17 PST
Comment on attachment 451009 [details]
Patch, v1

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

> Source/WebCore/rendering/RenderLayerBacking.cpp:-3965
> -        return { };

Is this safe? Previously, non RenderBox would bail out. Is there now a chance the ASSERT_NOT_REACHED in rendererBorderBoxRect will be triggered?
Comment 3 Nikolas Zimmermann 2022-02-07 04:59:11 PST
(In reply to Rob Buis from comment #2)
> Comment on attachment 451009 [details]
> Patch, v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=451009&action=review
> 
> > Source/WebCore/rendering/RenderLayerBacking.cpp:-3965
> > -        return { };
> 
> Is this safe? Previously, non RenderBox would bail out. Is there now a
> chance the ASSERT_NOT_REACHED in rendererBorderBoxRect will be triggered?

It Is. The ASSERT_NOT_REACHED() is mainly to document that there is no missing edge case - verified by debug layout test runs.

There are no cases in RenderLayerBacking that had a bail-out, if the renderer type was not RenderBox, it was assumed to be RenderBox (and guaranteed by RenderLayer so far). transformMatrixForProperty() was the only method that had indeed a null check on renderBox() - but I cannot see how a non-RenderBox derived object can come there (only one callosities from within GraphicsLayers -- which are only ever created for RenderBox derived renderers, that create layers).
Comment 4 Nikolas Zimmermann 2022-02-07 06:23:59 PST
Committed r289213 (246898@trunk): <https://commits.webkit.org/246898@trunk>
Comment 5 Radar WebKit Bug Importer 2022-02-07 06:24:20 PST
<rdar://problem/88569054>