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

Unified Diff: Source/core/rendering/FastTextAutosizer.h

Issue 209353003: Clean up handling of autosizing state changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@crap_base
Patch Set: Address review comments. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/FastTextAutosizer.h
diff --git a/Source/core/rendering/FastTextAutosizer.h b/Source/core/rendering/FastTextAutosizer.h
index df7b04cdec9ba3c0aefc5588a46b39c5c676c798..32bd222cac3d1912682fd73b69e5d11a2f097497 100644
--- a/Source/core/rendering/FastTextAutosizer.h
+++ b/Source/core/rendering/FastTextAutosizer.h
@@ -60,6 +60,8 @@ public:
return adoptPtr(new FastTextAutosizer(document));
}
+ void updatePageInfoInAllFrames();
+ void updatePageInfo();
void record(const RenderBlock*);
void destroy(const RenderBlock*);
void inflateListItem(RenderListItem*, RenderListMarker*);
@@ -82,12 +84,6 @@ private:
NotEnoughText
};
- enum PageAutosizingStatus {
- PageAutosizingStatusUnknown,
- PageNeedsAutosizing,
- PageDoesNotNeedAutosizing
- };
-
// A supercluster represents autosizing information about a set of two or
// more blocks that all have the same fingerprint. Clusters whose roots
// belong to a supercluster will share a common multiplier and
@@ -190,7 +186,8 @@ private:
void inflateTable(RenderTable*);
void inflate(RenderBlock*);
bool enabled();
- void updateRenderViewInfo();
+ void setAllTextNeedsLayout();
+ void resetMultipliers();
void prepareClusterStack(const RenderObject*);
bool isFingerprintingCandidate(const RenderBlock*);
bool clusterHasEnoughTextToAutosize(Cluster*, const RenderBlock* widthProvider = 0);
@@ -211,7 +208,7 @@ private:
// block's width otherwise.
float widthFromBlock(const RenderBlock*);
float multiplierFromBlock(const RenderBlock*);
- void applyMultiplier(RenderObject*, float);
+ void applyMultiplier(RenderObject*, float, bool relayout = false);
pdr. 2014/03/25 04:23:41 Can you use an enum here instead of a bool?
skobes 2014/03/25 18:25:26 Done.
bool isWiderOrNarrowerDescendant(Cluster*);
bool isLayoutRoot(const RenderBlock*) const;
@@ -230,10 +227,11 @@ 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.
- PageAutosizingStatus m_pageAutosizingStatus;
+ bool m_pageNeedsAutosizing;
+ bool m_previouslyAutosized;
+ bool m_updatePageInfoDeferred;
pdr. 2014/03/25 04:23:41 m_updatePageInfoDeferred isn't used in this patch.
skobes 2014/03/25 18:25:26 Done.
const RenderBlock* m_firstBlock; // First block to receive beginLayout.
#ifndef NDEBUG
- bool m_renderViewInfoPrepared;
BlockSet m_blocksThatHaveBegunLayout; // Used to ensure we don't compute properties of a block before beginLayout() is called on it.
#endif

Powered by Google App Engine
This is Rietveld 408576698