diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index fe99388b27732..58d82789cfbaf 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -2911,6 +2911,17 @@ CSS_CUSTOM_NAME_PREFIX_LENGTH Servo_GetCustomPropertyValue ( mComputedStyle +mPresShell +- +> +StyleSet +( +) +- +> +RawData +( +) & name & diff --git a/servo/components/style/custom_properties.rs b/servo/components/style/custom_properties.rs index b90e5ed784ecc..7a1111336d009 100644 --- a/servo/components/style/custom_properties.rs +++ b/servo/components/style/custom_properties.rs @@ -134,6 +134,18 @@ crate properties_and_values : : +registry +: +: +PropertyRegistration +; +use +crate +: +: +properties_and_values +: +: value : : @@ -1429,6 +1441,166 @@ PrecomputedHasher ; / / +IndexMap +equality +doesn +' +t +consider +ordering +which +we +have +to +account +for +. +/ +/ +Also +for +the +same +reason +IndexMap +equality +comparisons +are +slower +than +needed +. +/ +/ +/ +/ +See +https +: +/ +/ +github +. +com +/ +bluss +/ +indexmap +/ +issues +/ +153 +fn +maps_equal +( +l +: +Option +< +& +CustomPropertiesMap +> +r +: +Option +< +& +CustomPropertiesMap +> +) +- +> +bool +{ +match +( +l +r +) +{ +( +Some +( +l +) +Some +( +r +) +) += +> +{ +l +. +len +( +) += += +r +. +len +( +) +& +& +l +. +iter +( +) +. +zip +( +r +. +iter +( +) +) +. +all +( +| +( +( +k1 +v1 +) +( +k2 +v2 +) +) +| +k1 += += +k2 +& +& +v1 += += +v2 +) +} +( +None +None +) += +> +true +_ += +> +false +} +} +/ +/ / A pair @@ -1487,12 +1659,13 @@ inherit flag set including -classical -CSS +non +- +registered / / / -variables +ones . Defined as @@ -1580,123 +1753,139 @@ is_none ( ) } +/ +/ +/ +Return +the +name +and +value +of +the +property +at +specified +index +if +any +. +pub fn -read +property_at ( & self +index +: +usize ) - > -ReadOnlyCustomProperties -{ -ReadOnlyCustomProperties -{ -inherited -: -self -. -inherited -. -as_deref -( -) -non_inherited -: -self -. -non_inherited -. -as_deref -( -) -} -} -} -impl -PartialEq -for -ComputedCustomProperties -{ -fn -eq +Option +< ( & -self -other -: +Name & -Self +Arc +< +VariableValue +> ) -- > -bool { / / -IndexMap -equality -doesn -' -t -consider -ordering -which -we -have -to -account -for -. -/ -/ -Also -for +Just +expose the -same -reason -IndexMap -equality -comparisons -are -slower -than -needed -. +custom +property +items +from / / +custom_properties +. +inherited +followed +by +custom +property +items +from / / -See -https -: +custom_properties +. +non_inherited +. / / -github -. -com +TODO +( +bug +1855629 +) +: +We +should +probably +expose +all +properties +that / -bluss / -indexmap +don +' +t +have +the +guaranteed +- +invalid +- +value +( +including +non +- +inherited / -issues / -153 +properties +with +an +initial +value +) +not +just +the +ones +in +the +maps +. / / TODO ( bug -1840478 +1855629 ) : -Handle -non -- -inherited +In +which +order +should +we +expose +these properties -. +? match ( & @@ -1704,231 +1893,329 @@ self . inherited & -other +self . -inherited +non_inherited ) { ( Some ( -l +p1 ) Some ( -r +p2 ) ) = > -{ -l -. -len -( -) -= -= -r +p1 . -len +get_index ( +index ) -& -& -l . -iter +or_else ( -) +| +| +p2 . -zip +get_index ( -r +index +- +p1 . -iter +len ( ) ) -. -all +) ( -| +Some ( +p1 +) +None +) += +> +p1 +. +get_index ( -k1 -v1 +index ) ( -k2 -v2 +None +Some +( +p2 ) ) -| -k1 -= -= -k2 -& -& -v1 = -= -v2 +> +p2 +. +get_index +( +index ) -} ( None None ) = > -true -_ -= -> -false -} +None } } -/ -/ -/ -A -mutable -CustomPropertiesMapPair -using -UniqueArc -for -inherited -properties -. -# -[ -derive +fn +read ( -Default +& +self ) -] -struct -MutableCustomProperties +- +> +ReadOnlyCustomProperties +{ +ReadOnlyCustomProperties { inherited : -Option -< -UniqueArc -< -CustomPropertiesMap -> -> +self +. +inherited +. +as_deref +( +) non_inherited : -Option -< -Box -< -CustomPropertiesMap -> -> -} -impl -MutableCustomProperties -{ -/ -/ -/ -Insert -a -custom -property -in -the -corresponding -inherited -/ +self +. non_inherited -/ -/ -/ -map -depending -on -whether -the -inherit -flag -is -set -or -unset . +as_deref +( +) +} +} fn -insert +inherited_equal ( & -mut self -name -: -Name -value +other : -Arc -< -VariableValue -> +& +Self ) - > -Option -< -Arc -< -VariableValue -> +bool +{ +maps_equal +( +self +. +inherited +. +as_deref +( +) +other +. +inherited +. +as_deref +( +) +) +} +fn +non_inherited_equal +( +& +self +other +: +& +Self +) +- > +bool { -/ -/ -TODO +maps_equal +( +self +. +non_inherited +. +as_deref +( +) +other +. +non_inherited +. +as_deref ( -bug -1840478 ) +) +} +} +impl +PartialEq +for +ComputedCustomProperties +{ +fn +eq +( +& +self +other : -Handle -non +& +Self +) - -inherited -properties +> +bool +{ +self . -let -map -= +inherited_equal +( +other +) +& +& self . +non_inherited_equal +( +other +) +} +} +/ +/ +/ +A +mutable +CustomPropertiesMapPair +using +UniqueArc +for inherited +properties . -get_or_insert_with +# +[ +derive ( -| -| -UniqueArc +Default +) +] +struct +MutableCustomProperties +{ +inherited : +Option +< +UniqueArc +< +CustomPropertiesMap +> +> +non_inherited : -new -( +Option +< +Box +< CustomPropertiesMap +> +> +} +impl +MutableCustomProperties +{ +/ +/ +/ +Insert +a +custom +property +in +the +corresponding +inherited +/ +non_inherited +/ +/ +/ +map +depending +on +whether +the +inherit +flag +is +set +or +unset +. +fn +insert +( +& +mut +self +registration +: +Option +< +& +PropertyRegistration +> +name : +Name +value : -default -( -) +Arc +< +VariableValue +> ) +- +> +Option +< +Arc +< +VariableValue +> +> +{ +self +. +get_map +( +registration ) -; -map . insert ( @@ -1970,6 +2257,13 @@ remove & mut self +registration +: +Option +< +& +PropertyRegistration +> name : & @@ -1985,28 +2279,12 @@ VariableValue > > { -/ -/ -TODO -( -bug -1840478 -) -: -Handle -non -- -inherited -properties -. self . -inherited -. -as_mut +get_map ( +registration ) -? . remove ( @@ -2022,19 +2300,26 @@ capacity of the inherited -/ -non_inherited -maps +map as much as +possible +. +An +empty / / / -possible +map +is +just +replaced +with +None . fn -shrink_to_fit +inherited_shrink_to_fit ( & mut @@ -2054,17 +2339,70 @@ self . inherited { +if map . -shrink_to_fit +is_empty ( ) +{ +self +. +inherited += +None ; } -if -let -Some -( +else +{ +map +. +shrink_to_fit +( +) +; +} +} +} +/ +/ +/ +Shrink +the +capacity +of +the +non_inherited +map +as +much +as +possible +. +An +/ +/ +/ +empty +map +is +just +replaced +with +None +. +fn +non_inherited_shrink_to_fit +( +& +mut +self +) +{ +if +let +Some +( ref mut map @@ -2074,6 +2412,22 @@ self . non_inherited { +if +map +. +is_empty +( +) +{ +self +. +non_inherited += +None +; +} +else +{ map . shrink_to_fit @@ -2082,6 +2436,7 @@ shrink_to_fit ; } } +} fn read ( @@ -2114,6 +2469,87 @@ as_deref ) } } +fn +get_map +( +& +mut +self +registration +: +Option +< +& +PropertyRegistration +> +) +- +> +& +mut +CustomPropertiesMap +{ +if +registration +. +map_or +( +true +| +r +| +r +. +inherits +) +{ +self +. +inherited +. +get_or_insert_with +( +| +| +UniqueArc +: +: +new +( +Default +: +: +default +( +) +) +) +} +else +{ +self +. +non_inherited +. +get_or_insert_with +( +| +| +Box +: +: +new +( +Default +: +: +default +( +) +) +) +} +} } # [ @@ -2166,6 +2602,10 @@ get ( & self +stylist +: +& +Stylist name : & @@ -2182,20 +2622,31 @@ VariableValue > > { -/ -/ -TODO +let +registration += +stylist +. +get_custom_property_registration ( -bug -1840478 +& +name ) -: -Handle -non -- -inherited -properties +; +if +registration +. +map_or +( +true +| +r +| +r . +inherits +) +{ self . inherited @@ -2206,6 +2657,19 @@ get name ) } +else +{ +self +. +non_inherited +? +. +get +( +name +) +} +} } / / @@ -4886,18 +5350,6 @@ i > > { -debug_assert -! -( -custom_properties -. -non_inherited -. -is_none -( -) -) -; input . skip_whitespace @@ -5419,6 +5871,9 @@ stylist ' a Stylist +is_root_element +: +bool ) - > @@ -5448,52 +5903,121 @@ false custom_properties : MutableCustomProperties +{ +inherited : -: -default +if +is_root_element +{ +debug_assert +! ( -) inherited +. +is_empty +( +) +) +; stylist -} -} -/ -/ -/ -Cascade -a -given -custom -property -declaration . -pub -fn -cascade +get_custom_property_initial_values ( -& -mut -self -declaration +) +. +map +( +UniqueArc : -& -' -a -CustomDeclaration -priority : -CascadePriority +new ) -{ -let -CustomDeclaration -{ -ref -name -ref -value } -= +else +{ +/ +/ +This +should +just +be +a +copy +of +inherited +. +inherited +but +/ +/ +do +it +lazily +and +postpone +that +to +when +that +actually +/ +/ +becomes +necessary +in +the +cascade +and +build +methods +. +None +} +non_inherited +: +None +} +inherited +stylist +} +} +/ +/ +/ +Cascade +a +given +custom +property +declaration +. +pub +fn +cascade +( +& +mut +self +declaration +: +& +' +a +CustomDeclaration +priority +: +CascadePriority +) +{ +let +CustomDeclaration +{ +ref +name +ref +value +} += * declaration ; @@ -5570,14 +6094,17 @@ return TODO ( bug -1840478 +1855887 ) : -Handle -non -- +Try +to +postpone +cloning +of +inherited +. inherited -properties . if self @@ -5596,22 +6123,21 @@ custom_properties . inherited = -Some -( -match -& self . inherited . inherited -{ -Some +. +as_ref ( -inherited ) -= -> +. +map +( +| +i +| UniqueArc : : @@ -5620,29 +6146,13 @@ new ( * * -inherited +i ) . clone ( ) ) -None -= -> -UniqueArc -: -: -new -( -CustomPropertiesMap -: -: -default -( -) -) -} ) ; } @@ -5655,6 +6165,19 @@ self . custom_properties ; +let +custom_registration += +self +. +stylist +. +get_custom_property_registration +( +& +name +) +; match * value @@ -5758,15 +6281,7 @@ Some registration ) = -self -. -stylist -. -get_custom_property_registration -( -& -name -) +custom_registration { let mut @@ -5817,6 +6332,7 @@ map . remove ( +custom_registration name ) ; @@ -5829,6 +6345,7 @@ map . insert ( +custom_registration name . clone @@ -5909,70 +6426,737 @@ Initial = > { +/ +/ +For +non +- +inherited +custom +properties +' +initial +' +was +handled +in +value_may_affect_style +. +debug_assert +! +( +custom_registration +. +map_or +( +true +| +r +| +r +. +inherits +) +" +Should +' +ve +been +handled +earlier +" +) +; map . remove ( +custom_registration +name +) +; +if +let +Some +( +registration +) += +custom_registration +{ +if +let +Some +( +ref +initial_value +) += +registration +. +initial_value +{ +map +. +insert +( +custom_registration name +. +clone +( +) +initial_value +. +clone +( +) ) ; } +} +} +CSSWideKeyword +: +: +Inherit += +> +{ / / +For +inherited +custom +properties +' +inherit +' +was handled in value_may_affect_style -CSSWideKeyword -: -: -Unset +. +debug_assert +! +( +! +custom_registration +. +map_or +( +true | -CSSWideKeyword -: -: -Inherit +r +| +r +. +inherits +) +" +Should +' +ve +been +handled +earlier +" +) +; +if +let +Some +( +inherited_value +) += +self +. +inherited +. +non_inherited +. +as_ref +( +) +. +and_then +( +| +m +| +m +. +get +( +name +) +) +{ +map +. +insert +( +custom_registration +name +. +clone +( +) +inherited_value +. +clone +( +) +) +; +} +} +/ +/ +handled +in +value_may_affect_style +CSSWideKeyword +: +: +Unset += +> +unreachable +! +( +) +} +} +} +fn +value_may_affect_style +( +& +self +name +: +& +Name +value +: +& +CustomDeclarationValue +) +- +> +bool +{ +let +custom_registration += +self +. +stylist +. +get_custom_property_registration +( +& +name +) +; +match +* +value +{ +CustomDeclarationValue +: +: +CSSWideKeyword +( +CSSWideKeyword +: +: +Inherit +) += +> +{ +/ +/ +For +inherited +custom +properties +explicit +' +inherit +' +means +we +/ +/ +can +just +use +any +existing +value +in +the +inherited +/ +/ +CustomPropertiesMap +. +if +custom_registration +. +map_or +( +true +| +r +| +r +. +inherits +) +{ +return +false +; +} +} +CustomDeclarationValue +: +: +CSSWideKeyword +( +CSSWideKeyword +: +: +Initial +) += +> +{ +/ +/ +For +non +- +inherited +custom +properties +explicit +' +initial +' +means +/ +/ +we +can +just +use +any +initial +value +in +the +registration +. +if +! +custom_registration +. +map_or +( +true +| +r +| +r +. +inherits +) +{ +return +false +; +} +} +CustomDeclarationValue +: +: +CSSWideKeyword +( +CSSWideKeyword +: +: +Unset +) += +> +{ +/ +/ +Explicit +' +unset +' +means +we +can +either +just +use +any +existing +/ +/ +value +in +the +inherited +CustomPropertiesMap +or +the +initial +/ +/ +value +in +the +registration +. +return +false +; +} +_ += +> +{ +} +} +let +existing_value += +if +custom_registration +. +map_or +( +true +| +r +| +r +. +inherits +) +{ +self +. +custom_properties +. +inherited +. +as_ref +( +) +. +and_then +( +| +m +| +m +. +get +( +name +) +) +. +or_else +( +| +| +self +. +inherited +. +inherited +. +as_ref +( +) +. +and_then +( +| +m +| +m +. +get +( +name +) +) +) +} +else +{ +debug_assert +! +( +self +. +custom_properties +. +non_inherited +. +as_ref +( +) +. +map_or +( +true +| +m +| +! +m +. +contains_key +( +name +) +) +) +; +custom_registration +. +and_then +( +| +m +| +m +. +initial_value +. +as_ref +( +) +) +} +; +match +( +existing_value +value +) +{ +( +None +& +CustomDeclarationValue +: +: +CSSWideKeyword +( +CSSWideKeyword +: +: +Initial +) +) += +> +{ +debug_assert +! +( +custom_registration +. +map_or +( +true +| +r +| +r +. +inherits +) +" +Should +' +ve +been +handled +earlier +" +) +; +/ +/ +The +initial +value +of +a +custom +property +without +a +/ +/ +guaranteed +- +invalid +initial +value +is +the +same +as +it +/ +/ +not +existing +in +the +map +. +if +custom_registration +. +map_or +( +true +| +r +| +r +. +initial_value +. +is_none +( +) +) +{ +return +false +; +} +} +( +Some +( +existing_value +) +& +CustomDeclarationValue +: +: +CSSWideKeyword +( +CSSWideKeyword +: +: +Initial +) +) += +> +{ +debug_assert +! +( +custom_registration +. +map_or +( +true +| +r +| +r +. +inherits +) +" +Should +' +ve +been +handled +earlier +" +) +; +/ +/ +Don +' +t +bother +overwriting +an +existing +value +with +the +initial +/ +/ +value +specified +in +the +registration +. +if +let +Some +( +registration +) += +custom_registration +{ +if +Some +( +existing_value +) = -> -unreachable -! += +registration +. +initial_value +. +as_ref ( ) +{ +return +false +; } } } -fn -value_may_affect_style ( -& -self -name -: -& -Name -value -: -& -CustomDeclarationValue -) -- -> -bool -{ -match -* -value -{ -CustomDeclarationValue -: -: -CSSWideKeyword +Some ( -CSSWideKeyword -: -: -Unset +_ ) -| +& CustomDeclarationValue : : @@ -5983,171 +7167,105 @@ CSSWideKeyword : Inherit ) +) = > { -/ -/ -Custom -properties -are -inherited -by -default +debug_assert +! +( +! +custom_registration . -So -/ -/ -explicit -' -inherit -' -or -' -unset +map_or +( +true +| +r +| +r +. +inherits +) +" +Should ' -means -we -can -just -use +ve +been +handled +earlier +" +) +; / / -any -existing -value -in +existing_value +is the -inherited -CustomPropertiesMap +registered +initial +value . -return -false -; -} -_ -= -> -{ -} -} / / -TODO -( -bug -1840478 -) -: -Handle -non -- -inherited -properties -. -let -existing_value -= +Don +' +t +bother +adding +it +to self . custom_properties . -inherited -. -as_ref -( -) +non_inherited +/ +/ +if +the +key +is +also +absent +from +self . -and_then -( -| -m -| -m +inherited . -get -( -name -) -) +non_inherited . -or_else -( -| -| +if self . inherited . -inherited +non_inherited . as_ref ( ) . -and_then +map_or ( +true | m | +! m . -get +contains_key ( name ) ) -) -; -match -( -existing_value -value -) -{ -( -None -& -CustomDeclarationValue -: -: -CSSWideKeyword -( -CSSWideKeyword -: -: -Initial -) -) -= -> { -/ -/ -The -initial -value -of -a -custom -property -is -the -same -as -it -/ -/ -not -existing -in -the -map -. return false ; } +} ( Some ( @@ -6175,13 +7293,12 @@ bother overwriting an existing -inherited value with -/ -/ the same +/ +/ specified value . @@ -6218,20 +7335,6 @@ MutableCustomProperties > bool { -/ -/ -TODO -( -bug -1840478 -) -: -Handle -non -- -inherited -properties -. let ( inherited @@ -6269,7 +7372,7 @@ inherited map ) ( -None +_ None ) = @@ -6304,14 +7407,53 @@ false for name in -self -. -seen +self +. +seen +. +iter +( +) +{ +/ +/ +IndexMap +. +get +( +) +returns +None +if +the +element +is +not +in +the +map +so +/ +/ +we +don +' +t +bother +checking +whether +name +actually +corresponds +to +an +/ +/ +inherited +custom +property +here . -iter -( -) -{ if inherited . @@ -6361,6 +7503,19 @@ was any specified property +or +non +- +inherited +custom +property +/ +/ +/ +with +an +initial +value we ' ve @@ -6413,23 +7568,109 @@ self > ComputedCustomProperties { -/ -/ -TODO +if +self +. +custom_properties +. +inherited +. +is_none ( -bug -1840478 ) -: -Handle +{ +/ +/ +Return +early +when +self +. +custom_properties +is +empty +covering +the +/ +/ +common +case +of +nodes +without +any +custom +property +specified +. +In +/ +/ +that +situation +inherited +properties +will +just +use +the +value +from +/ +/ +self +. +inherited +while non - inherited properties +will +use +their +/ +/ +initial +values . -debug_assert -! -( +These +initial +values +are +required +to +be +/ +/ +' +computationally +independent +' +but +may +still +differ +from +the +ones +/ +/ +in +self +. +inherited +so +ensure +they +are +used +in +the +parent +too +. +if self . custom_properties @@ -6439,11 +7680,8 @@ non_inherited is_none ( ) -) -; -debug_assert -! -( +& +& self . inherited @@ -6453,8 +7691,40 @@ non_inherited is_none ( ) +{ +return +self +. +inherited +. +clone +( ) ; +} +} +if +self +. +may_have_cycles +{ +/ +/ +TODO +( +bug +1855887 +) +: +Try +to +postpone +cloning +of +inherited +. +inherited +. if self . @@ -6466,21 +7736,45 @@ is_none ( ) { -return self . +custom_properties +. +inherited += +self +. +inherited +. inherited . +as_ref +( +) +. +map +( +| +i +| +UniqueArc +: +: +new +( +( +* +* +i +) +. clone ( ) +) +) ; } -if -self -. -may_have_cycles -{ substitute_all ( & @@ -6565,21 +7859,55 @@ self custom_properties ) { +self +. +custom_properties +. +non_inherited_shrink_to_fit +( +) +; return +ComputedCustomProperties +{ +inherited +: self . inherited . +inherited +. clone ( ) +non_inherited +: +self +. +custom_properties +. +non_inherited +. +take +( +) +} ; } self . custom_properties . -shrink_to_fit +inherited_shrink_to_fit +( +) +; +self +. +custom_properties +. +non_inherited_shrink_to_fit ( ) ; @@ -7375,6 +8703,9 @@ props . get ( +context +. +stylist name ) ? @@ -8073,6 +9404,15 @@ map . remove ( +context +. +stylist +. +get_custom_property_registration +( +& +var_name +) & var_name ) @@ -8101,11 +9441,20 @@ context . map . -remove +remove +( +context +. +stylist +. +get_custom_property_registration ( & name ) +& +name +) ; return None @@ -8333,6 +9682,17 @@ has_references ) ; let +custom_registration += +stylist +. +get_custom_property_registration +( +& +name +) +; +let mut computed_value = @@ -8443,6 +9803,7 @@ custom_properties . remove ( +custom_registration name ) ; @@ -8470,6 +9831,7 @@ custom_properties . remove ( +custom_registration name ) ; @@ -8525,6 +9887,22 @@ with it now . +let +inherits += +custom_registration +. +map_or +( +true +| +r +| +r +. +inherits +) +; if let Ok @@ -8543,48 +9921,179 @@ parse ) { match +( kw +inherits +) { +( CSSWideKeyword : : Initial +_ +) +| +( +CSSWideKeyword +: +: +Revert +false +) +| +( +CSSWideKeyword +: +: +RevertLayer +false +) +| +( +CSSWideKeyword +: +: +Unset +false +) = > { +/ +/ +TODO +( +bug +1273706 +) +: +Do +we +really +need +to +insert +the +initial +value +if +inherits += += +false +? custom_properties . remove ( +custom_registration +name +) +; +if +let +Some +( +registration +) += +custom_registration +{ +if +let +Some +( +ref +initial_value +) += +registration +. +initial_value +{ +custom_properties +. +insert +( +custom_registration name +. +clone +( +) +Arc +: +: +clone +( +initial_value +) ) ; } +} +} +( CSSWideKeyword : : Revert +true +) | +( CSSWideKeyword : : RevertLayer +true +) | +( CSSWideKeyword : : Inherit +_ +) | +( CSSWideKeyword : : Unset +true +) = > { / / TODO +( +bug +1273706 +) +: +Do +we +really +need +to +insert +the +inherited +value +if +inherits += += +true +? +/ +/ +TODO : It ' @@ -8631,41 +10140,18 @@ unset seems fine ? -/ -/ -TODO -( -bug -1840478 -) -: -Handle -non -- -inherited -properties -. match inherited . -inherited -. -as_ref +read ( ) . -and_then -( -| -map -| -map -. get ( +stylist name ) -) { Some ( @@ -8678,6 +10164,7 @@ custom_properties . insert ( +custom_registration name . clone @@ -8701,6 +10188,7 @@ custom_properties . remove ( +custom_registration name ) ; @@ -8720,13 +10208,7 @@ Some registration ) = -stylist -. -get_custom_property_registration -( -& -name -) +custom_registration { if ComputedRegisteredValue @@ -8748,6 +10230,7 @@ custom_properties . remove ( +custom_registration name ) ; @@ -8774,6 +10257,7 @@ custom_properties . insert ( +custom_registration name . clone @@ -8963,18 +10447,6 @@ i > > { -debug_assert -! -( -custom_properties -. -non_inherited -. -is_none -( -) -) -; let mut last_token_type @@ -9284,20 +10756,6 @@ None } else { -/ -/ -TODO -( -bug -1840478 -) -: -Handle -non -- -inherited -properties -. registration = stylist @@ -9308,13 +10766,69 @@ get_custom_property_registration name ) ; +let +value += custom_properties . get ( +stylist & name ) +; +if +registration +. +map_or +( +true +| +r +| +r +. +inherits +) +{ +value +. +map +( +| +v +| +& +* +* +v +) +} +else +{ +value +. +or_else +( +| +| +registration +. +and_then +( +| +m +| +m +. +initial_value +. +as_ref +( +) +) +) . map ( @@ -9327,6 +10841,7 @@ v v ) } +} ; if let diff --git a/servo/components/style/properties/cascade.rs b/servo/components/style/properties/cascade.rs index 44d334dc4070b..e93e0fffe6d01 100644 --- a/servo/components/style/properties/cascade.rs +++ b/servo/components/style/properties/cascade.rs @@ -1783,6 +1783,7 @@ custom_properties ( ) stylist +is_root_element ) ; for diff --git a/servo/components/style/properties/declaration_block.rs b/servo/components/style/properties/declaration_block.rs index 64bbf0396333b..7c8f6d36f210a 100644 --- a/servo/components/style/properties/declaration_block.rs +++ b/servo/components/style/properties/declaration_block.rs @@ -6103,6 +6103,7 @@ new ( inherited_custom_properties stylist +false ) ; for diff --git a/servo/components/style/properties/properties.mako.rs b/servo/components/style/properties/properties.mako.rs index 1a2c2bda829c9..788ffe71ade77 100644 --- a/servo/components/style/properties/properties.mako.rs +++ b/servo/components/style/properties/properties.mako.rs @@ -23446,29 +23446,104 @@ name { / / -TODO +FIXME ( bug -1840478 +1273706 ) : -Handle +This +should +use +a +stylist +to +determine +/ +/ +whether +the +name +corresponds +to +an +inherited +custom +property +/ +/ +and +then +choose +the +inherited +/ +non_inherited +map +accordingly +. +/ +/ +It +should +also +fallback +to +registered +initial +values +for +/ +/ non - inherited properties . +See +Servo_GetCustomPropertyValue +. +let +p += +& self . custom_properties +; +let +value += +p +. +inherited . as_ref ( ) . -inherited +and_then +( +| +map +| +map . -unwrap +get +( +name +) +) +. +or_else +( +| +| +p +. +non_inherited +. +as_ref ( ) . @@ -23484,6 +23559,9 @@ get name ) ) +) +; +value . map_or ( diff --git a/servo/components/style/properties_and_values/registry.rs b/servo/components/style/properties_and_values/registry.rs index 7aff5256a1aba..bf08e67f5c8f3 100644 --- a/servo/components/style/properties_and_values/registry.rs +++ b/servo/components/style/properties_and_values/registry.rs @@ -353,6 +353,43 @@ name / / / +Gets +already +- +registered +custom +properties +via +script +. +# +[ +inline +] +pub +fn +properties +( +& +self +) +- +> +& +PrecomputedHashMap +< +Atom +PropertyRegistration +> +{ +& +self +. +properties +} +/ +/ +/ Register a given diff --git a/servo/components/style/stylist.rs b/servo/components/style/stylist.rs index cf7ddfe7ed12c..8343cefc77c85 100644 --- a/servo/components/style/stylist.rs +++ b/servo/components/style/stylist.rs @@ -91,6 +91,15 @@ use crate : : +custom_properties +: +: +CustomPropertiesMap +; +use +crate +: +: dom : : @@ -4621,6 +4630,279 @@ None / / / +Returns +a +map +of +initial +values +for +registered +properties +with +the +/ +/ +/ +inherits +flag +set +and +a +specified +initial +value +. +/ +/ +/ +https +: +/ +/ +drafts +. +css +- +houdini +. +org +/ +css +- +properties +- +values +- +api +- +1 +/ +# +determining +- +registration +pub +fn +get_custom_property_initial_values +( +& +self +) +- +> +Option +< +CustomPropertiesMap +> +{ +let +mut +seen_names += +PrecomputedHashSet +: +: +default +( +) +; +let +mut +map += +CustomPropertiesMap +: +: +default +( +) +; +for +( +k +v +) +in +self +. +custom_property_script_registry +( +) +. +properties +( +) +. +iter +( +) +{ +seen_names +. +insert +( +k +. +clone +( +) +) +; +if +v +. +inherits +{ +if +let +Some +( +value +) += +& +v +. +initial_value +{ +map +. +insert +( +k +. +clone +( +) +value +. +clone +( +) +) +; +} +} +} +for +( +data +_ +) +in +self +. +iter_origins +( +) +{ +for +( +k +v +) +in +data +. +custom_property_registrations +. +iter +( +) +{ +if +seen_names +. +insert +( +k +. +clone +( +) +) +{ +let +last_value += +& +v +. +last +( +) +. +unwrap +( +) +. +0 +; +if +last_value +. +inherits +{ +if +let +Some +( +ref +value +) += +last_value +. +initial_value +{ +map +. +insert +( +k +. +clone +( +) +value +. +clone +( +) +) +; +} +} +} +} +} +if +map +. +is_empty +( +) +{ +None +} +else +{ +map +. +shrink_to_fit +( +) +; +Some +( +map +) +} +} +/ +/ +/ Rebuilds ( if diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs index 3fb184d2b911f..fffdcd3472495 100644 --- a/servo/ports/geckolib/glue.rs +++ b/servo/ports/geckolib/glue.rs @@ -43389,6 +43389,10 @@ computed_values : & ComputedValues +raw_style_set +: +& +PerDocumentStyleData name : & @@ -43403,44 +43407,14 @@ nsACString > bool { -/ -/ -TODO -( -bug -1840478 -) -: -Handle -non -- -inherited -properties -. let -inherited +doc_data = -match -& -computed_values -. -custom_properties +raw_style_set . -inherited -{ -Some +borrow ( -p ) -= -> -p -None -= -> -return -false -} ; let name @@ -43458,32 +43432,123 @@ as_str_unchecked ) ; let +stylist += +& +doc_data +. +stylist +; +let +custom_registration += +stylist +. +get_custom_property_registration +( +& +name +) +; +let computed_value = -match +if +custom_registration +. +map_or +( +true +| +r +| +r +. +inherits +) +{ +computed_values +. +custom_properties +. inherited . +as_ref +( +) +. +and_then +( +| +m +| +m +. get ( & name ) +) +} +else { +computed_values +. +custom_properties +. +non_inherited +. +as_ref +( +) +. +and_then +( +| +m +| +m +. +get +( +& +name +) +) +. +or_else +( +| +| +custom_registration +. +and_then +( +| +m +| +m +. +initial_value +. +as_ref +( +) +) +) +} +; +if +let Some ( v ) = -> -v -None -= -> -return -false -} -; computed_value +{ +v . to_css ( @@ -43504,6 +43569,11 @@ unwrap ; true } +else +{ +false +} +} # [ no_mangle @@ -43527,46 +43597,125 @@ u32 { / / +Just +expose +the +custom +property +items +from +custom_properties +. +inherited +/ +/ +and +custom_properties +. +non_inherited +. +/ +/ TODO ( bug -1840478 +1855629 ) : -Handle +We +should +probably +expose +all +properties +that +don +' +t +/ +/ +have +the +guaranteed +- +invalid +- +value +( +including non - inherited properties +/ +/ +with +an +initial +value +) +not +just +the +ones +in +the +maps . -match -& +let +properties += computed_values . custom_properties ( ) +; +( +properties . inherited -{ -Some +. +as_ref ( +) +. +map_or +( +0 +| +m +| m +. +len +( ) -= -> +) ++ +properties +. +non_inherited +. +as_ref +( +) +. +map_or +( +0 +| +m +| m . len ( ) +) +) as u32 -None -= -> -0 -} } # [ @@ -43594,57 +43743,13 @@ u32 mut nsAtom { -/ -/ -TODO -( -bug -1840478 -) -: -Handle -non -- -inherited -properties -. -let -inherited -= match & computed_values . custom_properties . -inherited -{ -Some -( -p -) -= -> -p -None -= -> -return -ptr -: -: -null_mut -( -) -} -; -let -property_name -= -match -inherited -. -get_index +property_at ( index as @@ -43654,17 +43759,20 @@ usize Some ( ( -key +name _value ) ) = > -key +name +. +as_ptr +( +) None = > -return ptr : : @@ -43672,12 +43780,6 @@ null_mut ( ) } -; -property_name -. -as_ptr -( -) } # [ diff --git a/testing/web-platform/meta/css/css-cascade/layer-cssom-order-reverse-at-property.html.ini b/testing/web-platform/meta/css/css-cascade/layer-cssom-order-reverse-at-property.html.ini index a954e02c91b0c..1809dd92788c8 100644 --- a/testing/web-platform/meta/css/css-cascade/layer-cssom-order-reverse-at-property.html.ini +++ b/testing/web-platform/meta/css/css-cascade/layer-cssom-order-reverse-at-property.html.ini @@ -31,21 +31,3 @@ fission OK TIMEOUT ] -[ -Insert -layer -invalidates -property -] -expected -: -FAIL -[ -Delete -layer -invalidates -property -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-cascade/layer-property-override.html.ini b/testing/web-platform/meta/css/css-cascade/layer-property-override.html.ini index ffe471f2f32dc..bc660f5c28ca6 100644 --- a/testing/web-platform/meta/css/css-cascade/layer-property-override.html.ini +++ b/testing/web-platform/meta/css/css-cascade/layer-property-override.html.ini @@ -25,45 +25,3 @@ fission OK TIMEOUT ] -[ -property -override -between -layers -] -expected -: -FAIL -[ -property -override -update -with -appended -sheet -1 -] -expected -: -FAIL -[ -property -override -update -with -appended -sheet -2 -] -expected -: -FAIL -[ -property -unlayered -overrides -layered -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animate-invalid.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animate-invalid.html.ini deleted file mode 100644 index 37b4c76da8fc6..0000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/animate-invalid.html.ini +++ /dev/null @@ -1,22 +0,0 @@ -[ -animate -- -invalid -. -html -] -[ -Do -not -crash -when -animating -to -unresolved -var -( -) -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-angle-comma-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-angle-comma-list.html.ini index 53cb0473a67d0..4862adec90b0e 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-angle-comma-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-angle-comma-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -angle -> -# -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-angle-space-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-angle-space-list.html.ini index a701ad892f6a5..fa6bda383264e 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-angle-space-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-angle-space-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -angle -> -+ -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-color-comma-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-color-comma-list.html.ini index f6b7f4bf763bd..979a16a7ed2fa 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-color-comma-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-color-comma-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -color -> -# -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-color-space-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-color-space-list.html.ini index b7a709352b959..ce23e9a8cefc3 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-color-space-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-color-space-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -color -> -+ -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-custom-ident.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-custom-ident.html.ini deleted file mode 100644 index 8340fc3f2ecd2..0000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-custom-ident.html.ini +++ /dev/null @@ -1,69 +0,0 @@ -[ -custom -- -property -- -animation -- -custom -- -ident -. -html -] -[ -Animating -a -custom -property -of -type -< -custom -- -ident -> -is -discrete -] -expected -: -FAIL -[ -Animating -a -custom -property -of -type -< -custom -- -ident -> -+ -is -discrete -] -expected -: -FAIL -[ -Animating -a -custom -property -of -type -< -custom -- -ident -> -# -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-image.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-image.html.ini deleted file mode 100644 index 6fc86e61f7280..0000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-image.html.ini +++ /dev/null @@ -1,61 +0,0 @@ -[ -custom -- -property -- -animation -- -image -. -html -] -[ -Animating -a -custom -property -of -type -< -image -> -is -discrete -] -expected -: -FAIL -[ -Animating -a -custom -property -of -type -< -image -> -+ -is -discrete -] -expected -: -FAIL -[ -Animating -a -custom -property -of -type -< -image -> -# -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-integer-comma-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-integer-comma-list.html.ini index 178eaae47c6fc..e86e47e36245e 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-integer-comma-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-integer-comma-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -integer -> -# -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-integer-space-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-integer-space-list.html.ini index 3815bd91a6e86..53ad55101e484 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-integer-space-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-integer-space-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -integer -> -+ -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-comma-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-comma-list.html.ini index 496a9fb62fce0..5e872ac19d527 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-comma-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-comma-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -length -> -# -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-percentage-comma-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-percentage-comma-list.html.ini index 34e874e8f477f..44148b1586b67 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-percentage-comma-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-percentage-comma-list.html.ini @@ -114,25 +114,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -length -- -percentage -> -# -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-percentage-space-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-percentage-space-list.html.ini index d5ea1424282a3..03b97027b2d6d 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-percentage-space-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-percentage-space-list.html.ini @@ -114,25 +114,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -length -- -percentage -> -+ -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-space-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-space-list.html.ini index 58d7677a6b758..809c7f0ea5bdc 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-space-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-length-space-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -length -> -+ -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-number-comma-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-number-comma-list.html.ini index 9a5c2139061f4..caa8cc477959b 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-number-comma-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-number-comma-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -number -> -# -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-number-space-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-number-space-list.html.ini index c7117dfa83efe..5cd674038d843 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-number-space-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-number-space-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -number -> -+ -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-percentage-comma-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-percentage-comma-list.html.ini index 3555028a35cec..08ebc4500f9f1 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-percentage-comma-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-percentage-comma-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -percentage -> -# -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-percentage-space-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-percentage-space-list.html.ini index fd09a5f93d1e4..479ab59118398 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-percentage-space-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-percentage-space-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -percentage -> -+ -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-resolution-comma-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-resolution-comma-list.html.ini index 0911b6f08ec51..775eb4296ce6c 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-resolution-comma-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-resolution-comma-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -resolution -> -# -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-resolution-space-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-resolution-space-list.html.ini index c0fbec0dd47a0..1a440caac54fb 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-resolution-space-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-resolution-space-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -resolution -> -+ -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-time-comma-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-time-comma-list.html.ini index 3d340fefcd873..4f526250ea40f 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-time-comma-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-time-comma-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -time -> -# -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-time-space-list.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-time-space-list.html.ini index b41187084e0ef..b1107fbc58168 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-time-space-list.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-time-space-list.html.ini @@ -102,23 +102,3 @@ iterationComposite expected : FAIL -[ -Animating -a -custom -property -of -type -< -time -> -+ -with -different -lengths -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-url.html.ini b/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-url.html.ini deleted file mode 100644 index 12fb986c19b2d..0000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/animation/custom-property-animation-url.html.ini +++ /dev/null @@ -1,61 +0,0 @@ -[ -custom -- -property -- -animation -- -url -. -html -] -[ -Animating -a -custom -property -of -type -< -url -> -is -discrete -] -expected -: -FAIL -[ -Animating -a -custom -property -of -type -< -url -> -+ -is -discrete -] -expected -: -FAIL -[ -Animating -a -custom -property -of -type -< -url -> -# -is -discrete -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/at-property-stylesheets.html.ini b/testing/web-platform/meta/css/css-properties-values-api/at-property-stylesheets.html.ini deleted file mode 100644 index 195abcf67bb45..0000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/at-property-stylesheets.html.ini +++ /dev/null @@ -1,68 +0,0 @@ -[ -at -- -property -- -stylesheets -. -html -] -[ -property -removal -detected -when -last -property -rule -disappears -] -expected -: -FAIL -[ -property -removal -detected -with -removal -of -second -stylesheet -] -expected -: -FAIL -[ -property -detected -in -second -stylesheet -] -expected -: -FAIL -[ -property -removal -detected -with -removal -of -first -stylesheet -] -expected -: -FAIL -[ -property -detected -when -stylesheet -appears -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/at-property.html.ini b/testing/web-platform/meta/css/css-properties-values-api/at-property.html.ini index ff8b39de7123a..7d8e52e5cb687 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/at-property.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/at-property.html.ini @@ -10,78 +10,6 @@ Rule applied [ < -transform -- -list -> -rotateX -( -0deg -) -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -color -> -rgb -( -1 -2 -3 -) -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -number -> -2 -. -5 -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -angle -> -42deg -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< angle > 1turn @@ -97,73 +25,6 @@ Rule applied [ < -length -- -percentage -> -10px -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -length -- -percentage -> -10 -% -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -integer -> -5 -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -* -if -( -) -{ -} -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< color > green @@ -190,18 +51,6 @@ expected : FAIL [ -Non -- -inherited -properties -do -not -inherit -] -expected -: -FAIL -[ Rule applied [ @@ -223,83 +72,6 @@ applied < time > -10s -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -length -> -10px -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -transform -- -list -> -rotateX -( -0deg -) -translateX -( -10px -) -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -length -- -percentage -> -calc -( -10 -% -+ -10px -) -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -time -> 1000ms false \ @@ -313,85 +85,6 @@ Rule applied [ < -image -> -url -( -" -http -: -/ -/ -a -/ -" -) -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -percentage -> -10 -% -false -\ -] -] -expected -: -FAIL -[ -Rule -applied -[ -< -url -> -url -( -" -http -: -/ -/ -a -/ -" -) -false -\ -] -] -expected -: -FAIL -[ -Initial -value -may -be -omitted -for -universal -registration -] -expected -: -FAIL -[ -Rule -applied -[ -< color > tomato @@ -403,21 +96,6 @@ expected : FAIL [ -Rule -applied -[ -< -resolution -> -50dppx -false -\ -] -] -expected -: -FAIL -[ Initial values substituted @@ -428,23 +106,3 @@ value expected : FAIL -[ -Rule -applied -[ -< -transform -- -function -> -rotateX -( -0deg -) -false -\ -] -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/determine-registration.html.ini b/testing/web-platform/meta/css/css-properties-values-api/determine-registration.html.ini index 53ec1c4d45430..4ccc438858ce6 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/determine-registration.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/determine-registration.html.ini @@ -6,34 +6,6 @@ registration html ] [ -property -registrations -are -cleared -when -rule -removed -] -expected -: -FAIL -[ -Previous -invalid -rule -does -not -prevent -valid -rule -from -causing -registration -] -expected -: -FAIL -[ CSS . registerProperty @@ -57,35 +29,6 @@ expected : FAIL [ -Invalid -property -rule -( -missing -syntax -) -does -not -overwrite -previous -valid -rule -] -expected -: -FAIL -[ -property -determines -the -registration -when -uncontested -] -expected -: -FAIL -[ CSS . registerProperty @@ -110,83 +53,3 @@ removed expected : FAIL -[ -property -later -in -document -order -wins -] -expected -: -FAIL -[ -Invalid -property -rule -( -missing -inherits -descriptor -) -does -not -overwrite -previous -valid -rule -] -expected -: -FAIL -[ -Invalid -property -rule -( -missing -initial -- -value -) -does -not -overwrite -previous -valid -rule -] -expected -: -FAIL -[ -Unknown -descriptors -are -ignored -and -do -not -invalidate -rule -] -expected -: -FAIL -[ -Inherited -status -is -reflected -in -computed -styles -when -property -is -removed -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/registered-properties-inheritance.html.ini b/testing/web-platform/meta/css/css-properties-values-api/registered-properties-inheritance.html.ini index 6359d9213897c..a3b7a95ecbed0 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/registered-properties-inheritance.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/registered-properties-inheritance.html.ini @@ -28,43 +28,6 @@ expected : FAIL [ -Explicitly -inheriting -from -a -parent -with -an -invalid -value -results -in -initial -value -. -] -expected -: -FAIL -[ -Explicitly -inheriting -from -a -parent -with -no -value -results -in -initial -value -. -] -expected -: -FAIL -[ Reference to syntax diff --git a/testing/web-platform/meta/css/css-properties-values-api/registered-property-change-style-001.html.ini b/testing/web-platform/meta/css/css-properties-values-api/registered-property-change-style-001.html.ini index b9969c09f8788..2e3c522735931 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/registered-property-change-style-001.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/registered-property-change-style-001.html.ini @@ -12,20 +12,20 @@ style html ] [ -Registered +New +registered property -overrides -a -previous declaration ] expected : FAIL [ -New -registered +Registered property +overrides +a +previous declaration ] expected diff --git a/testing/web-platform/meta/css/css-properties-values-api/registered-property-crosstalk.html.ini b/testing/web-platform/meta/css/css-properties-values-api/registered-property-crosstalk.html.ini deleted file mode 100644 index ef4f0ccba06ca..0000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/registered-property-crosstalk.html.ini +++ /dev/null @@ -1,26 +0,0 @@ -[ -registered -- -property -- -crosstalk -. -html -] -[ -Only -# -c -should -be -affected -by -- -- -x -: -42 -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/registered-property-cssom.html.ini b/testing/web-platform/meta/css/css-properties-values-api/registered-property-cssom.html.ini index 38f897d3ae966..9da4bf9852246 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/registered-property-cssom.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/registered-property-cssom.html.ini @@ -41,17 +41,6 @@ expected : FAIL [ -Stylesheets -can -be -modified -by -CSSOM -] -expected -: -FAIL -[ Valid values can diff --git a/testing/web-platform/meta/css/css-properties-values-api/registered-property-initial.html.ini b/testing/web-platform/meta/css/css-properties-values-api/registered-property-initial.html.ini index 1a54fdae73cdb..bb64f4a2704c3 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/registered-property-initial.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/registered-property-initial.html.ini @@ -9,26 +9,6 @@ html ] [ Initial -non -- -inherited -value -can -be -substituted -[ -pink -background -- -color -\ -] -] -expected -: -FAIL -[ -Initial value for < @@ -139,44 +119,6 @@ Initial value for < -transform -- -function -> -correctly -computed -[ -rotate -( -42deg -) -\ -] -] -expected -: -FAIL -[ -Initial -inherited -value -can -be -substituted -[ -purple -color -\ -] -] -expected -: -FAIL -[ -Initial -value -for -< color > correctly @@ -297,33 +239,6 @@ can be substituted [ -\ -tcalc -( -13 -% -+ -37px -) -- -- -x -\ -] -] -expected -: -FAIL -[ -Initial -non -- -inherited -value -can -be -substituted -[ scale ( calc @@ -494,27 +409,6 @@ expected FAIL [ Initial -non -- -inherited -value -can -be -substituted -[ -\ -ttest -- -- -x -\ -] -] -expected -: -FAIL -[ -Initial value for < @@ -671,3 +565,19 @@ a expected : FAIL +[ +Initial +inherited +value +can +be +substituted +[ +purple +color +\ +] +] +expected +: +FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/registered-property-revert.html.ini b/testing/web-platform/meta/css/css-properties-values-api/registered-property-revert.html.ini index 662fa30153797..741a5c406ceb1 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/registered-property-revert.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/registered-property-revert.html.ini @@ -17,20 +17,6 @@ property can be reverted -] -expected -: -FAIL -[ -Non -- -inherited -registered -custom -property -can -be -reverted in animation ] diff --git a/testing/web-platform/meta/css/css-properties-values-api/self-utils.html.ini b/testing/web-platform/meta/css/css-properties-values-api/self-utils.html.ini deleted file mode 100644 index bcf29f726c0d8..0000000000000 --- a/testing/web-platform/meta/css/css-properties-values-api/self-utils.html.ini +++ /dev/null @@ -1,17 +0,0 @@ -[ -self -- -utils -. -html -] -[ -Generated -properties -respect -inherits -flag -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties-cycles.html.ini b/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties-cycles.html.ini index 35387f13ba815..f9e29df1664ee 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties-cycles.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties-cycles.html.ini @@ -18,27 +18,13 @@ var ) cycle between -two -registered -properties -is -handled -correctly -. -] -expected -: -FAIL -[ -A -var -( -) -cycle -between a -registered -properties +syntax +: +' +* +' +property and an unregistered @@ -51,22 +37,3 @@ correctly expected : FAIL -[ -A -var -( -) -cycle -between -a -two -unregistered -properties -is -handled -correctly -. -] -expected -: -FAIL diff --git a/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties.html.ini b/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties.html.ini index 376c92dcdb0d0..cb2af564692bd 100644 --- a/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties.html.ini +++ b/testing/web-platform/meta/css/css-properties-values-api/var-reference-registered-properties.html.ini @@ -74,3 +74,129 @@ syntax expected : FAIL +[ +Fallback +must +adhere +to +registered +syntax +[ +< +length +> +10px +\ +] +] +expected +: +FAIL +[ +Fallback +must +adhere +to +registered +syntax +[ +< +length +> +| +none +none +\ +] +] +expected +: +FAIL +[ +Fallback +must +adhere +to +registered +syntax +[ +< +length +> +var +( +- +- +length +- +1 +) +\ +] +] +expected +: +FAIL +[ +References +to +registered +var +( +) +- +properties +work +in +registered +lists +] +expected +: +FAIL +[ +References +to +mixed +registered +and +unregistered +var +( +) +- +properties +work +in +registered +lists +] +expected +: +FAIL +[ +Registered +lists +may +be +concatenated +] +expected +: +FAIL +[ +Invalid +values +for +registered +properties +are +serialized +as +the +empty +string +] +expected +: +FAIL diff --git a/testing/web-platform/meta/css/css-pseudo/highlight-cascade-004.html.ini b/testing/web-platform/meta/css/css-pseudo/highlight-cascade-004.html.ini deleted file mode 100644 index bc5af13c1d450..0000000000000 --- a/testing/web-platform/meta/css/css-pseudo/highlight-cascade-004.html.ini +++ /dev/null @@ -1,12 +0,0 @@ -[ -highlight -- -cascade -- -004 -. -html -] -expected -: -FAIL