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

Side by Side Diff: third_party/WebKit/Source/core/layout/TextAutosizer.cpp

Issue 1904403002: Recurse the inner elements only if behavior is DescendToInnerBlocks Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make menuitem non-void Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp ('k') | 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) 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 hasTextChild = true; 443 hasTextChild = true;
444 // We only calculate this multiplier on-demand to ensure the parent block of this text 444 // We only calculate this multiplier on-demand to ensure the parent block of this text
445 // has entered layout. 445 // has entered layout.
446 if (!multiplier) 446 if (!multiplier)
447 multiplier = cluster->m_flags & SUPPRESSING ? 1.0f : clusterMult iplier(cluster); 447 multiplier = cluster->m_flags & SUPPRESSING ? 1.0f : clusterMult iplier(cluster);
448 applyMultiplier(child, multiplier, layouter); 448 applyMultiplier(child, multiplier, layouter);
449 449
450 // FIXME: Investigate why MarkOnlyThis is sufficient. 450 // FIXME: Investigate why MarkOnlyThis is sufficient.
451 if (parent->isLayoutInline()) 451 if (parent->isLayoutInline())
452 child->setPreferredLogicalWidthsDirty(MarkOnlyThis); 452 child->setPreferredLogicalWidthsDirty(MarkOnlyThis);
453 } else if (child->isLayoutInline()) { 453 } else if (child->isLayoutInline() && behavior == DescendToInnerBlocks) {
454 multiplier = inflate(child, layouter, behavior, multiplier); 454 multiplier = inflate(child, layouter, behavior, multiplier);
455 } else if (child->isLayoutBlock() && behavior == DescendToInnerBlocks 455 } else if (child->isLayoutBlock() && behavior == DescendToInnerBlocks
456 && !classifyBlock(child, INDEPENDENT | EXPLICIT_WIDTH | SUPPRESSING) ) { 456 && !classifyBlock(child, INDEPENDENT | EXPLICIT_WIDTH | SUPPRESSING) ) {
457 multiplier = inflate(child, layouter, behavior, multiplier); 457 multiplier = inflate(child, layouter, behavior, multiplier);
458 } 458 }
459 child = child->nextSibling(); 459 child = child->nextSibling();
460 } 460 }
461 461
462 if (hasTextChild) { 462 if (hasTextChild) {
463 applyMultiplier(parent, multiplier, layouter); // Parent handles line sp acing. 463 applyMultiplier(parent, multiplier, layouter); // Parent handles line sp acing.
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 } 1188 }
1189 return computedSize; 1189 return computedSize;
1190 } 1190 }
1191 1191
1192 DEFINE_TRACE(TextAutosizer) 1192 DEFINE_TRACE(TextAutosizer)
1193 { 1193 {
1194 visitor->trace(m_document); 1194 visitor->trace(m_document);
1195 } 1195 }
1196 1196
1197 } // namespace blink 1197 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698