Bug 171226 - Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
Summary: Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 10
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on: 171215
Blocks: 171418
  Show dependency treegraph
 
Reported: 2017-04-24 09:42 PDT by Frédéric Wang (:fredw)
Modified: 2017-04-27 20:27 PDT (History)
14 users (show)

See Also:


Attachments
WIP Patch (6.93 KB, patch)
2017-04-26 21:11 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (52.43 KB, patch)
2017-04-26 22:38 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (52.82 KB, patch)
2017-04-26 22:49 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (53.13 KB, patch)
2017-04-26 23:05 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (53.14 KB, patch)
2017-04-26 23:09 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (53.13 KB, patch)
2017-04-26 23:13 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
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 Details
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 Details
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 Details
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 Details
Patch (67.59 KB, patch)
2017-04-27 08:45 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (67.38 KB, patch)
2017-04-27 10:04 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
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 Details
Patch (71.40 KB, patch)
2017-04-27 12:02 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 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."
Comment 1 Chris Dumez 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.
Comment 2 Chris Dumez 2017-04-26 21:11:39 PDT
Created attachment 308332 [details]
WIP Patch
Comment 3 Build Bot 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.
Comment 4 Chris Dumez 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.
Comment 5 Chris Dumez 2017-04-26 22:38:03 PDT
Created attachment 308338 [details]
Patch
Comment 6 Chris Dumez 2017-04-26 22:49:39 PDT
Created attachment 308341 [details]
Patch
Comment 7 Chris Dumez 2017-04-26 23:05:33 PDT
Created attachment 308343 [details]
Patch
Comment 8 Frédéric Wang (:fredw) 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.
Comment 9 Chris Dumez 2017-04-26 23:09:20 PDT
Created attachment 308344 [details]
Patch
Comment 10 Chris Dumez 2017-04-26 23:13:25 PDT
Created attachment 308346 [details]
Patch
Comment 11 Build Bot 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
Comment 12 Build Bot 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
Comment 13 Build Bot 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
Comment 14 Build Bot 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
Comment 15 Build Bot 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
Comment 16 Build Bot 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
Comment 17 Build Bot 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
Comment 18 Build Bot 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
Comment 19 Chris Dumez 2017-04-27 08:45:41 PDT
Created attachment 308393 [details]
Patch
Comment 20 Chris Dumez 2017-04-27 10:04:56 PDT
Created attachment 308405 [details]
Patch
Comment 21 Build Bot 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
Comment 22 Build Bot 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
Comment 23 Chris Dumez 2017-04-27 12:02:39 PDT
Created attachment 308422 [details]
Patch
Comment 24 WebKit Commit Bot 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>
Comment 25 WebKit Commit Bot 2017-04-27 14:00:56 PDT
All reviewed patches have been landed.  Closing bug.