Skip to content

Commit 4fe8b2c

Browse files
committed
fix: correct form states, defined elements and relative has anchors
Consolidates the original contiguous commits 47cc8f0..3eeafc2. Preserves the exact tree at the end of this group.
1 parent 0b43903 commit 4fe8b2c

13 files changed

Lines changed: 667 additions & 108 deletions

‎assets/repo/coverage.svg‎

Lines changed: 1 addition & 1 deletion
Loading

‎docs/api.md‎

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ Query contexts default to the factory document when omitted. `closest()`, `first
1111

1212
| Method | Result |
1313
| --- | --- |
14-
| [`byClass(cls, context)`](../src/nwsapi.mts#L3014) | Returns elements with the class name. |
15-
| [`byId(id, context)`](../src/nwsapi.mts#L3012) | Returns elements with the ID. Duplicate IDs are allowed by default. |
16-
| [`byTag(tag, context)`](../src/nwsapi.mts#L3013) | Returns elements with the tag name. Use `*` for all elements. |
17-
| [`closest(selectors, element, callback)`](../src/nwsapi.mts#L3020) | Returns the nearest match, starting with the element, or `null`. |
18-
| [`compile(selector, mode, callback)`](../src/nwsapi.mts#L3022) | Compiles a selector into a resolver function. This is an advanced API. |
19-
| [`configure(option, clear)`](../src/nwsapi.mts#L3023) | Reads or changes options. Pass `true` as the second argument to clear compiled selectors. |
20-
| [`emit(message, proto)`](../src/nwsapi.mts#L3025) | Reports an error using the configured error policy. |
21-
| [`first(selectors, context, callback)`](../src/nwsapi.mts#L3016) | Returns the first matching descendant, or `null`. |
22-
| [`install(all)`](../src/nwsapi.mts#L3031) | Replaces native selector methods. Pass `true` to also replace collection methods. |
23-
| [`match(selectors, element, callback)`](../src/nwsapi.mts#L3017) | Returns whether the element matches. |
24-
| [`registerCombinator(combinator, resolver)`](../src/nwsapi.mts#L3038) | Adds a relationship between elements using trusted resolver code. |
25-
| [`registerOperator(operator, resolver)`](../src/nwsapi.mts#L3063) | Adds an attribute operator using a resolver with `p1`, `p2`, and `p3` fields. |
26-
| [`registerSelector(name, rexp, func)`](../src/nwsapi.mts#L3085) | Adds a selector pattern and a compiler callback that returns `source` and `status`. |
27-
| [`select(selectors, context, callback)`](../src/nwsapi.mts#L3018) | Returns an array of matching descendants, or an empty array. |
28-
| [`uninstall()`](../src/nwsapi.mts#L3032) | Restores the native methods saved by `install()`. |
14+
| [`byClass(cls, context)`](../src/nwsapi.mts#L3069) | Returns elements with the class name. |
15+
| [`byId(id, context)`](../src/nwsapi.mts#L3067) | Returns elements with the ID. Duplicate IDs are allowed by default. |
16+
| [`byTag(tag, context)`](../src/nwsapi.mts#L3068) | Returns elements with the tag name. Use `*` for all elements. |
17+
| [`closest(selectors, element, callback)`](../src/nwsapi.mts#L3075) | Returns the nearest match, starting with the element, or `null`. |
18+
| [`compile(selector, mode, callback, relative)`](../src/nwsapi.mts#L3077) | Compiles a selector into a resolver function. This is an advanced API. |
19+
| [`configure(option, clear)`](../src/nwsapi.mts#L3078) | Reads or changes options. Pass `true` as the second argument to clear compiled selectors. |
20+
| [`emit(message, proto)`](../src/nwsapi.mts#L3080) | Reports an error using the configured error policy. |
21+
| [`first(selectors, context, callback)`](../src/nwsapi.mts#L3071) | Returns the first matching descendant, or `null`. |
22+
| [`install(all)`](../src/nwsapi.mts#L3086) | Replaces native selector methods. Pass `true` to also replace collection methods. |
23+
| [`match(selectors, element, callback)`](../src/nwsapi.mts#L3072) | Returns whether the element matches. |
24+
| [`registerCombinator(combinator, resolver)`](../src/nwsapi.mts#L3093) | Adds a relationship between elements using trusted resolver code. |
25+
| [`registerOperator(operator, resolver)`](../src/nwsapi.mts#L3118) | Adds an attribute operator using a resolver with `p1`, `p2`, and `p3` fields. |
26+
| [`registerSelector(name, rexp, func)`](../src/nwsapi.mts#L3140) | Adds a selector pattern and a compiler callback that returns `source` and `status`. |
27+
| [`select(selectors, context, callback)`](../src/nwsapi.mts#L3073) | Returns an array of matching descendants, or an empty array. |
28+
| [`uninstall()`](../src/nwsapi.mts#L3087) | Restores the native methods saved by `install()`. |
2929

3030
<details>
3131
<summary>Configuration</summary>
@@ -60,22 +60,22 @@ These exports support extensions and debugging. Prefer query methods and `config
6060

