Changeset 214215 in webkit
- Timestamp:
- Mar 21, 2017 2:11:05 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r214201 r214215 1 2017-03-21 Aidan Holm <aidanholm+webkit@gmail.com> 2 3 [GTK] Add function webkit_dom_element_get_bounding_client_rect 4 https://bugs.webkit.org/show_bug.cgi?id=163892 5 6 Reviewed by Carlos Garcia Campos. 7 8 Wrap WebCore::ClientRect as WebKitDOMClientRect. 9 Wrap WebCore::ClientRectList as WebKitDOMClientRectList. 10 Implement webkit_dom_element_get_bounding_client_rect(). 11 Implement webkit_dom_element_get_client_rects(). 12 13 * PlatformGTK.cmake: 14 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp: Added. 15 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp: Added. 16 (WebKit::kit): 17 (WebKit::core): 18 (WebKit::wrapClientRect): 19 (webkit_dom_client_rect_finalize): 20 (webkit_dom_client_rect_get_property): 21 (webkit_dom_client_rect_constructed): 22 (webkit_dom_client_rect_class_init): 23 (webkit_dom_client_rect_init): 24 (webkit_dom_client_rect_get_top): 25 (webkit_dom_client_rect_get_right): 26 (webkit_dom_client_rect_get_bottom): 27 (webkit_dom_client_rect_get_left): 28 (webkit_dom_client_rect_get_width): 29 (webkit_dom_client_rect_get_height): 30 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h: Added. 31 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h: Added. 32 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h: Added. 33 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h: Added. 34 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp: 35 (webkit_dom_element_get_property): 36 (webkit_dom_element_class_init): 37 (webkit_dom_element_get_scroll_height): 38 (webkit_dom_element_get_bounding_client_rect): 39 (webkit_dom_element_get_client_rects): 40 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h: 41 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp: 42 (WebKit::wrap): 43 * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h: 44 * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt: 45 * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h: 46 * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h: 47 * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h: 48 1 49 2017-03-20 Alex Christensen <achristensen@webkit.org> 2 50 -
trunk/Source/WebKit2/PlatformGTK.cmake
r213844 r214215 360 360 WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp 361 361 WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp 362 WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp 363 WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp 362 364 WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp 363 365 WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp … … 605 607 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h 606 608 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h 609 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h 610 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h 607 611 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h 608 612 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h … … 716 720 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h 717 721 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h 722 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h 723 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h 718 724 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h 719 725 ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp
r208476 r214215 23 23 #include <WebCore/CSSImportRule.h> 24 24 #include "DOMObjectCache.h" 25 #include <WebCore/ClientRect.h> 26 #include <WebCore/ClientRectList.h> 25 27 #include <WebCore/Document.h> 26 28 #include <WebCore/ExceptionCode.h> … … 31 33 #include "WebKitDOMAttrPrivate.h" 32 34 #include "WebKitDOMCSSStyleDeclarationPrivate.h" 35 #include "WebKitDOMClientRectListPrivate.h" 36 #include "WebKitDOMClientRectPrivate.h" 33 37 #include "WebKitDOMDOMTokenListPrivate.h" 34 38 #include "WebKitDOMElementPrivate.h" … … 1222 1226 } 1223 1227 1228 WebKitDOMClientRect* webkit_dom_element_get_bounding_client_rect(WebKitDOMElement* self) 1229 { 1230 WebCore::JSMainThreadNullState state; 1231 g_return_val_if_fail(WEBKIT_DOM_IS_ELEMENT(self), nullptr); 1232 WebCore::Element* item = WebKit::core(self); 1233 auto clientRect = item->getBoundingClientRect(); 1234 return WebKit::kit(clientRect.ptr()); 1235 } 1236 1237 WebKitDOMClientRectList* webkit_dom_element_get_client_rects(WebKitDOMElement* self) 1238 { 1239 WebCore::JSMainThreadNullState state; 1240 g_return_val_if_fail(WEBKIT_DOM_IS_ELEMENT(self), nullptr); 1241 WebCore::Element* item = WebKit::core(self); 1242 auto clientRects = item->getClientRects(); 1243 return WebKit::kit(clientRects.ptr()); 1244 } 1245 1224 1246 WebKitDOMElement* webkit_dom_element_get_offset_parent(WebKitDOMElement* self) 1225 1247 { -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h
r207735 r214215 517 517 518 518 /** 519 * webkit_dom_element_get_bounding_client_rect: 520 * @self: A #WebKitDOMElement 521 * 522 * Returns a #WebKitDOMClientRect representing the size and position of @self 523 * relative to the viewport. 524 * 525 * Returns: (transfer full): A #WebKitDOMClientRect 526 * 527 * Since: 2.18 528 **/ 529 WEBKIT_API WebKitDOMClientRect* 530 webkit_dom_element_get_bounding_client_rect(WebKitDOMElement* self); 531 532 /** 533 * webkit_dom_element_get_client_rects: 534 * @self: A #WebKitDOMElement 535 * 536 * Returns a collection of #WebKitDOMClientRect objects, each of which describe 537 * the size and position of a CSS border box relative to the viewport. 538 * 539 * Returns: (transfer full): A #WebKitDOMClientRectList 540 * 541 * Since: 2.18 542 **/ 543 WEBKIT_API WebKitDOMClientRectList* 544 webkit_dom_element_get_client_rects(WebKitDOMElement* self); 545 546 /** 519 547 * webkit_dom_element_get_offset_parent: 520 548 * @self: A #WebKitDOMElement -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt
r206906 r214215 648 648 webkit_dom_element_get_scroll_width 649 649 webkit_dom_element_get_scroll_height 650 webkit_dom_element_get_bounding_client_rect 651 webkit_dom_element_get_client_rects 650 652 webkit_dom_element_get_offset_parent 651 653 webkit_dom_element_get_inner_html … … 3202 3204 </SECTION> 3203 3205 3206 <SECTION> 3207 <FILE>WebKitDOMClientRect</FILE> 3208 <TITLE>WebKitDOMClientRect</TITLE> 3209 WebKitDOMClientRect 3210 3211 webkit_dom_client_rect_get_top 3212 webkit_dom_client_rect_get_right 3213 webkit_dom_client_rect_get_bottom 3214 webkit_dom_client_rect_get_left 3215 webkit_dom_client_rect_get_width 3216 webkit_dom_client_rect_get_height 3217 3218 <SUBSECTION Standard> 3219 WebKitDOMClientRectClass 3220 WEBKIT_DOM_TYPE_CLIENT_RECT 3221 WEBKIT_DOM_CLIENT_RECT 3222 WEBKIT_DOM_IS_CLIENT_RECT 3223 WEBKIT_DOM_CLIENT_RECT_CLASS 3224 WEBKIT_DOM_IS_CLIENT_RECT_CLASS 3225 WEBKIT_DOM_CLIENT_RECT_GET_CLASS 3226 3227 <SUBSECTION Private> 3228 webkit_dom_client_rect_get_type 3229 </SECTION> 3230 3231 <SECTION> 3232 <FILE>WebKitDOMClientRectList</FILE> 3233 <TITLE>WebKitDOMClientRectList</TITLE> 3234 WebKitDOMClientRectList 3235 3236 webkit_dom_client_rect_list_item 3237 webkit_dom_client_rect_list_get_length 3238 3239 <SUBSECTION Standard> 3240 WebKitDOMClientRectClass 3241 WEBKIT_DOM_TYPE_CLIENT_RECT_LIST 3242 WEBKIT_DOM_CLIENT_RECT_LIST 3243 WEBKIT_DOM_IS_CLIENT_RECT_LIST 3244 WEBKIT_DOM_CLIENT_RECT_LIST_CLASS 3245 WEBKIT_DOM_IS_CLIENT_RECT_LIST_CLASS 3246 WEBKIT_DOM_CLIENT_RECT_LIST_GET_CLASS 3247 3248 <SUBSECTION Private> 3249 webkit_dom_client_rect_list_get_type 3250 </SECTION> -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h
r208035 r214215 31 31 #include <webkitdom/WebKitDOMCSSValue.h> 32 32 #include <webkitdom/WebKitDOMCharacterData.h> 33 #include <webkitdom/WebKitDOMClientRect.h> 34 #include <webkitdom/WebKitDOMClientRectList.h> 33 35 #include <webkitdom/WebKitDOMComment.h> 34 36 #include <webkitdom/WebKitDOMCustom.h> -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h
r207735 r214215 34 34 G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitDOMCSSValue, g_object_unref) 35 35 G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitDOMCharacterData, g_object_unref) 36 G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitDOMClientRect, g_object_unref) 37 G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitDOMClientRectList, g_object_unref) 36 38 G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitDOMComment, g_object_unref) 37 39 G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitDOMDOMImplementation, g_object_unref) -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h
r207735 r214215 65 65 typedef struct _WebKitDOMCharacterDataClass WebKitDOMCharacterDataClass; 66 66 67 typedef struct _WebKitDOMClientRect WebKitDOMClientRect; 68 typedef struct _WebKitDOMClientRectClass WebKitDOMClientRectClass; 69 70 typedef struct _WebKitDOMClientRectList WebKitDOMClientRectList; 71 typedef struct _WebKitDOMClientRectListClass WebKitDOMClientRectListClass; 72 67 73 typedef struct _WebKitDOMComment WebKitDOMComment; 68 74 typedef struct _WebKitDOMCommentClass WebKitDOMCommentClass; -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt
r211079 r214215 94 94 95 95 ADD_WK2_TEST_WEB_EXTENSION(WebExtensionTest WebExtensionTest.cpp) 96 ADD_WK2_TEST_WEB_EXTENSION(WebProcessTest AutocleanupsTest.cpp DOM NodeTest.cpp DOMNodeFilterTest.cpp DOMXPathNSResolverTest.cpp FrameTest.cpp WebProcessTest.cpp EditorTest.cpp)96 ADD_WK2_TEST_WEB_EXTENSION(WebProcessTest AutocleanupsTest.cpp DOMClientRectTest.cpp DOMNodeTest.cpp DOMNodeFilterTest.cpp DOMXPathNSResolverTest.cpp FrameTest.cpp WebProcessTest.cpp EditorTest.cpp) 97 97 98 98 ADD_WK2_TEST(InspectorTestServer InspectorTestServer.cpp) … … 102 102 ADD_WK2_TEST(TestContextMenu TestContextMenu.cpp) 103 103 ADD_WK2_TEST(TestCookieManager TestCookieManager.cpp) 104 ADD_WK2_TEST(TestDOMClientRect TestDOMClientRect.cpp) 104 105 ADD_WK2_TEST(TestDOMNode TestDOMNode.cpp) 105 106 ADD_WK2_TEST(TestDOMNodeFilter TestDOMNodeFilter.cpp)
Note: See TracChangeset
for help on using the changeset viewer.