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

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

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
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 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 // is returned. 772 // is returned.
773 LayoutUnit offsetToNextPage() const { 773 LayoutUnit offsetToNextPage() const {
774 return m_rareData ? m_rareData->m_offsetToNextPage : LayoutUnit(); 774 return m_rareData ? m_rareData->m_offsetToNextPage : LayoutUnit();
775 } 775 }
776 void setOffsetToNextPage(LayoutUnit); 776 void setOffsetToNextPage(LayoutUnit);
777 777
778 // Specify which page or column to associate with an offset, if said offset is 778 // Specify which page or column to associate with an offset, if said offset is
779 // exactly at a page or column boundary. 779 // exactly at a page or column boundary.
780 enum PageBoundaryRule { AssociateWithFormerPage, AssociateWithLatterPage }; 780 enum PageBoundaryRule { AssociateWithFormerPage, AssociateWithLatterPage };
781 LayoutUnit pageLogicalHeightForOffset(LayoutUnit) const; 781 LayoutUnit pageLogicalHeightForOffset(LayoutUnit) const;
782 bool isPageLogicalHeightKnown() const;
782 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, 783 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit,
783 PageBoundaryRule) const; 784 PageBoundaryRule) const;
784 785
785 bool crossesPageBoundary(LayoutUnit offset, LayoutUnit logicalHeight) const; 786 bool crossesPageBoundary(LayoutUnit offset, LayoutUnit logicalHeight) const;
786 787
787 // Calculate the strut to insert in order fit content of size 788 // Calculate the strut to insert in order fit content of size
788 // |contentLogicalHeight|. |strutToNextPage| is the strut to add to |offset| 789 // |contentLogicalHeight|. |strutToNextPage| is the strut to add to |offset|
789 // to merely get to the top of the next page or column. This is what will be 790 // to merely get to the top of the next page or column. This is what will be
790 // returned if the content can actually fit there. Otherwise, return the 791 // returned if the content can actually fit there. Otherwise, return the
791 // distance to the next fragmentainer that can fit this piece of content. 792 // distance to the next fragmentainer that can fit this piece of content.
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 1623
1623 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) { 1624 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) {
1624 return breakValue == BreakColumn || breakValue == BreakLeft || 1625 return breakValue == BreakColumn || breakValue == BreakLeft ||
1625 breakValue == BreakPage || breakValue == BreakRecto || 1626 breakValue == BreakPage || breakValue == BreakRecto ||
1626 breakValue == BreakRight || breakValue == BreakVerso; 1627 breakValue == BreakRight || breakValue == BreakVerso;
1627 } 1628 }
1628 1629
1629 } // namespace blink 1630 } // namespace blink
1630 1631
1631 #endif // LayoutBox_h 1632 #endif // LayoutBox_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698