Skip to content
  • rniwa@webkit.org's avatar
    WebCore: · 076531a0
    rniwa@webkit.org authored
    2009-07-22  Ryosuke Niwa  <rniwa@webkit.org>
    
            Reviewed by Eric Seidel.
    
            execCommand('underline' / 'strikeThrough') doesn't work properly with multiple styles in text-decoration
            https://bugs.webkit.org/show_bug.cgi?id=27476
    
            executeStrikethrough and executeUnderline were toggling between "line-through" / "underline" and "none".
            This patch adds executeToggleStyleInList that toggles a style in CSSValueList instead of toggling the entire value.
            It modifies CSSComputedStyleDeclaration to return CSSValueList instead of CSSPrimitiveValue for text decorations,
            and adds removeAll member function to CSSValueList.
    
            Tests: editing/execCommand/toggle-text-decorations.html
                   fast/css/getComputedStyle/getComputedStyle-text-decoration.html
    
            * css/CSSComputedStyleDeclaration.cpp:
            (WebCore::renderTextDecorationFlagsToCSSValue): Creates a CSSValueList
            (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Returns a CSSValueList instead of CSSValue
            * css/CSSParser.cpp:
            (WebCore::CSSParser::parseValue): Text decorations are space separated instead of comma separated
            * css/CSSValueList.cpp:
            (WebCore::CSSValueList::removeAll): Removes all values that match the specified value
            * css/CSSValueList.h:
            * editing/EditorCommand.cpp:
            (WebCore::applyCommandToFrame): Apply style to a frame using specified command
            (WebCore::executeApplyStyle): Uses applyCommandToFrame
            (WebCore::executeToggleStyleInList): Uses applyCommandToFrame
            (WebCore::executeToggleStyle): Toggles a style in CSSValueList
            (WebCore::executeStrikethrough): Uses executeToggleStyleInList
            (WebCore::executeUnderline): Uses executeToggleStyleInList
    
    LayoutTests:
    
    2009-07-22  Ryosuke Niwa  <rniwa@webkit.org>
    
            Reviewed by Eric Seidel.
    
            execCommand('underline' / 'strikeThrough') doesn't work properly with multiple styles in text-decoration
            https://bugs.webkit.org/show_bug.cgi?id=27476
    
            toggle-text-decorations checks whether we can toggle text decorations with multiple styles properly.
            e.g. execCommand("underline") should modify "text-decoration: underline overline" to "text-decoration: overline"
    
            getComputedStyle-text-decorations checks whether the CSS value of text decoration and its computed style are
            both space-separated CSSValueList instead of CSSPrimitiveValue or comma-separated CSSValueList.
    
            * editing/execCommand/resources/toggle-text-decorations.js: Added.
            (testSingleToggle):
            * editing/execCommand/toggle-text-decorations-expected.txt: Added.
            * editing/execCommand/toggle-text-decorations.html: Added.
            * fast/css/getComputedStyle/getComputedStyle-text-decoration-expected.txt: Added.
            * fast/css/getComputedStyle/getComputedStyle-text-decoration.html: Added.
            * fast/css/getComputedStyle/resources: Added.
            * fast/css/getComputedStyle/resources/TEMPLATE.html: Added.
            * fast/css/getComputedStyle/resources/getComputedStyle-text-decoration.js: Added.
            (expect):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    076531a0