Changeset 76145 in webkit


Ignore:
Timestamp:
Jan 19, 2011 11:31:36 AM (13 years ago)
Author:
chang.shu@nokia.com
Message:

2011-01-19 Chang Shu <chang.shu@nokia.com>

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=52056

  1. Fixed test cases in the above bug;
  2. Partially fixed test cases in other contentEditable bugs;
  3. Updated expected result for fast/dom/element-attribute-js-null.html. However, the test itself should be fixed later in bug 52057.
  • editing/editability/attr-invalid-string-expected.txt:
  • editing/editability/attr-invalid-string.html:
  • editing/editability/attr-missing-ancestor-false-expected.txt:
  • editing/editability/attr-missing-ancestor-false.html:
  • editing/editability/attr-missing-ancestor-true-expected.txt:
  • editing/editability/attr-missing-ancestor-true.html:
  • editing/editability/attr-missing-parent-ancestor-missing-expected.txt:
  • editing/editability/attr-missing-parent-ancestor-missing.html:
  • editing/editability/attr-missing-parent-false-expected.txt:
  • editing/editability/attr-missing-parent-false.html:
  • editing/editability/attr-missing-parent-true-expected.txt:
  • editing/editability/attr-missing-parent-true.html:
  • editing/editability/set-false-expected.txt:
  • editing/editability/set-inherit-parent-false-expected.txt:
  • editing/editability/set-inherit-parent-true-expected.txt:
  • editing/editability/set-invalid-value-expected.txt:
  • editing/editability/set-true-expected.txt:
  • editing/editability/set-value-caseinsensitive-expected.txt:
  • fast/dom/element-attribute-js-null-expected.txt:

2011-01-19 Chang Shu <chang.shu@nokia.com>

Reviewed by Darin Adler.

The return value of contentEditable() function should depend on the DOM attribute
instead of render style userModify. The code change fixed test cases in the bug
and partially fixed test cases in other contentEditable bugs;

https://bugs.webkit.org/show_bug.cgi?id=52056

  • html/HTMLElement.cpp: (WebCore::HTMLElement::contentEditable):
Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76144 r76145  
     12011-01-19  Chang Shu  <chang.shu@nokia.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=52056
     6        1. Fixed test cases in the above bug;
     7        2. Partially fixed test cases in other contentEditable bugs;
     8        3. Updated expected result for fast/dom/element-attribute-js-null.html.
     9           However, the test itself should be fixed later in bug 52057.
     10
     11        * editing/editability/attr-invalid-string-expected.txt:
     12        * editing/editability/attr-invalid-string.html:
     13        * editing/editability/attr-missing-ancestor-false-expected.txt:
     14        * editing/editability/attr-missing-ancestor-false.html:
     15        * editing/editability/attr-missing-ancestor-true-expected.txt:
     16        * editing/editability/attr-missing-ancestor-true.html:
     17        * editing/editability/attr-missing-parent-ancestor-missing-expected.txt:
     18        * editing/editability/attr-missing-parent-ancestor-missing.html:
     19        * editing/editability/attr-missing-parent-false-expected.txt:
     20        * editing/editability/attr-missing-parent-false.html:
     21        * editing/editability/attr-missing-parent-true-expected.txt:
     22        * editing/editability/attr-missing-parent-true.html:
     23        * editing/editability/set-false-expected.txt:
     24        * editing/editability/set-inherit-parent-false-expected.txt:
     25        * editing/editability/set-inherit-parent-true-expected.txt:
     26        * editing/editability/set-invalid-value-expected.txt:
     27        * editing/editability/set-true-expected.txt:
     28        * editing/editability/set-value-caseinsensitive-expected.txt:
     29        * fast/dom/element-attribute-js-null-expected.txt:
     30
    1312011-01-19  Levi Weintraub  <leviw@chromium.org>
    232
  • trunk/LayoutTests/editing/editability/attr-invalid-string-expected.txt

    r75329 r76145  
    88
    99PASS document.getElementById("div").getAttribute("contentEditable") is "abc"
    10 FAIL document.getElementById("div").contentEditable should be inherit. Was false.
    11 FIXME: contentEditable attribute fails to take invalid value. https://bugs.webkit.org/show_bug.cgi?id=50636
     10PASS document.getElementById("div").contentEditable is "inherit"
    1211PASS document.getElementById("div").isContentEditable is false
    1312PASS window.getComputedStyle(div, "").getPropertyValue("-webkit-user-modify") is "read-only"
  • trunk/LayoutTests/editing/editability/attr-invalid-string.html

    r75329 r76145  
    1414shouldBe('document.getElementById("div").getAttribute("contentEditable")','"abc"');
    1515shouldBe('document.getElementById("div").contentEditable', '"inherit"');
    16 debug("FIXME: contentEditable attribute fails to take invalid value. https://bugs.webkit.org/show_bug.cgi?id=50636");
    1716shouldBe('document.getElementById("div").isContentEditable', 'false');
    1817shouldBe('window.getComputedStyle(div, "").getPropertyValue("-webkit-user-modify")', '"read-only"');
  • trunk/LayoutTests/editing/editability/attr-missing-ancestor-false-expected.txt

    r75329 r76145  
    88
    99PASS document.getElementById("p").hasAttribute("contentEditable") is false
    10 FAIL document.getElementById("p").contentEditable should be inherit. Was false.
    11 FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056
     10PASS document.getElementById("p").contentEditable is "inherit"
    1211PASS document.getElementById("p").isContentEditable is false
    1312PASS window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify") is "read-only"
  • trunk/LayoutTests/editing/editability/attr-missing-ancestor-false.html

    r75329 r76145  
    2020shouldBe('document.getElementById("p").hasAttribute("contentEditable")', 'false');
    2121shouldBe('document.getElementById("p").contentEditable', '"inherit"');
    22 debug("FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056");
    2322shouldBe('document.getElementById("p").isContentEditable', 'false');
    2423shouldBe('window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify")', '"read-only"');
  • trunk/LayoutTests/editing/editability/attr-missing-ancestor-true-expected.txt

    r75329 r76145  
    88
    99PASS document.getElementById("p").hasAttribute("contentEditable") is false
    10 FAIL document.getElementById("p").contentEditable should be inherit. Was true.
    11 FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056
     10PASS document.getElementById("p").contentEditable is "inherit"
    1211PASS document.getElementById("p").isContentEditable is true
    1312PASS window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify") is "read-write"
  • trunk/LayoutTests/editing/editability/attr-missing-ancestor-true.html

    r75329 r76145  
    2121shouldBe('document.getElementById("p").hasAttribute("contentEditable")','false');
    2222shouldBe('document.getElementById("p").contentEditable', '"inherit"');
    23 debug("FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056");
    2423shouldBe('document.getElementById("p").isContentEditable', 'true');
    2524shouldBe('window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify")', '"read-write"');
  • trunk/LayoutTests/editing/editability/attr-missing-parent-ancestor-missing-expected.txt

    r75329 r76145  
    88
    99PASS document.getElementById("p").hasAttribute("contentEditable") is false
    10 FAIL document.getElementById("p").contentEditable should be inherit. Was false.
    11 FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056
     10PASS document.getElementById("p").contentEditable is "inherit"
    1211PASS document.getElementById("p").isContentEditable is false
    1312PASS window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify") is "read-only"
  • trunk/LayoutTests/editing/editability/attr-missing-parent-ancestor-missing.html

    r75329 r76145  
    2020shouldBe('document.getElementById("p").hasAttribute("contentEditable")','false');
    2121shouldBe('document.getElementById("p").contentEditable', '"inherit"');
    22 debug("FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056");
    2322shouldBe('document.getElementById("p").isContentEditable', 'false');
    2423shouldBe('window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify")', '"read-only"');
  • trunk/LayoutTests/editing/editability/attr-missing-parent-false-expected.txt

    r75329 r76145  
    88
    99PASS document.getElementById("p").hasAttribute("contentEditable") is false
    10 FAIL document.getElementById("p").contentEditable should be inherit. Was false.
    11 FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056
     10PASS document.getElementById("p").contentEditable is "inherit"
    1211PASS document.getElementById("p").isContentEditable is false
    1312PASS window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify") is "read-only"
  • trunk/LayoutTests/editing/editability/attr-missing-parent-false.html

    r75329 r76145  
    1616shouldBe('document.getElementById("p").hasAttribute("contentEditable")','false');
    1717shouldBe('document.getElementById("p").contentEditable', '"inherit"');
    18 debug("FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056");
    1918shouldBe('document.getElementById("p").isContentEditable', 'false');
    2019shouldBe('window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify")', '"read-only"');
  • trunk/LayoutTests/editing/editability/attr-missing-parent-true-expected.txt

    r75329 r76145  
    88
    99PASS document.getElementById("p").hasAttribute("contentEditable") is false
    10 FAIL document.getElementById("p").contentEditable should be inherit. Was true.
    11 FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056
     10PASS document.getElementById("p").contentEditable is "inherit"
    1211PASS document.getElementById("p").isContentEditable is true
    1312PASS window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify") is "read-write"
  • trunk/LayoutTests/editing/editability/attr-missing-parent-true.html

    r75329 r76145  
    1616shouldBe('document.getElementById("p").hasAttribute("contentEditable")','false');
    1717shouldBe('document.getElementById("p").contentEditable', '"inherit"');
    18 debug("FIXME: contentEditable attribute should be inherit if missing. https://bugs.webkit.org/show_bug.cgi?id=52056");
    1918shouldBe('document.getElementById("p").isContentEditable', 'true');
    2019shouldBe('window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify")', '"read-write"');
  • trunk/LayoutTests/editing/editability/set-false-expected.txt

    r75329 r76145  
    99
    1010PASS document.getElementById("div1").getAttribute("contentEditable") is "false"
    11 FAIL document.getElementById("div1").contentEditable should be false. Was true.
     11PASS document.getElementById("div1").contentEditable is "false"
    1212FAIL document.getElementById("div1").isContentEditable should be false. Was true.
    1313FIXME: setContentEditable with true/false/inherit string is not working properly. https://bugs.webkit.org/show_bug.cgi?id=52058
  • trunk/LayoutTests/editing/editability/set-inherit-parent-false-expected.txt

    r75329 r76145  
    88
    99PASS document.getElementById("p").hasAttribute("contentEditable") is false
    10 FAIL document.getElementById("p").contentEditable should be inherit. Was true.
     10PASS document.getElementById("p").contentEditable is "inherit"
    1111FAIL document.getElementById("p").isContentEditable should be false. Was true.
    1212FIXME: setContentEditable with true/false/inherit string is not working properly. https://bugs.webkit.org/show_bug.cgi?id=52058
  • trunk/LayoutTests/editing/editability/set-inherit-parent-true-expected.txt

    r75329 r76145  
    88
    99PASS document.getElementById("p").hasAttribute("contentEditable") is false
    10 FAIL document.getElementById("p").contentEditable should be inherit. Was false.
     10PASS document.getElementById("p").contentEditable is "inherit"
    1111FAIL document.getElementById("p").isContentEditable should be true. Was false.
    1212FIXME: setContentEditable with true/false/inherit string is not working properly. https://bugs.webkit.org/show_bug.cgi?id=52058
  • trunk/LayoutTests/editing/editability/set-invalid-value-expected.txt

    r75329 r76145  
    1010FIXME: setContentEditable with invalid string should throw exception. https://bugs.webkit.org/show_bug.cgi?id=52057
    1111PASS document.getElementById("div").getAttribute("contentEditable") is "abc"
    12 PASS document.getElementById("div").contentEditable is "true"
     12FAIL document.getElementById("div").contentEditable should be true. Was inherit.
    1313PASS document.getElementById("div").isContentEditable is true
    1414FAIL window.getComputedStyle(div, "").getPropertyValue("-webkit-user-modify") should be read-write. Was read-only.
  • trunk/LayoutTests/editing/editability/set-true-expected.txt

    r75329 r76145  
    99
    1010PASS document.getElementById("div1").getAttribute("contentEditable") is "true"
    11 FAIL document.getElementById("div1").contentEditable should be true. Was false.
     11PASS document.getElementById("div1").contentEditable is "true"
    1212FAIL document.getElementById("div1").isContentEditable should be true. Was false.
    1313FIXME: setContentEditable with true/false/inherit string is not working properly. https://bugs.webkit.org/show_bug.cgi?id=52058
  • trunk/LayoutTests/editing/editability/set-value-caseinsensitive-expected.txt

    r75329 r76145  
    1010
    1111PASS document.getElementById("div1").getAttribute("contentEditable") is "TRue"
    12 FAIL document.getElementById("div1").contentEditable should be true. Was false.
     12PASS document.getElementById("div1").contentEditable is "true"
    1313FAIL document.getElementById("div1").isContentEditable should be true. Was false.
    1414PASS window.getComputedStyle(div1, "").getPropertyValue("-webkit-user-modify") is "read-write"
     
    1818PASS window.getComputedStyle(p1, "").getPropertyValue("-webkit-user-modify") is "read-only"
    1919FAIL document.getElementById("p2").hasAttribute("contentEditable") should be false. Was true.
    20 FAIL document.getElementById("p2").contentEditable should be inherit. Was false.
     20PASS document.getElementById("p2").contentEditable is "inherit"
    2121FAIL document.getElementById("p2").isContentEditable should be true. Was false.
    2222FAIL window.getComputedStyle(p2, "").getPropertyValue("-webkit-user-modify") should be read-write. Was read-only.
  • trunk/LayoutTests/fast/dom/element-attribute-js-null-expected.txt

    r30635 r76145  
    1212TEST SUCCEEDED: The value was the empty string. [tested HTMLElement.innerHTML]
    1313TEST SUCCEEDED: The value was the empty string. [tested HTMLElement.innerText]
    14 TEST SUCCEEDED: The value was the string 'false'. [tested HTMLElement.contentEditable]
     14TEST FAILED: The value should have been the string 'false' but was the string 'true'. [tested HTMLElement.contentEditable]
    1515
    1616TEST SUCCEEDED: The value was the empty string. [tested HTMLAnchorElement.accessKey]
  • trunk/Source/WebCore/ChangeLog

    r76144 r76145  
     12011-01-19  Chang Shu  <chang.shu@nokia.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        The return value of contentEditable() function should depend on the DOM attribute
     6        instead of render style userModify. The code change fixed test cases in the bug
     7        and partially fixed test cases in other contentEditable bugs;
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=52056
     10
     11        * html/HTMLElement.cpp:
     12        (WebCore::HTMLElement::contentEditable):
     13
    1142011-01-19  Levi Weintraub  <leviw@chromium.org>
    215
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r76115 r76145  
    690690String HTMLElement::contentEditable() const
    691691{
    692     if (!renderer())
    693         return "false";
    694    
    695     switch (renderer()->style()->userModify()) {
    696         case READ_WRITE:
    697             return "true";
    698         case READ_ONLY:
    699             return "false";
    700         case READ_WRITE_PLAINTEXT_ONLY:
    701             return "plaintext-only";
    702         default:
    703             return "inherit";
    704     }
     692    const AtomicString& value = fastGetAttribute(contenteditableAttr);
     693
     694    if (value.isNull())
     695        return "inherit";
     696    if (value.isEmpty() || equalIgnoringCase(value, "true"))
     697        return "true";
     698    if (equalIgnoringCase(value, "false"))
     699         return "false";
     700    if (equalIgnoringCase(value, "plaintext-only"))
     701        return "plaintext-only";
     702
     703    return "inherit";
    705704}
    706705
Note: See TracChangeset for help on using the changeset viewer.