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

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

Issue 235943003: [FastTextAutosizer] Do not pre-inflate nested tables (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | « LayoutTests/virtual/fasttextautosizing/fast/text-autosizing/tables/nested-table-wrapping.html ('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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 bool shouldAutosize; 396 bool shouldAutosize;
397 if (blockSuppressesAutosizing(renderTableCell)) 397 if (blockSuppressesAutosizing(renderTableCell))
398 shouldAutosize = false; 398 shouldAutosize = false;
399 else if (Supercluster* supercluster = getSupercluster(renderTabl eCell)) 399 else if (Supercluster* supercluster = getSupercluster(renderTabl eCell))
400 shouldAutosize = anyClusterHasEnoughTextToAutosize(superclus ter->m_roots, table); 400 shouldAutosize = anyClusterHasEnoughTextToAutosize(superclus ter->m_roots, table);
401 else 401 else
402 shouldAutosize = clusterWouldHaveEnoughTextToAutosize(render TableCell, table); 402 shouldAutosize = clusterWouldHaveEnoughTextToAutosize(render TableCell, table);
403 403
404 if (shouldAutosize) { 404 if (shouldAutosize) {
405 for (RenderObject* child = cell; child; child = child->nextI nPreOrder(cell)) { 405 RenderObject* child = cell;
406 if (child->isText() && child->needsLayout()) { 406 while (child) {
407 applyMultiplier(child, multiplier); 407 if (child->needsLayout() && !child->isTable()) {
408 applyMultiplier(child->parent(), multiplier); // Par ent handles line spacing. 408 if (child->isText()) {
409 applyMultiplier(child, multiplier);
410 applyMultiplier(child->parent(), multiplier); // Parent handles line spacing.
411 }
412 child = child->nextInPreOrder(cell);
413 } else {
414 // Skip inflation of this subtree.
415 child = child->nextInPreOrderAfterChildren(cell);
409 } 416 }
410 } 417 }
411 } 418 }
412 } 419 }
413 } 420 }
414 } 421 }
415 } 422 }
416 423
417 void FastTextAutosizer::endLayout(RenderBlock* block) 424 void FastTextAutosizer::endLayout(RenderBlock* block)
418 { 425 {
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo() 1080 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo()
1074 { 1081 {
1075 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) { 1082 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) {
1076 ASSERT(textAutosizer->m_updatePageInfoDeferred); 1083 ASSERT(textAutosizer->m_updatePageInfoDeferred);
1077 textAutosizer->m_updatePageInfoDeferred = false; 1084 textAutosizer->m_updatePageInfoDeferred = false;
1078 textAutosizer->updatePageInfoInAllFrames(); 1085 textAutosizer->updatePageInfoInAllFrames();
1079 } 1086 }
1080 } 1087 }
1081 1088
1082 } // namespace WebCore 1089 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/virtual/fasttextautosizing/fast/text-autosizing/tables/nested-table-wrapping.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698