Chromium Code Reviews| Index: Source/core/rendering/FastTextAutosizer.h |
| diff --git a/Source/core/rendering/FastTextAutosizer.h b/Source/core/rendering/FastTextAutosizer.h |
| index 7419126c33f0f0887435aceb41112e40cf983388..b508fabb89a8f64a8c95b8da660a3711db19ca69 100644 |
| --- a/Source/core/rendering/FastTextAutosizer.h |
| +++ b/Source/core/rendering/FastTextAutosizer.h |
| @@ -67,25 +67,8 @@ public: |
| class LayoutScope { |
| public: |
| - explicit LayoutScope(Document& document, RenderBlock* block) |
| - : m_block(0) |
| - { |
| - m_textAutosizer = document.fastTextAutosizer(); |
| - if (m_textAutosizer) { |
| - if (!m_textAutosizer->enabled()) { |
| - m_textAutosizer = 0; |
| - return; |
| - } |
| - m_block = block; |
| - m_textAutosizer->beginLayout(m_block); |
| - } |
| - } |
| - |
| - ~LayoutScope() |
| - { |
| - if (m_textAutosizer) |
| - m_textAutosizer->endLayout(m_block); |
| - } |
| + explicit LayoutScope(RenderBlock*); |
| + ~LayoutScope(); |
| private: |
| FastTextAutosizer* m_textAutosizer; |
| RenderBlock* m_block; |
| @@ -95,9 +78,15 @@ private: |
| typedef HashSet<const RenderBlock*> BlockSet; |
| enum HasEnoughTextToAutosize { |
|
pdr.
2014/03/01 05:16:43
This can end up being a bit verbose. Typically I s
skobes
2014/03/04 00:00:25
Done.
|
| - Unknown, |
| - Yes, |
| - No |
| + HasEnoughTextToAutosize_Unknown, |
| + HasEnoughTextToAutosize_Yes, |
| + HasEnoughTextToAutosize_No |
| + }; |
| + |
| + enum PageNeedsAutosizing { |
| + PageNeedsAutosizing_Unknown, |
|
pdr.
2014/03/01 05:16:43
Ditto here
skobes
2014/03/04 00:00:25
Done.
|
| + PageNeedsAutosizing_Yes, |
| + PageNeedsAutosizing_No |
| }; |
| // A supercluster represents autosizing information about a set of two or |
| @@ -122,7 +111,7 @@ private: |
| , m_parent(parent) |
| , m_autosize(autosize) |
| , m_multiplier(0) |
| - , m_hasEnoughTextToAutosize(Unknown) |
| + , m_hasEnoughTextToAutosize(HasEnoughTextToAutosize_Unknown) |
| , m_supercluster(supercluster) |
| , m_hasTableAncestor(root->isTableCell() || (m_parent && m_parent->m_hasTableAncestor)) |
| { |
| @@ -197,7 +186,7 @@ private: |
| void inflateTable(RenderTable*); |
| void inflate(RenderBlock*); |
| bool enabled(); |
| - void prepareRenderViewInfo(); |
| + void updateRenderViewInfo(); |
| void prepareClusterStack(const RenderObject*); |
| bool isFingerprintingCandidate(const RenderBlock*); |
| bool clusterHasEnoughTextToAutosize(Cluster*, const RenderBlock* widthProvider = 0); |
| @@ -221,6 +210,7 @@ private: |
| bool mightBeWiderOrNarrowerDescendant(const RenderBlock*); |
| bool isWiderOrNarrowerDescendant(Cluster*); |
| bool isLayoutRoot(const RenderBlock*) const; |
| + bool isInLayout() const; |
| Cluster* currentCluster() const; |
| @@ -237,6 +227,7 @@ private: |
| int m_frameWidth; // LocalFrame width in density-independent pixels (DIPs). |
| int m_layoutWidth; // Layout width in CSS pixels. |
| float m_baseMultiplier; // Includes accessibility font scale factor and device scale adjustment. |
| + PageNeedsAutosizing m_pageNeedsAutosizing; |
| const RenderBlock* m_firstBlock; // First block to receive beginLayout. |
| #ifndef NDEBUG |
| bool m_renderViewInfoPrepared; |