Title: [217576] trunk
Revision
217576
Author
[email protected]
Date
2017-05-30 14:19:01 -0700 (Tue, 30 May 2017)

Log Message

REGRESSION(r215946): Can't reference a table cell in Google spreadsheet
https://bugs.webkit.org/show_bug.cgi?id=172703
<rdar://problem/32458086>

Reviewed by Ryosuke Niwa.

Source/WebCore:

We updated getClientRects() to return an array of DOMRect objects instead of
a ClientRectList type, to match the latest specification. As it turns out, this
is not Web-compatible as some content (as Google Spreadsheet) relies on the
return type having an item() operation.

This patch re-introduces a DOMRectList type, with an item() operation. The
DOMRectList name is currently not exposed to the Web as we do not know what's
going to get specified yet (https://github.com/w3c/csswg-drafts/issues/1479).

No new tests, updated existing tests.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMRect.h:
* dom/DOMRectList.cpp: Copied from Source/WebCore/dom/DOMRect.cpp.
(WebCore::DOMRectList::DOMRectList):
(WebCore::DOMRectList::~DOMRectList):
* dom/DOMRectList.h: Copied from Source/WebCore/dom/DOMRect.cpp.
(WebCore::DOMRectList::create):
(WebCore::DOMRectList::length):
(WebCore::DOMRectList::item):
* dom/DOMRectList.idl: Renamed from Source/WebCore/dom/DOMRect.cpp.
* dom/Element.cpp:
(WebCore::Element::getClientRects):
* dom/Element.h:
* dom/Element.idl:
* dom/Range.cpp:
(WebCore::Range::getClientRects):
* dom/Range.h:
* dom/Range.idl:
* page/Page.cpp:
(WebCore::Page::nonFastScrollableRects):
(WebCore::Page::touchEventRectsForEvent):
(WebCore::Page::passiveTouchEventListenerRects):
* page/Page.h:
* testing/Internals.cpp:
(WebCore::Internals::inspectorHighlightRects):
(WebCore::Internals::touchEventRectsForEvent):
(WebCore::Internals::passiveTouchEventListenerRects):
(WebCore::Internals::nonFastScrollableRects):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Fix GObject bindings accordingly.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
(WebKit::kit):
(WebKit::core):
(WebKit::wrapDOMRectList):
(webkit_dom_client_rect_list_constructed):
(webkit_dom_client_rect_list_item):
(webkit_dom_client_rect_list_get_length):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_get_client_rects):

LayoutTests:

Update existing tests to reflect behavior change.

* fast/dom/Element/getClientRects-return-type-expected.txt:
* fast/dom/Element/getClientRects-return-type.html:
* fast/dom/Range/getBoundingClientRect-getClientRects-return-type-expected.txt:
* fast/dom/Range/getBoundingClientRect-getClientRects-return-type.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (217575 => 217576)


--- trunk/LayoutTests/ChangeLog	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/LayoutTests/ChangeLog	2017-05-30 21:19:01 UTC (rev 217576)
@@ -1,3 +1,18 @@
+2017-05-30  Chris Dumez  <[email protected]>
+
+        REGRESSION(r215946): Can't reference a table cell in Google spreadsheet
+        https://bugs.webkit.org/show_bug.cgi?id=172703
+        <rdar://problem/32458086>
+
+        Reviewed by Ryosuke Niwa.
+
+        Update existing tests to reflect behavior change.
+
+        * fast/dom/Element/getClientRects-return-type-expected.txt:
+        * fast/dom/Element/getClientRects-return-type.html:
+        * fast/dom/Range/getBoundingClientRect-getClientRects-return-type-expected.txt:
+        * fast/dom/Range/getBoundingClientRect-getClientRects-return-type.html:
+
 2017-05-30  Javier Fernandez  <[email protected]>
 
         [css-align] Import W3C web platform tests for the CSS Box Alignment feature

Modified: trunk/LayoutTests/fast/dom/Element/getClientRects-return-type-expected.txt (217575 => 217576)


--- trunk/LayoutTests/fast/dom/Element/getClientRects-return-type-expected.txt	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/LayoutTests/fast/dom/Element/getClientRects-return-type-expected.txt	2017-05-30 21:19:01 UTC (rev 217576)
@@ -1,11 +1,11 @@
-Tests that Element.getClientRects() returns an array of DOMRect objects.
+Tests that Element.getClientRects() returns a list of DOMRect objects.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS rects.__proto__ is Array.prototype
 PASS rects.length is 1
 PASS rects[0].__proto__ is DOMRect.prototype
+PASS rects[0] is rects.item(0)
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/dom/Element/getClientRects-return-type.html (217575 => 217576)


--- trunk/LayoutTests/fast/dom/Element/getClientRects-return-type.html	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/LayoutTests/fast/dom/Element/getClientRects-return-type.html	2017-05-30 21:19:01 UTC (rev 217576)
@@ -3,12 +3,12 @@
 <body>
 <script src=""
 <script>
-description("Tests that Element.getClientRects() returns an array of DOMRect objects.");
+description("Tests that Element.getClientRects() returns a list of DOMRect objects.");
 
 const rects = document.body.getClientRects();
-shouldBe("rects.__proto__", "Array.prototype");
 shouldBe("rects.length", "1");
 shouldBe("rects[0].__proto__", "DOMRect.prototype");
+shouldBe("rects[0]", "rects.item(0)");
 </script>
 <script src=""
 </body>

Modified: trunk/LayoutTests/fast/dom/Range/getBoundingClientRect-getClientRects-return-type-expected.txt (217575 => 217576)


--- trunk/LayoutTests/fast/dom/Range/getBoundingClientRect-getClientRects-return-type-expected.txt	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/LayoutTests/fast/dom/Range/getBoundingClientRect-getClientRects-return-type-expected.txt	2017-05-30 21:19:01 UTC (rev 217576)
@@ -4,8 +4,8 @@
 
 
 PASS rect.__proto__ is DOMRect.prototype
-PASS rects.__proto__ is Array.prototype
 PASS rects.length > 0 is true
