Bug 185357 - [LFC] Add assertions for stale Display::Box geometry
Summary: [LFC] Add assertions for stale Display::Box geometry
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: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-05 15:02 PDT by zalan
Modified: 2018-05-06 19:10 PDT (History)
7 users (show)

See Also:


Attachments
Patch (12.33 KB, patch)
2018-05-05 19:42 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (12.66 KB, patch)
2018-05-05 20:52 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (12.36 KB, patch)
2018-05-06 16:28 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2018-05-05 15:02:25 PDT
During layout we should never access stale geometry of other boxes (containing block etc).
Comment 1 zalan 2018-05-05 19:42:55 PDT
Created attachment 339664 [details]
Patch
Comment 2 zalan 2018-05-05 20:52:54 PDT
Created attachment 339669 [details]
Patch
Comment 3 Antti Koivisto 2018-05-06 11:56:39 PDT
Comment on attachment 339669 [details]
Patch

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

> Source/WebCore/layout/displaytree/DisplayBox.h:138
> +#if !ASSERT_DISABLED
> +    bool m_hasValidTop : 1;
> +    bool m_hasValidLeft : 1;
> +    bool m_hasValidWidth : 1;
> +    bool m_hasValidHeight : 1;
> +    bool m_hasValidMargin : 1;
> +    bool m_hasValidBorder : 1;
> +    bool m_hasValidPadding : 1;
> +#endif

I would just use bools. There is no need to optimize memory use of the debug build.

Do all these really need separate flags?
Comment 4 zalan 2018-05-06 12:34:10 PDT
(In reply to Antti Koivisto from comment #3)
> Comment on attachment 339669 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=339669&action=review
> 
> > Source/WebCore/layout/displaytree/DisplayBox.h:138
> > +#if !ASSERT_DISABLED
> > +    bool m_hasValidTop : 1;
> > +    bool m_hasValidLeft : 1;
> > +    bool m_hasValidWidth : 1;
> > +    bool m_hasValidHeight : 1;
> > +    bool m_hasValidMargin : 1;
> > +    bool m_hasValidBorder : 1;
> > +    bool m_hasValidPadding : 1;
> > +#endif
> 
> I would just use bools. There is no need to optimize memory use of the debug
> build.
> 
> Do all these really need separate flags?
For block context, I could definitely collapse top with left and the padding with border/margin since we compute them in one go, but other formatting contexts might differ. I guess padding/border/margin should always be collapsible.
Comment 5 zalan 2018-05-06 16:28:00 PDT
Created attachment 339694 [details]
Patch
Comment 6 WebKit Commit Bot 2018-05-06 19:09:22 PDT
Comment on attachment 339694 [details]
Patch

Clearing flags on attachment: 339694

Committed r231401: <https://trac.webkit.org/changeset/231401>
Comment 7 WebKit Commit Bot 2018-05-06 19:09:23 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-05-06 19:10:19 PDT
<rdar://problem/40013012>