[Bug 26365] [Shadow]: Need an equivalent definition of 'in a Document' for shadow trees

https://www.w3.org/Bugs/Public/show_bug.cgi?id=26365

--- Comment #46 from Hayato Ito <hayato@chromium.org> ---
Yeah, I think it's time to take a closer look at each case.

For example, in the HTML Living Standard, #in-a-document is referenced in:

2.1.3 DOM trees
3.1.3 DOM tree accessors
4.2.6 The style element
4.2.7 Interactions of styling and scripting
4.6.5.14 Link type "stylesheet" (2) (3) (4) (5)
4.8.5 The img element
4.8.7 The embed element (2)
4.8.8 The object element
4.8.14.8 Playing the media resource (2)
4.8.14.11.3 Assigning a media controller declaratively
4.10.18.3 Association of controls and forms (2)
4.10.19.8.3 User interface for bulk autofill
4.11.6.1 Facets
4.11.7 The dialog element
4.12.1 The script element (2) (3)
6.2 Inert subtrees
6.5.3 Processing model
7.1.1 Nested browsing contexts (2)
7.2.3 Accessing other browsing contexts (2)
15.3.1 The applet element
15.3.3 Frames


I've taken a quick look at each usage:

4.2.6 The style element
> If element is not in a Document, then abort these steps.

4.2.7 Interactions of styling and scripting
> ... last time the event loop reached step 1, the element was in that Document, and the user agent hasn't given up on that particular style sheet yet.

4.6.5.14 Link type "styleseet"
> When the external resource link is created on a link element that is already in a Document.

4.8.5 The img element
> While a user agent is running the above algorithm for an element x, there must be a strong reference from the element's node document to the element x, even if that element is not in its Document.

4.8.6 The iframe element
> For example if the user agent supports listing all the links in a document, links in "seamlessly" nested documents would be included in that list without being significantly distinguished from links in the document itself.

4.8.7 The embed element
> ... The element is in a Document or was in a Document the last time the event loop reached step 1.

4.8.8 The object element
> ... If the element has an ancestor media element, or has an ancestor object element that is not showing its fallback content, or if the element is not in a Document with a browsing context, o

4.8.14.8 Playing the media resource
> .. Media elements that are potentially playing while not in a Document must not play any video, but should play any audio component.

4.8.14.11.3 Assigning a media controller declaratively
> If there is another media element whose Document is the same as m's node document (even if one or both of these elements are not actually in the Document), and which also has a mediagroup attribute, and whose mediagroup attribute has the same value as the new value of m's mediagroup attribute, then let controller be that media element's current media controller.

4.10.18.3 Association of controls and forms
> ... If the element is reassociateable, has a form content attribute, and is itself in a Document, then run these substeps:

4.10.19.8.3 User interface for bulk autofill
> ... form is no longer in a Document

4.11.6.1 Facets
> The element is in a Document that has an associated browsing context.

4.11.7 The dialog element
> If subject is not in a Document, then throw an InvalidStateError exception and abort these steps.

4.12.1 The script element
> The script element is in a Document and a node or document fragment is inserted into the script element, after any script elements inserted at that time.
> The script element is in a Document and has a src attribute set where previously the element had no such attribute.

6.2 Inert subtrees
> While a browsing context container is marked as inert, its nested browsing context's active document, and all nodes in that Document, must be marked as inert.

6.5.2 The accesskey attribute
6.5.3 Processing model
> When the user presses the key combination corresponding to the assigned access key for an element, if the element defines a command, the command's Hidden State facet is false (visible), the command's Disabled State facet is also false (enabled), the element is in a Document

7.1.1 Nested browsing contexts
> Certain elements (for example, iframe elements) can instantiate further browsing contexts. These are called nested browsing contexts. If a browsing context P has a Document D with an element E that nests another browsing context C inside it, then C is said to be nested through D, and E is said to be the browsing context container of C. If the browsing context container element E is in the Document D

7.2.3 Accessing other browsing contexts
> The length IDL attribute on the Window interface must return the number of child browsing contexts that are nested through elements that are in the Document that is the active document of that Window object,

8.1.5.4 Events and the Window object
> When an event is dispatched at a DOM node in a Document in a browsing context, if the event is not a load event, the user agent must act as if, for the purposes of event dispatching, the Window object is the parent of the Document object. [DOM]

15.3.1 The applet element
> The element is not in a Document.

15.3.3 Frames
> A frame element is said to be an active frame element when it is in a Document.



In addition to 'in a Document', I think we need to have better words in replace
of 'inserted into a document' and 'removed from a document' in some places.

'inserted into a document' is referenced in:

4.2.5.3 Pragma directives (2)
4.2.6 The style element
4.6.5.14 Link type "stylesheet"
4.8.6 The iframe element
4.8.8 The object element
4.10.18.3 Association of controls and forms (2)
4.10.19.6.1 Autofocusing a form control: the autofocus attribute (2)
4.12.1 The script element (2)
7.6.3 Page load processing model for XML files (2)
8.1.4.1 Definitions
8.1.4.3 Generic task sources


'removed from a document' is referenced in:
4.2.6 The style element
4.8.6 The iframe element
4.8.8 The object element
4.8.14.8 Playing the media resource
4.8.14.19 Best practices for implementors of media elements
4.10.18.3 Association of controls and forms
4.11.7 The dialog element


Note that this is just a quick check. I have to do take another closer look in
the next iteration.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 14 November 2014 08:00:47 UTC