Source/WebCore/ChangeLog

 12012-11-29 Anton Vayvod <avayvod@chromium.org>
 2
 3 Text Autosizing: text nodes wider than their ancestor clusters should be autosized as separate clusters
 4 https://bugs.webkit.org/show_bug.cgi?id=103627
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 isAutosizingCluster() is checking for the width of the container being greater than the width of its
 9 descendant cluster (more precisely, its text nodes least common ancestor). This ancestor RenderBlock is
 10 passed throughout tree traversal methods.
 11 Algorithm that searches for text nodes least common ancestor had to be modified to avoid circular dependency
 12 between finding LCA and determining if container is a cluster. After initial LCA is found, we check if any of
 13 text leafs' parent nodes are clusters due to the new definition and if so, we find new text leafs and new LCA.
 14 This is repeated until there are no clusters in paths from LCA to the first and last text leafs.
 15
 16 The change fixes several cases covered by existing tests.
 17
 18 * rendering/TextAutosizer.cpp:
 19 (WebCore::TextAutosizer::processSubtree): passes found root cluster to processCluster as initial stayWithin value.
 20 (WebCore::TextAutosizer::processCluster): stayWithin parameter (for assertion only), passes found block containing all text into processContainer.
 21 (WebCore::TextAutosizer::processContainer): stayWithin parameter passed into processCluster and isAutosizingCluster.
 22 (WebCore::TextAutosizer::isAutosizingCluster): considers a block that is wider than its parent, containing all text nodes within the parent cluster, to be a cluster itself.
 23 (WebCore::TextAutosizer::clusterShouldBeAutosized): passes new parameter to measureDescendantTextWidth.
 24 (WebCore::TextAutosizer::measureDescendantTextWidth): uses stayWithin parameter to pass to isAutosizingCluster.
 25 (WebCore::TextAutosizer::findDeepestBlockContainingAllText): reimplemented to incrementally filter out clusters that are wider than the currently found block.
 26 (WebCore::TextAutosizer::findClosestCluster): find the first cluster in a collection of RenderObjects starting from the given position.
 27 (WebCore::TextAutosizer::findFirstTextLeafNotInCluster): finds text leaf that doesn't belong to any cluster, starts searching from the first child of the last node in the path.
 28 (WebCore::TextAutosizer::findNextTextLeafNotInCluster): finds text leaf that doesn't belong to any cluster, starts searching from the next sibling of the last node in the path.
 29 (WebCore::TextAutosizer::firstChildNotCluster): finds the first child of RenderObject that is not a cluster.
 30 (WebCore::TextAutosizer::nextSiblingNotCluster): finds the next sibling of RenderObject that is not a cluster.
 31 (WebCore::TextAutosizer::isObjectAutosizingCluster): convenience method reducing code duplication.
 32 (WebCore::TextAutosizer::objectFirstChild): convenience method reducing code duplication.
 33 (WebCore::TextAutosizer::objectNextSibling): convenience method reducing code duplication.
 34 * rendering/TextAutosizer.h:
 35 (TextAutosizer): type for a collection of const RenderObject*, new method definitions.
 36
1372012-11-29 Sheriff Bot <webkit.review.bot@gmail.com>
238
339 Unreviewed, rolling out r136111.

Source/WebCore/rendering/TextAutosizer.cpp

@@bool TextAutosizer::processSubtree(RenderObject* layoutRoot)
8585 container = container->containingBlock();
8686
8787 RenderBlock* cluster = container;
88  while (cluster && (!isAutosizingContainer(cluster) || !isAutosizingCluster(cluster)))
 88 while (cluster && (!isAutosizingContainer(cluster) || !isAutosizingCluster(cluster, 0)))
8989 cluster = cluster->containingBlock();
9090
91  processCluster(cluster, container, layoutRoot, windowInfo);
 91 processCluster(cluster, container, cluster, layoutRoot, windowInfo);
9292 return true;
9393}
9494
95 void TextAutosizer::processCluster(RenderBlock* cluster, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo)
 95void TextAutosizer::processCluster(RenderBlock* cluster, RenderBlock* container, const RenderBlock* stayWithin, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo)
