List item markers are not always updated after changes in the DOM.
authorjwieczorek@webkit.org <jwieczorek@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Apr 2010 15:41:14 +0000 (15:41 +0000)
committerjwieczorek@webkit.org <jwieczorek@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Apr 2010 15:41:14 +0000 (15:41 +0000)
commit30a677a9e523b5be31b595dc3a2c5590c9801dc9
treed9c9271f1e48adacbce58df812e734e9811e9254
parent89812cd8c79950eaf7236b755f4785f43ecaac1d
List item markers are not always updated after changes in the DOM.
https://bugs.webkit.org/show_bug.cgi?id=37060

Reviewed by Darin Adler.

WebCore:

In particular, they would not be updated when adding/removing an item
that is not a direct child of the list element.

Tests: fast/lists/ol-nested-items-dynamic-insert.html
       fast/lists/ol-nested-items-dynamic-remove.html
       fast/lists/ol-nested-items.html
       fast/lists/ol-nested-list-dynamic-insert.html
       fast/lists/ol-nested-list-dynamic-remove.html
       fast/lists/ol-nested-list.html

* rendering/RenderListItem.cpp:
(WebCore::updateListMarkerNumbers): Change it to traverse the whole subtree of a list, not only siblings of an item.
* rendering/RenderListItem.h:
* rendering/RenderObject.cpp: Move the updateListMarkerNumbers function to RenderListItem.cpp.
(WebCore::RenderObject::addChild): Move the code updating list markers to RenderObjectChildList for consistency.
* rendering/RenderObjectChildList.cpp: Move the updateListMarkerNumbers function to RenderListItem.cpp.
(WebCore::RenderObjectChildList::removeChildNode): Pass the actual node being removed, not the next sibling.
(WebCore::RenderObjectChildList::appendChildNode): Pass the actual node being added, not the next sibling.
(WebCore::RenderObjectChildList::insertChildNode): Pass the actual node being added, not the next sibling.
* rendering/RenderTreeAsText.cpp:
(WebCore::markerTextForListItem):

WebKit/gtk:

* webkit/webkitprivate.h:
* webkit/webkitwebframe.cpp:
(webkit_web_frame_marker_text_for_list_item): Add a private API to get the marker text for a list item.

WebKit/qt:

* Api/qwebelement.h: Make DumpRenderTreeSupportQt a friend class.
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::markerTextForListItem): Add a private API to get the marker text for a list item.

WebKitTools:

* DumpRenderTree/LayoutTestController.cpp:
(markerTextForListItemCallback): A function that returns the marker text for a given list item.
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::markerTextForListItem): Implement it in the GTK port.
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::markerTextForListItem): Add a stub.
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::markerTextForListItem): Implement it in the Qt port.
* DumpRenderTree/qt/LayoutTestControllerQt.h:
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::markerTextForListItem): Add a stub.

LayoutTests:

* fast/lists/dump-list.js:
(indent):
(dumpListHelper): A recursive function to dump nested lists.
(dumpList): A function that dumps a readable plain text representation of a list.
* fast/lists/ol-nested-items-dynamic-insert-expected.txt: Added.
* fast/lists/ol-nested-items-dynamic-insert.html: Added.
* fast/lists/ol-nested-items-dynamic-remove-expected.txt: Added.
* fast/lists/ol-nested-items-dynamic-remove.html: Added.
* fast/lists/ol-nested-items-expected.txt: Added.
* fast/lists/ol-nested-items.html: Added.
* fast/lists/ol-nested-list-dynamic-insert-expected.txt: Added.
* fast/lists/ol-nested-list-dynamic-insert.html: Added.
* fast/lists/ol-nested-list-dynamic-remove-expected.txt: Added.
* fast/lists/ol-nested-list-dynamic-remove.html: Added.
* fast/lists/ol-nested-list-expected.txt: Added.
* fast/lists/ol-nested-list.html: Added.
* platform/mac/Skipped: Skip the tests until this port implements the new LayoutTestController function.
* platform/win/Skipped: Skip the tests until this port implements the new LayoutTestController function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@57986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
36 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/lists/dump-list.js [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-items-dynamic-insert-expected.txt [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-items-dynamic-insert.html [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-items-dynamic-remove-expected.txt [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-items-dynamic-remove.html [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-items-expected.txt [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-items.html [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-list-dynamic-insert-expected.txt [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-list-dynamic-insert.html [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-list-dynamic-remove-expected.txt [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-list-dynamic-remove.html [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-list-expected.txt [new file with mode: 0644]
LayoutTests/fast/lists/ol-nested-list.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderListItem.cpp
WebCore/rendering/RenderListItem.h
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderObjectChildList.cpp
WebCore/rendering/RenderTreeAsText.cpp
WebCore/rendering/RenderTreeAsText.h
WebKit/gtk/ChangeLog
WebKit/gtk/webkit/webkitprivate.h
WebKit/gtk/webkit/webkitwebframe.cpp
WebKit/qt/Api/qwebelement.h
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/LayoutTestController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.h
WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp