Bug 255098 - RenderBox::hasTrimmedMargin(PhyscialDirection) has redundant code
Summary: RenderBox::hasTrimmedMargin(PhyscialDirection) has redundant code
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: Sammy Gill
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-04-06 09:56 PDT by Sammy Gill
Modified: 2023-04-06 13:55 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sammy Gill 2023-04-06 09:56:35 PDT
There are 2 RenderBox::hasTrimmedMargin methods. They take in either a PhysicalDirection or std::optional<MarginTrimType>. The version that takes in a physicalDirection simply maps the physical direction to a MarginTrimType and then calls the other version to perform the actual logic. There are pieces of debug code in here that are shared/redundant and will make it tedious to modify as future margin trim patches are landed. 

Since the version that takes in a PhysicalDirection just performs a mapping and calls the other, we can remove the debug code from it and keep it in the other.
Comment 1 Radar WebKit Bug Importer 2023-04-06 09:56:52 PDT
<rdar://problem/107713529>
Comment 2 Sammy Gill 2023-04-06 09:59:33 PDT
Actually it's not just strictly debug code. There is also a !isInFlow() check that can be removed too
Comment 3 Sammy Gill 2023-04-06 10:55:13 PDT
Pull request: https://github.com/WebKit/WebKit/pull/12464
Comment 4 EWS 2023-04-06 13:55:14 PDT
Committed 262684@main (0c3876d9cb24): <https://commits.webkit.org/262684@main>

Reviewed commits have been landed. Closing PR #12464 and removing active labels.