2011-01-20 Chang Shu <chang.shu@nokia.com>
authorAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Wed, 26 Jan 2011 21:16:13 +0000 (18:16 -0300)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Wed, 26 Jan 2011 21:16:13 +0000 (18:16 -0300)
commit56db691c8fd0feca9dfea4bda62d23c1552cd991
tree066039b4309769513fdc964047fe21b082e2eb08
parent5454ae30fa7939234567b785498d95f430f07611
2011-01-20  Chang Shu  <chang.shu@nokia.com>

        Reviewed by Darin Adler.

        setContentEditable with invalid string should throw exception.
        https://bugs.webkit.org/show_bug.cgi?id=52057

        Updated expected results after the fix. Also corrected test cases.

        * editing/editability/set-invalid-value-expected.txt:
        * editing/editability/set-invalid-value.html: 1. Fixed the getAttribute expectation as "abc" was failed to set. 2. Added additional check for setting empty string.
        * editing/editability/set-value-caseinsensitive-expected.txt:
        * editing/editability/set-value-caseinsensitive.html: Fixed the getAttribute expectations as all strings should be converted to lower cases.
        * fast/dom/element-attribute-js-null-expected.txt:
        * fast/dom/element-attribute-js-null.html: Fixed this existing test as the expectation for setting with null should throw exception instead of "false". Also added handling code when exception was thrown.
2011-01-20  Chang Shu  <chang.shu@nokia.com>

        Reviewed by Darin Adler.

        setContentEditable with invalid string should throw exception.
        https://bugs.webkit.org/show_bug.cgi?id=52057

        Implemented exception throwing for setContentEditable according to the following spec:
        http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#attr-contenteditable
        Related quotas: "On setting, if the new value is an ASCII case-insensitive match for the
        string 'inherit' then the content attribute must be removed, if the new value is an ASCII
        case-insensitive match for the string 'true' then the content attribute must be set to the
        string 'true', if the new value is an ASCII case-insensitive match for the string 'false'
        then the content attribute must be set to the string 'false', and otherwise the attribute
        setter must raise a SYNTAX_ERR exception."

        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::setContentEditable): Throw exception on invalid input strings; Make setting values case-insensitive and also convert them to lower cases according to the spec.
        * html/HTMLElement.h: Add additional parameter ExceptionCode& for function setContentEditable.
        * html/HTMLElement.idl: Add exception throwing support for contentEditable setter.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLElement.idl
LayoutTests/ChangeLog
LayoutTests/editing/editability/set-invalid-value-expected.txt
LayoutTests/editing/editability/set-invalid-value.html
LayoutTests/editing/editability/set-value-caseinsensitive-expected.txt
LayoutTests/editing/editability/set-value-caseinsensitive.html
LayoutTests/fast/dom/element-attribute-js-null-expected.txt
LayoutTests/fast/dom/element-attribute-js-null.html
WebCore/ChangeLog
WebCore/html/HTMLElement.cpp
WebCore/html/HTMLElement.h
WebCore/html/HTMLElement.idl