mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Backed out 8 changesets (bug 1288626) for conflicting with bug 1291280, which merged to m-c first a=backout
Backed out changeset caee616ea09c (bug 1288626) Backed out changeset eebda25d85cd (bug 1288626) Backed out changeset 07e9cb8a46fd (bug 1288626) Backed out changeset c5e4865819ff (bug 1288626) Backed out changeset 74633b2735e0 (bug 1288626) Backed out changeset 17f63bb7be11 (bug 1288626) Backed out changeset 654556e45f5a (bug 1288626) Backed out changeset be2c56decd65 (bug 1288626)
This commit is contained in:
parent
947c1cf7ba
commit
d418284da4
@ -823,7 +823,6 @@ PropertySupportsVariant(nsCSSProperty aPropertyID, uint32_t aVariant)
|
||||
case eCSSProperty_content:
|
||||
case eCSSProperty_cursor:
|
||||
case eCSSProperty_clip_path:
|
||||
case eCSSProperty_shape_outside:
|
||||
supported = VARIANT_URL;
|
||||
break;
|
||||
|
||||
|
@ -3493,18 +3493,18 @@ ExtractImageLayerSizePairList(const nsStyleImageLayers& aLayer,
|
||||
}
|
||||
|
||||
static bool
|
||||
StyleClipBasicShapeToCSSArray(const StyleClipPath& aClipPath,
|
||||
StyleClipBasicShapeToCSSArray(const nsStyleClipPath& aClipPath,
|
||||
nsCSSValue::Array* aResult)
|
||||
{
|
||||
MOZ_ASSERT(aResult->Count() == 2,
|
||||
"Expected array to be presized for a function and the sizing-box");
|
||||
|
||||
const StyleBasicShape* shape = aClipPath.GetBasicShape();
|
||||
const nsStyleBasicShape* shape = aClipPath.GetBasicShape();
|
||||
nsCSSKeyword functionName = shape->GetShapeTypeName();
|
||||
RefPtr<nsCSSValue::Array> functionArray;
|
||||
switch (shape->GetShapeType()) {
|
||||
case StyleBasicShapeType::Circle:
|
||||
case StyleBasicShapeType::Ellipse: {
|
||||
case nsStyleBasicShape::Type::eCircle:
|
||||
case nsStyleBasicShape::Type::eEllipse: {
|
||||
const nsTArray<nsStyleCoord>& coords = shape->Coordinates();
|
||||
MOZ_ASSERT(coords.Length() == ShapeArgumentCount(functionName) - 1,
|
||||
"Unexpected radii count");
|
||||
@ -3525,7 +3525,7 @@ StyleClipBasicShapeToCSSArray(const StyleClipPath& aClipPath,
|
||||
functionArray->Item(functionArray->Count() - 1));
|
||||
break;
|
||||
}
|
||||
case StyleBasicShapeType::Polygon: {
|
||||
case nsStyleBasicShape::Type::ePolygon: {
|
||||
functionArray =
|
||||
aResult->Item(0).InitFunction(functionName,
|
||||
ShapeArgumentCount(functionName));
|
||||
@ -3546,7 +3546,7 @@ StyleClipBasicShapeToCSSArray(const StyleClipPath& aClipPath,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case StyleBasicShapeType::Inset: {
|
||||
case nsStyleBasicShape::Type::eInset: {
|
||||
const nsTArray<nsStyleCoord>& coords = shape->Coordinates();
|
||||
MOZ_ASSERT(coords.Length() == ShapeArgumentCount(functionName) - 1,
|
||||
"Unexpected offset count");
|
||||
@ -3578,7 +3578,7 @@ StyleClipBasicShapeToCSSArray(const StyleClipPath& aClipPath,
|
||||
MOZ_ASSERT_UNREACHABLE("Unknown shape type");
|
||||
return false;
|
||||
}
|
||||
aResult->Item(1).SetIntValue(aClipPath.GetReferenceBox(),
|
||||
aResult->Item(1).SetIntValue(aClipPath.GetSizingBox(),
|
||||
eCSSUnit_Enumerated);
|
||||
return true;
|
||||
}
|
||||
@ -3953,10 +3953,10 @@ StyleAnimationValue::ExtractComputedValue(nsCSSProperty aProperty,
|
||||
case eCSSProperty_clip_path: {
|
||||
const nsStyleSVGReset* svgReset =
|
||||
static_cast<const nsStyleSVGReset*>(styleStruct);
|
||||
const StyleClipPath& clipPath = svgReset->mClipPath;
|
||||
const StyleShapeSourceType type = clipPath.GetType();
|
||||
const nsStyleClipPath& clipPath = svgReset->mClipPath;
|
||||
const StyleClipPathType type = clipPath.GetType();
|
||||
|
||||
if (type == StyleShapeSourceType::URL) {
|
||||
if (type == StyleClipPathType::URL) {
|
||||
nsIDocument* doc = aStyleContext->PresContext()->Document();
|
||||
RefPtr<mozilla::css::URLValue> url =
|
||||
FragmentOrURLToURLValue(clipPath.GetURL(), doc);
|
||||
@ -3964,10 +3964,10 @@ StyleAnimationValue::ExtractComputedValue(nsCSSProperty aProperty,
|
||||
auto result = MakeUnique<nsCSSValue>();
|
||||
result->SetURLValue(url);
|
||||
aComputedValue.SetAndAdoptCSSValueValue(result.release(), eUnit_URL);
|
||||
} else if (type == StyleShapeSourceType::Box) {
|
||||
aComputedValue.SetIntValue(clipPath.GetReferenceBox(),
|
||||
} else if (type == StyleClipPathType::Box) {
|
||||
aComputedValue.SetIntValue(clipPath.GetSizingBox(),
|
||||
eUnit_Enumerated);
|
||||
} else if (type == StyleShapeSourceType::Shape) {
|
||||
} else if (type == StyleClipPathType::Shape) {
|
||||
RefPtr<nsCSSValue::Array> result = nsCSSValue::Array::Create(2);
|
||||
if (!StyleClipBasicShapeToCSSArray(clipPath, result)) {
|
||||
return false;
|
||||
@ -3975,7 +3975,7 @@ StyleAnimationValue::ExtractComputedValue(nsCSSProperty aProperty,
|
||||
aComputedValue.SetCSSValueArrayValue(result, eUnit_Shape);
|
||||
|
||||
} else {
|
||||
MOZ_ASSERT(type == StyleShapeSourceType::None_, "unknown type");
|
||||
MOZ_ASSERT(type == StyleClipPathType::None_, "unknown type");
|
||||
aComputedValue.SetNoneValue();
|
||||
}
|
||||
break;
|
||||
|
@ -1066,7 +1066,6 @@ protected:
|
||||
|
||||
bool ParseShadowItem(nsCSSValue& aValue, bool aIsBoxShadow);
|
||||
bool ParseShadowList(nsCSSProperty aProperty);
|
||||
bool ParseShapeOutside(nsCSSValue& aValue);
|
||||
bool ParseTransitionProperty();
|
||||
bool ParseTransitionTimingFunctionValues(nsCSSValue& aValue);
|
||||
bool ParseTransitionTimingFunctionValueComponent(float& aComponent,
|
||||
@ -1325,8 +1324,6 @@ protected:
|
||||
}
|
||||
|
||||
/* Functions for basic shapes */
|
||||
bool ParseReferenceBoxAndBasicShape(nsCSSValue& aValue,
|
||||
const KTableEntry aBoxKeywordTable[]);
|
||||
bool ParseBasicShape(nsCSSValue& aValue, bool* aConsumedTokens);
|
||||
bool ParsePolygonFunction(nsCSSValue& aValue);
|
||||
bool ParseCircleOrEllipseFunction(nsCSSKeyword, nsCSSValue& aValue);
|
||||
@ -11762,8 +11759,6 @@ CSSParserImpl::ParseSingleValuePropertyByFunction(nsCSSValue& aValue,
|
||||
return ParseScrollSnapDestination(aValue);
|
||||
case eCSSProperty_scroll_snap_coordinate:
|
||||
return ParseScrollSnapCoordinate(aValue);
|
||||
case eCSSProperty_shape_outside:
|
||||
return ParseShapeOutside(aValue);
|
||||
case eCSSProperty_text_align:
|
||||
return ParseTextAlign(aValue);
|
||||
case eCSSProperty_text_align_last:
|
||||
@ -16170,48 +16165,6 @@ CSSParserImpl::ParseBasicShape(nsCSSValue& aValue, bool* aConsumedTokens)
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
CSSParserImpl::ParseReferenceBoxAndBasicShape(
|
||||
nsCSSValue& aValue,
|
||||
const KTableEntry aBoxKeywordTable[])
|
||||
{
|
||||
nsCSSValue referenceBox;
|
||||
bool hasBox = ParseEnum(referenceBox, aBoxKeywordTable);
|
||||
|
||||
const bool boxCameFirst = hasBox;
|
||||
|
||||
nsCSSValue basicShape;
|
||||
bool basicShapeConsumedTokens = false;
|
||||
bool hasShape = ParseBasicShape(basicShape, &basicShapeConsumedTokens);
|
||||
|
||||
// Parsing wasn't successful if ParseBasicShape consumed tokens but failed
|
||||
// or if the token was neither a reference box nor a basic shape.
|
||||
if ((!hasShape && basicShapeConsumedTokens) || (!hasBox && !hasShape)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the second argument is a reference box if the first wasn't.
|
||||
if (!hasBox) {
|
||||
hasBox = ParseEnum(referenceBox, aBoxKeywordTable);
|
||||
}
|
||||
|
||||
RefPtr<nsCSSValue::Array> fullValue =
|
||||
nsCSSValue::Array::Create((hasBox && hasShape) ? 2 : 1);
|
||||
|
||||
if (hasBox && hasShape) {
|
||||
fullValue->Item(boxCameFirst ? 0 : 1) = referenceBox;
|
||||
fullValue->Item(boxCameFirst ? 1 : 0) = basicShape;
|
||||
} else if (hasBox) {
|
||||
fullValue->Item(0) = referenceBox;
|
||||
} else {
|
||||
MOZ_ASSERT(hasShape, "should've bailed if we got neither box nor shape");
|
||||
fullValue->Item(0) = basicShape;
|
||||
}
|
||||
|
||||
aValue.SetArrayValue(fullValue, eCSSUnit_Array);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Parse a clip-path url to a <clipPath> element or a basic shape. */
|
||||
bool CSSParserImpl::ParseClipPath()
|
||||
{
|
||||
@ -16224,29 +16177,46 @@ bool CSSParserImpl::ParseClipPath()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ParseReferenceBoxAndBasicShape(
|
||||
value, nsCSSProps::kClipPathGeometryBoxKTable)) {
|
||||
nsCSSValue referenceBox;
|
||||
bool hasBox = ParseEnum(referenceBox, nsCSSProps::kClipShapeSizingKTable);
|
||||
|
||||
const bool boxCameFirst = hasBox;
|
||||
|
||||
nsCSSValue basicShape;
|
||||
bool basicShapeConsumedTokens = false;
|
||||
bool hasShape = ParseBasicShape(basicShape, &basicShapeConsumedTokens);
|
||||
|
||||
// Parsing wasn't successful if ParseBasicShape consumed tokens but failed
|
||||
// or if the token was neither a reference box nor a basic shape.
|
||||
if ((!hasShape && basicShapeConsumedTokens) || (!hasBox && !hasShape)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the second argument is a reference box if the first wasn't.
|
||||
if (!hasBox) {
|
||||
hasBox = ParseEnum(referenceBox, nsCSSProps::kClipShapeSizingKTable);
|
||||
}
|
||||
|
||||
RefPtr<nsCSSValue::Array> fullValue =
|
||||
nsCSSValue::Array::Create((hasBox && hasShape) ? 2 : 1);
|
||||
|
||||
if (hasBox && hasShape) {
|
||||
fullValue->Item(boxCameFirst ? 0 : 1) = referenceBox;
|
||||
fullValue->Item(boxCameFirst ? 1 : 0) = basicShape;
|
||||
} else if (hasBox) {
|
||||
fullValue->Item(0) = referenceBox;
|
||||
} else {
|
||||
MOZ_ASSERT(hasShape, "should've bailed if we got neither box nor shape");
|
||||
fullValue->Item(0) = basicShape;
|
||||
}
|
||||
|
||||
value.SetArrayValue(fullValue, eCSSUnit_Array);
|
||||
}
|
||||
|
||||
AppendValue(eCSSProperty_clip_path, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
// none | [ <basic-shape> || <shape-box> ] | <image>
|
||||
bool
|
||||
CSSParserImpl::ParseShapeOutside(nsCSSValue& aValue)
|
||||
{
|
||||
if (ParseSingleTokenVariant(aValue, VARIANT_HUO, nullptr)) {
|
||||
// 'inherit', 'initial', 'unset', 'none', and <image> url must be alone.
|
||||
return true;
|
||||
}
|
||||
|
||||
return ParseReferenceBoxAndBasicShape(
|
||||
aValue, nsCSSProps::kShapeOutsideShapeBoxKTable);
|
||||
}
|
||||
|
||||
bool CSSParserImpl::ParseTransformOrigin(bool aPerspective)
|
||||
{
|
||||
nsCSSValuePair position;
|
||||
|
@ -3708,18 +3708,6 @@ CSS_PROP_DISPLAY(
|
||||
kScrollSnapTypeKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_None)
|
||||
CSS_PROP_DISPLAY(
|
||||
shape-outside,
|
||||
shape_outside,
|
||||
ShapeOutside,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
|
||||
"layout.css.shape-outside.enabled",
|
||||
0,
|
||||
nullptr,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_None) // FIXME: Bug 1289049 for adding animation support
|
||||
CSS_PROP_SVG(
|
||||
shape-rendering,
|
||||
shape_rendering,
|
||||
|
@ -2296,15 +2296,15 @@ const KTableEntry nsCSSProps::kFillRuleKTable[] = {
|
||||
{ eCSSKeyword_UNKNOWN, -1 }
|
||||
};
|
||||
|
||||
const KTableEntry nsCSSProps::kClipPathGeometryBoxKTable[] = {
|
||||
{ eCSSKeyword_content_box, StyleClipPathGeometryBox::Content },
|
||||
{ eCSSKeyword_padding_box, StyleClipPathGeometryBox::Padding },
|
||||
{ eCSSKeyword_border_box, StyleClipPathGeometryBox::Border },
|
||||
{ eCSSKeyword_margin_box, StyleClipPathGeometryBox::Margin },
|
||||
{ eCSSKeyword_fill_box, StyleClipPathGeometryBox::Fill },
|
||||
{ eCSSKeyword_stroke_box, StyleClipPathGeometryBox::Stroke },
|
||||
{ eCSSKeyword_view_box, StyleClipPathGeometryBox::View },
|
||||
{ eCSSKeyword_UNKNOWN, -1 }
|
||||
const KTableEntry nsCSSProps::kClipShapeSizingKTable[] = {
|
||||
{ eCSSKeyword_content_box, StyleClipShapeSizing::Content },
|
||||
{ eCSSKeyword_padding_box, StyleClipShapeSizing::Padding },
|
||||
{ eCSSKeyword_border_box, StyleClipShapeSizing::Border },
|
||||
{ eCSSKeyword_margin_box, StyleClipShapeSizing::Margin },
|
||||
{ eCSSKeyword_fill_box, StyleClipShapeSizing::Fill },
|
||||
{ eCSSKeyword_stroke_box, StyleClipShapeSizing::Stroke },
|
||||
{ eCSSKeyword_view_box, StyleClipShapeSizing::View },
|
||||
{ eCSSKeyword_UNKNOWN, -1 }
|
||||
};
|
||||
|
||||
const KTableEntry nsCSSProps::kShapeRadiusKTable[] = {
|
||||
@ -2341,14 +2341,6 @@ const KTableEntry nsCSSProps::kMaskTypeKTable[] = {
|
||||
{ eCSSKeyword_UNKNOWN, -1 }
|
||||
};
|
||||
|
||||
const KTableEntry nsCSSProps::kShapeOutsideShapeBoxKTable[] = {
|
||||
{ eCSSKeyword_content_box, StyleShapeOutsideShapeBox::Content },
|
||||
{ eCSSKeyword_padding_box, StyleShapeOutsideShapeBox::Padding },
|
||||
{ eCSSKeyword_border_box, StyleShapeOutsideShapeBox::Border },
|
||||
{ eCSSKeyword_margin_box, StyleShapeOutsideShapeBox::Margin },
|
||||
{ eCSSKeyword_UNKNOWN, -1 }
|
||||
};
|
||||
|
||||
const KTableEntry nsCSSProps::kShapeRenderingKTable[] = {
|
||||
{ eCSSKeyword_auto, NS_STYLE_SHAPE_RENDERING_AUTO },
|
||||
{ eCSSKeyword_optimizespeed, NS_STYLE_SHAPE_RENDERING_OPTIMIZESPEED },
|
||||
|
@ -732,7 +732,7 @@ public:
|
||||
static const KTableEntry kBoxDirectionKTable[];
|
||||
static const KTableEntry kBoxOrientKTable[];
|
||||
static const KTableEntry kBoxPackKTable[];
|
||||
static const KTableEntry kClipPathGeometryBoxKTable[];
|
||||
static const KTableEntry kClipShapeSizingKTable[];
|
||||
static const KTableEntry kCounterRangeKTable[];
|
||||
static const KTableEntry kCounterSpeakAsKTable[];
|
||||
static const KTableEntry kCounterSymbolsSystemKTable[];
|
||||
@ -742,7 +742,6 @@ public:
|
||||
static const KTableEntry kFillRuleKTable[];
|
||||
static const KTableEntry kFilterFunctionKTable[];
|
||||
static const KTableEntry kImageRenderingKTable[];
|
||||
static const KTableEntry kShapeOutsideShapeBoxKTable[];
|
||||
static const KTableEntry kShapeRenderingKTable[];
|
||||
static const KTableEntry kStrokeLinecapKTable[];
|
||||
static const KTableEntry kStrokeLinejoinKTable[];
|
||||
|
@ -1424,13 +1424,7 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult,
|
||||
|
||||
case eCSSProperty_clip_path:
|
||||
AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(intValue,
|
||||
nsCSSProps::kClipPathGeometryBoxKTable),
|
||||
aResult);
|
||||
break;
|
||||
|
||||
case eCSSProperty_shape_outside:
|
||||
AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(intValue,
|
||||
nsCSSProps::kShapeOutsideShapeBoxKTable),
|
||||
nsCSSProps::kClipShapeSizingKTable),
|
||||
aResult);
|
||||
break;
|
||||
|
||||
@ -2528,8 +2522,7 @@ nsCSSValuePairList::AppendToString(nsCSSProperty aProperty,
|
||||
|
||||
if (nsCSSProps::PropHasFlags(aProperty,
|
||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS) ||
|
||||
aProperty == eCSSProperty_clip_path ||
|
||||
aProperty == eCSSProperty_shape_outside)
|
||||
aProperty == eCSSProperty_clip_path)
|
||||
aResult.Append(char16_t(','));
|
||||
aResult.Append(char16_t(' '));
|
||||
}
|
||||
|
@ -5917,11 +5917,11 @@ nsComputedDOMStyle::BasicShapeRadiiToString(nsAString& aCssText,
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::CreatePrimitiveValueForBasicShape(
|
||||
const StyleBasicShape* aStyleBasicShape)
|
||||
const nsStyleBasicShape* aStyleBasicShape)
|
||||
{
|
||||
MOZ_ASSERT(aStyleBasicShape, "Expect a valid basic shape pointer!");
|
||||
|
||||
StyleBasicShapeType type = aStyleBasicShape->GetShapeType();
|
||||
nsStyleBasicShape::Type type = aStyleBasicShape->GetShapeType();
|
||||
// Shape function name and opening parenthesis.
|
||||
nsAutoString shapeFunctionString;
|
||||
AppendASCIItoUTF16(nsCSSKeywords::GetStringValue(
|
||||
@ -5929,7 +5929,7 @@ nsComputedDOMStyle::CreatePrimitiveValueForBasicShape(
|
||||
shapeFunctionString);
|
||||
shapeFunctionString.Append('(');
|
||||
switch (type) {
|
||||
case StyleBasicShapeType::Polygon: {
|
||||
case nsStyleBasicShape::Type::ePolygon: {
|
||||
bool hasEvenOdd = aStyleBasicShape->GetFillRule() ==
|
||||
NS_STYLE_FILL_RULE_EVENODD;
|
||||
if (hasEvenOdd) {
|
||||
@ -5951,11 +5951,11 @@ nsComputedDOMStyle::CreatePrimitiveValueForBasicShape(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case StyleBasicShapeType::Circle:
|
||||
case StyleBasicShapeType::Ellipse: {
|
||||
case nsStyleBasicShape::Type::eCircle:
|
||||
case nsStyleBasicShape::Type::eEllipse: {
|
||||
const nsTArray<nsStyleCoord>& radii = aStyleBasicShape->Coordinates();
|
||||
MOZ_ASSERT(radii.Length() ==
|
||||
(type == StyleBasicShapeType::Circle ? 1 : 2),
|
||||
(type == nsStyleBasicShape::Type::eCircle ? 1 : 2),
|
||||
"wrong number of radii");
|
||||
for (size_t i = 0; i < radii.Length(); ++i) {
|
||||
nsAutoString radius;
|
||||
@ -5976,7 +5976,7 @@ nsComputedDOMStyle::CreatePrimitiveValueForBasicShape(
|
||||
shapeFunctionString.Append(positionString);
|
||||
break;
|
||||
}
|
||||
case StyleBasicShapeType::Inset: {
|
||||
case nsStyleBasicShape::Type::eInset: {
|
||||
BoxValuesToString(shapeFunctionString, aStyleBasicShape->Coordinates());
|
||||
if (aStyleBasicShape->HasRadius()) {
|
||||
shapeFunctionString.AppendLiteral(" round ");
|
||||
@ -5995,12 +5995,10 @@ nsComputedDOMStyle::CreatePrimitiveValueForBasicShape(
|
||||
return functionValue.forget();
|
||||
}
|
||||
|
||||
template<typename ReferenceBox>
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::CreatePrimitiveValueForShapeSource(
|
||||
const StyleBasicShape* aStyleBasicShape,
|
||||
ReferenceBox aReferenceBox,
|
||||
const KTableEntry aBoxKeywordTable[])
|
||||
nsComputedDOMStyle::CreatePrimitiveValueForClipPath(
|
||||
const nsStyleBasicShape* aStyleBasicShape,
|
||||
StyleClipShapeSizing aSizingBox)
|
||||
{
|
||||
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
|
||||
if (aStyleBasicShape) {
|
||||
@ -6008,40 +6006,41 @@ nsComputedDOMStyle::CreatePrimitiveValueForShapeSource(
|
||||
CreatePrimitiveValueForBasicShape(aStyleBasicShape));
|
||||
}
|
||||
|
||||
if (aReferenceBox == ReferenceBox::NoBox) {
|
||||
if (aSizingBox == StyleClipShapeSizing::NoBox) {
|
||||
return valueList.forget();
|
||||
}
|
||||
|
||||
nsAutoString boxString;
|
||||
AppendASCIItoUTF16(
|
||||
nsCSSProps::ValueToKeyword(aSizingBox,
|
||||
nsCSSProps::kClipShapeSizingKTable),
|
||||
boxString);
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
val->SetIdent(nsCSSProps::ValueToKeywordEnum(aReferenceBox, aBoxKeywordTable));
|
||||
val->SetString(boxString);
|
||||
valueList->AppendCSSValue(val.forget());
|
||||
|
||||
return valueList.forget();
|
||||
}
|
||||
|
||||
template<typename ReferenceBox>
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::GetShapeSource(
|
||||
const StyleShapeSource<ReferenceBox>& aShapeSource,
|
||||
const KTableEntry aBoxKeywordTable[])
|
||||
nsComputedDOMStyle::DoGetClipPath()
|
||||
{
|
||||
switch (aShapeSource.GetType()) {
|
||||
case StyleShapeSourceType::Shape:
|
||||
return CreatePrimitiveValueForShapeSource(aShapeSource.GetBasicShape(),
|
||||
aShapeSource.GetReferenceBox(),
|
||||
aBoxKeywordTable);
|
||||
case StyleShapeSourceType::Box:
|
||||
return CreatePrimitiveValueForShapeSource(nullptr,
|
||||
aShapeSource.GetReferenceBox(),
|
||||
aBoxKeywordTable);
|
||||
case StyleShapeSourceType::URL: {
|
||||
const nsStyleSVGReset* svg = StyleSVGReset();
|
||||
switch (svg->mClipPath.GetType()) {
|
||||
case StyleClipPathType::Shape:
|
||||
return CreatePrimitiveValueForClipPath(svg->mClipPath.GetBasicShape(),
|
||||
svg->mClipPath.GetSizingBox());
|
||||
case StyleClipPathType::Box:
|
||||
return CreatePrimitiveValueForClipPath(nullptr,
|
||||
svg->mClipPath.GetSizingBox());
|
||||
case StyleClipPathType::URL: {
|
||||
// Bug 1288812 - we should only serialize fragment for local-ref URL.
|
||||
nsCOMPtr<nsIURI> pathURI = aShapeSource.GetURL()->GetSourceURL();
|
||||
nsCOMPtr<nsIURI> pathURI = svg->mClipPath.GetURL()->GetSourceURL();
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
val->SetURI(pathURI);
|
||||
return val.forget();
|
||||
}
|
||||
case StyleShapeSourceType::None_: {
|
||||
case StyleClipPathType::None_: {
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
val->SetIdent(eCSSKeyword_none);
|
||||
return val.forget();
|
||||
@ -6052,20 +6051,6 @@ nsComputedDOMStyle::GetShapeSource(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetClipPath()
|
||||
{
|
||||
return GetShapeSource(StyleSVGReset()->mClipPath,
|
||||
nsCSSProps::kClipPathGeometryBoxKTable);
|
||||
}
|
||||
|
||||
already_AddRefed<CSSValue>
|
||||
nsComputedDOMStyle::DoGetShapeOutside()
|
||||
{
|
||||
return GetShapeSource(StyleDisplay()->mShapeOutside,
|
||||
nsCSSProps::kShapeOutsideShapeBoxKTable);
|
||||
}
|
||||
|
||||
void
|
||||
nsComputedDOMStyle::SetCssTextToCoord(nsAString& aCssText,
|
||||
const nsStyleCoord& aCoord)
|
||||
|
@ -481,7 +481,6 @@ private:
|
||||
already_AddRefed<CSSValue> DoGetScrollSnapPointsY();
|
||||
already_AddRefed<CSSValue> DoGetScrollSnapDestination();
|
||||
already_AddRefed<CSSValue> DoGetScrollSnapCoordinate();
|
||||
already_AddRefed<CSSValue> DoGetShapeOutside();
|
||||
|
||||
/* User interface properties */
|
||||
already_AddRefed<CSSValue> DoGetCursor();
|
||||
@ -644,21 +643,13 @@ private:
|
||||
already_AddRefed<CSSValue> CreatePrimitiveValueForStyleFilter(
|
||||
const nsStyleFilter& aStyleFilter);
|
||||
|
||||
template<typename ReferenceBox>
|
||||
already_AddRefed<CSSValue>
|
||||
GetShapeSource(const mozilla::StyleShapeSource<ReferenceBox>& aShapeSource,
|
||||
const KTableEntry aBoxKeywordTable[]);
|
||||
|
||||
template<typename ReferenceBox>
|
||||
already_AddRefed<CSSValue>
|
||||
CreatePrimitiveValueForShapeSource(
|
||||
const mozilla::StyleBasicShape* aStyleBasicShape,
|
||||
ReferenceBox aReferenceBox,
|
||||
const KTableEntry aBoxKeywordTable[]);
|
||||
already_AddRefed<CSSValue> CreatePrimitiveValueForClipPath(
|
||||
const nsStyleBasicShape* aStyleBasicShape,
|
||||
mozilla::StyleClipShapeSizing aSizingBox);
|
||||
|
||||
// Helper function for computing basic shape styles.
|
||||
already_AddRefed<CSSValue> CreatePrimitiveValueForBasicShape(
|
||||
const mozilla::StyleBasicShape* aStyleBasicShape);
|
||||
const nsStyleBasicShape* aStyleBasicShape);
|
||||
void BoxValuesToString(nsAString& aString,
|
||||
const nsTArray<nsStyleCoord>& aBoxValues);
|
||||
void BasicShapeRadiiToString(nsAString& aCssText,
|
||||
|
@ -217,7 +217,6 @@ COMPUTED_STYLE_PROP(scroll_snap_points_x, ScrollSnapPointsX)
|
||||
COMPUTED_STYLE_PROP(scroll_snap_points_y, ScrollSnapPointsY)
|
||||
COMPUTED_STYLE_PROP(scroll_snap_type_x, ScrollSnapTypeX)
|
||||
COMPUTED_STYLE_PROP(scroll_snap_type_y, ScrollSnapTypeY)
|
||||
COMPUTED_STYLE_PROP(shape_outside, ShapeOutside)
|
||||
//// COMPUTED_STYLE_PROP(size, Size)
|
||||
COMPUTED_STYLE_PROP(table_layout, TableLayout)
|
||||
COMPUTED_STYLE_PROP(text_align, TextAlign)
|
||||
|
@ -119,14 +119,6 @@ SetImageRequest(function<void(imgRequestProxy*)> aCallback,
|
||||
}
|
||||
}
|
||||
|
||||
template<typename ReferenceBox>
|
||||
static void
|
||||
SetStyleShapeSourceToCSSValue(StyleShapeSource<ReferenceBox>* aShapeSource,
|
||||
const nsCSSValue* aValue,
|
||||
nsStyleContext* aStyleContext,
|
||||
nsPresContext* aPresContext,
|
||||
RuleNodeCacheConditions& aConditions);
|
||||
|
||||
/* Helper function to convert a CSS <position> specified value into its
|
||||
* computed-style form. */
|
||||
static void
|
||||
@ -6442,35 +6434,6 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
|
||||
parentDisplay->mOrient,
|
||||
NS_STYLE_ORIENT_INLINE);
|
||||
|
||||
// shape-outside: none | [ <basic-shape> || <shape-box> ] | <image>
|
||||
const nsCSSValue* shapeOutsideValue = aRuleData->ValueForShapeOutside();
|
||||
switch (shapeOutsideValue->GetUnit()) {
|
||||
case eCSSUnit_Null:
|
||||
break;
|
||||
case eCSSUnit_None:
|
||||
case eCSSUnit_Initial:
|
||||
case eCSSUnit_Unset:
|
||||
display->mShapeOutside = StyleShapeOutside();
|
||||
break;
|
||||
case eCSSUnit_Inherit:
|
||||
conditions.SetUncacheable();
|
||||
display->mShapeOutside = parentDisplay->mShapeOutside;
|
||||
break;
|
||||
case eCSSUnit_URL: {
|
||||
display->mShapeOutside = StyleShapeOutside();
|
||||
display->mShapeOutside.SetURL(shapeOutsideValue);
|
||||
break;
|
||||
}
|
||||
case eCSSUnit_Array: {
|
||||
display->mShapeOutside = StyleShapeOutside();
|
||||
SetStyleShapeSourceToCSSValue(&display->mShapeOutside, shapeOutsideValue,
|
||||
aContext, mPresContext, conditions);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Unrecognized shape-outside unit!");
|
||||
}
|
||||
|
||||
COMPUTE_END_RESET(Display, display)
|
||||
}
|
||||
|
||||
@ -9618,13 +9581,13 @@ nsRuleNode::ComputeSVGData(void* aStartStruct,
|
||||
COMPUTE_END_INHERITED(SVG, svg)
|
||||
}
|
||||
|
||||
static already_AddRefed<StyleBasicShape>
|
||||
static already_AddRefed<nsStyleBasicShape>
|
||||
GetStyleBasicShapeFromCSSValue(const nsCSSValue& aValue,
|
||||
nsStyleContext* aStyleContext,
|
||||
nsPresContext* aPresContext,
|
||||
RuleNodeCacheConditions& aConditions)
|
||||
{
|
||||
RefPtr<StyleBasicShape> basicShape;
|
||||
RefPtr<nsStyleBasicShape> basicShape;
|
||||
|
||||
nsCSSValue::Array* shapeFunction = aValue.GetArrayValue();
|
||||
nsCSSKeyword functionName =
|
||||
@ -9632,7 +9595,7 @@ GetStyleBasicShapeFromCSSValue(const nsCSSValue& aValue,
|
||||
|
||||
if (functionName == eCSSKeyword_polygon) {
|
||||
MOZ_ASSERT(!basicShape, "did not expect value");
|
||||
basicShape = new StyleBasicShape(StyleBasicShapeType::Polygon);
|
||||
basicShape = new nsStyleBasicShape(nsStyleBasicShape::ePolygon);
|
||||
MOZ_ASSERT(shapeFunction->Count() > 1,
|
||||
"polygon has wrong number of arguments");
|
||||
size_t j = 1;
|
||||
@ -9663,17 +9626,17 @@ GetStyleBasicShapeFromCSSValue(const nsCSSValue& aValue,
|
||||
}
|
||||
} else if (functionName == eCSSKeyword_circle ||
|
||||
functionName == eCSSKeyword_ellipse) {
|
||||
StyleBasicShapeType type = functionName == eCSSKeyword_circle ?
|
||||
StyleBasicShapeType::Circle :
|
||||
StyleBasicShapeType::Ellipse;
|
||||
nsStyleBasicShape::Type type = functionName == eCSSKeyword_circle ?
|
||||
nsStyleBasicShape::eCircle :
|
||||
nsStyleBasicShape::eEllipse;
|
||||
MOZ_ASSERT(!basicShape, "did not expect value");
|
||||
basicShape = new StyleBasicShape(type);
|
||||
basicShape = new nsStyleBasicShape(type);
|
||||
const int32_t mask = SETCOORD_PERCENT | SETCOORD_LENGTH |
|
||||
SETCOORD_STORE_CALC | SETCOORD_ENUMERATED;
|
||||
size_t count = type == StyleBasicShapeType::Circle ? 2 : 3;
|
||||
size_t count = type == nsStyleBasicShape::eCircle ? 2 : 3;
|
||||
MOZ_ASSERT(shapeFunction->Count() == count + 1,
|
||||
"unexpected arguments count");
|
||||
MOZ_ASSERT(type == StyleBasicShapeType::Circle ||
|
||||
MOZ_ASSERT(type == nsStyleBasicShape::eCircle ||
|
||||
(shapeFunction->Item(1).GetUnit() == eCSSUnit_Null) ==
|
||||
(shapeFunction->Item(2).GetUnit() == eCSSUnit_Null),
|
||||
"ellipse should have two radii or none");
|
||||
@ -9703,7 +9666,7 @@ GetStyleBasicShapeFromCSSValue(const nsCSSValue& aValue,
|
||||
}
|
||||
} else if (functionName == eCSSKeyword_inset) {
|
||||
MOZ_ASSERT(!basicShape, "did not expect value");
|
||||
basicShape = new StyleBasicShape(StyleBasicShapeType::Inset);
|
||||
basicShape = new nsStyleBasicShape(nsStyleBasicShape::eInset);
|
||||
MOZ_ASSERT(shapeFunction->Count() == 6,
|
||||
"inset function has wrong number of arguments");
|
||||
MOZ_ASSERT(shapeFunction->Item(1).GetUnit() != eCSSUnit_Null,
|
||||
@ -9767,42 +9730,44 @@ GetStyleBasicShapeFromCSSValue(const nsCSSValue& aValue,
|
||||
return basicShape.forget();
|
||||
}
|
||||
|
||||
template<typename ReferenceBox>
|
||||
static void
|
||||
SetStyleShapeSourceToCSSValue(
|
||||
StyleShapeSource<ReferenceBox>* aShapeSource,
|
||||
const nsCSSValue* aValue,
|
||||
nsStyleContext* aStyleContext,
|
||||
nsPresContext* aPresContext,
|
||||
RuleNodeCacheConditions& aConditions)
|
||||
SetStyleClipPathToCSSValue(nsStyleClipPath* aStyleClipPath,
|
||||
const nsCSSValue* aValue,
|
||||
nsStyleContext* aStyleContext,
|
||||
nsPresContext* aPresContext,
|
||||
RuleNodeCacheConditions& aConditions)
|
||||
{
|
||||
MOZ_ASSERT(aValue->GetUnit() == eCSSUnit_Array,
|
||||
"expected a basic shape or reference box");
|
||||
|
||||
const nsCSSValue::Array* array = aValue->GetArrayValue();
|
||||
MOZ_ASSERT(array->Count() == 1 || array->Count() == 2,
|
||||
"Expect one or both of a shape function and a reference box");
|
||||
|
||||
ReferenceBox referenceBox = ReferenceBox::NoBox;
|
||||
RefPtr<StyleBasicShape> basicShape;
|
||||
"Expect one or both of a shape function and geometry-box");
|
||||
|
||||
StyleClipShapeSizing sizingBox = StyleClipShapeSizing::NoBox;
|
||||
RefPtr<nsStyleBasicShape> basicShape;
|
||||
for (size_t i = 0; i < array->Count(); ++i) {
|
||||
const nsCSSValue& item = array->Item(i);
|
||||
if (item.GetUnit() == eCSSUnit_Enumerated) {
|
||||
referenceBox = static_cast<ReferenceBox>(item.GetIntValue());
|
||||
} else if (item.GetUnit() == eCSSUnit_Function) {
|
||||
basicShape = GetStyleBasicShapeFromCSSValue(item, aStyleContext,
|
||||
if (array->Item(i).GetUnit() == eCSSUnit_Enumerated) {
|
||||
int32_t type = array->Item(i).GetIntValue();
|
||||
if (type > uint8_t(StyleClipShapeSizing::View) ||
|
||||
type < uint8_t(StyleClipShapeSizing::NoBox)) {
|
||||
NS_NOTREACHED("unexpected reference box");
|
||||
return;
|
||||
}
|
||||
sizingBox = static_cast<StyleClipShapeSizing>(type);
|
||||
} else if (array->Item(i).GetUnit() == eCSSUnit_Function) {
|
||||
basicShape = GetStyleBasicShapeFromCSSValue(array->Item(i), aStyleContext,
|
||||
aPresContext, aConditions);
|
||||
} else {
|
||||
MOZ_ASSERT_UNREACHABLE("Unexpected unit!");
|
||||
NS_NOTREACHED("unexpected value");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (basicShape) {
|
||||
aShapeSource->SetBasicShape(basicShape, referenceBox);
|
||||
aStyleClipPath->SetBasicShape(basicShape, sizingBox);
|
||||
} else {
|
||||
aShapeSource->SetReferenceBox(referenceBox);
|
||||
aStyleClipPath->SetSizingBox(sizingBox);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9914,21 +9879,21 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct,
|
||||
case eCSSUnit_None:
|
||||
case eCSSUnit_Initial:
|
||||
case eCSSUnit_Unset:
|
||||
svgReset->mClipPath = StyleClipPath();
|
||||
svgReset->mClipPath = nsStyleClipPath();
|
||||
break;
|
||||
case eCSSUnit_Inherit:
|
||||
conditions.SetUncacheable();
|
||||
svgReset->mClipPath = parentSVGReset->mClipPath;
|
||||
break;
|
||||
case eCSSUnit_URL: {
|
||||
svgReset->mClipPath = StyleClipPath();
|
||||
svgReset->mClipPath = nsStyleClipPath();
|
||||
svgReset->mClipPath.SetURL(clipPathValue);
|
||||
break;
|
||||
}
|
||||
case eCSSUnit_Array: {
|
||||
svgReset->mClipPath = StyleClipPath();
|
||||
SetStyleShapeSourceToCSSValue(&svgReset->mClipPath, clipPathValue, aContext,
|
||||
mPresContext, conditions);
|
||||
svgReset->mClipPath = nsStyleClipPath();
|
||||
SetStyleClipPathToCSSValue(&svgReset->mClipPath, clipPathValue, aContext,
|
||||
mPresContext, conditions);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -54,8 +54,8 @@ static inline css::Side operator++(css::Side& side, int) {
|
||||
#define NS_SIDE_TO_HALF_CORNER(side_, second_, parallel_) \
|
||||
((((side_) + !!(second_))*2 + ((side_) + !(parallel_))%2) % 8)
|
||||
|
||||
// Basic shapes
|
||||
enum class StyleBasicShapeType : uint8_t {
|
||||
// Basic Shapes (currently unused)
|
||||
enum class StyleBasicShape : uint8_t{
|
||||
Polygon,
|
||||
Circle,
|
||||
Ellipse,
|
||||
@ -73,8 +73,17 @@ enum class StyleBoxShadowType : uint8_t {
|
||||
Inset,
|
||||
};
|
||||
|
||||
// clip-path geometry box
|
||||
enum class StyleClipPathGeometryBox : uint8_t {
|
||||
// clip-path type
|
||||
// X11 has a #define for None causing conflicts, so we use None_ here
|
||||
enum class StyleClipPathType : uint8_t {
|
||||
None_,
|
||||
URL,
|
||||
Shape,
|
||||
Box,
|
||||
};
|
||||
|
||||
// clip-path sizing
|
||||
enum class StyleClipShapeSizing : uint8_t {
|
||||
NoBox,
|
||||
Content,
|
||||
Padding,
|
||||
@ -91,24 +100,6 @@ enum class StyleFloatEdge : uint8_t {
|
||||
MarginBox,
|
||||
};
|
||||
|
||||
// shape-box for shape-outside
|
||||
enum class StyleShapeOutsideShapeBox : uint8_t {
|
||||
NoBox,
|
||||
Content,
|
||||
Padding,
|
||||
Border,
|
||||
Margin
|
||||
};
|
||||
|
||||
// Shape source type
|
||||
// X11 has a #define for None causing conflicts, so we use None_ here
|
||||
enum class StyleShapeSourceType : uint8_t {
|
||||
None_,
|
||||
URL,
|
||||
Shape,
|
||||
Box,
|
||||
};
|
||||
|
||||
// user-focus
|
||||
// X11 has a #define for None causing conflicts, so we use None_ here
|
||||
enum class StyleUserFocus : uint8_t {
|
||||
|
@ -990,19 +990,19 @@ nsStyleSVG::CalcDifference(const nsStyleSVG& aNewData) const
|
||||
}
|
||||
|
||||
// --------------------
|
||||
// StyleBasicShape
|
||||
// nsStyleBasicShape
|
||||
|
||||
nsCSSKeyword
|
||||
StyleBasicShape::GetShapeTypeName() const
|
||||
nsStyleBasicShape::GetShapeTypeName() const
|
||||
{
|
||||
switch (mType) {
|
||||
case StyleBasicShapeType::Polygon:
|
||||
case nsStyleBasicShape::Type::ePolygon:
|
||||
return eCSSKeyword_polygon;
|
||||
case StyleBasicShapeType::Circle:
|
||||
case nsStyleBasicShape::Type::eCircle:
|
||||
return eCSSKeyword_circle;
|
||||
case StyleBasicShapeType::Ellipse:
|
||||
case nsStyleBasicShape::Type::eEllipse:
|
||||
return eCSSKeyword_ellipse;
|
||||
case StyleBasicShapeType::Inset:
|
||||
case nsStyleBasicShape::Type::eInset:
|
||||
return eCSSKeyword_inset;
|
||||
}
|
||||
NS_NOTREACHED("unexpected type");
|
||||
@ -1106,6 +1106,134 @@ FragmentOrURL::Resolve(nsIContent* aContent) const
|
||||
return Resolve(url);
|
||||
}
|
||||
|
||||
// --------------------
|
||||
// nsStyleClipPath
|
||||
//
|
||||
nsStyleClipPath::nsStyleClipPath()
|
||||
: mURL(nullptr)
|
||||
, mType(StyleClipPathType::None_)
|
||||
, mSizingBox(StyleClipShapeSizing::NoBox)
|
||||
{
|
||||
}
|
||||
|
||||
nsStyleClipPath::nsStyleClipPath(const nsStyleClipPath& aSource)
|
||||
: mURL(nullptr)
|
||||
, mType(StyleClipPathType::None_)
|
||||
, mSizingBox(StyleClipShapeSizing::NoBox)
|
||||
{
|
||||
if (aSource.mType == StyleClipPathType::URL) {
|
||||
CopyURL(aSource);
|
||||
} else if (aSource.mType == StyleClipPathType::Shape) {
|
||||
SetBasicShape(aSource.mBasicShape, aSource.mSizingBox);
|
||||
} else if (aSource.mType == StyleClipPathType::Box) {
|
||||
SetSizingBox(aSource.mSizingBox);
|
||||
}
|
||||
}
|
||||
|
||||
nsStyleClipPath::~nsStyleClipPath()
|
||||
{
|
||||
ReleaseRef();
|
||||
}
|
||||
|
||||
nsStyleClipPath&
|
||||
nsStyleClipPath::operator=(const nsStyleClipPath& aOther)
|
||||
{
|
||||
if (this == &aOther) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
if (aOther.mType == StyleClipPathType::URL) {
|
||||
CopyURL(aOther);
|
||||
} else if (aOther.mType == StyleClipPathType::Shape) {
|
||||
SetBasicShape(aOther.mBasicShape, aOther.mSizingBox);
|
||||
} else if (aOther.mType == StyleClipPathType::Box) {
|
||||
SetSizingBox(aOther.mSizingBox);
|
||||
} else {
|
||||
ReleaseRef();
|
||||
mSizingBox = StyleClipShapeSizing::NoBox;
|
||||
mType = StyleClipPathType::None_;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool
|
||||
nsStyleClipPath::operator==(const nsStyleClipPath& aOther) const
|
||||
{
|
||||
if (mType != aOther.mType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mType == StyleClipPathType::URL) {
|
||||
return EqualURIs(mURL, aOther.mURL);
|
||||
} else if (mType == StyleClipPathType::Shape) {
|
||||
return *mBasicShape == *aOther.mBasicShape &&
|
||||
mSizingBox == aOther.mSizingBox;
|
||||
} else if (mType == StyleClipPathType::Box) {
|
||||
return mSizingBox == aOther.mSizingBox;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleClipPath::ReleaseRef()
|
||||
{
|
||||
if (mType == StyleClipPathType::Shape) {
|
||||
NS_ASSERTION(mBasicShape, "expected pointer");
|
||||
mBasicShape->Release();
|
||||
} else if (mType == StyleClipPathType::URL) {
|
||||
NS_ASSERTION(mURL, "expected pointer");
|
||||
delete mURL;
|
||||
}
|
||||
// mBasicShap, mURL, etc. are all pointers in a union of pointers. Nulling
|
||||
// one of them nulls all of them:
|
||||
mURL = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleClipPath::CopyURL(const nsStyleClipPath& aOther)
|
||||
{
|
||||
ReleaseRef();
|
||||
|
||||
mURL = new FragmentOrURL(*aOther.mURL);
|
||||
mType = StyleClipPathType::URL;
|
||||
}
|
||||
|
||||
bool
|
||||
nsStyleClipPath::SetURL(const nsCSSValue* aValue)
|
||||
{
|
||||
if (!aValue->GetURLValue()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ReleaseRef();
|
||||
|
||||
mURL = new FragmentOrURL();
|
||||
mURL->SetValue(aValue);
|
||||
mType = StyleClipPathType::URL;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleClipPath::SetBasicShape(nsStyleBasicShape* aBasicShape,
|
||||
StyleClipShapeSizing aSizingBox)
|
||||
{
|
||||
NS_ASSERTION(aBasicShape, "expected pointer");
|
||||
ReleaseRef();
|
||||
mBasicShape = aBasicShape;
|
||||
mBasicShape->AddRef();
|
||||
mSizingBox = aSizingBox;
|
||||
mType = StyleClipPathType::Shape;
|
||||
}
|
||||
|
||||
void
|
||||
nsStyleClipPath::SetSizingBox(StyleClipShapeSizing aSizingBox)
|
||||
{
|
||||
ReleaseRef();
|
||||
mSizingBox = aSizingBox;
|
||||
mType = StyleClipPathType::Box;
|
||||
}
|
||||
|
||||
// --------------------
|
||||
// nsStyleFilter
|
||||
//
|
||||
@ -3076,7 +3204,6 @@ nsStyleDisplay::nsStyleDisplay(const nsStyleDisplay& aSource)
|
||||
, mAnimationFillModeCount(aSource.mAnimationFillModeCount)
|
||||
, mAnimationPlayStateCount(aSource.mAnimationPlayStateCount)
|
||||
, mAnimationIterationCountCount(aSource.mAnimationIterationCountCount)
|
||||
, mShapeOutside(aSource.mShapeOutside)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsStyleDisplay);
|
||||
|
||||
@ -3301,8 +3428,7 @@ nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
|
||||
mAnimationFillModeCount != aNewData.mAnimationFillModeCount ||
|
||||
mAnimationPlayStateCount != aNewData.mAnimationPlayStateCount ||
|
||||
mAnimationIterationCountCount != aNewData.mAnimationIterationCountCount ||
|
||||
mScrollSnapCoordinate != aNewData.mScrollSnapCoordinate ||
|
||||
mShapeOutside != aNewData.mShapeOutside)) {
|
||||
mScrollSnapCoordinate != aNewData.mScrollSnapCoordinate)) {
|
||||
hint |= nsChangeHint_NeutralChange;
|
||||
}
|
||||
|
||||
|
@ -2387,40 +2387,6 @@ private:
|
||||
void AssignFromKeyword(int32_t aTimingFunctionType);
|
||||
};
|
||||
|
||||
|
||||
struct FragmentOrURL
|
||||
{
|
||||
FragmentOrURL() : mIsLocalRef(false) {}
|
||||
FragmentOrURL(const FragmentOrURL& aSource)
|
||||
: mIsLocalRef(false)
|
||||
{ *this = aSource; }
|
||||
|
||||
void SetValue(const nsCSSValue* aValue);
|
||||
void SetNull();
|
||||
|
||||
FragmentOrURL& operator=(const FragmentOrURL& aOther);
|
||||
bool operator==(const FragmentOrURL& aOther) const;
|
||||
bool operator!=(const FragmentOrURL& aOther) const {
|
||||
return !(*this == aOther);
|
||||
}
|
||||
|
||||
bool EqualsExceptRef(nsIURI* aURI) const;
|
||||
|
||||
nsIURI* GetSourceURL() const { return mURL; }
|
||||
void GetSourceString(nsString& aRef) const;
|
||||
|
||||
// When matching a url with mIsLocalRef set, resolve it against aURI;
|
||||
// Otherwise, ignore aURL and return mURL directly.
|
||||
already_AddRefed<nsIURI> Resolve(nsIURI* aURI) const;
|
||||
already_AddRefed<nsIURI> Resolve(nsIContent* aContent) const;
|
||||
|
||||
bool IsLocalRef() const { return mIsLocalRef; }
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIURI> mURL;
|
||||
bool mIsLocalRef;
|
||||
};
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
struct StyleTransition
|
||||
@ -2524,259 +2490,6 @@ private:
|
||||
float mIterationCount; // mozilla::PositiveInfinity<float>() means infinite
|
||||
};
|
||||
|
||||
class StyleBasicShape final
|
||||
{
|
||||
public:
|
||||
explicit StyleBasicShape(StyleBasicShapeType type)
|
||||
: mType(type),
|
||||
mFillRule(NS_STYLE_FILL_RULE_NONZERO)
|
||||
{
|
||||
mPosition.SetInitialPercentValues(0.5f);
|
||||
}
|
||||
|
||||
StyleBasicShapeType GetShapeType() const { return mType; }
|
||||
nsCSSKeyword GetShapeTypeName() const;
|
||||
|
||||
int32_t GetFillRule() const { return mFillRule; }
|
||||
void SetFillRule(int32_t aFillRule)
|
||||
{
|
||||
MOZ_ASSERT(mType == StyleBasicShapeType::Polygon, "expected polygon");
|
||||
mFillRule = aFillRule;
|
||||
}
|
||||
|
||||
typedef nsStyleImageLayers::Position Position;
|
||||
Position& GetPosition() {
|
||||
MOZ_ASSERT(mType == StyleBasicShapeType::Circle ||
|
||||
mType == StyleBasicShapeType::Ellipse,
|
||||
"expected circle or ellipse");
|
||||
return mPosition;
|
||||
}
|
||||
const Position& GetPosition() const {
|
||||
MOZ_ASSERT(mType == StyleBasicShapeType::Circle ||
|
||||
mType == StyleBasicShapeType::Ellipse,
|
||||
"expected circle or ellipse");
|
||||
return mPosition;
|
||||
}
|
||||
|
||||
bool HasRadius() const {
|
||||
MOZ_ASSERT(mType == StyleBasicShapeType::Inset, "expected inset");
|
||||
nsStyleCoord zero;
|
||||
zero.SetCoordValue(0);
|
||||
NS_FOR_CSS_HALF_CORNERS(corner) {
|
||||
if (mRadius.Get(corner) != zero) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
nsStyleCorners& GetRadius() {
|
||||
MOZ_ASSERT(mType == StyleBasicShapeType::Inset, "expected inset");
|
||||
return mRadius;
|
||||
}
|
||||
const nsStyleCorners& GetRadius() const {
|
||||
MOZ_ASSERT(mType == StyleBasicShapeType::Inset, "expected inset");
|
||||
return mRadius;
|
||||
}
|
||||
|
||||
// mCoordinates has coordinates for polygon or radii for
|
||||
// ellipse and circle.
|
||||
nsTArray<nsStyleCoord>& Coordinates()
|
||||
{
|
||||
return mCoordinates;
|
||||
}
|
||||
|
||||
const nsTArray<nsStyleCoord>& Coordinates() const
|
||||
{
|
||||
return mCoordinates;
|
||||
}
|
||||
|
||||
bool operator==(const StyleBasicShape& aOther) const
|
||||
{
|
||||
return mType == aOther.mType &&
|
||||
mFillRule == aOther.mFillRule &&
|
||||
mCoordinates == aOther.mCoordinates &&
|
||||
mPosition == aOther.mPosition &&
|
||||
mRadius == aOther.mRadius;
|
||||
}
|
||||
bool operator!=(const StyleBasicShape& aOther) const {
|
||||
return !(*this == aOther);
|
||||
}
|
||||
|
||||
NS_INLINE_DECL_REFCOUNTING(StyleBasicShape);
|
||||
|
||||
private:
|
||||
~StyleBasicShape() {}
|
||||
|
||||
StyleBasicShapeType mType;
|
||||
int32_t mFillRule;
|
||||
|
||||
// mCoordinates has coordinates for polygon or radii for
|
||||
// ellipse and circle.
|
||||
nsTArray<nsStyleCoord> mCoordinates;
|
||||
Position mPosition;
|
||||
nsStyleCorners mRadius;
|
||||
};
|
||||
|
||||
template<typename ReferenceBox>
|
||||
struct StyleShapeSource
|
||||
{
|
||||
StyleShapeSource()
|
||||
: mURL(nullptr)
|
||||
{}
|
||||
|
||||
StyleShapeSource(const StyleShapeSource& aSource)
|
||||
: StyleShapeSource()
|
||||
{
|
||||
if (aSource.mType == StyleShapeSourceType::URL) {
|
||||
CopyURL(aSource);
|
||||
} else if (aSource.mType == StyleShapeSourceType::Shape) {
|
||||
SetBasicShape(aSource.mBasicShape, aSource.mReferenceBox);
|
||||
} else if (aSource.mType == StyleShapeSourceType::Box) {
|
||||
SetReferenceBox(aSource.mReferenceBox);
|
||||
}
|
||||
}
|
||||
|
||||
~StyleShapeSource()
|
||||
{
|
||||
ReleaseRef();
|
||||
}
|
||||
|
||||
StyleShapeSource& operator=(const StyleShapeSource& aOther)
|
||||
{
|
||||
if (this == &aOther) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
if (aOther.mType == StyleShapeSourceType::URL) {
|
||||
CopyURL(aOther);
|
||||
} else if (aOther.mType == StyleShapeSourceType::Shape) {
|
||||
SetBasicShape(aOther.mBasicShape, aOther.mReferenceBox);
|
||||
} else if (aOther.mType == StyleShapeSourceType::Box) {
|
||||
SetReferenceBox(aOther.mReferenceBox);
|
||||
} else {
|
||||
ReleaseRef();
|
||||
mReferenceBox = ReferenceBox::NoBox;
|
||||
mType = StyleShapeSourceType::None_;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const StyleShapeSource& aOther) const
|
||||
{
|
||||
if (mType != aOther.mType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mType == StyleShapeSourceType::URL) {
|
||||
return mURL == aOther.mURL;
|
||||
} else if (mType == StyleShapeSourceType::Shape) {
|
||||
return *mBasicShape == *aOther.mBasicShape &&
|
||||
mReferenceBox == aOther.mReferenceBox;
|
||||
} else if (mType == StyleShapeSourceType::Box) {
|
||||
return mReferenceBox == aOther.mReferenceBox;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool operator!=(const StyleShapeSource& aOther) const
|
||||
{
|
||||
return !(*this == aOther);
|
||||
}
|
||||
|
||||
StyleShapeSourceType GetType() const
|
||||
{
|
||||
return mType;
|
||||
}
|
||||
|
||||
FragmentOrURL* GetURL() const
|
||||
{
|
||||
MOZ_ASSERT(mType == StyleShapeSourceType::URL, "Wrong shape source type!");
|
||||
return mURL;
|
||||
}
|
||||
|
||||
bool SetURL(const nsCSSValue* aValue)
|
||||
{
|
||||
if (!aValue->GetURLValue()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ReleaseRef();
|
||||
|
||||
mURL = new FragmentOrURL();
|
||||
mURL->SetValue(aValue);
|
||||
mType = StyleShapeSourceType::URL;
|
||||
return true;
|
||||
}
|
||||
|
||||
StyleBasicShape* GetBasicShape() const
|
||||
{
|
||||
MOZ_ASSERT(mType == StyleShapeSourceType::Shape, "Wrong shape source type!");
|
||||
return mBasicShape;
|
||||
}
|
||||
|
||||
void SetBasicShape(StyleBasicShape* aBasicShape,
|
||||
ReferenceBox aReferenceBox)
|
||||
{
|
||||
NS_ASSERTION(aBasicShape, "expected pointer");
|
||||
ReleaseRef();
|
||||
mBasicShape = aBasicShape;
|
||||
mBasicShape->AddRef();
|
||||
mReferenceBox = aReferenceBox;
|
||||
mType = StyleShapeSourceType::Shape;
|
||||
}
|
||||
|
||||
ReferenceBox GetReferenceBox() const
|
||||
{
|
||||
MOZ_ASSERT(mType == StyleShapeSourceType::Box ||
|
||||
mType == StyleShapeSourceType::Shape,
|
||||
"Wrong shape source type!");
|
||||
return mReferenceBox;
|
||||
}
|
||||
|
||||
void SetReferenceBox(ReferenceBox aReferenceBox)
|
||||
{
|
||||
ReleaseRef();
|
||||
mReferenceBox = aReferenceBox;
|
||||
mType = StyleShapeSourceType::Box;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReleaseRef()
|
||||
{
|
||||
if (mType == StyleShapeSourceType::Shape) {
|
||||
NS_ASSERTION(mBasicShape, "expected pointer");
|
||||
mBasicShape->Release();
|
||||
} else if (mType == StyleShapeSourceType::URL) {
|
||||
NS_ASSERTION(mURL, "expected pointer");
|
||||
delete mURL;
|
||||
}
|
||||
// Both mBasicShape and mURL are pointers in a union. Nulling one of them
|
||||
// nulls both of them.
|
||||
mURL = nullptr;
|
||||
}
|
||||
|
||||
void CopyURL(const StyleShapeSource& aOther)
|
||||
{
|
||||
ReleaseRef();
|
||||
|
||||
mURL = new FragmentOrURL(*aOther.mURL);
|
||||
mType = StyleShapeSourceType::URL;
|
||||
}
|
||||
|
||||
void* operator new(size_t) = delete;
|
||||
|
||||
union {
|
||||
StyleBasicShape* mBasicShape;
|
||||
FragmentOrURL* mURL;
|
||||
};
|
||||
StyleShapeSourceType mType = StyleShapeSourceType::None_;
|
||||
ReferenceBox mReferenceBox = ReferenceBox::NoBox;
|
||||
};
|
||||
|
||||
using StyleClipPath = StyleShapeSource<StyleClipPathGeometryBox>;
|
||||
using StyleShapeOutside = StyleShapeSource<StyleShapeOutsideShapeBox>;
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
|
||||
@ -2898,8 +2611,6 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
|
||||
mAnimationPlayStateCount,
|
||||
mAnimationIterationCountCount;
|
||||
|
||||
mozilla::StyleShapeOutside mShapeOutside; // [reset]
|
||||
|
||||
bool IsBlockInsideStyle() const {
|
||||
return NS_STYLE_DISPLAY_BLOCK == mDisplay ||
|
||||
NS_STYLE_DISPLAY_LIST_ITEM == mDisplay ||
|
||||
@ -3522,6 +3233,39 @@ protected:
|
||||
nscoord mTwipsPerPixel;
|
||||
};
|
||||
|
||||
struct FragmentOrURL
|
||||
{
|
||||
FragmentOrURL() : mIsLocalRef(false) {}
|
||||
FragmentOrURL(const FragmentOrURL& aSource)
|
||||
: mIsLocalRef(false)
|
||||
{ *this = aSource; }
|
||||
|
||||
void SetValue(const nsCSSValue* aValue);
|
||||
void SetNull();
|
||||
|
||||
FragmentOrURL& operator=(const FragmentOrURL& aOther);
|
||||
bool operator==(const FragmentOrURL& aOther) const;
|
||||
bool operator!=(const FragmentOrURL& aOther) const {
|
||||
return !(*this == aOther);
|
||||
}
|
||||
|
||||
bool EqualsExceptRef(nsIURI* aURI) const;
|
||||
|
||||
nsIURI* GetSourceURL() const { return mURL; }
|
||||
void GetSourceString(nsString& aRef) const;
|
||||
|
||||
// When matching a url with mIsLocalRef set, resolve it against aURI;
|
||||
// Otherwise, ignore aURL and return mURL directly.
|
||||
already_AddRefed<nsIURI> Resolve(nsIURI* aURI) const;
|
||||
already_AddRefed<nsIURI> Resolve(nsIContent* aContent) const;
|
||||
|
||||
bool IsLocalRef() const { return mIsLocalRef; }
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIURI> mURL;
|
||||
bool mIsLocalRef;
|
||||
};
|
||||
|
||||
enum nsStyleSVGPaintType {
|
||||
eStyleSVGPaintType_None = 1,
|
||||
eStyleSVGPaintType_Color,
|
||||
@ -3692,6 +3436,153 @@ private:
|
||||
uint8_t mContextFlags; // [inherited]
|
||||
};
|
||||
|
||||
class nsStyleBasicShape final
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
eInset,
|
||||
eCircle,
|
||||
eEllipse,
|
||||
ePolygon
|
||||
};
|
||||
|
||||
explicit nsStyleBasicShape(Type type)
|
||||
: mType(type),
|
||||
mFillRule(NS_STYLE_FILL_RULE_NONZERO)
|
||||
{
|
||||
mPosition.SetInitialPercentValues(0.5f);
|
||||
}
|
||||
|
||||
Type GetShapeType() const { return mType; }
|
||||
nsCSSKeyword GetShapeTypeName() const;
|
||||
|
||||
int32_t GetFillRule() const { return mFillRule; }
|
||||
void SetFillRule(int32_t aFillRule)
|
||||
{
|
||||
NS_ASSERTION(mType == ePolygon, "expected polygon");
|
||||
mFillRule = aFillRule;
|
||||
}
|
||||
|
||||
typedef nsStyleImageLayers::Position Position;
|
||||
Position& GetPosition() {
|
||||
NS_ASSERTION(mType == eCircle || mType == eEllipse,
|
||||
"expected circle or ellipse");
|
||||
return mPosition;
|
||||
}
|
||||
const Position& GetPosition() const {
|
||||
NS_ASSERTION(mType == eCircle || mType == eEllipse,
|
||||
"expected circle or ellipse");
|
||||
return mPosition;
|
||||
}
|
||||
|
||||
bool HasRadius() const {
|
||||
NS_ASSERTION(mType == eInset, "expected inset");
|
||||
nsStyleCoord zero;
|
||||
zero.SetCoordValue(0);
|
||||
NS_FOR_CSS_HALF_CORNERS(corner) {
|
||||
if (mRadius.Get(corner) != zero) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
nsStyleCorners& GetRadius() {
|
||||
NS_ASSERTION(mType == eInset, "expected inset");
|
||||
return mRadius;
|
||||
}
|
||||
const nsStyleCorners& GetRadius() const {
|
||||
NS_ASSERTION(mType == eInset, "expected inset");
|
||||
return mRadius;
|
||||
}
|
||||
|
||||
// mCoordinates has coordinates for polygon or radii for
|
||||
// ellipse and circle.
|
||||
nsTArray<nsStyleCoord>& Coordinates()
|
||||
{
|
||||
return mCoordinates;
|
||||
}
|
||||
|
||||
const nsTArray<nsStyleCoord>& Coordinates() const
|
||||
{
|
||||
return mCoordinates;
|
||||
}
|
||||
|
||||
bool operator==(const nsStyleBasicShape& aOther) const
|
||||
{
|
||||
return mType == aOther.mType &&
|
||||
mFillRule == aOther.mFillRule &&
|
||||
mCoordinates == aOther.mCoordinates &&
|
||||
mPosition == aOther.mPosition &&
|
||||
mRadius == aOther.mRadius;
|
||||
}
|
||||
bool operator!=(const nsStyleBasicShape& aOther) const {
|
||||
return !(*this == aOther);
|
||||
}
|
||||
|
||||
NS_INLINE_DECL_REFCOUNTING(nsStyleBasicShape);
|
||||
|
||||
private:
|
||||
~nsStyleBasicShape() {}
|
||||
|
||||
Type mType;
|
||||
int32_t mFillRule;
|
||||
|
||||
// mCoordinates has coordinates for polygon or radii for
|
||||
// ellipse and circle.
|
||||
nsTArray<nsStyleCoord> mCoordinates;
|
||||
Position mPosition;
|
||||
nsStyleCorners mRadius;
|
||||
};
|
||||
|
||||
struct nsStyleClipPath
|
||||
{
|
||||
nsStyleClipPath();
|
||||
nsStyleClipPath(const nsStyleClipPath& aSource);
|
||||
~nsStyleClipPath();
|
||||
|
||||
nsStyleClipPath& operator=(const nsStyleClipPath& aOther);
|
||||
|
||||
bool operator==(const nsStyleClipPath& aOther) const;
|
||||
bool operator!=(const nsStyleClipPath& aOther) const {
|
||||
return !(*this == aOther);
|
||||
}
|
||||
|
||||
mozilla::StyleClipPathType GetType() const {
|
||||
return mType;
|
||||
}
|
||||
|
||||
FragmentOrURL* GetURL() const {
|
||||
NS_ASSERTION(mType == mozilla::StyleClipPathType::URL, "wrong clip-path type");
|
||||
return mURL;
|
||||
}
|
||||
bool SetURL(const nsCSSValue* aValue);
|
||||
|
||||
nsStyleBasicShape* GetBasicShape() const {
|
||||
NS_ASSERTION(mType == mozilla::StyleClipPathType::Shape, "wrong clip-path type");
|
||||
return mBasicShape;
|
||||
}
|
||||
|
||||
void SetBasicShape(nsStyleBasicShape* mBasicShape,
|
||||
mozilla::StyleClipShapeSizing aSizingBox =
|
||||
mozilla::StyleClipShapeSizing::NoBox);
|
||||
|
||||
mozilla::StyleClipShapeSizing GetSizingBox() const { return mSizingBox; }
|
||||
void SetSizingBox(mozilla::StyleClipShapeSizing aSizingBox);
|
||||
|
||||
private:
|
||||
void ReleaseRef();
|
||||
void CopyURL(const nsStyleClipPath& aOther);
|
||||
|
||||
void* operator new(size_t) = delete;
|
||||
|
||||
union {
|
||||
nsStyleBasicShape* mBasicShape;
|
||||
FragmentOrURL* mURL;
|
||||
};
|
||||
mozilla::StyleClipPathType mType;
|
||||
mozilla::StyleClipShapeSizing mSizingBox;
|
||||
};
|
||||
|
||||
struct nsStyleFilter
|
||||
{
|
||||
nsStyleFilter();
|
||||
@ -3779,7 +3670,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVGReset
|
||||
}
|
||||
|
||||
bool HasClipPath() const {
|
||||
return mClipPath.GetType() != mozilla::StyleShapeSourceType::None_;
|
||||
return mClipPath.GetType() != mozilla::StyleClipPathType::None_;
|
||||
}
|
||||
|
||||
bool HasNonScalingStroke() const {
|
||||
@ -3787,7 +3678,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVGReset
|
||||
}
|
||||
|
||||
nsStyleImageLayers mMask;
|
||||
mozilla::StyleClipPath mClipPath; // [reset]
|
||||
nsStyleClipPath mClipPath; // [reset]
|
||||
nscolor mStopColor; // [reset]
|
||||
nscolor mFloodColor; // [reset]
|
||||
nscolor mLightingColor; // [reset]
|
||||
|
@ -5598,173 +5598,6 @@ if (IsCSSPropertyPrefEnabled("svg.transform-box.enabled")) {
|
||||
};
|
||||
}
|
||||
|
||||
var basicShapeOtherValues = [
|
||||
"polygon(20px 20px)",
|
||||
"polygon(20px 20%)",
|
||||
"polygon(20% 20%)",
|
||||
"polygon(20rem 20em)",
|
||||
"polygon(20cm 20mm)",
|
||||
"polygon(20px 20px, 30px 30px)",
|
||||
"polygon(20px 20px, 30% 30%, 30px 30px)",
|
||||
"polygon(nonzero, 20px 20px, 30% 30%, 30px 30px)",
|
||||
"polygon(evenodd, 20px 20px, 30% 30%, 30px 30px)",
|
||||
|
||||
"content-box",
|
||||
"padding-box",
|
||||
"border-box",
|
||||
"margin-box",
|
||||
|
||||
"polygon(0 0) content-box",
|
||||
"border-box polygon(0 0)",
|
||||
"padding-box polygon( 0 20px , 30px 20% ) ",
|
||||
"polygon(evenodd, 20% 20em) content-box",
|
||||
"polygon(evenodd, 20vh 20em) padding-box",
|
||||
"polygon(evenodd, 20vh calc(20% + 20em)) border-box",
|
||||
"polygon(evenodd, 20vh 20vw) margin-box",
|
||||
|
||||
"circle()",
|
||||
"circle(at center)",
|
||||
"circle(at top left 20px)",
|
||||
"circle(at bottom right)",
|
||||
"circle(20%)",
|
||||
"circle(300px)",
|
||||
"circle(calc(20px + 30px))",
|
||||
"circle(farthest-side)",
|
||||
"circle(closest-side)",
|
||||
"circle(closest-side at center)",
|
||||
"circle(farthest-side at top)",
|
||||
"circle(20px at top right)",
|
||||
"circle(40% at 50% 100%)",
|
||||
"circle(calc(20% + 20%) at right bottom)",
|
||||
"circle() padding-box",
|
||||
|
||||
"ellipse()",
|
||||
"ellipse(at center)",
|
||||
"ellipse(at top left 20px)",
|
||||
"ellipse(at bottom right)",
|
||||
"ellipse(20% 20%)",
|
||||
"ellipse(300px 50%)",
|
||||
"ellipse(calc(20px + 30px) 10%)",
|
||||
"ellipse(farthest-side closest-side)",
|
||||
"ellipse(closest-side farthest-side)",
|
||||
"ellipse(farthest-side farthest-side)",
|
||||
"ellipse(closest-side closest-side)",
|
||||
"ellipse(closest-side closest-side at center)",
|
||||
"ellipse(20% farthest-side at top)",
|
||||
"ellipse(20px 50% at top right)",
|
||||
"ellipse(closest-side 40% at 50% 100%)",
|
||||
"ellipse(calc(20% + 20%) calc(20px + 20cm) at right bottom)",
|
||||
|
||||
"inset(1px)",
|
||||
"inset(20% -20px)",
|
||||
"inset(20em 4rem calc(20% + 20px))",
|
||||
"inset(20vh 20vw 20pt 3%)",
|
||||
"inset(5px round 3px)",
|
||||
"inset(1px 2px round 3px / 3px)",
|
||||
"inset(1px 2px 3px round 3px 2em / 20%)",
|
||||
"inset(1px 2px 3px 4px round 3px 2vw 20% / 20px 3em 2vh 20%)",
|
||||
];
|
||||
|
||||
var basicShapeInvalidValues = [
|
||||
"url(#test) url(#tes2)",
|
||||
"polygon (0 0)",
|
||||
"polygon(20px, 40px)",
|
||||
"border-box content-box",
|
||||
"polygon(0 0) polygon(0 0)",
|
||||
"polygon(nonzero 0 0)",
|
||||
"polygon(evenodd 20px 20px)",
|
||||
"polygon(20px 20px, evenodd)",
|
||||
"polygon(20px 20px, nonzero)",
|
||||
"polygon(0 0) conten-box content-box",
|
||||
"content-box polygon(0 0) conten-box",
|
||||
"padding-box polygon(0 0) conten-box",
|
||||
"polygon(0 0) polygon(0 0) content-box",
|
||||
"polygon(0 0) content-box polygon(0 0)",
|
||||
"polygon(0 0), content-box",
|
||||
"polygon(0 0), polygon(0 0)",
|
||||
"content-box polygon(0 0) polygon(0 0)",
|
||||
"content-box polygon(0 0) none",
|
||||
"none content-box polygon(0 0)",
|
||||
"inherit content-box polygon(0 0)",
|
||||
"initial polygon(0 0)",
|
||||
"polygon(0 0) farthest-side",
|
||||
"farthest-corner polygon(0 0)",
|
||||
"polygon(0 0) farthest-corner",
|
||||
"polygon(0 0) conten-box",
|
||||
"polygon(0 0) polygon(0 0) farthest-corner",
|
||||
"polygon(0 0) polygon(0 0) polygon(0 0)",
|
||||
"border-box polygon(0, 0)",
|
||||
"border-box padding-box",
|
||||
"margin-box farthest-side",
|
||||
"nonsense() border-box",
|
||||
"border-box nonsense()",
|
||||
|
||||
"circle(at)",
|
||||
"circle(at 20% 20% 30%)",
|
||||
"circle(20px 2px at center)",
|
||||
"circle(2at center)",
|
||||
"circle(closest-corner)",
|
||||
"circle(at center top closest-side)",
|
||||
"circle(-20px)",
|
||||
"circle(farthest-side closest-side)",
|
||||
"circle(20% 20%)",
|
||||
"circle(at farthest-side)",
|
||||
"circle(calc(20px + rubbish))",
|
||||
|
||||
"ellipse(at)",
|
||||
"ellipse(at 20% 20% 30%)",
|
||||
"ellipse(20px at center)",
|
||||
"ellipse(-20px 20px)",
|
||||
"ellipse(closest-corner farthest-corner)",
|
||||
"ellipse(20px -20px)",
|
||||
"ellipse(-20px -20px)",
|
||||
"ellipse(farthest-side)",
|
||||
"ellipse(20%)",
|
||||
"ellipse(at farthest-side farthest-side)",
|
||||
"ellipse(at top left calc(20px + rubbish))",
|
||||
|
||||
"polygon(at)",
|
||||
"polygon(at 20% 20% 30%)",
|
||||
"polygon(20px at center)",
|
||||
"polygon(2px 2at center)",
|
||||
"polygon(closest-corner farthest-corner)",
|
||||
"polygon(at center top closest-side closest-side)",
|
||||
"polygon(40% at 50% 100%)",
|
||||
"polygon(40% farthest-side 20px at 50% 100%)",
|
||||
|
||||
"inset()",
|
||||
"inset(round)",
|
||||
"inset(round 3px)",
|
||||
"inset(1px round 1px 2px 3px 4px 5px)",
|
||||
"inset(1px 2px 3px 4px 5px)",
|
||||
"inset(1px, round 3px)",
|
||||
"inset(1px, 2px)",
|
||||
"inset(1px 2px, 3px)",
|
||||
"inset(1px at 3px)",
|
||||
"inset(1px round 1px // 2px)",
|
||||
"inset(1px round)",
|
||||
"inset(1px calc(2px + rubbish))",
|
||||
"inset(1px round 2px calc(3px + rubbish))",
|
||||
];
|
||||
|
||||
var basicShapeUnbalancedValues = [
|
||||
"polygon(30% 30%",
|
||||
"polygon(nonzero, 20% 20px",
|
||||
"polygon(evenodd, 20px 20px",
|
||||
|
||||
"circle(",
|
||||
"circle(40% at 50% 100%",
|
||||
"ellipse(",
|
||||
"ellipse(40% at 50% 100%",
|
||||
|
||||
"inset(1px",
|
||||
"inset(1px 2px",
|
||||
"inset(1px 2px 3px",
|
||||
"inset(1px 2px 3px 4px",
|
||||
"inset(1px 2px 3px 4px round 5px",
|
||||
"inset(1px 2px 3px 4px round 5px / 6px",
|
||||
];
|
||||
|
||||
if (IsCSSPropertyPrefEnabled("layout.css.clip-path-shapes.enabled")) {
|
||||
gCSSProperties["clip-path"] = {
|
||||
domProp: "clipPath",
|
||||
@ -5775,30 +5608,175 @@ if (IsCSSPropertyPrefEnabled("layout.css.clip-path-shapes.enabled")) {
|
||||
// SVG reference clip-path
|
||||
"url(#my-clip-path)",
|
||||
|
||||
"polygon(20px 20px)",
|
||||
"polygon(20px 20%)",
|
||||
"polygon(20% 20%)",
|
||||
"polygon(20rem 20em)",
|
||||
"polygon(20cm 20mm)",
|
||||
"polygon(20px 20px, 30px 30px)",
|
||||
"polygon(20px 20px, 30% 30%, 30px 30px)",
|
||||
"polygon(nonzero, 20px 20px, 30% 30%, 30px 30px)",
|
||||
"polygon(evenodd, 20px 20px, 30% 30%, 30px 30px)",
|
||||
|
||||
"content-box",
|
||||
"padding-box",
|
||||
"border-box",
|
||||
"margin-box",
|
||||
"fill-box",
|
||||
"stroke-box",
|
||||
"view-box",
|
||||
|
||||
"polygon(0 0) content-box",
|
||||
"border-box polygon(0 0)",
|
||||
"padding-box polygon( 0 20px , 30px 20% ) ",
|
||||
"polygon(evenodd, 20% 20em) content-box",
|
||||
"polygon(evenodd, 20vh 20em) padding-box",
|
||||
"polygon(evenodd, 20vh calc(20% + 20em)) border-box",
|
||||
"polygon(evenodd, 20vh 20vw) margin-box",
|
||||
"polygon(evenodd, 20pt 20cm) fill-box",
|
||||
"polygon(evenodd, 20ex 20pc) stroke-box",
|
||||
"polygon(evenodd, 20rem 20in) view-box",
|
||||
].concat(basicShapeOtherValues),
|
||||
invalid_values: basicShapeInvalidValues,
|
||||
unbalanced_values: basicShapeUnbalancedValues,
|
||||
};
|
||||
}
|
||||
|
||||
if (IsCSSPropertyPrefEnabled("layout.css.shape-outside.enabled")) {
|
||||
gCSSProperties["shape-outside"] = {
|
||||
domProp: "shapeOutside",
|
||||
inherited: false,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "none" ],
|
||||
other_values: [
|
||||
"url(#my-shape-outside)",
|
||||
].concat(basicShapeOtherValues),
|
||||
invalid_values: basicShapeInvalidValues,
|
||||
unbalanced_values: basicShapeUnbalancedValues,
|
||||
"circle()",
|
||||
"circle(at center)",
|
||||
"circle(at top left 20px)",
|
||||
"circle(at bottom right)",
|
||||
"circle(20%)",
|
||||
"circle(300px)",
|
||||
"circle(calc(20px + 30px))",
|
||||
"circle(farthest-side)",
|
||||
"circle(closest-side)",
|
||||
"circle(closest-side at center)",
|
||||
"circle(farthest-side at top)",
|
||||
"circle(20px at top right)",
|
||||
"circle(40% at 50% 100%)",
|
||||
"circle(calc(20% + 20%) at right bottom)",
|
||||
"circle() padding-box",
|
||||
|
||||
"ellipse()",
|
||||
"ellipse(at center)",
|
||||
"ellipse(at top left 20px)",
|
||||
"ellipse(at bottom right)",
|
||||
"ellipse(20% 20%)",
|
||||
"ellipse(300px 50%)",
|
||||
"ellipse(calc(20px + 30px) 10%)",
|
||||
"ellipse(farthest-side closest-side)",
|
||||
"ellipse(closest-side farthest-side)",
|
||||
"ellipse(farthest-side farthest-side)",
|
||||
"ellipse(closest-side closest-side)",
|
||||
"ellipse(closest-side closest-side at center)",
|
||||
"ellipse(20% farthest-side at top)",
|
||||
"ellipse(20px 50% at top right)",
|
||||
"ellipse(closest-side 40% at 50% 100%)",
|
||||
"ellipse(calc(20% + 20%) calc(20px + 20cm) at right bottom)",
|
||||
|
||||
"inset(1px)",
|
||||
"inset(20% -20px)",
|
||||
"inset(20em 4rem calc(20% + 20px))",
|
||||
"inset(20vh 20vw 20pt 3%)",
|
||||
"inset(5px round 3px)",
|
||||
"inset(1px 2px round 3px / 3px)",
|
||||
"inset(1px 2px 3px round 3px 2em / 20%)",
|
||||
"inset(1px 2px 3px 4px round 3px 2vw 20% / 20px 3em 2vh 20%)",
|
||||
],
|
||||
invalid_values: [
|
||||
"url(#test) url(#tes2)",
|
||||
"polygon (0 0)",
|
||||
"polygon(20px, 40px)",
|
||||
"border-box content-box",
|
||||
"polygon(0 0) polygon(0 0)",
|
||||
"polygon(nonzero 0 0)",
|
||||
"polygon(evenodd 20px 20px)",
|
||||
"polygon(20px 20px, evenodd)",
|
||||
"polygon(20px 20px, nonzero)",
|
||||
"polygon(0 0) conten-box content-box",
|
||||
"content-box polygon(0 0) conten-box",
|
||||
"padding-box polygon(0 0) conten-box",
|
||||
"polygon(0 0) polygon(0 0) content-box",
|
||||
"polygon(0 0) content-box polygon(0 0)",
|
||||
"polygon(0 0), content-box",
|
||||
"polygon(0 0), polygon(0 0)",
|
||||
"content-box polygon(0 0) polygon(0 0)",
|
||||
"content-box polygon(0 0) none",
|
||||
"none content-box polygon(0 0)",
|
||||
"inherit content-box polygon(0 0)",
|
||||
"initial polygon(0 0)",
|
||||
"polygon(0 0) farthest-side",
|
||||
"farthest-corner polygon(0 0)",
|
||||
"polygon(0 0) farthest-corner",
|
||||
"polygon(0 0) conten-box",
|
||||
"polygon(0 0) polygon(0 0) farthest-corner",
|
||||
"polygon(0 0) polygon(0 0) polygon(0 0)",
|
||||
"border-box polygon(0, 0)",
|
||||
"border-box padding-box",
|
||||
"margin-box farthest-side",
|
||||
"nonsense() border-box",
|
||||
"border-box nonsense()",
|
||||
|
||||
"circle(at)",
|
||||
"circle(at 20% 20% 30%)",
|
||||
"circle(20px 2px at center)",
|
||||
"circle(2at center)",
|
||||
"circle(closest-corner)",
|
||||
"circle(at center top closest-side)",
|
||||
"circle(-20px)",
|
||||
"circle(farthest-side closest-side)",
|
||||
"circle(20% 20%)",
|
||||
"circle(at farthest-side)",
|
||||
"circle(calc(20px + rubbish))",
|
||||
|
||||
"ellipse(at)",
|
||||
"ellipse(at 20% 20% 30%)",
|
||||
"ellipse(20px at center)",
|
||||
"ellipse(-20px 20px)",
|
||||
"ellipse(closest-corner farthest-corner)",
|
||||
"ellipse(20px -20px)",
|
||||
"ellipse(-20px -20px)",
|
||||
"ellipse(farthest-side)",
|
||||
"ellipse(20%)",
|
||||
"ellipse(at farthest-side farthest-side)",
|
||||
"ellipse(at top left calc(20px + rubbish))",
|
||||
|
||||
"polygon(at)",
|
||||
"polygon(at 20% 20% 30%)",
|
||||
"polygon(20px at center)",
|
||||
"polygon(2px 2at center)",
|
||||
"polygon(closest-corner farthest-corner)",
|
||||
"polygon(at center top closest-side closest-side)",
|
||||
"polygon(40% at 50% 100%)",
|
||||
"polygon(40% farthest-side 20px at 50% 100%)",
|
||||
|
||||
"inset()",
|
||||
"inset(round)",
|
||||
"inset(round 3px)",
|
||||
"inset(1px round 1px 2px 3px 4px 5px)",
|
||||
"inset(1px 2px 3px 4px 5px)",
|
||||
"inset(1px, round 3px)",
|
||||
"inset(1px, 2px)",
|
||||
"inset(1px 2px, 3px)",
|
||||
"inset(1px at 3px)",
|
||||
"inset(1px round 1px // 2px)",
|
||||
"inset(1px round)",
|
||||
"inset(1px calc(2px + rubbish))",
|
||||
"inset(1px round 2px calc(3px + rubbish))",
|
||||
],
|
||||
unbalanced_values: [
|
||||
"polygon(30% 30%",
|
||||
"polygon(nonzero, 20% 20px",
|
||||
"polygon(evenodd, 20px 20px",
|
||||
|
||||
"circle(",
|
||||
"circle(40% at 50% 100%",
|
||||
"ellipse(",
|
||||
"ellipse(40% at 50% 100%",
|
||||
|
||||
"inset(1px",
|
||||
"inset(1px 2px",
|
||||
"inset(1px 2px 3px",
|
||||
"inset(1px 2px 3px 4px",
|
||||
"inset(1px 2px 3px 4px round 5px",
|
||||
"inset(1px 2px 3px 4px round 5px / 6px",
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -23,11 +23,11 @@ nsCSSClipPathInstance::ApplyBasicShapeClip(gfxContext& aContext,
|
||||
nsIFrame* aFrame)
|
||||
{
|
||||
auto& clipPathStyle = aFrame->StyleSVGReset()->mClipPath;
|
||||
StyleShapeSourceType type = clipPathStyle.GetType();
|
||||
MOZ_ASSERT(type != StyleShapeSourceType::None_, "unexpected none value");
|
||||
StyleClipPathType type = clipPathStyle.GetType();
|
||||
MOZ_ASSERT(type != StyleClipPathType::None_, "unexpected none value");
|
||||
// In the future nsCSSClipPathInstance may handle <clipPath> references as
|
||||
// well. For the time being return early.
|
||||
if (type == StyleShapeSourceType::URL) {
|
||||
if (type == StyleClipPathType::URL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -44,11 +44,11 @@ nsCSSClipPathInstance::HitTestBasicShapeClip(nsIFrame* aFrame,
|
||||
const gfxPoint& aPoint)
|
||||
{
|
||||
auto& clipPathStyle = aFrame->StyleSVGReset()->mClipPath;
|
||||
StyleShapeSourceType type = clipPathStyle.GetType();
|
||||
MOZ_ASSERT(type != StyleShapeSourceType::None_, "unexpected none value");
|
||||
StyleClipPathType type = clipPathStyle.GetType();
|
||||
MOZ_ASSERT(type != StyleClipPathType::None_, "unexpected none value");
|
||||
// In the future nsCSSClipPathInstance may handle <clipPath> references as
|
||||
// well. For the time being return early.
|
||||
if (type == StyleShapeSourceType::URL) {
|
||||
if (type == StyleClipPathType::URL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -67,21 +67,21 @@ nsCSSClipPathInstance::CreateClipPath(DrawTarget* aDrawTarget)
|
||||
{
|
||||
nsRect r;
|
||||
// XXXkrit SVG needs to use different boxes.
|
||||
switch (mClipPathStyle.GetReferenceBox()) {
|
||||
case StyleClipPathGeometryBox::Content:
|
||||
switch (mClipPathStyle.GetSizingBox()) {
|
||||
case StyleClipShapeSizing::Content:
|
||||
r = mTargetFrame->GetContentRectRelativeToSelf();
|
||||
break;
|
||||
case StyleClipPathGeometryBox::Padding:
|
||||
case StyleClipShapeSizing::Padding:
|
||||
r = mTargetFrame->GetPaddingRectRelativeToSelf();
|
||||
break;
|
||||
case StyleClipPathGeometryBox::Margin:
|
||||
case StyleClipShapeSizing::Margin:
|
||||
r = mTargetFrame->GetMarginRectRelativeToSelf();
|
||||
break;
|
||||
default: // Use the border box
|
||||
r = mTargetFrame->GetRectRelativeToSelf();
|
||||
}
|
||||
|
||||
if (mClipPathStyle.GetType() != StyleShapeSourceType::Shape) {
|
||||
if (mClipPathStyle.GetType() != StyleClipPathType::Shape) {
|
||||
// TODO Clip to border-radius/reference box if no shape
|
||||
// was specified.
|
||||
RefPtr<PathBuilder> builder = aDrawTarget->CreatePathBuilder();
|
||||
@ -92,15 +92,15 @@ nsCSSClipPathInstance::CreateClipPath(DrawTarget* aDrawTarget)
|
||||
mTargetFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
r = ToAppUnits(r.ToNearestPixels(appUnitsPerDevPixel), appUnitsPerDevPixel);
|
||||
|
||||
StyleBasicShape* basicShape = mClipPathStyle.GetBasicShape();
|
||||
nsStyleBasicShape* basicShape = mClipPathStyle.GetBasicShape();
|
||||
switch (basicShape->GetShapeType()) {
|
||||
case StyleBasicShapeType::Circle:
|
||||
case nsStyleBasicShape::Type::eCircle:
|
||||
return CreateClipPathCircle(aDrawTarget, r);
|
||||
case StyleBasicShapeType::Ellipse:
|
||||
case nsStyleBasicShape::Type::eEllipse:
|
||||
return CreateClipPathEllipse(aDrawTarget, r);
|
||||
case StyleBasicShapeType::Polygon:
|
||||
case nsStyleBasicShape::Type::ePolygon:
|
||||
return CreateClipPathPolygon(aDrawTarget, r);
|
||||
case StyleBasicShapeType::Inset:
|
||||
case nsStyleBasicShape::Type::eInset:
|
||||
// XXXkrit support all basic shapes
|
||||
break;
|
||||
default:
|
||||
@ -134,7 +134,7 @@ already_AddRefed<Path>
|
||||
nsCSSClipPathInstance::CreateClipPathCircle(DrawTarget* aDrawTarget,
|
||||
const nsRect& aRefBox)
|
||||
{
|
||||
StyleBasicShape* basicShape = mClipPathStyle.GetBasicShape();
|
||||
nsStyleBasicShape* basicShape = mClipPathStyle.GetBasicShape();
|
||||
|
||||
RefPtr<PathBuilder> builder = aDrawTarget->CreatePathBuilder();
|
||||
|
||||
@ -177,7 +177,7 @@ already_AddRefed<Path>
|
||||
nsCSSClipPathInstance::CreateClipPathEllipse(DrawTarget* aDrawTarget,
|
||||
const nsRect& aRefBox)
|
||||
{
|
||||
StyleBasicShape* basicShape = mClipPathStyle.GetBasicShape();
|
||||
nsStyleBasicShape* basicShape = mClipPathStyle.GetBasicShape();
|
||||
|
||||
RefPtr<PathBuilder> builder = aDrawTarget->CreatePathBuilder();
|
||||
|
||||
@ -217,7 +217,7 @@ already_AddRefed<Path>
|
||||
nsCSSClipPathInstance::CreateClipPathPolygon(DrawTarget* aDrawTarget,
|
||||
const nsRect& aRefBox)
|
||||
{
|
||||
StyleBasicShape* basicShape = mClipPathStyle.GetBasicShape();
|
||||
nsStyleBasicShape* basicShape = mClipPathStyle.GetBasicShape();
|
||||
const nsTArray<nsStyleCoord>& coords = basicShape->Coordinates();
|
||||
MOZ_ASSERT(coords.Length() % 2 == 0 &&
|
||||
coords.Length() >= 2, "wrong number of arguments");
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
const gfxPoint& aPoint);
|
||||
private:
|
||||
explicit nsCSSClipPathInstance(nsIFrame* aFrame,
|
||||
const StyleClipPath aClipPathStyle)
|
||||
const nsStyleClipPath aClipPathStyle)
|
||||
: mTargetFrame(aFrame)
|
||||
, mClipPathStyle(aClipPathStyle)
|
||||
{
|
||||
@ -49,7 +49,7 @@ private:
|
||||
* The frame for the element that is currently being clipped.
|
||||
*/
|
||||
nsIFrame* mTargetFrame;
|
||||
StyleClipPath mClipPathStyle;
|
||||
nsStyleClipPath mClipPathStyle;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -579,7 +579,7 @@ nsSVGEffects::GetEffectProperties(nsIFrame* aFrame)
|
||||
|
||||
result.mFilter = GetOrCreateFilterProperty(aFrame);
|
||||
|
||||
if (style->mClipPath.GetType() == StyleShapeSourceType::URL) {
|
||||
if (style->mClipPath.GetType() == StyleClipPathType::URL) {
|
||||
nsCOMPtr<nsIURI> pathURI = nsSVGEffects::GetClipPathURI(aFrame);
|
||||
result.mClipPath =
|
||||
GetPaintingProperty(pathURI, aFrame, ClipPathProperty());
|
||||
@ -929,7 +929,7 @@ already_AddRefed<nsIURI>
|
||||
nsSVGEffects::GetClipPathURI(nsIFrame* aFrame)
|
||||
{
|
||||
const nsStyleSVGReset* svgResetStyle = aFrame->StyleSVGReset();
|
||||
MOZ_ASSERT(svgResetStyle->mClipPath.GetType() == StyleShapeSourceType::URL);
|
||||
MOZ_ASSERT(svgResetStyle->mClipPath.GetType() == StyleClipPathType::URL);
|
||||
|
||||
FragmentOrURL* url = svgResetStyle->mClipPath.GetURL();
|
||||
return ResolveFragmentOrURL(aFrame, url);
|
||||
|
@ -2603,9 +2603,6 @@ pref("layout.css.scroll-behavior.damping-ratio", "1.0");
|
||||
// Is support for scroll-snap enabled?
|
||||
pref("layout.css.scroll-snap.enabled", true);
|
||||
|
||||
// Is support for CSS shape-outside enabled?
|
||||
pref("layout.css.shape-outside.enabled", false);
|
||||
|
||||
// Is support for document.fonts enabled?
|
||||
pref("layout.css.font-loading-api.enabled", true);
|
||||
|
||||
|
@ -176,9 +176,6 @@ user_pref("layout.css.prefixes.webkit", true);
|
||||
// Enable -webkit-{min|max}-device-pixel-ratio media queries for testing
|
||||
user_pref("layout.css.prefixes.device-pixel-ratio-webkit", true);
|
||||
|
||||
// Enable CSS shape-outside for testing
|
||||
user_pref("layout.css.shape-outside.enabled", true);
|
||||
|
||||
// Disable spammy layout warnings because they pollute test logs
|
||||
user_pref("layout.spammy_warnings.enabled", false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user