Backed out 4 changesets (bug 1418224) for build bustages r=backout on a CLOSED TREE

Backed out changeset 3ef8715cb8d7 (bug 1418224)
Backed out changeset 0d58d9fed90d (bug 1418224)
Backed out changeset faad7f275749 (bug 1418224)
Backed out changeset 1e86ff6b95ae (bug 1418224)
This commit is contained in:
dluca 2017-11-27 07:42:50 +02:00
parent ce20f92811
commit 627438bf3c
20 changed files with 73 additions and 220 deletions

View File

@ -223,7 +223,6 @@ function treatAsSafeArgument(entry, varName, csuName)
["Gecko_DestroyShapeSource", "aShape", null],
["Gecko_StyleShapeSource_SetURLValue", "aShape", null],
["Gecko_NewBasicShape", "aShape", null],
["Gecko_NewShapeImage", "aShape", null],
["Gecko_nsFont_InitSystem", "aDest", null],
["Gecko_nsFont_SetFontFeatureValuesLookup", "aFont", null],
["Gecko_nsFont_ResetFontFeatureValuesLookup", "aFont", null],

View File

@ -756,38 +756,46 @@ nsFloatManager::FloatInfo::FloatInfo(nsIFrame* aFrame,
const StyleShapeSource& shapeOutside = mFrame->StyleDisplay()->mShapeOutside;
switch (shapeOutside.GetType()) {
case StyleShapeSourceType::None:
// No need to create shape info.
return;
if (shapeOutside.GetType() == StyleShapeSourceType::None) {
return;
}
case StyleShapeSourceType::URL:
MOZ_ASSERT_UNREACHABLE("shape-outside doesn't have URL source type!");
return;
if (shapeOutside.GetType() == StyleShapeSourceType::URL) {
// Bug 1265343: Implement 'shape-image-threshold'. Early return
// here because shape-outside with url() value doesn't have a
// reference box, and GetReferenceBox() asserts that.
return;
}
case StyleShapeSourceType::Image:
// Bug 1265343: Implement 'shape-image-threshold'
// Bug 1404222: Support shape-outside: <image>
return;
// Initialize <shape-box>'s reference rect.
LogicalRect shapeBoxRect =
ShapeInfo::ComputeShapeBoxRect(shapeOutside, mFrame, aMarginRect, aWM);
case StyleShapeSourceType::Box: {
// Initialize <shape-box>'s reference rect.
LogicalRect shapeBoxRect =
ShapeInfo::ComputeShapeBoxRect(shapeOutside, mFrame, aMarginRect, aWM);
mShapeInfo = ShapeInfo::CreateShapeBox(mFrame, shapeBoxRect, aWM,
aContainerSize);
break;
}
case StyleShapeSourceType::Shape: {
const UniquePtr<StyleBasicShape>& basicShape = shapeOutside.GetBasicShape();
// Initialize <shape-box>'s reference rect.
LogicalRect shapeBoxRect =
ShapeInfo::ComputeShapeBoxRect(shapeOutside, mFrame, aMarginRect, aWM);
mShapeInfo = ShapeInfo::CreateBasicShape(basicShape, shapeBoxRect, aWM,
aContainerSize);
break;
if (shapeOutside.GetType() == StyleShapeSourceType::Box) {
mShapeInfo = ShapeInfo::CreateShapeBox(mFrame, shapeBoxRect, aWM,
aContainerSize);
} else if (shapeOutside.GetType() == StyleShapeSourceType::Shape) {
const UniquePtr<StyleBasicShape>& basicShape = shapeOutside.GetBasicShape();
switch (basicShape->GetShapeType()) {
case StyleBasicShapeType::Polygon:
mShapeInfo =
ShapeInfo::CreatePolygon(basicShape, shapeBoxRect, aWM,
aContainerSize);
break;
case StyleBasicShapeType::Circle:
case StyleBasicShapeType::Ellipse:
mShapeInfo =
ShapeInfo::CreateCircleOrEllipse(basicShape, shapeBoxRect, aWM,
aContainerSize);
break;
case StyleBasicShapeType::Inset:
mShapeInfo =
ShapeInfo::CreateInset(basicShape, shapeBoxRect, aWM, aContainerSize);
break;
}
} else {
MOZ_ASSERT_UNREACHABLE("Unknown StyleShapeSourceType!");
}
MOZ_ASSERT(mShapeInfo,
@ -952,26 +960,6 @@ nsFloatManager::ShapeInfo::CreateShapeBox(
aWM));
}
/* static */ UniquePtr<nsFloatManager::ShapeInfo>
nsFloatManager::ShapeInfo::CreateBasicShape(
const UniquePtr<StyleBasicShape>& aBasicShape,
const LogicalRect& aShapeBoxRect,
WritingMode aWM,
const nsSize& aContainerSize)
{
switch (aBasicShape->GetShapeType()) {
case StyleBasicShapeType::Polygon:
return CreatePolygon(aBasicShape, aShapeBoxRect, aWM, aContainerSize);
case StyleBasicShapeType::Circle:
case StyleBasicShapeType::Ellipse:
return CreateCircleOrEllipse(aBasicShape, aShapeBoxRect, aWM,
aContainerSize);
case StyleBasicShapeType::Inset:
return CreateInset(aBasicShape, aShapeBoxRect, aWM, aContainerSize);
}
return nullptr;
}
/* static */ UniquePtr<nsFloatManager::ShapeInfo>
nsFloatManager::ShapeInfo::CreateInset(
const UniquePtr<StyleBasicShape>& aBasicShape,

View File

@ -381,12 +381,6 @@ private:
mozilla::WritingMode aWM,
const nsSize& aContainerSize);
static mozilla::UniquePtr<ShapeInfo> CreateBasicShape(
const mozilla::UniquePtr<mozilla::StyleBasicShape>& aBasicShape,
const mozilla::LogicalRect& aShapeBoxRect,
mozilla::WritingMode aWM,
const nsSize& aContainerSize);
static mozilla::UniquePtr<ShapeInfo> CreateInset(
const mozilla::UniquePtr<mozilla::StyleBasicShape>& aBasicShape,
const mozilla::LogicalRect& aShapeBoxRect,

View File

@ -816,11 +816,8 @@ PropertySupportsVariant(nsCSSPropertyID aPropertyID, uint32_t aVariant)
case eCSSProperty_content:
case eCSSProperty_cursor:
case eCSSProperty_clip_path:
supported = VARIANT_URL;
break;
case eCSSProperty_shape_outside:
supported = VARIANT_IMAGE;
supported = VARIANT_URL;
break;
case eCSSProperty_fill:

View File

@ -2028,12 +2028,6 @@ Gecko_NewBasicShape(mozilla::StyleShapeSource* aShape,
StyleGeometryBox::NoBox);
}
void
Gecko_NewShapeImage(mozilla::StyleShapeSource* aShape)
{
aShape->SetShapeImage(MakeUnique<nsStyleImage>());
}
void
Gecko_ResetFilters(nsStyleEffects* effects, size_t new_len)
{

View File

@ -519,7 +519,6 @@ void Gecko_CopyShapeSourceFrom(mozilla::StyleShapeSource* dst, const mozilla::St
void Gecko_DestroyShapeSource(mozilla::StyleShapeSource* shape);
void Gecko_NewBasicShape(mozilla::StyleShapeSource* shape,
mozilla::StyleBasicShapeType type);
void Gecko_NewShapeImage(mozilla::StyleShapeSource* shape);
void Gecko_StyleShapeSource_SetURLValue(mozilla::StyleShapeSource* shape, ServoBundledURI uri);
void Gecko_ResetFilters(nsStyleEffects* effects, size_t new_len);

View File

@ -4245,9 +4245,6 @@ ExtractComputedValueFromShapeSource(const StyleShapeSource& aShapeSource,
aComputedValue.SetCSSValueArrayValue(result,
StyleAnimationValue::eUnit_Shape);
} else if (type == StyleShapeSourceType::Image) {
// XXX: Won't implement because Gecko style system will be removed.
return false;
} else {
MOZ_ASSERT(type == StyleShapeSourceType::None, "unknown type");
aComputedValue.SetNoneValue();

View File

@ -16443,16 +16443,8 @@ CSSParserImpl::ParseClipPath(nsCSSValue& aValue)
bool
CSSParserImpl::ParseShapeOutside(nsCSSValue& aValue)
{
CSSParseResult result =
ParseVariant(aValue, VARIANT_IMAGE | VARIANT_INHERIT, nullptr);
if (result == CSSParseResult::Error) {
return false;
}
if (result == CSSParseResult::Ok) {
// 'inherit', 'initial', 'unset', 'none', and <image> (<url> or
// <gradient>) must be alone.
if (ParseSingleTokenVariant(aValue, VARIANT_HUO, nullptr)) {
// 'inherit', 'initial', 'unset', 'none', and <image> url must be alone.
return true;
}

View File

@ -3765,7 +3765,6 @@ CSS_PROP_DISPLAY(
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_START_IMAGE_LOADS |
CSS_PROPERTY_STORES_CALC,
"layout.css.shape-outside.enabled",
0,

View File

@ -6553,11 +6553,8 @@ nsComputedDOMStyle::GetShapeSource(
val->SetIdent(eCSSKeyword_none);
return val.forget();
}
case StyleShapeSourceType::Image: {
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
SetValueToStyleImage(*aShapeSource.GetShapeImage(), val);
return val.forget();
}
default:
NS_NOTREACHED("unexpected type");
}
return nullptr;
}

View File

@ -6434,14 +6434,9 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
conditions.SetUncacheable();
display->mShapeOutside = parentDisplay->mShapeOutside;
break;
case eCSSUnit_Image:
case eCSSUnit_Function:
case eCSSUnit_Gradient:
case eCSSUnit_Element: {
auto shapeImage = MakeUnique<nsStyleImage>();
SetStyleImage(aContext, *shapeOutsideValue, *shapeImage, conditions);
case eCSSUnit_URL: {
display->mShapeOutside = StyleShapeSource();
display->mShapeOutside.SetShapeImage(Move(shapeImage));
display->mShapeOutside.SetURL(shapeOutsideValue->GetURLStructValue());
break;
}
case eCSSUnit_Array: {

View File

@ -154,8 +154,7 @@ enum class StyleShapeRadius : uint8_t {
// Shape source type
enum class StyleShapeSourceType : uint8_t {
None,
URL, // clip-path only
Image, // shape-outside only
URL,
Shape,
Box,
};

View File

@ -1073,27 +1073,19 @@ StyleShapeSource::operator==(const StyleShapeSource& aOther) const
return false;
}
switch (mType) {
case StyleShapeSourceType::None:
return true;
case StyleShapeSourceType::URL:
case StyleShapeSourceType::Image:
return *mShapeImage == *aOther.mShapeImage;
case StyleShapeSourceType::Shape:
return *mBasicShape == *aOther.mBasicShape &&
mReferenceBox == aOther.mReferenceBox;
case StyleShapeSourceType::Box:
return mReferenceBox == aOther.mReferenceBox;
if (mType == StyleShapeSourceType::URL) {
return DefinitelyEqualURIs(GetURL(), aOther.GetURL());
} else if (mType == StyleShapeSourceType::Shape) {
return *mBasicShape == *aOther.mBasicShape &&
mReferenceBox == aOther.mReferenceBox;
} else if (mType == StyleShapeSourceType::Box) {
return mReferenceBox == aOther.mReferenceBox;
}
MOZ_ASSERT_UNREACHABLE("Unexpected shape source type!");
return true;
}
void
bool
StyleShapeSource::SetURL(css::URLValue* aValue)
{
MOZ_ASSERT(aValue);
@ -1102,21 +1094,14 @@ StyleShapeSource::SetURL(css::URLValue* aValue)
}
mShapeImage->SetURLValue(do_AddRef(aValue));
mType = StyleShapeSourceType::URL;
}
void
StyleShapeSource::SetShapeImage(UniquePtr<nsStyleImage> aShapeImage)
{
MOZ_ASSERT(aShapeImage);
mShapeImage = Move(aShapeImage);
mType = StyleShapeSourceType::Image;
return true;
}
void
StyleShapeSource::SetBasicShape(UniquePtr<StyleBasicShape> aBasicShape,
StyleGeometryBox aReferenceBox)
{
MOZ_ASSERT(aBasicShape);
NS_ASSERTION(aBasicShape, "expected pointer");
mBasicShape = Move(aBasicShape);
mReferenceBox = aReferenceBox;
mType = StyleShapeSourceType::Shape;
@ -1132,6 +1117,7 @@ StyleShapeSource::SetReferenceBox(StyleGeometryBox aReferenceBox)
void
StyleShapeSource::DoCopy(const StyleShapeSource& aOther)
{
switch (aOther.mType) {
case StyleShapeSourceType::None:
mReferenceBox = StyleGeometryBox::NoBox;
@ -1142,10 +1128,6 @@ StyleShapeSource::DoCopy(const StyleShapeSource& aOther)
SetURL(aOther.GetURL());
break;
case StyleShapeSourceType::Image:
SetShapeImage(MakeUnique<nsStyleImage>(*aOther.GetShapeImage()));
break;
case StyleShapeSourceType::Shape:
SetBasicShape(MakeUnique<StyleBasicShape>(*aOther.GetBasicShape()),
aOther.GetReferenceBox());
@ -3716,20 +3698,6 @@ nsStyleDisplay::~nsStyleDisplay()
MOZ_COUNT_DTOR(nsStyleDisplay);
}
void
nsStyleDisplay::FinishStyle(nsPresContext* aPresContext)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aPresContext->StyleSet()->IsServo());
if (mShapeOutside.GetType() == StyleShapeSourceType::Image) {
const UniquePtr<nsStyleImage>& shapeImage = mShapeOutside.GetShapeImage();
if (shapeImage) {
shapeImage->ResolveImage(aPresContext);
}
}
}
nsChangeHint
nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
{

View File

@ -2472,15 +2472,7 @@ struct StyleShapeSource final
: nullptr;
}
void SetURL(css::URLValue* aValue);
const UniquePtr<nsStyleImage>& GetShapeImage() const
{
MOZ_ASSERT(mType == StyleShapeSourceType::Image, "Wrong shape source type!");
return mShapeImage;
}
void SetShapeImage(UniquePtr<nsStyleImage> aShapeImage);
bool SetURL(css::URLValue* aValue);
const UniquePtr<StyleBasicShape>& GetBasicShape() const
{
@ -2540,8 +2532,8 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
nsStyleDisplay(const nsStyleDisplay& aOther);
~nsStyleDisplay();
void FinishStyle(nsPresContext* aPresContext);
const static bool kHasFinishStyle = true;
void FinishStyle(nsPresContext* aPresContext) {}
const static bool kHasFinishStyle = false;
void* operator new(size_t sz, nsStyleDisplay* aSelf) { return aSelf; }
void* operator new(size_t sz, nsPresContext* aContext) {

View File

@ -6443,19 +6443,9 @@ if (IsCSSPropertyPrefEnabled("layout.css.shape-outside.enabled")) {
initial_values: [ "none" ],
other_values: [
"url(#my-shape-outside)",
].concat(
basicShapeOtherValues,
validGradientAndElementValues
),
invalid_values: [].concat(
basicShapeSVGBoxValues,
basicShapeInvalidValues,
invalidGradientAndElementValues
),
unbalanced_values: [].concat(
basicShapeUnbalancedValues,
unbalancedGradientAndElementValues
)
].concat(basicShapeOtherValues),
invalid_values: basicShapeSVGBoxValues.concat(basicShapeInvalidValues),
unbalanced_values: basicShapeUnbalancedValues,
};
}

View File

@ -638,7 +638,7 @@ var transformTests = [
// reference-box (i.e. border-box or content-box) if needed.
// Bug 1313619: Add some tests for two basic shapes with an explicit
// reference-box and a default one.
const basicShapesTests = [
var clipPathAndShapeOutsideTests = [
{ start: "none", end: "none",
expected: ["none"] },
// none to shape
@ -780,20 +780,12 @@ const basicShapesTests = [
{ start: "circle(20px)", end: "content-box", expected: ["content-box"] },
{ start: "content-box", end: "circle(20px)", expected: ["circle", ["20px at 50% 50%"]] },
// url to shape
{ start: "circle(20px)", end: "url(http://localhost/a.png)", expected: ["url", ["\"http://localhost/a.png\""]] },
{ start: "url(http://localhost/a.png)", end: "circle(20px)", expected: ["circle", ["20px at 50% 50%"]] },
// url to none
{ start: "none", end: "url(http://localhost/a.png)", expected: ["url", ["\"http://localhost/a.png\""]] },
{ start: "http://localhost/a.png", end: "none", expected: ["none"] },
];
const basicShapesWithFragmentUrlTests = [
// Fragment url to shape
{ start: "circle(20px)", end: "url('#a')", expected: ["url", ["\"#a\""]] },
{ start: "url('#a')", end: "circle(20px)", expected: ["circle", ["20px at 50% 50%"]] },
// Fragment url to none
// url to none
{ start: "none", end: "url('#a')", expected: ["url", ["\"#a\""]] },
{ start: "url('#a')", end: "none", expected: ["none"] },
];
var filterTests = [
@ -1583,13 +1575,8 @@ function filter_function_list_equals(computedValStr, expectedList)
}
function test_basic_shape_or_url_transition(prop) {
let tests = basicShapesTests;
if (prop == "clip-path") {
// Clip-path won't resolve fragment URLs.
tests.concat(basicShapesWithFragmentUrlTests);
}
for (let test of tests) {
for (var i in clipPathAndShapeOutsideTests) {
var test = clipPathAndShapeOutsideTests[i];
div.style.setProperty("transition-property", "none", "");
div.style.setProperty(prop, test.start, "");
cs.getPropertyValue(prop);

View File

@ -2,7 +2,7 @@
type: testharness
expected: TIMEOUT
[Verify FetchEvent for css image (shapeOutside).]
expected: FAIL # Bug 1418930
expected: TIMEOUT
[Verify FetchEvent for css image-set (backgroundImage).]
expected: TIMEOUT

View File

@ -1,10 +1,3 @@
prefs: [layout.css.font-variations.enabled:true, layout.css.overflow-clip-box.enabled:true]
[accumulation-per-property.html]
type: testharness
[shape-outside: "url("http://localhost/test-2")" onto "url("http://localhost/test-1")"]
expected:
if not stylo: FAIL
[shape-outside: "url("http://localhost/test-1")" onto "url("http://localhost/test-2")"]
expected:
if not stylo: FAIL

View File

@ -1,10 +1,3 @@
prefs: [layout.css.font-variations.enabled:true, layout.css.overflow-clip-box.enabled:true]
[addition-per-property.html]
type: testharness
[shape-outside: "url("http://localhost/test-2")" onto "url("http://localhost/test-1")"]
expected:
if not stylo: FAIL
[shape-outside: "url("http://localhost/test-1")" onto "url("http://localhost/test-2")"]
expected:
if not stylo: FAIL

View File

@ -7,37 +7,17 @@ prefs: [layout.css.font-variations.enabled:true, layout.css.overflow-clip-box.en
[font-variation-settings supports animation as float with multiple tags]
expected:
if not stylo: FAIL
if stylo: PASS
FAIL
[font-variation-settings supports animation as float with multiple duplicate tags]
expected:
if not stylo: FAIL
if stylo: PASS
FAIL
[transform: non-invertible matrices in matched transform lists]
expected:
if not stylo: FAIL
if stylo: PASS
FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1400167
[shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with linear easing]
expected:
if not stylo: FAIL
[shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with linear easing]
expected:
if not stylo: FAIL
[shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with linear easing]
expected:
if not stylo: FAIL
[shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with effect easing]
expected:
if not stylo: FAIL
[shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with effect easing]
expected:
if not stylo: FAIL
[shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with keyframe easing]
expected:
if not stylo: FAIL