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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 virtual LayoutBox* createAnonymousBoxWithSameTypeAs(const LayoutObject* pare
nt) const override; | 194 virtual LayoutBox* createAnonymousBoxWithSameTypeAs(const LayoutObject* pare
nt) const override; |
195 | 195 |
196 ColumnInfo* columnInfo() const; | 196 ColumnInfo* columnInfo() const; |
197 int columnGap() const; | 197 int columnGap() const; |
198 | 198 |
199 // These two functions take the ColumnInfo* to avoid repeated lookups of the
info in the global HashMap. | 199 // These two functions take the ColumnInfo* to avoid repeated lookups of the
info in the global HashMap. |
200 unsigned columnCount(ColumnInfo*) const; | 200 unsigned columnCount(ColumnInfo*) const; |
201 LayoutRect columnRectAt(ColumnInfo*, unsigned) const; | 201 LayoutRect columnRectAt(ColumnInfo*, unsigned) const; |
202 | 202 |
203 // The page logical offset is the object's offset from the top of the page i
n the page progression | |
204 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). | |
205 LayoutUnit pageLogicalOffset() const { return m_pageLogicalOffset; } | |
206 void setPageLogicalOffset(LayoutUnit offset) { m_pageLogicalOffset = offset;
} | |
207 | |
208 // Accessors for logical width/height and margins in the containing block's
block-flow direction. | 203 // Accessors for logical width/height and margins in the containing block's
block-flow direction. |
209 LayoutUnit logicalWidthForChild(const LayoutBox& child) const { return isHor
izontalWritingMode() ? child.size().width() : child.size().height(); } | 204 LayoutUnit logicalWidthForChild(const LayoutBox& child) const { return isHor
izontalWritingMode() ? child.size().width() : child.size().height(); } |
210 LayoutUnit logicalHeightForChild(const LayoutBox& child) const { return isHo
rizontalWritingMode() ? child.size().height() : child.size().width(); } | 205 LayoutUnit logicalHeightForChild(const LayoutBox& child) const { return isHo
rizontalWritingMode() ? child.size().height() : child.size().width(); } |
211 LayoutSize logicalSizeForChild(const LayoutBox& child) const { return isHori
zontalWritingMode() ? child.size() : child.size().transposedSize(); } | 206 LayoutSize logicalSizeForChild(const LayoutBox& child) const { return isHori
zontalWritingMode() ? child.size() : child.size().transposedSize(); } |
212 LayoutUnit logicalTopForChild(const LayoutBox& child) const { return isHoriz
ontalWritingMode() ? child.location().y() : child.location().x(); } | 207 LayoutUnit logicalTopForChild(const LayoutBox& child) const { return isHoriz
ontalWritingMode() ? child.location().y() : child.location().x(); } |
213 LayoutUnit marginBeforeForChild(const LayoutBoxModelObject& child) const { r
eturn child.marginBefore(style()); } | 208 LayoutUnit marginBeforeForChild(const LayoutBoxModelObject& child) const { r
eturn child.marginBefore(style()); } |
214 LayoutUnit marginAfterForChild(const LayoutBoxModelObject& child) const { re
turn child.marginAfter(style()); } | 209 LayoutUnit marginAfterForChild(const LayoutBoxModelObject& child) const { re
turn child.marginAfter(style()); } |
215 LayoutUnit marginStartForChild(const LayoutBoxModelObject& child) const { re
turn child.marginStart(style()); } | 210 LayoutUnit marginStartForChild(const LayoutBoxModelObject& child) const { re
turn child.marginStart(style()); } |
216 LayoutUnit marginEndForChild(const LayoutBoxModelObject& child) const { retu
rn child.marginEnd(style()); } | 211 LayoutUnit marginEndForChild(const LayoutBoxModelObject& child) const { retu
rn child.marginEnd(style()); } |
217 void setMarginStartForChild(LayoutBox& child, LayoutUnit value) const { chil
d.setMarginStart(value, style()); } | 212 void setMarginStartForChild(LayoutBox& child, LayoutUnit value) const { chil
d.setMarginStart(value, style()); } |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 | 444 |
450 virtual bool canCollapseAnonymousBlockChild() const { return true; } | 445 virtual bool canCollapseAnonymousBlockChild() const { return true; } |
451 | 446 |
452 public: | 447 public: |
453 virtual LayoutUnit offsetFromLogicalTopOfFirstPage() const override final; | 448 virtual LayoutUnit offsetFromLogicalTopOfFirstPage() const override final; |
454 | 449 |
455 protected: | 450 protected: |
456 LayoutObjectChildList m_children; | 451 LayoutObjectChildList m_children; |
457 LineBoxList m_lineBoxes; // All of the root line boxes created for this bloc
k flow. For example, <div>Hello<br>world.</div> will have two total lines for t
he <div>. | 452 LineBoxList m_lineBoxes; // All of the root line boxes created for this bloc
k flow. For example, <div>Hello<br>world.</div> will have two total lines for t
he <div>. |
458 | 453 |
459 LayoutUnit m_pageLogicalOffset; | |
460 | |
461 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put
in LayoutBlockRareData since they are set too frequently. | 454 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put
in LayoutBlockRareData since they are set too frequently. |
462 unsigned m_hasMarginAfterQuirk : 1; | 455 unsigned m_hasMarginAfterQuirk : 1; |
463 unsigned m_beingDestroyed : 1; | 456 unsigned m_beingDestroyed : 1; |
464 unsigned m_hasMarkupTruncation : 1; | 457 unsigned m_hasMarkupTruncation : 1; |
465 unsigned m_widthAvailableToChildrenChanged : 1; | 458 unsigned m_widthAvailableToChildrenChanged : 1; |
466 mutable unsigned m_hasOnlySelfCollapsingChildren : 1; | 459 mutable unsigned m_hasOnlySelfCollapsingChildren : 1; |
467 mutable unsigned m_descendantsWithFloatsMarkedForLayout : 1; | 460 mutable unsigned m_descendantsWithFloatsMarkedForLayout : 1; |
468 | 461 |
469 // LayoutRubyBase objects need to be able to split and merge, moving their c
hildren around | 462 // LayoutRubyBase objects need to be able to split and merge, moving their c
hildren around |
470 // (calling moveChildTo, moveAllChildrenTo, and makeChildrenNonInline). | 463 // (calling moveChildTo, moveAllChildrenTo, and makeChildrenNonInline). |
471 friend class LayoutRubyBase; | 464 friend class LayoutRubyBase; |
472 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out
of LayoutBlock | 465 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out
of LayoutBlock |
473 friend class LineBreaker; | 466 friend class LineBreaker; |
474 | 467 |
475 // FIXME: This is temporary as we move code that accesses block flow | 468 // FIXME: This is temporary as we move code that accesses block flow |
476 // member variables out of LayoutBlock and into LayoutBlockFlow. | 469 // member variables out of LayoutBlock and into LayoutBlockFlow. |
477 friend class LayoutBlockFlow; | 470 friend class LayoutBlockFlow; |
478 }; | 471 }; |
479 | 472 |
480 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); | 473 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); |
481 | 474 |
482 } // namespace blink | 475 } // namespace blink |
483 | 476 |
484 #endif // LayoutBlock_h | 477 #endif // LayoutBlock_h |
OLD | NEW |