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

Side by Side Diff: Source/core/layout/LayoutListItem.cpp

Issue 1021143004: [New Multicolumn] Don't return the wrong flow thread from locateFlowThreadContainingBlock(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 return result; 265 return result;
266 } 266 }
267 267
268 void LayoutListItem::updateMarkerLocationAndInvalidateWidth() 268 void LayoutListItem::updateMarkerLocationAndInvalidateWidth()
269 { 269 {
270 ASSERT(m_marker); 270 ASSERT(m_marker);
271 271
272 // FIXME: We should not modify the structure of the render tree 272 // FIXME: We should not modify the structure of the render tree
273 // during layout. crbug.com/370461 273 // during layout. crbug.com/370461
274 DeprecatedDisableModifyRenderTreeStructureAsserts disabler; 274 DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
275 LayoutState* layoutState = view()->layoutState();
276 LayoutFlowThread* currentFlowThread = nullptr;
277 if (layoutState) {
278 // We're about to modify the layout tree structure (during layout!), and any code using
279 // LayoutState might get utterly confused by that. There's no evidence t hat anything other
280 // than the flow thread code will suffer, though, so just reset the curr ent flow thread
281 // temporarily.
282 // FIXME: get rid of this hack, including the flow thread setter in Layo utState, as part of
283 // fixing crbug.com/370461
284 currentFlowThread = layoutState->flowThread();
285 layoutState->setFlowThread(nullptr);
286 }
275 if (updateMarkerLocation()) { 287 if (updateMarkerLocation()) {
276 // If the marker is inside we need to redo the preferred width calculati ons 288 // If the marker is inside we need to redo the preferred width calculati ons
277 // as the size of the item now includes the size of the list marker. 289 // as the size of the item now includes the size of the list marker.
278 if (m_marker->isInside()) 290 if (m_marker->isInside())
279 containingBlock()->updateLogicalWidth(); 291 containingBlock()->updateLogicalWidth();
280 } 292 }
293 if (layoutState)
294 layoutState->setFlowThread(currentFlowThread);
281 } 295 }
282 296
283 bool LayoutListItem::updateMarkerLocation() 297 bool LayoutListItem::updateMarkerLocation()
284 { 298 {
285 ASSERT(m_marker); 299 ASSERT(m_marker);
286 LayoutObject* markerParent = m_marker->parent(); 300 LayoutObject* markerParent = m_marker->parent();
287 LayoutObject* lineBoxParent = getParentOfFirstLineBox(this, m_marker); 301 LayoutObject* lineBoxParent = getParentOfFirstLineBox(this, m_marker);
288 if (!lineBoxParent) { 302 if (!lineBoxParent) {
289 // If the marker is currently contained inside an anonymous box, then we 303 // If the marker is currently contained inside an anonymous box, then we
290 // are the only item in that anonymous box (since no line box parent was 304 // are the only item in that anonymous box (since no line box parent was
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 // assume that all the following ones have too. 528 // assume that all the following ones have too.
515 // This gives us the opportunity to stop here and avoid 529 // This gives us the opportunity to stop here and avoid
516 // marking the same nodes again. 530 // marking the same nodes again.
517 break; 531 break;
518 } 532 }
519 item->updateValue(); 533 item->updateValue();
520 } 534 }
521 } 535 }
522 536
523 } // namespace blink 537 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/empty-list-item-as-nested-multicol-expected.txt ('k') | Source/core/layout/LayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698