LayoutTests:
authorddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Jan 2007 05:28:35 +0000 (05:28 +0000)
committerddkilzer <ddkilzer@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Jan 2007 05:28:35 +0000 (05:28 +0000)
commit35a7390da1d70397f35fb8c8e29969b5836532f4
treeb38a946901e858a98fe1861e9b3e779eb62b315d
parent3d735c405adf0f6da21f7451ba2cce65532b217a
LayoutTests:

        Reviewed by Hyatt.

        - test and updated results for http://bugs.webkit.org/show_bug.cgi?id=5164
          Non-integer percentages are incorrectly rounded down in Safari

        * css2.1/t0804-c5507-padn-r-00-c-ag-expected.checksum:
        * css2.1/t0804-c5507-padn-r-00-c-ag-expected.png:
        * css2.1/t0804-c5507-padn-r-00-c-ag-expected.txt:
        * css2.1/t0804-c5509-padn-l-00-b-ag-expected.checksum:
        * css2.1/t0804-c5509-padn-l-00-b-ag-expected.png:
        * css2.1/t0804-c5509-padn-l-00-b-ag-expected.txt:
        * css2.1/t09-c5526c-display-00-e-expected.checksum:
        * css2.1/t09-c5526c-display-00-e-expected.png:
        * css2.1/t09-c5526c-display-00-e-expected.txt:
        * fast/block/basic/011-expected.checksum:
        * fast/block/basic/011-expected.png:
        * fast/block/basic/011-expected.txt:
        * fast/css/percentage-non-integer-expected.checksum: Added.
        * fast/css/percentage-non-integer-expected.png: Added.
        * fast/css/percentage-non-integer-expected.txt: Added.
        * fast/css/percentage-non-integer.html: Added.
        * tables/mozilla/bugs/bug4385-expected.checksum:
        * tables/mozilla/bugs/bug4385-expected.png:
        * tables/mozilla/bugs/bug4385-expected.txt:
        * tables/mozilla_expected_failures/core/col_span2-expected.checksum:
        * tables/mozilla_expected_failures/core/col_span2-expected.txt:

WebCore:

        Reviewed by Hyatt.

        - fix http://bugs.webkit.org/show_bug.cgi?id=5164
          Non-integer percentages are incorrectly rounded down in Safari

        Test: fast/css/percentage-non-integer.html

        Added floating point constructor and accessors to Length for use with
        Percent lengths only. The raw value of a percent length is the integer
        part of a constant multiple of the original double value. The constant
        is percentScaleFactor, which is currently 128.

        Added assertions that the correct constructors and accessors are used
        depending on the type: the double-based percent(), setValue() and Length()
        for the Percent type, and the integer-based value(), setValue() and Length()
        for all other types.

        calcValue() and calcMinValue() work the same as before, regardless of the
        type.

        Added helpers for testing if the value is 0, positive, negative or undefined
        without having to check the type first.

        Added raw value accessors. These are useful for doing integer math and
        comparisons with scaled percent values or doing Length type-agnostic math.

        Changed the rest of the code to use the appropriate accessors and helpers.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::valueForLength):
        (WebCore::primitiveValueFromLength):
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
        * css/cssstyleselector.cpp:
        (WebCore::convertToLength):
        (WebCore::CSSStyleSelector::applyProperty):
        (WebCore::CSSStyleSelector::mapBackgroundSize):
        (WebCore::CSSStyleSelector::mapBackgroundXPosition):
        (WebCore::CSSStyleSelector::mapBackgroundYPosition):
        * platform/StringImpl.cpp:
        (WebCore::parseLength):
        * rendering/AutoTableLayout.cpp:
        (WebCore::AutoTableLayout::recalcColumn):
        (WebCore::AutoTableLayout::fullRecalc):
        (WebCore::AutoTableLayout::calcMinMaxWidth):
        (WebCore::AutoTableLayout::calcEffectiveWidth):
        (WebCore::AutoTableLayout::layout):
        (WebCore::AutoTableLayout::calcPercentages):
        * rendering/FixedTableLayout.cpp:
        (WebCore::FixedTableLayout::calcWidthArray):
        (WebCore::FixedTableLayout::layout):
        * rendering/Length.h:
        (WebCore::Length::Length):
        (WebCore::Length::value):
        (WebCore::Length::rawValue):
        (WebCore::Length::percent):
        (WebCore::Length::setValue):
        (WebCore::Length::setRawValue):
        (WebCore::Length::calcValue):
        (WebCore::Length::calcMinValue):
        (WebCore::Length::isUndefined):
        (WebCore::Length::isZero):
        (WebCore::Length::isPositive):
        (WebCore::Length::isNegative):
        * rendering/RenderBR.cpp:
        (WebCore::RenderBR::lineHeight):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::isSelfCollapsingBlock):
        * rendering/RenderBox.cpp:
        (WebCore::cacluateBackgroundSize):
        (WebCore::RenderBox::calcWidth):
        (WebCore::RenderBox::calcHeight):
        (WebCore::RenderBox::calcReplacedWidth):
        (WebCore::RenderBox::calcReplacedHeight):
        (WebCore::RenderBox::calcAbsoluteHorizontal):
        (WebCore::RenderBox::calcAbsoluteVertical):
        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::allowedChildFlex):
        * rendering/RenderFlow.cpp:
        (WebCore::RenderFlow::lineHeight):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::calcReplacedWidth):
        (WebCore::RenderImage::calcReplacedHeight):
        * rendering/RenderLayer.cpp:
        (WebCore::Marquee::direction):
        (WebCore::Marquee::start):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
        (WebCore::RenderObject::lineHeight):
        * rendering/RenderSlider.cpp:
        (WebCore::RenderSlider::layout): Added FIXMEs.
        * rendering/RenderStyle.h:
        (WebCore::LengthBox::nonZero):
        (WebCore::RenderStyle::initialLineHeight):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::calcWidth):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::addCell):
        (WebCore::RenderTableSection::layoutRows):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
