--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -619,23 +619,16 @@ PropertySupportsVariant(nsCSSPropertyID
case eCSSProperty__moz_outline_radius_topleft:
case eCSSProperty__moz_outline_radius_topright:
case eCSSProperty__moz_outline_radius_bottomleft:
case eCSSProperty__moz_outline_radius_bottomright:
case eCSSProperty__moz_window_transform_origin:
supported = VARIANT_LP;
break;
- case eCSSProperty__moz_border_bottom_colors:
- case eCSSProperty__moz_border_left_colors:
- case eCSSProperty__moz_border_right_colors:
- case eCSSProperty__moz_border_top_colors:
- supported = VARIANT_COLOR;
- break;
-
case eCSSProperty_text_shadow:
case eCSSProperty_box_shadow:
supported = VARIANT_LENGTH | VARIANT_COLOR;
break;
case eCSSProperty_border_spacing:
supported = VARIANT_LENGTH;
break;
--- a/layout/reftests/first-line/border-not-apply.html
+++ b/layout/reftests/first-line/border-not-apply.html
@@ -5,17 +5,13 @@
p::first-line {
/* specify all the properties in nsStyleBorder */
border-inline-start: medium solid red ! important;
border-inline-end: medium solid red ! important;
border: medium solid red ! important;
border-image: none ! important;
-moz-float-edge: content-box ! important;
border-radius: 0 ! important;
- -moz-border-top-colors: none ! important;
- -moz-border-right-colors: none ! important;
- -moz-border-bottom-colors: none ! important;
- -moz-border-left-colors: none ! important;
box-shadow: none ! important;
}
</style>
<p>Hello</p>
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1211,22 +1211,16 @@ Gecko_AtomEqualsUTF8IgnoreCase(nsAtom* a
// XXXbholley: We should be able to do this without converting, I just can't
// find the right thing to call.
nsDependentAtomString atomStr(aAtom);
NS_ConvertUTF8toUTF16 inStr(nsDependentCSubstring(aString, aLength));
return nsContentUtils::EqualsIgnoreASCIICase(atomStr, inStr);
}
void
-Gecko_EnsureMozBorderColors(nsStyleBorder* aBorder)
-{
- aBorder->EnsureBorderColors();
-}
-
-void
Gecko_nsTArray_FontFamilyName_AppendNamed(nsTArray<FontFamilyName>* aNames,
nsAtom* aName,
bool aQuoted)
{
FontFamilyName family;
aName->ToString(family.mName);
if (aQuoted) {
family.mType = eFamily_named_quoted;
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -287,19 +287,16 @@ void Gecko_StyleTransition_SetUnsupporte
nsAtom* Gecko_Atomize(const char* aString, uint32_t aLength);
nsAtom* Gecko_Atomize16(const nsAString* aString);
void Gecko_AddRefAtom(nsAtom* aAtom);
void Gecko_ReleaseAtom(nsAtom* aAtom);
const uint16_t* Gecko_GetAtomAsUTF16(nsAtom* aAtom, uint32_t* aLength);
bool Gecko_AtomEqualsUTF8(nsAtom* aAtom, const char* aString, uint32_t aLength);
bool Gecko_AtomEqualsUTF8IgnoreCase(nsAtom* aAtom, const char* aString, uint32_t aLength);
-// Border style
-void Gecko_EnsureMozBorderColors(nsStyleBorder* aBorder);
-
// Font style
void Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src);
void Gecko_nsTArray_FontFamilyName_AppendNamed(nsTArray<FontFamilyName>* aNames, nsAtom* aName, bool aQuoted);
void Gecko_nsTArray_FontFamilyName_AppendGeneric(nsTArray<FontFamilyName>* aNames, FontFamilyType aType);
// Returns an already-AddRefed SharedFontList with an empty mNames array.
SharedFontList* Gecko_SharedFontList_Create();
size_t Gecko_SharedFontList_SizeOfIncludingThis(SharedFontList* fontlist);
size_t Gecko_SharedFontList_SizeOfIncludingThisIfUnshared(SharedFontList* fontlist);
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -784,17 +784,16 @@ protected:
// the 'background-position' property.
bool ParsePositionValue(nsCSSValue& aOut);
bool ParsePositionValueSeparateCoords(nsCSSValue& aOutX, nsCSSValue& aOutY);
bool ParseImageLayerPositionCoordItem(nsCSSValue& aOut, bool aIsHorizontal);
bool ParseImageLayerSize(nsCSSPropertyID aPropID);
bool ParseImageLayerSizeValues(nsCSSValuePair& aOut);
bool ParseBorderColor();
- bool ParseBorderColors(nsCSSPropertyID aProperty);
void SetBorderImageInitialValues();
bool ParseBorderImageRepeat(bool aAcceptsInherit);
// If ParseBorderImageSlice returns false, aConsumedTokens indicates
// whether or not any tokens were consumed (in other words, was the property
// in error or just not present). If ParseBorderImageSlice returns true
// aConsumedTokens is always true.
bool ParseBorderImageSlice(bool aAcceptsInherit, bool* aConsumedTokens);
bool ParseBorderImageWidth(bool aAcceptsInherit);
@@ -11656,21 +11655,16 @@ CSSParserImpl::ParsePropertyByFunction(n
case eCSSProperty_border_inline_start:
return ParseBorderSide(kBorderInlineStartIDs, false);
case eCSSProperty_border_left:
return ParseBorderSide(kBorderLeftIDs, false);
case eCSSProperty_border_right:
return ParseBorderSide(kBorderRightIDs, false);
case eCSSProperty_border_top:
return ParseBorderSide(kBorderTopIDs, false);
- case eCSSProperty__moz_border_bottom_colors:
- case eCSSProperty__moz_border_left_colors:
- case eCSSProperty__moz_border_right_colors:
- case eCSSProperty__moz_border_top_colors:
- return ParseBorderColors(aPropID);
case eCSSProperty_border_image_slice:
return ParseBorderImageSlice(true, nullptr);
case eCSSProperty_border_image_width:
return ParseBorderImageWidth(true);
case eCSSProperty_border_image_outset:
return ParseBorderImageOutset(true);
case eCSSProperty_border_image_repeat:
return ParseBorderImageRepeat(true);
@@ -13488,40 +13482,16 @@ CSSParserImpl::ParseBorderStyle()
}
bool
CSSParserImpl::ParseBorderWidth()
{
return ParseBoxProperties(kBorderWidthIDs);
}
-bool
-CSSParserImpl::ParseBorderColors(nsCSSPropertyID aProperty)
-{
- nsCSSValue value;
- // 'inherit', 'initial', 'unset' and 'none' are only allowed on their own
- if (!ParseSingleTokenVariant(value, VARIANT_INHERIT | VARIANT_NONE,
- nullptr)) {
- nsCSSValueList *cur = value.SetListValue();
- for (;;) {
- if (ParseVariant(cur->mValue, VARIANT_COLOR, nullptr) !=
- CSSParseResult::Ok) {
- return false;
- }
- if (CheckEndProperty()) {
- break;
- }
- cur->mNext = new nsCSSValueList;
- cur = cur->mNext;
- }
- }
- AppendValue(aProperty, value);
- return true;
-}
-
// Parse the top level of a calc() expression.
bool
CSSParserImpl::ParseCalc(nsCSSValue &aValue, uint32_t aVariantMask)
{
// Parsing calc expressions requires, in a number of cases, looking
// for a token that is *either* a value of the property or a number.
// This can be done without lookahead when we assume that the property
// values cannot themselves be numbers.
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -788,32 +788,16 @@ CSS_PROP_BORDER(
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
"",
VARIANT_HC,
nullptr,
offsetof(nsStyleBorder, mBorderBottomColor),
eStyleAnimType_ComplexColor)
-#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
-CSS_PROP_BORDER(
- -moz-border-bottom-colors,
- _moz_border_bottom_colors,
- CSS_PROP_DOMPROP_PREFIXED(BorderBottomColors),
- CSS_PROPERTY_PARSE_FUNCTION |
- CSS_PROPERTY_INTERNAL |
- CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME |
- CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
- CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
- "",
- 0,
- nullptr,
- CSS_PROP_NO_OFFSET,
- eStyleAnimType_Discrete)
-#endif
CSS_PROP_BORDER(
border-bottom-left-radius,
border_bottom_left_radius,
BorderBottomLeftRadius,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC,
@@ -1056,32 +1040,16 @@ CSS_PROP_BORDER(
CSS_PROPERTY_HASHLESS_COLOR_QUIRK |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
"",
VARIANT_HC,
nullptr,
offsetof(nsStyleBorder, mBorderLeftColor),
eStyleAnimType_ComplexColor)
-#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
-CSS_PROP_BORDER(
- -moz-border-left-colors,
- _moz_border_left_colors,
- CSS_PROP_DOMPROP_PREFIXED(BorderLeftColors),
- CSS_PROPERTY_PARSE_FUNCTION |
- CSS_PROPERTY_INTERNAL |
- CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME |
- CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
- CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
- "",
- 0,
- nullptr,
- CSS_PROP_NO_OFFSET,
- eStyleAnimType_Discrete)
-#endif
CSS_PROP_BORDER(
border-left-style,
border_left_style,
BorderLeftStyle,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
"",
VARIANT_HK,
@@ -1122,32 +1090,16 @@ CSS_PROP_BORDER(
CSS_PROPERTY_HASHLESS_COLOR_QUIRK |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
"",
VARIANT_HC,
nullptr,
offsetof(nsStyleBorder, mBorderRightColor),
eStyleAnimType_ComplexColor)
-#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
-CSS_PROP_BORDER(
- -moz-border-right-colors,
- _moz_border_right_colors,
- CSS_PROP_DOMPROP_PREFIXED(BorderRightColors),
- CSS_PROPERTY_PARSE_FUNCTION |
- CSS_PROPERTY_INTERNAL |
- CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME |
- CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
- CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
- "",
- 0,
- nullptr,
- CSS_PROP_NO_OFFSET,
- eStyleAnimType_Discrete)
-#endif
CSS_PROP_BORDER(
border-right-style,
border_right_style,
BorderRightStyle,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
"",
VARIANT_HK,
@@ -1200,32 +1152,16 @@ CSS_PROP_BORDER(
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
"",
VARIANT_HC,
nullptr,
offsetof(nsStyleBorder, mBorderTopColor),
eStyleAnimType_ComplexColor)
-#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
-CSS_PROP_BORDER(
- -moz-border-top-colors,
- _moz_border_top_colors,
- CSS_PROP_DOMPROP_PREFIXED(BorderTopColors),
- CSS_PROPERTY_PARSE_FUNCTION |
- CSS_PROPERTY_INTERNAL |
- CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME |
- CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
- CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
- "",
- 0,
- nullptr,
- CSS_PROP_NO_OFFSET,
- eStyleAnimType_Discrete)
-#endif
CSS_PROP_BORDER(
border-top-left-radius,
border_top_left_radius,
BorderTopLeftRadius,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
CSS_PROPERTY_VALUE_NONNEGATIVE |
CSS_PROPERTY_STORES_CALC,
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -3465,41 +3465,16 @@ nsComputedDOMStyle::DoGetBorderLeftStyle
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetBorderRightStyle()
{
return GetBorderStyleFor(eSideRight);
}
already_AddRefed<CSSValue>
-nsComputedDOMStyle::DoGetBorderBottomColors()
-{
- return GetBorderColorsFor(eSideBottom);
-}
-
-already_AddRefed<CSSValue>
-nsComputedDOMStyle::DoGetBorderLeftColors()
-{
- return GetBorderColorsFor(eSideLeft);
-}
-
-already_AddRefed<CSSValue>
-nsComputedDOMStyle::DoGetBorderRightColors()
-{
- return GetBorderColorsFor(eSideRight);
-}
-
-
-already_AddRefed<CSSValue>
-nsComputedDOMStyle::DoGetBorderTopColors()
-{
- return GetBorderColorsFor(eSideTop);
-}
-
-already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetBorderBottomLeftRadius()
{
return GetEllipseRadii(StyleBorder()->mBorderRadius,
eCornerBottomLeft);
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetBorderBottomRightRadius()
@@ -5649,39 +5624,16 @@ nsComputedDOMStyle::GetLineHeightCoord(n
fCoord = fCoord * (float(font->mSize) / float(font->mFont.size));
}
aCoord = NSToCoordRound(fCoord);
return true;
}
already_AddRefed<CSSValue>
-nsComputedDOMStyle::GetBorderColorsFor(mozilla::Side aSide)
-{
- const nsStyleBorder *border = StyleBorder();
-
- if (border->mBorderColors) {
- const nsTArray<nscolor>& borderColors = (*border->mBorderColors)[aSide];
- if (!borderColors.IsEmpty()) {
- RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
- for (nscolor color : borderColors) {
- RefPtr<nsROCSSPrimitiveValue> primitive = new nsROCSSPrimitiveValue;
- SetToRGBAColor(primitive, color);
- valueList->AppendCSSValue(primitive.forget());
- }
- return valueList.forget();
- }
- }
-
- RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
- val->SetIdent(eCSSKeyword_none);
- return val.forget();
-}
-
-already_AddRefed<CSSValue>
nsComputedDOMStyle::GetBorderWidthFor(mozilla::Side aSide)
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
nscoord width;
if (mInnerFrame) {
AssertFlushedPendingReflows();
width = mInnerFrame->GetUsedBorder().Side(aSide);
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -206,18 +206,16 @@ private:
already_AddRefed<CSSValue> GetRelativeOffset(mozilla::Side aSide);
already_AddRefed<CSSValue> GetStickyOffset(mozilla::Side aSide);
already_AddRefed<CSSValue> GetStaticOffset(mozilla::Side aSide);
already_AddRefed<CSSValue> GetPaddingWidthFor(mozilla::Side aSide);
- already_AddRefed<CSSValue> GetBorderColorsFor(mozilla::Side aSide);
-
already_AddRefed<CSSValue> GetBorderStyleFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetBorderWidthFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetBorderColorFor(mozilla::Side aSide);
already_AddRefed<CSSValue> GetMarginWidthFor(mozilla::Side aSide);
@@ -389,20 +387,16 @@ private:
already_AddRefed<CSSValue> DoGetBorderTopWidth();
already_AddRefed<CSSValue> DoGetBorderBottomWidth();
already_AddRefed<CSSValue> DoGetBorderLeftWidth();
already_AddRefed<CSSValue> DoGetBorderRightWidth();
already_AddRefed<CSSValue> DoGetBorderTopColor();
already_AddRefed<CSSValue> DoGetBorderBottomColor();
already_AddRefed<CSSValue> DoGetBorderLeftColor();
already_AddRefed<CSSValue> DoGetBorderRightColor();
- already_AddRefed<CSSValue> DoGetBorderBottomColors();
- already_AddRefed<CSSValue> DoGetBorderLeftColors();
- already_AddRefed<CSSValue> DoGetBorderRightColors();
- already_AddRefed<CSSValue> DoGetBorderTopColors();
already_AddRefed<CSSValue> DoGetBorderBottomLeftRadius();
already_AddRefed<CSSValue> DoGetBorderBottomRightRadius();
already_AddRefed<CSSValue> DoGetBorderTopLeftRadius();
already_AddRefed<CSSValue> DoGetBorderTopRightRadius();
already_AddRefed<CSSValue> DoGetFloatEdge();
/* Border Image */
already_AddRefed<CSSValue> DoGetBorderImageSource();
--- a/layout/style/nsComputedDOMStylePropertyList.h
+++ b/layout/style/nsComputedDOMStylePropertyList.h
@@ -276,20 +276,16 @@ COMPUTED_STYLE_PROP(writing_mode,
COMPUTED_STYLE_PROP(z_index, ZIndex)
/* ******************************* *\
* Implementations of -moz- styles *
\* ******************************* */
COMPUTED_STYLE_PROP(_moz_appearance, Appearance)
COMPUTED_STYLE_PROP(_moz_binding, Binding)
-COMPUTED_STYLE_PROP(_moz_border_bottom_colors, BorderBottomColors)
-COMPUTED_STYLE_PROP(_moz_border_left_colors, BorderLeftColors)
-COMPUTED_STYLE_PROP(_moz_border_right_colors, BorderRightColors)
-COMPUTED_STYLE_PROP(_moz_border_top_colors, BorderTopColors)
COMPUTED_STYLE_PROP(_moz_box_align, BoxAlign)
COMPUTED_STYLE_PROP(_moz_box_direction, BoxDirection)
COMPUTED_STYLE_PROP(_moz_box_flex, BoxFlex)
COMPUTED_STYLE_PROP(_moz_box_ordinal_group, BoxOrdinalGroup)
COMPUTED_STYLE_PROP(_moz_box_orient, BoxOrient)
COMPUTED_STYLE_PROP(_moz_box_pack, BoxPack)
COMPUTED_STYLE_PROP(_moz_context_properties, ContextProperties)
COMPUTED_STYLE_PROP(_moz_float_edge, FloatEdge)
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -7419,74 +7419,16 @@ nsRuleNode::ComputeBorderData(void* aSta
}
else if (eCSSUnit_Inherit == unit) {
conditions.SetUncacheable();
border->SetBorderStyle(side, parentBorder->GetBorderStyle(side));
}
}
}
- // -moz-border-*-colors: color, string, enum, none, inherit/initial
- nscolor borderColor;
- nscolor unused = NS_RGB(0,0,0);
-
- static const nsCSSPropertyID borderColorsProps[] = {
- eCSSProperty__moz_border_top_colors,
- eCSSProperty__moz_border_right_colors,
- eCSSProperty__moz_border_bottom_colors,
- eCSSProperty__moz_border_left_colors
- };
-
- NS_FOR_CSS_SIDES(side) {
- const nsCSSValue& value = *aRuleData->ValueFor(borderColorsProps[side]);
- switch (value.GetUnit()) {
- case eCSSUnit_Null:
- break;
-
- case eCSSUnit_Initial:
- case eCSSUnit_Unset:
- case eCSSUnit_None:
- border->ClearBorderColors(side);
- break;
-
- case eCSSUnit_Inherit: {
- conditions.SetUncacheable();
- border->ClearBorderColors(side);
- if (parentBorder->mBorderColors) {
- border->EnsureBorderColors();
- border->mBorderColors->mColors[side] =
- parentBorder->mBorderColors->mColors[side];
- }
- break;
- }
-
- case eCSSUnit_List:
- case eCSSUnit_ListDep: {
- // Some composite border color information has been specified for this
- // border side.
- border->EnsureBorderColors();
- border->ClearBorderColors(side);
- const nsCSSValueList* list = value.GetListValue();
- while (list) {
- if (SetColor(list->mValue, unused, mPresContext,
- aContext, borderColor, conditions))
- border->mBorderColors->mColors[side].AppendElement(borderColor);
- else {
- NS_NOTREACHED("unexpected item in -moz-border-*-colors list");
- }
- list = list->mNext;
- }
- break;
- }
-
- default:
- MOZ_ASSERT(false, "unrecognized border color unit");
- }
- }
-
// border-color, border-*-color: color, string, enum, inherit
{
const nsCSSPropertyID* subprops =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_color);
NS_FOR_CSS_SIDES(side) {
SetComplexColor<eUnsetInitial>(*aRuleData->ValueFor(subprops[side]),
parentBorder->mBorderColor[side],
StyleComplexColor::CurrentColor(),
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -375,20 +375,16 @@ nsStyleBorder::nsStyleBorder(const nsSty
, mBorderImageRepeatV(aSrc.mBorderImageRepeatV)
, mFloatEdge(aSrc.mFloatEdge)
, mBoxDecorationBreak(aSrc.mBoxDecorationBreak)
, mComputedBorder(aSrc.mComputedBorder)
, mBorder(aSrc.mBorder)
, mTwipsPerPixel(aSrc.mTwipsPerPixel)
{
MOZ_COUNT_CTOR(nsStyleBorder);
- if (aSrc.mBorderColors) {
- mBorderColors.reset(new nsBorderColors(*aSrc.mBorderColors));
- }
-
NS_FOR_CSS_SIDES(side) {
mBorderStyle[side] = aSrc.mBorderStyle[side];
mBorderColor[side] = aSrc.mBorderColor[side];
}
}
nsStyleBorder::~nsStyleBorder()
{
@@ -476,18 +472,17 @@ nsStyleBorder::CalcDifference(const nsSt
// style or the color flags differ we want to repaint.
NS_FOR_CSS_SIDES(ix) {
if (mBorderStyle[ix] != aNewData.mBorderStyle[ix] ||
mBorderColor[ix] != aNewData.mBorderColor[ix]) {
return nsChangeHint_RepaintFrame;
}
}
- if (mBorderRadius != aNewData.mBorderRadius ||
- !mBorderColors != !aNewData.mBorderColors) {
+ if (mBorderRadius != aNewData.mBorderRadius) {
return nsChangeHint_RepaintFrame;
}
// Loading status of the border image can be accessed in main thread only
// while CalcDifference might be executed on a background thread. As a
// result, we have to check mBorderImage* fields even before border image was
// actually loaded.
if (!mBorderImageSource.IsEmpty() || !aNewData.mBorderImageSource.IsEmpty()) {
@@ -496,26 +491,16 @@ nsStyleBorder::CalcDifference(const nsSt
mBorderImageRepeatV != aNewData.mBorderImageRepeatV ||
mBorderImageSlice != aNewData.mBorderImageSlice ||
mBorderImageFill != aNewData.mBorderImageFill ||
mBorderImageWidth != aNewData.mBorderImageWidth) {
return nsChangeHint_RepaintFrame;
}
}
- // Note that at this point if mBorderColors is non-null so is
- // aNewData.mBorderColors
- if (mBorderColors) {
- NS_FOR_CSS_SIDES(side) {
- if ((*mBorderColors)[side] != (*aNewData.mBorderColors)[side]) {
- return nsChangeHint_RepaintFrame;
- }
- }
- }
-
// mBorder is the specified border value. Changes to this don't
// need any change processing, since we operate on the computed
// border values instead.
if (mBorder != aNewData.mBorder) {
return nsChangeHint_NeutralChange;
}
// mBorderImage* fields are checked only when border-image is not 'none'.
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1106,36 +1106,16 @@ private:
// Returns if the given border style type is visible or not
static bool IsVisibleBorderStyle(uint8_t aStyle)
{
return (aStyle != NS_STYLE_BORDER_STYLE_NONE &&
aStyle != NS_STYLE_BORDER_STYLE_HIDDEN);
}
-struct nsBorderColors
-{
- nsBorderColors() = default;
-
- // GCC cannot generate this copy constructor correctly, since nsTArray
- // has explicit copy constructor, and we use array of nsTArray here.
- // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82235
- nsBorderColors(const nsBorderColors& aOther) {
- NS_FOR_CSS_SIDES(side) {
- mColors[side] = aOther.mColors[side];
- }
- }
-
- const nsTArray<nscolor>& operator[](mozilla::Side aSide) const {
- return mColors[aSide];
- }
-
- nsTArray<nscolor> mColors[4];
-};
-
struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder
{
explicit nsStyleBorder(const nsPresContext* aContext);
nsStyleBorder(const nsStyleBorder& aBorder);
~nsStyleBorder();
// Resolves and tracks mBorderImageSource. Only called with a Servo-backed
// style system, where those images must be resolved later than the OMT
@@ -1147,28 +1127,16 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleBorder, sz);
}
void Destroy(nsPresContext* aContext);
nsChangeHint CalcDifference(const nsStyleBorder& aNewData) const;
- void EnsureBorderColors() {
- if (!mBorderColors) {
- mBorderColors.reset(new nsBorderColors);
- }
- }
-
- void ClearBorderColors(mozilla::Side aSide) {
- if (mBorderColors) {
- mBorderColors->mColors[aSide].Clear();
- }
- }
-
// Return whether aStyle is a visible style. Invisible styles cause
// the relevant computed border width to be 0.
// Note that this does *not* consider the effects of 'border-image':
// if border-style is none, but there is a loaded border image,
// HasVisibleStyle will be false even though there *is* a border.
bool HasVisibleStyle(mozilla::Side aSide) const
{
return IsVisibleBorderStyle(mBorderStyle[aSide]);
@@ -1239,18 +1207,16 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
{
if (mBorderImageSource.GetType() == eStyleImageType_Image) {
return mBorderImageSource.GetImageData();
}
return nullptr;
}
public:
- // [reset] composite (stripe) colors
- mozilla::UniquePtr<nsBorderColors> mBorderColors;
nsStyleCorners mBorderRadius; // [reset] coord, percent
nsStyleImage mBorderImageSource; // [reset]
nsStyleSides mBorderImageSlice; // [reset] factor, percent
nsStyleSides mBorderImageWidth; // [reset] length, factor, percent, auto
nsStyleSides mBorderImageOutset; // [reset] length, factor
uint8_t mBorderImageFill; // [reset]
mozilla::StyleBorderImageRepeat mBorderImageRepeatH; // [reset]
--- a/layout/style/test/ListCSSProperties.cpp
+++ b/layout/style/test/ListCSSProperties.cpp
@@ -115,20 +115,16 @@ const char *gInaccessibleProperties[] =
"-moz-math-display", // parsed by UA sheets only
"-moz-top-layer", // parsed by UA sheets only
"-moz-min-font-size-ratio", // parsed by UA sheets only
"-moz-font-smoothing-background-color", // chrome-only internal properties
"-moz-window-opacity", // chrome-only internal properties
"-moz-window-transform", // chrome-only internal properties
"-moz-window-transform-origin", // chrome-only internal properties
"-moz-window-shadow", // chrome-only internal properties
- "-moz-border-top-colors", // chrome-only internal properties
- "-moz-border-bottom-colors", // chrome-only internal properties
- "-moz-border-left-colors", // chrome-only internal properties
- "-moz-border-right-colors" // chrome-only internal properties
};
inline int
is_inaccessible(const char* aPropName)
{
for (unsigned j = 0; j < MOZ_ARRAY_LENGTH(gInaccessibleProperties); ++j) {
if (strcmp(aPropName, gInaccessibleProperties[j]) == 0)
return 1;
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -8297,70 +8297,22 @@ if (false) {
gCSSProperties["-moz-font-smoothing-background-color"] = {
// domProp: "MozFontSmoothingBackgroundColor",
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "transparent" ],
other_values: [ "green", "#fc3" ],
invalid_values: [ "000000", "ff00ff" ]
};
-
- gCSSProperties["-moz-border-bottom-colors"] = {
- domProp: "MozBorderBottomColors",
- inherited: false,
- type: CSS_TYPE_LONGHAND,
- applies_to_first_letter: true,
- initial_values: [ "none" ],
- other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
- invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
- };
-
- gCSSProperties["-moz-border-left-colors"] = {
- domProp: "MozBorderLeftColors",
- inherited: false,
- type: CSS_TYPE_LONGHAND,
- applies_to_first_letter: true,
- initial_values: [ "none" ],
- other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
- invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
- };
-
- gCSSProperties["-moz-border-right-colors"] = {
- domProp: "MozBorderRightColors",
- inherited: false,
- type: CSS_TYPE_LONGHAND,
- applies_to_first_letter: true,
- initial_values: [ "none" ],
- other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
- invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
- };
-
- gCSSProperties["-moz-border-top-colors"] = {
- domProp: "MozBorderTopColors",
- inherited: false,
- type: CSS_TYPE_LONGHAND,
- applies_to_first_letter: true,
- initial_values: [ "none" ],
- other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
- invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
- };
}
if (IsCSSPropertyPrefEnabled("layout.css.unset-value.enabled")) {
gCSSProperties["animation"].invalid_values.push("2s unset");
gCSSProperties["animation-direction"].invalid_values.push("normal, unset", "unset, normal");
gCSSProperties["animation-name"].invalid_values.push("bounce, unset", "unset, bounce");
- if (gCSSProperties["-moz-border-bottom-colors"])
- gCSSProperties["-moz-border-bottom-colors"].invalid_values.push("red unset", "unset red");
- if (gCSSProperties["-moz-border-left-colors"])
- gCSSProperties["-moz-border-left-colors"].invalid_values.push("red unset", "unset red");
- if (gCSSProperties["-moz-border-right-colors"])
- gCSSProperties["-moz-border-right-colors"].invalid_values.push("red unset", "unset red");
- if (gCSSProperties["-moz-border-top-colors"])
- gCSSProperties["-moz-border-top-colors"].invalid_values.push("red unset", "unset red");
gCSSProperties["border-radius"].invalid_values.push("unset 2px", "unset / 2px", "2px unset", "2px / unset");
gCSSProperties["border-bottom-left-radius"].invalid_values.push("unset 2px", "2px unset");
gCSSProperties["border-bottom-right-radius"].invalid_values.push("unset 2px", "2px unset");
gCSSProperties["border-top-left-radius"].invalid_values.push("unset 2px", "2px unset");
gCSSProperties["border-top-right-radius"].invalid_values.push("unset 2px", "2px unset");
gCSSProperties["-moz-outline-radius"].invalid_values.push("unset 2px", "unset / 2px", "2px unset", "2px / unset");
gCSSProperties["-moz-outline-radius-bottomleft"].invalid_values.push("unset 2px", "2px unset");
gCSSProperties["-moz-outline-radius-bottomright"].invalid_values.push("unset 2px", "2px unset");
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -1611,67 +1611,19 @@ fn static_assert() {
"none solid double dotted dashed hidden groove ridge inset outset") %>
<% skip_border_longhands = " ".join(["border-{0}-{1}".format(x.ident, y)
for x in SIDES
for y in ["color", "style", "width"]] +
["border-{0}-radius".format(x.ident.replace("_", "-"))
for x in CORNERS]) %>
-<% skip_moz_border_color_longhands = " ".join("-moz-border-{0}-colors".format(x.ident)
- for x in SIDES) %>
<%self:impl_trait style_struct_name="Border"
skip_longhands="${skip_border_longhands} border-image-source border-image-outset
- border-image-repeat border-image-width border-image-slice
- ${skip_moz_border_color_longhands}">
-
- fn set_moz_border_colors(&mut self, side: structs::Side, v: Option<Vec<::cssparser::RGBA>>) {
- match v {
- None => {
- let ptr = self.gecko.mBorderColors.mPtr;
- if let Some(colors) = unsafe { ptr.as_mut() } {
- unsafe { colors.mColors[side as usize].clear() };
- }
- }
- Some(ref colors) => {
- unsafe { bindings::Gecko_EnsureMozBorderColors(&mut self.gecko) };
- let border_colors = unsafe { self.gecko.mBorderColors.mPtr.as_mut().unwrap() };
- let dest_colors = &mut border_colors.mColors[side as usize];
- unsafe { dest_colors.set_len_pod(colors.len() as u32) };
- for (dst, src) in dest_colors.iter_mut().zip(colors.into_iter()) {
- *dst = convert_rgba_to_nscolor(src);
- }
- }
- }
- }
-
- fn copy_moz_border_colors_from(&mut self, other: &Self, side: structs::Side) {
- if let Some(dest) = unsafe { self.gecko.mBorderColors.mPtr.as_mut() } {
- dest.mColors[side as usize].clear_pod();
- }
- if let Some(src) = unsafe { other.gecko.mBorderColors.mPtr.as_ref() } {
- let src = &src.mColors[side as usize];
- if !src.is_empty() {
- unsafe { bindings::Gecko_EnsureMozBorderColors(&mut self.gecko) };
- let dest = unsafe { self.gecko.mBorderColors.mPtr.as_mut().unwrap() };
- let dest = &mut dest.mColors[side as usize];
- unsafe { dest.set_len_pod(src.len() as u32) };
- dest.copy_from_slice(&src);
- }
- }
- }
-
- fn clone_moz_border_colors(&self, side: structs::Side) -> Option<Vec<::cssparser::RGBA>> {
- unsafe { self.gecko.mBorderColors.mPtr.as_ref() }.map(|colors| {
- colors.mColors[side as usize].iter()
- .map(|color| convert_nscolor_to_rgba(*color))
- .collect()
- })
- }
-
+ border-image-repeat border-image-width border-image-slice">
% for side in SIDES:
<% impl_keyword("border_%s_style" % side.ident,
"mBorderStyle[%s]" % side.index,
border_style_keyword,
on_set="update_border_%s" % side.ident) %>
// This is needed because the initial mComputedBorder value is set to zero.
//
@@ -1708,39 +1660,16 @@ fn static_assert() {
<% impl_non_negative_length("border_%s_width" % side.ident,
"mComputedBorder.%s" % side.ident,
inherit_from="mBorder.%s" % side.ident,
round_to_pixels=True) %>
pub fn border_${side.ident}_has_nonzero_width(&self) -> bool {
self.gecko.mComputedBorder.${side.ident} != 0
}
-
- #[allow(non_snake_case)]
- pub fn set__moz_border_${side.ident}_colors(&mut self,
- v: longhands::_moz_border_${side.ident}_colors::computed_value::T) {
- self.set_moz_border_colors(structs::Side::eSide${to_camel_case(side.ident)}, v.0);
- }
-
- #[allow(non_snake_case)]
- pub fn copy__moz_border_${side.ident}_colors_from(&mut self, other: &Self) {
- self.copy_moz_border_colors_from(other, structs::Side::eSide${to_camel_case(side.ident)});
- }
-
- #[allow(non_snake_case)]
- pub fn reset__moz_border_${side.ident}_colors(&mut self, other: &Self) {
- self.copy__moz_border_${side.ident}_colors_from(other)
- }
-
- #[allow(non_snake_case)]
- pub fn clone__moz_border_${side.ident}_colors(&self)
- -> longhands::_moz_border_${side.ident}_colors::computed_value::T {
- use self::longhands::_moz_border_${side.ident}_colors::computed_value::T;
- T(self.clone_moz_border_colors(structs::Side::eSide${to_camel_case(side.ident)}))
- }
% endfor
% for corner in CORNERS:
<% impl_corner_style_coord("border_%s_radius" % corner.ident,
"mBorderRadius",
corner.x_index,
corner.y_index) %>
% endfor
--- a/servo/components/style/properties/longhand/border.mako.rs
+++ b/servo/components/style/properties/longhand/border.mako.rs
@@ -62,139 +62,16 @@
"computed::BorderCornerRadius::zero()",
"parse", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-backgrounds/#border-%s-radius" % corner,
boxed=True,
flags="APPLIES_TO_FIRST_LETTER",
animation_value_type="BorderCornerRadius")}
% endfor
-/// -moz-border-*-colors: color, string, enum, none, inherit/initial
-/// These non-spec properties are just for Gecko (Stylo) internal use.
-% for side in PHYSICAL_SIDES:
- <%helpers:longhand name="-moz-border-${side}-colors" animation_value_type="discrete"
- spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-border-*-colors)"
- products="gecko"
- flags="APPLIES_TO_FIRST_LETTER"
- enabled_in="chrome"
- ignored_when_colors_disabled="True">
- use std::fmt;
- use style_traits::ToCss;
- use values::specified::RGBAColor;
-
- pub mod computed_value {
- use cssparser::RGBA;
- #[derive(Clone, Debug, MallocSizeOf, PartialEq)]
- pub struct T(pub Option<Vec<RGBA>>);
- }
-
- #[derive(Clone, Debug, MallocSizeOf, PartialEq)]
- pub enum SpecifiedValue {
- None,
- Colors(Vec<RGBAColor>),
- }
-
- impl ToCss for computed_value::T {
- fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
- match self.0 {
- None => return dest.write_str("none"),
- Some(ref vec) => {
- let mut first = true;
- for ref color in vec {
- if !first {
- dest.write_str(" ")?;
- }
- first = false;
- color.to_css(dest)?
- }
- Ok(())
- }
- }
- }
- }
-
- impl ToCss for SpecifiedValue {
- fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
- match *self {
- SpecifiedValue::None => return dest.write_str("none"),
- SpecifiedValue::Colors(ref vec) => {
- let mut first = true;
- for ref color in vec {
- if !first {
- dest.write_str(" ")?;
- }
- first = false;
- color.to_css(dest)?
- }
- Ok(())
- }
- }
- }
- }
-
- #[inline] pub fn get_initial_value() -> computed_value::T {
- computed_value::T(None)
- }
-
- #[inline] pub fn get_initial_specified_value() -> SpecifiedValue {
- SpecifiedValue::None
- }
-
- impl ToComputedValue for SpecifiedValue {
- type ComputedValue = computed_value::T;
-
- #[inline]
- fn to_computed_value(&self, context: &Context) -> computed_value::T {
- match *self {
- SpecifiedValue::Colors(ref vec) => {
- computed_value::T(Some(vec.iter()
- .map(|c| c.to_computed_value(context))
- .collect()))
- },
- SpecifiedValue::None => {
- computed_value::T(None)
- }
- }
- }
- #[inline]
- fn from_computed_value(computed: &computed_value::T) -> Self {
- match *computed {
- computed_value::T(Some(ref vec)) => {
- SpecifiedValue::Colors(vec.iter()
- .map(ToComputedValue::from_computed_value)
- .collect())
- },
- computed_value::T(None) => {
- SpecifiedValue::None
- }
- }
- }
- }
-
- #[inline]
- pub fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
- -> Result<SpecifiedValue, ParseError<'i>> {
- if input.try(|input| input.expect_ident_matching("none")).is_ok() {
- return Ok(SpecifiedValue::None)
- }
-
- let mut result = Vec::new();
- while let Ok(value) = input.try(|i| RGBAColor::parse(context, i)) {
- result.push(value);
- }
-
- if !result.is_empty() {
- Ok(SpecifiedValue::Colors(result))
- } else {
- Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
- }
- }
- </%helpers:longhand>
-% endfor
-
${helpers.single_keyword("box-decoration-break", "slice clone",
gecko_enum_prefix="StyleBoxDecorationBreak",
gecko_pref="layout.css.box-decoration-break.enabled",
spec="https://drafts.csswg.org/css-break/#propdef-box-decoration-break",
products="gecko", animation_value_type="discrete")}
${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
gecko_ffi_name="mFloatEdge",
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -794,20 +794,16 @@ impl LonghandId {
% if property.predefined_type == "RGBAColor":
LonghandId::${property.camel_case} |
% endif
% endfor
LonghandId::BackgroundImage |
LonghandId::BorderImageSource |
LonghandId::BoxShadow |
LonghandId::MaskImage |
- LonghandId::MozBorderBottomColors |
- LonghandId::MozBorderLeftColors |
- LonghandId::MozBorderRightColors |
- LonghandId::MozBorderTopColors |
LonghandId::TextShadow
)
% else:
false
% endif
}
}