Update aspect-ratio property to have constraining keywords
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Feb 2014 01:20:28 +0000 (01:20 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Feb 2014 01:20:28 +0000 (01:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=128262

Reviewed by Simon Fraser.

Source/WebCore:

Add support for "from-dimensions" and "from-intrinsic"
property values to "-webkit-aspect-ratio". I also changed
the default value from "none" to "auto", because "none" doesn't
make sense any more.

Covered by enhancing existing tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): New keywords.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseAspectRatio): Support new keywords.
* css/CSSValueKeywords.in: Add from-dimensions and from-intrinsic.
* css/DeprecatedStyleBuilder.cpp: This now has to handle the new
values. I also changed "none" to "auto".
(WebCore::ApplyPropertyAspectRatio::applyInheritValue):
(WebCore::ApplyPropertyAspectRatio::applyInitialValue):
(WebCore::ApplyPropertyAspectRatio::applyValue):
* rendering/style/RenderStyle.h: hasAspectRatio is now aspectRatioType
and indicates one of the three keywords, or a specified number.
* rendering/style/RenderStyleConstants.h: New enum.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

Add tests for new from-intrinsic and from-dimensions
property values.

* fast/css/aspect-ratio-inheritance-expected.txt:
* fast/css/aspect-ratio-inheritance.html:
* fast/css/aspect-ratio-parsing-tests-expected.txt:
* fast/css/aspect-ratio-parsing-tests.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163840 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/aspect-ratio-inheritance-expected.txt
LayoutTests/fast/css/aspect-ratio-inheritance.html
LayoutTests/fast/css/aspect-ratio-parsing-tests-expected.txt
LayoutTests/fast/css/aspect-ratio-parsing-tests.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/DeprecatedStyleBuilder.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h

index 5dd45ea..b4aec48 100644 (file)
@@ -1,3 +1,18 @@
+2014-02-09  Dean Jackson  <dino@apple.com>
+
+        Update aspect-ratio property to have constraining keywords
+        https://bugs.webkit.org/show_bug.cgi?id=128262
+
+        Reviewed by Simon Fraser.
+
+        Add tests for new from-intrinsic and from-dimensions
+        property values.
+
+        * fast/css/aspect-ratio-inheritance-expected.txt:
+        * fast/css/aspect-ratio-inheritance.html:
+        * fast/css/aspect-ratio-parsing-tests-expected.txt:
+        * fast/css/aspect-ratio-parsing-tests.html:
+
 2014-02-10  Mark Lam  <mark.lam@apple.com>
 
         REGRESSION(r163660-r163664): js/dom/stack-trace.html fails.
index 3232e50..85f026e 100644 (file)
@@ -1,6 +1,10 @@
-PASS testComputedValue("aspectRatioTest", "1 / 4", "-webkit-aspect-ratio") is "1/4"
-PASS testComputedValue("aspectRatioTest", "inherit", "-webkit-aspect-ratio") is "1/2"
-PASS testComputedValue("aspectRatioTest", "none", "-webkit-aspect-ratio") is "none"
+PASS testComputedValue("aspectRatioTest1", "1 / 4", "-webkit-aspect-ratio") is "1/4"
+PASS testComputedValue("aspectRatioTest1", "inherit", "-webkit-aspect-ratio") is "1/2"
+PASS testComputedValue("aspectRatioTest1", "auto", "-webkit-aspect-ratio") is "auto"
+PASS testComputedValue("aspectRatioTest2", "1 / 4", "-webkit-aspect-ratio") is "1/4"
+PASS testComputedValue("aspectRatioTest2", "inherit", "-webkit-aspect-ratio") is "from-dimensions"
+PASS testComputedValue("aspectRatioTest3", "1 / 4", "-webkit-aspect-ratio") is "1/4"
+PASS testComputedValue("aspectRatioTest3", "inherit", "-webkit-aspect-ratio") is "from-intrinsic"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 3ce199c..eb35d53 100644 (file)
@@ -1,7 +1,13 @@
 <!DOCTYPE html>
 <script src="../../resources/js-test-pre.js"></script>
 <div style="-webkit-aspect-ratio: 1 / 2;">
