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

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

Issue 2467353003: Remove pageLogicalHeightChanged() from LayoutState. (Closed)
Patch Set: Created 4 years, 1 month 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 | third_party/WebKit/Source/core/layout/LayoutState.h » ('j') | 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 rebuildFloatsFromIntruding(); 477 rebuildFloatsFromIntruding();
478 478
479 bool pageLogicalHeightChanged = false; 479 bool pageLogicalHeightChanged = false;
480 bool hasSpecifiedPageLogicalHeight = false; 480 bool hasSpecifiedPageLogicalHeight = false;
481 checkForPaginationLogicalHeightChange(pageLogicalHeight, 481 checkForPaginationLogicalHeightChange(pageLogicalHeight,
482 pageLogicalHeightChanged, 482 pageLogicalHeightChanged,
483 hasSpecifiedPageLogicalHeight); 483 hasSpecifiedPageLogicalHeight);
484 if (pageLogicalHeightChanged) 484 if (pageLogicalHeightChanged)
485 relayoutChildren = true; 485 relayoutChildren = true;
486 486
487 LayoutState state(*this, pageLogicalHeight, pageLogicalHeightChanged, 487 LayoutState state(*this, pageLogicalHeight, logicalWidthChanged);
488 logicalWidthChanged);
489 488
490 if (m_paginationStateChanged) { 489 if (m_paginationStateChanged) {
491 // We now need a deep layout to clean up struts after pagination, if we 490 // We now need a deep layout to clean up struts after pagination, if we
492 // just ceased to be paginated, or, if we just became paginated on the 491 // just ceased to be paginated, or, if we just became paginated on the
493 // other hand, we now need the deep layout, to insert pagination struts. 492 // other hand, we now need the deep layout, to insert pagination struts.
494 m_paginationStateChanged = false; 493 m_paginationStateChanged = false;
495 state.setPaginationStateChanged(); 494 state.setPaginationStateChanged();
496 } 495 }
497 496
498 // We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg, 497 // We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg,
(...skipping 3027 matching lines...) Expand 10 before | Expand all | Expand 10 after
3526 FloatingObjectSetIterator it = 3525 FloatingObjectSetIterator it =
3527 floatingObjectSet.find<FloatingObjectHashTranslator>(&floatBox); 3526 floatingObjectSet.find<FloatingObjectHashTranslator>(&floatBox);
3528 if (it != floatingObjectSet.end()) 3527 if (it != floatingObjectSet.end())
3529 return it->get(); 3528 return it->get();
3530 } 3529 }
3531 3530
3532 // Create the special object entry & append it to the list 3531 // Create the special object entry & append it to the list
3533 3532
3534 std::unique_ptr<FloatingObject> newObj = FloatingObject::create(&floatBox); 3533 std::unique_ptr<FloatingObject> newObj = FloatingObject::create(&floatBox);
3535 3534
3536 // Our location is irrelevant if we're unsplittable or no pagination is in 3535 // TODO(mstensho): Avoid laying out before positioning the object, as that's
3537 // effect. Just go ahead and lay out the float. 3536 // bad for pagination.
3538 bool isChildLayoutBlock = floatBox.isLayoutBlock();
3539 if (isChildLayoutBlock && !floatBox.needsLayout() &&
3540 view()->layoutState()->pageLogicalHeightChanged())
3541 floatBox.setChildNeedsLayout(MarkOnlyThis);
3542
3543 floatBox.layoutIfNeeded(); 3537 floatBox.layoutIfNeeded();
3544 3538
3545 setLogicalWidthForFloat(*newObj, logicalWidthForChild(floatBox) + 3539 setLogicalWidthForFloat(*newObj, logicalWidthForChild(floatBox) +
3546 marginStartForChild(floatBox) + 3540 marginStartForChild(floatBox) +
3547 marginEndForChild(floatBox)); 3541 marginEndForChild(floatBox));
3548 3542
3549 return m_floatingObjects->add(std::move(newObj)); 3543 return m_floatingObjects->add(std::move(newObj));
3550 } 3544 }
3551 3545
3552 void LayoutBlockFlow::removeFloatingObject(LayoutBox* floatBox) { 3546 void LayoutBlockFlow::removeFloatingObject(LayoutBox* floatBox) {
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
4550 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4544 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4551 } 4545 }
4552 4546
4553 void LayoutBlockFlow::invalidateDisplayItemClients( 4547 void LayoutBlockFlow::invalidateDisplayItemClients(
4554 PaintInvalidationReason invalidationReason) const { 4548 PaintInvalidationReason invalidationReason) const {
4555 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4549 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4556 invalidationReason); 4550 invalidationReason);
4557 } 4551 }
4558 4552
4559 } // namespace blink 4553 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698