This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25182 - Should element with 0 clientWidth and clientHeight be considered visible?
Summary: Should element with 0 clientWidth and clientHeight be considered visible?
Status: RESOLVED FIXED
Alias: None
Product: Browser Test/Tools WG
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: seva
QA Contact: Browser Testing and Tools WG
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 20860
  Show dependency treegraph
 
Reported: 2014-03-27 20:55 UTC by Andrey Botalov
Modified: 2014-05-16 22:28 UTC (History)
3 users (show)

See Also:


Attachments
A few cleanups in section 10.1 (3.86 KB, patch)
2014-05-13 11:08 UTC, seva
Details
Suggested ammended wording for "height and width > 0px" (1.63 KB, patch)
2014-05-16 00:54 UTC, seva
Details

Description Andrey Botalov 2014-03-27 20:55:15 UTC
Let's say there is element:
<span style="border-style:solid;border-width:5px;"></span>

This element has 0 clientWidth and clientHeight but its offsetWidth and offsetHeight are positive numbers.

The spec currently says:
"The element must have a height and width greater than 0px" without saying type of width/height.


I made a quick test and the following element is clickable in Google Chrome:
<span style="border-style:solid;border-width:5px;" onclick="console.log(1000)"></span>

I think it should be clarified which type of width/height is meant.
Comment 1 seva 2014-04-14 05:50:19 UTC
I'll work on getting visibility experts' attention.
Comment 2 David Burns :automatedtester 2014-04-22 23:44:22 UTC
landed in https://dvcs.w3.org/hg/webdriver/rev/28b6056637b2
Comment 3 seva 2014-05-13 11:08:24 UTC
Created attachment 1476 [details]
A few cleanups in section 10.1
Comment 4 seva 2014-05-13 11:10:25 UTC
The newly added

"The element must have a DOMRect height and a DOMRect width greater than 0px, as returned by element.getBoundingClientRect() , unless the element has a descendent with a positive height and width."

does not mention which elements MUST/SHOULD/MAY be (considered) displayed.

Also it is a slower check (descendents are involved) and some trivial checks go first in this algorithm. It makes sense to move all the trivial checks up.

Also I noticed that "displayed" is used in most of the section while "shown" or "visible" on only a few occasions.

I removed "if Javascript is enabled", too ( https://www.w3.org/Bugs/Public/show_bug.cgi?id=25681 )

I just attached a patch I suggest committing.
Comment 5 seva 2014-05-13 11:12:29 UTC
Not sure if the email notifications fired up or not... Reopening just in case.
Comment 6 seva 2014-05-16 00:54:17 UTC
Created attachment 1477 [details]
Suggested ammended wording for "height and width > 0px"

A new patch attached; only changes strictly related to this bug.
Comment 7 David Burns :automatedtester 2014-05-16 19:24:52 UTC
Landed in https://dvcs.w3.org/hg/webdriver/rev/d3d3f482328e
Comment 8 Andrey Botalov 2014-05-16 21:21:48 UTC
There is an extra space between "element." and "getBoundingClientRect()" now.
Comment 9 David Burns :automatedtester 2014-05-16 22:28:36 UTC
fixed in https://dvcs.w3.org/hg/webdriver/rev/ed9347dfddf6