Bug 254859 - checking for margin-top computed style can trigger ASSERT(!needsLayout()) in RenderBox::hasTrimmedMargin
Summary: checking for margin-top computed style can trigger ASSERT(!needsLayout()) in ...
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-03-31 23:03 PDT by Sammy Gill
Modified: 2023-04-06 12:49 PDT (History)
4 users (show)

See Also:


Attachments
Testcase (396 bytes, text/html)
2023-03-31 23:03 PDT, Sammy Gill
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sammy Gill 2023-03-31 23:03:15 PDT
Created attachment 465720 [details]
Testcase

Trying to check an element's margin-top property before layout happens can trigger a !needsLayout assert. This is because isLayoutDependent will return false if the flexbox does not have margin-trim specified and would result in calling box->hasTrimmedMargin. Before calling box->hasTrimmedMargin( we should check for the same conditions in the isLayoutDependent code.
Comment 1 Radar WebKit Bug Importer 2023-03-31 23:04:38 PDT
<rdar://problem/107502795>
Comment 2 Sammy Gill 2023-03-31 23:21:50 PDT
Pull request: https://github.com/WebKit/WebKit/pull/12273
Comment 3 EWS 2023-04-06 12:49:41 PDT
Committed 262679@main (beefa0360c1e): <https://commits.webkit.org/262679@main>

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