Skip to content

Conversation

@yorkie
Copy link
Collaborator

@yorkie yorkie commented Aug 27, 2025

This pull request adds support for retrieving and exposing the raw CSS selector text for style rules in the bindings between Rust and C++. This enhancement allows consumers of the C++ API to access the original selector string as authored, which can be useful for debugging, serialization, or advanced CSSOM operations. The changes include updates to the Rust data model, FFI layer, and C++ bindings.

@yorkie yorkie requested a review from Copilot August 27, 2025 06:08
Copy link
Contributor

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 pull request adds support for exposing the raw CSS selector text in style rules across the Rust-C++ bindings layer. The enhancement enables C++ API consumers to access the original selector string as authored in CSS, which is valuable for debugging, serialization, and advanced CSSOM operations.

  • Adds a new selectorsText() method to the C++ StyleRule class that returns the raw selector string
  • Implements the underlying Rust functionality to convert selectors to CSS text using the ToCss trait
  • Updates the FFI layer to bridge the selector text from Rust to C++

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/client/cssom/rules/css_style_rule.hpp Adds TODO comment about future C++ parser migration
crates/jsbindings/css_parser.rs Adds FFI function to expose selector text from Rust
crates/jsbindings/css/stylesheets/style_rule.rs Implements selector-to-text conversion using ToCss trait
crates/jsbindings/bindings.css.hpp Adds selectorsText member and accessor method to C++ StyleRule class

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@yorkie yorkie merged commit be80a36 into main Aug 27, 2025
2 checks passed
@yorkie yorkie deleted the feat/export-css-selectors-text branch August 27, 2025 06:22
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