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 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 // We need to see if margins on either the start side or the end side can co
ntain the floats in question. If they can, | 1517 // We need to see if margins on either the start side or the end side can co
ntain the floats in question. If they can, |
1518 // then just using the line width is inaccurate. In the case where a float c
ompletely fits, we don't need to use the line | 1518 // then just using the line width is inaccurate. In the case where a float c
ompletely fits, we don't need to use the line |
1519 // offset at all, but can instead push all the way to the content edge of th
e containing block. In the case where the float | 1519 // offset at all, but can instead push all the way to the content edge of th
e containing block. In the case where the float |
1520 // doesn't fit, we can use the line offset, but we need to grow it by the ma
rgin to reflect the fact that the margin was | 1520 // doesn't fit, we can use the line offset, but we need to grow it by the ma
rgin to reflect the fact that the margin was |
1521 // "consumed" by the float. Negative margins aren't consumed by the float, a
nd so we ignore them. | 1521 // "consumed" by the float. Negative margins aren't consumed by the float, a
nd so we ignore them. |
1522 width += portionOfMarginNotConsumedByFloat(childMarginStart, startOffsetForC
ontent, startOffsetForLine); | 1522 width += portionOfMarginNotConsumedByFloat(childMarginStart, startOffsetForC
ontent, startOffsetForLine); |
1523 width += portionOfMarginNotConsumedByFloat(childMarginEnd, endOffsetForConte
nt, endOffsetForLine); | 1523 width += portionOfMarginNotConsumedByFloat(childMarginEnd, endOffsetForConte
nt, endOffsetForLine); |
1524 return width; | 1524 return width; |
1525 } | 1525 } |
1526 | 1526 |
| 1527 LayoutUnit LayoutBox::containingBlockLogicalHeightForGetComputedStyle() const |
| 1528 { |
| 1529 if (hasOverrideContainingBlockLogicalHeight()) |
| 1530 return overrideContainingBlockContentLogicalHeight(); |
| 1531 |
| 1532 if (!isPositioned()) |
| 1533 return containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding
); |
| 1534 |
| 1535 LayoutBoxModelObject* cb = toLayoutBoxModelObject(container()); |
| 1536 LayoutUnit height = containingBlockLogicalHeightForPositioned(cb); |
| 1537 if (styleRef().position() != AbsolutePosition) |
| 1538 height -= cb->paddingLogicalHeight(); |
| 1539 return height; |
| 1540 } |
| 1541 |
1527 LayoutUnit LayoutBox::containingBlockLogicalWidthForContent() const | 1542 LayoutUnit LayoutBox::containingBlockLogicalWidthForContent() const |
1528 { | 1543 { |
1529 if (hasOverrideContainingBlockLogicalWidth()) | 1544 if (hasOverrideContainingBlockLogicalWidth()) |
1530 return overrideContainingBlockContentLogicalWidth(); | 1545 return overrideContainingBlockContentLogicalWidth(); |
1531 | 1546 |
1532 LayoutBlock* cb = containingBlock(); | 1547 LayoutBlock* cb = containingBlock(); |
1533 return cb->availableLogicalWidth(); | 1548 return cb->availableLogicalWidth(); |
1534 } | 1549 } |
1535 | 1550 |
1536 LayoutUnit LayoutBox::containingBlockLogicalHeightForContent(AvailableLogicalHei
ghtType heightType) const | 1551 LayoutUnit LayoutBox::containingBlockLogicalHeightForContent(AvailableLogicalHei
ghtType heightType) const |
(...skipping 3107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4644 computedValues.m_margins.m_end = marginEnd(); | 4659 computedValues.m_margins.m_end = marginEnd(); |
4645 | 4660 |
4646 setLogicalTop(oldLogicalTop); | 4661 setLogicalTop(oldLogicalTop); |
4647 setLogicalWidth(oldLogicalWidth); | 4662 setLogicalWidth(oldLogicalWidth); |
4648 setLogicalLeft(oldLogicalLeft); | 4663 setLogicalLeft(oldLogicalLeft); |
4649 setMarginLeft(oldMarginLeft); | 4664 setMarginLeft(oldMarginLeft); |
4650 setMarginRight(oldMarginRight); | 4665 setMarginRight(oldMarginRight); |
4651 } | 4666 } |
4652 | 4667 |
4653 } // namespace blink | 4668 } // namespace blink |
OLD | NEW |