Bug 171829 - Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement
Summary: Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://drafts.csswg.org/cssom-view/#...
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2017-05-08 14:38 PDT by Chris Dumez
Modified: 2017-05-08 22:08 PDT (History)
17 users (show)

See Also:


Attachments
WIP patch (13.27 KB, patch)
2017-05-08 15:28 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (21.49 KB, patch)
2017-05-08 15:59 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (23.08 KB, patch)
2017-05-08 16:03 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 Chris Dumez 2017-05-08 14:38:11 PDT
Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement, as per the specification:
- https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface

Both Firefox and Chrome match the specification and also do not have the corresponding API on SVGElement.

Bug tracking the similar move in Blink (completed over 1 year ago):
- https://bugs.chromium.org/p/chromium/issues/detail?id=463116

Note that for the inner SVG elements like <rect> and <circle> these attributes were returning 0, because those aren't part of the CSS box model.
They did return correct values for the <svg> element itself, however.
Comment 1 Chris Dumez 2017-05-08 15:28:35 PDT
Created attachment 309421 [details]
WIP patch
Comment 2 Chris Dumez 2017-05-08 15:29:14 PDT
Found bug in web-platform-test:
https://github.com/w3c/web-platform-tests/pull/5855
Comment 3 Chris Dumez 2017-05-08 15:59:46 PDT
Created attachment 309427 [details]
Patch
Comment 4 Chris Dumez 2017-05-08 16:03:33 PDT
Created attachment 309429 [details]
Patch
Comment 5 WebKit Commit Bot 2017-05-08 17:16:21 PDT
Comment on attachment 309429 [details]
Patch

Clearing flags on attachment: 309429

Committed r216466: <http://trac.webkit.org/changeset/216466>
Comment 6 WebKit Commit Bot 2017-05-08 17:16:23 PDT
All reviewed patches have been landed.  Closing bug.