Bug 98692

Summary: Modify LayoutState ASSERTS to support SATURATED_LAYOUT_ARITHMETIC
Product: WebKit Reporter: Emil A Eklund <eae>
Component: Layout and RenderingAssignee: Emil A Eklund <eae>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, inferno, leviw, mitz, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 95053    
Attachments:
Description Flags
Patch
none
Patch for landing none

Emil A Eklund
Reported 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.
Attachments
Patch (6.70 KB, patch)
2012-10-08 15:04 PDT, Emil A Eklund
no flags
Patch for landing (6.72 KB, patch)
2012-10-22 10:21 PDT, Emil A Eklund
no flags
Emil A Eklund
Comment 1 2012-10-08 15:04:00 PDT
Emil A Eklund
Comment 2 2012-10-09 13:31:38 PDT
Eric, would you mind reviewing this?
Eric Seidel (no email)
Comment 3 2012-10-09 13:33:47 PDT
Mitz is the original author of LayoutDelta and LayoutState and is your best reviewer here.
Emil A Eklund
Comment 4 2012-10-09 13:35:09 PDT
Great, thanks!
Emil A Eklund
Comment 5 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.
mitz
Comment 6 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”
Emil A Eklund
Comment 7 2012-10-22 09:32:48 PDT
Thank you!
Emil A Eklund
Comment 8 2012-10-22 10:21:57 PDT
Created attachment 169935 [details] Patch for landing
WebKit Review Bot
Comment 9 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>
WebKit Review Bot
Comment 10 2012-10-22 10:47:03 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 11 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.
Emil A Eklund
Comment 12 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.
Darin Adler
Comment 13 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.
Emil A Eklund
Comment 14 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.
Note You need to log in before you can comment on or make changes to this bug.