Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2553133002: Better isPageLogicalHeightKnown() implementation. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 5498 matching lines...) Expand 10 before | Expand all | Expand 10 after
5509 5509
5510 LayoutUnit LayoutBox::pageLogicalHeightForOffset(LayoutUnit offset) const { 5510 LayoutUnit LayoutBox::pageLogicalHeightForOffset(LayoutUnit offset) const {
5511 LayoutView* layoutView = view(); 5511 LayoutView* layoutView = view();
5512 LayoutFlowThread* flowThread = flowThreadContainingBlock(); 5512 LayoutFlowThread* flowThread = flowThreadContainingBlock();
5513 if (!flowThread) 5513 if (!flowThread)
5514 return layoutView->pageLogicalHeight(); 5514 return layoutView->pageLogicalHeight();
5515 return flowThread->pageLogicalHeightForOffset( 5515 return flowThread->pageLogicalHeightForOffset(
5516 offset + offsetFromLogicalTopOfFirstPage()); 5516 offset + offsetFromLogicalTopOfFirstPage());
5517 } 5517 }
5518 5518
5519 bool LayoutBox::isPageLogicalHeightKnown() const {
5520 if (const LayoutFlowThread* flowThread = flowThreadContainingBlock())
5521 return flowThread->isPageLogicalHeightKnown();
5522 return view()->pageLogicalHeight();
5523 }
5524
5519 LayoutUnit LayoutBox::pageRemainingLogicalHeightForOffset( 5525 LayoutUnit LayoutBox::pageRemainingLogicalHeightForOffset(
5520 LayoutUnit offset, 5526 LayoutUnit offset,
5521 PageBoundaryRule pageBoundaryRule) const { 5527 PageBoundaryRule pageBoundaryRule) const {
5522 LayoutView* layoutView = view(); 5528 LayoutView* layoutView = view();
5523 offset += offsetFromLogicalTopOfFirstPage(); 5529 offset += offsetFromLogicalTopOfFirstPage();
5524 5530
5525 LayoutFlowThread* flowThread = flowThreadContainingBlock(); 5531 LayoutFlowThread* flowThread = flowThreadContainingBlock();
5526 if (!flowThread) { 5532 if (!flowThread) {
5527 LayoutUnit pageLogicalHeight = layoutView->pageLogicalHeight(); 5533 LayoutUnit pageLogicalHeight = layoutView->pageLogicalHeight();
5528 LayoutUnit remainingHeight = 5534 LayoutUnit remainingHeight =
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
5623 LayoutRect rect = frameRect(); 5629 LayoutRect rect = frameRect();
5624 5630
5625 LayoutBlock* block = containingBlock(); 5631 LayoutBlock* block = containingBlock();
5626 if (block) 5632 if (block)
5627 block->adjustChildDebugRect(rect); 5633 block->adjustChildDebugRect(rect);
5628 5634
5629 return rect; 5635 return rect;
5630 } 5636 }
5631 5637
5632 } // namespace blink 5638 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698