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

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

Issue 295513003: add 'slow' prefix to RenderObject's firstChild() / lastChild() methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 // Pre-inflate cells that have enough text so that their inflated preferred widths will be used 424 // Pre-inflate cells that have enough text so that their inflated preferred widths will be used
425 // for column sizing. 425 // for column sizing.
426 // The multiplier used for cell descendants represents the maximum we can ev er inflate 426 // The multiplier used for cell descendants represents the maximum we can ev er inflate
427 // descendants without overflowing the cell width computed by the table layo ut. Therefore, 427 // descendants without overflowing the cell width computed by the table layo ut. Therefore,
428 // descendants of cells cannot use a multiplier higher than the table's mult iplier. 428 // descendants of cells cannot use a multiplier higher than the table's mult iplier.
429 float multiplier = clusterMultiplier(cluster); 429 float multiplier = clusterMultiplier(cluster);
430 for (RenderObject* section = table->firstChild(); section; section = section ->nextSibling()) { 430 for (RenderObject* section = table->firstChild(); section; section = section ->nextSibling()) {
431 if (!section->isTableSection()) 431 if (!section->isTableSection())
432 continue; 432 continue;
433 for (RenderObject* row = section->firstChild(); row; row = row->nextSibl ing()) { 433 for (RenderObject* row = toRenderTableSection(section)->firstChild(); ro w; row = row->nextSibling()) {
434 if (!row->isTableRow()) 434 if (!row->isTableRow())
435 continue; 435 continue;
436 for (RenderObject* cell = row->firstChild(); cell; cell = cell->next Sibling()) { 436 for (RenderObject* cell = toRenderTableRow(row)->firstChild(); cell; cell = cell->nextSibling()) {
437 if (!cell->isTableCell() || !cell->needsLayout()) 437 if (!cell->isTableCell() || !cell->needsLayout())
438 continue; 438 continue;
439 RenderTableCell* renderTableCell = toRenderTableCell(cell); 439 RenderTableCell* renderTableCell = toRenderTableCell(cell);
440 440
441 bool shouldAutosize; 441 bool shouldAutosize;
442 if (blockSuppressesAutosizing(renderTableCell)) 442 if (blockSuppressesAutosizing(renderTableCell))
443 shouldAutosize = false; 443 shouldAutosize = false;
444 else if (Supercluster* supercluster = getSupercluster(renderTabl eCell)) 444 else if (Supercluster* supercluster = getSupercluster(renderTabl eCell))
445 shouldAutosize = superclusterHasEnoughTextToAutosize(supercl uster, table); 445 shouldAutosize = superclusterHasEnoughTextToAutosize(supercl uster, table);
446 else 446 else
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 { 941 {
942 // List items are treated as text due to the marker. 942 // List items are treated as text due to the marker.
943 // The actual renderer for the marker (RenderListMarker) may not be in the t ree yet since it is added during layout. 943 // The actual renderer for the marker (RenderListMarker) may not be in the t ree yet since it is added during layout.
944 if (parent->isListItem()) 944 if (parent->isListItem())
945 return parent; 945 return parent;
946 946
947 if (parent->isText()) 947 if (parent->isText())
948 return parent; 948 return parent;
949 949
950 ++depth; 950 ++depth;
951 const RenderObject* child = (firstOrLast == First) ? parent->firstChild() : parent->lastChild(); 951 const RenderObject* child = (firstOrLast == First) ? parent->slowFirstChild( ) : parent->slowLastChild();
952 while (child) { 952 while (child) {
953 // Note: At this point clusters may not have been created for these bloc ks so we cannot rely 953 // Note: At this point clusters may not have been created for these bloc ks so we cannot rely
954 // on m_clusters. Instead, we use a best-guess about whether the b lock will become a cluster. 954 // on m_clusters. Instead, we use a best-guess about whether the b lock will become a cluster.
955 if (!classifyBlock(child, INDEPENDENT)) { 955 if (!classifyBlock(child, INDEPENDENT)) {
956 if (const RenderObject* leaf = findTextLeaf(child, depth, firstOrLas t)) 956 if (const RenderObject* leaf = findTextLeaf(child, depth, firstOrLas t))
957 return leaf; 957 return leaf;
958 } 958 }
959 child = (firstOrLast == First) ? child->nextSibling() : child->previousS ibling(); 959 child = (firstOrLast == First) ? child->nextSibling() : child->previousS ibling();
960 } 960 }
961 --depth; 961 --depth;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo() 1130 FastTextAutosizer::DeferUpdatePageInfo::~DeferUpdatePageInfo()
1131 { 1131 {
1132 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) { 1132 if (FastTextAutosizer* textAutosizer = m_mainFrame->document()->fastTextAuto sizer()) {
1133 ASSERT(textAutosizer->m_updatePageInfoDeferred); 1133 ASSERT(textAutosizer->m_updatePageInfoDeferred);
1134 textAutosizer->m_updatePageInfoDeferred = false; 1134 textAutosizer->m_updatePageInfoDeferred = false;
1135 textAutosizer->updatePageInfoInAllFrames(); 1135 textAutosizer->updatePageInfoInAllFrames();
1136 } 1136 }
1137 } 1137 }
1138 1138
1139 } // namespace WebCore 1139 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/plugins/PluginOcclusionSupport.cpp ('k') | Source/core/rendering/FixedTableLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698