Backed out 2 changesets (bug 1559231) for rusttests build bustages. CLOSED TREE

Backed out changeset d47d9f4bf9a9 (bug 1559231)
Backed out changeset 50f92d01c47a (bug 1559231)
This commit is contained in:
Brindusan Cristian 2019-08-02 21:55:37 +03:00
Родитель 082a390c61
Коммит 0b3e26149c
23 изменённых файлов: 184 добавлений и 154 удалений

Просмотреть файл

@ -282,7 +282,6 @@ exports.ANIMATION_TYPE_FOR_LONGHANDS = [
"mask-position-y",
"mask-size",
"object-position",
"offset-anchor",
"offset-path",
"offset-rotate",
"order",

Просмотреть файл

@ -3085,7 +3085,6 @@ exports.CSS_PROPERTIES = {
"offset-path",
"offset-distance",
"offset-rotate",
"offset-anchor",
"scroll-behavior",
"scroll-snap-align",
"scroll-snap-type",
@ -8278,25 +8277,6 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"offset-anchor": {
"isInherited": false,
"subproperties": [
"offset-anchor"
],
"supports": [],
"values": [
"auto",
"bottom",
"center",
"inherit",
"initial",
"left",
"revert",
"right",
"top",
"unset"
]
},
"offset-distance": {
"isInherited": false,
"subproperties": [
@ -10792,10 +10772,6 @@ exports.PREFERENCES = [
"font-variation-settings",
"layout.css.font-variations.enabled"
],
[
"offset-anchor",
"layout.css.motion-path.enabled"
],
[
"offset-path",
"layout.css.motion-path.enabled"

Просмотреть файл

@ -10154,29 +10154,12 @@ Maybe<MotionPathData> nsLayoutUtils::ResolveMotionPath(const nsIFrame* aFrame) {
(rotate.auto_ ? directionAngle : 0.0) + rotate.angle.ToRadians());
// Compute the offset for motion path translate.
// Bug 1559232: the translate parameters will be adjusted more after we
// support offset-position.
// FIXME: It's possible to refactor the calculation of transform-origin, so we
// could calculate from the caller, and reuse the value in nsDisplayList.cpp.
// Per the spec, the default offset-anchor is `auto`, and in this case,
// we should use transform-origin as the anchor point.
TransformReferenceBox refBox(aFrame);
const auto& transformOrigin = display->mTransformOrigin;
const CSSPoint origin = nsStyleTransformMatrix::Convert2DPosition(
auto& transformOrigin = display->mTransformOrigin;
CSSPoint anchorPoint = nsStyleTransformMatrix::Convert2DPosition(
transformOrigin.horizontal, transformOrigin.vertical, refBox);
// Per the spec, the default offset-anchor is `auto`, so initialize the anchor
// point to transform-origin.
CSSPoint anchorPoint(origin);
Point shift;
if (!display->mOffsetAnchor.IsAuto()) {
const auto& pos = display->mOffsetAnchor.AsPosition();
anchorPoint = nsStyleTransformMatrix::Convert2DPosition(
pos.horizontal, pos.vertical, refBox);
// We need this value to shift the origin from transform-origin to
// offset-anchor (and vice versa).
// See nsStyleTransformMatrix::ReadTransform for more details.
shift = (anchorPoint - origin).ToUnknownPoint();
}
// SVG frames (unlike other frames) have a reference box that can be (and
// typically is) offset from the TopLeft() of the frame.
// In motion path, we have to make sure the object is aligned with offset-path
@ -10189,6 +10172,7 @@ Maybe<MotionPathData> nsLayoutUtils::ResolveMotionPath(const nsIFrame* aFrame) {
anchorPoint.y += CSSPixel::FromAppUnits(aFrame->GetPosition().y);
}
return Some(
MotionPathData{point - anchorPoint.ToUnknownPoint(), angle, shift});
// Bug 1186329: the translate parameters will be adjusted more after we
// implement offset-position and offset-anchor.
return Some(MotionPathData{point - anchorPoint.ToUnknownPoint(), angle});
}

Просмотреть файл

@ -119,8 +119,6 @@ struct DisplayPortMarginsPropertyData {
struct MotionPathData {
gfx::Point mTranslate;
float mRotate;
// The delta value between transform-origin and offset-anchor.
gfx::Point mShift;
};
} // namespace mozilla

Просмотреть файл

@ -444,8 +444,6 @@ cbindgen-types = [
{ gecko = "StyleMaxSize", servo = "values::computed::MaxSize" },
{ gecko = "StyleFlexBasis", servo = "values::computed::FlexBasis" },
{ gecko = "StylePosition", servo = "values::computed::Position" },
{ gecko = "StylePositionOrAuto", servo = "values::computed::PositionOrAuto" },
{ gecko = "StyleGenericPositionOrAuto", servo = "values::generics::position::PositionOrAuto" },
{ gecko = "StyleBackgroundSize", servo = "values::computed::BackgroundSize" },
{ gecko = "StyleGenericBackgroundSize", servo = "values::generics::background::BackgroundSize" },
{ gecko = "StyleBorderImageSlice", servo = "values::computed::BorderImageSlice" },

Просмотреть файл

@ -2740,7 +2740,6 @@ nsStyleDisplay::nsStyleDisplay(const Document& aDocument)
mOffsetPath(StyleOffsetPath::None()),
mOffsetDistance(LengthPercentage::Zero()),
mOffsetRotate{true, StyleAngle{0.0}},
mOffsetAnchor(StylePositionOrAuto::Auto()),
mTransformOrigin{LengthPercentage::FromPercentage(0.5),
LengthPercentage::FromPercentage(0.5),
{0.}},
@ -2806,7 +2805,6 @@ nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
mOffsetPath(aSource.mOffsetPath),
mOffsetDistance(aSource.mOffsetDistance),
mOffsetRotate(aSource.mOffsetRotate),
mOffsetAnchor(aSource.mOffsetAnchor),
mTransformOrigin(aSource.mTransformOrigin),
mChildPerspective(aSource.mChildPerspective),
mPerspectiveOrigin(aSource.mPerspectiveOrigin),
@ -2850,8 +2848,7 @@ static inline nsChangeHint CompareMotionValues(
const nsStyleDisplay& aDisplay, const nsStyleDisplay& aNewDisplay) {
if (aDisplay.mOffsetPath == aNewDisplay.mOffsetPath) {
if (aDisplay.mOffsetDistance == aNewDisplay.mOffsetDistance &&
aDisplay.mOffsetRotate == aNewDisplay.mOffsetRotate &&
aDisplay.mOffsetAnchor == aNewDisplay.mOffsetAnchor) {
aDisplay.mOffsetRotate == aNewDisplay.mOffsetRotate) {
return nsChangeHint(0);
}

Просмотреть файл

@ -1585,7 +1585,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay {
mozilla::StyleOffsetPath mOffsetPath;
mozilla::LengthPercentage mOffsetDistance;
mozilla::StyleOffsetRotate mOffsetRotate;
mozilla::StylePositionOrAuto mOffsetAnchor;
mozilla::StyleTransformOrigin mTransformOrigin;
mozilla::StylePerspective mChildPerspective;

Просмотреть файл

@ -551,17 +551,10 @@ Matrix4x4 ReadTransforms(const StyleTranslate& aTranslate,
// Create the equivalent translate and rotate function, according to the
// order in spec. We combine the translate and then the rotate.
// https://drafts.fxtf.org/motion-1/#calculating-path-transform
//
// Besides, we have to shift the object by the delta between anchor-point
// and transform-origin, to make sure we rotate the object according to
// anchor-point.
result.PreTranslate(aMotion->mTranslate.x + aMotion->mShift.x,
aMotion->mTranslate.y + aMotion->mShift.y, 0.0);
result.PreTranslate(aMotion->mTranslate.x, aMotion->mTranslate.y, 0.0);
if (aMotion->mRotate != 0.0) {
result.RotateZ(aMotion->mRotate);
}
// Shift the origin back to transform-origin.
result.PreTranslate(-aMotion->mShift.x, -aMotion->mShift.y, 0.0);
}
for (const StyleTransformOperation& op : aTransform.Operations()) {

Просмотреть файл

@ -12791,23 +12791,6 @@ if (IsCSSPropertyPrefEnabled("layout.css.motion-path.enabled")) {
other_values: ["reverse", "0deg", "0rad reverse", "-45deg", "5turn auto"],
invalid_values: ["none", "10px", "reverse 0deg reverse", "reverse auto"],
};
gCSSProperties["offset-anchor"] = {
domProp: "offsetAnchor",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: ["auto"],
other_values: [
"left bottom",
"center center",
"calc(20% + 10px) center",
"right 30em",
"10px 20%",
"left -10px top -20%",
"right 10% bottom 20em",
],
invalid_values: ["none", "10deg", "left 10% top"],
};
}
if (IsCSSPropertyPrefEnabled("layout.css.clip-path-path.enabled")) {

Просмотреть файл

@ -374,11 +374,6 @@ if (IsCSSPropertyPrefEnabled("layout.css.motion-path.enabled")) {
supported_properties["offset-rotate"] =
[ test_angle_transition,
test_offset_rotate_transition ];
// Note: offset-anchor supports "auto | <position>", and the tests for
// `auto` are already in wpt, so we don't test it here again.
supported_properties["offset-anchor"] =
[ test_background_position_transition ];
}
if (IsCSSPropertyPrefEnabled("layout.css.clip-path-path.enabled")) {

Просмотреть файл

@ -421,18 +421,6 @@ ${helpers.predefined_type(
servo_restyle_damage="reflow_out_of_flow"
)}
// Motion Path Module Level 1
${helpers.predefined_type(
"offset-anchor",
"PositionOrAuto",
"computed::PositionOrAuto::auto()",
engines="gecko",
animation_value_type="ComputedValue",
gecko_pref="layout.css.motion-path.enabled",
spec="https://drafts.fxtf.org/motion-1/#offset-anchor-property",
servo_restyle_damage="reflow_out_of_flow"
)}
// CSSOM View Module
// https://www.w3.org/TR/cssom-view-1/
${helpers.single_keyword(

Просмотреть файл

@ -68,7 +68,7 @@ pub use self::list::Quotes;
pub use self::motion::{OffsetPath, OffsetRotate};
pub use self::outline::OutlineStyle;
pub use self::percentage::{NonNegativePercentage, Percentage};
pub use self::position::{GridAutoFlow, GridTemplateAreas, Position, PositionOrAuto, ZIndex};
pub use self::position::{GridAutoFlow, GridTemplateAreas, Position, ZIndex};
pub use self::rect::NonNegativeLengthOrNumberRect;
pub use self::resolution::Resolution;
pub use self::svg::MozContextProperties;

Просмотреть файл

@ -9,7 +9,6 @@
use crate::values::computed::{Integer, LengthPercentage, Percentage};
use crate::values::generics::position::Position as GenericPosition;
use crate::values::generics::position::PositionOrAuto as GenericPositionOrAuto;
use crate::values::generics::position::ZIndex as GenericZIndex;
pub use crate::values::specified::position::{GridAutoFlow, GridTemplateAreas};
use crate::Zero;
@ -19,9 +18,6 @@ use style_traits::{CssWriter, ToCss};
/// The computed value of a CSS `<position>`
pub type Position = GenericPosition<HorizontalPosition, VerticalPosition>;
/// The computed value of an `auto | <position>`
pub type PositionOrAuto = GenericPositionOrAuto<Position>;
/// The computed value of a CSS horizontal position.
pub type HorizontalPosition = LengthPercentage;

Просмотреть файл

@ -41,43 +41,6 @@ impl<H, V> Position<H, V> {
}
}
/// A generic type for representing an `Auto | <position>`.
/// This is used by <offset-anchor> for now.
/// https://drafts.fxtf.org/motion-1/#offset-anchor-property
#[derive(
Animate,
Clone,
ComputeSquaredDistance,
Copy,
Debug,
MallocSizeOf,
Parse,
PartialEq,
SpecifiedValueInfo,
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(C, u8)]
pub enum GenericPositionOrAuto<Pos> {
/// The <position> value.
Position(Pos),
/// The keyword `auto`.
Auto,
}
pub use self::GenericPositionOrAuto as PositionOrAuto;
impl<Pos> PositionOrAuto<Pos> {
/// Return `auto`.
#[inline]
pub fn auto() -> Self {
PositionOrAuto::Auto
}
}
/// A generic value for the `z-index` property.
#[derive(
Animate,

Просмотреть файл

@ -69,7 +69,7 @@ pub use self::list::Quotes;
pub use self::motion::{OffsetPath, OffsetRotate};
pub use self::outline::OutlineStyle;
pub use self::percentage::Percentage;
pub use self::position::{GridAutoFlow, GridTemplateAreas, Position, PositionOrAuto};
pub use self::position::{GridAutoFlow, GridTemplateAreas, Position};
pub use self::position::{PositionComponent, ZIndex};
pub use self::rect::NonNegativeLengthOrNumberRect;
pub use self::resolution::Resolution;

Просмотреть файл

@ -13,7 +13,6 @@ use crate::str::HTML_SPACE_CHARACTERS;
use crate::values::computed::LengthPercentage as ComputedLengthPercentage;
use crate::values::computed::{Context, Percentage, ToComputedValue};
use crate::values::generics::position::Position as GenericPosition;
use crate::values::generics::position::PositionOrAuto as GenericPositionOrAuto;
use crate::values::generics::position::ZIndex as GenericZIndex;
use crate::values::specified::{AllowQuirks, Integer, LengthPercentage};
use crate::Atom;
@ -27,9 +26,6 @@ use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
/// The specified value of a CSS `<position>`
pub type Position = GenericPosition<HorizontalPosition, VerticalPosition>;
/// The specified value of an `auto | <position>`.
pub type PositionOrAuto = GenericPositionOrAuto<Position>;
/// The specified value of a horizontal position.
pub type HorizontalPosition = PositionComponent<HorizontalPositionKeyword>;

Просмотреть файл

@ -109,7 +109,6 @@ include = [
"MaxSize",
"FlexBasis",
"Position",
"PositionOrAuto",
"BackgroundSize",
"BorderImageSlice",
"BorderSpacing",

Просмотреть файл

@ -0,0 +1,91 @@
[offset-anchor-interpolation.html]
["220px 240px" and "300px 400px" are valid offset-anchor values]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress -1]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 0]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 0.125]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 0.875]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 1]
expected: FAIL
[Animation between "220px 240px" and "300px 400px" at progress 2]
expected: FAIL
["left 480px top 400px" and "right -140% bottom -60%" are valid offset-anchor values]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress -1]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 0]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 0.125]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 0.875]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 1]
expected: FAIL
[Animation between "left 480px top 400px" and "right -140% bottom -60%" at progress 2]
expected: FAIL
["left top" and "left 8px bottom 20%" are valid offset-anchor values]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress -1]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 0]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 0.125]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 0.875]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 1]
expected: FAIL
[Animation between "left top" and "left 8px bottom 20%" at progress 2]
expected: FAIL
["right 10px top 20%" and "auto" are valid offset-anchor values]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress -1]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 0]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 0.125]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 0.875]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 1]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 2]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 0.4]
expected: FAIL
[Animation between "right 10px top 20%" and "auto" at progress 0.6]
expected: FAIL

