RESOLVED FIXED 171226
Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
https://bugs.webkit.org/show_bug.cgi?id=171226
Summary Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
Frédéric Wang (:fredw)
Reported 2017-04-24 09:42:18 PDT
This is a edge case, covered by the following test: http://w3c-test.org/cssom-view/cssom-getBoundingClientRect-002.html https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect "Let list be the result of invoking getClientRects() on the same element this method was invoked on. If the list is empty return a DOMRect object whose x, y, width and height members are zero." https://drafts.csswg.org/cssom-view/#dom-element-getclientrects "If the element on which it was invoked does not have an associated layout box return an empty sequence and stop this algorithm."
Attachments
WIP Patch (6.93 KB, patch)
2017-04-26 21:11 PDT, Chris Dumez
no flags
Patch (52.43 KB, patch)
2017-04-26 22:38 PDT, Chris Dumez
no flags
Patch (52.82 KB, patch)
2017-04-26 22:49 PDT, Chris Dumez
no flags
Patch (53.13 KB, patch)
2017-04-26 23:05 PDT, Chris Dumez
no flags
Patch (53.14 KB, patch)
2017-04-26 23:09 PDT, Chris Dumez
no flags
Patch (53.13 KB, patch)
2017-04-26 23:13 PDT, Chris Dumez
no flags
Archive of layout-test-results from ews102 for mac-elcapitan (947.76 KB, application/zip)
2017-04-27 00:13 PDT, Build Bot
no flags
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (933.89 KB, application/zip)
2017-04-27 00:24 PDT, Build Bot
no flags
Archive of layout-test-results from ews115 for mac-elcapitan (1.72 MB, application/zip)
2017-04-27 00:34 PDT, Build Bot
no flags
Archive of layout-test-results from ews121 for ios-simulator-wk2 (15.23 MB, application/zip)
2017-04-27 00:48 PDT, Build Bot
no flags
Patch (67.59 KB, patch)
2017-04-27 08:45 PDT, Chris Dumez
no flags
Patch (67.38 KB, patch)
2017-04-27 10:04 PDT, Chris Dumez
no flags
Archive of layout-test-results from ews124 for ios-simulator-wk2 (916.00 KB, application/zip)
2017-04-27 11:49 PDT, Build Bot
no flags
Patch (71.40 KB, patch)
2017-04-27 12:02 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-04-24 09:48:29 PDT
I suspect the issue is rather that we return a ClientRect instead of a DOMRect. So does Chrome it seems. Firefox seems to behave as per spec though.
Chris Dumez
Comment 2 2017-04-26 21:11:39 PDT
Created attachment 308332 [details] WIP Patch
Build Bot
Comment 3 2017-04-26 21:13:03 PDT
Attachment 308332 [details] did not pass style-queue: ERROR: Source/WebCore/dom/Element.cpp:1149: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 4 2017-04-26 21:13:21 PDT
@Frédéric Wang: In the future, it would be nicer to land baselines with FAIL lines rather than skipping the tests.
Chris Dumez
Comment 5 2017-04-26 22:38:03 PDT
Chris Dumez
Comment 6 2017-04-26 22:49:39 PDT
Chris Dumez
Comment 7 2017-04-26 23:05:33 PDT
Frédéric Wang (:fredw)
Comment 8 2017-04-26 23:07:52 PDT
(In reply to Chris Dumez from comment #4) > @Frédéric Wang: In the future, it would be nicer to land baselines with FAIL > lines rather than skipping the tests. Thanks for the information, I'll do that in the future.
Chris Dumez
Comment 9 2017-04-26 23:09:20 PDT
Chris Dumez
Comment 10 2017-04-26 23:13:25 PDT
Build Bot
Comment 11 2017-04-27 00:13:52 PDT
Comment on attachment 308346 [details] Patch Attachment 308346 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3617158 New failing tests: media/track/track-cue-overlap-snap-to-lines-not-set.html
Build Bot
Comment 12 2017-04-27 00:13:53 PDT
Created attachment 308353 [details] Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 13 2017-04-27 00:24:42 PDT
Comment on attachment 308346 [details] Patch Attachment 308346 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/3617230 New failing tests: media/track/track-cue-overlap-snap-to-lines-not-set.html
Build Bot
Comment 14 2017-04-27 00:24:43 PDT
Created attachment 308356 [details] Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 15 2017-04-27 00:34:44 PDT
Comment on attachment 308346 [details] Patch Attachment 308346 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3617248 New failing tests: media/track/track-cue-overlap-snap-to-lines-not-set.html
Build Bot
Comment 16 2017-04-27 00:34:46 PDT
Created attachment 308359 [details] Archive of layout-test-results from ews115 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 17 2017-04-27 00:48:42 PDT
Comment on attachment 308346 [details] Patch Attachment 308346 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/3617247 New failing tests: media/track/track-cue-overlap-snap-to-lines-not-set.html fast/dom/collection-iterators.html fast/visual-viewport/zoomed-fixed.html fast/visual-viewport/zoomed-fixed-header-and-footer.html
Build Bot
Comment 18 2017-04-27 00:48:45 PDT
Created attachment 308362 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Chris Dumez
Comment 19 2017-04-27 08:45:41 PDT
Chris Dumez
Comment 20 2017-04-27 10:04:56 PDT
Build Bot
Comment 21 2017-04-27 11:49:38 PDT
Comment on attachment 308405 [details] Patch Attachment 308405 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/3620755 New failing tests: fast/visual-viewport/zoomed-fixed.html
Build Bot
Comment 22 2017-04-27 11:49:40 PDT
Created attachment 308419 [details] Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Chris Dumez
Comment 23 2017-04-27 12:02:39 PDT
WebKit Commit Bot
Comment 24 2017-04-27 14:00:54 PDT
Comment on attachment 308422 [details] Patch Clearing flags on attachment: 308422 Committed r215892: <http://trac.webkit.org/changeset/215892>
WebKit Commit Bot
Comment 25 2017-04-27 14:00:56 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.