[whatwg] When to stop <video> elements from playing

On Wed, 24 Oct 2007 01:53:56 +0200, Jonas Sicking <jonas at sicking.cc> wrote:

> fantasai wrote:
>> Robert O'Callahan wrote:
>>>
>>> A related question is whether display:none audio and video elements  
>>> should produce sound.
>>  No. "display: none" is defined to affect all media, and that certainly
>> should not change for <audio> and <video>.
>
> I think this is different than screen readers not speaking display:none  
> text. Both hiding layout frames and silencing screen readers only affect  
> the 'rendering' of the contained text, it doesn't otherwise deactivate  
> the contained display:none elements:

What matters is how display: none is defined [1], and as fantasai  
mentioned display is media: all, with special processing to boot:

   This value causes an element to generate no boxes in the
   formatting structure (i.e., the element has no effect on
   layout). Descendant elements do not generate any boxes
   either; this behavior cannot be overridden by setting the
   'display' property on the descendants.

   Please note that a display of 'none' does not create an
   invisible box; it creates no box at all.


Other properties like 'visibility' are defined as visual [2] and wouldn't  
affect audio rendering. With the caveat that it is a working draft that  
hasn't been updated for a long time, the CSS3 Speech property  
'voice-volume' [3] and voice-volume: silent can be seen as analogous to  
visibility: hidden.

[1] <http://www.w3.org/TR/CSS21/visuren.html#display-prop>
[2] <http://www.w3.org/TR/CSS21/visufx.html#propdef-visibility>
[3] <http://www.w3.org/TR/css3-speech/#voice-volume>

-- 
Jonny Axelsson, Core Technology, Opera Software AS

Received on Thursday, 25 October 2007 07:24:59 UTC