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 25285 - Boolean attributes return null in both situations - if browser returns undefined and if browser returns false
Summary: Boolean attributes return null in both situations - if browser returns undefi...
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: Simon Stewart
QA Contact: Browser Testing and Tools WG
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 20860
  Show dependency treegraph
 
Reported: 2014-04-07 20:54 UTC by Andrey Botalov
Modified: 2016-09-02 20:52 UTC (History)
2 users (show)

See Also:


Attachments

Description Andrey Botalov 2014-04-07 20:54:51 UTC
The spec says:
"Because of this, the WebDriver API offers a single command ("getElementAttribute") which covers the case of returning either of the value of a Document element's property or attribute."

But actually spec defines its own algorithm that isn't similar to neither returning property nor returning attribute in case if boolean attribute is supplied.

Consider the following:
<input id="id1" type="checkbox" />

<input id="id2" type="text" />

<span id="id2"></span>

In browsers "checked" will return false for the first and second elements, but undefined for the third element.

An implementation of Webdriver protocol will return null in all cases.

IMO it's not good. IMO it would be better if Webdriver will return the same values (true/false/null) as W3C specs say browser to return.
Comment 1 Simon Stewart 2016-09-02 20:52:10 UTC
getAttribute, as discussed in this bug, was removed from the spec. Closing.