Changeset 151997 in webkit
- Timestamp:
- Jun 26, 2013 10:31:26 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r151993 r151997 1 2013-06-25 David Hyatt <hyatt@apple.com> 2 3 Flex boxes (both old and new) don't handle max-height images correctly. 4 https://bugs.webkit.org/show_bug.cgi?id=118000 5 6 Reviewed by Beth Dakin. 7 8 * css3/flexbox/image-percent-max-height-expected.html: Added. 9 * css3/flexbox/image-percent-max-height.html: Added. 10 * css3/flexbox/resources/hero.png: Added. 11 * fast/flexbox/image-percent-max-height-expected.html: Added. 12 * fast/flexbox/image-percent-max-height.html: Added. 13 * fast/flexbox/resources/hero.png: Added. 14 1 15 2013-06-26 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/LayoutTests/tables/mozilla_expected_failures/bugs/bug85016-expected.txt
r142981 r151997 1 layer at (0,0) size 9 82x20591 layer at (0,0) size 960x2059 2 2 RenderView at (0,0) size 785x585 3 3 layer at (0,0) size 785x2059 … … 13 13 RenderBlock {DIV} at (32,735) size 657x657 [border: (3px dotted #008000)] 14 14 RenderBlock {DIV} at (35,35) size 587x587 [border: (1px solid #FF0000)] 15 RenderImage {IMG} at (1,1) size 8 82x58515 RenderImage {IMG} at (1,1) size 860x585 16 16 RenderText {#text} at (0,0) size 0x0 17 17 RenderBlock {P} at (0,1424) size 721x18 -
trunk/Source/WebCore/ChangeLog
r151996 r151997 1 2013-06-25 David Hyatt <hyatt@apple.com> 2 3 Flex boxes (both old and new) don't handle max-height images correctly. 4 https://bugs.webkit.org/show_bug.cgi?id=118000 5 6 Reviewed by Beth Dakin. 7 8 Tests: css3/flexbox/image-percent-max-height.html 9 fast/flexbox/image-percent-max-height.html 10 11 * rendering/RenderBlock.cpp: 12 (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants): 13 (WebCore::RenderBlock::layoutBlockChildren): 14 Pull the percentage height descendant code that dirties those descendants 15 out of layoutBlockChildren and into a protected helper function, 16 dirtyForLayoutFromPercentageHeightDescendants, that can be called from the 17 flex box code. 18 19 Also patch dirtyForLayoutFromPercentageHeightDescendants so that it will dirty 20 preferred logical widths when a child has an aspect ratio, since we know that 21 percentage height changes will potentially affect the preferred widths of the image and 22 its ancestor blocks. 23 24 * rendering/RenderBlock.h: 25 Declaration of the new dirtyForLayoutFromPercentageHeightDescendants function. 26 27 * rendering/RenderDeprecatedFlexibleBox.cpp: 28 (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): 29 Make the old flex box code call dirtyForLayoutFromPercentageHeightDescendants so 30 that everything is dirtied properly. 31 32 (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): 33 (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): 34 Remove the isReplaced()/percentage height/width dirtying now that the old flexible 35 box is using the same dirtying mechanism as RenderBlock. 36 37 * rendering/RenderFlexibleBox.cpp: 38 (WebCore::RenderFlexibleBox::layoutBlock): 39 Patch the new flexible box code to use the dirtying mechanism that RenderBlock 40 uses for percentage heights/widths on replaced descendants. 41 42 * rendering/RenderObject.h: 43 (WebCore::RenderObject::hasAspectRatio): 44 Pulled the static helper function from RenderReplaced into a full-blown method 45 on RenderObject, so that dirtyForLayoutFromPercentageHeightDescendants can call 46 it to check if an object has an aspect ratio. 47 48 * rendering/RenderReplaced.cpp: 49 (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox): 50 (WebCore::RenderReplaced::computeIntrinsicRatioInformation): 51 Patch the call sites of the static helper function to use hasAspectRatio instead 52 and get rid of the static in the cpp file. 53 1 54 2013-06-26 Kangil Han <kangil.han@samsung.com> 2 55 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r151946 r151997 2520 2520 } 2521 2521 2522 void RenderBlock::dirtyForLayoutFromPercentageHeightDescendants() 2523 { 2524 if (!gPercentHeightDescendantsMap) 2525 return; 2526 2527 TrackedRendererListHashSet* descendants = gPercentHeightDescendantsMap->get(this); 2528 if (!descendants) 2529 return; 2530 2531 TrackedRendererListHashSet::iterator end = descendants->end(); 2532 for (TrackedRendererListHashSet::iterator it = descendants->begin(); it != end; ++it) { 2533 RenderBox* box = *it; 2534 while (box != this) { 2535 if (box->normalChildNeedsLayout()) 2536 break; 2537 box->setChildNeedsLayout(true, MarkOnlyThis); 2538 2539 // If the width of an image is affected by the height of a child (e.g., an image with an aspect ratio), 2540 // then we have to dirty preferred widths, since even enclosing blocks can become dirty as a result. 2541 // (A horizontal flexbox that contains an inline image wrapped in an anonymous block for example.) 2542 if (box->hasAspectRatio()) 2543 box->setPreferredLogicalWidthsDirty(true); 2544 2545 box = box->containingBlock(); 2546 ASSERT(box); 2547 if (!box) 2548 break; 2549 } 2550 } 2551 } 2552 2522 2553 void RenderBlock::layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloatLogicalBottom) 2523 2554 { 2524 if (gPercentHeightDescendantsMap) { 2525 if (TrackedRendererListHashSet* descendants = gPercentHeightDescendantsMap->get(this)) { 2526 TrackedRendererListHashSet::iterator end = descendants->end(); 2527 for (TrackedRendererListHashSet::iterator it = descendants->begin(); it != end; ++it) { 2528 RenderBox* box = *it; 2529 while (box != this) { 2530 if (box->normalChildNeedsLayout()) 2531 break; 2532 box->setChildNeedsLayout(true, MarkOnlyThis); 2533 box = box->containingBlock(); 2534 ASSERT(box); 2535 if (!box) 2536 break; 2537 } 2538 } 2539 } 2540 } 2555 dirtyForLayoutFromPercentageHeightDescendants(); 2541 2556 2542 2557 LayoutUnit beforeEdge = borderAndPaddingBefore(); -
trunk/Source/WebCore/rendering/RenderBlock.h
r151750 r151997 1095 1095 1096 1096 protected: 1097 void dirtyForLayoutFromPercentageHeightDescendants(); 1098 1097 1099 void determineLogicalLeftPositionForChild(RenderBox* child, ApplyLayoutDeltaMode = DoNotApplyLayoutDelta); 1098 1100 -
trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
r151750 r151997 332 332 appendChildFrameRects(this, oldChildRects); 333 333 334 dirtyForLayoutFromPercentageHeightDescendants(); 335 334 336 if (isHorizontal()) 335 337 layoutHorizontalBox(relayoutChildren); … … 457 459 LayoutUnit maxAscent = 0, maxDescent = 0; 458 460 for (RenderBox* child = iterator.first(); child; child = iterator.next()) { 459 if (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())))461 if (relayoutChildren) 460 462 child->setChildNeedsLayout(true, MarkOnlyThis); 461 463 … … 759 761 for (RenderBox* child = iterator.first(); child; child = iterator.next()) { 760 762 // Make sure we relayout children if we need it. 761 if (!haveLineClamp && (relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent()))))763 if (!haveLineClamp && relayoutChildren) 762 764 child->setChildNeedsLayout(true, MarkOnlyThis); 763 765 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r151750 r151997 350 350 RenderBlock::startDelayUpdateScrollInfo(); 351 351 352 dirtyForLayoutFromPercentageHeightDescendants(); 353 352 354 Vector<LineContext> lineContexts; 353 355 OrderHashSet orderValues; -
trunk/Source/WebCore/rendering/RenderObject.h
r151622 r151997 479 479 virtual bool isSVGResourceFilterPrimitive() const { return false; } 480 480 481 bool hasAspectRatio() const { return isReplaced() && (isImage() || isVideo() || isCanvas()); } 482 481 483 virtual RenderSVGResourceContainer* toRenderSVGResourceContainer(); 482 484 -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r148921 r151997 249 249 } 250 250 251 static inline bool rendererHasAspectRatio(const RenderObject* renderer)252 {253 ASSERT(renderer);254 return renderer->isImage() || renderer->isCanvas() || renderer->isVideo();255 }256 257 251 void RenderReplaced::computeAspectRatioInformationForRenderBox(RenderBox* contentRenderer, FloatSize& constrainedSize, double& intrinsicRatio, bool& isPercentageIntrinsicSize) const 258 252 { … … 267 261 intrinsicSize.scale(style()->effectiveZoom()); 268 262 269 if ( rendererHasAspectRatio(this) && isPercentageIntrinsicSize)263 if (hasAspectRatio() && isPercentageIntrinsicSize) 270 264 intrinsicRatio = 1; 271 265 … … 313 307 314 308 // Figure out if we need to compute an intrinsic ratio. 315 if (intrinsicSize.isEmpty() || ! rendererHasAspectRatio(this))309 if (intrinsicSize.isEmpty() || !hasAspectRatio()) 316 310 return; 317 311
Note: See TracChangeset
for help on using the changeset viewer.