Skip to content
  • chang.shu@nokia.com's avatar
    2011-01-20 Chang Shu <chang.shu@nokia.com> · a73b559f
    chang.shu@nokia.com authored
            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
    a73b559f