summaryrefslogtreecommitdiffstats
path: root/layout/style/nsComputedDOMStyle.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-02-03 08:34:51 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-02-03 08:34:51 +0100
commit23f587278abc939b5499e51863e3e63619be8a95 (patch)
tree94d51331f38585695339742e26c0b1498d32abaf /layout/style/nsComputedDOMStyle.cpp
parent9a8a050294414a7d248a4ec872744b43e1b9bfb1 (diff)
parent4874970d329943e08bcca7c61e7b7d2bc0f7c9d3 (diff)
downloadUXP-23f587278abc939b5499e51863e3e63619be8a95.tar
UXP-23f587278abc939b5499e51863e3e63619be8a95.tar.gz
UXP-23f587278abc939b5499e51863e3e63619be8a95.tar.lz
UXP-23f587278abc939b5499e51863e3e63619be8a95.tar.xz
UXP-23f587278abc939b5499e51863e3e63619be8a95.zip
Merge branch 'master' of https://github.com/MoonchildProductions/UXP
Diffstat (limited to 'layout/style/nsComputedDOMStyle.cpp')
-rw-r--r--layout/style/nsComputedDOMStyle.cpp60
1 files changed, 29 insertions, 31 deletions
diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp
index 6c846ed94..65c1d698c 100644
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -74,6 +74,30 @@ NS_NewComputedDOMStyle(dom::Element* aElement, const nsAString& aPseudoElt,
return computedStyle.forget();
}
+static nsDOMCSSValueList*
+GetROCSSValueList(bool aCommaDelimited)
+{
+ return new nsDOMCSSValueList(aCommaDelimited, true);
+}
+
+template<typename T>
+already_AddRefed<CSSValue>
+GetBackgroundList(T nsStyleImageLayers::Layer::* aMember,
+ uint32_t nsStyleImageLayers::* aCount,
+ const nsStyleImageLayers& aLayers,
+ const KTableEntry aTable[])
+{
+ RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(true);
+
+ for (uint32_t i = 0, i_end = aLayers.*aCount; i < i_end; ++i) {
+ RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
+ val->SetIdent(nsCSSProps::ValueToKeywordEnum(aLayers.mLayers[i].*aMember, aTable));
+ valueList->AppendCSSValue(val.forget());
+ }
+
+ return valueList.forget();
+}
+
/**
* An object that represents the ordered set of properties that are exposed on
* an nsComputedDOMStyle object and how their computed values can be obtained.
@@ -1802,24 +1826,6 @@ nsComputedDOMStyle::DoGetFontVariantPosition()
}
already_AddRefed<CSSValue>
-nsComputedDOMStyle::GetBackgroundList(uint8_t nsStyleImageLayers::Layer::* aMember,
- uint32_t nsStyleImageLayers::* aCount,
- const nsStyleImageLayers& aLayers,
- const KTableEntry aTable[])
-{
- RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(true);
-
- for (uint32_t i = 0, i_end = aLayers.*aCount; i < i_end; ++i) {
- RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
- val->SetIdent(nsCSSProps::ValueToKeywordEnum(aLayers.mLayers[i].*aMember,
- aTable));
- valueList->AppendCSSValue(val.forget());
- }
-
- return valueList.forget();
-}
-
-already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetBackgroundAttachment()
{
return GetBackgroundList(&nsStyleImageLayers::Layer::mAttachment,
@@ -2366,7 +2372,7 @@ nsComputedDOMStyle::DoGetBackgroundOrigin()
return GetBackgroundList(&nsStyleImageLayers::Layer::mOrigin,
&nsStyleImageLayers::mOriginCount,
StyleBackground()->mImage,
- nsCSSProps::kImageLayerOriginKTable);
+ nsCSSProps::kBackgroundOriginKTable);
}
void
@@ -5012,12 +5018,6 @@ nsComputedDOMStyle::DoGetTop()
return GetOffsetWidthFor(NS_SIDE_TOP);
}
-nsDOMCSSValueList*
-nsComputedDOMStyle::GetROCSSValueList(bool aCommaDelimited)
-{
- return new nsDOMCSSValueList(aCommaDelimited, true);
-}
-
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide)
{
@@ -6179,8 +6179,8 @@ nsComputedDOMStyle::DoGetMask()
// need to support computed style for the cases where it used to be
// a longhand.
if (svg->mMask.mImageCount > 1 ||
- firstLayer.mClip != NS_STYLE_IMAGELAYER_CLIP_BORDER ||
- firstLayer.mOrigin != NS_STYLE_IMAGELAYER_ORIGIN_BORDER ||
+ firstLayer.mClip != StyleGeometryBox::Border ||
+ firstLayer.mOrigin != StyleGeometryBox::Border ||
firstLayer.mComposite != NS_STYLE_MASK_COMPOSITE_ADD ||
firstLayer.mMaskMode != NS_STYLE_MASK_MODE_MATCH_SOURCE ||
!nsStyleImageLayers::IsInitialPositionForLayerType(
@@ -6199,14 +6199,13 @@ nsComputedDOMStyle::DoGetMask()
return val.forget();
}
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetMaskClip()
{
return GetBackgroundList(&nsStyleImageLayers::Layer::mClip,
&nsStyleImageLayers::mClipCount,
StyleSVGReset()->mMask,
- nsCSSProps::kImageLayerOriginKTable);
+ nsCSSProps::kMaskClipKTable);
}
already_AddRefed<CSSValue>
@@ -6240,7 +6239,7 @@ nsComputedDOMStyle::DoGetMaskOrigin()
return GetBackgroundList(&nsStyleImageLayers::Layer::mOrigin,
&nsStyleImageLayers::mOriginCount,
StyleSVGReset()->mMask,
- nsCSSProps::kImageLayerOriginKTable);
+ nsCSSProps::kMaskOriginKTable);
}
already_AddRefed<CSSValue>
@@ -6277,7 +6276,6 @@ nsComputedDOMStyle::DoGetMaskSize()
const nsStyleImageLayers& layers = StyleSVGReset()->mMask;
return DoGetImageLayerSize(layers);
}
-#endif
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetMaskType()