Skip to content

Commit 6af7872

Browse files
committed
[selectors] Fix more issues from Anne.
1 parent db2d17d commit 6af7872

2 files changed

Lines changed: 39 additions & 53 deletions

File tree

selectors/Overview.bs

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -572,14 +572,12 @@ Evaluating a Selector</h3>
572572

573573
This section describes how to <dfn export>evaluate a selector</dfn> against a set of elements.
574574

575-
APIs using this algorithm must provide a selector.
575+
APIs using this algorithm must provide a selector,
576+
and one or more <a>element tree</a> root elements
577+
indicating the trees that will be searched by the selector.
576578
They may optionally provide:
577579

578580
<ul>
579-
<li>
580-
a <a>selector match list</a> of elements to match against.
581-
If not specified, the <a>initial selector match list</a> for the selector's context is used.
582-
583581
<li>
584582
a <a>scoping method</a> and <a>scoping root</a>.
585583
If not specified, the selector defaults to being unscoped.
@@ -603,9 +601,12 @@ Evaluating a Selector</h3>
603601
If not specified, this defaults to allowing all pseudo-elements.
604602
</ul>
605603

606-
A <a>selector</a> is evaluated against some initial list of elements,
607-
as determined by the context that the selector is evaluated in:
604+
A <a>selector</a> is evaluated against some initial list of elements:
608605
the <dfn export>selector match list</dfn>.
606+
The <a>selector match list</a> is initially populated with the <a>element tree</a> roots
607+
provided to the algorithm,
608+
and all elements reachable from them by traversing any number of child lists.
609+
609610
If the selector is <a>scope-contained</a>,
610611
the <a>selector match list</a> is immediately filtered
611612
to contain only elements that are either the <a>scoping root</a>
@@ -656,15 +657,6 @@ Evaluating a Selector</h3>
656657
as long as it results in the same elements being returned
657658
as the spec's algorithm would.
658659

659-
Each context that a selector can be evaluated in
660-
must define the <dfn export>initial selector match list</dfn>,
661-
the list of elements that every selector in that context begins with.
662-
663-
When evaluating a selector against a DOM document,
664-
the <a>initial selector match list</a>
665-
is the root element and all of its descendants,
666-
ordered by a pre-order traversal.
667-
668660
Issue: The relative position of pseudo-elements in the <a>selector match list</a> is undefined.
669661
There's not yet a context that exposes this information,
670662
but we need to decide on something eventually,
@@ -674,8 +666,9 @@ Evaluating a Selector</h3>
674666
<h3 id='data-model'>
675667
Data Model</h3>
676668

677-
Selectors are matched against a <a>selector match list</a> of elements,
678-
which is usually arranged in an abstract tree structure.
669+
Selectors are matched against an <dfn export>element tree</dfn>,
670+
which is an abstract tree structure containing elements
671+
having the structure defined in the <a href="http://dom.spec.whatwg.org/#trees">DOM Standard</a> [[!DOM]].
679672

680673
Each element may have any of:
681674

@@ -708,13 +701,13 @@ Data Model</h3>
708701
and can't be matched by <em>any</em> <a>pseudo-class</a> except for '':host'' and '':host-context()''.)
709702

710703
In a DOM document,
711-
the DOM is used as the <a>selector match list</a>.
712-
Each DOM element is an element in the <a>selector match list</a>,
713-
with the DOM element's tagname as the type,
704+
the DOM is used as the <a>element tree</a>.
705+
Each DOM element is an element in the <a>element tree</a>,
706+
with the DOM element's namespace and local name as the type,
714707
and its ID, class list, attributes, and child elements
715-
as the ID, classes, attributes, and child elements in the <a>selector match list</a>.
708+
as the ID, classes, attributes, and child elements in the <a>element tree</a>.
716709
The rest of the information in the DOM is also accessible
717-
as the arbitrary additional information in the <a>selector match list</a>.
710+
as the arbitrary additional information in the <a>element tree</a>.
718711

719712

720713
<h3 id="scoping">
@@ -2147,7 +2140,7 @@ User Action Pseudo-classes</h2>
21472140
Note: The specifics of hit-testing,
21482141
necessary to know when several of the pseudo-classes defined in this section apply,
21492142
are not yet defined,
2150-
but should be in the future.
2143+
but will be in the future.
21512144

21522145
<h3 id="the-hover-pseudo">
21532146
The pointer hover pseudo-class '':hover''</h3>

0 commit comments

Comments
 (0)