Просмотреть файл

@ -5,6 +5,12 @@
[Property offset-position does not inherit]
expected: FAIL
[Property offset-anchor does not inherit]
expected: FAIL
[Property offset-position has initial value auto]
expected: FAIL
[Property offset-anchor has initial value auto]
expected: FAIL

Просмотреть файл

@ -0,0 +1,2 @@
[offset-anchor-transform-box-fill-box-002.html]
expected: FAIL

Просмотреть файл

@ -0,0 +1,67 @@
[offset-anchor-parsing-valid.html]
[e.style['offset-anchor'\] = "auto" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "auto"]
expected: FAIL
[e.style['offset-anchor'\] = "left bottom" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "left bottom"]
expected: FAIL
[e.style['offset-anchor'\] = "center center" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "center center"]
expected: FAIL
[e.style['offset-anchor'\] = "right center" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "right center"]
expected: FAIL
[e.style['offset-anchor'\] = "center top" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "center top"]
expected: FAIL
[e.style['offset-anchor'\] = "center bottom" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "center bottom"]
expected: FAIL
[e.style['offset-anchor'\] = "calc(10px + 20%) center" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "calc(10px + 20%) center"]
expected: FAIL
[e.style['offset-anchor'\] = "right 30em" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "right 30em"]
expected: FAIL
[e.style['offset-anchor'\] = "10px 20%" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "10px 20%"]
expected: FAIL
[e.style['offset-anchor'\] = "left -10px top -20%" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "left -10px top -20%"]
expected: FAIL
[e.style['offset-anchor'\] = "right 10% bottom 20em" should set the property value]
expected: FAIL
[Serialization should round-trip after setting e.style['offset-anchor'\] = "right 10% bottom 20em"]
expected: FAIL

