Skip to content
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

[TASK] Use delegation for DeclarationBlock -> RuleSet #1194

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JakeQZ
Copy link
Contributor

@JakeQZ JakeQZ commented Mar 19, 2025

... rather than inheritance.

This will allow DeclarationBlock to instead extend CSSBlockList in order to support
CSS nesting.

This is a slightly-breaking change, since now CSSBlockList::getAllRuleSets() will include the RuleSet property of the DeclarationBlock instead of the DeclarationBlock itself.

Part of #1170.

@JakeQZ JakeQZ added cleanup css4 Relating to features introduced in CSS4 labels Mar 19, 2025
@JakeQZ JakeQZ self-assigned this Mar 19, 2025
@JakeQZ JakeQZ marked this pull request as draft March 19, 2025 00:56
@coveralls
Copy link

coveralls commented Mar 19, 2025

Coverage Status

coverage: 49.362% (-4.0%) from 53.315%
when pulling 3a278e0 on task/declarationblock-delegate-ruleset
into 9b52615 on main.

@JakeQZ JakeQZ force-pushed the task/declarationblock-delegate-ruleset branch from 7800603 to 73956e9 Compare March 19, 2025 02:06
@@ -41,7 +41,7 @@ abstract class CSSList implements Renderable, Commentable
protected $comments = [];

/**
* @var array<int<0, max>, RuleSet|CSSList|Import|Charset>
* @var array<int<0, max>, RuleSet|CSSList|DeclarationBlock|Import|Charset>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose we introduce an interface instead, e.g. something like CSSListItem. (We could do this as a pre-patch to keep PRs small.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing so would also make Stan happy :)

@JakeQZ JakeQZ added css3 and removed css4 Relating to features introduced in CSS4 labels Mar 20, 2025
@JakeQZ JakeQZ force-pushed the task/declarationblock-delegate-ruleset branch 4 times, most recently from 4d7831a to c1c27a9 Compare March 31, 2025 23:21
... rather than inheritance.

This will allow `DeclarationBlock` to instead extend `CSSBlockList` in order
to support
[CSS nesting](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting).

This is a slightly-breaking change, since now `CSSBlockList::getAllRuleSets()`
will include the `RuleSet` property of the `DeclarationBlock` instead of the
`DeclarationBlock` itself.

Part of #1170.
@JakeQZ JakeQZ force-pushed the task/declarationblock-delegate-ruleset branch from c1c27a9 to 3a278e0 Compare April 2, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants