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

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

Issue 236033005: [FastTextAutosizer] Do not inflate table parts that do not need layout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix TestExpectations 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-tables.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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 // descendants without overflowing the cell width computed by the table layo ut. Therefore, 382 // descendants without overflowing the cell width computed by the table layo ut. Therefore,
383 // descendants of cells cannot use a multiplier higher than the table's mult iplier. 383 // descendants of cells cannot use a multiplier higher than the table's mult iplier.
384 float multiplier = clusterMultiplier(cluster); 384 float multiplier = clusterMultiplier(cluster);
385 for (RenderObject* section = table->firstChild(); section; section = section ->nextSibling()) { 385 for (RenderObject* section = table->firstChild(); section; section = section ->nextSibling()) {
386 if (!section->isTableSection()) 386 if (!section->isTableSection())
387 continue; 387 continue;
388 for (RenderObject* row = section->firstChild(); row; row = row->nextSibl ing()) { 388 for (RenderObject* row = section->firstChild(); row; row = row->nextSibl ing()) {
389 if (!row->isTableRow()) 389 if (!row->isTableRow())
390 continue; 390 continue;
391 for (RenderObject* cell = row->firstChild(); cell; cell = cell->next Sibling()) { 391 for (RenderObject* cell = row->firstChild(); cell; cell = cell->next Sibling()) {
392 if (!cell->isTableCell()) 392 if (!cell->isTableCell() || !cell->needsLayout())
393 continue; 393 continue;
394 RenderTableCell* renderTableCell = toRenderTableCell(cell); 394 RenderTableCell* renderTableCell = toRenderTableCell(cell);
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 for (RenderObject* child = cell; child; child = child->nextI nPreOrder(cell)) {
406 if (child->isText()) { 406 if (child->isText() && child->needsLayout()) {
407 applyMultiplier(child, multiplier); 407 applyMultiplier(child, multiplier);
408 applyMultiplier(child->parent(), multiplier); // Par ent handles line spacing. 408 applyMultiplier(child->parent(), multiplier); // Par ent handles line spacing.
409 } 409 }
410 } 410 }
411 } 411 }
412 } 412 }
413 } 413 }
414 } 414 }
415 } 415 }
416 416
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo() 1073 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo()
1074 { 1074 {
1075 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) { 1075 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) {
1076 ASSERT(textAutosizer->m_updatePageInfoDeferred); 1076 ASSERT(textAutosizer->m_updatePageInfoDeferred);
1077 textAutosizer->m_updatePageInfoDeferred = false; 1077 textAutosizer->m_updatePageInfoDeferred = false;
1078 textAutosizer->updatePageInfoInAllFrames(); 1078 textAutosizer->updatePageInfoInAllFrames();
1079 } 1079 }
1080 } 1080 }
1081 1081
1082 } // namespace WebCore 1082 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/virtual/fasttextautosizing/fast/text-autosizing/tables/nested-tables.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698