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

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

Issue 1880343004: Fix TextAutosizer not to scheduleRelayout() for LayoutGrid::layoutBlock() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 ASSERT(tracksAreWiderThanMinTrackBreadth(direction, sizingData)); 340 ASSERT(tracksAreWiderThanMinTrackBreadth(direction, sizingData));
341 } 341 }
342 342
343 void LayoutGrid::layoutBlock(bool relayoutChildren) 343 void LayoutGrid::layoutBlock(bool relayoutChildren)
344 { 344 {
345 ASSERT(needsLayout()); 345 ASSERT(needsLayout());
346 346
347 if (!relayoutChildren && simplifiedLayout()) 347 if (!relayoutChildren && simplifiedLayout())
348 return; 348 return;
349 349
350 SubtreeLayoutScope layoutScope(*this);
351
350 { 352 {
351 // LayoutState needs this deliberate scope to pop before updating scroll information (which 353 // LayoutState needs this deliberate scope to pop before updating scroll information (which
352 // may trigger relayout). 354 // may trigger relayout).
353 LayoutState state(*this, locationOffset()); 355 LayoutState state(*this, locationOffset());
354 356
355 LayoutSize previousSize = size(); 357 LayoutSize previousSize = size();
356 358
357 updateLogicalWidth(); 359 updateLogicalWidth();
358 bool logicalHeightWasIndefinite = computeContentLogicalHeight(MainOrPref erredSize, style()->logicalHeight(), LayoutUnit(-1)) == LayoutUnit(-1); 360 bool logicalHeightWasIndefinite = computeContentLogicalHeight(MainOrPref erredSize, style()->logicalHeight(), LayoutUnit(-1)) == LayoutUnit(-1);
359 361
360 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); 362 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope);
361 363
362 placeItemsOnGrid(); 364 placeItemsOnGrid();
363 365
364 GridSizingData sizingData(gridColumnCount(), gridRowCount()); 366 GridSizingData sizingData(gridColumnCount(), gridRowCount());
365 367
366 // 1- First, the track sizing algorithm is used to resolve the sizes of the grid columns. 368 // 1- First, the track sizing algorithm is used to resolve the sizes of the grid columns.
367 // At this point the logical width is always definite as the above call to updateLogicalWidth() 369 // At this point the logical width is always definite as the above call to updateLogicalWidth()
368 // properly resolves intrinsic sizes. We cannot do the same for heights though because many code 370 // properly resolves intrinsic sizes. We cannot do the same for heights though because many code
369 // paths inside updateLogicalHeight() require a previous call to setLogi calHeight() to resolve 371 // paths inside updateLogicalHeight() require a previous call to setLogi calHeight() to resolve
370 // heights properly (like for positioned items for example). 372 // heights properly (like for positioned items for example).
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 2140
2139 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData )); 2141 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData ));
2140 } 2142 }
2141 2143
2142 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2144 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2143 { 2145 {
2144 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2146 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2145 } 2147 }
2146 2148
2147 } // namespace blink 2149 } // namespace blink
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