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 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 438 |
439 Position positionForBox(InlineBox*, bool start = true) const; | 439 Position positionForBox(InlineBox*, bool start = true) const; |
440 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); | 440 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); |
441 | 441 |
442 // End helper functions and structs used by layoutBlockChildren. | 442 // End helper functions and structs used by layoutBlockChildren. |
443 | 443 |
444 void removeFromGlobalMaps(); | 444 void removeFromGlobalMaps(); |
445 bool widthAvailableToChildrenHasChanged(); | 445 bool widthAvailableToChildrenHasChanged(); |
446 | 446 |
447 public: | 447 public: |
448 // Specify which page or column to associate with an offset, if said offset
is exactly at a page | |
449 // or column boundary. | |
450 enum PageBoundaryRule { AssociateWithFormerPage, AssociateWithLatterPage }; | |
451 | |
452 LayoutUnit pageLogicalHeightForOffset(LayoutUnit) const; | |
453 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, PageBoundaryRule)
const; | |
454 | |
455 // Calculate the strut to insert in order fit content of size |contentLogica
lHeight|. | |
456 // |strutToNextPage| is the strut to add to |offset| to merely get to the to
p of the next page | |
457 // or column. This is what will be returned if the content can actually fit
there. Otherwise, | |
458 // return the distance to the next fragmentainer that can fit this piece of
content. | |
459 LayoutUnit calculatePaginationStrutToFitContent(LayoutUnit offset, LayoutUni
t strutToNextPage, LayoutUnit contentLogicalHeight) const; | |
460 | |
461 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch
ild); | 448 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch
ild); |
462 protected: | 449 protected: |
463 bool isPageLogicalHeightKnown(LayoutUnit logicalOffset) const { return pageL
ogicalHeightForOffset(logicalOffset); } | 450 bool isPageLogicalHeightKnown(LayoutUnit logicalOffset) const { return pageL
ogicalHeightForOffset(logicalOffset); } |
464 | 451 |
465 // Returns the logical offset at the top of the next page, for a given offse
t. | 452 // Returns the logical offset at the top of the next page, for a given offse
t. |
466 // | 453 // |
467 // If the given offset is at a page boundary, using AssociateWithLatterPage
as PageBoundaryRule | 454 // If the given offset is at a page boundary, using AssociateWithLatterPage
as PageBoundaryRule |
468 // will move us one page ahead (since the offset is at the top of the "curre
nt" page). Using | 455 // will move us one page ahead (since the offset is at the top of the "curre
nt" page). Using |
469 // AssociateWithFormerPage instead will keep us where we are (since the offs
et is at the bottom | 456 // AssociateWithFormerPage instead will keep us where we are (since the offs
et is at the bottom |
470 // of the "current" page, which is exactly the same offset as the top offset
on the next page). | 457 // of the "current" page, which is exactly the same offset as the top offset
on the next page). |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 // FIXME: This is temporary as we move code that accesses block flow | 496 // FIXME: This is temporary as we move code that accesses block flow |
510 // member variables out of LayoutBlock and into LayoutBlockFlow. | 497 // member variables out of LayoutBlock and into LayoutBlockFlow. |
511 friend class LayoutBlockFlow; | 498 friend class LayoutBlockFlow; |
512 }; | 499 }; |
513 | 500 |
514 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); | 501 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); |
515 | 502 |
516 } // namespace blink | 503 } // namespace blink |
517 | 504 |
518 #endif // LayoutBlock_h | 505 #endif // LayoutBlock_h |
OLD | NEW |