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

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

Issue 1602773005: Respect break-inside:avoid on table rows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 4 years, 8 months 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 * (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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 448
449 Position positionForBox(InlineBox*, bool start = true) const; 449 Position positionForBox(InlineBox*, bool start = true) const;
450 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); 450 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&);
451 451
452 // End helper functions and structs used by layoutBlockChildren. 452 // End helper functions and structs used by layoutBlockChildren.
453 453
454 void removeFromGlobalMaps(); 454 void removeFromGlobalMaps();
455 bool widthAvailableToChildrenHasChanged(); 455 bool widthAvailableToChildrenHasChanged();
456 456
457 public: 457 public:
458 // Specify which page or column to associate with an offset, if said offset is exactly at a page
459 // or column boundary.
460 enum PageBoundaryRule { AssociateWithFormerPage, AssociateWithLatterPage };
461
462 LayoutUnit pageLogicalHeightForOffset(LayoutUnit) const;
463 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, PageBoundaryRule) const;
464
465 // Calculate the strut to insert in order fit content of size |contentLogica lHeight|.
466 // |strutToNextPage| is the strut to add to |offset| to merely get to the to p of the next page
467 // or column. This is what will be returned if the content can actually fit there. Otherwise,
468 // return the distance to the next fragmentainer that can fit this piece of content.
469 LayoutUnit calculatePaginationStrutToFitContent(LayoutUnit offset, LayoutUni t strutToNextPage, LayoutUnit contentLogicalHeight) const;
470
471 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch ild); 458 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch ild);
472 protected: 459 protected:
473 bool isPageLogicalHeightKnown(LayoutUnit logicalOffset) const { return pageL ogicalHeightForOffset(logicalOffset); } 460 bool isPageLogicalHeightKnown(LayoutUnit logicalOffset) const { return pageL ogicalHeightForOffset(logicalOffset); }
474 461
475 // Returns the logical offset at the top of the next page, for a given offse t. 462 // Returns the logical offset at the top of the next page, for a given offse t.
476 // 463 //
477 // If the given offset is at a page boundary, using AssociateWithLatterPage as PageBoundaryRule 464 // If the given offset is at a page boundary, using AssociateWithLatterPage as PageBoundaryRule
478 // will move us one page ahead (since the offset is at the top of the "curre nt" page). Using 465 // will move us one page ahead (since the offset is at the top of the "curre nt" page). Using
479 // AssociateWithFormerPage instead will keep us where we are (since the offs et is at the bottom 466 // AssociateWithFormerPage instead will keep us where we are (since the offs et is at the bottom
480 // of the "current" page, which is exactly the same offset as the top offset on the next page). 467 // 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
519 // FIXME: This is temporary as we move code that accesses block flow 506 // FIXME: This is temporary as we move code that accesses block flow
520 // member variables out of LayoutBlock and into LayoutBlockFlow. 507 // member variables out of LayoutBlock and into LayoutBlockFlow.
521 friend class LayoutBlockFlow; 508 friend class LayoutBlockFlow;
522 }; 509 };
523 510
524 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); 511 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock());
525 512
526 } // namespace blink 513 } // namespace blink
527 514
528 #endif // LayoutBlock_h 515 #endif // LayoutBlock_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698