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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class LayoutInline; | 42 class LayoutInline; |
43 class WordMeasurement; | 43 class WordMeasurement; |
44 | 44 |
45 typedef WTF::ListHashSet<LayoutBox*, 16> TrackedLayoutBoxListHashSet; | 45 typedef WTF::ListHashSet<LayoutBox*, 16> TrackedLayoutBoxListHashSet; |
46 typedef WTF::HashMap<const LayoutBlock*, OwnPtr<TrackedLayoutBoxListHashSet>> Tr
ackedDescendantsMap; | 46 typedef WTF::HashMap<const LayoutBlock*, OwnPtr<TrackedLayoutBoxListHashSet>> Tr
ackedDescendantsMap; |
47 typedef WTF::HashMap<const LayoutBox*, OwnPtr<HashSet<LayoutBlock*>>> TrackedCon
tainerMap; | 47 typedef WTF::HashMap<const LayoutBox*, OwnPtr<HashSet<LayoutBlock*>>> TrackedCon
tainerMap; |
48 typedef Vector<WordMeasurement, 64> WordMeasurements; | 48 typedef Vector<WordMeasurement, 64> WordMeasurements; |
49 | 49 |
50 enum ContainingBlockState { NewContainingBlock, SameContainingBlock }; | 50 enum ContainingBlockState { NewContainingBlock, SameContainingBlock }; |
51 | 51 |
52 typedef WTF::HashMap<LayoutBlock*, OwnPtr<ListHashSet<LayoutInline*>>> Continuat
ionOutlineTableMap; | |
53 | |
54 ContinuationOutlineTableMap* continuationOutlineTable(); | |
55 | |
56 class CORE_EXPORT LayoutBlock : public LayoutBox { | 52 class CORE_EXPORT LayoutBlock : public LayoutBox { |
57 public: | 53 public: |
58 friend class LineLayoutState; | 54 friend class LineLayoutState; |
59 | 55 |
60 protected: | 56 protected: |
61 explicit LayoutBlock(ContainerNode*); | 57 explicit LayoutBlock(ContainerNode*); |
62 ~LayoutBlock() override; | 58 ~LayoutBlock() override; |
63 | 59 |
64 public: | 60 public: |
65 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 61 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void setSelectionState(SelectionState) override; | 153 void setSelectionState(SelectionState) override; |
158 | 154 |
159 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect) const; | 155 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect) const; |
160 | 156 |
161 // Helper methods for computing line counts and heights for line counts. | 157 // Helper methods for computing line counts and heights for line counts. |
162 RootInlineBox* lineAtIndex(int) const; | 158 RootInlineBox* lineAtIndex(int) const; |
163 int lineCount(const RootInlineBox* = nullptr, bool* = nullptr) const; | 159 int lineCount(const RootInlineBox* = nullptr, bool* = nullptr) const; |
164 int heightForLineCount(int); | 160 int heightForLineCount(int); |
165 void clearTruncation(); | 161 void clearTruncation(); |
166 | 162 |
167 void addContinuationWithOutline(LayoutInline*); | |
168 | |
169 LayoutBoxModelObject* virtualContinuation() const final { return continuatio
n(); } | 163 LayoutBoxModelObject* virtualContinuation() const final { return continuatio
n(); } |
170 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } | 164 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } |
171 LayoutInline* inlineElementContinuation() const; | 165 LayoutInline* inlineElementContinuation() const; |
172 | 166 |
173 using LayoutBoxModelObject::continuation; | 167 using LayoutBoxModelObject::continuation; |
174 using LayoutBoxModelObject::setContinuation; | 168 using LayoutBoxModelObject::setContinuation; |
175 | 169 |
176 static LayoutBlock* createAnonymousWithParentAndDisplay(const LayoutObject*,
EDisplay = BLOCK); | 170 static LayoutBlock* createAnonymousWithParentAndDisplay(const LayoutObject*,
EDisplay = BLOCK); |
177 LayoutBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentAndDisplay(this, display); } | 171 LayoutBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentAndDisplay(this, display); } |
178 | 172 |
(...skipping 25 matching lines...) Expand all Loading... |
204 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM
ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } | 198 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM
ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } |
205 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo
rContent() + availableLogicalWidth(); } | 199 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo
rContent() + availableLogicalWidth(); } |
206 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire
ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor
Content(); } | 200 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire
ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor
Content(); } |
207 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec
tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC
ontent(); } | 201 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec
tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC
ontent(); } |
208 | 202 |
209 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; | 203 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; |
210 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; | 204 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; |
211 | 205 |
212 #if ENABLE(ASSERT) | 206 #if ENABLE(ASSERT) |
213 void checkPositionedObjectsNeedLayout(); | 207 void checkPositionedObjectsNeedLayout(); |
214 bool paintsContinuationOutline(LayoutInline* flow); | |
215 #endif | 208 #endif |
216 #ifndef NDEBUG | 209 #ifndef NDEBUG |
217 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr,
const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr
) const; | 210 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr,
const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr
) const; |
218 #endif | 211 #endif |
219 | 212 |
220 bool recalcChildOverflowAfterStyleChange(); | 213 bool recalcChildOverflowAfterStyleChange(); |
221 bool recalcOverflowAfterStyleChange(); | 214 bool recalcOverflowAfterStyleChange(); |
222 | 215 |
223 protected: | 216 protected: |
224 void willBeDestroyed() override; | 217 void willBeDestroyed() override; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // FIXME: This is temporary as we move code that accesses block flow | 416 // FIXME: This is temporary as we move code that accesses block flow |
424 // member variables out of LayoutBlock and into LayoutBlockFlow. | 417 // member variables out of LayoutBlock and into LayoutBlockFlow. |
425 friend class LayoutBlockFlow; | 418 friend class LayoutBlockFlow; |
426 }; | 419 }; |
427 | 420 |
428 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); | 421 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); |
429 | 422 |
430 } // namespace blink | 423 } // namespace blink |
431 | 424 |
432 #endif // LayoutBlock_h | 425 #endif // LayoutBlock_h |
OLD | NEW |