diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 2536de5c91b58..f4c0957770fa3 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -2184,7 +2184,7 @@ nsStyleDisplay::nsStyleDisplay() mOffsetDistance(LengthPercentage::Zero()), mOffsetRotate{true, StyleAngle{0.0}}, mOffsetAnchor(StylePositionOrAuto::Auto()), - mOffsetPosition(StyleOffsetPosition::Auto()), + mOffsetPosition(StyleOffsetPosition::Normal()), mTransformOrigin{LengthPercentage::FromPercentage(0.5), LengthPercentage::FromPercentage(0.5), {0.}}, diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 6df530de1cc6b..76bf7a6c680df 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -13612,9 +13612,9 @@ if ( domProp: "offsetPosition", inherited: false, type: CSS_TYPE_LONGHAND, - initial_values: ["auto"], + initial_values: ["normal"], other_values: [ - "normal", + "auto", "left bottom", "center center", "calc(20% + 10px) center", diff --git a/layout/style/test/test_animations_omta.html b/layout/style/test/test_animations_omta.html index 026e83b2fbfe5..06a409b4908c6 100644 --- a/layout/style/test/test_animations_omta.html +++ b/layout/style/test/test_animations_omta.html @@ -2728,6 +2728,7 @@ addAsyncAnimTest(async function() { new_div("offset-path: ray(90deg); " + "offset-distance: 0%; " + + "offset-position: auto; " + "transition: offset-path 10s linear"); await waitForPaintsFlushed(); diff --git a/servo/components/style/properties/longhands/box.mako.rs b/servo/components/style/properties/longhands/box.mako.rs index 7d86645dd5490..4b1a58b66cd39 100644 --- a/servo/components/style/properties/longhands/box.mako.rs +++ b/servo/components/style/properties/longhands/box.mako.rs @@ -287,7 +287,7 @@ ${helpers.predefined_type( ${helpers.predefined_type( "offset-position", "OffsetPosition", - "computed::OffsetPosition::auto()", + "computed::OffsetPosition::normal()", engines="gecko", animation_value_type="ComputedValue", gecko_pref="layout.css.motion-path-offset-position.enabled", diff --git a/servo/components/style/properties/shorthands/box.mako.rs b/servo/components/style/properties/shorthands/box.mako.rs index b9b8f7a3a1b7f..2b65a575a1e91 100644 --- a/servo/components/style/properties/shorthands/box.mako.rs +++ b/servo/components/style/properties/shorthands/box.mako.rs @@ -203,7 +203,7 @@ ${helpers.two_properties_shorthand( }).ok(); Ok(expanded! { - offset_position: offset_position.unwrap_or(OffsetPosition::auto()), + offset_position: offset_position.unwrap_or(OffsetPosition::normal()), offset_path: offset_path.unwrap_or(OffsetPath::none()), offset_distance: offset_distance.unwrap_or(LengthPercentage::zero()), offset_rotate: offset_rotate.unwrap_or(OffsetRotate::auto()), @@ -218,7 +218,7 @@ ${helpers.two_properties_shorthand( // offset-path group means "offset-path offset-distance offset-rotate". let must_serialize_path = *self.offset_path != OffsetPath::None || (!self.offset_distance.is_zero() || !self.offset_rotate.is_auto()); - let position_is_default = matches!(offset_position, OffsetPosition::Auto); + let position_is_default = matches!(offset_position, OffsetPosition::Normal); if !position_is_default || !must_serialize_path { offset_position.to_css(dest)?; } diff --git a/servo/components/style/values/generics/motion.rs b/servo/components/style/values/generics/motion.rs index c7f675c36d7e9..24af3ad1e86db 100644 --- a/servo/components/style/values/generics/motion.rs +++ b/servo/components/style/values/generics/motion.rs @@ -237,9 +237,9 @@ pub enum GenericOffsetPosition { pub use self::GenericOffsetPosition as OffsetPosition; impl OffsetPosition { - /// Returns the initial value, auto. + /// Returns the initial value, normal. #[inline] - pub fn auto() -> Self { - Self::Auto + pub fn normal() -> Self { + Self::Normal } } diff --git a/testing/web-platform/meta/css/motion/inheritance.html.ini b/testing/web-platform/meta/css/motion/inheritance.html.ini new file mode 100644 index 0000000000000..22ed6e0b533e6 --- /dev/null +++ b/testing/web-platform/meta/css/motion/inheritance.html.ini @@ -0,0 +1,3 @@ +[inheritance.html] + [Property offset-position has initial value auto] + expected: FAIL diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-001.html b/testing/web-platform/tests/css/motion/offset-path-ray-001.html index 26b3b11c4e25c..39c10330f4b7c 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-001.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-001.html @@ -17,6 +17,7 @@ transform-origin: 0px 0px; offset-path: ray(135deg closest-side); offset-distance: 20px; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-002.html b/testing/web-platform/tests/css/motion/offset-path-ray-002.html index 7c023657786ba..4af6394ef2d53 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-002.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-002.html @@ -16,6 +16,7 @@ transform-origin: 0px 0px; offset-path: ray(135deg closest-side); offset-distance: 20%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-003.html b/testing/web-platform/tests/css/motion/offset-path-ray-003.html index 4dc27c4782329..cbcbd8b3b3f09 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-003.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-003.html @@ -20,6 +20,7 @@ transform-origin: 0px 0px; offset-path: ray(135deg closest-side); offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-004.html b/testing/web-platform/tests/css/motion/offset-path-ray-004.html index e6bf08f0a615e..9b6f5befef937 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-004.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-004.html @@ -20,6 +20,7 @@ transform-origin: 0px 0px; offset-path: ray(135deg farthest-side); offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-005.html b/testing/web-platform/tests/css/motion/offset-path-ray-005.html index a1aa8e110ef61..26167b6bc1df5 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-005.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-005.html @@ -20,6 +20,7 @@ transform-origin: 0px 0px; offset-path: ray(135deg closest-corner); offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-006.html b/testing/web-platform/tests/css/motion/offset-path-ray-006.html index dbbd12bef0dcd..d3bea43979868 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-006.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-006.html @@ -20,6 +20,7 @@ transform-origin: 0px 0px; offset-path: ray(135deg farthest-corner); offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-007.html b/testing/web-platform/tests/css/motion/offset-path-ray-007.html index 1e75771f48ed5..7b9ff1e0ebe0e 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-007.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-007.html @@ -20,6 +20,7 @@ transform-origin: 0px 0px; offset-path: ray(180deg sides); offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-008.html b/testing/web-platform/tests/css/motion/offset-path-ray-008.html index 97d9cfb274cdc..60713924562f9 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-008.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-008.html @@ -19,6 +19,7 @@ background-color: lime; offset-path: ray(-90deg sides); offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-009.html b/testing/web-platform/tests/css/motion/offset-path-ray-009.html index c4986eb5f3bc9..8cff3136450df 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-009.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-009.html @@ -19,6 +19,7 @@ background-color: lime; offset-path: ray(180deg closest-side); offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-010.html b/testing/web-platform/tests/css/motion/offset-path-ray-010.html index d10afe1ab158f..da0935019b6a7 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-010.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-010.html @@ -17,6 +17,7 @@ transform-origin: 0px 0px; offset-path: ray(135deg); offset-distance: 20px; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-contain-001.html b/testing/web-platform/tests/css/motion/offset-path-ray-contain-001.html index ba03f1115f6e7..dc3cb4d52b1f8 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-contain-001.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-contain-001.html @@ -20,6 +20,7 @@ offset-path: ray(180deg closest-corner contain); offset-rotate: 0deg; offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-contain-002.html b/testing/web-platform/tests/css/motion/offset-path-ray-contain-002.html index db7710cb4386b..6825c755d5b7d 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-contain-002.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-contain-002.html @@ -20,6 +20,7 @@ offset-path: ray(180deg closest-side contain); offset-rotate: 0deg; offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-contain-003.html b/testing/web-platform/tests/css/motion/offset-path-ray-contain-003.html index 08705ad9459e8..a71c8aa73a068 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-contain-003.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-contain-003.html @@ -20,6 +20,7 @@ offset-path: ray(45deg closest-side contain); offset-rotate: 0deg; offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-contain-004.html b/testing/web-platform/tests/css/motion/offset-path-ray-contain-004.html index d5c5ecf3c7ca7..0689ccba6f58e 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-contain-004.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-contain-004.html @@ -21,6 +21,7 @@ offset-path: ray(45deg closest-side contain); offset-rotate: auto; offset-distance: 100%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-ray-contain-005.html b/testing/web-platform/tests/css/motion/offset-path-ray-contain-005.html index fc747027c6c51..6e44f88f811ab 100644 --- a/testing/web-platform/tests/css/motion/offset-path-ray-contain-005.html +++ b/testing/web-platform/tests/css/motion/offset-path-ray-contain-005.html @@ -24,6 +24,7 @@ offset-anchor: 200% -300%; offset-rotate: -90deg; offset-distance: 50%; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-path-shape-circle-002.html b/testing/web-platform/tests/css/motion/offset-path-shape-circle-002.html index 672396186a57b..74828fe6f4ba2 100644 --- a/testing/web-platform/tests/css/motion/offset-path-shape-circle-002.html +++ b/testing/web-platform/tests/css/motion/offset-path-shape-circle-002.html @@ -17,6 +17,7 @@ background-color: green; position: relative; offset-path: circle(); + offset-position: auto; width: 100px; height: 100px; } diff --git a/testing/web-platform/tests/css/motion/offset-path-shape-ellipse-002.html b/testing/web-platform/tests/css/motion/offset-path-shape-ellipse-002.html index 461838aa8899a..fa647a9c2e5c1 100644 --- a/testing/web-platform/tests/css/motion/offset-path-shape-ellipse-002.html +++ b/testing/web-platform/tests/css/motion/offset-path-shape-ellipse-002.html @@ -17,6 +17,7 @@ background-color: green; position: relative; offset-path: ellipse(); + offset-position: auto; width: 100px; height: 100px; } diff --git a/testing/web-platform/tests/css/motion/offset-rotate-001.html b/testing/web-platform/tests/css/motion/offset-rotate-001.html index 55147698a7f2f..e5b13fe8a9ab5 100644 --- a/testing/web-platform/tests/css/motion/offset-rotate-001.html +++ b/testing/web-platform/tests/css/motion/offset-rotate-001.html @@ -17,6 +17,7 @@ transform-origin: 0px 0px; offset-path: ray(120deg closest-corner); offset-rotate: auto; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/offset-rotate-002.html b/testing/web-platform/tests/css/motion/offset-rotate-002.html index fb301be24efc2..1edf38d546dff 100644 --- a/testing/web-platform/tests/css/motion/offset-rotate-002.html +++ b/testing/web-platform/tests/css/motion/offset-rotate-002.html @@ -17,6 +17,7 @@ transform-origin: 0px 0px; offset-path: ray(-120deg closest-corner); offset-rotate: reverse 60deg; + offset-position: auto; } diff --git a/testing/web-platform/tests/css/motion/parsing/offset-parsing-valid.html b/testing/web-platform/tests/css/motion/parsing/offset-parsing-valid.html index 7a5d9c94f057f..6358582bfe54a 100644 --- a/testing/web-platform/tests/css/motion/parsing/offset-parsing-valid.html +++ b/testing/web-platform/tests/css/motion/parsing/offset-parsing-valid.html @@ -14,7 +14,7 @@