Changeset 132104 in webkit
- Timestamp:
- Oct 22, 2012 10:45:33 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r132103 r132104 1 2012-10-22 Tony Chang <tony@chromium.org> 2 3 Fix some baseline flexbox alignment 4 https://bugs.webkit.org/show_bug.cgi?id=99879 5 6 Reviewed by Ojan Vafai. 7 8 Additional test cases for baseline aligning flexbox. 9 10 * css3/flexbox/flexbox-baseline-margins.html: Added. 11 * css3/flexbox/resources/flexbox.css: 12 (.flex-one): New cross browser value. 13 * platform/chromium-linux/css3/flexbox/flexbox-baseline-margins-expected.png: Added. 14 * platform/chromium-linux/css3/flexbox/flexbox-baseline-margins-expected.txt: Added. 15 * platform/chromium/TestExpectations: 16 * platform/efl/TestExpectations: 17 * platform/gtk/TestExpectations: 18 * platform/mac/TestExpectations: 19 * platform/qt/TestExpectations: 20 * platform/win/TestExpectations: 21 1 22 2012-10-22 Tony Chang <tony@chromium.org> 2 23 -
trunk/LayoutTests/css3/flexbox/resources/flexbox.css
r130457 r132104 15 15 -webkit-flex: auto; 16 16 -moz-flex: auto; 17 } 18 .flex-one { 19 -webkit-flex: 1; 20 -moz-flex: 1; 17 21 } 18 22 -
trunk/LayoutTests/platform/chromium/TestExpectations
r132043 r132104 4035 4035 webkit.org/b/99421 platform/chromium/fast/forms/suggestion-picker/time-suggestion-picker-appearance.html [ Pass ImageOnlyFailure ] 4036 4036 4037 webkit.org/b/99878 [ Mac Win ] css3/flexbox/flexbox-baseline-margins.html [ Missing ImageOnlyFailure ] 4038 4037 4039 # Flaky crashing on debug 4038 4040 webkit.org/b/99604 [ Mac Win ] http/tests/workers/text-encoding.html [ Pass Crash ] -
trunk/LayoutTests/platform/efl/TestExpectations
r131984 r132104 1967 1967 webkit.org/b/98587 fast/writing-mode/vertical-subst-font-vert-no-dflt.html [ ImageOnlyFailure ] 1968 1968 1969 webkit.org/b/99878 css3/flexbox/flexbox-baseline-margins.html [ Missing ImageOnlyFailure ] 1970 1969 1971 # Needs rebaseline eventually 1970 1972 webkit.org/b/97990 mathml/presentation/attributes.xhtml [ Failure ] -
trunk/LayoutTests/platform/gtk/TestExpectations
r132082 r132104 1358 1358 webkit.org/b/98587 fast/writing-mode/vertical-subst-font-vert-no-dflt.html [ ImageOnlyFailure ] 1359 1359 1360 webkit.org/b/99878 css3/flexbox/flexbox-baseline-margins.html [ Missing ImageOnlyFailure ] 1361 1360 1362 webkit.org/b/98612 [ Release ] fast/dom/gc-dom-tree-lifetime.html [ Failure ] 1361 1363 -
trunk/LayoutTests/platform/mac/TestExpectations
r132043 r132104 1299 1299 webkit.org/b/86146 css3/supports.html 1300 1300 1301 webkit.org/b/99878 css3/flexbox/flexbox-baseline-margins.html [ Missing ImageOnlyFailure ] 1302 1301 1303 # Asserts in MessagePort::contextDestroyed, but the assert usually gets attributed to later tests. 1302 1304 webkit.org/b/94458 fast/events/message-port-constructor-for-deleted-document.html -
trunk/LayoutTests/platform/qt/TestExpectations
r132053 r132104 2415 2415 webkit.org/b/90951 fast/text/shaping 2416 2416 2417 webkit.org/b/99878 css3/flexbox/flexbox-baseline-margins.html [ Missing ImageOnlyFailure ] 2418 2417 2419 # Flaky tests 2418 2420 webkit.org/b/91376 http/tests/security/sandboxed-iframe-modify-self.html [ Failure Pass ] -
trunk/LayoutTests/platform/win/TestExpectations
r132103 r132104 2332 2332 #https://bugs.webkit.org/show_bug.cgi?id=98306 2333 2333 css3/flexbox/flexbox-baseline.html 2334 #https://bugs.webkit.org/show_bug.cgi?id=99878 2335 css3/flexbox/flexbox-baseline-margins.html 2334 2336 2335 2337 # css3-conditionals support is not yet enabled. http://webkit.org/b/86146 -
trunk/Source/WebCore/ChangeLog
r132102 r132104 1 2012-10-22 Tony Chang <tony@chromium.org> 2 3 Fix some baseline flexbox alignment 4 https://bugs.webkit.org/show_bug.cgi?id=99879 5 6 Reviewed by Ojan Vafai. 7 8 Fix a bug where we weren't handling margin properly on inline-flexbox. 9 Fix a bug where we weren't getting the edge of the content box properly when synthesizing 10 a baseline. 11 12 Test: css3/flexbox/flexbox-baseline-margins.html 13 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::baselinePosition): 16 (WebCore::RenderBlock::inlineBlockBaseline): Add a new method that is used when calculating an inline-block's 17 baseline. Previously we would use lastLineBoxBaseline. 18 (WebCore::RenderBlock::lastLineBoxBaseline): Pass in direction and when searching children, use inlineBlockBaseline. 19 * rendering/RenderBlock.h: 20 (RenderBlock): Make lastLineBoxBaseline non-virtual. 21 * rendering/RenderBox.h: 22 (WebCore::RenderBox::inlineBlockBaseline): Replace lastLineBoxBaseline with inlineBlockBaseline. 23 * rendering/RenderFlexibleBox.cpp: 24 (WebCore::synthesizedBaselineFromContentBox): Helper method for getting the baseline from the content box. 25 (WebCore::RenderFlexibleBox::baselinePosition): Always include the margin. This fixes the inline-flexbox case. 26 (WebCore::RenderFlexibleBox::firstLineBoxBaseline): Fix a case where we didn't synthesize a baseline. Returning -1 means there is no baseline, but we can 27 synthesize a baseline if we have a flexitem without text. 28 (WebCore::RenderFlexibleBox::inlineBlockBaseline): 29 * rendering/RenderFlexibleBox.h: 30 * rendering/RenderTable.cpp: Replace lastLineBoxBaseline with inlineBlockBaseline. 31 (WebCore::RenderTable::inlineBlockBaseline): Try to make comment more direct. 32 * rendering/RenderTable.h: 33 (RenderTable): Replace lastLineBoxBaseline with inlineBlockBaseline. 34 1 35 2012-10-22 Levi Weintraub <leviw@chromium.org> 2 36 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r131971 r132104 6206 6206 : (layer()->horizontalScrollbar() || layer()->scrollXOffset() != 0)))) || (isWritingModeRoot() && !isRubyRun()); 6207 6207 6208 LayoutUnit baselinePos = ignoreBaseline ? static_cast<LayoutUnit>(-1) : lastLineBoxBaseline();6208 LayoutUnit baselinePos = ignoreBaseline ? static_cast<LayoutUnit>(-1) : inlineBlockBaseline(direction); 6209 6209 6210 6210 LayoutUnit bottomOfContent = direction == HorizontalLine ? borderTop() + paddingTop() + contentHeight() : borderRight() + paddingRight() + contentWidth(); … … 6243 6243 } 6244 6244 6245 LayoutUnit RenderBlock::lastLineBoxBaseline() const 6245 LayoutUnit RenderBlock::inlineBlockBaseline(LineDirectionMode direction) const 6246 { 6247 return lastLineBoxBaseline(direction); 6248 } 6249 6250 LayoutUnit RenderBlock::lastLineBoxBaseline(LineDirectionMode lineDirection) const 6246 6251 { 6247 6252 if (!isBlockFlow() || (isWritingModeRoot() && !isRubyRun())) 6248 6253 return -1; 6249 6250 LineDirectionMode lineDirection = isHorizontalWritingMode() ? HorizontalLine : VerticalLine;6251 6254 6252 6255 if (childrenInline()) { … … 6265 6268 if (!curr->isFloatingOrOutOfFlowPositioned()) { 6266 6269 haveNormalFlowChild = true; 6267 LayoutUnit result = curr-> lastLineBoxBaseline();6270 LayoutUnit result = curr->inlineBlockBaseline(lineDirection); 6268 6271 if (result != -1) 6269 6272 return curr->logicalTop() + result; // Translate to our coordinate space. -
trunk/Source/WebCore/rendering/RenderBlock.h
r131526 r132104 465 465 466 466 virtual LayoutUnit firstLineBoxBaseline() const; 467 virtual LayoutUnit lastLineBoxBaseline() const; 467 virtual LayoutUnit inlineBlockBaseline(LineDirectionMode) const OVERRIDE; 468 LayoutUnit lastLineBoxBaseline(LineDirectionMode) const; 468 469 469 470 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); -
trunk/Source/WebCore/rendering/RenderBox.h
r131348 r132104 474 474 475 475 virtual LayoutUnit firstLineBoxBaseline() const { return -1; } 476 virtual LayoutUnit lastLineBoxBaseline() const { return -1; }476 virtual LayoutUnit inlineBlockBaseline(LineDirectionMode) const { return -1; } // Returns -1 if we should skip this box when computing the baseline of an inline-block. 477 477 478 478 bool shrinkToAvoidFloats() const; -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r131972 r132104 236 236 } 237 237 238 LayoutUnit RenderFlexibleBox::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const 238 static LayoutUnit synthesizedBaselineFromContentBox(const RenderBox* box, LineDirectionMode direction) 239 { 240 return direction == HorizontalLine ? box->borderTop() + box->paddingTop() + box->contentHeight() : box->borderRight() + box->paddingRight() + box->contentWidth(); 241 } 242 243 LayoutUnit RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode direction, LinePositionMode) const 239 244 { 240 245 LayoutUnit baseline = firstLineBoxBaseline(); 241 if (baseline != -1) { 242 LayoutUnit marginAscent = direction == HorizontalLine ? marginTop() : marginRight(); 243 return baseline + marginAscent; 244 } 245 246 return RenderBox::baselinePosition(baselineType, firstLine, direction, linePositionMode); 246 if (baseline == -1) 247 baseline = synthesizedBaselineFromContentBox(this, direction); 248 249 LayoutUnit marginAscent = direction == HorizontalLine ? marginTop() : marginRight(); 250 return baseline + marginAscent; 247 251 } 248 252 … … 275 279 276 280 LayoutUnit baseline = baselineChild->firstLineBoxBaseline(); 277 if (baseline == -1) 278 return -1; 281 if (baseline == -1) { 282 // FIXME: We should pass |direction| into firstLineBoxBaseline and stop bailing out if we're a writing mode root. 283 // This would also fix some cases where the flexbox is orthogonal to its container. 284 LineDirectionMode direction = isHorizontalWritingMode() ? HorizontalLine : VerticalLine; 285 return synthesizedBaselineFromContentBox(baselineChild, direction) + baselineChild->logicalTop(); 286 } 279 287 280 288 return baseline + baselineChild->logicalTop(); 289 } 290 291 LayoutUnit RenderFlexibleBox::inlineBlockBaseline(LineDirectionMode direction) const 292 { 293 LayoutUnit baseline = firstLineBoxBaseline(); 294 if (baseline != -1) 295 return baseline; 296 297 LayoutUnit marginAscent = direction == HorizontalLine ? marginTop() : marginRight(); 298 return synthesizedBaselineFromContentBox(this, direction) + marginAscent; 281 299 } 282 300 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r130714 r132104 52 52 virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const OVERRIDE; 53 53 virtual LayoutUnit firstLineBoxBaseline() const OVERRIDE; 54 virtual LayoutUnit inlineBlockBaseline(LineDirectionMode) const OVERRIDE; 54 55 55 56 virtual void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) OVERRIDE; -
trunk/Source/WebCore/rendering/RenderTable.cpp
r131938 r132104 1230 1230 } 1231 1231 1232 LayoutUnit RenderTable:: lastLineBoxBaseline() const1233 { 1234 // Tables don't contribute their baseline towards the computation ofan inline-block's baseline.1232 LayoutUnit RenderTable::inlineBlockBaseline(LineDirectionMode) const 1233 { 1234 // Tables are skipped when computing an inline-block's baseline. 1235 1235 return -1; 1236 1236 } -
trunk/Source/WebCore/rendering/RenderTable.h
r131465 r132104 280 280 virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const OVERRIDE; 281 281 virtual LayoutUnit firstLineBoxBaseline() const OVERRIDE; 282 virtual LayoutUnit lastLineBoxBaseline() const OVERRIDE;282 virtual LayoutUnit inlineBlockBaseline(LineDirectionMode) const OVERRIDE; 283 283 284 284 RenderTableCol* slowColElement(unsigned col, bool* startEdge, bool* endEdge) const;
Note: See TracChangeset
for help on using the changeset viewer.