-  <div id="aspectRatioTest"></div>
+  <div id="aspectRatioTest1"></div>
+</div>
+<div style="-webkit-aspect-ratio: from-dimensions;">
+  <div id="aspectRatioTest2"></div>
+</div>
+<div style="-webkit-aspect-ratio: from-intrinsic;">
+  <div id="aspectRatioTest3"></div>
 </div>
 <script>
     function testComputedValue(elementId, value, styleAttribute)
         var computedValue = window.getComputedStyle(div)[styleAttribute];
         return computedValue;
     }
-    shouldBeEqualToString('testComputedValue("aspectRatioTest", "1 / 4", "-webkit-aspect-ratio")', '1/4');
-    shouldBeEqualToString('testComputedValue("aspectRatioTest", "inherit", "-webkit-aspect-ratio")', '1/2');
-    shouldBeEqualToString('testComputedValue("aspectRatioTest", "none", "-webkit-aspect-ratio")', 'none');
+    shouldBeEqualToString('testComputedValue("aspectRatioTest1", "1 / 4", "-webkit-aspect-ratio")', '1/4');
+    shouldBeEqualToString('testComputedValue("aspectRatioTest1", "inherit", "-webkit-aspect-ratio")', '1/2');
+    shouldBeEqualToString('testComputedValue("aspectRatioTest1", "auto", "-webkit-aspect-ratio")', 'auto');
+    shouldBeEqualToString('testComputedValue("aspectRatioTest2", "1 / 4", "-webkit-aspect-ratio")', '1/4');
+    shouldBeEqualToString('testComputedValue("aspectRatioTest2", "inherit", "-webkit-aspect-ratio")', 'from-dimensions');
+    shouldBeEqualToString('testComputedValue("aspectRatioTest3", "1 / 4", "-webkit-aspect-ratio")', '1/4');
+    shouldBeEqualToString('testComputedValue("aspectRatioTest3", "inherit", "-webkit-aspect-ratio")', 'from-intrinsic');
 </script>
 <script src="../../resources/js-test-post.js"></script>
index 4f9c7ce..70ba6ea 100644 (file)
@@ -10,18 +10,21 @@ PASS testParsing("aspectRatioTest", "1 / 2", "-webkit-aspect-ratio") is "1/2"
 PASS testParsing("aspectRatioTest", "1.2 / 2", "-webkit-aspect-ratio") is "1.2/2"
 PASS testParsing("aspectRatioTest", "2 / 0.5", "-webkit-aspect-ratio") is "2/0.5"
 PASS testParsing("aspectRatioTest", "inherit", "-webkit-aspect-ratio") is "inherit"
-PASS testParsing("aspectRatioTest", "none", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "1 2", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "a/1", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "1/a", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "abc123", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "1", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "1 / 0", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "0 / 1", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "0 / 0", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "-1 / 8", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "1 / -9", "-webkit-aspect-ratio") is "none"
-PASS testParsing("aspectRatioTest", "-1 / -4", "-webkit-aspect-ratio") is "none"
+PASS testParsing("aspectRatioTest", "from-dimensions", "-webkit-aspect-ratio") is "from-dimensions"
+PASS testParsing("aspectRatioTest", "from-intrinsic", "-webkit-aspect-ratio") is "from-intrinsic"
+PASS testParsing("aspectRatioTest", "auto", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "none", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "1 2", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "a/1", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "1/a", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "abc123", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "1", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "1 / 0", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "0 / 1", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "0 / 0", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "-1 / 8", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "1 / -9", "-webkit-aspect-ratio") is "auto"
+PASS testParsing("aspectRatioTest", "-1 / -4", "-webkit-aspect-ratio") is "auto"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index ee4f81e..d8012c3 100644 (file)
       shouldBeEqualToString('testParsing("aspectRatioTest", "1.2 / 2", "-webkit-aspect-ratio")', '1.2/2');
       shouldBeEqualToString('testParsing("aspectRatioTest", "2 / 0.5", "-webkit-aspect-ratio")', '2/0.5');
       shouldBeEqualToString('testParsing("aspectRatioTest", "inherit", "-webkit-aspect-ratio")', 'inherit');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "none", "-webkit-aspect-ratio")', 'none');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "from-dimensions", "-webkit-aspect-ratio")', 'from-dimensions');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "from-intrinsic", "-webkit-aspect-ratio")', 'from-intrinsic');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "auto", "-webkit-aspect-ratio")', 'auto');
 
       // The following are invalid and should get ignored.
-      shouldBeEqualToString('testParsing("aspectRatioTest", "1 2", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "a/1", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "1/a", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "abc123", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "1", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "1 / 0", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "0 / 1", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "0 / 0", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "-1 / 8", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "1 / -9", "-webkit-aspect-ratio")', 'none');
-      shouldBeEqualToString('testParsing("aspectRatioTest", "-1 / -4", "-webkit-aspect-ratio")', 'none');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "none", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "1 2", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "a/1", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "1/a", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "abc123", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "1", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "1 / 0", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "0 / 1", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "0 / 0", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "-1 / 8", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "1 / -9", "-webkit-aspect-ratio")', 'auto');
+      shouldBeEqualToString('testParsing("aspectRatioTest", "-1 / -4", "-webkit-aspect-ratio")', 'auto');
     </script>
     <script src="../../resources/js-test-post.js"></script>
   </body>
index 0f6cdf9..c95a907 100644 (file)
@@ -1,3 +1,35 @@
+2014-02-09  Dean Jackson  <dino@apple.com>
+
+        Update aspect-ratio property to have constraining keywords
+        https://bugs.webkit.org/show_bug.cgi?id=128262
+
+        Reviewed by Simon Fraser.
+
+        Add support for "from-dimensions" and "from-intrinsic"
+        property values to "-webkit-aspect-ratio". I also changed
+        the default value from "none" to "auto", because "none" doesn't
+        make sense any more.
+
+        Covered by enhancing existing tests.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyValue): New keywords.
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseAspectRatio): Support new keywords.
+        * css/CSSValueKeywords.in: Add from-dimensions and from-intrinsic.
+        * css/DeprecatedStyleBuilder.cpp: This now has to handle the new
+        values. I also changed "none" to "auto".
+        (WebCore::ApplyPropertyAspectRatio::applyInheritValue):
+        (WebCore::ApplyPropertyAspectRatio::applyInitialValue):
+        (WebCore::ApplyPropertyAspectRatio::applyValue):
+        * rendering/style/RenderStyle.h: hasAspectRatio is now aspectRatioType
+        and indicates one of the three keywords, or a specified number.
+        * rendering/style/RenderStyleConstants.h: New enum.
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2014-02-10  Benjamin Poulain  <bpoulain@apple.com>
 
         [WK2] Add support for image document viewport configuration
index 3e6659b..7d5dcfd 100644 (file)
@@ -2583,8 +2583,12 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert
         case CSSPropertyWebkitAppearance:
             return cssValuePool().createValue(style->appearance());
         case CSSPropertyWebkitAspectRatio:
