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

Side by Side Diff: Source/core/rendering/TextAutosizer.cpp

Issue 134153006: TextAutosizer: avoid unnecessary calls to containerShouldBeAutosized. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 348 }
349 } 349 }
350 350
351 void TextAutosizer::processContainer(float multiplier, RenderBlock* container, T extAutosizingClusterInfo& clusterInfo, RenderObject* subtreeRoot, const TextAuto sizingWindowInfo& windowInfo) 351 void TextAutosizer::processContainer(float multiplier, RenderBlock* container, T extAutosizingClusterInfo& clusterInfo, RenderObject* subtreeRoot, const TextAuto sizingWindowInfo& windowInfo)
352 { 352 {
353 ASSERT(isAutosizingContainer(container)); 353 ASSERT(isAutosizingContainer(container));
354 #ifdef AUTOSIZING_DOM_DEBUG_INFO 354 #ifdef AUTOSIZING_DOM_DEBUG_INFO
355 writeDebugInfo(container, "container"); 355 writeDebugInfo(container, "container");
356 #endif 356 #endif
357 357
358 float localMultiplier = containerShouldBeAutosized(container) ? multiplier: 1; 358 float localMultiplier = (multiplier > 1 && containerShouldBeAutosized(contai ner)) ? multiplier: 1;
359 359
360 RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(sub treeRoot, subtreeRoot); 360 RenderObject* descendant = nextInPreOrderSkippingDescendantsOfContainers(sub treeRoot, subtreeRoot);
361 while (descendant) { 361 while (descendant) {
362 if (descendant->isText()) { 362 if (descendant->isText()) {
363 if (localMultiplier != 1 && descendant->style()->textAutosizingMulti plier() == 1) { 363 if (localMultiplier != 1 && descendant->style()->textAutosizingMulti plier() == 1) {
364 setMultiplier(descendant, localMultiplier); 364 setMultiplier(descendant, localMultiplier);
365 setMultiplier(descendant->parent(), localMultiplier); // Parent does line spacing. 365 setMultiplier(descendant->parent(), localMultiplier); // Parent does line spacing.
366 366
367 if (RenderListItem* listItemAncestor = getAncestorListItem(desce ndant)) { 367 if (RenderListItem* listItemAncestor = getAncestorListItem(desce ndant)) {
368 if (RenderObject* list = getAncestorList(listItemAncestor)) { 368 if (RenderObject* list = getAncestorList(listItemAncestor)) {
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 if (i + 1 < clusterInfos.size()) { 797 if (i + 1 < clusterInfos.size()) {
798 float currentWidth = clusterInfos[i].root->contentLogicalWidth(); 798 float currentWidth = clusterInfos[i].root->contentLogicalWidth();
799 float nextWidth = clusterInfos[i + 1].root->contentLogicalWidth(); 799 float nextWidth = clusterInfos[i + 1].root->contentLogicalWidth();
800 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup) 800 if (currentWidth - nextWidth > maxWidthDifferenceWithinGroup)
801 groups.grow(groups.size() + 1); 801 groups.grow(groups.size() + 1);
802 } 802 }
803 } 803 }
804 } 804 }
805 805
806 } // namespace WebCore 806 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698