- From: <bugzilla@jessica.w3.org>
- Date: Sat, 28 Sep 2013 02:46:18 +0000
- To: public-html-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23389 Bug ID: 23389 Summary: The implementation symantics of the HTML hidden="hidden" attribute vs CSS display:none are not clear and in fact conflict Product: HTML WG Version: unspecified Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P2 Component: HTML5 spec Assignee: dave.null@w3.org Reporter: scunliffe.bugzilla@gmail.com QA Contact: public-html-bugzilla@w3.org CC: mike@w3.org, public-html-admin@w3.org, public-html-wg-issue-tracking@w3.org >From the current draft: http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-hidden-attribute "User agents should not render elements that have the hidden attribute specified." As stated implies that user agents would be "in error" if displaying elements when this attribute is specified. <side_rant>I presume there is a good accessibility reason for this new attribute but at the moment as a developer I only see trouble. I would love to see a clear indication as to why this addition is even needed in the first place.</side_rant> I've created a jsbin demo showing the confusing behavior as it is currently implemented in browsers (Firefox & Chrome from my testing) http://jsbin.com/IKohIXe/3/edit In short since this new HTML attribute is currently "duplicating" the same behavior as the CSS property developers now have 2 'methods' of changing the physical rendering of elements yet the 2 accessors are not kept in sync and the true state of an element's display is not maintained causing "dirty data" when inspected. In the test case above if an element was served up with hidden="hidden" but later JavaScript sets the CSS style "display:block" on the element the element becomes visible... however the hidden attribute that implies that it is not visible remains and HTMLElement.hidden returns true. 1.) Excluding any accessibility issues (which I'm presuming was the impetus for this feature addition in the first place) I don't see any helpful use for this attribute. 2.) IMHO, if the display of an element is altered to show through CSS the hidden attribute (if kept) should be removed from the DOM. 3.) If it was not the intention that the hidden attribute and the CSS display property were to affect each other in any way... then the current browser implementations do not match the intentions. 4.) As a developer it is already confusing enough with both the CSS display and visibility properties (especially when display can be "block|inline|{empty_string}|table-row|inline-block" etc.) adding yet another layer of the element is: "maybe, kinda, sorta-ish" hidden doesn't seem helpful at all to me. Due to the inconsistencies I've already deemed use of this attribute verboten within my developer teams on Web Projects and from conversations with other developers the feeling is mutual. -- You are receiving this mail because: You are the QA Contact for the bug.
Received on Saturday, 28 September 2013 02:46:21 UTC