2011-02-07 Kenichi Ishibashi <bashi@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Feb 2011 06:30:56 +0000 (06:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Feb 2011 06:30:56 +0000 (06:30 +0000)
        Reviewed by Andreas Kling.

        HTMLOutputElement::childrenChanged() should call its base class childrenChanged()
        https://bugs.webkit.org/show_bug.cgi?id=53791

        Test that a live list is updated after the child of an HTMLOutputElement was removed.

        * fast/dom/HTMLOutputElement/htmloutputelement-children-removed-expected.txt: Added.
        * fast/dom/HTMLOutputElement/htmloutputelement-children-removed.html: Added.
2011-02-07  Kenichi Ishibashi  <bashi@chromium.org>

        Reviewed by Andreas Kling.

        HTMLOutputElement::childrenChanged() should call its base class childrenChanged()
        https://bugs.webkit.org/show_bug.cgi?id=53791

        Calls HTMLFormControlElement::childrenChanged() in HTMLOutputElement::childrenChanged().

        Test: fast/dom/HTMLOutputElement/htmloutputelement-children-removed.html

        * html/HTMLOutputElement.cpp:
        (WebCore::HTMLOutputElement::childrenChanged): Calls super class's
        childrenChanged().

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

LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-children-removed-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-children-removed.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLOutputElement.cpp

index 7b091a2da508ae75eac85f20f0abedcc814cfe75..b819377b55962122532e96e8dbb7bbdb41e15f87 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-07  Kenichi Ishibashi  <bashi@google.com>
+
+        Reviewed by Andreas Kling.
+
+        HTMLOutputElement::childrenChanged() should call its base class childrenChanged()
+        https://bugs.webkit.org/show_bug.cgi?id=53791
+
+        Test that a live list is updated after the child of an HTMLOutputElement was removed.
+
+        * fast/dom/HTMLOutputElement/htmloutputelement-children-removed-expected.txt: Added.
+        * fast/dom/HTMLOutputElement/htmloutputelement-children-removed.html: Added.
+
 2011-02-07  Ami Fischman  <fischman@google.com>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-children-removed-expected.txt b/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-children-removed-expected.txt
new file mode 100644 (file)
index 0000000..61b315d
--- /dev/null
@@ -0,0 +1,12 @@
+Test that a live list is updated after the child of an HTMLOutputElement was removed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The number of spans before removal is 2
+The number of spans after removal is 1
+PASS list.length == beforeLength - 1 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-children-removed.html b/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-children-removed.html
new file mode 100644 (file)
index 0000000..5b4a55a
--- /dev/null
@@ -0,0 +1,24 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description('Test that a live list is updated after the child of an HTMLOutputElement was removed.');
+</script>
+<output id="parentOutput"><span class="inner" id="first"></span><span class="inner" id="second"></span></output>
+<script>
+    var list = document.getElementsByClassName("inner");
+    debug("The number of spans before removal is " + list.length);
+    var beforeLength = list.length;
+    document.getElementById("parentOutput").removeChild(document.getElementById("first"));
+    debug("The number of spans after removal is " + list.length);
+    shouldBeTrue('list.length == beforeLength - 1');
+    var successfullyParsed = true;
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
index f2c39912e29deb5bddb5b9d7329abdae3f34ea0e..00732462a5e48c7dcf37595291e08a5144a8decd 100644 (file)
@@ -1,3 +1,18 @@
+2011-02-07  Kenichi Ishibashi  <bashi@chromium.org>
+
+        Reviewed by Andreas Kling.
+
+        HTMLOutputElement::childrenChanged() should call its base class childrenChanged()
+        https://bugs.webkit.org/show_bug.cgi?id=53791
+
+        Calls HTMLFormControlElement::childrenChanged() in HTMLOutputElement::childrenChanged().
+
+        Test: fast/dom/HTMLOutputElement/htmloutputelement-children-removed.html
+
+        * html/HTMLOutputElement.cpp:
+        (WebCore::HTMLOutputElement::childrenChanged): Calls super class's
+        childrenChanged().
+
 2011-02-07  Benjamin Poulain  <ikipou@gmail.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index 2f1d4901d11d638f7914c2b6b13f14bec152fe32..8be5d911c0798462c554076c36999328d8f38ac1 100644 (file)
@@ -74,7 +74,7 @@ void HTMLOutputElement::setFor(const String& value)
     m_tokens->setValue(value);
 }
 
-void HTMLOutputElement::childrenChanged(bool createdByParser, Node*, Node*, int)
+void HTMLOutputElement::childrenChanged(bool createdByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
     if (createdByParser || m_isSetTextContentInProgress) {
         m_isSetTextContentInProgress = false;
@@ -83,6 +83,7 @@ void HTMLOutputElement::childrenChanged(bool createdByParser, Node*, Node*, int)
 
     if (m_isDefaultValueMode)
         m_defaultValue = textContent();
+    HTMLFormControlElement::childrenChanged(createdByParser, beforeChange, afterChange, childCountDelta);
 }
 
 void HTMLOutputElement::reset()