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

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

Issue 1241703005: Make sure that no column rows get negative flow thread portion heights. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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) 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 columnSet->detachFromFlowThread(); 586 columnSet->detachFromFlowThread();
587 multiColumnBlockFlow()->resetMultiColumnFlowThread(); 587 multiColumnBlockFlow()->resetMultiColumnFlowThread();
588 LayoutFlowThread::willBeRemovedFromTree(); 588 LayoutFlowThread::willBeRemovedFromTree();
589 } 589 }
590 590
591 void LayoutMultiColumnFlowThread::skipColumnSpanner(LayoutBox* layoutObject, Lay outUnit logicalTopInFlowThread) 591 void LayoutMultiColumnFlowThread::skipColumnSpanner(LayoutBox* layoutObject, Lay outUnit logicalTopInFlowThread)
592 { 592 {
593 ASSERT(layoutObject->isColumnSpanAll()); 593 ASSERT(layoutObject->isColumnSpanAll());
594 LayoutMultiColumnSpannerPlaceholder* placeholder = layoutObject->spannerPlac eholder(); 594 LayoutMultiColumnSpannerPlaceholder* placeholder = layoutObject->spannerPlac eholder();
595 LayoutBox* previousColumnBox = placeholder->previousSiblingMultiColumnBox(); 595 LayoutBox* previousColumnBox = placeholder->previousSiblingMultiColumnBox();
596 if (previousColumnBox && previousColumnBox->isLayoutMultiColumnSet()) 596 if (previousColumnBox && previousColumnBox->isLayoutMultiColumnSet()) {
597 toLayoutMultiColumnSet(previousColumnBox)->endFlow(logicalTopInFlowThrea d); 597 LayoutMultiColumnSet* columnSet = toLayoutMultiColumnSet(previousColumnB ox);
598 if (logicalTopInFlowThread < columnSet->logicalTopInFlowThread())
599 logicalTopInFlowThread = columnSet->logicalTopInFlowThread(); // Neg ative margins may cause this.
600 columnSet->endFlow(logicalTopInFlowThread);
601 }
598 LayoutBox* nextColumnBox = placeholder->nextSiblingMultiColumnBox(); 602 LayoutBox* nextColumnBox = placeholder->nextSiblingMultiColumnBox();
599 if (nextColumnBox && nextColumnBox->isLayoutMultiColumnSet()) { 603 if (nextColumnBox && nextColumnBox->isLayoutMultiColumnSet()) {
600 LayoutMultiColumnSet* nextSet = toLayoutMultiColumnSet(nextColumnBox); 604 LayoutMultiColumnSet* nextSet = toLayoutMultiColumnSet(nextColumnBox);
601 m_lastSetWorkedOn = nextSet; 605 m_lastSetWorkedOn = nextSet;
602 nextSet->beginFlow(logicalTopInFlowThread); 606 nextSet->beginFlow(logicalTopInFlowThread);
603 } 607 }
604 608
605 // We'll lay out of spanners after flow thread layout has finished (during l ayout of the spanner 609 // We'll lay out of spanners after flow thread layout has finished (during l ayout of the spanner
606 // placeholders). There may be containing blocks for out-of-flow positioned descendants of the 610 // placeholders). There may be containing blocks for out-of-flow positioned descendants of the
607 // spanner in the flow thread, so that out-of-flow objects inside the spanne r will be laid out 611 // spanner in the flow thread, so that out-of-flow objects inside the spanne r will be laid out
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 } 909 }
906 910
907 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const 911 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const
908 { 912 {
909 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) 913 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet())
910 return columnSet->pageLogicalHeight(); 914 return columnSet->pageLogicalHeight();
911 return false; 915 return false;
912 } 916 }
913 917
914 } 918 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698