WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
88918
Cast paddings to int in RenderTableCell
https://bugs.webkit.org/show_bug.cgi?id=88918
Summary
Cast paddings to int in RenderTableCell
Emil A Eklund
Reported
2012-06-12 14:23:45 PDT
Table layout uses integers throughout (as documented on
https://trac.webkit.org/wiki/LayoutUnit
) yet the TableCell paddingLeft/Right/Top/Bottom methods returns LayoutUnits. This causes inconsistent rounding as some call sites cast the numbers to ints before doing computation and others do computation before casting. By changing the methods to always cast the padding values to int we ensure consistent padding calculations. Ideally we'd change the type of the return value for the methods but as they are overriden that would likely cause more confusion.
Attachments
Patch
(498.95 KB, patch)
2012-06-12 14:39 PDT
,
Emil A Eklund
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Emil A Eklund
Comment 1
2012-06-12 14:39:15 PDT
Created
attachment 147165
[details]
Patch
Emil A Eklund
Comment 2
2012-06-12 17:06:46 PDT
FYI: The chromium test expectation changes here (apart from the new test) reflects us going back to rendering that more closely matches the other platforms (and in most cases matches how they looked in chromium before we turned on subpixel layout).
Levi Weintraub
Comment 3
2012-06-13 10:01:18 PDT
Comment on
attachment 147165
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=147165&action=review
You need to also update the test expectations files to prevent the bots from going red on non-linux platforms. With that r=me.
> Source/WebCore/rendering/RenderTableCell.cpp:228 > - return computedCSSPaddingBefore() + intrinsicPaddingBefore(); > + return static_cast<int>(computedCSSPaddingBefore() + intrinsicPaddingBefore());
Only casting the computedCSSPaddingBefore would save unnecessarily promoting intrinsicPaddingBefore to a LayoutUnit.
Emil A Eklund
Comment 4
2012-06-13 13:34:03 PDT
(In reply to
comment #3
)
> (From update of
attachment 147165
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=147165&action=review
> > You need to also update the test expectations files to prevent the bots from going red on non-linux platforms. With that r=me.
Will do, I really wish there was a better way to do this.
> > > Source/WebCore/rendering/RenderTableCell.cpp:228 > > - return computedCSSPaddingBefore() + intrinsicPaddingBefore(); > > + return static_cast<int>(computedCSSPaddingBefore() + intrinsicPaddingBefore()); > > Only casting the computedCSSPaddingBefore would save unnecessarily promoting intrinsicPaddingBefore to a LayoutUnit.
Ah, good idea.
Emil A Eklund
Comment 5
2012-06-14 23:07:41 PDT
Committed
r120403
: <
http://trac.webkit.org/changeset/120403
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug