Changeset 121613 in webkit
- Timestamp:
- Jun 29, 2012 8:16:23 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r121611 r121613 1 2012-06-29 Tony Chang <tony@chromium.org> 2 3 All child elements of a flex container should be turned into a flex item 4 https://bugs.webkit.org/show_bug.cgi?id=90323 5 6 Reviewed by Ojan Vafai. 7 8 * css3/flexbox/anonymous-block-expected.html: 9 * css3/flexbox/anonymous-block.html: 10 * css3/flexbox/flexitem-expected.txt: 11 * css3/flexbox/flexitem.html: 12 1 13 2012-06-29 Tony Chang <tony@chromium.org> 2 14 -
trunk/LayoutTests/css3/flexbox/anonymous-block-expected.html
r99120 r121613 2 2 <html> 3 3 <body> 4 <p>This tests that text nodes that have a flexbox as a parent are wrapped in 5 anonymous blocks.</p> 4 6 <div>This text should be visible.</div> 7 <table cellpadding=0 cellspacing=0 style="width: 100%"><tr> 8 <td>spacer</td> 9 <td style="text-align: center">middle</td> 10 <td style="text-align: right">spacer</td> 11 </tr></table> 5 12 </body> 6 13 </html> -
trunk/LayoutTests/css3/flexbox/anonymous-block.html
r117385 r121613 2 2 <html> 3 3 <body> 4 <p>This tests that text nodes that have a flexbox as a parent are wrapped in 5 anonymous blocks.</p> 4 6 <div style="display: -webkit-flex">This text should be visible.</div> 7 <div style="display: -webkit-flex; -webkit-justify-content: space-between"> 8 spacer<span>middle</span>spacer 9 </div> 5 10 </body> 6 11 </html> -
trunk/LayoutTests/css3/flexbox/flexitem-expected.txt
r120132 r121613 27 27 </div> 28 28 PASS 29 30 31 29 button 30 PASS 31 PASS 32 32 FAIL: 33 33 Expected 600 for width, but got 0. -
trunk/LayoutTests/css3/flexbox/flexitem.html
r120330 r121613 71 71 72 72 <div class="flexbox"> 73 <!-- The <spans> get wrapped in anonymous blocks that have the default value 74 of flex: 0 1 auto. Setting a flex: on these spans should do nothing. --> 75 <span style="-webkit-flex: 5 0 0"></span> 76 <button data-expected-display="block" data-expected-width="600" style="-webkit-flex: 1 0 0">button</button> 77 <span style="-webkit-lex: 2 2 100px"></span> 73 <span data-expected-display="block" data-expected-width="200" style="-webkit-flex: 2 0 0"></span> 74 <button data-expected-display="block" data-expected-width="100" style="-webkit-flex: 1 0 0">button</button> 75 <span data-expected-display="block" data-expected-width="300" style="-webkit-flex: 2 2 100px"></span> 78 76 </div> 79 77 80 <div class="flexbox" >78 <div class="flexbox" style="width: 700px"> 81 79 <div data-expected-display="block" data-expected-width="100" style="display: inline-block;"></div> 82 80 <div data-expected-display="-webkit-box" data-expected-width="100" style="display: -webkit-inline-box;"></div> … … 85 83 <div data-expected-display="block" data-expected-width="100" style="display: compact"></div> 86 84 <div data-expected-display="block" data-expected-width="100" style="display: run-in"></div> 87 <!-- This inline should be wrapping in an anonymous block, which gets the 88 default flex: 0 1 auto. --> 89 <div data-expected-display="inline" data-expected-width="0" style="display: inline;"></div> 85 <div data-expected-display="block" data-expected-width="100" style="display: inline;"></div> 90 86 </div> 91 87 -
trunk/Source/WebCore/ChangeLog
r121612 r121613 1 2012-06-29 Tony Chang <tony@chromium.org> 2 3 All child elements of a flex container should be turned into a flex item 4 https://bugs.webkit.org/show_bug.cgi?id=90323 5 6 Reviewed by Ojan Vafai. 7 8 We used to only convert some elements to blocks, but now we convert everything except text nodes. 9 This was recently changed here: 10 http://wiki.csswg.org/topics/css3-flexbox-flexbox-replaced-children 11 12 Tests: css3/flexbox/anonymous-block.html : Add new test case. 13 css3/flexbox/flexitem.html: Update results. 14 15 * css/StyleResolver.cpp: 16 (WebCore::StyleResolver::collectMatchingRulesForList): 17 1 18 2012-06-29 Joshua Bell <jsbell@chromium.org> 2 19 -
trunk/Source/WebCore/css/StyleResolver.cpp
r121513 r121613 1982 1982 } 1983 1983 1984 static bool shouldBecomeBlockWhenParentIsFlexbox(const Element* element)1985 {1986 return element->hasTagName(imgTag)1987 || element->hasTagName(canvasTag)1988 #if ENABLE(SVG)1989 || element->hasTagName(SVGNames::svgTag)1990 #endif1991 #if ENABLE(MATHML)1992 || element->hasTagName(MathMLNames::mathTag)1993 #endif1994 #if ENABLE(VIDEO)1995 || element->hasTagName(audioTag)1996 || element->hasTagName(videoTag)1997 #endif1998 || element->hasTagName(iframeTag)1999 || element->hasTagName(objectTag)2000 || element->hasTagName(embedTag)2001 || element->hasTagName(appletTag)2002 #if ENABLE(PROGRESS_TAG)2003 || element->hasTagName(progressTag)2004 #endif2005 #if ENABLE(METER_TAG)2006 || element->hasTagName(meterTag)2007 #endif2008 || element->hasTagName(inputTag)2009 || element->hasTagName(buttonTag)2010 || element->hasTagName(selectTag)2011 || element->hasTagName(textareaTag);2012 }2013 2014 1984 static EDisplay equivalentBlockDisplay(EDisplay display, bool isFloating, bool strictParsing) 2015 1985 { … … 2156 2126 style->setWritingMode(TopToBottomWritingMode); 2157 2127 2158 if (e && e->parentNode() && e->parentNode()->renderer() && e->parentNode()->renderer()->isFlexibleBox()) { 2159 if (shouldBecomeBlockWhenParentIsFlexbox(e)) 2160 style->setDisplay(BLOCK); 2161 else if (style->display() != INLINE) 2162 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloating(), m_checker.strictParsing())); 2163 } 2128 if (e && e->parentNode() && e->parentNode()->renderer() && e->parentNode()->renderer()->isFlexibleBox()) 2129 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloating(), m_checker.strictParsing())); 2164 2130 } 2165 2131
Note: See TracChangeset
for help on using the changeset viewer.