Bug 98692 - Modify LayoutState ASSERTS to support SATURATED_LAYOUT_ARITHMETIC
Summary: Modify LayoutState ASSERTS to support SATURATED_LAYOUT_ARITHMETIC
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Emil A Eklund
URL:
Keywords:
Depends on:
Blocks: 95053
  Show dependency treegraph
 
Reported: 2012-10-08 15:02 PDT by Emil A Eklund
Modified: 2012-10-23 09:23 PDT (History)
6 users (show)

See Also:


Attachments
Patch (6.70 KB, patch)
2012-10-08 15:04 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff
Patch for landing (6.72 KB, patch)
2012-10-22 10:21 PDT, Emil A Eklund
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emil A Eklund 2012-10-08 15:02:44 PDT
We currently overflow/wrap when computing the delta in RenderBlock::setLogicalTopForChild in cases where we have an element width a width or height exceeding maxLayoutUnit. When the delta is later added back in RenderBlock::layoutBlockChild the number wraps again getting us back to the correct value.

With SATURATED_LAYOUT_ARITHMETIC enabled the values no longer wraps, which seems like the correct thing to do however this causes the compare to fail for obvious reasons. By accounting for this we can keep the asserts (which have proven very helpful) even when SATURATED_LAYOUT_ARITHMETIC is turned on.
Comment 1 Emil A Eklund 2012-10-08 15:04:00 PDT
Created attachment 167625 [details]
Patch
Comment 2 Emil A Eklund 2012-10-09 13:31:38 PDT
Eric, would you mind reviewing this?
Comment 3 Eric Seidel (no email) 2012-10-09 13:33:47 PDT
Mitz is the original author of LayoutDelta and LayoutState and is your best reviewer here.
Comment 4 Emil A Eklund 2012-10-09 13:35:09 PDT
Great, thanks!
Comment 5 Emil A Eklund 2012-10-19 12:08:03 PDT
Mitz, any chance you could take a look at this in the next couple of days? Would like to get your feedback on the approach.
Comment 6 mitz 2012-10-21 17:38:30 PDT
Comment on attachment 167625 [details]
Patch

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

> Source/WebCore/ChangeLog:10
> +        element width a width or height exceeding maxLayoutUnit. When

Typo: “width a width”
Comment 7 Emil A Eklund 2012-10-22 09:32:48 PDT
Thank you!
Comment 8 Emil A Eklund 2012-10-22 10:21:57 PDT
Created attachment 169935 [details]
Patch for landing
Comment 9 WebKit Review Bot 2012-10-22 10:47:00 PDT
Comment on attachment 169935 [details]
Patch for landing

Clearing flags on attachment: 169935

Committed r132105: <http://trac.webkit.org/changeset/132105>
Comment 10 WebKit Review Bot 2012-10-22 10:47:03 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Darin Adler 2012-10-22 11:57:38 PDT
Comment on attachment 169935 [details]
Patch for landing

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

> Source/WebCore/rendering/LayoutState.cpp:39
> +    : m_clipped(false)

Why make this change? m_clipped is set unconditionally below. Just for #if convenience?

> Source/WebCore/rendering/LayoutState.cpp:43
> +#if !ASSERT_DISABLED && ENABLE(SATURATED_LAYOUT_ARITHMETIC)
> +    , m_layoutDeltaXSaturated(false)
> +    , m_layoutDeltaYSaturated(false)
> +#endif

Why initialize these here since they are unconditionally set in the function body below? This makes things more ugly for no real reason.
Comment 12 Emil A Eklund 2012-10-22 12:02:23 PDT
(In reply to comment #11)
> (From update of attachment 169935 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=169935&action=review
> 
> > Source/WebCore/rendering/LayoutState.cpp:39
> > +    : m_clipped(false)
> 
> Why make this change? m_clipped is set unconditionally below. Just for #if convenience?

Got a compiler warning about out of order initialization without it.

> 
> > Source/WebCore/rendering/LayoutState.cpp:43
> > +#if !ASSERT_DISABLED && ENABLE(SATURATED_LAYOUT_ARITHMETIC)
> > +    , m_layoutDeltaXSaturated(false)
> > +    , m_layoutDeltaYSaturated(false)
> > +#endif
> 
> Why initialize these here since they are unconditionally set in the function body below? This makes things more ugly for no real reason.

You are right, these are not needed. I'll remove them.

Thanks.
Comment 13 Darin Adler 2012-10-22 17:59:15 PDT
Comment on attachment 169935 [details]
Patch for landing

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

>>> Source/WebCore/rendering/LayoutState.cpp:39
>>> +    : m_clipped(false)
>> 
>> Why make this change? m_clipped is set unconditionally below. Just for #if convenience?
> 
> Got a compiler warning about out of order initialization without it.

I don’t understand. Despite you reporting that, I am pretty sure you can remove this without creating a warning, particularly now that you have removed the initialization of the two new fields.

This constructor should revert to exactly how it was before.
Comment 14 Emil A Eklund 2012-10-23 09:23:22 PDT
(In reply to comment #13)
> I don’t understand. Despite you reporting that, I am pretty sure you can remove this without creating a warning, particularly now that you have removed the initialization of the two new fields.

You are right, without the (unnecessary) initialization it is not needed. Reverted back to how it was before in r132233.

Thanks.