| 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 4626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4637 if (didSplitParentAnonymousBoxes) | 4637 if (didSplitParentAnonymousBoxes) |
| 4638 markBoxForRelayoutAfterSplit(this); | 4638 markBoxForRelayoutAfterSplit(this); |
| 4639 | 4639 |
| 4640 ASSERT(beforeChild->parent() == this); | 4640 ASSERT(beforeChild->parent() == this); |
| 4641 return beforeChild; | 4641 return beforeChild; |
| 4642 } | 4642 } |
| 4643 | 4643 |
| 4644 LayoutUnit LayoutBox::offsetFromLogicalTopOfFirstPage() const | 4644 LayoutUnit LayoutBox::offsetFromLogicalTopOfFirstPage() const |
| 4645 { | 4645 { |
| 4646 LayoutState* layoutState = view()->layoutState(); | 4646 LayoutState* layoutState = view()->layoutState(); |
| 4647 if (layoutState && !layoutState->isPaginated()) | 4647 if (!layoutState || !layoutState->isPaginated()) |
| 4648 return LayoutUnit(); | 4648 return LayoutUnit(); |
| 4649 | 4649 |
| 4650 if (!layoutState && !flowThreadContainingBlock()) | 4650 if (layoutState->layoutObject() == this) { |
| 4651 return LayoutUnit(); | 4651 LayoutSize offsetDelta = layoutState->layoutOffset() - layoutState->page
Offset(); |
| 4652 return isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.wi
dth(); |
| 4653 } |
| 4652 | 4654 |
| 4655 // A LayoutBlock always establishes a layout state, and this method is only
meant to be called |
| 4656 // on the object currently being laid out. |
| 4657 ASSERT(!isLayoutBlock()); |
| 4658 |
| 4659 // In case this box doesn't establish a layout state, try the containing blo
ck. |
| 4653 LayoutBlock* containerBlock = containingBlock(); | 4660 LayoutBlock* containerBlock = containingBlock(); |
| 4661 ASSERT(layoutState->layoutObject() == containerBlock); |
| 4654 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4662 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
| 4655 } | 4663 } |
| 4656 | 4664 |
| 4657 void LayoutBox::savePreviousBorderBoxSizeIfNeeded() | 4665 void LayoutBox::savePreviousBorderBoxSizeIfNeeded() |
| 4658 { | 4666 { |
| 4659 // If m_rareData is already created, always save. | 4667 // If m_rareData is already created, always save. |
| 4660 if (!m_rareData) { | 4668 if (!m_rareData) { |
| 4661 LayoutSize paintInvalidationSize = previousPaintInvalidationRect().size(
); | 4669 LayoutSize paintInvalidationSize = previousPaintInvalidationRect().size(
); |
| 4662 | 4670 |
| 4663 // Don't save old border box size if the paint rect is empty because we'
ll | 4671 // Don't save old border box size if the paint rect is empty because we'
ll |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4794 bool LayoutBox::canRenderBorderImage() const | 4802 bool LayoutBox::canRenderBorderImage() const |
| 4795 { | 4803 { |
| 4796 if (!style()->hasBorder()) | 4804 if (!style()->hasBorder()) |
| 4797 return false; | 4805 return false; |
| 4798 | 4806 |
| 4799 StyleImage* borderImage = style()->borderImage().image(); | 4807 StyleImage* borderImage = style()->borderImage().image(); |
| 4800 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); | 4808 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); |
| 4801 } | 4809 } |
| 4802 | 4810 |
| 4803 } // namespace blink | 4811 } // namespace blink |
| OLD | NEW |