@@ -48,7 +48,7 @@ final class WP_CSS_Complex_Selector extends WP_CSS_Selector_Parser_Matcher {
4848 * The "self selector" is the last element in a complex selector, it corresponds to the
4949 * selected element.
5050 *
51- * @example
51+ * Example:
5252 *
5353 * $self_selector
5454 * ┏━━━━┻━━━━┓
@@ -67,38 +67,28 @@ final class WP_CSS_Complex_Selector extends WP_CSS_Selector_Parser_Matcher {
6767 * the element at index 1 is the combinator string constant from this class,
6868 * e.g. `WP_CSS_Complex_Selector::COMBINATOR_CHILD`.
6969 *
70- * In the example selector below, an element like `<el class="selected">` is selected iff:
70+ * In the example selector below, an element like `<strong class="selected">` matches iff:
7171 * - it is a child of an `H1` element
72- * - *and* that `H1` element is a descendant of a `HEADING ` element.
72+ * - that `H1` element is a descendant of a `SECTION ` element.
7373 *
74- * The `H1` and `HEADING` parts of this selector are the "context selectors." Note that this
75- * terminology is used for purposes of this class but does not correspond to language in the
76- * CSS or selector specifications.
77- *
78- * @example
74+ * The `section` and `h1` parts of this selector and their combinators are the
75+ * "context selectors." Note that this terminology does not correspond to language in the
76+ * specification texts.
7977 *
8078 * $context_selectors
81- * ┏━━━━━━┻━━━━┓
82- * .heading h1 > el.selected
83- *
84- * The example would have the following relative selectors:
79+ * ┏━━━━━┻━━━━┓
80+ * section h1 > strong.selected
8581 *
86- * @ example
82+ * The example would have the following context selectors:
8783 *
88- * array (
89- * array(
90- * WP_CSS_Type_Selector( 'ident' => 'h1' ),
91- * '>', // WP_CSS_Complex_Selector::COMBINATOR_CHILD
92- * ),
93- * array(
94- * new WP_CSS_Type_Selector( 'header' ),
95- * ' ', // WP_CSS_Complex_Selector::COMBINATOR_DESCENDANT
96- * ),
84+ * // Pseudo-code
85+ * array(
86+ * array( WP_CSS_Type_Selector( 'type'=>'h1' ), '>' ),
87+ * array( WP_CSS_Type_Selector( 'type'=>'section' ), ' ' ),
9788 * )
9889 *
99- * Note that the order of context selectors is reversed. This is to match the self selector
100- * first and then match the context selectors beginning with the selector closest to the self
101- * selector.
90+ * Context selectors are ordered from right to left in the selector text. The selectors closest
91+ * to the target appear at the start of the `context_selectors` array.
10292 *
10393 * @readonly
10494 * @var array{WP_CSS_Type_Selector, string}[]|null
0 commit comments