Change FractionalLayoutUnit denominator to 64 to reduce precision loss when convertin...
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Sep 2012 16:25:41 +0000 (16:25 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Sep 2012 16:25:41 +0000 (16:25 +0000)
commitb4b7c22ae256bee49c12f2961592b04e95ef7781
tree87f78dfd9b25fbc15a2a86e232819d159682115f
parente08c508c0eaa12cf815ad128442f78b972498790
Change FractionalLayoutUnit denominator to 64 to reduce precision loss when converting to floating point
https://bugs.webkit.org/show_bug.cgi?id=96139

Reviewed by Eric Seidel.

Source/WebCore:

We currently use a denominator of 60 in FractionalLayoutUnit,
this causes a loss of precision when converting to floating
point.

By changing the denominator to 64 the values can better be
represented as floating point (without loosing any precision for
many values), this in turn allows us to remove the tolerance
hack in the line break logic and avoids problems caused by this
precision for web sites that do their own layout based on
element measurements.

Test: fast/sub-pixel/float-precision.html

* platform/FractionalLayoutUnit.h:
Change denominator to 64.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineWidth::fitsOnLine):
Remove epsilon tolerance hack.

LayoutTests:

Add new precision test and adjust expectations for existing tests as needed.

* fast/sub-pixel/float-precision-expected.html: Added.
* fast/sub-pixel/float-precision.html: Added.
* fast/sub-pixel/float-wrap-with-subpixel-top-expected.html:
* fast/sub-pixel/float-wrap-with-subpixel-top.html:
* fast/sub-pixel/layout-boxes-with-zoom-expected.html:
* fast/sub-pixel/layout-boxes-with-zoom.html:
* fast/sub-pixel/size-of-box-with-zoom-expected.html:
* fast/sub-pixel/size-of-box-with-zoom.html:
* platform/chromium-linux/css1/formatting_model/inline_elements-expected.txt:
* platform/chromium-linux/css2.1/t090501-c414-flt-03-b-g-expected.txt:
* platform/chromium-linux/fast/backgrounds/background-position-parsing-expected.txt:
* platform/chromium-linux/fast/block/margin-collapse/103-expected.txt:
* platform/chromium-linux/fast/borders/border-antialiasing-expected.png:
* platform/chromium-linux/fast/borders/border-radius-huge-assert-expected.png:
* platform/chromium-linux/fast/box-sizing/box-sizing-expected.png:
* platform/chromium-linux/fast/css/bidi-override-in-anonymous-block-expected.txt:
* platform/chromium-linux/fast/css/hsl-color-expected.png:
* platform/chromium-linux/fast/dom/HTMLMeterElement/meter-styles-expected.png:
* platform/chromium-linux/fast/encoding/utf-16-big-endian-expected.txt:
* platform/chromium-linux/fast/encoding/utf-16-little-endian-expected.txt:
* platform/chromium-linux/fast/forms/date/date-appearance-expected.png:
* platform/chromium-linux/fast/forms/form-element-geometry-expected.txt:
* platform/chromium-linux/fast/html/details-add-summary-1-expected.png:
* platform/chromium-linux/fast/html/details-add-summary-10-and-click-expected.png:
* platform/chromium-linux/fast/html/details-add-summary-2-expected.png:
* platform/chromium-linux/fast/html/details-add-summary-3-expected.png:
* platform/chromium-linux/fast/html/details-add-summary-4-expected.png:
* platform/chromium-linux/fast/html/details-add-summary-5-expected.png:
* platform/chromium-linux/fast/html/details-add-summary-6-and-click-expected.png:
* platform/chromium-linux/fast/html/details-add-summary-7-and-click-expected.png:
* platform/chromium-linux/fast/html/details-add-summary-8-and-click-expected.png:
* platform/chromium-linux/fast/html/details-add-summary-9-and-click-expected.png:
* platform/chromium-linux/fast/html/details-marker-style-expected.png:
* platform/chromium-linux/fast/html/details-no-summary1-expected.png:
* platform/chromium-linux/fast/html/details-no-summary3-expected.png:
* platform/chromium-linux/fast/html/details-open-javascript-expected.png:
* platform/chromium-linux/fast/html/details-open1-expected.png:
* platform/chromium-linux/fast/html/details-open3-expected.png:
* platform/chromium-linux/fast/html/details-open5-expected.png:
* platform/chromium-linux/fast/html/details-position-expected.png:
* platform/chromium-linux/fast/html/details-remove-summary-1-expected.png:
* platform/chromium-linux/fast/html/details-remove-summary-2-expected.png:
* platform/chromium-linux/fast/html/details-remove-summary-3-expected.png:
* platform/chromium-linux/fast/html/details-remove-summary-4-and-click-expected.png:
* platform/chromium-linux/fast/html/details-remove-summary-5-and-click-expected.png:
* platform/chromium-linux/fast/html/details-remove-summary-6-and-click-expected.png:
* platform/chromium-linux/fast/html/details-writing-mode-expected.png:
* platform/chromium-linux/fast/multicol/vertical-rl/float-multicol-expected.png:
* platform/chromium-linux/fast/parser/style-script-head-test-expected.txt:
* platform/chromium-linux/fast/text/line-breaks-expected.txt:
* platform/chromium-linux/svg/custom/use-css-no-effect-on-shadow-tree-expected.png:
* platform/chromium-linux/svg/custom/viewBox-hit-expected.png:
* platform/chromium-linux/svg/wicd/rightsizing-grid-expected.png:
* platform/chromium-linux/svg/wicd/test-rightsizing-b-expected.png:
* platform/chromium-linux/svg/wicd/test-rightsizing-b-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-background-images-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-hixie-mixed-009-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-mask-with-percentages-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
* platform/chromium-linux/svg/zoom/text/zoom-svg-float-border-padding-expected.png:
* platform/chromium-linux/tables/mozilla/bugs/bug2479-4-expected.txt:
* platform/chromium-linux/tables/mozilla/bugs/bug46480-1-expected.png:
* platform/chromium-linux/tables/mozilla/bugs/bug46480-2-expected.png:
* platform/chromium-win/compositing/visibility/visibility-image-layers-dynamic-expected.txt:
* platform/chromium-win/css1/formatting_model/vertical_formatting-expected.txt:
* platform/chromium-win/css2.1/t080301-c411-vt-mrgn-00-b-expected.txt:
* platform/chromium-win/fast/block/float/shrink-to-avoid-float-complexity-expected.txt:
* platform/chromium-win/fast/css/hsl-color-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-optimums-expected.txt:
* platform/chromium-win/fast/dom/HTMLMeterElement/meter-styles-expected.txt:
* platform/chromium-win/fast/multicol/span/span-as-immediate-child-complex-splitting-expected.txt:
* platform/chromium-win/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt:
* platform/chromium-win/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt:
* platform/chromium-win/fast/multicol/span/span-as-immediate-columns-child-expected.txt:
* platform/chromium-win/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt:
* platform/chromium-win/fast/multicol/span/span-as-nested-columns-child-expected.txt:
* platform/chromium-win/fast/multicol/span/span-margin-collapsing-expected.txt:
* platform/chromium-win/fast/text/whitespace/024-expected.txt:
* platform/chromium-win/svg/wicd/rightsizing-grid-expected.txt:
* platform/chromium-win/svg/zoom/page/zoom-hixie-mixed-009-expected.txt:
* platform/chromium-win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:
* platform/chromium-win/tables/mozilla/bugs/bug2479-1-expected.txt:
* platform/chromium-win/tables/mozilla/other/test3-expected.txt:
* platform/chromium-win/tables/mozilla_expected_failures/bugs/bug91057-expected.txt:
* platform/chromium/fast/css/getComputedStyle/getComputedStyle-margin-percentage-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
100 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/sub-pixel/float-precision-expected.html [new file with mode: 0644]
LayoutTests/fast/sub-pixel/float-precision.html [new file with mode: 0644]
LayoutTests/fast/sub-pixel/float-wrap-with-subpixel-top-expected.html
LayoutTests/fast/sub-pixel/float-wrap-with-subpixel-top.html
LayoutTests/fast/sub-pixel/large-sizes-expected.txt
LayoutTests/fast/sub-pixel/large-sizes.html
LayoutTests/fast/sub-pixel/layout-boxes-with-zoom-expected.html
LayoutTests/fast/sub-pixel/layout-boxes-with-zoom.html
LayoutTests/fast/sub-pixel/size-of-box-with-zoom-expected.html
LayoutTests/fast/sub-pixel/size-of-box-with-zoom.html
LayoutTests/platform/chromium-linux/css1/formatting_model/inline_elements-expected.txt
LayoutTests/platform/chromium-linux/css2.1/t090501-c414-flt-03-b-g-expected.txt
LayoutTests/platform/chromium-linux/fast/backgrounds/background-position-parsing-expected.txt
LayoutTests/platform/chromium-linux/fast/block/margin-collapse/103-expected.txt
LayoutTests/platform/chromium-linux/fast/borders/border-antialiasing-expected.png
LayoutTests/platform/chromium-linux/fast/borders/border-radius-huge-assert-expected.png
LayoutTests/platform/chromium-linux/fast/box-sizing/box-sizing-expected.png
LayoutTests/platform/chromium-linux/fast/css/bidi-override-in-anonymous-block-expected.txt
LayoutTests/platform/chromium-linux/fast/css/hsl-color-expected.png
LayoutTests/platform/chromium-linux/fast/dom/HTMLMeterElement/meter-styles-expected.png
LayoutTests/platform/chromium-linux/fast/encoding/utf-16-big-endian-expected.txt
LayoutTests/platform/chromium-linux/fast/encoding/utf-16-little-endian-expected.txt
LayoutTests/platform/chromium-linux/fast/forms/date/date-appearance-expected.png
LayoutTests/platform/chromium-linux/fast/forms/form-element-geometry-expected.txt
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-1-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-10-and-click-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-2-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-3-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-4-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-5-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-6-and-click-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-7-and-click-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-8-and-click-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-add-summary-9-and-click-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-marker-style-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-no-summary1-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-no-summary3-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-open-javascript-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-open1-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-open3-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-open5-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-position-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-remove-summary-1-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-remove-summary-2-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-remove-summary-3-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-remove-summary-4-and-click-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-remove-summary-5-and-click-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-remove-summary-6-and-click-expected.png
LayoutTests/platform/chromium-linux/fast/html/details-writing-mode-expected.png
LayoutTests/platform/chromium-linux/fast/multicol/vertical-rl/float-multicol-expected.png
LayoutTests/platform/chromium-linux/fast/parser/style-script-head-test-expected.txt
LayoutTests/platform/chromium-linux/fast/text/line-breaks-expected.txt
LayoutTests/platform/chromium-linux/svg/custom/use-css-no-effect-on-shadow-tree-expected.png
LayoutTests/platform/chromium-linux/svg/custom/viewBox-hit-expected.png
LayoutTests/platform/chromium-linux/svg/wicd/rightsizing-grid-expected.png
LayoutTests/platform/chromium-linux/svg/wicd/test-rightsizing-b-expected.png
LayoutTests/platform/chromium-linux/svg/wicd/test-rightsizing-b-expected.txt
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-background-images-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-hixie-mixed-009-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-mask-with-percentages-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-float-border-padding-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/text/zoom-svg-float-border-padding-expected.png
LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug2479-4-expected.txt
LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug46480-1-expected.png
LayoutTests/platform/chromium-linux/tables/mozilla/bugs/bug46480-2-expected.png
LayoutTests/platform/chromium-win/compositing/visibility/visibility-image-layers-dynamic-expected.txt
LayoutTests/platform/chromium-win/css1/formatting_model/vertical_formatting-expected.txt
LayoutTests/platform/chromium-win/css2.1/t080301-c411-vt-mrgn-00-b-expected.txt
LayoutTests/platform/chromium-win/fast/block/float/overhanging-tall-block-expected.txt
LayoutTests/platform/chromium-win/fast/block/float/shrink-to-avoid-float-complexity-expected.txt
LayoutTests/platform/chromium-win/fast/css/hsl-color-expected.txt
LayoutTests/platform/chromium-win/fast/dom/HTMLMeterElement/meter-optimums-expected.txt
LayoutTests/platform/chromium-win/fast/dom/HTMLMeterElement/meter-styles-expected.txt
LayoutTests/platform/chromium-win/fast/multicol/span/span-as-immediate-child-complex-splitting-expected.txt
LayoutTests/platform/chromium-win/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt
LayoutTests/platform/chromium-win/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt
LayoutTests/platform/chromium-win/fast/multicol/span/span-as-immediate-columns-child-expected.txt
LayoutTests/platform/chromium-win/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt
LayoutTests/platform/chromium-win/fast/multicol/span/span-as-nested-columns-child-expected.txt
LayoutTests/platform/chromium-win/fast/multicol/span/span-margin-collapsing-expected.txt
LayoutTests/platform/chromium-win/fast/text/whitespace/024-expected.txt
LayoutTests/platform/chromium-win/svg/wicd/rightsizing-grid-expected.txt
LayoutTests/platform/chromium-win/svg/zoom/page/zoom-hixie-mixed-009-expected.txt
LayoutTests/platform/chromium-win/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt
LayoutTests/platform/chromium-win/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt
LayoutTests/platform/chromium-win/tables/mozilla/bugs/bug2479-1-expected.txt
LayoutTests/platform/chromium-win/tables/mozilla/other/test3-expected.txt
LayoutTests/platform/chromium-win/tables/mozilla_expected_failures/bugs/bug91057-expected.txt
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/chromium/fast/css/getComputedStyle/getComputedStyle-margin-percentage-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/FractionalLayoutUnit.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp