-
Notifications
You must be signed in to change notification settings - Fork 31
vaev-engine: Initial implementation of pseudo elements. #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the pseudo selector handling by splitting Pseudo into two distinct types: PseudoElementSelector for pseudo-elements (::before, ::after, ::marker) and PseudoClassSelector for pseudo-classes (:hover, :first-child, etc.). Additionally, it introduces support for generating pseudo-elements in the layout builder and adds a rule indexing system to optimize selector matching.
- Separated pseudo-class and pseudo-element selectors into distinct types
- Added pseudo-element generation support in the layout builder with proper content handling
- Moved style rule lookup logic from
rules.cppto a newrules-index.cppfile - Updated all selector matching to support pseudo-elements as a parameter
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vaev-engine/values/angle.cpp | Added empty line after import statement |
| src/vaev-engine/style/selector.cpp | Split Pseudo into PseudoElementSelector and PseudoClassSelector, updated parsing logic |
| src/vaev-engine/style/selector-impl.cpp | Updated operator== implementation for renamed type |
| src/vaev-engine/style/rules.cpp | Removed StyleRuleLookup code, updated match() signature |
| src/vaev-engine/style/rules-index.cpp | New file containing refactored RuleIndex (formerly StyleRuleLookup) |
| src/vaev-engine/style/matcher.cpp | Updated matching logic to support pseudo-elements, improved variable naming |
| src/vaev-engine/style/defs/pseudo-class.inc | Removed pseudo-elements (BEFORE, AFTER, etc.) from pseudo-class definitions |
| src/vaev-engine/style/computer.cpp | Added pseudo-element generation logic and updated to use RuleIndex |
| src/vaev-engine/style/page.cpp | Simplified lambda with explicit return type |
| src/vaev-engine/layout/builder/mod.cpp | Added pseudo-element building support, removed BR_TAG special handling, fixed table wrapper positioning |
| src/vaev-engine/dom/element.cpp | Added PseudoElement constants and methods to manage pseudo-elements |
| src/vaev-engine/dom/token-list.cpp | Renamed module from token_list to tokenList |
| src/vaev-engine/dom/mod.cpp | Updated import for renamed module |
| src/vaev-engine/style/tests/*.cpp | Updated tests to use new selector types |
src/vaev-engine/style/selector.cpp
Outdated
| val = PseudoElementSelector{Dom::PseudoElement::BEFORE}; | ||
| else if (name == "after") | ||
| val = PseudoElementSelector{Dom::PseudoElement::AFTER}; | ||
| else if (name == "maker") |
Copilot
AI
Oct 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'maker' to 'marker'.
| else if (name == "maker") | |
| else if (name == "marker") |
13044ab to
3bacdcb
Compare
3bacdcb to
1f21a8e
Compare
1f21a8e to
f45c381
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small step for the dev but a great step for paper-muncher
No description provided.