RESOLVED FIXED 107208
LayoutUnit should round half consistently, not away from zero
https://bugs.webkit.org/show_bug.cgi?id=107208
Summary LayoutUnit should round half consistently, not away from zero
Levi Weintraub
Reported 2013-01-17 17:44:58 PST
The current implementation of the LayoutUnit::round() method rounds away from zero. Particularly when dealing with Layers, when we round the translate to the graphics context and pass only the sub-pixel fraction to the rendering tree, this leads to bad behavior.
Attachments
Patch (124.71 KB, patch)
2013-01-17 18:00 PST, Levi Weintraub
no flags
Suggested api test changes (992 bytes, patch)
2013-01-17 19:36 PST, Emil A Eklund
no flags
Patch for landing (127.39 KB, patch)
2013-01-18 11:02 PST, Levi Weintraub
no flags
Patch for landing (127.36 KB, patch)
2013-01-18 11:45 PST, Levi Weintraub
no flags
Levi Weintraub
Comment 1 2013-01-17 18:00:47 PST
WebKit Review Bot
Comment 2 2013-01-17 18:07:18 PST
Attachment 183334 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1 LayoutTests/platform/chromium-linux/fast/regions/overflow-size-change-in-variable-width-regions-expected.png:0: Have to enable auto props in the subversion config file (/home/alancutter/.subversion/config "enable-auto-props = yes"). Have to set the svn:mime-type in the subversion config file (/home/alancutter/.subversion/config "*.png = svn:mime-type=image/png"). [image/png] [5] Total errors found: 1 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Eric Seidel (no email)
Comment 3 2013-01-17 18:35:22 PST
Comment on attachment 183334 [details] Patch I assume this makes us more like the pre-subpixel behavior?
Build Bot
Comment 4 2013-01-17 19:00:50 PST
Comment on attachment 183334 [details] Patch Attachment 183334 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://queues.webkit.org/results/15949106 New failing tests: fast/regions/overflow-size-change-with-stacking-context.html fast/regions/overflow-size-change-in-variable-width-regions.html fast/regions/overflow-moving-below-floats-in-variable-width-regions.html
Emil A Eklund
Comment 5 2013-01-17 19:34:25 PST
Comment on attachment 183334 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=183334&action=review > Source/WebCore/platform/LayoutUnit.h:231 > + return saturatedSubtraction(rawValue(), 1 + kEffectiveFixedPointDenominator / 2) / kEffectiveFixedPointDenominator; For non-saturated you do 1 + value - (denominator/2) yet for saturated you do value - 1 + (denominator/2). How about doing the operations in the same order for both? return (saturatedSubtraction(rawValue(), kEffectiveFixedPointDenominator / 2) + 1) / kEffectiveFixedPointDenominator; and return (m_value - (kEffectiveFixedPointDenominator / 2) + 1) / kEffectiveFixedPointDenominator; perhaps? > Source/WebCore/rendering/RenderLayer.cpp:-3655 > - if (this == localPaintingInfo.rootLayer) Nice! Glad to see this go! Also, you'll need to update Tools/TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp
Emil A Eklund
Comment 6 2013-01-17 19:36:08 PST
Created attachment 183354 [details] Suggested api test changes
Build Bot
Comment 7 2013-01-17 20:05:05 PST
Comment on attachment 183334 [details] Patch Attachment 183334 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/15943286 New failing tests: fast/regions/overflow-size-change-with-stacking-context.html fast/regions/overflow-size-change-in-variable-width-regions.html fast/regions/overflow-moving-below-floats-in-variable-width-regions.html
Build Bot
Comment 8 2013-01-17 21:24:07 PST
Comment on attachment 183334 [details] Patch Attachment 183334 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/15940471 New failing tests: fast/regions/overflow-size-change-with-stacking-context.html fast/regions/overflow-size-change-in-variable-width-regions.html fast/regions/overflow-moving-below-floats-in-variable-width-regions.html
Levi Weintraub
Comment 9 2013-01-18 11:02:45 PST
Created attachment 183510 [details] Patch for landing
WebKit Review Bot
Comment 10 2013-01-18 11:37:54 PST
Comment on attachment 183510 [details] Patch for landing Rejecting attachment 183510 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 cwd: /mnt/git/webkit-commit-queue Last 500 characters of output: xpectations:1286: Path does not exist. [test/expectations] [5] Total errors found: 6 in 2 files Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/platform/chromium/TestExpectat..." exit_code: 1 s:1286: expecting "[", "#", or end of line instead of "fast/regions/overflow-size-change-with-stacking-context.html" [test/expectations] [5] LayoutTests/platform/mac/TestExpectations:1286: Path does not exist. [test/expectations] [5] Total errors found: 6 in 2 files Full output: http://queues.webkit.org/results/15941771
Levi Weintraub
Comment 11 2013-01-18 11:45:10 PST
Created attachment 183521 [details] Patch for landing
WebKit Review Bot
Comment 12 2013-01-18 12:23:25 PST
Comment on attachment 183521 [details] Patch for landing Clearing flags on attachment: 183521 Committed r140192: <http://trac.webkit.org/changeset/140192>
WebKit Review Bot
Comment 13 2013-01-18 12:23:30 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.