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

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

Issue 1224933002: Combine outline and focus ring code paths (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix empty focus ring on Mac Created 5 years, 3 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 | Annotate | Revision Log
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 29 matching lines...) Expand all
208 202
209 bool needsRecalcLogicalWidthAfterLayoutChildren() const { return m_needsReca lcLogicalWidthAfterLayoutChildren; } 203 bool needsRecalcLogicalWidthAfterLayoutChildren() const { return m_needsReca lcLogicalWidthAfterLayoutChildren; }
210 void setNeedsRecalcLogicalWidthAfterLayoutChildren() { m_needsRecalcLogicalW idthAfterLayoutChildren = true; } 204 void setNeedsRecalcLogicalWidthAfterLayoutChildren() { m_needsRecalcLogicalW idthAfterLayoutChildren = true; }
211 void clearNeedsRecalcLogicalWidthAfterLayoutChildren() { m_needsRecalcLogica lWidthAfterLayoutChildren = false; } 205 void clearNeedsRecalcLogicalWidthAfterLayoutChildren() { m_needsRecalcLogica lWidthAfterLayoutChildren = false; }
212 206
213 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const; 207 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const;
214 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const; 208 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const;
215 209
216 #if ENABLE(ASSERT) 210 #if ENABLE(ASSERT)
217 void checkPositionedObjectsNeedLayout(); 211 void checkPositionedObjectsNeedLayout();
218 bool paintsContinuationOutline(LayoutInline* flow);
219 #endif 212 #endif
220 #ifndef NDEBUG 213 #ifndef NDEBUG
221 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr, const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr ) const; 214 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr, const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr ) const;
222 #endif 215 #endif
223 216
224 bool recalcChildOverflowAfterStyleChange(); 217 bool recalcChildOverflowAfterStyleChange();
225 bool recalcOverflowAfterStyleChange(); 218 bool recalcOverflowAfterStyleChange();
226 219
227 protected: 220 protected:
228 void willBeDestroyed() override; 221 void willBeDestroyed() override;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 // FIXME: This is temporary as we move code that accesses block flow 421 // FIXME: This is temporary as we move code that accesses block flow
429 // member variables out of LayoutBlock and into LayoutBlockFlow. 422 // member variables out of LayoutBlock and into LayoutBlockFlow.
430 friend class LayoutBlockFlow; 423 friend class LayoutBlockFlow;
431 }; 424 };
432 425
433 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); 426 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock());
434 427
435 } // namespace blink 428 } // namespace blink
436 429
437 #endif // LayoutBlock_h 430 #endif // LayoutBlock_h
OLDNEW
« no previous file with comments | « LayoutTests/svg/as-image/svg-object-intrinsic-size-expected.html ('k') | Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698