OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 , m_multiplier(0) | 141 , m_multiplier(0) |
142 { | 142 { |
143 } | 143 } |
144 | 144 |
145 const BlockSet* const m_roots; | 145 const BlockSet* const m_roots; |
146 HasEnoughTextToAutosize m_hasEnoughTextToAutosize; | 146 HasEnoughTextToAutosize m_hasEnoughTextToAutosize; |
147 float m_multiplier; | 147 float m_multiplier; |
148 }; | 148 }; |
149 | 149 |
150 struct Cluster { | 150 struct Cluster { |
151 explicit Cluster(const LayoutBlock* root, BlockFlags flags, Cluster* par
ent, Supercluster* supercluster = 0) | 151 explicit Cluster(const LayoutBlock* root, BlockFlags flags, Cluster* par
ent, Supercluster* supercluster = nullptr) |
152 : m_root(root) | 152 : m_root(root) |
153 , m_flags(flags) | 153 , m_flags(flags) |
154 , m_deepestBlockContainingAllText(0) | 154 , m_deepestBlockContainingAllText(nullptr) |
155 , m_parent(parent) | 155 , m_parent(parent) |
156 , m_multiplier(0) | 156 , m_multiplier(0) |
157 , m_hasEnoughTextToAutosize(UnknownAmountOfText) | 157 , m_hasEnoughTextToAutosize(UnknownAmountOfText) |
158 , m_supercluster(supercluster) | 158 , m_supercluster(supercluster) |
159 , m_hasTableAncestor(root->isTableCell() || (m_parent && m_parent->m
_hasTableAncestor)) | 159 , m_hasTableAncestor(root->isTableCell() || (m_parent && m_parent->m
_hasTableAncestor)) |
160 { | 160 { |
161 } | 161 } |
162 | 162 |
163 const LayoutBlock* const m_root; | 163 const LayoutBlock* const m_root; |
164 BlockFlags m_flags; | 164 BlockFlags m_flags; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 void beginLayout(LayoutBlock*); | 253 void beginLayout(LayoutBlock*); |
254 void endLayout(LayoutBlock*); | 254 void endLayout(LayoutBlock*); |
255 void inflateAutoTable(LayoutTable*); | 255 void inflateAutoTable(LayoutTable*); |
256 float inflate(LayoutObject*, InflateBehavior = ThisBlockOnly, float multipli
er = 0); | 256 float inflate(LayoutObject*, InflateBehavior = ThisBlockOnly, float multipli
er = 0); |
257 bool shouldHandleLayout() const; | 257 bool shouldHandleLayout() const; |
258 IntSize windowSize() const; | 258 IntSize windowSize() const; |
259 void setAllTextNeedsLayout(); | 259 void setAllTextNeedsLayout(); |
260 void resetMultipliers(); | 260 void resetMultipliers(); |
261 BeginLayoutBehavior prepareForLayout(const LayoutBlock*); | 261 BeginLayoutBehavior prepareForLayout(const LayoutBlock*); |
262 void prepareClusterStack(const LayoutObject*); | 262 void prepareClusterStack(const LayoutObject*); |
263 bool clusterHasEnoughTextToAutosize(Cluster*, const LayoutBlock* widthProvid
er = 0); | 263 bool clusterHasEnoughTextToAutosize(Cluster*, const LayoutBlock* widthProvid
er = nullptr); |
264 bool superclusterHasEnoughTextToAutosize(Supercluster*, const LayoutBlock* w
idthProvider = 0); | 264 bool superclusterHasEnoughTextToAutosize(Supercluster*, const LayoutBlock* w
idthProvider = nullptr); |
265 bool clusterWouldHaveEnoughTextToAutosize(const LayoutBlock* root, const Lay
outBlock* widthProvider = 0); | 265 bool clusterWouldHaveEnoughTextToAutosize(const LayoutBlock* root, const Lay
outBlock* widthProvider = nullptr); |
266 Fingerprint getFingerprint(const LayoutObject*); | 266 Fingerprint getFingerprint(const LayoutObject*); |
267 Fingerprint computeFingerprint(const LayoutObject*); | 267 Fingerprint computeFingerprint(const LayoutObject*); |
268 Cluster* maybeCreateCluster(const LayoutBlock*); | 268 Cluster* maybeCreateCluster(const LayoutBlock*); |
269 Supercluster* getSupercluster(const LayoutBlock*); | 269 Supercluster* getSupercluster(const LayoutBlock*); |
270 float clusterMultiplier(Cluster*); | 270 float clusterMultiplier(Cluster*); |
271 float superclusterMultiplier(Cluster*); | 271 float superclusterMultiplier(Cluster*); |
272 // A cluster's width provider is typically the deepest block containing all
text. | 272 // A cluster's width provider is typically the deepest block containing all
text. |
273 // There are exceptions, such as tables and table cells which use the table
itself for width. | 273 // There are exceptions, such as tables and table cells which use the table
itself for width. |
274 const LayoutBlock* clusterWidthProvider(const LayoutBlock*) const; | 274 const LayoutBlock* clusterWidthProvider(const LayoutBlock*) const; |
275 const LayoutBlock* maxClusterWidthProvider(const Supercluster*, const Layout
Block* currentRoot) const; | 275 const LayoutBlock* maxClusterWidthProvider(const Supercluster*, const Layout
Block* currentRoot) const; |
(...skipping 30 matching lines...) Expand all Loading... |
306 FingerprintMapper m_fingerprintMapper; | 306 FingerprintMapper m_fingerprintMapper; |
307 Vector<RefPtr<ComputedStyle>> m_stylesRetainedDuringLayout; | 307 Vector<RefPtr<ComputedStyle>> m_stylesRetainedDuringLayout; |
308 // FIXME: All frames should share the same m_pageInfo instance. | 308 // FIXME: All frames should share the same m_pageInfo instance. |
309 PageInfo m_pageInfo; | 309 PageInfo m_pageInfo; |
310 bool m_updatePageInfoDeferred; | 310 bool m_updatePageInfoDeferred; |
311 }; | 311 }; |
312 | 312 |
313 } // namespace blink | 313 } // namespace blink |
314 | 314 |
315 #endif // TextAutosizer_h | 315 #endif // TextAutosizer_h |
OLD | NEW |