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 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1556 if (offset > contentSideWithMargin) | 1556 if (offset > contentSideWithMargin) |
1557 return childMargin; | 1557 return childMargin; |
1558 return offset - contentSide; | 1558 return offset - contentSide; |
1559 } | 1559 } |
1560 | 1560 |
1561 LayoutUnit LayoutBox::shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStar
t, LayoutUnit childMarginEnd, const LayoutBlockFlow* cb) const | 1561 LayoutUnit LayoutBox::shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStar
t, LayoutUnit childMarginEnd, const LayoutBlockFlow* cb) const |
1562 { | 1562 { |
1563 LayoutUnit logicalTopPosition = logicalTop(); | 1563 LayoutUnit logicalTopPosition = logicalTop(); |
1564 LayoutUnit startOffsetForContent = cb->startOffsetForContent(); | 1564 LayoutUnit startOffsetForContent = cb->startOffsetForContent(); |
1565 LayoutUnit endOffsetForContent = cb->endOffsetForContent(); | 1565 LayoutUnit endOffsetForContent = cb->endOffsetForContent(); |
1566 LayoutUnit startOffsetForLine = cb->startOffsetForLine(logicalTopPosition, f
alse); | 1566 LayoutUnit startOffsetForLine = cb->startOffsetForLine(logicalTopPosition, D
oNotIndentText); |
1567 LayoutUnit endOffsetForLine = cb->endOffsetForLine(logicalTopPosition, false
); | 1567 LayoutUnit endOffsetForLine = cb->endOffsetForLine(logicalTopPosition, DoNot
IndentText); |
1568 | 1568 |
1569 // If there aren't any floats constraining us then allow the margins to shri
nk/expand the width as much as they want. | 1569 // If there aren't any floats constraining us then allow the margins to shri
nk/expand the width as much as they want. |
1570 if (startOffsetForContent == startOffsetForLine && endOffsetForContent == en
dOffsetForLine) | 1570 if (startOffsetForContent == startOffsetForLine && endOffsetForContent == en
dOffsetForLine) |
1571 return cb->availableLogicalWidthForLine(logicalTopPosition, false) - chi
ldMarginStart - childMarginEnd; | 1571 return cb->availableLogicalWidthForLine(logicalTopPosition, DoNotIndentT
ext) - childMarginStart - childMarginEnd; |
1572 | 1572 |
1573 LayoutUnit width = cb->availableLogicalWidthForLine(logicalTopPosition, fals
e) - std::max(LayoutUnit(), childMarginStart) - std::max(LayoutUnit(), childMarg
inEnd); | 1573 LayoutUnit width = cb->availableLogicalWidthForLine(logicalTopPosition, DoNo
tIndentText) - std::max(LayoutUnit(), childMarginStart) - std::max(LayoutUnit(),
childMarginEnd); |
1574 // 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, | 1574 // 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, |
1575 // 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 | 1575 // 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 |
1576 // 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 | 1576 // 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 |
1577 // 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 | 1577 // 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 |
1578 // "consumed" by the float. Negative margins aren't consumed by the float, a
nd so we ignore them. | 1578 // "consumed" by the float. Negative margins aren't consumed by the float, a
nd so we ignore them. |
1579 width += portionOfMarginNotConsumedByFloat(childMarginStart, startOffsetForC
ontent, startOffsetForLine); | 1579 width += portionOfMarginNotConsumedByFloat(childMarginStart, startOffsetForC
ontent, startOffsetForLine); |
1580 width += portionOfMarginNotConsumedByFloat(childMarginEnd, endOffsetForConte
nt, endOffsetForLine); | 1580 width += portionOfMarginNotConsumedByFloat(childMarginEnd, endOffsetForConte
nt, endOffsetForLine); |
1581 return width; | 1581 return width; |
1582 } | 1582 } |
1583 | 1583 |
(...skipping 27 matching lines...) Expand all Loading... |
1611 return overrideContainingBlockContentLogicalHeight(); | 1611 return overrideContainingBlockContentLogicalHeight(); |
1612 | 1612 |
1613 LayoutBlock* cb = containingBlock(); | 1613 LayoutBlock* cb = containingBlock(); |
1614 return cb->availableLogicalHeight(heightType); | 1614 return cb->availableLogicalHeight(heightType); |
1615 } | 1615 } |
1616 | 1616 |
1617 LayoutUnit LayoutBox::containingBlockAvailableLineWidth() const | 1617 LayoutUnit LayoutBox::containingBlockAvailableLineWidth() const |
1618 { | 1618 { |
1619 LayoutBlock* cb = containingBlock(); | 1619 LayoutBlock* cb = containingBlock(); |
1620 if (cb->isLayoutBlockFlow()) | 1620 if (cb->isLayoutBlockFlow()) |
1621 return toLayoutBlockFlow(cb)->availableLogicalWidthForLine(logicalTop(),
false, availableLogicalHeight(IncludeMarginBorderPadding)); | 1621 return toLayoutBlockFlow(cb)->availableLogicalWidthForLine(logicalTop(),
DoNotIndentText, availableLogicalHeight(IncludeMarginBorderPadding)); |
1622 return LayoutUnit(); | 1622 return LayoutUnit(); |
1623 } | 1623 } |
1624 | 1624 |
1625 LayoutUnit LayoutBox::perpendicularContainingBlockLogicalHeight() const | 1625 LayoutUnit LayoutBox::perpendicularContainingBlockLogicalHeight() const |
1626 { | 1626 { |
1627 if (hasOverrideContainingBlockLogicalHeight()) | 1627 if (hasOverrideContainingBlockLogicalHeight()) |
1628 return overrideContainingBlockContentLogicalHeight(); | 1628 return overrideContainingBlockContentLogicalHeight(); |
1629 | 1629 |
1630 LayoutBlock* cb = containingBlock(); | 1630 LayoutBlock* cb = containingBlock(); |
1631 if (cb->hasOverrideLogicalContentHeight()) | 1631 if (cb->hasOverrideLogicalContentHeight()) |
(...skipping 3272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4904 } | 4904 } |
4905 | 4905 |
4906 void LayoutBox::clearPreviousPaintInvalidationRects() | 4906 void LayoutBox::clearPreviousPaintInvalidationRects() |
4907 { | 4907 { |
4908 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); | 4908 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); |
4909 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) | 4909 if (PaintLayerScrollableArea* scrollableArea = this->scrollableArea()) |
4910 scrollableArea->clearPreviousPaintInvalidationRects(); | 4910 scrollableArea->clearPreviousPaintInvalidationRects(); |
4911 } | 4911 } |
4912 | 4912 |
4913 } // namespace blink | 4913 } // namespace blink |
OLD | NEW |