-            if (!style->hasAspectRatio())
-                return cssValuePool().createIdentifierValue(CSSValueNone);
+            if (style->aspectRatioType() == AspectRatioAuto)
+                return cssValuePool().createIdentifierValue(CSSValueAuto);
+            if (style->aspectRatioType() == AspectRatioFromDimensions)
+                return cssValuePool().createIdentifierValue(CSSValueFromDimensions);
+            if (style->aspectRatioType() == AspectRatioFromIntrinsic)
+                return cssValuePool().createIdentifierValue(CSSValueFromIntrinsic);
             return CSSAspectRatioValue::create(style->aspectRatioNumerator(), style->aspectRatioDenominator());
         case CSSPropertyWebkitBackfaceVisibility:
             return cssValuePool().createIdentifierValue((style->backfaceVisibility() == BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible);
index 4114618..925ef0f 100644 (file)
@@ -7707,9 +7707,12 @@ bool CSSParser::parseBorderRadius(CSSPropertyID propId, bool important)
 bool CSSParser::parseAspectRatio(bool important)
 {
     unsigned num = m_valueList->size();
-    if (num == 1 && m_valueList->valueAt(0)->id == CSSValueNone) {
-        addProperty(CSSPropertyWebkitAspectRatio, cssValuePool().createIdentifierValue(CSSValueNone), important);
-        return true;
+    if (num == 1) {
+        CSSValueID valueId = m_valueList->valueAt(0)->id;
+        if (valueId == CSSValueAuto || valueId == CSSValueFromDimensions || valueId == CSSValueFromIntrinsic) {
+            addProperty(CSSPropertyWebkitAspectRatio, cssValuePool().createIdentifierValue(valueId), important);
+            return true;
+        }
     }
 
     if (num != 3)
index 2675565..db0de53 100644 (file)
@@ -1050,3 +1050,7 @@ span
 
 // -webkit-column-fill
 balance
+
+// -webkit-aspect-ratio
+from-dimensions
+from-intrinsic
index 77d6bd1..acffe69 100644 (file)
@@ -1982,28 +1982,40 @@ class ApplyPropertyAspectRatio {
 public:
     static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
     {
-        if (!styleResolver->parentStyle()->hasAspectRatio())
+        if (styleResolver->parentStyle()->aspectRatioType() == AspectRatioAuto)
             return;
-        styleResolver->style()->setHasAspectRatio(true);
+        styleResolver->style()->setAspectRatioType(styleResolver->parentStyle()->aspectRatioType());
         styleResolver->style()->setAspectRatioDenominator(styleResolver->parentStyle()->aspectRatioDenominator());
         styleResolver->style()->setAspectRatioNumerator(styleResolver->parentStyle()->aspectRatioNumerator());
     }
 
     static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
     {
-        styleResolver->style()->setHasAspectRatio(RenderStyle::initialHasAspectRatio());
+        styleResolver->style()->setAspectRatioType(RenderStyle::initialAspectRatioType());
         styleResolver->style()->setAspectRatioDenominator(RenderStyle::initialAspectRatioDenominator());
         styleResolver->style()->setAspectRatioNumerator(RenderStyle::initialAspectRatioNumerator());
     }
 
     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
     {
+        if (value->isPrimitiveValue()) {
+            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+
+            if (primitiveValue->getValueID() == CSSValueAuto)
+                return styleResolver->style()->setAspectRatioType(AspectRatioAuto);
+            if (primitiveValue->getValueID() == CSSValueFromDimensions)
+                return styleResolver->style()->setAspectRatioType(AspectRatioFromDimensions);
+            if (primitiveValue->getValueID() == CSSValueFromIntrinsic)
+                return styleResolver->style()->setAspectRatioType(AspectRatioFromIntrinsic);
+        }
+
         if (!value->isAspectRatioValue()) {
-            styleResolver->style()->setHasAspectRatio(false);
+            styleResolver->style()->setAspectRatioType(AspectRatioAuto);
             return;
         }
+
         CSSAspectRatioValue* aspectRatioValue = toCSSAspectRatioValue(value);
-        styleResolver->style()->setHasAspectRatio(true);
+        styleResolver->style()->setAspectRatioType(AspectRatioSpecified);
         styleResolver->style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue());
         styleResolver->style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue());
     }
index 27bb111..c3d8683 100644 (file)
@@ -743,8 +743,7 @@ public:
     ColorSpace colorSpace() const { return static_cast<ColorSpace>(rareInheritedData->colorSpace); }
     float opacity() const { return rareNonInheritedData->opacity; }
     ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
-    // aspect ratio convenience method
-    bool hasAspectRatio() const { return rareNonInheritedData->m_hasAspectRatio; }
+    AspectRatioType aspectRatioType() const { return static_cast<AspectRatioType>(rareNonInheritedData->m_aspectRatioType); }
     float aspectRatio() const { return aspectRatioNumerator() / aspectRatioDenominator(); }
     float aspectRatioDenominator() const { return rareNonInheritedData->m_aspectRatioDenominator; }
     float aspectRatioNumerator() const { return rareNonInheritedData->m_aspectRatioNumerator; }
@@ -1214,7 +1213,7 @@ public:
     void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
     void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
 
-    void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRatio, b); }
+    void setAspectRatioType(AspectRatioType aspectRatioType) { SET_VAR(rareNonInheritedData, m_aspectRatioType, aspectRatioType); }
     void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioDenominator, v); }
     void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioNumerator, v); }
 
