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