| OLD | NEW |
| 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 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2352 } | 2352 } |
| 2353 if (height.isFixed()) | 2353 if (height.isFixed()) |
| 2354 return height.value(); | 2354 return height.value(); |
| 2355 if (height.isPercent()) | 2355 if (height.isPercent()) |
| 2356 return computePercentageLogicalHeight(height); | 2356 return computePercentageLogicalHeight(height); |
| 2357 return -1; | 2357 return -1; |
| 2358 } | 2358 } |
| 2359 | 2359 |
| 2360 bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox*
containingBlock) const | 2360 bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox*
containingBlock) const |
| 2361 { | 2361 { |
| 2362 // If the writing mode of the containing block is orthogonal to ours, it mea
ns that we shouldn't |
| 2363 // skip anything, since we're going to resolve the percentage height against
a containing block *width*. |
| 2364 if (isHorizontalWritingMode() != containingBlock->isHorizontalWritingMode()) |
| 2365 return false; |
| 2366 |
| 2362 // Flow threads for multicol or paged overflow should be skipped. They are i
nvisible to the DOM, | 2367 // Flow threads for multicol or paged overflow should be skipped. They are i
nvisible to the DOM, |
| 2363 // and percent heights of children should be resolved against the multicol o
r paged container. | 2368 // and percent heights of children should be resolved against the multicol o
r paged container. |
| 2364 if (containingBlock->isRenderFlowThread()) | 2369 if (containingBlock->isRenderFlowThread()) |
| 2365 return true; | 2370 return true; |
| 2366 | 2371 |
| 2367 // For quirks mode and anonymous blocks, we skip auto-height containingBlock
s when computing percentages. | 2372 // For quirks mode and anonymous blocks, we skip auto-height containingBlock
s when computing percentages. |
| 2368 // For standards mode, we treat the percentage as auto if it has an auto-hei
ght containing block. | 2373 // For standards mode, we treat the percentage as auto if it has an auto-hei
ght containing block. |
| 2369 if (!document().inQuirksMode() && !containingBlock->isAnonymousBlock()) | 2374 if (!document().inQuirksMode() && !containingBlock->isAnonymousBlock()) |
| 2370 return false; | 2375 return false; |
| 2371 return !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPosit
ioned() && containingBlock->style()->logicalHeight().isAuto() && isHorizontalWri
tingMode() == containingBlock->isHorizontalWritingMode(); | 2376 |
| 2377 return !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPosit
ioned() && containingBlock->style()->logicalHeight().isAuto(); |
| 2372 } | 2378 } |
| 2373 | 2379 |
| 2374 LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const | 2380 LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const |
| 2375 { | 2381 { |
| 2376 LayoutUnit availableHeight = -1; | 2382 LayoutUnit availableHeight = -1; |
| 2377 | 2383 |
| 2378 bool skippedAutoHeightContainingBlock = false; | 2384 bool skippedAutoHeightContainingBlock = false; |
| 2379 RenderBlock* cb = containingBlock(); | 2385 RenderBlock* cb = containingBlock(); |
| 2380 const RenderBox* containingBlockChild = this; | 2386 const RenderBox* containingBlockChild = this; |
| 2381 LayoutUnit rootMarginBorderPaddingHeight = 0; | 2387 LayoutUnit rootMarginBorderPaddingHeight = 0; |
| (...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4521 computedValues.m_margins.m_end = marginEnd(); | 4527 computedValues.m_margins.m_end = marginEnd(); |
| 4522 | 4528 |
| 4523 setLogicalTop(oldLogicalTop); | 4529 setLogicalTop(oldLogicalTop); |
| 4524 setLogicalWidth(oldLogicalWidth); | 4530 setLogicalWidth(oldLogicalWidth); |
| 4525 setLogicalLeft(oldLogicalLeft); | 4531 setLogicalLeft(oldLogicalLeft); |
| 4526 setMarginLeft(oldMarginLeft); | 4532 setMarginLeft(oldMarginLeft); |
| 4527 setMarginRight(oldMarginRight); | 4533 setMarginRight(oldMarginRight); |
| 4528 } | 4534 } |
| 4529 | 4535 |
| 4530 } // namespace blink | 4536 } // namespace blink |
| OLD | NEW |