Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Louciole
Copy link
Member

No description provided.

Copy link
Member Author

@Louciole Louciole left a 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

@sleepy-monax sleepy-monax requested a review from Copilot July 16, 2025 11:09
Copilot

This comment was marked as outdated.

Copy link

@Copilot Copilot AI left a 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 for position property
  • Adds element() and counter() 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) {
Copy link
Preview

Copilot AI Jul 17, 2025

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.

Suggested change
if (info.page <= page and page < info.page) {
if (info.page == page) {

Copilot uses AI. Check for mistakes.

Comment on lines +300 to +302
if (box.style->position.is<RunningPosition>()) {
input.fragment = nullptr;
}
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants