Commit f72f3535 authored by tony@chromium.org's avatar tony@chromium.org
Browse files

flex-grow should be 1 when omitted from flex shorthand

https://bugs.webkit.org/show_bug.cgi?id=97480

Reviewed by Ojan Vafai.

Source/WebCore:

We were using 0, based on an outdated version of the spec.

Tests: css3/flexbox/flex-property-parsing.html
       css3/flexbox/flex-algorithm.html: New test case.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseFlex):

LayoutTests:

Update tests due to default CSS value changes.

* css3/flexbox/flex-algorithm-expected.txt:
* css3/flexbox/flex-algorithm.html: Add test case using -webkit-flex: auto.
* css3/flexbox/flex-property-parsing-expected.txt:
* css3/flexbox/flex-property-parsing.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6aa72d8c
2012-09-24 Tony Chang <tony@chromium.org>
flex-grow should be 1 when omitted from flex shorthand
https://bugs.webkit.org/show_bug.cgi?id=97480
Reviewed by Ojan Vafai.
Update tests due to default CSS value changes.
* css3/flexbox/flex-algorithm-expected.txt:
* css3/flexbox/flex-algorithm.html: Add test case using -webkit-flex: auto.
* css3/flexbox/flex-property-parsing-expected.txt:
* css3/flexbox/flex-property-parsing.html:
2012-09-24 Hans Muller <hmuller@adobe.com>
 
[CSS Exclusions] ExclusionShape API should use logical coordinates for input/output
......@@ -175,6 +175,16 @@ if (window.testRunner)
<div data-expected-width="200" style="-webkit-flex: 1"></div>
</div>
<div class="flexbox">
<div data-expected-width="200" style="-webkit-flex: auto">
<div style="width: 100px;"></div>
</div>
<div data-expected-width="100" style="-webkit-flex: auto"></div>
<div data-expected-width="300" style="-webkit-flex: auto">
<div style="width: 200px;"></div>
</div>
</div>
<!-- Test border/padding/margin on the flexbox itself. -->
<div data-expected-width="830" style="border: 10px solid; display: inline-block;">
<div data-expected-width="700" style="display: -webkit-flex; padding-left: 10px; padding-right: 20px; border-left: 30px solid; border-right: 40px solid; margin-left: 50px; margin-right:60px;" class="flexbox ">
......
......@@ -15,14 +15,14 @@ PASS flexitem.style.webkitFlex is "0 1 0px"
PASS getComputedStyle(flexitem).webkitFlex is "0 1 0px"
PASS flexitem.style.webkitFlex is "1.5 1 0px"
PASS getComputedStyle(flexitem).webkitFlex is "1.5 1 0px"
PASS flexitem.style.webkitFlex is "0 1 auto"
PASS getComputedStyle(flexitem).webkitFlex is "0 1 auto"
PASS flexitem.style.webkitFlex is "0 1 1px"
PASS getComputedStyle(flexitem).webkitFlex is "0 1 1px"
PASS flexitem.style.webkitFlex is "0 1 2em"
PASS getComputedStyle(flexitem).webkitFlex is "0 1 32px"
PASS flexitem.style.webkitFlex is "0 1 0px"
PASS getComputedStyle(flexitem).webkitFlex is "0 1 0px"
PASS flexitem.style.webkitFlex is "1 1 auto"
PASS getComputedStyle(flexitem).webkitFlex is "1 1 auto"
PASS flexitem.style.webkitFlex is "1 1 1px"
PASS getComputedStyle(flexitem).webkitFlex is "1 1 1px"
PASS flexitem.style.webkitFlex is "1 1 2em"
PASS getComputedStyle(flexitem).webkitFlex is "1 1 32px"
PASS flexitem.style.webkitFlex is "1 1 0px"
PASS getComputedStyle(flexitem).webkitFlex is "1 1 0px"
PASS flexitem.style.webkitFlex is "0 0 auto"
PASS getComputedStyle(flexitem).webkitFlex is "0 0 auto"
PASS flexitem.style.webkitFlex is "0 0 0px"
......
......@@ -40,20 +40,20 @@ shouldBeEqualToString('flexitem.style.webkitFlex', '1.5 1 0px');
shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1.5 1 0px');
flexitem.style.webkitFlex = 'auto';
shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 auto');
shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 auto');
shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 auto');
shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 auto');
flexitem.style.webkitFlex = '1px';
shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 1px');
shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 1px');
shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 1px');
shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 1px');
flexitem.style.webkitFlex = '2em';
shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 2em');
shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 32px');
shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 2em');
shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 32px');
flexitem.style.webkitFlex = '0px';
shouldBeEqualToString('flexitem.style.webkitFlex', '0 1 0px');
shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '0 1 0px');
shouldBeEqualToString('flexitem.style.webkitFlex', '1 1 0px');
shouldBeEqualToString('getComputedStyle(flexitem).webkitFlex', '1 1 0px');
flexitem.style.webkitFlex = 'none';
flexitem.style.webkitFlex = '-2'; // Invalid, return previous value.
......
2012-09-24 Tony Chang <tony@chromium.org>
flex-grow should be 1 when omitted from flex shorthand
https://bugs.webkit.org/show_bug.cgi?id=97480
Reviewed by Ojan Vafai.
We were using 0, based on an outdated version of the spec.
Tests: css3/flexbox/flex-property-parsing.html
css3/flexbox/flex-algorithm.html: New test case.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseFlex):
2012-09-24 Benjamin Poulain <benjamin@webkit.org>
 
Add support for query encoding to WTFURL
......@@ -5994,7 +5994,7 @@ bool CSSParser::parseFlex(CSSParserValueList* args, bool important)
}
if (flexGrow == unsetValue)
flexGrow = 0;
flexGrow = 1;
if (flexShrink == unsetValue)
flexShrink = 1;
if (!flexBasis)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment