- Revision
- 208277
- Author
- r...@igalia.com
- Date
- 2016-11-02 05:40:23 -0700 (Wed, 02 Nov 2016)
Log Message
[css-grid] mimax(auto, <flex>) should be serialized as <flex>
https://bugs.webkit.org/show_bug.cgi?id=164316
Reviewed by Sergio Villar Senin.
Source/WebCore:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::specifiedValueForGridTrackSize): Add a simple if to serialize
properly this case.
* rendering/style/GridLength.h:
(WebCore::GridLength::isAuto): Add new function to check if GridLength
is or not "auto".
LayoutTests:
Add new test case to verify it. We can only check it
using grid-auto-columns|rows, because grid-template-columns|rows
is serialized to the used breadth.
* fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/grid-auto-columns-rows-get-set.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (208276 => 208277)
--- trunk/LayoutTests/ChangeLog 2016-11-02 11:37:26 UTC (rev 208276)
+++ trunk/LayoutTests/ChangeLog 2016-11-02 12:40:23 UTC (rev 208277)
@@ -1,3 +1,17 @@
+2016-11-02 Manuel Rego Casasnovas <r...@igalia.com>
+
+ [css-grid] mimax(auto, <flex>) should be serialized as <flex>
+ https://bugs.webkit.org/show_bug.cgi?id=164316
+
+ Reviewed by Sergio Villar Senin.
+
+ Add new test case to verify it. We can only check it
+ using grid-auto-columns|rows, because grid-template-columns|rows
+ is serialized to the used breadth.
+
+ * fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt:
+ * fast/css-grid-layout/grid-auto-columns-rows-get-set.html:
+
2016-11-02 Romain Bellessort <romain.belless...@crf.canon.fr>
[Readable Streams API] Enable creation of ReadableByteStreamController
Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt (208276 => 208277)
--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt 2016-11-02 11:37:26 UTC (rev 208276)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt 2016-11-02 12:40:23 UTC (rev 208277)
@@ -52,6 +52,8 @@
PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto 30px minmax(10%, 60%)"
PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "fit-content(10px) fit-content(30%)"
PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "fit-content(5%) fit-content(40px)"
+PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "2fr"
+PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "1fr"
Test setting grid-auto-columns and grid-auto-rows to bad minmax value through JS
PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set.html (208276 => 208277)
--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set.html 2016-11-02 11:37:26 UTC (rev 208276)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set.html 2016-11-02 12:40:23 UTC (rev 208277)
@@ -123,6 +123,7 @@
testAutoValues("minmax(-webkit-min-content, -webkit-max-content)", "minmax(-webkit-max-content, -webkit-min-content)");
testAutoValues("minmax(-webkit-min-content, 10px) 48px 5%", "auto 30px minmax(10%, 60%)");
testAutoValues("fit-content(10px) fit-content(30%)", "fit-content(5%) fit-content(calc(20px + 2em))", "fit-content(10px) fit-content(30%)", "fit-content(5%) fit-content(40px)");
+testAutoValues("minmax(auto, 2fr)", "minmax(auto, 1fr)", "2fr", "1fr");
debug("");
debug("Test setting grid-auto-columns and grid-auto-rows to bad minmax value through JS");
Modified: trunk/Source/WebCore/ChangeLog (208276 => 208277)
--- trunk/Source/WebCore/ChangeLog 2016-11-02 11:37:26 UTC (rev 208276)
+++ trunk/Source/WebCore/ChangeLog 2016-11-02 12:40:23 UTC (rev 208277)
@@ -1,3 +1,17 @@
+2016-11-02 Manuel Rego Casasnovas <r...@igalia.com>
+
+ [css-grid] mimax(auto, <flex>) should be serialized as <flex>
+ https://bugs.webkit.org/show_bug.cgi?id=164316
+
+ Reviewed by Sergio Villar Senin.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::specifiedValueForGridTrackSize): Add a simple if to serialize
+ properly this case.
+ * rendering/style/GridLength.h:
+ (WebCore::GridLength::isAuto): Add new function to check if GridLength
+ is or not "auto".
+
2016-11-02 Romain Bellessort <romain.belless...@crf.canon.fr>
[Readable Streams API] Enable creation of ReadableByteStreamController
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (208276 => 208277)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2016-11-02 11:37:26 UTC (rev 208276)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2016-11-02 12:40:23 UTC (rev 208277)
@@ -1012,6 +1012,9 @@
}
default:
ASSERT(trackSize.type() == MinMaxTrackSizing);
+ if (trackSize.minTrackBreadth().isAuto() && trackSize.maxTrackBreadth().isFlex())
+ return CSSValuePool::singleton().createValue(trackSize.maxTrackBreadth().flex(), CSSPrimitiveValue::CSS_FR);
+
auto minMaxTrackBreadths = CSSValueList::createCommaSeparated();
minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), style));
minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.maxTrackBreadth(), style));
Modified: trunk/Source/WebCore/rendering/style/GridLength.h (208276 => 208277)
--- trunk/Source/WebCore/rendering/style/GridLength.h 2016-11-02 11:37:26 UTC (rev 208276)
+++ trunk/Source/WebCore/rendering/style/GridLength.h 2016-11-02 12:40:23 UTC (rev 208277)
@@ -72,6 +72,7 @@
}
bool isContentSized() const { return m_type == LengthType && (m_length.isAuto() || m_length.isMinContent() || m_length.isMaxContent()); }
+ bool isAuto() const { return m_type == LengthType && m_length.isAuto(); }
private:
// Ideally we would put the 2 following fields in a union, but Length has a constructor,