@@ -1723,7 +1722,7 @@ public:
     static EBorderFit initialBorderFit() { return BorderFitBorder; }
     static EResize initialResize() { return RESIZE_NONE; }
     static ControlPart initialAppearance() { return NoControlPart; }
-    static bool initialHasAspectRatio() { return false; }
+    static AspectRatioType initialAspectRatioType() { return AspectRatioAuto; }
     static float initialAspectRatioDenominator() { return 1; }
     static float initialAspectRatioNumerator() { return 1; }
     static Order initialRTLOrdering() { return LogicalOrder; }
index 9d337bb..bfb8b58 100644 (file)
@@ -214,6 +214,10 @@ enum ObjectFit {
     ObjectFitFill, ObjectFitContain, ObjectFitCover, ObjectFitNone, ObjectFitScaleDown
 };
 
+enum AspectRatioType {
+    AspectRatioAuto, AspectRatioFromIntrinsic, AspectRatioFromDimensions, AspectRatioSpecified
+};
+
 // Word Break Values. Matches WinIE, rather than CSS3
 
 enum EWordBreak {
index 4d0d139..8bec162 100644 (file)
@@ -89,7 +89,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , m_wrapFlow(RenderStyle::initialWrapFlow())
     , m_wrapThrough(RenderStyle::initialWrapThrough())
     , m_runningAcceleratedAnimation(false)
-    , m_hasAspectRatio(false)
+    , m_aspectRatioType(RenderStyle::initialAspectRatioType())
 #if ENABLE(CSS_COMPOSITING)
     , m_effectiveBlendMode(RenderStyle::initialBlendMode())
 #endif
@@ -169,7 +169,7 @@ inline StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonIn
     , m_wrapFlow(o.m_wrapFlow)
     , m_wrapThrough(o.m_wrapThrough)
     , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
-    , m_hasAspectRatio(o.m_hasAspectRatio)
+    , m_aspectRatioType(o.m_aspectRatioType)
 #if ENABLE(CSS_COMPOSITING)
     , m_effectiveBlendMode(o.m_effectiveBlendMode)
 #endif
@@ -263,7 +263,7 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
 #if ENABLE(CSS_COMPOSITING)
         && m_effectiveBlendMode == o.m_effectiveBlendMode
 #endif
-        && m_hasAspectRatio == o.m_hasAspectRatio
+        && m_aspectRatioType == o.m_aspectRatioType
         && m_objectFit == o.m_objectFit;
 }
 
index f33870e..c3ba526 100644 (file)
@@ -190,7 +190,7 @@ public:
 
     unsigned m_runningAcceleratedAnimation : 1;
 
-    unsigned m_hasAspectRatio : 1; // Whether or not an aspect ratio has been specified.
+    unsigned m_aspectRatioType : 2;
 
 #if ENABLE(CSS_COMPOSITING)
     unsigned m_effectiveBlendMode: 5; // EBlendMode