Bug 255098

Summary: RenderBox::hasTrimmedMargin(PhyscialDirection) has redundant code
Product: WebKit Reporter: Sammy Gill <sgill26>
Component: Layout and RenderingAssignee: Sammy Gill <sgill26>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

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.