[GTK] webkit_dom_document_create_tree_walker impossible to use due to WebKitDOMNodeFilter
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 06:44:16 +0000 (06:44 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 06:44:16 +0000 (06:44 +0000)
commitd872a33bdac48a9617c8d7412a29aded67c81fa9
treea32666154a51cdad92f4c284927338eaf385ab22
parentd6dae69c63f0f8772854b844772ea13c8006d406
[GTK] webkit_dom_document_create_tree_walker impossible to use due to WebKitDOMNodeFilter
https://bugs.webkit.org/show_bug.cgi?id=93002

Reviewed by Gustavo Noronha Silva.

Source/WebCore:
Add custom implementation of WebKitDOMNodeFilter to expose it as
an interface instead of a class.

* PlatformGTK.cmake: Add new files to compilation.
* bindings/gobject/GObjectNodeFilterCondition.cpp: Added.
(WebCore::GObjectNodeFilterCondition::~GObjectNodeFilterCondition):
Reset the NodeFilter WebCore object associated to the
WebKitDOMNodeFilter object.
(WebCore::GObjectNodeFilterCondition::acceptNode): Call webkit_dom_node_filter_accept_node().
* bindings/gobject/GObjectNodeFilterCondition.h: Added.
(WebCore::GObjectNodeFilterCondition::create): Create a new
GObjectNodeFilterCondition for the given WebKitDOMNodeFilter.
(WebCore::GObjectNodeFilterCondition::GObjectNodeFilterCondition):
* bindings/gobject/WebKitDOMNodeFilter.cpp: Added.
(webkit_dom_node_filter_default_init):
(webkit_dom_node_filter_accept_node):
(WebKit::nodeFilterMap): Map NodeFilter WebCore objects to
WebKitDOMNodeFilter objects.
(WebKit::nodeFilterObjectDestroyedCallback): Remove the node
filter form the map when the WebKitDOMNodeFilter objecrt is destroyed.
(WebKit::kit): Return the WebKitDOMNodeFilter object for the given
NodeFilter WebCore object.
(WebKit::core): Get or create a NodeFilter WebCore object
associated to the given WebKitDOMNodeFilter.
* bindings/gobject/WebKitDOMNodeFilter.h: Added.
* bindings/gobject/WebKitDOMNodeFilter.symbols: Added.
* bindings/gobject/WebKitDOMNodeFilterPrivate.h: Added.
* bindings/scripts/CodeGeneratorGObject.pm:
(GenerateFunction): Add exceptions for NodeFilter parameters since
the core method returns a PassRefPtr.

Tools:
Add unit tests to check WebKitDOMNodefilter API used from both
TreeWalker and NodeIterator.

* Scripts/webkitpy/style/checker.py: Add exceptions for GTK+
public headers and add WebKitDOMNodeFilter to the list of exceptions.
* TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt: Add new files to compilation.
* TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeFilterTest.cpp: Added.
(webkitNodeFilterAcceptNode):
(webkitNodeFilterDOMNodeFilterIfaceInit):
(webkit_node_filter_init):
(webkit_node_filter_class_init):
(WebKitDOMNodeFilterTest::create):
(WebKitDOMNodeFilterTest::webPageFromArgs):
(WebKitDOMNodeFilterTest::testTreeWalker):
(WebKitDOMNodeFilterTest::testNodeIterator):
(WebKitDOMNodeFilterTest::runTest):
(registerTests):
* TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp: Added.
(runTest):
(testWebKitDOMNodeFilterTreeWalker):
(testWebKitDOMNodeFilterNodeIterator):
(beforeAll):
(afterAll):
* gtk/webkitdom.py:
(WebKitDOMDocGeneratorSections.__init__):
(WebKitDOMDocGeneratorSections._symbol_list):
(WebKitDOMDocGeneratorSections.write_section):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/bindings/gobject/GObjectNodeFilterCondition.cpp [new file with mode: 0644]
Source/WebCore/bindings/gobject/GObjectNodeFilterCondition.h [new file with mode: 0644]
Source/WebCore/bindings/gobject/WebKitDOMNodeFilter.cpp [new file with mode: 0644]
Source/WebCore/bindings/gobject/WebKitDOMNodeFilter.h [new file with mode: 0644]
Source/WebCore/bindings/gobject/WebKitDOMNodeFilter.symbols [new file with mode: 0644]
Source/WebCore/bindings/gobject/WebKitDOMNodeFilterPrivate.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
Tools/ChangeLog
Tools/Scripts/webkitpy/style/checker.py
Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt
Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeFilterTest.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDOMNodeFilter.cpp [new file with mode: 0644]
Tools/gtk/webkitdom.py