+PASS rects[0] is rects.item(0)
 PASS rects[0].__proto__ is DOMRect.prototype
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/fast/dom/Range/getBoundingClientRect-getClientRects-return-type.html (217575 => 217576)


--- trunk/LayoutTests/fast/dom/Range/getBoundingClientRect-getClientRects-return-type.html	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/LayoutTests/fast/dom/Range/getBoundingClientRect-getClientRects-return-type.html	2017-05-30 21:19:01 UTC (rev 217576)
@@ -14,8 +14,8 @@
     shouldBe("rect.__proto__", "DOMRect.prototype");
 
     rects = range.getClientRects();
-    shouldBe("rects.__proto__", "Array.prototype");
     shouldBeTrue("rects.length > 0");
+    shouldBe("rects[0]", "rects.item(0)");
     shouldBe("rects[0].__proto__", "DOMRect.prototype");
 
     finishJSTest();

Modified: trunk/Source/WebCore/CMakeLists.txt (217575 => 217576)


--- trunk/Source/WebCore/CMakeLists.txt	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-05-30 21:19:01 UTC (rev 217576)
@@ -426,6 +426,7 @@
     dom/DOMPointReadOnly.idl
     dom/DOMRect.idl
     dom/DOMRectInit.idl
+    dom/DOMRectList.idl
     dom/DOMRectReadOnly.idl
     dom/DOMStringList.idl
     dom/DOMStringMap.idl
@@ -1457,7 +1458,7 @@
     dom/DOMError.cpp
     dom/DOMImplementation.cpp
     dom/DOMNamedFlowCollection.cpp
-    dom/DOMRect.cpp
+    dom/DOMRectList.cpp
     dom/DOMStringList.cpp
     dom/DataTransfer.cpp
     dom/DataTransferItem.cpp

Modified: trunk/Source/WebCore/ChangeLog (217575 => 217576)


--- trunk/Source/WebCore/ChangeLog	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/ChangeLog	2017-05-30 21:19:01 UTC (rev 217576)
@@ -1,3 +1,55 @@
+2017-05-30  Chris Dumez  <[email protected]>
+
+        REGRESSION(r215946): Can't reference a table cell in Google spreadsheet
+        https://bugs.webkit.org/show_bug.cgi?id=172703
+        <rdar://problem/32458086>
+
+        Reviewed by Ryosuke Niwa.
+
+        We updated getClientRects() to return an array of DOMRect objects instead of
+        a ClientRectList type, to match the latest specification. As it turns out, this
+        is not Web-compatible as some content (as Google Spreadsheet) relies on the
+        return type having an item() operation.
+
+        This patch re-introduces a DOMRectList type, with an item() operation. The
+        DOMRectList name is currently not exposed to the Web as we do not know what's
+        going to get specified yet (https://github.com/w3c/csswg-drafts/issues/1479).
+
+        No new tests, updated existing tests.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/DOMRect.h:
+        * dom/DOMRectList.cpp: Copied from Source/WebCore/dom/DOMRect.cpp.
+        (WebCore::DOMRectList::DOMRectList):
+        (WebCore::DOMRectList::~DOMRectList):
+        * dom/DOMRectList.h: Copied from Source/WebCore/dom/DOMRect.cpp.
+        (WebCore::DOMRectList::create):
+        (WebCore::DOMRectList::length):
+        (WebCore::DOMRectList::item):
+        * dom/DOMRectList.idl: Renamed from Source/WebCore/dom/DOMRect.cpp.
+        * dom/Element.cpp:
+        (WebCore::Element::getClientRects):
+        * dom/Element.h:
+        * dom/Element.idl:
+        * dom/Range.cpp:
+        (WebCore::Range::getClientRects):
+        * dom/Range.h:
+        * dom/Range.idl:
+        * page/Page.cpp:
+        (WebCore::Page::nonFastScrollableRects):
+        (WebCore::Page::touchEventRectsForEvent):
+        (WebCore::Page::passiveTouchEventListenerRects):
+        * page/Page.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::inspectorHighlightRects):
+        (WebCore::Internals::touchEventRectsForEvent):
+        (WebCore::Internals::passiveTouchEventListenerRects):
+        (WebCore::Internals::nonFastScrollableRects):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2017-05-30  Ali Juma  <[email protected]>
 
         [CredentialManagement] Incorporate IDL updates from latest spec

Modified: trunk/Source/WebCore/DerivedSources.make (217575 => 217576)


--- trunk/Source/WebCore/DerivedSources.make	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/DerivedSources.make	2017-05-30 21:19:01 UTC (rev 217576)
@@ -366,6 +366,7 @@
     $(WebCore)/dom/DOMPointReadOnly.idl \
     $(WebCore)/dom/DOMRect.idl \
     $(WebCore)/dom/DOMRectInit.idl \
+    $(WebCore)/dom/DOMRectList.idl \
     $(WebCore)/dom/DOMRectReadOnly.idl \
     $(WebCore)/dom/DOMStringList.idl \
     $(WebCore)/dom/DOMStringMap.idl \

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (217575 => 217576)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-05-30 21:19:01 UTC (rev 217576)
@@ -1936,9 +1936,13 @@
 		465307D01DB6EE4800E4137C /* JSUIEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E045EF1DAA104F00B0D8B9 /* JSUIEventInit.h */; };
 		465307D11DB6EE4A00E4137C /* JSUIEventInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83E045EE1DAA104F00B0D8B9 /* JSUIEventInit.cpp */; };
 		465A8E791C8A24CE00E7D3E4 /* RuntimeApplicationChecksCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecksCocoa.mm */; };
+		466DC6AC1EDE021D00746224 /* JSDOMRectList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 466DC6AB1EDE021D00746224 /* JSDOMRectList.cpp */; };
+		466ED8D31EDE0144005E43F6 /* JSDOMRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = 466ED8D21EDE0135005E43F6 /* JSDOMRectList.h */; };
 		4671E0651D67A59600C6B497 /* CanvasPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4671E0631D67A57B00C6B497 /* CanvasPath.cpp */; };
 		4671E0661D67A59600C6B497 /* CanvasPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 4671E0641D67A57B00C6B497 /* CanvasPath.h */; };
 		467302021C4EFE7800BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h in Headers */ = {isa = PBXBuildFile; fileRef = 467302011C4EFE6600BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h */; };
+		468344DF1EDDFAAA00B7795B /* DOMRectList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 468344DD1EDDFA5F00B7795B /* DOMRectList.cpp */; };
+		468344E01EDDFAAA00B7795B /* DOMRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = 468344DE1EDDFA5F00B7795B /* DOMRectList.h */; };
 		4689F1AF1267BAE100E8D380 /* FileMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 4689F1AE1267BAE100E8D380 /* FileMetadata.h */; };
 		46B63F6C1C6E8D19002E914B /* JSEventTargetCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 46B63F6B1C6E8CDF002E914B /* JSEventTargetCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		46C696CB1E7205F700597937 /* CPUMonitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 46C696C91E7205E400597937 /* CPUMonitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3353,7 +3357,6 @@
 		830A36BD1DAC5FAD006D7D09 /* JSMouseEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 830A36BB1DAC5FA7006D7D09 /* JSMouseEventInit.h */; };
 		83120C701C56F3F6001CB112 /* HTMLDataElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 831D1F291C56ECA000F5F6C0 /* HTMLDataElement.cpp */; };
 		83120C711C56F3FB001CB112 /* HTMLDataElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B86A71C56E83A00F3F0E3 /* HTMLDataElement.h */; };
-		83149FF61EB38B3700089665 /* DOMRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83149FF51EB38B1200089665 /* DOMRect.cpp */; };
 		832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */; };
 		832B843619D8E57400B26055 /* SVGAnimateElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */; };
 		83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -9654,9 +9657,14 @@
 		463EB6201B8789CB0096ED51 /* TagCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagCollection.cpp; sourceTree = "<group>"; };
 		463EB6211B8789CB0096ED51 /* TagCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagCollection.h; sourceTree = "<group>"; };
 		465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecksCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RuntimeApplicationChecksCocoa.mm; sourceTree = "<group>"; };
+		466DC6AB1EDE021D00746224 /* JSDOMRectList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMRectList.cpp; sourceTree = "<group>"; };
+		466ED8D21EDE0135005E43F6 /* JSDOMRectList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMRectList.h; sourceTree = "<group>"; };
 		4671E0631D67A57B00C6B497 /* CanvasPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasPath.cpp; sourceTree = "<group>"; };
 		4671E0641D67A57B00C6B497 /* CanvasPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanvasPath.h; sourceTree = "<group>"; };
 		467302011C4EFE6600BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IgnoreOpensDuringUnloadCountIncrementer.h; sourceTree = "<group>"; };
+		468344DC1EDDFA5F00B7795B /* DOMRectList.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = DOMRectList.idl; sourceTree = "<group>"; };
+		468344DD1EDDFA5F00B7795B /* DOMRectList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DOMRectList.cpp; sourceTree = "<group>"; };
+		468344DE1EDDFA5F00B7795B /* DOMRectList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMRectList.h; sourceTree = "<group>"; };
 		4689F1AE1267BAE100E8D380 /* FileMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileMetadata.h; sourceTree = "<group>"; };
 		46B63F6B1C6E8CDF002E914B /* JSEventTargetCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventTargetCustom.h; sourceTree = "<group>"; };
 		46C696C91E7205E400597937 /* CPUMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPUMonitor.h; sourceTree = "<group>"; };
@@ -11440,7 +11448,6 @@
 		830784B11C52EE1900104D1D /* XMLDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLDocument.h; sourceTree = "<group>"; };
 		830A36BA1DAC5FA7006D7D09 /* JSMouseEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMouseEventInit.cpp; sourceTree = "<group>"; };
 		830A36BB1DAC5FA7006D7D09 /* JSMouseEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMouseEventInit.h; sourceTree = "<group>"; };
-		83149FF51EB38B1200089665 /* DOMRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMRect.cpp; sourceTree = "<group>"; };
 		831D1F291C56ECA000F5F6C0 /* HTMLDataElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDataElement.cpp; sourceTree = "<group>"; };
 		8329A4171EC25B2B008ED4BE /* DocumentAndElementEventHandlers.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DocumentAndElementEventHandlers.idl; sourceTree = "<group>"; };
 		8329DCC21C7A6AE300730B33 /* HTMLHyperlinkElementUtils.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLHyperlinkElementUtils.idl; sourceTree = "<group>"; };
@@ -22066,6 +22073,8 @@
 				0F4710B61DB56BE8002DCEC3 /* JSDOMRect.h */,
 				0F4710B71DB56BE8002DCEC3 /* JSDOMRectInit.cpp */,
 				0F4710B81DB56BE8002DCEC3 /* JSDOMRectInit.h */,
+				466DC6AB1EDE021D00746224 /* JSDOMRectList.cpp */,
+				466ED8D21EDE0135005E43F6 /* JSDOMRectList.h */,
 				0F4710B91DB56BE8002DCEC3 /* JSDOMRectReadOnly.cpp */,
 				0F4710BA1DB56BE8002DCEC3 /* JSDOMRectReadOnly.h */,
 				C5137CF011A58378004ADB99 /* JSDOMStringList.cpp */,
@@ -25696,9 +25705,11 @@
 				0F4966A11DB4090100A274BB /* DOMPointInit.idl */,
 				0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */,
 				0F49669C1DB408C100A274BB /* DOMPointReadOnly.idl */,
-				83149FF51EB38B1200089665 /* DOMRect.cpp */,
 				0F4710A91DB56AFC002DCEC3 /* DOMRect.h */,
 				0F4710AA1DB56AFC002DCEC3 /* DOMRect.idl */,
+				468344DD1EDDFA5F00B7795B /* DOMRectList.cpp */,
+				468344DE1EDDFA5F00B7795B /* DOMRectList.h */,
+				468344DC1EDDFA5F00B7795B /* DOMRectList.idl */,
 				0F4710AB1DB56AFC002DCEC3 /* DOMRectInit.h */,
 				0F4710AC1DB56AFC002DCEC3 /* DOMRectInit.idl */,
 				0F4710AD1DB56AFC002DCEC3 /* DOMRectReadOnly.h */,
@@ -27166,6 +27177,7 @@
 				BC5A86850C33676000EEA649 /* DOMSelection.h in Headers */,
 				C544274B11A57E7A0063A749 /* DOMStringList.h in Headers */,
 				BC64640A11D7F304006455B0 /* DOMStringMap.h in Headers */,
+				468344E01EDDFAAA00B7795B /* DOMRectList.h in Headers */,
 				188604B40F2E654A000B6443 /* DOMTimer.h in Headers */,
 				05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */,
 				76FC2B0C12370DA0006A991A /* DOMTokenList.h in Headers */,
@@ -27788,6 +27800,7 @@
 				BE8EF043171C8FF9009B48C3 /* JSAudioTrack.h in Headers */,
 				BE8EF045171C8FF9009B48C3 /* JSAudioTrackList.h in Headers */,
 				76FB9FF919A73E3A00420562 /* JSAutocompleteErrorEvent.h in Headers */,
+				466ED8D31EDE0144005E43F6 /* JSDOMRectList.h in Headers */,
 				BC124F000C26447A009E2349 /* JSBarProp.h in Headers */,
 				57C7A69F1E57917800C67D71 /* JSBasicCredential.h in Headers */,
 				BC946348107A936600857193 /* JSBeforeLoadEvent.h in Headers */,
@@ -30797,6 +30810,7 @@
 				5101846A0B08602A004A825F /* CachedPage.cpp in Sources */,
 				D0EDA774143E303C0028E383 /* CachedRawResource.cpp in Sources */,
 				BCB16C1F0979C3BD00467741 /* CachedResource.cpp in Sources */,
+				468344DF1EDDFAAA00B7795B /* DOMRectList.cpp in Sources */,
 				E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */,
 				BCB16C290979C3BD00467741 /* CachedResourceLoader.cpp in Sources */,
 				5081E3C33CE580C16EF8B48B /* CachedResourceRequest.cpp in Sources */,
@@ -31178,7 +31192,6 @@
 				2D5002F81B56D7810020AAF7 /* DOMPath.cpp in Sources */,
 				A9C6E4EB0D745E2B006442E9 /* DOMPlugin.cpp in Sources */,
 				A9C6E4EF0D745E38006442E9 /* DOMPluginArray.cpp in Sources */,
-				83149FF61EB38B3700089665 /* DOMRect.cpp in Sources */,
 				BC5A86840C33676000EEA649 /* DOMSelection.cpp in Sources */,
 				C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */,
 				188604B30F2E654A000B6443 /* DOMTimer.cpp in Sources */,
@@ -33887,6 +33900,7 @@
 				B10B6981140C174000BC1C26 /* WebVTTTokenizer.cpp in Sources */,
 				CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */,
 				F55B3DDF1251F12D003EF269 /* WeekInputType.cpp in Sources */,
+				466DC6AC1EDE021D00746224 /* JSDOMRectList.cpp in Sources */,
 				85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */,
 				2E19516B1B6598D200DF6EEF /* WheelEventDeltaFilter.cpp in Sources */,
 				2EEEE55C1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm in Sources */,

Deleted: trunk/Source/WebCore/dom/DOMRect.cpp (217575 => 217576)


--- trunk/Source/WebCore/dom/DOMRect.cpp	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/dom/DOMRect.cpp	2017-05-30 21:19:01 UTC (rev 217576)
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DOMRect.h"
-
-#include "FloatQuad.h"
-
-namespace WebCore {
-
-Vector<Ref<DOMRect>> createDOMRectVector(const Vector<FloatQuad>& quads)
-{
-    Vector<Ref<DOMRect>> result;
-    result.reserveInitialCapacity(quads.size());
-    for (auto& quad : quads)
-        result.uncheckedAppend(DOMRect::create(quad.boundingBox()));
-    return result;
-}
-
-}

Modified: trunk/Source/WebCore/dom/DOMRect.h (217575 => 217576)


--- trunk/Source/WebCore/dom/DOMRect.h	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/dom/DOMRect.h	2017-05-30 21:19:01 UTC (rev 217576)
@@ -58,6 +58,4 @@
     DOMRect() = default;
 };
 
-WEBCORE_EXPORT Vector<Ref<DOMRect>> createDOMRectVector(const Vector<FloatQuad>&);
-
 }

Copied: trunk/Source/WebCore/dom/DOMRectList.cpp (from rev 217575, trunk/Source/WebCore/dom/DOMRect.cpp) (0 => 217576)


--- trunk/Source/WebCore/dom/DOMRectList.cpp	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMRectList.cpp	2017-05-30 21:19:01 UTC (rev 217576)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DOMRectList.h"
+
+#include "DOMRect.h"
+
+namespace WebCore {
+
+DOMRectList::DOMRectList(const Vector<FloatQuad>& quads)
+{
+    m_items.reserveInitialCapacity(quads.size());
+    for (auto& quad : quads)
+        m_items.uncheckedAppend(DOMRect::create(quad.boundingBox()));
+}
+
+DOMRectList::~DOMRectList()
+{
+}
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/dom/DOMRectList.h (from rev 217575, trunk/Source/WebCore/dom/DOMRect.cpp) (0 => 217576)


--- trunk/Source/WebCore/dom/DOMRectList.h	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMRectList.h	2017-05-30 21:19:01 UTC (rev 217576)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "FloatQuad.h"
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class DOMRect;
+
+class DOMRectList : public RefCounted<DOMRectList> {
+public:
+    static Ref<DOMRectList> create(const Vector<FloatQuad>& quads) { return adoptRef(*new DOMRectList(quads)); }
+    static Ref<DOMRectList> create() { return adoptRef(*new DOMRectList()); }
+    WEBCORE_EXPORT ~DOMRectList();
+
+    unsigned length() const { return m_items.size(); }
+    DOMRect* item(unsigned index) { return index < m_items.size() ? m_items[index].ptr() : nullptr; }
+
+private:
+    WEBCORE_EXPORT explicit DOMRectList(const Vector<FloatQuad>& quads);
+    DOMRectList() = default;
+
+    Vector<Ref<DOMRect>> m_items;
+};
+
+}

