Bug 53791 - HTMLOutputElement::childrenChanged() should call its base class childrenChanged()
Summary: HTMLOutputElement::childrenChanged() should call its base class childrenChang...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 50916
  Show dependency treegraph
 
Reported: 2011-02-04 10:59 PST by Yael
Modified: 2011-02-07 22:31 PST (History)
3 users (show)

See Also:


Attachments
Patch (1.88 KB, patch)
2011-02-05 07:59 PST, Kenichi Ishibashi
no flags Details | Formatted Diff | Diff
Patch V2 (4.80 KB, patch)
2011-02-06 17:56 PST, Kenichi Ishibashi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yael 2011-02-04 10:59:11 PST
While working on the bug https://bugs.webkit.org/show_bug.cgi?id=50916, I noticed that this is the only element that is not calling its base class childrenChanged().
Adding code to Element::childrenChanged() will not have the desired effect on HTMLOutputElement.
Comment 1 Kenichi Ishibashi 2011-02-05 07:59:53 PST
Created attachment 81361 [details]
Patch
Comment 2 Andreas Kling 2011-02-05 10:03:43 PST
Comment on attachment 81361 [details]
Patch

r=me
Comment 3 Yael 2011-02-05 12:13:04 PST
This modification actually does change behavior :)
If you run the following without this change, the second alert will show 2 instead of 1.


<!DOCTYPE html>
<html>
<head>
<script>

window.onload=function(){
    if (window.layoutTestController)
        layoutTestController.dumpAsText();
    var list = document.getElementsByTagName("span");
    var el = document.getElementById("result");
    alert("The number of spans before removal is " + list.length);
    document.getElementById("parentOutput").removeChild(document.getElementById("first"));
    alert("The number of spans after removal is " + list.length);
}
</script>
</head>
<body>
<output id="parentOutput"><span class="first" id="first"></span><span class="second" id="second"></span></output>
<br>
Test that a live list is updated after the child of an HTMLOutputElement was removed.
<br>
<div id="result"></div>
</body>
</html>
Comment 4 Andreas Kling 2011-02-06 05:15:26 PST
Comment on attachment 81361 [details]
Patch

@Yael: Ah, beautiful! Let's add a test for it.
Comment 5 Kenichi Ishibashi 2011-02-06 17:56:56 PST
Created attachment 81436 [details]
Patch V2
Comment 6 Kenichi Ishibashi 2011-02-06 18:00:44 PST
(In reply to comment #5)
> Created an attachment (id=81436) [details]
> Patch V2

Thank you guys for review and correcting my misunderstanding. I've added a test.

Thanks!
Comment 7 Kenichi Ishibashi 2011-02-07 16:07:27 PST
Comment on attachment 81436 [details]
Patch V2

Thank you for review. Could someone cq+?
Comment 8 WebKit Commit Bot 2011-02-07 22:31:13 PST
Comment on attachment 81436 [details]
Patch V2

Clearing flags on attachment: 81436

Committed r77902: <http://trac.webkit.org/changeset/77902>
Comment 9 WebKit Commit Bot 2011-02-07 22:31:16 PST
All reviewed patches have been landed.  Closing bug.