9696{
97  ASSERT(isAutosizingCluster(cluster));
 97 ASSERT_UNUSED(stayWithin, isAutosizingCluster(cluster, stayWithin));
9898
9999 // Many pages set a max-width on their content. So especially for the
100100 // RenderView, instead of just taking the width of |cluster| we find
101101 // the lowest common ancestor of the first and last descendant text node of
102102 // the cluster (i.e. the deepest wrapper block that contains all the text),
103103 // and use its width instead.
104  const RenderBlock* lowestCommonAncestor = findDeepestBlockContainingAllText(cluster);
105  float commonAncestorWidth = lowestCommonAncestor->contentLogicalWidth();
 104 const RenderBlock* deepestBlockContainingAllText = findDeepestBlockContainingAllText(cluster);
 105 float textWidth = deepestBlockContainingAllText->contentLogicalWidth();
106106
107107 float multiplier = 1;
108  if (clusterShouldBeAutosized(lowestCommonAncestor, commonAncestorWidth)) {
 108 if (clusterShouldBeAutosized(deepestBlockContainingAllText, textWidth)) {
109109 int logicalWindowWidth = cluster->isHorizontalWritingMode() ? windowInfo.windowSize.width() : windowInfo.windowSize.height();
110110 int logicalLayoutWidth = cluster->isHorizontalWritingMode() ? windowInfo.minLayoutSize.width() : windowInfo.minLayoutSize.height();
111111 // Ignore box width in excess of the layout width, to avoid extreme multipliers.
112  float logicalClusterWidth = std::min<float>(commonAncestorWidth, logicalLayoutWidth);
 112 float logicalClusterWidth = std::min<float>(textWidth, logicalLayoutWidth);
113113
114114 multiplier = logicalClusterWidth / logicalWindowWidth;
115115 multiplier *= m_document->settings()->textAutosizingFontScaleFactor();
116116 multiplier = std::max(1.0f, multiplier);
117117 }
118118
119  processContainer(multiplier, container, subtreeRoot, windowInfo);
 119 processContainer(multiplier, container, deepestBlockContainingAllText, subtreeRoot, windowInfo);
120120}
121121
122122static bool contentHeightIsConstrained(const RenderBlock* container)

@@static bool contentHeightIsConstrained(const RenderBlock* container)
139139 return false;
140140}
141141
142 void TextAutosizer::processContainer(float multiplier, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo)
 142void TextAutosizer::processContainer(float multiplier, RenderBlock* container, const RenderBlock* stayWithin, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo)
143143{
144144 ASSERT(isAutosizingContainer(container));
145145

@@void TextAutosizer::processContainer(float multiplier, RenderBlock* container, R
155155 // FIXME: Increase list marker size proportionately.
156156 } else if (isAutosizingContainer(descendant)) {
157157 RenderBlock* descendantBlock = toRenderBlock(descendant);
158  if (isAutosizingCluster(descendantBlock))
159  processCluster(descendantBlock, descendantBlock, descendantBlock, windowInfo);
 158 if (isAutosizingCluster(descendantBlock, stayWithin))
 159 processCluster(descendantBlock, descendantBlock, stayWithin, descendantBlock, windowInfo);
160160 else
161  processContainer(multiplier, descendantBlock, descendantBlock, windowInfo);
 161 processContainer(multiplier, descendantBlock, stayWithin, descendantBlock, windowInfo);
162162 }
163163 descendant = nextInPreOrderSkippingDescendantsOfContainers(descendant, subtreeRoot);
164164 }

@@bool TextAutosizer::isAutosizingContainer(const RenderObject* renderer)
211211 && (!renderer->isListItem() || renderer->isOutOfFlowPositioned());
212212}
213213
214 bool TextAutosizer::isAutosizingCluster(const RenderBlock* renderer)
 214bool TextAutosizer::isAutosizingCluster(const RenderBlock* renderer, const RenderBlock* stayWithin)
