- From: Mike Sherov <mike.sherov@gmail.com>
- Date: Fri, 6 Sep 2013 05:36:23 -0400
- To: "www-style@w3.org" <www-style@w3.org>
- Message-ID: <-398490840663009747@unknownmsgid>
At risk of beating a dead horse, allow me to describe two use cases, and how CSS Display Level 3 (and CSSOM and CSS Cascading) attempts to address each one: 1. A javascript library wants to be able to "hide" (set display:none) a "non-hidden" (has a display other than none) element and then "show" (return to the display value before setting it to none) it. This is the main use case covered by Display Module Level 3. By providing a separate "box" property, a javascript library can set that property to "none" to perform a "hide", and then set that property to "normal" to perform a "show". No loss of information about whether the element was inline or block. Great! 2. A bit more insidiously, a javascript library wants to "show" a div that is already "hidden" through an element selector in the author style sheet: div {display:none;}. Can Display Level 3 address this? The current spec says: The computed value of box <http://dev.w3.org/csswg/css-display-3/#box> is the specified value, unlessdisplay-outside<http://dev.w3.org/csswg/css-display-3/#display-outside> has the value none <http://dev.w3.org/csswg/css-display-3/#display-outside-none>, in which case the computed value of box<http://dev.w3.org/csswg/css-display-3/#box> is none <http://dev.w3.org/csswg/css-display-3/#display-outside-none> as well. I believe this prevents a JS library like jQuery from overcoming authors who use element selectors to define display:none. This may not seem like a big use case, but happens often enough. We're left with the situation where Display 3 still needs a mechanism by which an element can be reverted to its "default display". Now, we can add a value to display-outside like default that accomplishes this, but now its starting to sound very familiar to the generic "default" keyword that was just dropped from cascade level 3. To be clear, currently a javascript library must append an iframe to the page to get at the "default value" of display for the div. CSSOM had at one point defined an interface created by dbaron called getDefaultComputedStyle() to essentially emulate the iframe hack. In conjunction, Cascading 3 at one point had a "default value" to define what value gDCS returns. I know I raised this issue and subsequently acquiesced when Cascading Level 3 was still LC, but I find myself still needing a solution to this problem not yet covered by any spec. Mike Sherov Chief Technologist SNAP Interactive, Inc. | Ticker: STVI http://snap-interactive.com | http://ayi.com
Received on Friday, 6 September 2013 09:36:57 UTC