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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.h

Issue 2877703003: Improve LayoutMultiColumnFlowThread::IsPageLogicalHeightKnown(). (Closed)
Patch Set: Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // layout (during column set layout), in which case we need another layout 246 // layout (during column set layout), in which case we need another layout
247 // pass. Column heights may change after flow thread layout because of 247 // pass. Column heights may change after flow thread layout because of
248 // balancing. We may have to do multiple layout passes, depending on how the 248 // balancing. We may have to do multiple layout passes, depending on how the
249 // contents is fitted to the changed column heights. In most cases, laying out 249 // contents is fitted to the changed column heights. In most cases, laying out
250 // again twice or even just once will suffice. Sometimes we need more passes 250 // again twice or even just once will suffice. Sometimes we need more passes
251 // than that, though, but the number of retries should not exceed the number 251 // than that, though, but the number of retries should not exceed the number
252 // of columns, unless we have a bug. 252 // of columns, unless we have a bug.
253 bool ColumnHeightsChanged() const { return column_heights_changed_; } 253 bool ColumnHeightsChanged() const { return column_heights_changed_; }
254 void SetColumnHeightsChanged() { column_heights_changed_ = true; } 254 void SetColumnHeightsChanged() { column_heights_changed_ = true; }
255 255
256 // Finish multicol layout. Returns true if we're really done, or false if we
257 // need another layout pass (typically because columns got new heights in the
258 // previous pass, so that we need to refragment).
259 bool FinishLayout();
260
256 void ColumnRuleStyleDidChange(); 261 void ColumnRuleStyleDidChange();
257 262
258 // Remove the spanner placeholder and return true if the specified object is 263 // Remove the spanner placeholder and return true if the specified object is
259 // no longer a valid spanner. 264 // no longer a valid spanner.
260 bool RemoveSpannerPlaceholderIfNoLongerValid( 265 bool RemoveSpannerPlaceholderIfNoLongerValid(
261 LayoutBox* spanner_object_in_flow_thread); 266 LayoutBox* spanner_object_in_flow_thread);
262 267
263 LayoutMultiColumnFlowThread* EnclosingFlowThread( 268 LayoutMultiColumnFlowThread* EnclosingFlowThread(
264 AncestorSearchConstraint = kIsolateUnbreakableContainers) const; 269 AncestorSearchConstraint = kIsolateUnbreakableContainers) const;
265 FragmentationContext* EnclosingFragmentationContext( 270 FragmentationContext* EnclosingFragmentationContext(
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 LayoutUnit column_height_available_; 350 LayoutUnit column_height_available_;
346 351
347 // Cached block offset from this flow thread to the enclosing fragmentation 352 // Cached block offset from this flow thread to the enclosing fragmentation
348 // context, if any. In 353 // context, if any. In
349 // the coordinate space of the enclosing fragmentation context. 354 // the coordinate space of the enclosing fragmentation context.
350 LayoutUnit block_offset_in_enclosing_fragmentation_context_; 355 LayoutUnit block_offset_in_enclosing_fragmentation_context_;
351 356
352 // Set when column heights are out of sync with actual layout. 357 // Set when column heights are out of sync with actual layout.
353 bool column_heights_changed_; 358 bool column_heights_changed_;
354 359
360 bool all_columns_have_known_height_ = false;
361
355 // Always true for regular multicol. False for paged-y overflow. 362 // Always true for regular multicol. False for paged-y overflow.
356 bool progression_is_inline_; 363 bool progression_is_inline_;
357 364
358 bool is_being_evacuated_; 365 bool is_being_evacuated_;
359 366
360 // Specifies whether the the descendant whose style is about to change could 367 // Specifies whether the the descendant whose style is about to change could
361 // contain spanners or not. The flag is set in 368 // contain spanners or not. The flag is set in
362 // flowThreadDescendantStyleWillChange(), and then checked in 369 // flowThreadDescendantStyleWillChange(), and then checked in
363 // flowThreadDescendantStyleDidChange(). 370 // flowThreadDescendantStyleDidChange().
364 static bool could_contain_spanners_; 371 static bool could_contain_spanners_;
365 372
366 static bool toggle_spanners_if_needed_; 373 static bool toggle_spanners_if_needed_;
367 }; 374 };
368 375
369 // Cannot use DEFINE_LAYOUT_OBJECT_TYPE_CASTS here, because 376 // Cannot use DEFINE_LAYOUT_OBJECT_TYPE_CASTS here, because
370 // isMultiColumnFlowThread() is defined in LayoutFlowThread, not in 377 // isMultiColumnFlowThread() is defined in LayoutFlowThread, not in
371 // LayoutObject. 378 // LayoutObject.
372 DEFINE_TYPE_CASTS(LayoutMultiColumnFlowThread, 379 DEFINE_TYPE_CASTS(LayoutMultiColumnFlowThread,
373 LayoutFlowThread, 380 LayoutFlowThread,
374 object, 381 object,
375 object->IsLayoutMultiColumnFlowThread(), 382 object->IsLayoutMultiColumnFlowThread(),
376 object.IsLayoutMultiColumnFlowThread()); 383 object.IsLayoutMultiColumnFlowThread());
377 384
378 } // namespace blink 385 } // namespace blink
379 386
380 #endif // LayoutMultiColumnFlowThread_h 387 #endif // LayoutMultiColumnFlowThread_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698