Copied: trunk/Source/WebCore/dom/DOMRectList.idl (from rev 217575, trunk/Source/WebCore/dom/DOMRect.cpp) (0 => 217576)


--- trunk/Source/WebCore/dom/DOMRectList.idl	                        (rev 0)
+++ trunk/Source/WebCore/dom/DOMRectList.idl	2017-05-30 21:19:01 UTC (rev 217576)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+     ExportMacro=WEBCORE_EXPORT,
+     ImplementationLacksVTable,
+     NoInterfaceObject
+] interface DOMRectList {
+    readonly attribute unsigned long length;
+    getter DOMRect item(unsigned long index);
+};

Modified: trunk/Source/WebCore/dom/Element.cpp (217575 => 217576)


--- trunk/Source/WebCore/dom/Element.cpp	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/dom/Element.cpp	2017-05-30 21:19:01 UTC (rev 217576)
@@ -38,6 +38,7 @@
 #include "CustomElementReactionQueue.h"
 #include "CustomElementRegistry.h"
 #include "DOMRect.h"
+#include "DOMRectList.h"
 #include "DOMTokenList.h"
 #include "DocumentAnimation.h"
 #include "DocumentSharedObjectPool.h"
@@ -1144,13 +1145,13 @@
     return absoluteEventBoundsOfElementAndDescendants(includesFixedPositionElements);
 }
 
-Vector<Ref<DOMRect>> Element::getClientRects()
+Ref<DOMRectList> Element::getClientRects()
 {
     document().updateLayoutIgnorePendingStylesheets();
 
     RenderBoxModelObject* renderBoxModelObject = this->renderBoxModelObject();
     if (!renderBoxModelObject)
-        return { };
+        return DOMRectList::create();
 
     // FIXME: Handle SVG elements.
     // FIXME: Handle table/inline-table with a caption.
@@ -1158,7 +1159,7 @@
     Vector<FloatQuad> quads;
     renderBoxModelObject->absoluteQuads(quads);
     document().convertAbsoluteToClientQuads(quads, renderBoxModelObject->style());
-    return createDOMRectVector(quads);
+    return DOMRectList::create(quads);
 }
 
 Ref<DOMRect> Element::getBoundingClientRect()

Modified: trunk/Source/WebCore/dom/Element.h (217575 => 217576)


--- trunk/Source/WebCore/dom/Element.h	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/dom/Element.h	2017-05-30 21:19:01 UTC (rev 217576)
@@ -40,6 +40,7 @@
 class CustomElementReactionQueue;
 class DatasetDOMStringMap;
 class DOMRect;
+class DOMRectList;
 class DOMTokenList;
 class ElementRareData;
 class HTMLDocument;
@@ -172,7 +173,7 @@
 
     WEBCORE_EXPORT IntRect boundsInRootViewSpace();
 
-    Vector<Ref<DOMRect>> getClientRects();
+    Ref<DOMRectList> getClientRects();
     Ref<DOMRect> getBoundingClientRect();
 
     // Returns the absolute bounding box translated into client coordinates.

Modified: trunk/Source/WebCore/dom/Element.idl (217575 => 217576)


--- trunk/Source/WebCore/dom/Element.idl	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/dom/Element.idl	2017-05-30 21:19:01 UTC (rev 217576)
@@ -68,7 +68,7 @@
     [MayThrowException] void insertAdjacentText(DOMString where, DOMString data); // Historical.
 
     // CSSOM-view extensions (https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface).
-    sequence<DOMRect> getClientRects();
+    DOMRectList getClientRects();
     [NewObject] DOMRect getBoundingClientRect();
     void scrollIntoView(optional boolean alignWithTop = true); // FIXME: Parameter type should be (boolean or object).
     [ImplementedAs=scrollTo] void scroll(optional ScrollToOptions options);

Modified: trunk/Source/WebCore/dom/Range.cpp (217575 => 217576)


--- trunk/Source/WebCore/dom/Range.cpp	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/dom/Range.cpp	2017-05-30 21:19:01 UTC (rev 217576)
@@ -27,6 +27,7 @@
 
 #include "Comment.h"
 #include "DOMRect.h"
+#include "DOMRectList.h"
 #include "DocumentFragment.h"
 #include "Editing.h"
 #include "Event.h"
@@ -1762,9 +1763,9 @@
     return setEnd(*endContainer, end.deepEquivalent().computeOffsetInContainerNode());
 }
 
-Vector<Ref<DOMRect>> Range::getClientRects() const
+Ref<DOMRectList> Range::getClientRects() const
 {
-    return createDOMRectVector(borderAndTextQuads(CoordinateSpace::Client));
+    return DOMRectList::create(borderAndTextQuads(CoordinateSpace::Client));
 }
 
 Ref<DOMRect> Range::getBoundingClientRect() const

Modified: trunk/Source/WebCore/dom/Range.h (217575 => 217576)


