Changeset 95050 in webkit


Ignore:
Timestamp:
Sep 13, 2011 3:31:24 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

For compatibility, execCommand should support deprecated 'useCSS' alias for 'styleWithCSS'
https://bugs.webkit.org/show_bug.cgi?id=36683

Patch by Kiyoto Tamura <owenestea@gmail.com> on 2011-09-13
Reviewed by Ryosuke Niwa.

Source/WebCore:

In addition to supporting the deprecated 'useCSS', 'styleWithCSS' now accepts any argument other than
the boolean false or the case-insensitive string "false". This is per
http://aryeh.name/spec/editing/editing.html#the-stylewithcss-command

Tests: editing/execCommand/style-with-css.html

editing/execCommand/use-css.html

  • editing/EditorCommand.cpp:

(WebCore::executeStyleWithCSS):
(WebCore::executeUseCSS):
(WebCore::createCommandMap):

LayoutTests:

Testing useCSS, the command previously unsupported by WebKit. Also, we are testing
styleWithCSS accepts anything that is not the boolean false or the string "false" as true.
Furthermore, we test that queryCommandValue/State('useCSS') return boolean false and
queryCommandValue/State('useStyleWithCSS') returns booleans (as opposed to 'true'/'false'
strings)

  • editing/execCommand/style-with-css-expected.txt: Added.
  • editing/execCommand/style-with-css.html: Added.
  • editing/execCommand/use-css-expected.txt: Added.
  • editing/execCommand/use-css.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95047 r95050  
     12011-09-13  Kiyoto Tamura  <owenestea@gmail.com>
     2
     3        For compatibility, execCommand should support deprecated 'useCSS' alias for 'styleWithCSS'
     4        https://bugs.webkit.org/show_bug.cgi?id=36683
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Testing useCSS, the command previously unsupported by WebKit. Also, we are testing
     9        styleWithCSS accepts anything that is not the boolean false or the string "false" as true.
     10        Furthermore, we test that queryCommandValue/State('useCSS') return boolean false and
     11        queryCommandValue/State('useStyleWithCSS') returns booleans (as opposed to 'true'/'false'
     12        strings)
     13
     14        * editing/execCommand/style-with-css-expected.txt: Added.
     15        * editing/execCommand/style-with-css.html: Added.
     16        * editing/execCommand/use-css-expected.txt: Added.
     17        * editing/execCommand/use-css.html: Added.
     18
    1192011-09-13  Tim Horton  <timothy_horton@apple.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r95049 r95050  
     12011-09-13  Kiyoto Tamura  <owenestea@gmail.com>
     2
     3        For compatibility, execCommand should support deprecated 'useCSS' alias for 'styleWithCSS'
     4        https://bugs.webkit.org/show_bug.cgi?id=36683
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        In addition to supporting the deprecated 'useCSS', 'styleWithCSS' now accepts any argument other than
     9        the boolean false or the case-insensitive string "false". This is per
     10        http://aryeh.name/spec/editing/editing.html#the-stylewithcss-command
     11
     12        Tests: editing/execCommand/style-with-css.html
     13               editing/execCommand/use-css.html
     14
     15        * editing/EditorCommand.cpp:
     16        (WebCore::executeStyleWithCSS):
     17        (WebCore::executeUseCSS):
     18        (WebCore::createCommandMap):
     19
    1202011-09-13  Anders Carlsson  <andersca@apple.com>
    221
  • trunk/Source/WebCore/editing/EditorCommand.cpp

    r89293 r95050  
    10181018static bool executeStyleWithCSS(Frame* frame, Event*, EditorCommandSource, const String& value)
    10191019{
    1020     if (value != "false" && value != "true")
    1021         return false;
    1022    
    1023     frame->editor()->setShouldStyleWithCSS(value == "true" ? true : false);
     1020    frame->editor()->setShouldStyleWithCSS(!equalIgnoringCase(value, "false"));
     1021    return true;
     1022}
     1023
     1024static bool executeUseCSS(Frame* frame, Event*, EditorCommandSource, const String& value)
     1025{
     1026    frame->editor()->setShouldStyleWithCSS(equalIgnoringCase(value, "false"));
    10241027    return true;
    10251028}
     
    15351538        { "Unscript", { executeUnscript, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
    15361539        { "Unselect", { executeUnselect, supported, enabledVisibleSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
     1540        { "UseCSS", { executeUseCSS, supported, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
    15371541        { "Yank", { executeYank, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
    15381542        { "YankAndSelect", { executeYankAndSelect, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
Note: See TracChangeset for help on using the changeset viewer.