summaryrefslogtreecommitdiffstats
path: root/layout/style
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-08-13 12:10:54 +0000
committerMoonchild <moonchild@palemoon.org>2020-08-13 12:10:54 +0000
commit11285cd0d6ef7de80d22187b99376602ed547214 (patch)
tree034c72eea2e7838b08abd00f37acf8e3c9e97949 /layout/style
parente1e535c1c6372f95b4a14b6a00b6d6e7be400c3b (diff)
parentd3383327a749ddb5c0626146c6f83bdfa3ea9936 (diff)
downloadUXP-11285cd0d6ef7de80d22187b99376602ed547214.tar
UXP-11285cd0d6ef7de80d22187b99376602ed547214.tar.gz
UXP-11285cd0d6ef7de80d22187b99376602ed547214.tar.lz
UXP-11285cd0d6ef7de80d22187b99376602ed547214.tar.xz
UXP-11285cd0d6ef7de80d22187b99376602ed547214.zip
Merge branch 'master' into es-modules-work
Diffstat (limited to 'layout/style')
-rw-r--r--layout/style/nsCSSPropAliasList.h5
-rw-r--r--layout/style/nsCSSPropList.h11
-rw-r--r--layout/style/nsRuleNode.cpp6
-rw-r--r--layout/style/nsStyleStruct.cpp11
-rw-r--r--layout/style/nsStyleStruct.h1
-rw-r--r--layout/style/test/ListCSSProperties.cpp1
6 files changed, 33 insertions, 2 deletions
diff --git a/layout/style/nsCSSPropAliasList.h b/layout/style/nsCSSPropAliasList.h
index f7938af9e..9ec71b2cf 100644
--- a/layout/style/nsCSSPropAliasList.h
+++ b/layout/style/nsCSSPropAliasList.h
@@ -264,6 +264,11 @@ CSS_PROP_ALIAS(-webkit-animation-timing-function,
WebkitAnimationTimingFunction,
WEBKIT_PREFIX_PREF)
+CSS_PROP_ALIAS(-webkit-appearance,
+ appearance,
+ WebkitAppearance,
+ WEBKIT_PREFIX_PREF)
+
CSS_PROP_ALIAS(-webkit-filter,
filter,
WebkitFilter,
diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h
index 411f982a4..44bd44cef 100644
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -470,6 +470,17 @@ CSS_PROP_DISPLAY(
kAppearanceKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_Discrete)
+CSS_PROP_POSITION(
+ aspect-ratio,
+ aspect_ratio,
+ AspectRatio,
+ CSS_PROPERTY_INTERNAL |
+ CSS_PROPERTY_PARSE_INACCESSIBLE,
+ "",
+ VARIANT_NUMBER,
+ nullptr,
+ offsetof(nsStylePosition, mAspectRatio),
+ eStyleAnimType_None)
CSS_PROP_DISPLAY(
backface-visibility,
backface_visibility,
diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp
index a0f65c069..1a451a2ef 100644
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -8544,6 +8544,12 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
SETCOORD_UNSET_INITIAL,
aContext, mPresContext, conditions);
+ // aspect-ratio: float, initial
+ SetFactor(*aRuleData->ValueForAspectRatio(),
+ pos->mAspectRatio, conditions,
+ parentPos->mAspectRatio, 0.0f,
+ SETFCT_UNSET_INITIAL | SETFCT_POSITIVE | SETFCT_NONE);
+
// box-sizing: enum, inherit, initial
SetValue(*aRuleData->ValueForBoxSizing(),
pos->mBoxSizing, conditions,
diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp
index 200f934c5..3b19a4418 100644
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -1408,6 +1408,7 @@ nsStylePosition::nsStylePosition(StyleStructContext aContext)
, mGridAutoColumnsMax(eStyleUnit_Auto)
, mGridAutoRowsMin(eStyleUnit_Auto)
, mGridAutoRowsMax(eStyleUnit_Auto)
+ , mAspectRatio(0.0f)
, mGridAutoFlow(NS_STYLE_GRID_AUTO_FLOW_ROW)
, mBoxSizing(StyleBoxSizing::Content)
, mAlignContent(NS_STYLE_ALIGN_NORMAL)
@@ -1466,6 +1467,7 @@ nsStylePosition::nsStylePosition(const nsStylePosition& aSource)
, mGridAutoColumnsMax(aSource.mGridAutoColumnsMax)
, mGridAutoRowsMin(aSource.mGridAutoRowsMin)
, mGridAutoRowsMax(aSource.mGridAutoRowsMax)
+ , mAspectRatio(aSource.mAspectRatio)
, mGridAutoFlow(aSource.mGridAutoFlow)
, mBoxSizing(aSource.mBoxSizing)
, mAlignContent(aSource.mAlignContent)
@@ -1636,6 +1638,11 @@ nsStylePosition::CalcDifference(const nsStylePosition& aNewData,
if (isVertical ? heightChanged : widthChanged) {
hint |= nsChangeHint_ReflowHintsForISizeChange;
}
+
+ if (mAspectRatio != aNewData.mAspectRatio) {
+ hint |= nsChangeHint_ReflowHintsForISizeChange |
+ nsChangeHint_ReflowHintsForBSizeChange;
+ }
} else {
if (widthChanged || heightChanged) {
hint |= nsChangeHint_NeutralChange;
@@ -2731,7 +2738,7 @@ nsStyleImageLayers::Size::DependsOnPositioningAreaSize(const nsStyleImage& aImag
}
if (imgContainer) {
CSSIntSize imageSize;
- nsSize imageRatio;
+ AspectRatio imageRatio;
bool hasWidth, hasHeight;
nsLayoutUtils::ComputeSizeForDrawing(imgContainer, imageSize, imageRatio,
hasWidth, hasHeight);
@@ -2744,7 +2751,7 @@ nsStyleImageLayers::Size::DependsOnPositioningAreaSize(const nsStyleImage& aImag
// If the image has an intrinsic ratio, rendering will depend on frame
// size when background-size is all auto.
- if (imageRatio != nsSize(0, 0)) {
+ if (imageRatio) {
return mWidthType == mHeightType;
}
diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h
index b257c6bb5..4bda817dd 100644
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1815,6 +1815,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePosition
nsStyleCoord mGridAutoColumnsMax; // [reset] coord, percent, enum, calc, flex
nsStyleCoord mGridAutoRowsMin; // [reset] coord, percent, enum, calc, flex
nsStyleCoord mGridAutoRowsMax; // [reset] coord, percent, enum, calc, flex
+ float mAspectRatio; // [reset] float
uint8_t mGridAutoFlow; // [reset] enumerated. See nsStyleConsts.h
mozilla::StyleBoxSizing mBoxSizing; // [reset] see nsStyleConsts.h
diff --git a/layout/style/test/ListCSSProperties.cpp b/layout/style/test/ListCSSProperties.cpp
index 718032f61..9f727104b 100644
--- a/layout/style/test/ListCSSProperties.cpp
+++ b/layout/style/test/ListCSSProperties.cpp
@@ -106,6 +106,7 @@ const char *gInaccessibleProperties[] = {
"-x-span",
"-x-system-font",
"-x-text-zoom",
+ "aspect-ratio", // for now.
"-moz-control-character-visibility",
"-moz-script-level", // parsed by UA sheets only
"-moz-script-size-multiplier",