Skip to content

Commit 6317c26

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 606a178 + efee925 commit 6317c26

7 files changed

Lines changed: 184 additions & 16 deletions

File tree

.github/workflows/pull-request-comments.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ jobs:
195195
const prBody = pr.body ?? '';
196196
const prTitle = pr.title ?? '';
197197
198-
const tracTicketRegex = new RegExp( 'https?://core.trac.wordpress.org/ticket/([0-9]+)', 'g' );
198+
const tracTicketRegex = new RegExp( '(https?://core.trac.wordpress.org/ticket/|Core-)([0-9]+)', 'g' );
199199
const tracTicketMatches = prBody.match( tracTicketRegex ) || prTitle.match( tracTicketRegex );
200200
201201
if ( ! tracTicketMatches ) {

.mailmap

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Aliases names and emails inside of commits.
2+
# See https://git-scm.com/docs/gitmailmap
3+
#
4+
# Some entries appear as duplicates, but are both required to correct
5+
# identities with just the wrong name as well as those with the wrong
6+
# name and also the wrong email address.
7+
8+
# Accounts with a display name.
9+
Aaron D. Campbell <aaroncampbell@git.wordpress.org> <aaroncampbell@602fd350-edb4-49c9-b593-d223f7449a82>
10+
Aaron Jorbin <jorbin@git.wordpress.org> <jorbin@602fd350-edb4-49c9-b593-d223f7449a82>
11+
Adam Silverstein <adamsilverstein@git.wordpress.org> <adamsilverstein@602fd350-edb4-49c9-b593-d223f7449a82>
12+
Alex King <alexkingorg@git.wordpress.org> <alexkingorg@602fd350-edb4-49c9-b593-d223f7449a82>
13+
Alex Shiels <tellyworth@git.wordpress.org> <tellyworth@602fd350-edb4-49c9-b593-d223f7449a82>
14+
André <oandregal@git.wordpress.org>
15+
André <oandregal@git.wordpress.org> <oandregal@602fd350-edb4-49c9-b593-d223f7449a82>
16+
Andrea Fercia <afercia@git.wordpress.org> <afercia@602fd350-edb4-49c9-b593-d223f7449a82>
17+
Andrew Duthie <aduth@git.wordpress.org> <aduth@602fd350-edb4-49c9-b593-d223f7449a82>
18+
Andrew Nacin <nacin@git.wordpress.org> <nacin@602fd350-edb4-49c9-b593-d223f7449a82>
19+
Andrew Ozz <azaozz@git.wordpress.org> <azaozz@602fd350-edb4-49c9-b593-d223f7449a82>
20+
Anthony Burchell <antpb@git.wordpress.org> <antpb@602fd350-edb4-49c9-b593-d223f7449a82>
21+
Anton Timmermans <atimmer@git.wordpress.org> <atimmer@602fd350-edb4-49c9-b593-d223f7449a82>
22+
Bernie Reiter <bernhard-reiter@git.wordpress.org>
23+
Bernie Reiter <bernhard-reiter@git.wordpress.org> <bernhard-reiter@602fd350-edb4-49c9-b593-d223f7449a82>
24+
Boone Gorges <boonebgorges@git.wordpress.org> <boonebgorges@602fd350-edb4-49c9-b593-d223f7449a82>
25+
Carlos Bravo <cbravobernal@git.wordpress.org> <cbravobernal@602fd350-edb4-49c9-b593-d223f7449a82>
26+
Colin Stewart <costdev@git.wordpress.org> <costdev@602fd350-edb4-49c9-b593-d223f7449a82>
27+
Daniel Bachhuber <danielbachhuber@git.wordpress.org> <danielbachhuber@602fd350-edb4-49c9-b593-d223f7449a82>
28+
Daniel Richards <talldanwp@git.wordpress.org> <talldanwp@602fd350-edb4-49c9-b593-d223f7449a82>
29+
Daryl Koopersmith <koop@git.wordpress.org> <koop@602fd350-edb4-49c9-b593-d223f7449a82>
30+
David A. Kennedy <davidakennedy@git.wordpress.org> <davidakennedy@602fd350-edb4-49c9-b593-d223f7449a82>
31+
David Baumwald <davidbaumwald@git.wordpress.org> <davidbaumwald@602fd350-edb4-49c9-b593-d223f7449a82>
32+
Dennis Snell <dmsnell@git.wordpress.org> <dmsnell@602fd350-edb4-49c9-b593-d223f7449a82>
33+
Dion Hulse <dd32@git.wordpress.org> <dd32@602fd350-edb4-49c9-b593-d223f7449a82>
34+
Dominik Schilling <ocean90@git.wordpress.org>
35+
Dominik Schilling <ocean90@git.wordpress.org> <ocean90@602fd350-edb4-49c9-b593-d223f7449a82>
36+
Donncha O Caoimh <donncha@git.wordpress.org> <donncha@602fd350-edb4-49c9-b593-d223f7449a82>
37+
Dougal Campbell <dougal@git.wordpress.org> <dougal@602fd350-edb4-49c9-b593-d223f7449a82>
38+
Drew Jaynes <drewapicture@git.wordpress.org>
39+
Drew Jaynes <drewapicture@git.wordpress.org> <drewapicture@602fd350-edb4-49c9-b593-d223f7449a82>
40+
Drew Jaynes <drewapicture@git.wordpress.org> <DrewAPicture@602fd350-edb4-49c9-b593-d223f7449a82>
41+
Ella <ellatrix@git.wordpress.org>
42+
Ella <ellatrix@git.wordpress.org> <ellatrix@602fd350-edb4-49c9-b593-d223f7449a82>
43+
Ella <ellatrix@git.wordpress.org> <iseulde@602fd350-edb4-49c9-b593-d223f7449a82>
44+
Ella <ellatrix@git.wordpress.org> <iseulde@git.wordpress.org>
45+
Eric Andrew Lewis <ericlewis@git.wordpress.org> <ericlewis@602fd350-edb4-49c9-b593-d223f7449a82>
46+
Felix Arntz <flixos90@git.wordpress.org> <flixos90@602fd350-edb4-49c9-b593-d223f7449a82>
47+
Gary Pendergast <pento@git.wordpress.org> <pento@602fd350-edb4-49c9-b593-d223f7449a82>
48+
Greg Ziółkowski <gziolo@git.wordpress.org>
49+
Greg Ziółkowski <gziolo@git.wordpress.org> <gziolo@602fd350-edb4-49c9-b593-d223f7449a82>
50+
Helen Hou-Sandi <helen@git.wordpress.org> <helen@602fd350-edb4-49c9-b593-d223f7449a82>
51+
Ian Belanger <ianbelanger@git.wordpress.org> <ianbelanger@602fd350-edb4-49c9-b593-d223f7449a82>
52+
Ian Dunn <iandunn@git.wordpress.org> <iandunn@602fd350-edb4-49c9-b593-d223f7449a82>
53+
Ian Stewart <iandstewart@git.wordpress.org> <iandstewart@602fd350-edb4-49c9-b593-d223f7449a82>
54+
Isabel Brison <isabel_brison@git.wordpress.org> <isabel_brison@602fd350-edb4-49c9-b593-d223f7449a82>
55+
Jake Spurlock <whyisjake@git.wordpress.org> <whyisjake@602fd350-edb4-49c9-b593-d223f7449a82>
56+
James Nylen <jnylen0@git.wordpress.org> <jnylen0@602fd350-edb4-49c9-b593-d223f7449a82>
57+
Jb Audras <audrasjb@git.wordpress.org> <audrasjb@602fd350-edb4-49c9-b593-d223f7449a82>
58+
Jeff Ong <jffng@git.wordpress.org> <jffng@602fd350-edb4-49c9-b593-d223f7449a82>
59+
Jeremy Felt <jeremyfelt@git.wordpress.org> <jeremyfelt@602fd350-edb4-49c9-b593-d223f7449a82>
60+
Joe Dolson <joedolson@git.wordpress.org> <joedolson@602fd350-edb4-49c9-b593-d223f7449a82>
61+
Joe Hoyle <joehoyle@git.wordpress.org> <joehoyle@602fd350-edb4-49c9-b593-d223f7449a82>
62+
Joe McGill <joemcgill@git.wordpress.org> <joemcgill@602fd350-edb4-49c9-b593-d223f7449a82>
63+
John Blackbourn <johnbillion@git.wordpress.org> <johnbillion@602fd350-edb4-49c9-b593-d223f7449a82>
64+
John James Jacoby <johnjamesjacoby@git.wordpress.org> <johnjamesjacoby@602fd350-edb4-49c9-b593-d223f7449a82>
65+
Jon Cave <duck_@git.wordpress.org> <duck_@602fd350-edb4-49c9-b593-d223f7449a82>
66+
Jonathan Desrosiers <desrosj@git.wordpress.org> <desrosj@602fd350-edb4-49c9-b593-d223f7449a82>
67+
Jonny Harris <spacedmonkey@git.wordpress.org> <spacedmonkey@602fd350-edb4-49c9-b593-d223f7449a82>
68+
Jorge Costa <jorgefilipecosta@git.wordpress.org> <jorgefilipecosta@602fd350-edb4-49c9-b593-d223f7449a82>
69+
Joseph Scott <josephscott@git.wordpress.org> <josephscott@602fd350-edb4-49c9-b593-d223f7449a82>
70+
Juliette Reinders Folmer <jrf@git.wordpress.org>
71+
Juliette Reinders Folmer <jrf@git.wordpress.org> <jrf@602fd350-edb4-49c9-b593-d223f7449a82>
72+
K. Adam White <kadamwhite@git.wordpress.org> <kadamwhite@602fd350-edb4-49c9-b593-d223f7449a82>
73+
Kelly Choyce-Dwan <ryelle@git.wordpress.org>
74+
Kelly Choyce-Dwan <ryelle@git.wordpress.org> <ryelle@602fd350-edb4-49c9-b593-d223f7449a82>
75+
Kira Schroder <kirasong@git.wordpress.org> <mikeschroder@602fd350-edb4-49c9-b593-d223f7449a82>
76+
Kira Schroder <kirasong@git.wordpress.org> <mikeschroder@git.wordpress.org>
77+
Konstantin Kovshenin <kovshenin@git.wordpress.org> <kovshenin@602fd350-edb4-49c9-b593-d223f7449a82>
78+
Konstantin Obenland <obenland@git.wordpress.org>
79+
Konstantin Obenland <obenland@git.wordpress.org> <obenland@602fd350-edb4-49c9-b593-d223f7449a82>
80+
Lance Willett <lancewillett@git.wordpress.org> <lancewillett@602fd350-edb4-49c9-b593-d223f7449a82>
81+
Marius L. J <clorith@git.wordpress.org> <clorith@602fd350-edb4-49c9-b593-d223f7449a82>
82+
Mark Jaquith <markjaquith@git.wordpress.org> <markjaquith@602fd350-edb4-49c9-b593-d223f7449a82>
83+
Matias Ventura <matveb@git.wordpress.org> <matveb@602fd350-edb4-49c9-b593-d223f7449a82>
84+
Matt Mullenweg <matt@git.wordpress.org> <matt@602fd350-edb4-49c9-b593-d223f7449a82>
85+
Matt Thomas <iammattthomas@git.wordpress.org> <iammattthomas@602fd350-edb4-49c9-b593-d223f7449a82>
86+
Mel Choyce <melchoyce@git.wordpress.org> <melchoyce@602fd350-edb4-49c9-b593-d223f7449a82>
87+
Michael Adams <mdawaffe@git.wordpress.org>
88+
Michael Adams <mdawaffe@git.wordpress.org> <mdawaffe@602fd350-edb4-49c9-b593-d223f7449a82>
89+
Michael Arestad <michael-arestad@git.wordpress.org> <michael-arestad@602fd350-edb4-49c9-b593-d223f7449a82>
90+
Michal Czaplinski <czapla@git.wordpress.org> <czapla@602fd350-edb4-49c9-b593-d223f7449a82>
91+
Miguel Fonseca <mcsf@git.wordpress.org> <mcsf@602fd350-edb4-49c9-b593-d223f7449a82>
92+
Mike Little <mikelittle@git.wordpress.org> <mikelittle@602fd350-edb4-49c9-b593-d223f7449a82>
93+
Nikolay Bachiyski <nbachiyski@git.wordpress.org> <nbachiyski@602fd350-edb4-49c9-b593-d223f7449a82>
94+
Omar Reiss <omarreiss@git.wordpress.org> <omarreiss@602fd350-edb4-49c9-b593-d223f7449a82>
95+
Pascal Birchler <swissspidy@git.wordpress.org> <swissspidy@602fd350-edb4-49c9-b593-d223f7449a82>
96+
Pete Mall <petemall@git.wordpress.org> <petemall@602fd350-edb4-49c9-b593-d223f7449a82>
97+
Peter Westwood <westi@git.wordpress.org> <westi@602fd350-edb4-49c9-b593-d223f7449a82>
98+
Peter Wilson <peterwilsoncc@git.wordpress.org> <peterwilsoncc@602fd350-edb4-49c9-b593-d223f7449a82>
99+
Rachel Baker <rachelbaker@git.wordpress.org> <rachelbaker@602fd350-edb4-49c9-b593-d223f7449a82>
100+
Riad Benguella <youknowriad@git.wordpress.org> <youknowriad@602fd350-edb4-49c9-b593-d223f7449a82>
101+
Robert Anderson <noisysocks@git.wordpress.org> <noisysocks@602fd350-edb4-49c9-b593-d223f7449a82>
102+
Ron Rennick <wpmuguru@git.wordpress.org> <wpmuguru@602fd350-edb4-49c9-b593-d223f7449a82>
103+
Ryan Boren <ryan@git.wordpress.org> <ryan@602fd350-edb4-49c9-b593-d223f7449a82>
104+
Ryan McCue <rmccue@git.wordpress.org> <rmccue@602fd350-edb4-49c9-b593-d223f7449a82>
105+
Scott Taylor <wonderboymusic@git.wordpress.org> <wonderboymusic@602fd350-edb4-49c9-b593-d223f7449a82>
106+
Sergey Biryukov <sergeybiryukov@git.wordpress.org> <sergeybiryukov@602fd350-edb4-49c9-b593-d223f7449a82>
107+
Sergey Biryukov <sergeybiryukov@git.wordpress.org> <SergeyBiryukov@602fd350-edb4-49c9-b593-d223f7449a82>
108+
Tammie Lister <karmatosed@git.wordpress.org>
109+
Tammie Lister <karmatosed@git.wordpress.org> <karmatosed@602fd350-edb4-49c9-b593-d223f7449a82>
110+
Timothy Jacobs <timothyblynjacobs@git.wordpress.org> <timothyblynjacobs@602fd350-edb4-49c9-b593-d223f7449a82>
111+
Timothy Jacobs <timothyblynjacobs@git.wordpress.org> <TimothyBlynJacobs@602fd350-edb4-49c9-b593-d223f7449a82>
112+
Tonya Mork <hellofromTonya@git.wordpress.org> <hellofromTonya@602fd350-edb4-49c9-b593-d223f7449a82>
113+
Tonya Mork <hellofromTonya@git.wordpress.org> <hellofromtonya@git.wordpress.org>
114+
Weston Ruter <westonruter@git.wordpress.org> <westonruter@602fd350-edb4-49c9-b593-d223f7449a82>
115+
116+
# Accounts without a corresponding display name.
117+
allancole <allancole@git.wordpress.org> <allancole@602fd350-edb4-49c9-b593-d223f7449a82>
118+
bumpbot <bumpbot@git.wordpress.org> <bumpbot@602fd350-edb4-49c9-b593-d223f7449a82>
119+
jverber <jverber@git.wordpress.org> <jverber@602fd350-edb4-49c9-b593-d223f7449a82>
120+
laurelfulford <laurelfulford@git.wordpress.org> <laurelfulford@602fd350-edb4-49c9-b593-d223f7449a82>
121+
luisherranz <luisherranz@git.wordpress.org> <luisherranz@602fd350-edb4-49c9-b593-d223f7449a82>
122+
michelvaldrighi <michelvaldrighi@git.wordpress.org> <michelvaldrighi@602fd350-edb4-49c9-b593-d223f7449a82>
123+
potbot <potbot@git.wordpress.org> <potbot@602fd350-edb4-49c9-b593-d223f7449a82>
124+
ramonopoly <ramonopoly@git.wordpress.org> <ramonopoly@602fd350-edb4-49c9-b593-d223f7449a82>
125+
rob1n <rob1n@git.wordpress.org> <rob1n@602fd350-edb4-49c9-b593-d223f7449a82>
126+
scribu <scribu@git.wordpress.org> <scribu@602fd350-edb4-49c9-b593-d223f7449a82>
127+
zieladam <zieladam@git.wordpress.org> <zieladam@602fd350-edb4-49c9-b593-d223f7449a82>

src/wp-admin/css/dashboard.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,11 @@ body #dashboard-widgets .postbox form .submit {
712712
font-weight: 400;
713713
}
714714

715+
#network_dashboard_right_now p input {
716+
margin: 2px 1px;
717+
vertical-align: middle;
718+
}
719+
715720
/* Dashboard right now - Colors */
716721

717722
#dashboard_right_now .sub {

src/wp-includes/class-wp-theme-json.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,9 +1448,16 @@ public function get_stylesheet( $types = array( 'variables', 'styles', 'presets'
14481448
protected function process_blocks_custom_css( $css, $selector ) {
14491449
$processed_css = '';
14501450

1451+
if ( empty( $css ) ) {
1452+
return $processed_css;
1453+
}
1454+
14511455
// Split CSS nested rules.
14521456
$parts = explode( '&', $css );
14531457
foreach ( $parts as $part ) {
1458+
if ( empty( $part ) ) {
1459+
continue;
1460+
}
14541461
$is_root_css = ( ! str_contains( $part, '{' ) );
14551462
if ( $is_root_css ) {
14561463
// If the part doesn't contain braces, it applies to the root level.
@@ -1463,11 +1470,25 @@ protected function process_blocks_custom_css( $css, $selector ) {
14631470
}
14641471
$nested_selector = $part[0];
14651472
$css_value = $part[1];
1466-
$part_selector = str_starts_with( $nested_selector, ' ' )
1473+
1474+
/*
1475+
* Handle pseudo elements such as ::before, ::after etc. Regex will also
1476+
* capture any leading combinator such as >, +, or ~, as well as spaces.
1477+
* This allows pseudo elements as descendants e.g. `.parent ::before`.
1478+
*/
1479+
$matches = array();
1480+
$has_pseudo_element = preg_match( '/([>+~\s]*::[a-zA-Z-]+)/', $nested_selector, $matches );
1481+
$pseudo_part = $has_pseudo_element ? $matches[1] : '';
1482+
$nested_selector = $has_pseudo_element ? str_replace( $pseudo_part, '', $nested_selector ) : $nested_selector;
1483+
1484+
// Finalize selector and re-append pseudo element if required.
1485+
$part_selector = str_starts_with( $nested_selector, ' ' )
14671486
? static::scope_selector( $selector, $nested_selector )
14681487
: static::append_to_selector( $selector, $nested_selector );
1469-
$final_selector = ":root :where($part_selector)";
1470-
$processed_css .= $final_selector . '{' . trim( $css_value ) . '}';}
1488+
$final_selector = ":root :where($part_selector)$pseudo_part";
1489+
1490+
$processed_css .= $final_selector . '{' . trim( $css_value ) . '}';
1491+
}
14711492
}
14721493
return $processed_css;
14731494
}

src/wp-includes/html-api/class-wp-html-processor.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ private function step_in_head(): bool {
15011501
$this->state->stack_of_open_elements->pop_until( 'TEMPLATE' );
15021502
$this->state->active_formatting_elements->clear_up_to_last_marker();
15031503
array_pop( $this->state->stack_of_template_insertion_modes );
1504-
$this->reset_insertion_mode();
1504+
$this->reset_insertion_mode_appropriately();
15051505
return true;
15061506
}
15071507

@@ -2955,7 +2955,7 @@ private function step_in_table(): bool {
29552955
}
29562956

29572957
$this->state->stack_of_open_elements->pop_until( 'TABLE' );
2958-
$this->reset_insertion_mode();
2958+
$this->reset_insertion_mode_appropriately();
29592959
return $this->step( self::REPROCESS_CURRENT_NODE );
29602960

29612961
/*
@@ -2968,7 +2968,7 @@ private function step_in_table(): bool {
29682968
}
29692969

29702970
$this->state->stack_of_open_elements->pop_until( 'TABLE' );
2971-
$this->reset_insertion_mode();
2971+
$this->reset_insertion_mode_appropriately();
29722972
return true;
29732973

29742974
/*
@@ -3729,7 +3729,7 @@ private function step_in_select(): bool {
37293729
return $this->step();
37303730
}
37313731
$this->state->stack_of_open_elements->pop_until( 'SELECT' );
3732-
$this->reset_insertion_mode();
3732+
$this->reset_insertion_mode_appropriately();
37333733
return true;
37343734

37353735
/*
@@ -3745,7 +3745,7 @@ private function step_in_select(): bool {
37453745
return $this->step();
37463746
}
37473747
$this->state->stack_of_open_elements->pop_until( 'SELECT' );
3748-
$this->reset_insertion_mode();
3748+
$this->reset_insertion_mode_appropriately();
37493749
return $this->step( self::REPROCESS_CURRENT_NODE );
37503750

37513751
/*
@@ -3800,7 +3800,7 @@ private function step_in_select_in_table(): bool {
38003800
case '+TH':
38013801
// @todo Indicate a parse error once it's possible.
38023802
$this->state->stack_of_open_elements->pop_until( 'SELECT' );
3803-
$this->reset_insertion_mode();
3803+
$this->reset_insertion_mode_appropriately();
38043804
return $this->step( self::REPROCESS_CURRENT_NODE );
38053805

38063806
/*
@@ -3819,7 +3819,7 @@ private function step_in_select_in_table(): bool {
38193819
return $this->step();
38203820
}
38213821
$this->state->stack_of_open_elements->pop_until( 'SELECT' );
3822-
$this->reset_insertion_mode();
3822+
$this->reset_insertion_mode_appropriately();
38233823
return $this->step( self::REPROCESS_CURRENT_NODE );
38243824
}
38253825

@@ -3954,7 +3954,7 @@ private function step_in_template(): bool {
39543954
$this->state->stack_of_open_elements->pop_until( 'TEMPLATE' );
39553955
$this->state->active_formatting_elements->clear_up_to_last_marker();
39563956
array_pop( $this->state->stack_of_template_insertion_modes );
3957-
$this->reset_insertion_mode();
3957+
$this->reset_insertion_mode_appropriately();
39583958
return $this->step( self::REPROCESS_CURRENT_NODE );
39593959
}
39603960

@@ -5100,7 +5100,7 @@ private function reconstruct_active_formatting_elements(): bool {
51005100
*
51015101
* @see https://html.spec.whatwg.org/multipage/parsing.html#reset-the-insertion-mode-appropriately
51025102
*/
5103-
public function reset_insertion_mode(): void {
5103+
private function reset_insertion_mode_appropriately(): void {
51045104
// Set the first node.
51055105
$first_node = null;
51065106
foreach ( $this->state->stack_of_open_elements->walk_down() as $first_node ) {

src/wp-includes/html-api/class-wp-html-tag-processor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3667,7 +3667,7 @@ public function set_attribute( $name, $value ): bool {
36673667
*
36683668
* @see https://html.spec.whatwg.org/#attributes-3
36693669
*/
3670-
$escaped_new_value = in_array( $comparable_name, wp_kses_uri_attributes() ) ? esc_url( $value ) : esc_attr( $value );
3670+
$escaped_new_value = in_array( $comparable_name, wp_kses_uri_attributes(), true ) ? esc_url( $value ) : esc_attr( $value );
36713671

36723672
// If the escaping functions wiped out the update, reject it and indicate it was rejected.
36733673
if ( '' === $escaped_new_value && '' !== $value ) {

tests/phpunit/tests/theme/wpThemeJson.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5243,6 +5243,7 @@ public function data_custom_css_for_user_caps() {
52435243

52445244
/**
52455245
* @ticket 61165
5246+
* @ticket 61769
52465247
*
52475248
* @dataProvider data_process_blocks_custom_css
52485249
*
@@ -5270,6 +5271,13 @@ public function test_process_blocks_custom_css( $input, $expected ) {
52705271
public function data_process_blocks_custom_css() {
52715272
return array(
52725273
// Simple CSS without any nested selectors.
5274+
'empty css' => array(
5275+
'input' => array(
5276+
'selector' => '.foo',
5277+
'css' => '',
5278+
),
5279+
'expected' => '',
5280+
),
52735281
'no nested selectors' => array(
52745282
'input' => array(
52755283
'selector' => '.foo',
@@ -5285,21 +5293,28 @@ public function data_process_blocks_custom_css() {
52855293
),
52865294
'expected' => ':root :where(.foo){color: red; margin: auto;}:root :where(.foo.one){color: blue;}:root :where(.foo .two){color: green;}',
52875295
),
5296+
'no root styles' => array(
5297+
'input' => array(
5298+
'selector' => '.foo',
5299+
'css' => '&::before{color: red;}',
5300+
),
5301+
'expected' => ':root :where(.foo)::before{color: red;}',
5302+
),
52885303
// CSS with pseudo elements.
52895304
'with pseudo elements' => array(
52905305
'input' => array(
52915306
'selector' => '.foo',
52925307
'css' => 'color: red; margin: auto; &::before{color: blue;} & ::before{color: green;} &.one::before{color: yellow;} & .two::before{color: purple;}',
52935308
),
5294-
'expected' => ':root :where(.foo){color: red; margin: auto;}:root :where(.foo::before){color: blue;}:root :where(.foo ::before){color: green;}:root :where(.foo.one::before){color: yellow;}:root :where(.foo .two::before){color: purple;}',
5309+
'expected' => ':root :where(.foo){color: red; margin: auto;}:root :where(.foo)::before{color: blue;}:root :where(.foo) ::before{color: green;}:root :where(.foo.one)::before{color: yellow;}:root :where(.foo .two)::before{color: purple;}',
52955310
),
52965311
// CSS with multiple root selectors.
52975312
'with multiple root selectors' => array(
52985313
'input' => array(
52995314
'selector' => '.foo, .bar',
53005315
'css' => 'color: red; margin: auto; &.one{color: blue;} & .two{color: green;} &::before{color: yellow;} & ::before{color: purple;} &.three::before{color: orange;} & .four::before{color: skyblue;}',
53015316
),
5302-
'expected' => ':root :where(.foo, .bar){color: red; margin: auto;}:root :where(.foo.one, .bar.one){color: blue;}:root :where(.foo .two, .bar .two){color: green;}:root :where(.foo::before, .bar::before){color: yellow;}:root :where(.foo ::before, .bar ::before){color: purple;}:root :where(.foo.three::before, .bar.three::before){color: orange;}:root :where(.foo .four::before, .bar .four::before){color: skyblue;}',
5317+
'expected' => ':root :where(.foo, .bar){color: red; margin: auto;}:root :where(.foo.one, .bar.one){color: blue;}:root :where(.foo .two, .bar .two){color: green;}:root :where(.foo, .bar)::before{color: yellow;}:root :where(.foo, .bar) ::before{color: purple;}:root :where(.foo.three, .bar.three)::before{color: orange;}:root :where(.foo .four, .bar .four)::before{color: skyblue;}',
53035318
),
53045319
);
53055320
}

0 commit comments

Comments
 (0)