| 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 4477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4488 if (!pageLogicalHeight) | 4488 if (!pageLogicalHeight) |
| 4489 return logicalOffset; | 4489 return logicalOffset; |
| 4490 | 4490 |
| 4491 // The logicalOffset is in our coordinate space. We can add in our pushed o
ffset. | 4491 // The logicalOffset is in our coordinate space. We can add in our pushed o
ffset. |
| 4492 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logi
calOffset); | 4492 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logi
calOffset); |
| 4493 if (pageBoundaryRule == ExcludePageBoundary) | 4493 if (pageBoundaryRule == ExcludePageBoundary) |
| 4494 return logicalOffset + (remainingLogicalHeight ? remainingLogicalHeight
: pageLogicalHeight); | 4494 return logicalOffset + (remainingLogicalHeight ? remainingLogicalHeight
: pageLogicalHeight); |
| 4495 return logicalOffset + remainingLogicalHeight; | 4495 return logicalOffset + remainingLogicalHeight; |
| 4496 } | 4496 } |
| 4497 | 4497 |
| 4498 LayoutUnit RenderBlock::pageLogicalTopForOffset(LayoutUnit offset) const |
| 4499 { |
| 4500 RenderView* renderView = view(); |
| 4501 LayoutUnit firstPageLogicalTop = isHorizontalWritingMode() ? renderView->lay
outState()->pageOffset().height() : renderView->layoutState()->pageOffset().widt
h(); |
| 4502 LayoutUnit blockLogicalTop = isHorizontalWritingMode() ? renderView->layoutS
tate()->layoutOffset().height() : renderView->layoutState()->layoutOffset().widt
h(); |
| 4503 |
| 4504 LayoutUnit cumulativeOffset = offset + blockLogicalTop; |
| 4505 RenderFlowThread* flowThread = flowThreadContainingBlock(); |
| 4506 if (!flowThread) { |
| 4507 LayoutUnit pageLogicalHeight = renderView->layoutState()->pageLogicalHei
ght(); |
| 4508 if (!pageLogicalHeight) |
| 4509 return 0; |
| 4510 return cumulativeOffset - roundToInt(cumulativeOffset - firstPageLogical
Top) % roundToInt(pageLogicalHeight); |
| 4511 } |
| 4512 return flowThread->pageLogicalTopForOffset(cumulativeOffset); |
| 4513 } |
| 4514 |
| 4498 LayoutUnit RenderBlock::pageLogicalHeightForOffset(LayoutUnit offset) const | 4515 LayoutUnit RenderBlock::pageLogicalHeightForOffset(LayoutUnit offset) const |
| 4499 { | 4516 { |
| 4500 RenderView* renderView = view(); | 4517 RenderView* renderView = view(); |
| 4501 RenderFlowThread* flowThread = flowThreadContainingBlock(); | 4518 RenderFlowThread* flowThread = flowThreadContainingBlock(); |
| 4502 if (!flowThread) | 4519 if (!flowThread) |
| 4503 return renderView->layoutState()->pageLogicalHeight(); | 4520 return renderView->layoutState()->pageLogicalHeight(); |
| 4504 return flowThread->pageLogicalHeightForOffset(offset + offsetFromLogicalTopO
fFirstPage()); | 4521 return flowThread->pageLogicalHeightForOffset(offset + offsetFromLogicalTopO
fFirstPage()); |
| 4505 } | 4522 } |
| 4506 | 4523 |
| 4507 LayoutUnit RenderBlock::pageRemainingLogicalHeightForOffset(LayoutUnit offset, P
ageBoundaryRule pageBoundaryRule) const | 4524 LayoutUnit RenderBlock::pageRemainingLogicalHeightForOffset(LayoutUnit offset, P
ageBoundaryRule pageBoundaryRule) const |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4816 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 4833 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
| 4817 { | 4834 { |
| 4818 showRenderObject(); | 4835 showRenderObject(); |
| 4819 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 4836 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
| 4820 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 4837 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
| 4821 } | 4838 } |
| 4822 | 4839 |
| 4823 #endif | 4840 #endif |
| 4824 | 4841 |
| 4825 } // namespace blink | 4842 } // namespace blink |
| OLD | NEW |