215215{
216216 // "Autosizing clusters" are special autosizing containers within which we
217217 // want to enforce a uniform text size multiplier, in the hopes of making

@@bool TextAutosizer::isAutosizingCluster(const RenderBlock* renderer)
232232 // from the box's parent (we want to avoid having significantly different
233233 // width blocks within a cluster, since the narrower blocks would end up
234234 // larger than would otherwise be necessary).
 235 // If a container is wider than its |stayWithin| parent, it becomes a cluster.
235236 ASSERT(isAutosizingContainer(renderer));
236237
237238 return renderer->isRenderView()

@@bool TextAutosizer::isAutosizingCluster(const RenderBlock* renderer)
241242 || renderer->isTableCaption()
242243 || renderer->isFlexibleBoxIncludingDeprecated()
243244 || renderer->hasColumns()
244  || renderer->containingBlock()->isHorizontalWritingMode() != renderer->isHorizontalWritingMode();
 245 || renderer->containingBlock()->isHorizontalWritingMode() != renderer->isHorizontalWritingMode()
 246 || (stayWithin && renderer->contentLogicalWidth() > stayWithin->contentLogicalWidth());
245247 // FIXME: Tables need special handling to multiply all their columns by
246248 // the same amount even if they're different widths; so do hasColumns()
247249 // renderers, and probably flexboxes...

@@bool TextAutosizer::clusterShouldBeAutosized(const RenderBlock* lowestCommonAnce
262264 const float minLinesOfText = 4;
263265 float minTextWidth = commonAncestorWidth * minLinesOfText;
264266 float textWidth = 0;
265  measureDescendantTextWidth(lowestCommonAncestor, minTextWidth, textWidth);
 267 measureDescendantTextWidth(lowestCommonAncestor, lowestCommonAncestor, minTextWidth, textWidth);
266268 if (textWidth >= minTextWidth)
267269 return true;
268270 return false;
269271}
270272
271 void TextAutosizer::measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth)
 273void TextAutosizer::measureDescendantTextWidth(const RenderBlock* stayWithin, const RenderBlock* container, float minTextWidth, float& textWidth)
