Bug 171226

Summary: Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, calvaris, cdumez, cmarcelo, commit-queue, dbates, eric.carlson, esprehn+autocc, gyuyoung.kim, kangil.han, kondapallykalyan, philipj, rniwa, simon.fraser
Priority: P2    
Version: Safari 10   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=171393
Bug Depends on: 171215    
Bug Blocks: 171418    
Attachments:
Description Flags
WIP Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from ews102 for mac-elcapitan
none
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews115 for mac-elcapitan
none
Archive of layout-test-results from ews121 for ios-simulator-wk2
none
Patch
none
Patch
none
Archive of layout-test-results from ews124 for ios-simulator-wk2
none
Patch none

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.