mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-18 19:43:24 +03:00
Selector matching (Selectors Level 4 §17.3): - Retry other candidates for descendant and general-sibling combinators instead of rejecting after the first failed path. Checkpoints use a fixed array of one entry per checkpoint-saving rule (16 on the stack, 32/64 in out-of-line helpers, heap beyond), with failure pruning so exhausted searches stop early. - Handle <html> as a style-sheet parent boundary whose siblings stay visible: failed parent steps at an <html> with element siblings retry instead of rejecting, and a ~ candidate that is such an <html> resumes its search without a checkpoint. - Reject the subject before sizing storage for long selectors. Style dependencies: - getRelatedElements() now returns the union of tracked elements over every matching path, so state changes on any eligible ancestor or sibling restyle the subject. Strategies are chosen per selector: immediate exit, fixed-prefix walk, single candidate scan (with a shared suffix for ~ candidates), an ancestor-path DP, and a memoized collector. All are linear and allocation-free for common selectors. Other fixes: - Exclude raw text nodes from matched author styles; their widget backgrounds painted over glyphs drawn by the parent rich text. - Report widget ids from getPropertyString() so [id=...] selectors match. - Add StyleSheetSelectorRule::hasAnyPseudoClasses() and UIStyle::getRelatedWidgets() (inline, ABI-compatible additions). Build: - Link libeepp with -Wl,-Bsymbolic-functions on Linux, BSD and Haiku so internal calls skip the PLT (11,314 -> 619 PLT entries). Measured: Markdown load -25%, selector matching -11%, attribute matching -14%. Tests and benchmarks: - Regression tests for backtracking, <html> boundaries, subscription union and cleanup, operation-count bounds, long selectors and id attribute selectors, plus a differential test against an exhaustive reference matcher. - Add Benchmark.CSSSelectorCombinators and Benchmark.CSSStateDependencies and create all benchmark windows hidden.