6161
| Member | Purpose |
6262
| --- | --- |
63-
| [`CFG`](../src/nwsapi.mts#L3000) | Contains the compiler syntax settings. |
64-
| [`Config`](../src/nwsapi.mts#L3026) | Contains the active options. Use `configure()` to change them. |
65-
| [`M_BODY`](../src/nwsapi.mts#L3003) | Contains the matching resolver body template. |
66-
| [`M_TEST`](../src/nwsapi.mts#L3007) | Contains the matching resolver test template. |
67-
| [`matchLambdas`](../src/nwsapi.mts#L2992) | Caches compiled matching functions, not DOM results. |
68-
| [`matchResolvers`](../src/nwsapi.mts#L2995) | Caches matching plans, not DOM results. |
69-
| [`N_BODY`](../src/nwsapi.mts#L3004) | Exposes the matching resolver body template. |
70-
| [`N_TEST`](../src/nwsapi.mts#L3008) | Contains the alternate resolver test template. |
71-
| [`Operators`](../src/nwsapi.mts#L3034) | Contains registered attribute operators. |
72-
| [`S_BODY`](../src/nwsapi.mts#L3002) | Contains the selection resolver body template. |
73-
| [`S_TEST`](../src/nwsapi.mts#L3006) | Contains the selection resolver test template. |
74-
| [`selectLambdas`](../src/nwsapi.mts#L2993) | Caches compiled selection functions, not DOM results. |
75-
| [`Selectors`](../src/nwsapi.mts#L3035) | Contains registered selector extensions. |
76-
| [`selectResolvers`](../src/nwsapi.mts#L2996) | Caches selection plans, not DOM results. |
77-
| [`Snapshot`](../src/nwsapi.mts#L3027) | Contains the document state and helpers used by compiled selectors. |
78-
| [`Version`](../src/nwsapi.mts#L3029) | Contains the engine version string. |
63+
| [`CFG`](../src/nwsapi.mts#L3055) | Contains the compiler syntax settings. |
64+
| [`Config`](../src/nwsapi.mts#L3081) | Contains the active options. Use `configure()` to change them. |
65+
| [`M_BODY`](../src/nwsapi.mts#L3058) | Contains the matching resolver body template. |
66+
| [`M_TEST`](../src/nwsapi.mts#L3062) | Contains the matching resolver test template. |
67+
| [`matchLambdas`](../src/nwsapi.mts#L3047) | Caches compiled matching functions, not DOM results. |
68+
| [`matchResolvers`](../src/nwsapi.mts#L3050) | Caches matching plans, not DOM results. |
69+
| [`N_BODY`](../src/nwsapi.mts#L3059) | Exposes the matching resolver body template. |
70+
| [`N_TEST`](../src/nwsapi.mts#L3063) | Contains the alternate resolver test template. |
71+
| [`Operators`](../src/nwsapi.mts#L3089) | Contains registered attribute operators. |
72+
| [`S_BODY`](../src/nwsapi.mts#L3057) | Contains the selection resolver body template. |
73+
| [`S_TEST`](../src/nwsapi.mts#L3061) | Contains the selection resolver test template. |
74+
| [`selectLambdas`](../src/nwsapi.mts#L3048) | Caches compiled selection functions, not DOM results. |
75+
| [`Selectors`](../src/nwsapi.mts#L3090) | Contains registered selector extensions. |
76+
| [`selectResolvers`](../src/nwsapi.mts#L3051) | Caches selection plans, not DOM results. |
77+
| [`Snapshot`](../src/nwsapi.mts#L3082) | Contains the document state and helpers used by compiled selectors. |
78+
| [`Version`](../src/nwsapi.mts#L3084) | Contains the engine version string. |
7979

8080
</details>
8181

0 commit comments

Comments
 (0)