2011-06-24 Abhishek Arya <inferno@chromium.org>
authorinferno@chromium.org <inferno@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2011 21:45:16 +0000 (21:45 +0000)
committerinferno@chromium.org <inferno@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2011 21:45:16 +0000 (21:45 +0000)
commit34a3727594b45ad1f7bcc680d0742670705a7cf8
treef2d08af534fb5a740348fe360fd27df8f2c8d89c
parent0fa0320f19f41a828a6e5afc5dc9bdc58db80429
2011-06-24  Abhishek Arya  <inferno@chromium.org>

        Reviewed by Darin Adler.

        Match other clampTo* functions in style with clampToInteger(float)
        function.
        https://bugs.webkit.org/show_bug.cgi?id=53449

        * wtf/MathExtras.h:
        (clampToInteger):
        (clampToFloat):
        (clampToPositiveInteger):
2011-06-24  Abhishek Arya  <inferno@chromium.org>

        Reviewed by Darin Adler.

        Add clamping for CSSPrimitiveValues and SVGInlineText font size.
        https://bugs.webkit.org/show_bug.cgi?id=53449

        Test: svg/text/svg-zoom-large-value.xhtml

        * css/CSSPrimitiveValue.cpp:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): add asserts to detect if the
        number created is valid.
        * css/CSSPrimitiveValue.h: add clamping checks to prevent overflows.
        (WebCore::CSSPrimitiveValue::getFloatValue):
        (WebCore::CSSPrimitiveValue::getIntValue):
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize): split into two
        static functions, one specific to CSSStyleSelector and other generic to help
        in clamping font size for other callers like svg text, etc.
        * css/CSSStyleSelector.h:
        * platform/graphics/FontDescription.h: add asserts to detect if the new font
        size is valid.
        (WebCore::FontDescription::setComputedSize):
        (WebCore::FontDescription::setSpecifiedSize):
        * rendering/svg/RenderSVGInlineText.cpp:
        (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle): use the new helper
        from CSSStyleSelector to help in clamping new scaled font size. do not use
        "smart minimum" since svg allows really small unreadable fonts (tested by existing
        layout tests). Document's minimum font size clamp (0 in my case) and harmless epsilon
        check in CSSStyleSelector function should still hold for svg.
2011-06-24  Abhishek Arya  <inferno@chromium.org>

        Reviewed by Darin Adler.

        Tests that font size for svg text zoom is clamped and we do not
        crash on ASSERT(isfinite(s)) in FontDescription.h
        https://bugs.webkit.org/show_bug.cgi?id=53449

        * svg/text/svg-zoom-large-value-expected.txt: Added.
        * svg/text/svg-zoom-large-value.xhtml: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/text/svg-zoom-large-value-expected.txt [new file with mode: 0644]
LayoutTests/svg/text/svg-zoom-large-value.xhtml [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wtf/MathExtras.h
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/CSSStyleSelector.h
Source/WebCore/platform/graphics/FontDescription.h
Source/WebCore/rendering/svg/RenderSVGInlineText.cpp