41 files changed:
LayoutTests/ChangeLog
LayoutTests/css2.1/t0804-c5507-padn-r-00-c-ag-expected.checksum
LayoutTests/css2.1/t0804-c5507-padn-r-00-c-ag-expected.png
LayoutTests/css2.1/t0804-c5507-padn-r-00-c-ag-expected.txt
LayoutTests/css2.1/t0804-c5509-padn-l-00-b-ag-expected.checksum
LayoutTests/css2.1/t0804-c5509-padn-l-00-b-ag-expected.png
LayoutTests/css2.1/t0804-c5509-padn-l-00-b-ag-expected.txt
LayoutTests/css2.1/t09-c5526c-display-00-e-expected.checksum
LayoutTests/css2.1/t09-c5526c-display-00-e-expected.png
LayoutTests/css2.1/t09-c5526c-display-00-e-expected.txt
LayoutTests/fast/block/basic/011-expected.checksum
LayoutTests/fast/block/basic/011-expected.png
LayoutTests/fast/block/basic/011-expected.txt
LayoutTests/fast/css/percentage-non-integer-expected.checksum [new file with mode: 0644]
LayoutTests/fast/css/percentage-non-integer-expected.png [new file with mode: 0644]
LayoutTests/fast/css/percentage-non-integer-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/percentage-non-integer.html [new file with mode: 0644]
LayoutTests/tables/mozilla/bugs/bug4385-expected.checksum
LayoutTests/tables/mozilla/bugs/bug4385-expected.png
LayoutTests/tables/mozilla/bugs/bug4385-expected.txt
LayoutTests/tables/mozilla_expected_failures/core/col_span2-expected.checksum
LayoutTests/tables/mozilla_expected_failures/core/col_span2-expected.txt
WebCore/ChangeLog
WebCore/css/CSSComputedStyleDeclaration.cpp
WebCore/css/cssstyleselector.cpp
WebCore/platform/StringImpl.cpp
WebCore/rendering/AutoTableLayout.cpp
WebCore/rendering/FixedTableLayout.cpp
WebCore/rendering/Length.h
WebCore/rendering/RenderBR.cpp
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderBox.cpp
WebCore/rendering/RenderFlexibleBox.cpp
WebCore/rendering/RenderFlow.cpp
WebCore/rendering/RenderImage.cpp
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderSlider.cpp
WebCore/rendering/RenderStyle.h
WebCore/rendering/RenderTable.cpp
WebCore/rendering/RenderTableSection.cpp