--- trunk/Source/WebCore/dom/Range.h	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/dom/Range.h	2017-05-30 21:19:01 UTC (rev 217576)
@@ -34,8 +34,9 @@
 
 namespace WebCore {
 
+class ContainerNode;
 class DOMRect;
-class ContainerNode;
+class DOMRectList;
 class Document;
 class DocumentFragment;
 class FloatQuad;
@@ -141,7 +142,7 @@
     // for details.
     WEBCORE_EXPORT ExceptionOr<void> expand(const String&);
 
-    Vector<Ref<DOMRect>> getClientRects() const;
+    Ref<DOMRectList> getClientRects() const;
     Ref<DOMRect> getBoundingClientRect() const;
 
 #if ENABLE(TREE_DEBUGGING)

Modified: trunk/Source/WebCore/dom/Range.idl (217575 => 217576)


--- trunk/Source/WebCore/dom/Range.idl	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/dom/Range.idl	2017-05-30 21:19:01 UTC (rev 217576)
@@ -64,7 +64,7 @@
     DOMString toString(); // FIXME: Should be stringifier once we support it.
 
     // Extensions from CSSOM-view (https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface).
-    sequence<DOMRect> getClientRects();
+    DOMRectList getClientRects();
     [NewObject] DOMRect getBoundingClientRect();
 
     // Extensions from DOMParsing and Serialization specification (https://w3c.github.io/DOM-Parsing/#extensions-to-the-range-interface).

Modified: trunk/Source/WebCore/page/Page.cpp (217575 => 217576)


--- trunk/Source/WebCore/page/Page.cpp	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/page/Page.cpp	2017-05-30 21:19:01 UTC (rev 217576)
@@ -32,6 +32,7 @@
 #include "ContextMenuClient.h"
 #include "ContextMenuController.h"
 #include "DOMRect.h"
+#include "DOMRectList.h"
 #include "DatabaseProvider.h"
 #include "DiagnosticLoggingClient.h"
 #include "DiagnosticLoggingKeys.h"
@@ -405,7 +406,7 @@
     return String();
 }
 
-Vector<Ref<DOMRect>> Page::nonFastScrollableRects()
+Ref<DOMRectList> Page::nonFastScrollableRects()
 {
     if (Document* document = m_mainFrame->document())
         document->updateLayout();
@@ -421,10 +422,10 @@
     for (size_t i = 0; i < rects.size(); ++i)
         quads[i] = FloatRect(rects[i]);
 
-    return createDOMRectVector(quads);
+    return DOMRectList::create(quads);
 }
 
-Vector<Ref<DOMRect>> Page::touchEventRectsForEvent(const String& eventName)
+Ref<DOMRectList> Page::touchEventRectsForEvent(const String& eventName)
 {
     if (Document* document = m_mainFrame->document()) {
         document->updateLayout();
@@ -444,10 +445,10 @@
     for (size_t i = 0; i < rects.size(); ++i)
         quads[i] = FloatRect(rects[i]);
 
-    return createDOMRectVector(quads);
+    return DOMRectList::create(quads);
 }
 
-Vector<Ref<DOMRect>> Page::passiveTouchEventListenerRects()
+Ref<DOMRectList> Page::passiveTouchEventListenerRects()
 {
     if (Document* document = m_mainFrame->document()) {
         document->updateLayout();
@@ -464,7 +465,7 @@
     for (size_t i = 0; i < rects.size(); ++i)
         quads[i] = FloatRect(rects[i]);
 
-    return createDOMRectVector(quads);
+    return DOMRectList::create(quads);
 }
 
 #if ENABLE(VIEW_MODE_CSS_MEDIA)

Modified: trunk/Source/WebCore/page/Page.h (217575 => 217576)


--- trunk/Source/WebCore/page/Page.h	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/page/Page.h	2017-05-30 21:19:01 UTC (rev 217576)
@@ -85,6 +85,7 @@
 class ContextMenuClient;
 class ContextMenuController;
 class DOMRect;
+class DOMRectList;
 class DatabaseProvider;
 class DiagnosticLoggingClient;
 class DragCaretController;
@@ -238,10 +239,10 @@
 
     WEBCORE_EXPORT String scrollingStateTreeAsText();
     WEBCORE_EXPORT String synchronousScrollingReasonsAsText();
-    WEBCORE_EXPORT Vector<Ref<DOMRect>> nonFastScrollableRects();
+    WEBCORE_EXPORT Ref<DOMRectList> nonFastScrollableRects();
 
-    WEBCORE_EXPORT Vector<Ref<DOMRect>> touchEventRectsForEvent(const String& eventName);
-    WEBCORE_EXPORT Vector<Ref<DOMRect>> passiveTouchEventListenerRects();
+    WEBCORE_EXPORT Ref<DOMRectList> touchEventRectsForEvent(const String& eventName);
+    WEBCORE_EXPORT Ref<DOMRectList> passiveTouchEventListenerRects();
 
     Settings& settings() const { return *m_settings; }
     ProgressTracker& progress() const { return *m_progress; }

Modified: trunk/Source/WebCore/testing/Internals.cpp (217575 => 217576)


--- trunk/Source/WebCore/testing/Internals.cpp	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/testing/Internals.cpp	2017-05-30 21:19:01 UTC (rev 217576)
@@ -44,6 +44,7 @@
 #include "Cursor.h"
 #include "DOMPath.h"
 #include "DOMRect.h"
+#include "DOMRectList.h"
 #include "DOMStringList.h"
 #include "DOMWindow.h"
 #include "DisplayList.h"
@@ -1362,7 +1363,7 @@
     return DOMRect::create(renderer->absoluteBoundingBoxRectIgnoringTransforms());
 }
 
-ExceptionOr<Vector<Ref<DOMRect>>> Internals::inspectorHighlightRects()
+ExceptionOr<Ref<DOMRectList>> Internals::inspectorHighlightRects()
 {
     Document* document = contextDocument();
     if (!document || !document->page())
@@ -1370,7 +1371,7 @@
 
     Highlight highlight;
     document->page()->inspectorController().getHighlight(highlight, InspectorOverlay::CoordinateSystem::View);
-    return createDOMRectVector(highlight.quads);
+    return DOMRectList::create(highlight.quads);
 }
 
 ExceptionOr<String> Internals::inspectorHighlightObject()
@@ -1806,7 +1807,7 @@
     return document->touchEventHandlerCount();
 }
 
-ExceptionOr<Vector<Ref<DOMRect>>> Internals::touchEventRectsForEvent(const String& eventName)
+ExceptionOr<Ref<DOMRectList>> Internals::touchEventRectsForEvent(const String& eventName)
 {
     Document* document = contextDocument();
     if (!document || !document->page())
@@ -1815,7 +1816,7 @@
     return document->page()->touchEventRectsForEvent(eventName);
 }
 