272274{
273275 bool skipLocalText = contentHeightIsConstrained(container);
274276

@@void TextAutosizer::measureDescendantTextWidth(const RenderBlock* container, flo
278280 textWidth += toRenderText(descendant)->renderedTextLength() * descendant->style()->specifiedFontSize();
279281 } else if (isAutosizingContainer(descendant)) {
280282 RenderBlock* descendantBlock = toRenderBlock(descendant);
281  if (!isAutosizingCluster(descendantBlock))
282  measureDescendantTextWidth(descendantBlock, minTextWidth, textWidth);
 283 if (!isAutosizingCluster(descendantBlock, stayWithin))
 284 measureDescendantTextWidth(stayWithin, descendantBlock, minTextWidth, textWidth);
283285 }
284286 if (textWidth >= minTextWidth)
285287 return;

@@RenderObject* TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers(const
303305 return 0;
304306}
305307
306 const RenderBlock* TextAutosizer::findDeepestBlockContainingAllText(const RenderBlock* cluster)
 308const RenderBlock* TextAutosizer::findDeepestBlockContainingAllText(const RenderBlock* subtreeRoot)
307309{
308  ASSERT(isAutosizingCluster(cluster));
309 
310  size_t firstDepth = 0;
311  const RenderObject* firstTextLeaf = findFirstTextLeafNotInCluster(cluster, firstDepth, FirstToLast);
 310 RenderObjects firstPath(1, subtreeRoot);
 311 const RenderObject* firstTextLeaf = findFirstTextLeafNotInCluster(FirstToLast, firstPath);
312312 if (!firstTextLeaf)
313  return cluster;
 313 return subtreeRoot;
314314
315  size_t lastDepth = 0;
316  const RenderObject* lastTextLeaf = findFirstTextLeafNotInCluster(cluster, lastDepth, LastToFirst);
 315 RenderObjects lastPath(1, subtreeRoot);
 316 const RenderObject* lastTextLeaf = findFirstTextLeafNotInCluster(LastToFirst, lastPath);
317317 ASSERT(lastTextLeaf);
318318
319  // Equalize the depths if necessary. Only one of the while loops below will get executed.
320  const RenderObject* firstNode = firstTextLeaf;
321  const RenderObject* lastNode = lastTextLeaf;
322  while (firstDepth > lastDepth) {
323  firstNode = firstNode->parent();
324  --firstDepth;
325  }
326  while (lastDepth > firstDepth) {
327  lastNode = lastNode->parent();
328  --lastDepth;
329  }
 319 const RenderBlock* containingBlock = 0;
 320 do {
 321 size_t minSize = std::min(firstPath.size(), lastPath.size());
 322 size_t firstNotEqualIndex = 1;
 323 while (firstNotEqualIndex < minSize && firstPath[firstNotEqualIndex] == lastPath[firstNotEqualIndex])
 324 firstNotEqualIndex++;
 325 const RenderObject* lowestCommonAncestor = firstPath[firstNotEqualIndex - 1];
 326 if (lowestCommonAncestor->isRenderBlock())
 327 containingBlock = toRenderBlock(lowestCommonAncestor);
 328 else
 329 containingBlock = lowestCommonAncestor->containingBlock();
 330 ASSERT(containingBlock->isDescendantOf(subtreeRoot));
 331
 332 // Check if any of text leafs parents are going to be clusters due to being wider than the block just found.
 333 // In such case we need to start searching for the corresponding leaf again from the next not cluster node
 334 // after the closest cluster descendant in the corresponding path.
 335 size_t clusterInFirstPath = findClosestCluster(firstPath, firstNotEqualIndex, containingBlock);
 336 if (clusterInFirstPath < firstPath.size()) {
 337 firstPath.remove(clusterInFirstPath + 1, firstPath.size() - (clusterInFirstPath + 1));
 338 firstTextLeaf = findNextTextLeafNotInCluster(FirstToLast, firstPath);
 339 containingBlock = 0;
 340 }
 341 size_t clusterInLastPath = findClosestCluster(lastPath, firstNotEqualIndex, containingBlock);
 342 if (clusterInLastPath < lastPath.size()) {
 343 lastPath.remove(clusterInLastPath + 1, lastPath.size() - (clusterInLastPath + 1));
 344 lastTextLeaf = findNextTextLeafNotInCluster(LastToFirst, lastPath);
 345 containingBlock = 0;
 346 }
 347 if (!containingBlock && (!firstTextLeaf || !lastTextLeaf))
 348 containingBlock = subtreeRoot;
 349 } while (!containingBlock);
330350
331  // Go up from both nodes until the parent is the same. Both pointers will point to the LCA then.
332  while (firstNode != lastNode) {
333  firstNode = firstNode->parent();
334  lastNode = lastNode->parent();
335  }
 351 return containingBlock;
 352}
336353
337  if (firstNode->isRenderBlock())
338  return toRenderBlock(firstNode);
 354size_t TextAutosizer::findClosestCluster(const RenderObjects& objects, size_t startFrom, const RenderBlock* stayWithin)
 355{
 356 for (size_t i = startFrom; i < objects.size(); ++i)
 357 if (isObjectAutosizingCluster(objects[i], stayWithin))
 358 return i;
 359 return objects.size();
 360}
339361
340  // containingBlock() should never leave the cluster, since it only skips ancestors when finding the
341  // container of position:absolute/fixed blocks, and those cannot exist between a cluster and its text
342  // nodes lowest common ancestor as isAutosizingCluster would have made them into their own independent
343  // cluster.
344  RenderBlock* containingBlock = firstNode->containingBlock();
345  ASSERT(containingBlock->isDescendantOf(cluster));
 362const RenderObject* TextAutosizer::findFirstTextLeafNotInCluster(TraversalDirection direction, RenderObjects& path)
 363{
 364 while (!path.isEmpty()) {
 365 const RenderObject* current = path.last();
 366 if (current->isEmpty()) {
 367 if (current->isText())
 368 return current;
 369 return findNextTextLeafNotInCluster(direction, path);
 370 }
346371
347  return containingBlock;
 372 const RenderObject* next = firstChildNotCluster(direction, current);
 373 if (next)
 374 path.append(next);
 375 else
 376 return findNextTextLeafNotInCluster(direction, path);
 377 }
 378 return 0;
348379}
349380
350 const RenderObject* TextAutosizer::findFirstTextLeafNotInCluster(const RenderObject* parent, size_t& depth, TraversalDirection direction)
 381const RenderObject* TextAutosizer::findNextTextLeafNotInCluster(TraversalDirection direction, RenderObjects& path)
351382{
352  if (parent->isEmpty())
353  return parent->isText() ? parent : 0;
354 
355  ++depth;
356  const RenderObject* child = (direction == FirstToLast) ? parent->firstChild() : parent->lastChild();
357  while (child) {
358  if (!isAutosizingContainer(child) || !isAutosizingCluster(toRenderBlock(child))) {
359  const RenderObject* leaf = findFirstTextLeafNotInCluster(child, depth, direction);
360  if (leaf)
361  return leaf;
 383 // Don't examine siblings of the root (first element in path).
 384 while (path.size() > 1) {
 385 const RenderObject* current = path.last();
 386 path.removeLast();
 387 const RenderObject* nextSibling = nextSiblingNotCluster(direction, current);
 388 if (nextSibling) {
 389 path.append(nextSibling);
 390 return findFirstTextLeafNotInCluster(direction, path);
362391 }
363  child = (direction == FirstToLast) ? child->nextSibling() : child->previousSibling();
364392 }
365  --depth;
 393 return 0;
 394}
366395
 396const RenderObject* TextAutosizer::firstChildNotCluster(TraversalDirection direction, const RenderObject* object)
 397{
 398 for (const RenderObject* child = objectFirstChild(object, direction); child; child = objectNextSibling(child, direction))
 399 if (!isObjectAutosizingCluster(child, 0))
 400 return child;
 401 return 0;
 402}
 403
 404const RenderObject* TextAutosizer::nextSiblingNotCluster(TraversalDirection direction, const RenderObject* object)
 405{
 406 for (const RenderObject* sibling = objectNextSibling(object, direction); sibling; sibling = objectNextSibling(sibling, direction))
 407 if (!isObjectAutosizingCluster(sibling, 0))
 408 return sibling;
367409 return 0;
368410}
369411
 412bool TextAutosizer::isObjectAutosizingCluster(const RenderObject* object, const RenderBlock* stayWithin)
 413{
 414 return isAutosizingContainer(object) && isAutosizingCluster(toRenderBlock(object), stayWithin);
 415}
 416
 417const RenderObject* TextAutosizer::objectFirstChild(const RenderObject* object, TraversalDirection direction)
 418{
 419 return (direction == FirstToLast) ? object->firstChild() : object->lastChild();
 420}
 421
 422const RenderObject* TextAutosizer::objectNextSibling(const RenderObject* object, TraversalDirection direction)
 423{
 424 return (direction == FirstToLast) ? object->nextSibling() : object->previousSibling();
 425}
 426
370427} // namespace WebCore
371428
372429#endif // ENABLE(TEXT_AUTOSIZING)

Source/WebCore/rendering/TextAutosizer.h

3232#include <wtf/Noncopyable.h>
3333#include <wtf/PassOwnPtr.h>
3434#include <wtf/PassRefPtr.h>
 35#include <wtf/Vector.h>
3536
3637namespace WebCore {
3738

@@public:
5556 static float computeAutosizedFontSize(float specifiedSize, float multiplier);
5657
5758private:
 59 typedef Vector<const RenderObject*> RenderObjects;
5860 enum TraversalDirection {
5961 FirstToLast,
6062 LastToFirst

@@private:
6264
6365 explicit TextAutosizer(Document*);
6466
65  void processCluster(RenderBlock* cluster, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&);
66  void processContainer(float multiplier, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&);
 67 void processCluster(RenderBlock* cluster, RenderBlock* container, const RenderBlock* stayWithin, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&);
 68 void processContainer(float multiplier, RenderBlock* container, const RenderBlock* stayWithin, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&);
6769
6870 void setMultiplier(RenderObject*, float);
6971
7072 static bool isAutosizingContainer(const RenderObject*);
71  static bool isAutosizingCluster(const RenderBlock*);
7273
73  static bool clusterShouldBeAutosized(const RenderBlock* lowestCommonAncestor, float commonAncestorWidth);
74  static void measureDescendantTextWidth(const RenderBlock* container, float minTextWidth, float& textWidth);
 74 // Returns true if the specified autosizing container is also a cluster. If |stayWithin| is specified and |container| is wider,
 75 // it's also considered to be a cluster.
 76 static bool isAutosizingCluster(const RenderBlock* container, const RenderBlock* stayWithin);
 77
 78 static bool clusterShouldBeAutosized(const RenderBlock* cluster, float clusterWidth);
 79 static void measureDescendantTextWidth(const RenderBlock* container, const RenderBlock* stayWithin, float minTextWidth, float& textWidth);
7580
7681 // Use to traverse the tree of descendants, excluding descendants of containers (but returning the containers themselves).
7782 static RenderObject* nextInPreOrderSkippingDescendantsOfContainers(const RenderObject* current, const RenderObject* stayWithin);

@@private:
8085 // text node (excluding those belonging to other autosizing clusters).
8186 static const RenderBlock* findDeepestBlockContainingAllText(const RenderBlock* cluster);
8287
83  // Depending on the traversal direction specified, finds the first or the last leaf text node child that doesn't
84  // belong to any cluster.
85  static const RenderObject* findFirstTextLeafNotInCluster(const RenderObject*, size_t& depth, TraversalDirection);
 88 // Returns the index of the first autosizing cluster in given objects vector starting from |startFrom|.
 89 // If no cluster is found, returns the size of the collection of objects.
 90 static size_t findClosestCluster(const RenderObjects&, size_t startFrom, const RenderBlock* stayWithin);
 91
 92 // Find the first leaf text node in-order that doesn't belong to any cluster under the first element of |path|.
 93 // Returns the found node and its complete path.
 94 static const RenderObject* findFirstTextLeafNotInCluster(TraversalDirection, RenderObjects& path);
 95
 96 // Find the next leaf text node in-order that doesn't belong to any cluster under the first element of |path|.
 97 // Returns the found node and its complete path.
 98 static const RenderObject* findNextTextLeafNotInCluster(TraversalDirection, RenderObjects& path);
 99
 100 // Finds the first child of the object that is not a cluster.
 101 static const RenderObject* firstChildNotCluster(TraversalDirection, const RenderObject*);
 102
 103 // Finds the first sibling of the object that is not a cluster.
 104 static const RenderObject* nextSiblingNotCluster(TraversalDirection, const RenderObject*);
 105
 106 // Returns true if the object is an autosizing container and an autosizing cluster.
 107 static bool isObjectAutosizingCluster(const RenderObject*, const RenderBlock* stayWithin);
 108
 109 // Wrapper around firstChild() and lastChild() methods, calling one or another depending on the direction.
 110 static const RenderObject* objectFirstChild(const RenderObject*, TraversalDirection);
 111 // Wrapper around nextSibling() and previousSibling() methods, calling one or another depending on the direction.
 112 static const RenderObject* objectNextSibling(const RenderObject*, TraversalDirection);
86113
87114 Document* m_document;
88115};

LayoutTests/ChangeLog

 12012-11-29 Anton Vayvod <avayvod@chromium.org>
 2
 3 Text Autosizing: text nodes wider than their ancestor clusters should be autosized as separate clusters
 4 https://bugs.webkit.org/show_bug.cgi?id=103627
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 isAutosizingCluster() is checking for the width of the container being greater than the width of its
 9 descendant cluster (more precisely, its text nodes least common ancestor). This ancestor RenderBlock is
 10 passed throughout tree traversal methods.
 11 Algorithm that searches for text nodes least common ancestor had to be modified to avoid circular dependency
 12 between finding LCA and determining if container is a cluster. After initial LCA is found, we check if any of
 13 text leafs' parent nodes are clusters due to the new definition and if so, we find new text leafs and new LCA.
 14 This is repeated until there are no clusters in paths from LCA to the first and last text leafs.
 15 The change fixes several cases covered by existing tests.
 16
 17 * fast/text-autosizing/cluster-wide-in-narrow-expected.html:
 18 * fast/text-autosizing/cluster-wide-in-narrow.html:
 19 * fast/text-autosizing/wide-child-expected.html:
 20 * fast/text-autosizing/wide-child.html:
 21 * fast/text-autosizing/wide-in-narrow-overflow-scroll-expected.html:
 22 * fast/text-autosizing/wide-in-narrow-overflow-scroll.html:
 23
1242012-11-29 Nandor Huszka <hnandor@inf.u-szeged.hu>
225
326 [Qt] Unreviewed gardening.

LayoutTests/fast/text-autosizing/cluster-wide-in-narrow-expected.html

@@body { width: 800px; margin: 0; overflow-y: hidden; }
1717 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
1818 </div>
1919
20  <div style="width: 800px; font-size: 1.25rem">
21  This text should be autosized to just 20px computed font-size (16 * 400/320), since despite its width:800px it is part of the 400px wide root cluster.<br>
 20 <div style="width: 600px; font-size: 1.875rem">
 21 This text should be autosized to 30px computed font-size (16 * 600/320), since because of its width:600px it becomes a cluster.<br>
2222 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
2323 </div>
2424

LayoutTests/fast/text-autosizing/cluster-wide-in-narrow.html

@@if (window.internals) {
2626 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
2727 </div>
2828
29  <div style="width: 800px">
30  This text should be autosized to just 20px computed font-size (16 * 400/320), since despite its width:800px it is part of the 400px wide root cluster.<br>
 29 <div style="width: 600px">
 30 This text should be autosized to 30px computed font-size (16 * 600/320), since because of its width:600px it becomes a cluster.<br>
3131 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
3232 </div>
3333

LayoutTests/fast/text-autosizing/wide-child-expected.html

@@body { width: 800px; margin: 0; overflow-y: hidden; }
1414<div style="width: 320px; font-size: 1rem">
1515 This text should not be autosized, as this div is the lowest common ancestor of the root cluster, and this div is narrow.<br>
1616 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
17  <div style="width: 800px">
18  This text should not be autosized since it doesn't affect the width of the parent block which is used to calculate the autosizing multiplier.<br>
19  FIXME: Ideally this text should be autosized. Will need to be fixed later.<br>
 17 <div style="width: 800px; font-size: 2.5rem">
 18 This text should be autosized to 40px computed font size (16 * 800/320) since it's wider than its cluster so it becomes a cluster itself.<br>
2019 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
2120 </div>
2221</div>

LayoutTests/fast/text-autosizing/wide-child.html

@@if (window.internals) {
2424 This text should not be autosized, as this div is the lowest common ancestor of the root cluster, and this div is narrow.<br>
2525 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
2626 <div style="width: 800px">
27  This text should not be autosized since it doesn't affect the width of the parent block which is used to calculate the autosizing multiplier.<br>
28  FIXME: Ideally this text should be autosized. Will need to be fixed later.<br>
 27 This text should be autosized to 40px computed font size (16 * 800/320) since it's wider than its cluster so it becomes a cluster itself.<br>
2928 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
3029 </div>
3130</div>

LayoutTests/fast/text-autosizing/wide-in-narrow-overflow-scroll-expected.html

@@body { width: 800px; margin: 0; overflow-y: hidden; }
1313
1414<div style="width: 400px">
1515 <div style="overflow-x: scroll">
16  <div style="width: 800px; font-size: 1.25rem">
17  This text should be autosized to 20px computed font size (16 * 400/320), since this is part of the root cluster, whose text descendants are all contained within the 400px wide grandparent of this div.<br>
 16 <div style="width: 800px; font-size: 2.5rem">
 17 This text should be autosized to 40px computed font size (16 * 800/320), since it's wider than the containing cluster and therefore becomes a cluster itself.<br>
1818 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
1919 </div>
2020 </div>

LayoutTests/fast/text-autosizing/wide-in-narrow-overflow-scroll.html

@@if (window.internals) {
2323<div style="width: 400px">
2424 <div style="overflow-x: scroll">
2525 <div style="width: 800px">
26  This text should be autosized to 20px computed font size (16 * 400/320), since this is part of the root cluster, whose text descendants are all contained within the 400px wide grandparent of this div.<br>
 26 This text should be autosized to 40px computed font size (16 * 800/320), since it's wider than the containing cluster and therefore becomes a cluster itself.<br>
2727 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
2828 </div>
2929 </div>