Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Issue 10349004: Revert 115573 - Move Length and CSS length computation to float (Closed)

Created:
8 years, 7 months ago by karen
Modified:
8 years, 7 months ago
Reviewers:
eae
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/1123/
Visibility:
Public.

Description

Revert 115573 - Move Length and CSS length computation to float https://bugs.webkit.org/show_bug.cgi?id=84801 Source/WebCore: Patch by Emil A Eklund <eae@chromium.org>; and Levi Weintraub <leviw@chromium.org>; on 2012-04-26 Reviewed by Eric Seidel. Change Length and CSS length computation to floating point. This gets us closer to the goal of supporting subpixel layout and improves precision for SVG which already uses floating point for its layout. This change makes computedStyle return fractional values for pixel values if a fraction is specified. It also changes the result of computations where two or more values with fractional precision. Prior to this change the result of Length(2.9) + Length(2.9) would be 4 as each value would be floored. With this change the result is 5 as the addition is done with floating point precision and then the result will be floored. Once we enable subpixel layout the resulting value in this example would be 5.8. Updated existing layout tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::zoomAdjustedPixelValue): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::computeLength): * css/CSSPrimitiveValue.h: (WebCore): (WebCore::roundForImpreciseConversion): Add specialized float version of roundForImpreciseConversion that matches the int versions rounding logic. If a value is sufficiently close to the next integer round it up to ensure that a style rule such as "width: 4.999px" evaluates to 5px instead of 4px. This is needed as, although Lengths are using floating point, the layout system still uses integer precision and floors the Length values. This will change once we move to FractionalLayoutUnits but for now this is needed to ensure compatibility with the existing system and tests. Without this specialized rounding logic we fail a handful of tests including acid3. * platform/Length.h: (WebCore::Length::value): (Length): (WebCore::Length::intValue): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::styleOrColLogicalWidth): LayoutTests: Reviewed by Eric Seidel. Change Length and CSS length computation to floating point. This gets us closer to the goal of supporting subpixel layout and improves precision for SVG which already uses floating point for its layout. This change makes computedStyle return fractional values for pixel values if a fraction is specified. It also changes the result of computations where two or more values with fractional precision. Prior to this change the result of Length(2.9) + Length(2.9) would be 4 as each value would be floored. with this change the result is 5 as the addition is done with floating point precision and then the result will be floored. Once we enable subpixel layout the resulting value in this example would be 5.8. * fast/dom/length-attribute-mapping-expected.txt: * fast/dom/length-attribute-mapping.html: * platform/mac-snowleopard/fast/forms/001-expected.png: * platform/mac-snowleopard/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.png: * platform/mac/fast/forms/001-expected.txt: * platform/mac/fast/html/details-position-expected.png: * platform/mac/fast/html/details-position-expected.txt: * platform/mac/fast/replaced/width100percent-checkbox-expected.png: * platform/mac/fast/replaced/width100percent-checkbox-expected.txt: * platform/mac/fast/replaced/width100percent-radio-expected.png: * platform/mac/fast/replaced/width100percent-radio-expected.txt: * platform/mac/mathml/presentation/fractions-expected.png: * platform/mac/mathml/presentation/fractions-expected.txt: * platform/mac/mathml/presentation/fractions-vertical-alignment-expected.png: * platform/mac/mathml/presentation/fractions-vertical-alignment-expected.txt: * platform/mac/mathml/presentation/mo-stretch-expected.png: * platform/mac/mathml/presentation/mo-stretch-expected.txt: * platform/mac/mathml/presentation/subsup-expected.png: * platform/mac/mathml/presentation/subsup-expected.txt: * platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt: * platform/mac/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt: * platform/mac/tables/mozilla/bugs/bug1318-expected.png: * platform/mac/tables/mozilla/bugs/bug1318-expected.txt: TBR=eae@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=115919

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+173 lines, -182 lines) Patch
M LayoutTests/fast/dom/length-attribute-mapping.html View 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/length-attribute-mapping-expected.txt View 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/platform/mac-snowleopard/fast/forms/001-expected.png View Binary file 0 comments Download
M LayoutTests/platform/mac-snowleopard/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.png View Binary file 0 comments Download
M LayoutTests/platform/mac/fast/forms/001-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/platform/mac/fast/html/details-position-expected.png View Binary file 0 comments Download
M LayoutTests/platform/mac/fast/html/details-position-expected.txt View 2 chunks +4 lines, -4 lines 0 comments Download
M LayoutTests/platform/mac/fast/replaced/width100percent-checkbox-expected.png View Binary file 0 comments Download
M LayoutTests/platform/mac/fast/replaced/width100percent-checkbox-expected.txt View 1 chunk +7 lines, -7 lines 0 comments Download
M LayoutTests/platform/mac/fast/replaced/width100percent-radio-expected.png View Binary file 0 comments Download
M LayoutTests/platform/mac/fast/replaced/width100percent-radio-expected.txt View 1 chunk +7 lines, -7 lines 0 comments Download
M LayoutTests/platform/mac/mathml/presentation/fractions-expected.png View Binary file 0 comments Download
M LayoutTests/platform/mac/mathml/presentation/fractions-expected.txt View 3 chunks +24 lines, -24 lines 0 comments Download
M LayoutTests/platform/mac/mathml/presentation/fractions-vertical-alignment-expected.png View Binary file 0 comments Download
M LayoutTests/platform/mac/mathml/presentation/fractions-vertical-alignment-expected.txt View 2 chunks +13 lines, -13 lines 0 comments Download
M LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.png View Binary file 0 comments Download
M LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt View 8 chunks +59 lines, -59 lines 0 comments Download
M LayoutTests/platform/mac/mathml/presentation/subsup-expected.txt View 5 chunks +15 lines, -15 lines 0 comments Download
M LayoutTests/platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt View 2 chunks +8 lines, -8 lines 0 comments Download
M LayoutTests/platform/mac/tables/mozilla/bugs/bug1318-expected.png View Binary file 0 comments Download
M LayoutTests/platform/mac/tables/mozilla/bugs/bug1318-expected.txt View 1 chunk +13 lines, -13 lines 0 comments Download
M Source/WebCore/css/CSSComputedStyleDeclaration.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/WebCore/css/CSSPrimitiveValue.h View 1 chunk +3 lines, -14 lines 0 comments Download
M Source/WebCore/css/CSSPrimitiveValue.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/WebCore/platform/Length.h View 2 chunks +8 lines, -6 lines 0 comments Download
M Source/WebCore/rendering/RenderTableCell.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 1 (0 generated)
karen
8 years, 7 months ago (2012-05-03 00:39:34 UTC) #1

          

Powered by Google App Engine
This is Rietveld 408576698