Bug 237469 - Add hasTransformOrPerspective() helper to RenderObject
Summary: Add hasTransformOrPerspective() helper to RenderObject
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nikolas Zimmermann
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-04 04:29 PST by Nikolas Zimmermann
Modified: 2022-03-07 03:20 PST (History)
12 users (show)

See Also:


Attachments
Patch, v1 (3.41 KB, patch)
2022-03-04 04:33 PST, Nikolas Zimmermann
darin: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolas Zimmermann 2022-03-04 04:29:48 PST
RenderGeometryMap contains a duplication of the 'hasTransform()' logic from RenderObject, just with an additional check. Avoid that.
Comment 1 Nikolas Zimmermann 2022-03-04 04:33:28 PST
Created attachment 453834 [details]
Patch, v1
Comment 2 Darin Adler 2022-03-04 05:51:36 PST
Comment on attachment 453834 [details]
Patch, v1

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

I wonder at what point these function implementations get long enough that we want to move them out of the class definition.  They can still be in the header if they need to be inlined or in the .cpp file if not. Probably not yet but they are certainly getting close.

> Source/WebCore/ChangeLog:3
> +        Add hasTransformOrPerspective() helper to RenderObject

The rationale in the change log explains in detail why we must use hasTransform here, but says nothing about why adding hasTransdormOrPerspective is good.
Comment 3 zalan 2022-03-04 06:07:43 PST
These functions should really be on the RenderElement (RenderText has no business of dealing with transforms and alikes).
Comment 4 Nikolas Zimmermann 2022-03-07 03:05:10 PST
(In reply to zalan from comment #3)
> These functions should really be on the RenderElement (RenderText has no
> business of dealing with transforms and alikes).

I agree and do address that in a follow-up patch in the LBSE downstream branch, however this only aims to remove the code duplication, postponing cleanups to later. Ok with you?
Comment 5 Nikolas Zimmermann 2022-03-07 03:07:31 PST
(In reply to Darin Adler from comment #2)
> Comment on attachment 453834 [details]
> Patch, v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=453834&action=review
> 
> I wonder at what point these function implementations get long enough that
> we want to move them out of the class definition.  They can still be in the
> header if they need to be inlined or in the .cpp file if not. Probably not
> yet but they are certainly getting close.
> 
> > Source/WebCore/ChangeLog:3
> > +        Add hasTransformOrPerspective() helper to RenderObject
> 
> The rationale in the change log explains in detail why we must use
> hasTransform here, but says nothing about why adding
> hasTransdormOrPerspective is good.

Good point! In LBSE I'll have to add another condition to hasTransform(): checking for hasSVGTransform(). Prior to this patch I had to fix two call sites: the one in RenderObject.h and in RenderGeometryMap.cpp -- I want to avoid having to touch more than one place to add such a condition.

I'll amend the ChangeLog a bit to include that information. Thanks for the review, and sorry for the late reply: I was on sick leave.... More patches will follow today, cleaning up transform-box handling, individual bugs in perspective-origin, transform-box + compositing, etc.
Comment 6 Nikolas Zimmermann 2022-03-07 03:19:04 PST
Committed r290881 (248112@trunk): <https://commits.webkit.org/248112@trunk>
Comment 7 Radar WebKit Bug Importer 2022-03-07 03:20:18 PST
<rdar://problem/89897134>