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) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 3624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3635 } | 3635 } |
3636 | 3636 |
3637 void LayoutBlock::updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeigh
t) | 3637 void LayoutBlock::updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeigh
t) |
3638 { | 3638 { |
3639 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) | 3639 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) |
3640 flowThread->updateMinimumPageHeight(offsetFromLogicalTopOfFirstPage() +
offset, minHeight); | 3640 flowThread->updateMinimumPageHeight(offsetFromLogicalTopOfFirstPage() +
offset, minHeight); |
3641 else if (ColumnInfo* colInfo = view()->layoutState()->columnInfo()) | 3641 else if (ColumnInfo* colInfo = view()->layoutState()->columnInfo()) |
3642 colInfo->updateMinimumColumnHeight(minHeight); | 3642 colInfo->updateMinimumColumnHeight(minHeight); |
3643 } | 3643 } |
3644 | 3644 |
3645 LayoutUnit LayoutBlock::offsetFromLogicalTopOfFirstPage() const | |
3646 { | |
3647 LayoutState* layoutState = view()->layoutState(); | |
3648 RELEASE_ASSERT(layoutState); | |
3649 if (!layoutState->isPaginated()) | |
3650 return LayoutUnit(); | |
3651 // It would be possible to remove the requirement that this block be the one
currently being | |
3652 // laid out, but nobody needs that at the moment. | |
3653 ASSERT(layoutState->layoutObject() == this); | |
3654 LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState->pageOffs
et(); | |
3655 return isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width(
); | |
3656 } | |
3657 | |
3658 LayoutUnit LayoutBlock::collapsedMarginBeforeForChild(const LayoutBox& child) co
nst | 3645 LayoutUnit LayoutBlock::collapsedMarginBeforeForChild(const LayoutBox& child) co
nst |
3659 { | 3646 { |
3660 // If the child has the same directionality as we do, then we can just retur
n its | 3647 // If the child has the same directionality as we do, then we can just retur
n its |
3661 // collapsed margin. | 3648 // collapsed margin. |
3662 if (!child.isWritingModeRoot()) | 3649 if (!child.isWritingModeRoot()) |
3663 return child.collapsedMarginBefore(); | 3650 return child.collapsedMarginBefore(); |
3664 | 3651 |
3665 // The child has a different directionality. If the child is parallel, then
it's just | 3652 // The child has a different directionality. If the child is parallel, then
it's just |
3666 // flipped relative to us. We can use the collapsed margin for the opposite
edge. | 3653 // flipped relative to us. We can use the collapsed margin for the opposite
edge. |
3667 if (child.isHorizontalWritingMode() == isHorizontalWritingMode()) | 3654 if (child.isHorizontalWritingMode() == isHorizontalWritingMode()) |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3921 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const | 3908 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const |
3922 { | 3909 { |
3923 showLayoutObject(); | 3910 showLayoutObject(); |
3924 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 3911 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
3925 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 3912 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
3926 } | 3913 } |
3927 | 3914 |
3928 #endif | 3915 #endif |
3929 | 3916 |
3930 } // namespace blink | 3917 } // namespace blink |
OLD | NEW |