Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1208)

Side by Side Diff: Source/core/layout/LayoutBox.cpp

Issue 1289463002: Auto-height table cells must stop percentage resolution of child heights. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Right.. anonymous inline-blocks too. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/table/percent-height-inside-anonymous-cell-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after
2401 return -1; 2401 return -1;
2402 } 2402 }
2403 2403
2404 bool LayoutBox::skipContainingBlockForPercentHeightCalculation(const LayoutBox* containingBlock) const 2404 bool LayoutBox::skipContainingBlockForPercentHeightCalculation(const LayoutBox* containingBlock) const
2405 { 2405 {
2406 // If the writing mode of the containing block is orthogonal to ours, it mea ns that we shouldn't 2406 // If the writing mode of the containing block is orthogonal to ours, it mea ns that we shouldn't
2407 // skip anything, since we're going to resolve the percentage height against a containing block *width*. 2407 // skip anything, since we're going to resolve the percentage height against a containing block *width*.
2408 if (isHorizontalWritingMode() != containingBlock->isHorizontalWritingMode()) 2408 if (isHorizontalWritingMode() != containingBlock->isHorizontalWritingMode())
2409 return false; 2409 return false;
2410 2410
2411 // Anonymous layout objects are invisible to the DOM, so whatever they're do ing there, they 2411 // Anonymous blocks should not impede percentage resolution on a child. Exam ples of such
2412 // should not impede percentage resolution on a child. Examples of such anon ymous layout objects 2412 // anonymous blocks are blocks wrapped around inlines that have block siblin gs (from the CSS
2413 // are multicol flow threads and ruby runs. 2413 // spec) and multicol flow threads (an implementation detail). Another imple mentation detail,
2414 if (containingBlock->isAnonymous()) 2414 // ruby runs, create anonymous inline-blocks, so skip those too. All other t ypes of anonymous
2415 return true; 2415 // objects, such as table-cells, will be treated just as if they were non-an onymous.
2416 if (containingBlock->isAnonymous()) {
2417 EDisplay display = containingBlock->styleRef().display();
2418 return display == BLOCK || display == INLINE_BLOCK;
2419 }
2416 2420
2417 // For quirks mode, we skip most auto-height containing blocks when computin g percentages. 2421 // For quirks mode, we skip most auto-height containing blocks when computin g percentages.
2418 return document().inQuirksMode() && !containingBlock->isTableCell() && !cont ainingBlock->isOutOfFlowPositioned() && containingBlock->style()->logicalHeight( ).isAuto(); 2422 return document().inQuirksMode() && !containingBlock->isTableCell() && !cont ainingBlock->isOutOfFlowPositioned() && containingBlock->style()->logicalHeight( ).isAuto();
2419 } 2423 }
2420 2424
2421 LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const 2425 LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const
2422 { 2426 {
2423 LayoutUnit availableHeight = -1; 2427 LayoutUnit availableHeight = -1;
2424 2428
2425 bool skippedAutoHeightContainingBlock = false; 2429 bool skippedAutoHeightContainingBlock = false;
(...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after
4738 StyleImage* borderImage = style()->borderImage().image(); 4742 StyleImage* borderImage = style()->borderImage().image();
4739 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded(); 4743 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded();
4740 } 4744 }
4741 4745
4742 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const 4746 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const
4743 { 4747 {
4744 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr; 4748 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) : nullptr;
4745 } 4749 }
4746 4750
4747 } // namespace blink 4751 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/table/percent-height-inside-anonymous-cell-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698