WebCore:
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2008 04:04:31 +0000 (04:04 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Jan 2008 04:04:31 +0000 (04:04 +0000)
commit465c88ea9a05df1ee4397c7234dd084b68f74cd7
tree075edd9698f22e5455149dc5f85b6b1c238b1808
parentf8fcfb4d81639a9b789aa5fb77531b7d6d97e54f
WebCore:

        Reviewed by Oliver Hunt.

        - Match the spec when calling getFloatValue, getStringValue, getCounterValue,
          getRectValue and getRGBColorValue of CSSPrimitiveValue by throwing exceptions
          if the type of the CSSPrimitiveValue is not the same as the type requested.
        - Fix the intermittent assertion failure seen in svg/css/glyph-orientation-rounding-test.xhtml

        Test: fast/css/CSSPrimitiveValue-exceptions.html

        * css/CSSPrimitiveValue.cpp:
        (WebCore::CSSPrimitiveValue::getDoubleValue):
        (WebCore::CSSPrimitiveValue::getStringValue):
        (WebCore::CSSPrimitiveValue::getCounterValue):
        (WebCore::CSSPrimitiveValue::getRectValue):
        (WebCore::CSSPrimitiveValue::getRGBColorValue):
        (WebCore::CSSPrimitiveValue::getPairValue):
        * css/CSSPrimitiveValue.h:
        (WebCore::CSSPrimitiveValue::getFloatValue):
        (WebCore::CSSPrimitiveValue::getIntValue):
        (WebCore::CSSPrimitiveValue::getCounterValue):
        (WebCore::CSSPrimitiveValue::getRectValue):
        (WebCore::CSSPrimitiveValue::getDashboardRegionValue):
        * css/CSSPrimitiveValue.idl:

LayoutTests:

        Reviewed by Oliver Hunt.

        Throw exceptions for the CSSPrimitiveValue getters, matching the spec.

        * fast/css/CSSPrimitiveValue-exceptions-expected.txt: Added.
        * fast/css/CSSPrimitiveValue-exceptions.html: Added.
        * fast/css/resources/CSSPrimitiveValue-exceptions.js: Added.
        * fast/dom/prototypes.html:
        * fast/dom/wrapper-classes.html:
        * platform/mac/fast/dom/wrapper-classes-objc.html:
        * svg/css/glyph-orientation-rounding-test-expected.txt:
        * svg/css/glyph-orientation-rounding-test.xhtml: Pass in a unit so this doesn't throw.
        This patch also fixes the associated intermittent failure seen in this test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/CSSPrimitiveValue-exceptions-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/CSSPrimitiveValue-exceptions.html [new file with mode: 0644]
LayoutTests/fast/css/resources/CSSPrimitiveValue-exceptions.js [new file with mode: 0644]
LayoutTests/fast/dom/prototypes.html
LayoutTests/fast/dom/wrapper-classes.html
LayoutTests/platform/mac/fast/dom/wrapper-classes-objc.html
LayoutTests/svg/css/glyph-orientation-rounding-test-expected.txt
LayoutTests/svg/css/glyph-orientation-rounding-test.xhtml
WebCore/ChangeLog
WebCore/css/CSSPrimitiveValue.cpp
WebCore/css/CSSPrimitiveValue.h
WebCore/css/CSSPrimitiveValue.idl