mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 07:39:16 +00:00
LibWeb/CSS: Prepare pseudo-classes for multiple An+B patterns
The upcoming `:heading()` pseudo-class takes multiple comma-separated An+Bs. Also rename this field as the `:nth-[last-]child()` pseudo-classes are only a subset of the users.
This commit is contained in:
parent
c2fc4b25cd
commit
a59c15481f
Notes:
github-actions[bot]
2025-08-13 08:49:02 +00:00
Author: https://github.com/AtkinsSJ
Commit: a59c15481f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5830
5 changed files with 15 additions and 14 deletions
|
@ -670,8 +670,9 @@ static inline bool matches_pseudo_class(CSS::Selector::SimpleSelector::PseudoCla
|
|||
case CSS::PseudoClass::NthLastChild:
|
||||
case CSS::PseudoClass::NthOfType:
|
||||
case CSS::PseudoClass::NthLastOfType: {
|
||||
auto const step_size = pseudo_class.nth_child_pattern.step_size;
|
||||
auto const offset = pseudo_class.nth_child_pattern.offset;
|
||||
auto& an_plus_b = pseudo_class.an_plus_b_patterns.first();
|
||||
auto const step_size = an_plus_b.step_size;
|
||||
auto const offset = an_plus_b.offset;
|
||||
if (step_size == 0 && offset == 0)
|
||||
return false; // "If both a and b are equal to zero, the pseudo-class represents no element in the document tree."
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue