-
Notifications
You must be signed in to change notification settings - Fork 24
vaev-style: Add running positions, content element() and counter page #79
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
base: main
Are you sure you want to change the base?
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.
- remove reference of currentPage
- reorder pageLayoutInfo,
- del constructor of pageLayout info
- create Pagination context to replace args, in collection
- shortcut for pageInfos[pageContent]
- remove utility import in impl
- investigate page usage in layout
- replace Page in layout with just pageNumber
- in binary search use (search) then linear
- put RunningPos in its own object (from builder methods and layout impl)
- del constructor of RunningPositonInfo
- is lookforLayoutPosition useful cant it just be layout() ??
- customIdent should be a Symbol instead of a String
- better parsing of customIdent
…ge to allow beautiful margins.
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 adds support for CSS running positions, content element() function, and counter page functionality to the CSS engine. The implementation includes new value types for positioning elements using running() positioning scheme and content generation through element() and counter() functions.
Key Changes
- Implements CSS running positions with
running()
function support forposition
property - Adds
element()
andcounter()
functions for CSS content property - Introduces page counter support for print layout
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
src/vaev-engine/values/primitives.cpp | Adds comparison operators and repr method to CustomIdent |
src/vaev-engine/values/content.cpp | New file implementing ElementContent and Counter value types with parsers |
src/vaev-engine/values/insets.cpp | Refactors Position enum to Union type and adds RunningPosition support |
src/vaev-engine/values/defs/keywords.inc | Adds position-related keywords (Fixed, Sticky, Absolute, Relative, Static) |
src/vaev-engine/style/specified.cpp | Updates content type from String to Content and position default value |
src/vaev-engine/style/props.cpp | Updates ContentProp to use Content type instead of String |
src/vaev-engine/layout/positioned.cpp | Updates position comparisons to use keyword constants |
src/vaev-engine/layout/paint.cpp | Adds RunningPosition filtering in paint logic |
src/vaev-engine/layout/layout-impl.cpp | Adds RunningPositionMap support and lookForRunningPosition function |
src/vaev-engine/layout/builder.cpp | Fixes function name typo and adds support for element() and counter() content |
src/vaev-engine/layout/base.cpp | Adds RunningPositionMap implementation and Input struct updates |
src/vaev-engine/driver/print.cpp | Implements two-pass pagination with running position collection |
// binary search of all running positions that match the page | ||
|
||
auto res = search(list, [&](RunningPositionInfo const& info) { | ||
if (info.page <= page and page < info.page) { |
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.
This condition 'info.page <= page and page < info.page' is logically impossible - no value can be both less than or equal to page AND greater than page. This will never evaluate to true.
if (info.page <= page and page < info.page) { | |
if (info.page == page) { |
Copilot uses AI. Check for mistakes.
if (box.style->position.is<RunningPosition>()) { | ||
input.fragment = nullptr; | ||
} |
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.
Can't we return early instead?
No description provided.