Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cssom-view] Definition of clientLeft and clientTop doesn't make sense for the document scrolling element. #5363

Open
emilio opened this issue Jul 27, 2020 · 1 comment

Comments

@emilio
Copy link
Collaborator

emilio commented Jul 27, 2020

https://drafts.csswg.org/cssom-view/#dom-element-clienttop says:

Return the computed value of the border-top-width property plus the height of any scrollbar rendered between the top padding edge and the top border edge, ignoring any transforms that apply to the element and its ancestors.

Note how there's no special-case for the root. But clientWidth and clientHeight have a special case for the root element:

If the element is the root element and the element’s node document is not in quirks mode, or if the element is the HTML body element and the element’s node document is in quirks mode, return the viewport width excluding the size of a rendered scroll bar (if any).

So surely enough if you follow the spec to the letter, for a test-case like this:

<!doctype html>
<style>
  :root { margin: 100px; border: 10px solid; }
</style>

The rect you get doesn't make sense. Gecko does the sensible thing, I think, which is that in this case the x and y are zero.

moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 27, 2020
The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1655398
gecko-commit: 31ebee09829284fb331a9170fc3ccf3e5e7df708
gecko-integration-branch: autoland
gecko-reviewers: mats
@emilio
Copy link
Collaborator Author

emilio commented Jul 27, 2020

Ah, so @bzbarsky agreed with me like 4 years ago ;)

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29603

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jul 28, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Jul 28, 2020
The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1655398
gecko-commit: 31ebee09829284fb331a9170fc3ccf3e5e7df708
gecko-integration-branch: autoland
gecko-reviewers: mats
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Jul 28, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959
moz-wptsync-bot added a commit to web-platform-tests/wpt that referenced this issue Jul 28, 2020
The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1655398
gecko-commit: 1fa3c63f82d23ea49809c70a74bea90a8fd6f426
gecko-integration-branch: autoland
gecko-reviewers: mats
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jul 28, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959
moz-wptsync-bot added a commit to web-platform-tests/wpt that referenced this issue Jul 28, 2020
The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1655398
gecko-commit: 1fa3c63f82d23ea49809c70a74bea90a8fd6f426
gecko-integration-branch: autoland
gecko-reviewers: mats
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Jul 28, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jul 31, 2020
…me. r=mats, a=jcristau

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Aug 1, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

UltraBlame original commit: 31ebee09829284fb331a9170fc3ccf3e5e7df708
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Aug 1, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

UltraBlame original commit: 1fa3c63f82d23ea49809c70a74bea90a8fd6f426
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Aug 1, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

UltraBlame original commit: 31ebee09829284fb331a9170fc3ccf3e5e7df708
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Aug 1, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

UltraBlame original commit: 1fa3c63f82d23ea49809c70a74bea90a8fd6f426
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Aug 1, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

UltraBlame original commit: 31ebee09829284fb331a9170fc3ccf3e5e7df708
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Aug 1, 2020
…me. r=mats

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959

UltraBlame original commit: 1fa3c63f82d23ea49809c70a74bea90a8fd6f426
aosmond pushed a commit to aosmond/gecko that referenced this issue Nov 15, 2020
…me. r=mats, a=jcristau

The spec really asks us to put the rect at GetUsedBorder().{top,left} in
this case, but I don't think that really makes sense, see
w3c/csswg-drafts#5363.

Differential Revision: https://phabricator.services.mozilla.com/D84959
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant