w3c / w3c/csswg-drafts

[cssom-view] Step one of client{Width,Height} should be moved.

Open
#3,582 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cssom-view-1
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

The following pages:

<!doctype html><html style="display: none"><script>alert(document.documentElement.clientWidth)</script>
<html style="display: none"><body><script>alert(document.body.clientWidth)</script>

Don't alert 0 in any case in neither Gecko, Blink or WebKit, even though per spec they should given the first point. https://drafts.csswg.org/cssom-view/#dom-element-clientwidth says:

If the element has no associated CSS layout box or if the CSS layout box is inline, return zero.

We should probably move it to be the step 2 to match implementations.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CSSOM View specification's Element clientWidth and clientHeight definitions linked in the issue, and compare the current algorithm with the reported Gecko, Blink, and WebKit behavior. Move the no-layout-box or inline-layout-box check to step 2, then verify that the examples no longer conflict with the stated behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation, web-dev
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.