-ExceptionOr<Vector<Ref<DOMRect>>> Internals::passiveTouchEventListenerRects()
+ExceptionOr<Ref<DOMRectList>> Internals::passiveTouchEventListenerRects()
 {
     Document* document = contextDocument();
     if (!document || !document->page())
@@ -2337,7 +2338,7 @@
     return page->synchronousScrollingReasonsAsText();
 }
 
-ExceptionOr<Vector<Ref<DOMRect>>> Internals::nonFastScrollableRects() const
+ExceptionOr<Ref<DOMRectList>> Internals::nonFastScrollableRects() const
 {
     Document* document = contextDocument();
     if (!document || !document->frame())
@@ -2345,7 +2346,7 @@
 
     Page* page = document->page();
     if (!page)
-        return Vector<Ref<DOMRect>> { };
+        return DOMRectList::create();
 
     return page->nonFastScrollableRects();
 }

Modified: trunk/Source/WebCore/testing/Internals.h (217575 => 217576)


--- trunk/Source/WebCore/testing/Internals.h	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/testing/Internals.h	2017-05-30 21:19:01 UTC (rev 217576)
@@ -44,6 +44,7 @@
 
 class AudioContext;
 class DOMRect;
+class DOMRectList;
 class DOMURL;
 class DOMWindow;
 class Document;
@@ -184,7 +185,7 @@
 
     Ref<DOMRect> boundingBox(Element&);
 
-    ExceptionOr<Vector<Ref<DOMRect>>> inspectorHighlightRects();
+    ExceptionOr<Ref<DOMRectList>> inspectorHighlightRects();
     ExceptionOr<String> inspectorHighlightObject();
 
     ExceptionOr<unsigned> markerCountForNode(Node&, const String&);
@@ -244,8 +245,8 @@
     ExceptionOr<unsigned> wheelEventHandlerCount();
     ExceptionOr<unsigned> touchEventHandlerCount();
 
-    ExceptionOr<Vector<Ref<DOMRect>>> touchEventRectsForEvent(const String&);
-    ExceptionOr<Vector<Ref<DOMRect>>> passiveTouchEventListenerRects();
+    ExceptionOr<Ref<DOMRectList>> touchEventRectsForEvent(const String&);
+    ExceptionOr<Ref<DOMRectList>> passiveTouchEventListenerRects();
 
     ExceptionOr<RefPtr<NodeList>> nodesFromRect(Document&, int x, int y, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent) const;
 
@@ -299,7 +300,7 @@
     ExceptionOr<String> repaintRectsAsText() const;
     ExceptionOr<String> scrollingStateTreeAsText() const;
     ExceptionOr<String> mainThreadScrollingReasons() const;
-    ExceptionOr<Vector<Ref<DOMRect>>> nonFastScrollableRects() const;
+    ExceptionOr<Ref<DOMRectList>> nonFastScrollableRects() const;
 
     ExceptionOr<void> setElementUsesDisplayListDrawing(Element&, bool usesDisplayListDrawing);
     ExceptionOr<void> setElementTracksDisplayListReplay(Element&, bool isTrackingReplay);

Modified: trunk/Source/WebCore/testing/Internals.idl (217575 => 217576)


--- trunk/Source/WebCore/testing/Internals.idl	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebCore/testing/Internals.idl	2017-05-30 21:19:01 UTC (rev 217576)
@@ -153,7 +153,7 @@
 
     DOMRect boundingBox(Element element);
 
-    [MayThrowException] sequence<DOMRect> inspectorHighlightRects();
+    [MayThrowException] DOMRectList inspectorHighlightRects();
     [MayThrowException] DOMString inspectorHighlightObject();
 
     [MayThrowException] unsigned long markerCountForNode(Node node, DOMString markerType);
@@ -216,8 +216,8 @@
     [MayThrowException] unsigned long wheelEventHandlerCount();
     [MayThrowException] unsigned long touchEventHandlerCount();
 
-    [MayThrowException] sequence<DOMRect> touchEventRectsForEvent(DOMString eventName);
-    [MayThrowException] sequence<DOMRect> passiveTouchEventListenerRects();
+    [MayThrowException] DOMRectList touchEventRectsForEvent(DOMString eventName);
+    [MayThrowException] DOMRectList passiveTouchEventListenerRects();
 
     [MayThrowException] NodeList? nodesFromRect(Document document, long x, long y,
         unsigned long topPadding, unsigned long rightPadding, unsigned long bottomPadding, unsigned long leftPadding,
@@ -274,7 +274,7 @@
 
     [MayThrowException] DOMString scrollingStateTreeAsText();
     [MayThrowException] DOMString mainThreadScrollingReasons(); // FIXME: rename to synchronousScrollingReasons().
-    [MayThrowException] sequence<DOMRect> nonFastScrollableRects();
+    [MayThrowException] DOMRectList nonFastScrollableRects();
 
     [MayThrowException] DOMString repaintRectsAsText();
 

Modified: trunk/Source/WebKit2/ChangeLog (217575 => 217576)


--- trunk/Source/WebKit2/ChangeLog	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebKit2/ChangeLog	2017-05-30 21:19:01 UTC (rev 217576)
@@ -1,3 +1,24 @@
+2017-05-30  Chris Dumez  <[email protected]>
+
+        REGRESSION(r215946): Can't reference a table cell in Google spreadsheet
+        https://bugs.webkit.org/show_bug.cgi?id=172703
+        <rdar://problem/32458086>
+
+        Reviewed by Ryosuke Niwa.
+
+        Fix GObject bindings accordingly.
+
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
+        (WebKit::kit):
+        (WebKit::core):
+        (WebKit::wrapDOMRectList):
+        (webkit_dom_client_rect_list_constructed):
+        (webkit_dom_client_rect_list_item):
+        (webkit_dom_client_rect_list_get_length):
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h:
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
+        (webkit_dom_element_get_client_rects):
+
 2017-05-30  Daniel Bates  <[email protected]>
 
         [WK2] Add runBeforeUnloadConfirmPanel WKUIDelegate SPI; support onbeforeunload confirm panel in MiniBrowser

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp (217575 => 217576)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp	2017-05-30 21:19:01 UTC (rev 217576)
@@ -35,43 +35,31 @@
 
 #define WEBKIT_DOM_CLIENT_RECT_LIST_GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE(obj, WEBKIT_DOM_TYPE_CLIENT_RECT_LIST, WebKitDOMClientRectListPrivate)
 
-class ClientRectList : public RefCounted<ClientRectList> {
-public:
-    static Ref<ClientRectList> create(WTF::Vector<Ref<WebCore::DOMRect>>&& items)
-    {
-        return adoptRef(*new ClientRectList(WTFMove(items)));
-    }
-
-    const WTF::Vector<Ref<WebCore::DOMRect>>& items() const { return m_items; }
-
-private:
-    ClientRectList(WTF::Vector<Ref<WebCore::DOMRect>>&& items)
-        : m_items(WTFMove(items))
-    { }
-
-    WTF::Vector<Ref<WebCore::DOMRect>> m_items;
-};
-
 typedef struct _WebKitDOMClientRectListPrivate {
-    RefPtr<ClientRectList> coreObject;
+    RefPtr<WebCore::DOMRectList> coreObject;
 } WebKitDOMClientRectListPrivate;
 
 namespace WebKit {
 
-WebKitDOMClientRectList* kit(WTF::Vector<Ref<WebCore::DOMRect>>&& obj)
+WebKitDOMClientRectList* kit(WebCore::DOMRectList* obj)
 {
-    return wrapClientRectList(WTFMove(obj));
+    if (!obj)
+        return nullptr;
+
+    if (gpointer ret = DOMObjectCache::get(obj))
+        return WEBKIT_DOM_CLIENT_RECT_LIST(ret);
+
+    return wrapDOMRectList(obj);
 }
 
-static ClientRectList* core(WebKitDOMClientRectList* request)
+WebCore::DOMRectList* core(WebKitDOMClientRectList* request)
 {
-    return request ? static_cast<ClientRectList*>(WEBKIT_DOM_OBJECT(request)->coreObject) : nullptr;
+    return request ? static_cast<WebCore::DOMRectList*>(WEBKIT_DOM_OBJECT(request)->coreObject) : nullptr;
 }
 
-WebKitDOMClientRectList* wrapClientRectList(WTF::Vector<Ref<WebCore::DOMRect>>&& coreObject)
+WebKitDOMClientRectList* wrapDOMRectList(WebCore::DOMRectList* coreObject)
 {
-    auto list = ClientRectList::create(WTFMove(coreObject));
-    return WEBKIT_DOM_CLIENT_RECT_LIST(g_object_new(WEBKIT_DOM_TYPE_CLIENT_RECT_LIST, "core-object", list.ptr(), nullptr));
+    return WEBKIT_DOM_CLIENT_RECT_LIST(g_object_new(WEBKIT_DOM_TYPE_CLIENT_RECT_LIST, "core-object", coreObject, nullptr));
 }
 
 } // namespace WebKit
@@ -112,7 +100,8 @@
     G_OBJECT_CLASS(webkit_dom_client_rect_list_parent_class)->constructed(object);
 
     WebKitDOMClientRectListPrivate* priv = WEBKIT_DOM_CLIENT_RECT_LIST_GET_PRIVATE(object);
-    priv->coreObject = static_cast<ClientRectList*>(WEBKIT_DOM_OBJECT(object)->coreObject);
+    priv->coreObject = static_cast<WebCore::DOMRectList*>(WEBKIT_DOM_OBJECT(object)->coreObject);
+    WebKit::DOMObjectCache::put(priv->coreObject.get(), object);
 }
 
 static void webkit_dom_client_rect_list_class_init(WebKitDOMClientRectListClass* requestClass)
@@ -145,8 +134,8 @@
 {
     WebCore::JSMainThreadNullState state;
     g_return_val_if_fail(WEBKIT_DOM_IS_CLIENT_RECT_LIST(self), nullptr);
-    auto& list = WebKit::core(self)->items();
-    RefPtr<WebCore::DOMRect> gobjectResult = index >= list.size() ? nullptr : list[index].ptr();
+    auto* list = WebKit::core(self);
+    RefPtr<WebCore::DOMRect> gobjectResult = WTF::getPtr(list->item(index));
     return WebKit::kit(gobjectResult.get());
 }
 
@@ -154,5 +143,5 @@
 {
     WebCore::JSMainThreadNullState state;
     g_return_val_if_fail(WEBKIT_DOM_IS_CLIENT_RECT_LIST(self), 0);
-    return WebKit::core(self)->items().size();
+    return WebKit::core(self)->length();
 }

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h (217575 => 217576)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h	2017-05-30 21:19:01 UTC (rev 217576)
@@ -19,11 +19,11 @@
 
 #pragma once
 
-#include <WebCore/DOMRect.h>
+#include <WebCore/DOMRectList.h>
 #include <webkitdom/WebKitDOMClientRectList.h>
-#include <wtf/Vector.h>
 
 namespace WebKit {
-WebKitDOMClientRectList* wrapClientRectList(WTF::Vector<Ref<WebCore::DOMRect>>&&);
-WebKitDOMClientRectList* kit(WTF::Vector<Ref<WebCore::DOMRect>>&&);
+WebKitDOMClientRectList* wrapDOMRectList(WebCore::DOMRectList*);
+WebKitDOMClientRectList* kit(WebCore::DOMRectList*);
+WebCore::DOMRectList* core(WebKitDOMClientRectList*);
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp (217575 => 217576)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp	2017-05-30 21:18:01 UTC (rev 217575)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp	2017-05-30 21:19:01 UTC (rev 217576)
@@ -1239,7 +1239,7 @@
     WebCore::JSMainThreadNullState state;
     g_return_val_if_fail(WEBKIT_DOM_IS_ELEMENT(self), nullptr);
     WebCore::Element* item = WebKit::core(self);
-    return WebKit::kit(item->getClientRects());
+    return WebKit::kit(item->getClientRects().ptr());
 }
 
 WebKitDOMElement* webkit_dom_element_get_offset_parent(WebKitDOMElement* self)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to