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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 enum RelayoutBehavior { | 100 enum RelayoutBehavior { |
101 AlreadyInLayout, // The default; appropriate if we are already in layout
. | 101 AlreadyInLayout, // The default; appropriate if we are already in layout
. |
102 LayoutNeeded // Use this if changing a multiplier outside of layout. | 102 LayoutNeeded // Use this if changing a multiplier outside of layout. |
103 }; | 103 }; |
104 | 104 |
105 enum BeginLayoutBehavior { | 105 enum BeginLayoutBehavior { |
106 StopLayout, | 106 StopLayout, |
107 ContinueLayout | 107 ContinueLayout |
108 }; | 108 }; |
109 | 109 |
| 110 enum InflateBehavior { |
| 111 ThisBlockOnly, |
| 112 DescendToInnerBlocks |
| 113 }; |
| 114 |
110 enum BlockFlag { | 115 enum BlockFlag { |
111 // A block that is evaluated for becoming a cluster root. | 116 // A block that is evaluated for becoming a cluster root. |
112 POTENTIAL_ROOT = 1 << 0, | 117 POTENTIAL_ROOT = 1 << 0, |
113 // A cluster root that establishes an independent multiplier. | 118 // A cluster root that establishes an independent multiplier. |
114 INDEPENDENT = 1 << 1, | 119 INDEPENDENT = 1 << 1, |
115 // A cluster root with an explicit width. These are likely to be indepen
dent. | 120 // A cluster root with an explicit width. These are likely to be indepen
dent. |
116 EXPLICIT_WIDTH = 1 << 2, | 121 EXPLICIT_WIDTH = 1 << 2, |
117 // A cluster that is wider or narrower than its parent. These also creat
e an | 122 // A cluster that is wider or narrower than its parent. These also creat
e an |
118 // independent multiplier, but this state cannot be determined until lay
out. | 123 // independent multiplier, but this state cannot be determined until lay
out. |
119 WIDER_OR_NARROWER = 1 << 3, | 124 WIDER_OR_NARROWER = 1 << 3, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 bool m_pageNeedsAutosizing; | 243 bool m_pageNeedsAutosizing; |
239 bool m_hasAutosized; | 244 bool m_hasAutosized; |
240 bool m_settingEnabled; | 245 bool m_settingEnabled; |
241 }; | 246 }; |
242 | 247 |
243 explicit FastTextAutosizer(const Document*); | 248 explicit FastTextAutosizer(const Document*); |
244 | 249 |
245 void beginLayout(RenderBlock*); | 250 void beginLayout(RenderBlock*); |
246 void endLayout(RenderBlock*); | 251 void endLayout(RenderBlock*); |
247 void inflateAutoTable(RenderTable*); | 252 void inflateAutoTable(RenderTable*); |
248 float inflate(RenderObject*, float multiplier = 0); | 253 float inflate(RenderObject*, InflateBehavior = ThisBlockOnly, float multipli
er = 0); |
249 bool shouldHandleLayout() const; | 254 bool shouldHandleLayout() const; |
250 void setAllTextNeedsLayout(); | 255 void setAllTextNeedsLayout(); |
251 void resetMultipliers(); | 256 void resetMultipliers(); |
252 BeginLayoutBehavior prepareForLayout(const RenderBlock*); | 257 BeginLayoutBehavior prepareForLayout(const RenderBlock*); |
253 void prepareClusterStack(const RenderObject*); | 258 void prepareClusterStack(const RenderObject*); |
254 bool clusterHasEnoughTextToAutosize(Cluster*, const RenderBlock* widthProvid
er = 0); | 259 bool clusterHasEnoughTextToAutosize(Cluster*, const RenderBlock* widthProvid
er = 0); |
255 bool superclusterHasEnoughTextToAutosize(Supercluster*, const RenderBlock* w
idthProvider = 0); | 260 bool superclusterHasEnoughTextToAutosize(Supercluster*, const RenderBlock* w
idthProvider = 0); |
256 bool clusterWouldHaveEnoughTextToAutosize(const RenderBlock* root, const Ren
derBlock* widthProvider = 0); | 261 bool clusterWouldHaveEnoughTextToAutosize(const RenderBlock* root, const Ren
derBlock* widthProvider = 0); |
257 Fingerprint getFingerprint(const RenderObject*); | 262 Fingerprint getFingerprint(const RenderObject*); |
258 Fingerprint computeFingerprint(const RenderObject*); | 263 Fingerprint computeFingerprint(const RenderObject*); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 FingerprintMapper m_fingerprintMapper; | 302 FingerprintMapper m_fingerprintMapper; |
298 Vector<RefPtr<RenderStyle> > m_stylesRetainedDuringLayout; | 303 Vector<RefPtr<RenderStyle> > m_stylesRetainedDuringLayout; |
299 // FIXME: All frames should share the same m_pageInfo instance. | 304 // FIXME: All frames should share the same m_pageInfo instance. |
300 PageInfo m_pageInfo; | 305 PageInfo m_pageInfo; |
301 bool m_updatePageInfoDeferred; | 306 bool m_updatePageInfoDeferred; |
302 }; | 307 }; |
303 | 308 |
304 } // namespace WebCore | 309 } // namespace WebCore |
305 | 310 |
306 #endif // FastTextAutosizer_h | 311 #endif // FastTextAutosizer_h |
OLD | NEW |