summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsvillar <svillar@igalia.com>2016-03-14 03:32:23 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-14 10:33:20 +0000
commita70190e18d697d66bfd0ef4e9a2e4e578668e335 (patch)
treed9dc2e0363d8df2dbec83bbfb0d5c887928d994b
parentb94607d49db87ab4807c1b64a09e9615a6d0b6aa (diff)
downloadchromium_src-a70190e18d697d66bfd0ef4e9a2e4e578668e335.zip
chromium_src-a70190e18d697d66bfd0ef4e9a2e4e578668e335.tar.gz
chromium_src-a70190e18d697d66bfd0ef4e9a2e4e578668e335.tar.bz2
Reland: [css-grid] Store auto repeat data in ComputedStyle
This patch provides a new CSSValueList subclass which is used by the parser to store auto-repeat data which will be later consumed by the StyleBuilderConverter. It also adds the required machinery to ComputedStyle and StyleGridData. This is the first step to implement auto-repeat. Follow up patches will provide support for: * auto-repeat tracks computation * grid items placement in auto-repeat tracks * auto-repeat tracks computed style The original CL was: https://codereview.chromium.org/1731233002/ BUG=589460 Review URL: https://codereview.chromium.org/1787753002 Cr-Commit-Position: refs/heads/master@{#380950}
-rw-r--r--third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt48
-rw-r--r--third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html12
-rw-r--r--third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl14
-rw-r--r--third_party/WebKit/Source/core/core.gypi2
-rw-r--r--third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.cpp22
-rw-r--r--third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.h51
-rw-r--r--third_party/WebKit/Source/core/css/CSSValue.cpp14
-rw-r--r--third_party/WebKit/Source/core/css/CSSValue.h2
-rw-r--r--third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp9
-rw-r--r--third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp56
-rw-r--r--third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp44
-rw-r--r--third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h4
-rw-r--r--third_party/WebKit/Source/core/style/ComputedStyle.h21
-rw-r--r--third_party/WebKit/Source/core/style/ComputedStyleConstants.h6
-rw-r--r--third_party/WebKit/Source/core/style/StyleGridData.cpp18
-rw-r--r--third_party/WebKit/Source/core/style/StyleGridData.h19
16 files changed, 277 insertions, 65 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt
index 3953b477..4c70c74 100644
--- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt
@@ -4,30 +4,30 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
Test auto-repeat syntax.
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[foo bar] 10px"
-PASS element.style.gridTemplateColumns is "[foo bar] 10px"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "20px [foo bar]"
-PASS element.style.gridTemplateRows is "2em [foo bar]"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[foo bar] 800px"
-PASS element.style.gridTemplateColumns is "[foo bar] minmax(10px, 1fr)"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "[foo] 20px [bar]"
-PASS element.style.gridTemplateRows is "[foo] minmax(2em, max-content) [bar]"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "100px 20px 20px"
-PASS element.style.gridTemplateColumns is "minmax(10px, 100px) 20px 20px"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "70px 20px [bar foo] 10px [foo] 10px"
-PASS element.style.gridTemplateRows is "70px minmax(2em, max-content) [bar] [foo] 1em [foo] 1em"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[foo bar] 10px"
-PASS element.style.gridTemplateColumns is "[foo bar] 10px"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "20px [foo bar]"
-PASS element.style.gridTemplateRows is "2em [foo bar]"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[foo bar] 800px"
-PASS element.style.gridTemplateColumns is "[foo bar] minmax(10px, 1fr)"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "[foo] 20px [bar]"
-PASS element.style.gridTemplateRows is "[foo] minmax(2em, max-content) [bar]"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "10px 20px 20px"
-PASS element.style.gridTemplateColumns is "minmax(10px, min-content) 20px 20px"
-PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "60px 20px [bar foo] 10px [foo] 10px"
-PASS element.style.gridTemplateRows is "10% minmax(2em, max-content) [bar] [foo] 1em [foo] 1em"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-columns') should be [foo bar] 10px. Was 0px.
+PASS element.style.gridTemplateColumns is "repeat(auto-fill, [foo bar] 10px)"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-rows') should be 20px [foo bar]. Was 0px.
+PASS element.style.gridTemplateRows is "repeat(auto-fill, 2em [foo bar])"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-columns') should be [foo bar] 800px. Was 0px.
+PASS element.style.gridTemplateColumns is "repeat(auto-fill, [foo bar] minmax(10px, 1fr))"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-rows') should be [foo] 20px [bar]. Was 0px.
+PASS element.style.gridTemplateRows is "repeat(auto-fill, [foo] minmax(2em, max-content) [bar])"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-columns') should be 100px 20px 20px. Was 20px 20px.
+PASS element.style.gridTemplateColumns is "repeat(auto-fill, minmax(10px, 100px)) 20px 20px"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-rows') should be 70px 20px [bar foo] 10px [foo] 10px. Was 70px 10px [foo] 10px [foo].
+PASS element.style.gridTemplateRows is "70px repeat(auto-fill, minmax(2em, max-content) [bar]) [foo] 1em [foo] 1em"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-columns') should be [foo bar] 10px. Was 0px.
+PASS element.style.gridTemplateColumns is "repeat(auto-fit, [foo bar] 10px)"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-rows') should be 20px [foo bar]. Was 0px.
+PASS element.style.gridTemplateRows is "repeat(auto-fit, 2em [foo bar])"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-columns') should be [foo bar] 800px. Was 0px.
+PASS element.style.gridTemplateColumns is "repeat(auto-fit, [foo bar] minmax(10px, 1fr))"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-rows') should be [foo] 20px [bar]. Was 0px.
+PASS element.style.gridTemplateRows is "repeat(auto-fit, [foo] minmax(2em, max-content) [bar])"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-columns') should be 10px 20px 20px. Was 20px 20px.
+PASS element.style.gridTemplateColumns is "repeat(auto-fit, minmax(10px, min-content)) 20px 20px"
+FAIL getComputedStyle(element, '').getPropertyValue('grid-template-rows') should be 60px 20px [bar foo] 10px [foo] 10px. Was 60px 10px [foo] 10px [foo].
+PASS element.style.gridTemplateRows is "10% repeat(auto-fit, minmax(2em, max-content) [bar]) [foo] 1em [foo] 1em"
Test invalid repeat syntax.
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html
index 94f18a5..ebfa116 100644
--- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html
+++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html
@@ -9,12 +9,12 @@
description('Test that setting/getting grid-template-{columns|rows} with repeat(auto-fill|auto-fit,) works as expected');
debug("Test auto-repeat syntax.");
- testGridDefinitionsSetJSValues("repeat(auto-fill, [foo bar] 10px)", "repeat(auto-fill, 2em [foo bar])", "[foo bar] 10px", "20px [foo bar]", "[foo bar] 10px", "2em [foo bar]");
- testGridDefinitionsSetJSValues("repeat(auto-fill, [foo bar] minmax(10px, 1fr))", "repeat(auto-fill, [foo] minmax(2em, max-content) [bar])", "[foo bar] 800px", "[foo] 20px [bar]", "[foo bar] minmax(10px, 1fr)", "[foo] minmax(2em, max-content) [bar]");
- testGridDefinitionsSetJSValues("repeat(auto-fill, minmax(10px, 100px)) repeat(2, 20px)", "repeat(1, 70px) repeat(auto-fill, minmax(2em, max-content) [bar]) repeat(2, [foo] 1em)", "100px 20px 20px", "70px 20px [bar foo] 10px [foo] 10px", "minmax(10px, 100px) 20px 20px", "70px minmax(2em, max-content) [bar] [foo] 1em [foo] 1em");
- testGridDefinitionsSetJSValues("repeat(auto-fit, [foo bar] 10px)", "repeat(auto-fit, 2em [foo bar])", "[foo bar] 10px", "20px [foo bar]", "[foo bar] 10px", "2em [foo bar]");
- testGridDefinitionsSetJSValues("repeat(auto-fit, [foo bar] minmax(10px, 1fr))", "repeat(auto-fit, [foo] minmax(2em, max-content) [bar])", "[foo bar] 800px", "[foo] 20px [bar]", "[foo bar] minmax(10px, 1fr)", "[foo] minmax(2em, max-content) [bar]");
- testGridDefinitionsSetJSValues("repeat(auto-fit, minmax(10px, min-content)) repeat(2, 20px)", "repeat(1, 10%) repeat(auto-fit, minmax(2em, max-content) [bar]) repeat(2, [foo] 1em)", "10px 20px 20px", "60px 20px [bar foo] 10px [foo] 10px", "minmax(10px, min-content) 20px 20px", "10% minmax(2em, max-content) [bar] [foo] 1em [foo] 1em");
+ testGridDefinitionsSetJSValues("repeat(auto-fill, [foo bar] 10px)", "repeat(auto-fill, 2em [foo bar])", "[foo bar] 10px", "20px [foo bar]", "repeat(auto-fill, [foo bar] 10px)", "repeat(auto-fill, 2em [foo bar])");
+ testGridDefinitionsSetJSValues("repeat(auto-fill, [foo bar] minmax(10px, 1fr))", "repeat(auto-fill, [foo] minmax(2em, max-content) [bar])", "[foo bar] 800px", "[foo] 20px [bar]", "repeat(auto-fill, [foo bar] minmax(10px, 1fr))", "repeat(auto-fill, [foo] minmax(2em, max-content) [bar])");
+ testGridDefinitionsSetJSValues("repeat(auto-fill, minmax(10px, 100px)) repeat(2, 20px)", "repeat(1, 70px) repeat(auto-fill, minmax(2em, max-content) [bar]) repeat(2, [foo] 1em)", "100px 20px 20px", "70px 20px [bar foo] 10px [foo] 10px", "repeat(auto-fill, minmax(10px, 100px)) 20px 20px", "70px repeat(auto-fill, minmax(2em, max-content) [bar]) [foo] 1em [foo] 1em");
+ testGridDefinitionsSetJSValues("repeat(auto-fit, [foo bar] 10px)", "repeat(auto-fit, 2em [foo bar])", "[foo bar] 10px", "20px [foo bar]", "repeat(auto-fit, [foo bar] 10px)", "repeat(auto-fit, 2em [foo bar])");
+ testGridDefinitionsSetJSValues("repeat(auto-fit, [foo bar] minmax(10px, 1fr))", "repeat(auto-fit, [foo] minmax(2em, max-content) [bar])", "[foo bar] 800px", "[foo] 20px [bar]", "repeat(auto-fit, [foo bar] minmax(10px, 1fr))", "repeat(auto-fit, [foo] minmax(2em, max-content) [bar])");
+ testGridDefinitionsSetJSValues("repeat(auto-fit, minmax(10px, min-content)) repeat(2, 20px)", "repeat(1, 10%) repeat(auto-fit, minmax(2em, max-content) [bar]) repeat(2, [foo] 1em)", "10px 20px 20px", "60px 20px [bar foo] 10px [foo] 10px", "repeat(auto-fit, minmax(10px, min-content)) 20px 20px", "10% repeat(auto-fit, minmax(2em, max-content) [bar]) [foo] 1em [foo] 1em");
debug("");
debug("Test invalid repeat syntax.");
diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index 61d5c25..6097cfc 100644
--- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -461,15 +461,27 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
{{declare_value_function(property_id)}}
{
Vector<GridTrackSize> trackSizes;
+ Vector<GridTrackSize> autoRepeatTrackSizes;
+ size_t autoRepeatInsertionPoint;
NamedGridLinesMap namedGridLines;
OrderedNamedGridLines orderedNamedGridLines;
- StyleBuilderConverter::convertGridTrackList(*value, trackSizes, namedGridLines, orderedNamedGridLines, state);
+ NamedGridLinesMap autoRepeatNamedGridLines;
+ OrderedNamedGridLines autoRepeatOrderedNamedGridLines;
+ AutoRepeatType autoRepeatType;
+ StyleBuilderConverter::convertGridTrackList(*value, trackSizes, namedGridLines, orderedNamedGridLines, autoRepeatTrackSizes, autoRepeatNamedGridLines, autoRepeatOrderedNamedGridLines, autoRepeatInsertionPoint, autoRepeatType, state);
const NamedGridAreaMap& namedGridAreas = state.style()->namedGridArea();
if (!namedGridAreas.isEmpty())
StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGridAreas, namedGridLines, For{{type}}s);
state.style()->setGridTemplate{{type}}s(trackSizes);
state.style()->setNamedGrid{{type}}Lines(namedGridLines);
state.style()->setOrderedNamedGrid{{type}}Lines(orderedNamedGridLines);
+ if (autoRepeatTrackSizes.size()) {
+ state.style()->setGridAutoRepeat{{type}}s(autoRepeatTrackSizes);
+ state.style()->setGridAutoRepeat{{type}}sInsertionPoint(autoRepeatInsertionPoint);
+ state.style()->setAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLines);
+ state.style()->setAutoRepeatOrderedNamedGrid{{type}}Lines(autoRepeatOrderedNamedGridLines);
+ state.style()->setGridAutoRepeatType(autoRepeatType);
+ }
}
{% endmacro %}
{{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}}
diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi
index adb0679..3a1da07 100644
--- a/third_party/WebKit/Source/core/core.gypi
+++ b/third_party/WebKit/Source/core/core.gypi
@@ -1134,6 +1134,8 @@
'css/CSSFunctionValue.h',
'css/CSSGradientValue.cpp',
'css/CSSGradientValue.h',
+ 'css/CSSGridAutoRepeatValue.h',
+ 'css/CSSGridAutoRepeatValue.cpp',
'css/CSSGridLineNamesValue.cpp',
'css/CSSGridLineNamesValue.h',
'css/CSSGridTemplateAreasValue.cpp',
diff --git a/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.cpp b/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.cpp
new file mode 100644
index 0000000..238c6ed
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.cpp
@@ -0,0 +1,22 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/css/CSSGridAutoRepeatValue.h"
+
+#include "wtf/text/StringBuilder.h"
+
+namespace blink {
+
+String CSSGridAutoRepeatValue::customCSSText() const
+{
+ StringBuilder result;
+ result.append("repeat(");
+ result.append(getValueName(autoRepeatID()));
+ result.append(", ");
+ result.append(CSSValueList::customCSSText());
+ result.append(")");
+ return result.toString();
+}
+
+} // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.h b/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.h
new file mode 100644
index 0000000..1b69f93
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.h
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CSSGridAutoRepeatValue_h
+#define CSSGridAutoRepeatValue_h
+
+#include "core/CSSValueKeywords.h"
+#include "core/css/CSSValueList.h"
+
+namespace blink {
+
+// CSSGridAutoRepeatValue stores the track sizes and line numbers when the auto-repeat
+// syntax is used
+//
+// Right now the auto-repeat syntax is as follows:
+// <auto-repeat> = repeat( [ auto-fill | auto-fit ], <line-names>? <fixed-size> <line-names>? )
+//
+// meaning that only one fixed size track is allowed. It could be argued that a different
+// class storing two CSSGridLineNamesValue and one CSSValue (for the track size) fits
+// better but the CSSWG has left the door open to allow more than one track in the
+// future. That's why we're using a list, it's prepared for future changes and it also
+// allows us to keep the parsing algorithm almost intact.
+class CSSGridAutoRepeatValue : public CSSValueList {
+public:
+ static PassRefPtrWillBeRawPtr<CSSGridAutoRepeatValue> create(CSSValueID id)
+ {
+ return adoptRefWillBeNoop(new CSSGridAutoRepeatValue(id));
+ }
+
+ String customCSSText() const;
+ CSSValueID autoRepeatID() const { return m_autoRepeatID; }
+
+ DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValueList::traceAfterDispatch(visitor); }
+
+private:
+ CSSGridAutoRepeatValue(CSSValueID id)
+ : CSSValueList(GridAutoRepeatClass, SpaceSeparator)
+ , m_autoRepeatID(id)
+ {
+ ASSERT(id == CSSValueAutoFill || id == CSSValueAutoFit);
+ }
+
+ const CSSValueID m_autoRepeatID;
+};
+
+DEFINE_CSS_VALUE_TYPE_CASTS(CSSGridAutoRepeatValue, isGridAutoRepeatValue());
+
+} // namespace blink
+
+#endif // CSSGridAutoRepeatValue_h
diff --git a/third_party/WebKit/Source/core/css/CSSValue.cpp b/third_party/WebKit/Source/core/css/CSSValue.cpp
index 4f3dd60..7481533 100644
--- a/third_party/WebKit/Source/core/css/CSSValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSValue.cpp
@@ -39,6 +39,7 @@
#include "core/css/CSSFontFeatureValue.h"
#include "core/css/CSSFunctionValue.h"
#include "core/css/CSSGradientValue.h"
+#include "core/css/CSSGridAutoRepeatValue.h"
#include "core/css/CSSGridLineNamesValue.h"
#include "core/css/CSSGridTemplateAreasValue.h"
#include "core/css/CSSImageSetValue.h"
@@ -137,6 +138,8 @@ bool CSSValue::equals(const CSSValue& other) const
return compareCSSValues<CSSInitialValue>(*this, other);
case UnsetClass:
return compareCSSValues<CSSUnsetValue>(*this, other);
+ case GridAutoRepeatClass:
+ return compareCSSValues<CSSGridAutoRepeatValue>(*this, other);
case GridLineNamesClass:
return compareCSSValues<CSSGridLineNamesValue>(*this, other);
case GridTemplateAreasClass:
@@ -223,6 +226,8 @@ String CSSValue::cssText() const
return toCSSUnsetValue(this)->customCSSText();
case InitialClass:
return toCSSInitialValue(this)->customCSSText();
+ case GridAutoRepeatClass:
+ return toCSSGridAutoRepeatValue(this)->customCSSText();
case GridLineNamesClass:
return toCSSGridLineNamesValue(this)->customCSSText();
case GridTemplateAreasClass:
@@ -326,6 +331,9 @@ void CSSValue::destroy()
case UnsetClass:
delete toCSSUnsetValue(this);
return;
+ case GridAutoRepeatClass:
+ delete toCSSGridAutoRepeatValue(this);
+ return;
case GridLineNamesClass:
delete toCSSGridLineNamesValue(this);
return;
@@ -447,6 +455,9 @@ void CSSValue::finalizeGarbageCollectedObject()
case UnsetClass:
toCSSUnsetValue(this)->~CSSUnsetValue();
return;
+ case GridAutoRepeatClass:
+ toCSSGridAutoRepeatValue(this)->~CSSGridAutoRepeatValue();
+ return;
case GridLineNamesClass:
toCSSGridLineNamesValue(this)->~CSSGridLineNamesValue();
return;
@@ -568,6 +579,9 @@ DEFINE_TRACE(CSSValue)
case UnsetClass:
toCSSUnsetValue(this)->traceAfterDispatch(visitor);
return;
+ case GridAutoRepeatClass:
+ toCSSGridAutoRepeatValue(this)->traceAfterDispatch(visitor);
+ return;
case GridLineNamesClass:
toCSSGridLineNamesValue(this)->traceAfterDispatch(visitor);
return;
diff --git a/third_party/WebKit/Source/core/css/CSSValue.h b/third_party/WebKit/Source/core/css/CSSValue.h
index 8b52da1..33eb456 100644
--- a/third_party/WebKit/Source/core/css/CSSValue.h
+++ b/third_party/WebKit/Source/core/css/CSSValue.h
@@ -108,6 +108,7 @@ public:
bool isGridLineNamesValue() const { return m_classType == GridLineNamesClass; }
bool isCustomPropertyDeclaration() const { return m_classType == CustomPropertyDeclarationClass; }
bool isVariableReferenceValue() const { return m_classType == VariableReferenceClass; }
+ bool isGridAutoRepeatValue() const { return m_classType == GridAutoRepeatClass; }
bool hasFailedOrCanceledSubresources() const;
@@ -182,6 +183,7 @@ protected:
FunctionClass,
ImageSetClass,
GridLineNamesClass,
+ GridAutoRepeatClass,
// Do not append non-list class types here.
};
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 0ed1d88..8215810 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -566,12 +566,15 @@ static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction, const LayoutObject* layoutObject, const ComputedStyle& style)
{
- const Vector<GridTrackSize>& trackSizes = direction == ForColumns ? style.gridTemplateColumns() : style.gridTemplateRows();
- const OrderedNamedGridLines& orderedNamedGridLines = direction == ForColumns ? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines();
+ bool isRowAxis = direction == ForColumns;
+ const Vector<GridTrackSize>& trackSizes = isRowAxis ? style.gridTemplateColumns() : style.gridTemplateRows();
+ const Vector<GridTrackSize>& autoRepeatTrackSizes = isRowAxis ? style.gridAutoRepeatColumns() : style.gridAutoRepeatRows();
+ const OrderedNamedGridLines& orderedNamedGridLines = isRowAxis ? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines();
+
bool isLayoutGrid = layoutObject && layoutObject->isLayoutGrid();
// Handle the 'none' case.
- bool trackListIsEmpty = trackSizes.isEmpty();
+ bool trackListIsEmpty = trackSizes.isEmpty() && autoRepeatTrackSizes.isEmpty();
if (isLayoutGrid && trackListIsEmpty) {
// For grids we should consider every listed track, whether implicitly or explicitly created. If we don't have
// any explicit track and there are no children then there are no implicit tracks. We cannot simply check the
diff --git a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
index 3eb4957..95365c5 100644
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
@@ -29,6 +29,7 @@
#include "core/StylePropertyShorthand.h"
#include "core/css/CSSCustomIdentValue.h"
#include "core/css/CSSFunctionValue.h"
+#include "core/css/CSSGridAutoRepeatValue.h"
#include "core/css/CSSGridLineNamesValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
#include "core/css/CSSValuePair.h"
@@ -736,6 +737,28 @@ bool CSSPropertyParser::parseGridLineNames(CSSParserValueList& inputList, CSSVal
return true;
}
+static bool allTracksAreFixedSized(CSSValueList& valueList)
+{
+ for (auto value : valueList) {
+ if (value->isGridLineNamesValue())
+ continue;
+ // The auto-repeat value holds a <fixed-size> = <fixed-breadth> | minmax( <fixed-breadth>, <track-breadth> )
+ if (value->isGridAutoRepeatValue()) {
+ if (!allTracksAreFixedSized(toCSSValueList(*value)))
+ return false;
+ continue;
+ }
+ ASSERT(value->isPrimitiveValue() || (value->isFunctionValue() && toCSSFunctionValue(*value).item(0)));
+ const CSSPrimitiveValue& primitiveValue = value->isPrimitiveValue()
+ ? toCSSPrimitiveValue(*value)
+ : toCSSPrimitiveValue(*toCSSFunctionValue(*value).item(0));
+ CSSValueID valueID = primitiveValue.getValueID();
+ if (valueID == CSSValueMinContent || valueID == CSSValueMaxContent || valueID == CSSValueAuto || primitiveValue.isFlex())
+ return false;
+ }
+ return true;
+}
+
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackList()
{
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
@@ -782,19 +805,8 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTrackList()
// <auto-repeat> requires definite minimum track sizes in order to compute the number of repetitions.
// The above while loop detects those appearances after the <auto-repeat> but not the ones before.
- if (seenAutoRepeat) {
- for (auto value : *values) {
- if (value->isGridLineNamesValue())
- continue;
- ASSERT(value->isPrimitiveValue() || (value->isFunctionValue() && toCSSFunctionValue(*value).item(0)));
- const CSSPrimitiveValue& primitiveValue = value->isPrimitiveValue()
- ? toCSSPrimitiveValue(*value)
- : toCSSPrimitiveValue(*toCSSFunctionValue(*value).item(0));
- CSSValueID valueID = primitiveValue.getValueID();
- if (valueID == CSSValueMinContent || valueID == CSSValueMaxContent || valueID == CSSValueAuto || primitiveValue.isFlex())
- return nullptr;
- }
- }
+ if (seenAutoRepeat && !allTracksAreFixedSized(*values))
+ return nullptr;
return values;
}
@@ -814,7 +826,7 @@ bool CSSPropertyParser::parseGridTrackRepeatFunction(CSSValueList& list, bool& i
// because it will be computed later, let's set it to 1.
size_t repetitions = isAutoRepeat ? 1 : clampTo<size_t>(currentValue->fValue, 0, kGridMaxTracks);
- RefPtrWillBeRawPtr<CSSValueList> repeatedValues = CSSValueList::createSpaceSeparated();
+ RefPtrWillBeRawPtr<CSSValueList> repeatedValues = isAutoRepeat ? CSSGridAutoRepeatValue::create(currentValue->id) : CSSValueList::createSpaceSeparated();
arguments->next(); // Skip the repetition count.
arguments->next(); // Skip the comma.
@@ -844,13 +856,17 @@ bool CSSPropertyParser::parseGridTrackRepeatFunction(CSSValueList& list, bool& i
if (!numberOfTracks)
return false;
- // We clamp the number of repetitions to a multiple of the repeat() track list's size, while staying below the max
- // grid size.
- repetitions = std::min(repetitions, kGridMaxTracks / numberOfTracks);
+ if (isAutoRepeat) {
+ list.append(repeatedValues.release());
+ } else {
+ // We clamp the number of repetitions to a multiple of the repeat() track list's size, while staying below the max
+ // grid size.
+ repetitions = std::min(repetitions, kGridMaxTracks / numberOfTracks);
- for (size_t i = 0; i < repetitions; ++i) {
- for (size_t j = 0; j < repeatedValues->length(); ++j)
- list.append(repeatedValues->item(j));
+ for (size_t i = 0; i < repetitions; ++i) {
+ for (size_t j = 0; j < repeatedValues->length(); ++j)
+ list.append(repeatedValues->item(j));
+ }
}
// parseGridTrackSize iterated over the repeat arguments, move to the next value.
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
index fd34261..4e1efaf 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -31,6 +31,7 @@
#include "core/css/CSSContentDistributionValue.h"
#include "core/css/CSSFontFeatureValue.h"
#include "core/css/CSSFunctionValue.h"
+#include "core/css/CSSGridAutoRepeatValue.h"
#include "core/css/CSSGridLineNamesValue.h"
#include "core/css/CSSPathValue.h"
#include "core/css/CSSPrimitiveValueMappings.h"
@@ -451,7 +452,20 @@ GridTrackSize StyleBuilderConverter::convertGridTrackSize(StyleResolverState& st
return GridTrackSize(minTrackBreadth, maxTrackBreadth);
}
-void StyleBuilderConverter::convertGridTrackList(const CSSValue& value, Vector<GridTrackSize>& trackSizes, NamedGridLinesMap& namedGridLines, OrderedNamedGridLines& orderedNamedGridLines, StyleResolverState& state)
+static void convertGridLineNamesList(const CSSValue& value, size_t currentNamedGridLine, NamedGridLinesMap& namedGridLines, OrderedNamedGridLines& orderedNamedGridLines)
+{
+ ASSERT(value.isGridLineNamesValue());
+
+ for (auto& namedGridLineValue : toCSSValueList(value)) {
+ String namedGridLine = toCSSCustomIdentValue(*namedGridLineValue).value();
+ NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<size_t>());
+ result.storedValue->value.append(currentNamedGridLine);
+ OrderedNamedGridLines::AddResult orderedInsertionResult = orderedNamedGridLines.add(currentNamedGridLine, Vector<String>());
+ orderedInsertionResult.storedValue->value.append(namedGridLine);
+ }
+}
+
+void StyleBuilderConverter::convertGridTrackList(const CSSValue& value, Vector<GridTrackSize>& trackSizes, NamedGridLinesMap& namedGridLines, OrderedNamedGridLines& orderedNamedGridLines, Vector<GridTrackSize>& autoRepeatTrackSizes, NamedGridLinesMap& autoRepeatNamedGridLines, OrderedNamedGridLines& autoRepeatOrderedNamedGridLines, size_t& autoRepeatInsertionPoint, AutoRepeatType &autoRepeatType, StyleResolverState& state)
{
if (value.isPrimitiveValue()) {
ASSERT(toCSSPrimitiveValue(value).getValueID() == CSSValueNone);
@@ -459,15 +473,27 @@ void StyleBuilderConverter::convertGridTrackList(const CSSValue& value, Vector<G
}
size_t currentNamedGridLine = 0;
- for (auto& currValue : toCSSValueList(value)) {
+ for (auto currValue : toCSSValueList(value)) {
if (currValue->isGridLineNamesValue()) {
- for (auto& namedGridLineValue : toCSSGridLineNamesValue(*currValue)) {
- String namedGridLine = toCSSCustomIdentValue(*namedGridLineValue).value();
- NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<size_t>());
- result.storedValue->value.append(currentNamedGridLine);
- OrderedNamedGridLines::AddResult orderedInsertionResult = orderedNamedGridLines.add(currentNamedGridLine, Vector<String>());
- orderedInsertionResult.storedValue->value.append(namedGridLine);
+ convertGridLineNamesList(*currValue, currentNamedGridLine, namedGridLines, orderedNamedGridLines);
+ continue;
+ }
+
+ if (currValue->isGridAutoRepeatValue()) {
+ ASSERT(autoRepeatTrackSizes.isEmpty());
+ size_t autoRepeatIndex = 0;
+ CSSValueID autoRepeatID = toCSSGridAutoRepeatValue(currValue.get())->autoRepeatID();
+ ASSERT(autoRepeatID == CSSValueAutoFill || autoRepeatID == CSSValueAutoFit);
+ autoRepeatType = autoRepeatID == CSSValueAutoFill ? AutoFill : AutoFit;
+ for (auto autoRepeatValue : toCSSValueList(*currValue)) {
+ if (autoRepeatValue->isGridLineNamesValue()) {
+ convertGridLineNamesList(*autoRepeatValue, autoRepeatIndex, autoRepeatNamedGridLines, autoRepeatOrderedNamedGridLines);
+ continue;
+ }
+ ++autoRepeatIndex;
+ autoRepeatTrackSizes.append(convertGridTrackSize(state, *autoRepeatValue));
}
+ autoRepeatInsertionPoint = currentNamedGridLine++;
continue;
}
@@ -477,7 +503,7 @@ void StyleBuilderConverter::convertGridTrackList(const CSSValue& value, Vector<G
// The parser should have rejected any <track-list> without any <track-size> as
// this is not conformant to the syntax.
- ASSERT(!trackSizes.isEmpty());
+ ASSERT(!trackSizes.isEmpty() || !autoRepeatTrackSizes.isEmpty());
}
void StyleBuilderConverter::convertOrderedNamedGridLinesMapToNamedGridLinesMap(const OrderedNamedGridLines& orderedNamedGridLines, NamedGridLinesMap& namedGridLines)
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
index 22fd808..e328c8e 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
@@ -96,7 +96,9 @@ public:
static float convertTextStrokeWidth(StyleResolverState&, const CSSValue&);
static TransformOrigin convertTransformOrigin(StyleResolverState&, const CSSValue&);
- static void convertGridTrackList(const CSSValue&, Vector<GridTrackSize>&, NamedGridLinesMap&, OrderedNamedGridLines&, StyleResolverState&);
+ static void convertGridTrackList(const CSSValue&, Vector<GridTrackSize>&, NamedGridLinesMap&, OrderedNamedGridLines&,
+ Vector<GridTrackSize>& autoRepeatTrackSizes, NamedGridLinesMap&, OrderedNamedGridLines&,
+ size_t& autoRepeatInsertionPoint, AutoRepeatType&, StyleResolverState&);
static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&, NamedGridLinesMap&, GridTrackSizingDirection);
static void convertOrderedNamedGridLinesMapToNamedGridLinesMap(const OrderedNamedGridLines&, NamedGridLinesMap&);
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 7540622..36a0222 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -816,10 +816,19 @@ public:
const Vector<GridTrackSize>& gridTemplateColumns() const { return rareNonInheritedData->m_grid->m_gridTemplateColumns; }
const Vector<GridTrackSize>& gridTemplateRows() const { return rareNonInheritedData->m_grid->m_gridTemplateRows; }
+ const Vector<GridTrackSize>& gridAutoRepeatColumns() const { return rareNonInheritedData->m_grid->m_gridAutoRepeatColumns; }
+ const Vector<GridTrackSize>& gridAutoRepeatRows() const { return rareNonInheritedData->m_grid->m_gridAutoRepeatRows; }
+ size_t gridAutoRepeatColumnsInsertionPoint() const { return rareNonInheritedData->m_grid->m_autoRepeatColumnsInsertionPoint; }
+ size_t gridAutoRepeatRowsInsertionPoint() const { return rareNonInheritedData->m_grid->m_autoRepeatRowsInsertionPoint; }
+ AutoRepeatType gridAutoRepeatType() const { return rareNonInheritedData->m_grid->m_autoRepeatType; }
const NamedGridLinesMap& namedGridColumnLines() const { return rareNonInheritedData->m_grid->m_namedGridColumnLines; }
const NamedGridLinesMap& namedGridRowLines() const { return rareNonInheritedData->m_grid->m_namedGridRowLines; }
const OrderedNamedGridLines& orderedNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridColumnLines; }
const OrderedNamedGridLines& orderedNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridRowLines; }
+ const NamedGridLinesMap& autoRepeatNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_autoRepeatNamedGridColumnLines; }
+ const NamedGridLinesMap& autoRepeatNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_autoRepeatNamedGridRowLines; }
+ const OrderedNamedGridLines& autoRepeatOrderedNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridColumnLines; }
+ const OrderedNamedGridLines& autoRepeatOrderedNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridRowLines; }
const NamedGridAreaMap& namedGridArea() const { return rareNonInheritedData->m_grid->m_namedGridArea; }
size_t namedGridAreaRowCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaRowCount; }
size_t namedGridAreaColumnCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaColumnCount; }
@@ -1368,10 +1377,19 @@ public:
void setGridAutoRows(const GridTrackSize& length) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoRows, length); }
void setGridTemplateColumns(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridTemplateColumns, lengths); }
void setGridTemplateRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridTemplateRows, lengths); }
+ void setGridAutoRepeatColumns(const Vector<GridTrackSize>& trackSizes) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoRepeatColumns, trackSizes); }
+ void setGridAutoRepeatRows(const Vector<GridTrackSize>& trackSizes) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoRepeatRows, trackSizes); }
+ void setGridAutoRepeatColumnsInsertionPoint(const size_t insertionPoint) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatColumnsInsertionPoint, insertionPoint); }
+ void setGridAutoRepeatRowsInsertionPoint(const size_t insertionPoint) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatRowsInsertionPoint, insertionPoint); }
+ void setGridAutoRepeatType(const AutoRepeatType autoRepeatType) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatType, autoRepeatType); }
void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridColumnLines, namedGridColumnLines); }
void setNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridRowLines, namedGridRowLines); }
void setOrderedNamedGridColumnLines(const OrderedNamedGridLines& orderedNamedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_orderedNamedGridColumnLines, orderedNamedGridColumnLines); }
void setOrderedNamedGridRowLines(const OrderedNamedGridLines& orderedNamedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_orderedNamedGridRowLines, orderedNamedGridRowLines); }
+ void setAutoRepeatNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatNamedGridColumnLines, namedGridColumnLines); }
+ void setAutoRepeatNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatNamedGridRowLines, namedGridRowLines); }
+ void setAutoRepeatOrderedNamedGridColumnLines(const OrderedNamedGridLines& orderedNamedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatOrderedNamedGridColumnLines, orderedNamedGridColumnLines); }
+ void setAutoRepeatOrderedNamedGridRowLines(const OrderedNamedGridLines& orderedNamedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatOrderedNamedGridRowLines, orderedNamedGridRowLines); }
void setNamedGridArea(const NamedGridAreaMap& namedGridArea) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridArea, namedGridArea); }
void setNamedGridAreaRowCount(size_t rowCount) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridAreaRowCount, rowCount); }
void setNamedGridAreaColumnCount(size_t columnCount) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridAreaColumnCount, columnCount); }
@@ -1794,6 +1812,9 @@ public:
// The initial value is 'none' for grid tracks.
static Vector<GridTrackSize> initialGridTemplateColumns() { return Vector<GridTrackSize>(); }
static Vector<GridTrackSize> initialGridTemplateRows() { return Vector<GridTrackSize>(); }
+ static Vector<GridTrackSize> initialGridAutoRepeatTracks() { return Vector<GridTrackSize>(); }
+ static size_t initialGridAutoRepeatInsertionPoint() { return 0; }
+ static AutoRepeatType initialGridAutoRepeatType() { return NoAutoRepeat; }
static GridAutoFlow initialGridAutoFlow() { return AutoFlowRow; }
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
index 8e03c3d..6d9f77b 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
@@ -605,6 +605,12 @@ enum ScrollSnapType {
ScrollSnapTypeProximity
};
+enum AutoRepeatType {
+ NoAutoRepeat,
+ AutoFill,
+ AutoFit
+};
+
} // namespace blink
#endif // ComputedStyleConstants_h
diff --git a/third_party/WebKit/Source/core/style/StyleGridData.cpp b/third_party/WebKit/Source/core/style/StyleGridData.cpp
index f780397..20f1588 100644
--- a/third_party/WebKit/Source/core/style/StyleGridData.cpp
+++ b/third_party/WebKit/Source/core/style/StyleGridData.cpp
@@ -36,6 +36,10 @@ StyleGridData::StyleGridData()
, m_namedGridRowLines(ComputedStyle::initialNamedGridRowLines())
, m_orderedNamedGridColumnLines(ComputedStyle::initialOrderedNamedGridColumnLines())
, m_orderedNamedGridRowLines(ComputedStyle::initialOrderedNamedGridRowLines())
+ , m_autoRepeatNamedGridColumnLines(ComputedStyle::initialNamedGridColumnLines())
+ , m_autoRepeatNamedGridRowLines(ComputedStyle::initialNamedGridRowLines())
+ , m_autoRepeatOrderedNamedGridColumnLines(ComputedStyle::initialOrderedNamedGridColumnLines())
+ , m_autoRepeatOrderedNamedGridRowLines(ComputedStyle::initialOrderedNamedGridRowLines())
, m_gridAutoFlow(ComputedStyle::initialGridAutoFlow())
, m_gridAutoRows(ComputedStyle::initialGridAutoRows())
, m_gridAutoColumns(ComputedStyle::initialGridAutoColumns())
@@ -44,6 +48,11 @@ StyleGridData::StyleGridData()
, m_namedGridAreaColumnCount(ComputedStyle::initialNamedGridAreaCount())
, m_gridColumnGap(ComputedStyle::initialGridColumnGap())
, m_gridRowGap(ComputedStyle::initialGridRowGap())
+ , m_gridAutoRepeatColumns(ComputedStyle::initialGridAutoRepeatTracks())
+ , m_gridAutoRepeatRows(ComputedStyle::initialGridAutoRepeatTracks())
+ , m_autoRepeatColumnsInsertionPoint(ComputedStyle::initialGridAutoRepeatInsertionPoint())
+ , m_autoRepeatRowsInsertionPoint(ComputedStyle::initialGridAutoRepeatInsertionPoint())
+ , m_autoRepeatType(ComputedStyle::initialGridAutoRepeatType())
{
}
@@ -55,6 +64,10 @@ StyleGridData::StyleGridData(const StyleGridData& o)
, m_namedGridRowLines(o.m_namedGridRowLines)
, m_orderedNamedGridColumnLines(o.m_orderedNamedGridColumnLines)
, m_orderedNamedGridRowLines(o.m_orderedNamedGridRowLines)
+ , m_autoRepeatNamedGridColumnLines(o.m_namedGridColumnLines)
+ , m_autoRepeatNamedGridRowLines(o.m_namedGridRowLines)
+ , m_autoRepeatOrderedNamedGridColumnLines(o.m_orderedNamedGridColumnLines)
+ , m_autoRepeatOrderedNamedGridRowLines(o.m_orderedNamedGridRowLines)
, m_gridAutoFlow(o.m_gridAutoFlow)
, m_gridAutoRows(o.m_gridAutoRows)
, m_gridAutoColumns(o.m_gridAutoColumns)
@@ -63,6 +76,11 @@ StyleGridData::StyleGridData(const StyleGridData& o)
, m_namedGridAreaColumnCount(o.m_namedGridAreaColumnCount)
, m_gridColumnGap(o.m_gridColumnGap)
, m_gridRowGap(o.m_gridRowGap)
+ , m_gridAutoRepeatColumns(o.m_gridAutoRepeatColumns)
+ , m_gridAutoRepeatRows(o.m_gridAutoRepeatRows)
+ , m_autoRepeatColumnsInsertionPoint(o.m_autoRepeatColumnsInsertionPoint)
+ , m_autoRepeatRowsInsertionPoint(o.m_autoRepeatRowsInsertionPoint)
+ , m_autoRepeatType(o.m_autoRepeatType)
{
}
diff --git a/third_party/WebKit/Source/core/style/StyleGridData.h b/third_party/WebKit/Source/core/style/StyleGridData.h
index fa5fae1..e47bddc 100644
--- a/third_party/WebKit/Source/core/style/StyleGridData.h
+++ b/third_party/WebKit/Source/core/style/StyleGridData.h
@@ -50,9 +50,14 @@ public:
&& m_gridAutoFlow == o.m_gridAutoFlow && m_gridAutoRows == o.m_gridAutoRows && m_gridAutoColumns == o.m_gridAutoColumns
&& m_namedGridColumnLines == o.m_namedGridColumnLines && m_namedGridRowLines == o.m_namedGridRowLines
&& m_orderedNamedGridColumnLines == o.m_orderedNamedGridColumnLines && m_orderedNamedGridRowLines == o.m_orderedNamedGridRowLines
+ && m_autoRepeatNamedGridColumnLines == o.m_autoRepeatNamedGridColumnLines && m_autoRepeatNamedGridRowLines == o.m_autoRepeatNamedGridRowLines
+ && m_autoRepeatOrderedNamedGridColumnLines == o.m_autoRepeatOrderedNamedGridColumnLines && m_autoRepeatOrderedNamedGridRowLines == o.m_autoRepeatOrderedNamedGridRowLines
&& m_namedGridArea == o.m_namedGridArea && m_namedGridArea == o.m_namedGridArea
&& m_namedGridAreaRowCount == o.m_namedGridAreaRowCount && m_namedGridAreaColumnCount == o.m_namedGridAreaColumnCount
- && m_gridColumnGap == o.m_gridColumnGap && m_gridRowGap == o.m_gridRowGap;
+ && m_gridColumnGap == o.m_gridColumnGap && m_gridRowGap == o.m_gridRowGap
+ && m_gridAutoRepeatColumns == o.m_gridAutoRepeatColumns && m_gridAutoRepeatRows == o.m_gridAutoRepeatRows
+ && m_autoRepeatColumnsInsertionPoint == o.m_autoRepeatColumnsInsertionPoint && m_autoRepeatRowsInsertionPoint == o.m_autoRepeatRowsInsertionPoint
+ && m_autoRepeatType == o.m_autoRepeatType;
}
bool operator!=(const StyleGridData& o) const
@@ -71,6 +76,11 @@ public:
OrderedNamedGridLines m_orderedNamedGridColumnLines;
OrderedNamedGridLines m_orderedNamedGridRowLines;
+ NamedGridLinesMap m_autoRepeatNamedGridColumnLines;
+ NamedGridLinesMap m_autoRepeatNamedGridRowLines;
+ OrderedNamedGridLines m_autoRepeatOrderedNamedGridColumnLines;
+ OrderedNamedGridLines m_autoRepeatOrderedNamedGridRowLines;
+
unsigned m_gridAutoFlow : GridAutoFlowBits;
GridTrackSize m_gridAutoRows;
@@ -85,6 +95,13 @@ public:
Length m_gridColumnGap;
Length m_gridRowGap;
+ Vector<GridTrackSize> m_gridAutoRepeatColumns;
+ Vector<GridTrackSize> m_gridAutoRepeatRows;
+
+ size_t m_autoRepeatColumnsInsertionPoint;
+ size_t m_autoRepeatRowsInsertionPoint;
+
+ AutoRepeatType m_autoRepeatType;
private:
StyleGridData();
StyleGridData(const StyleGridData&);