Просмотреть файл

@ -42,7 +42,7 @@
to: 'right -140% bottom -60%',
}, [
{at: -1, expect: 'calc(960px - 240%) calc(800px - 160%)'},
{at: 0, expect: 'left calc(0% + 480px) top calc(0% + 400px)'},
{at: 0, expect: 'left 480px top 400px'},
{at: 0.125, expect: 'calc(420px + 30%) calc(350px + 20%)'},
{at: 0.875, expect: 'calc(210% + 60px) calc(140% + 50px)'},
{at: 1, expect: 'right -140% bottom -60%'},
@ -54,12 +54,12 @@
from: 'left top',
to: 'left 8px bottom 20%',
}, [
{at: -1, expect: 'calc(0% - 8px) -80%'},
{at: -1, expect: '-8px -80%'},
{at: 0, expect: 'left top'},
{at: 0.125, expect: 'calc(0% + 1px) 10%'},
{at: 0.875, expect: 'calc(0% + 7px) 70%'},
{at: 1, expect: 'left calc(0% + 8px) bottom 20%'},
{at: 2, expect: 'calc(0% + 16px) 160%'}
{at: 0.125, expect: '1px 10%'},
{at: 0.875, expect: '7px 70%'},
{at: 1, expect: 'left 8px bottom 20%'},
{at: 2, expect: '16px 160%'}
]);
test_no_interpolation({

Просмотреть файл

@ -19,7 +19,7 @@ test_valid_value("offset-anchor", "center center");
test_valid_value("offset-anchor", "right center");
test_valid_value("offset-anchor", "center top");
test_valid_value("offset-anchor", "center bottom");
test_valid_value("offset-anchor", "calc(20% + 10px) center");
test_valid_value("offset-anchor", "calc(10px + 20%) center");
test_valid_value("offset-anchor", "right 30em");
test_valid_value("offset-anchor", "10px 20%");
test_valid_value("offset-anchor", "left -10px top -20%");