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

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

Issue 215503003: Reland text autosizing changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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..8228c11efe97d8e443d58f8d37c56fd7c3d7dca9 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,10 +84,9 @@ private:
NotEnoughText
};
- enum PageAutosizingStatus {
- PageAutosizingStatusUnknown,
- PageNeedsAutosizing,
- PageDoesNotNeedAutosizing
+ enum RelayoutBehavior {
+ AlreadyInLayout, // The default; appropriate if we are already in layout.
+ LayoutNeeded // Use this if changing a multiplier outside of layout.
};
// A supercluster represents autosizing information about a set of two or
@@ -190,7 +191,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 +213,7 @@ private:
// block's width otherwise.
float widthFromBlock(const RenderBlock*);
float multiplierFromBlock(const RenderBlock*);
- void applyMultiplier(RenderObject*, float);
+ void applyMultiplier(RenderObject*, float, RelayoutBehavior = AlreadyInLayout);
bool isWiderOrNarrowerDescendant(Cluster*);
bool isLayoutRoot(const RenderBlock*) const;
@@ -230,10 +232,10 @@ 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;
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