OLD | NEW |
---|---|
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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
588 if (markDescendantsWithFloats) | 588 if (markDescendantsWithFloats) |
589 childRenderBlockFlow->markAllDescendantsWithFloatsForLayout(); | 589 childRenderBlockFlow->markAllDescendantsWithFloatsForLayout(); |
590 if (!child->isWritingModeRoot()) | 590 if (!child->isWritingModeRoot()) |
591 previousFloatLogicalBottom = std::max(previousFloatLogicalBottom, ol dLogicalTop + childRenderBlockFlow->lowestFloatLogicalBottom()); | 591 previousFloatLogicalBottom = std::max(previousFloatLogicalBottom, ol dLogicalTop + childRenderBlockFlow->lowestFloatLogicalBottom()); |
592 } | 592 } |
593 | 593 |
594 SubtreeLayoutScope layoutScope(*child); | 594 SubtreeLayoutScope layoutScope(*child); |
595 if (!child->needsLayout()) | 595 if (!child->needsLayout()) |
596 child->markForPaginationRelayoutIfNeeded(layoutScope); | 596 child->markForPaginationRelayoutIfNeeded(layoutScope); |
597 | 597 |
598 bool childHadLayout = child->everHadLayout(); | |
599 bool childNeededLayout = child->needsLayout(); | 598 bool childNeededLayout = child->needsLayout(); |
600 if (childNeededLayout) | 599 if (childNeededLayout) |
601 child->layout(); | 600 child->layout(); |
602 | 601 |
603 // Cache if we are at the top of the block right now. | 602 // Cache if we are at the top of the block right now. |
604 bool atBeforeSideOfBlock = marginInfo.atBeforeSideOfBlock(); | 603 bool atBeforeSideOfBlock = marginInfo.atBeforeSideOfBlock(); |
605 bool childIsSelfCollapsing = child->isSelfCollapsingBlock(); | 604 bool childIsSelfCollapsing = child->isSelfCollapsingBlock(); |
606 | 605 |
607 // Now determine the correct ypos based off examination of collapsing margin | 606 // Now determine the correct ypos based off examination of collapsing margin |
608 // values. | 607 // values. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
663 setLogicalHeight(logicalHeight() + logicalHeightForChild(child)); | 662 setLogicalHeight(logicalHeight() + logicalHeightForChild(child)); |
664 if (mustSeparateMarginAfterForChild(child)) { | 663 if (mustSeparateMarginAfterForChild(child)) { |
665 setLogicalHeight(logicalHeight() + marginAfterForChild(child)); | 664 setLogicalHeight(logicalHeight() + marginAfterForChild(child)); |
666 marginInfo.clearMargin(); | 665 marginInfo.clearMargin(); |
667 } | 666 } |
668 // If the child has overhanging floats that intrude into following siblings (or possibly out | 667 // If the child has overhanging floats that intrude into following siblings (or possibly out |
669 // of this block), then the parent gets notified of the floats now. | 668 // of this block), then the parent gets notified of the floats now. |
670 if (childRenderBlockFlow) | 669 if (childRenderBlockFlow) |
671 addOverhangingFloats(childRenderBlockFlow, !childNeededLayout); | 670 addOverhangingFloats(childRenderBlockFlow, !childNeededLayout); |
672 | 671 |
673 // If the child moved, we have to invalidate it's paint as well as any floa ting/positioned | 672 // If the child moved, we have to invalidate it's paint as well as any float ing/positioned |
Julien - ping for review
2014/10/13 21:26:54
s/it's/its/
Xianzhu
2014/10/13 21:35:37
Done.
| |
674 // descendants. An exception is if we need a layout. In this case, we know w e're going to | 673 // descendants. An exception is if we need a layout. In this case, we know w e're going to |
675 // invalidate our paint (and the child) anyway. | 674 // invalidate our paint (and the child) anyway. |
676 bool didNotDoFullLayoutAndMoved = childHadLayout && !selfNeedsLayout() && (c hildOffset.width() || childOffset.height()); | 675 if (!selfNeedsLayout() && (childOffset.width() || childOffset.height())) |
677 bool didNotLayoutAndNeedsPaintInvalidation = !childHadLayout && child->check ForPaintInvalidation(); | |
678 | |
679 if (didNotDoFullLayoutAndMoved || didNotLayoutAndNeedsPaintInvalidation) | |
680 child->invalidatePaintForOverhangingFloats(true); | 676 child->invalidatePaintForOverhangingFloats(true); |
681 | 677 |
682 if (paginated) { | 678 if (paginated) { |
683 // Check for an after page/column break. | 679 // Check for an after page/column break. |
684 LayoutUnit newHeight = applyAfterBreak(child, logicalHeight(), marginInf o); | 680 LayoutUnit newHeight = applyAfterBreak(child, logicalHeight(), marginInf o); |
685 if (newHeight != height()) | 681 if (newHeight != height()) |
686 setLogicalHeight(newHeight); | 682 setLogicalHeight(newHeight); |
687 } | 683 } |
688 } | 684 } |
689 | 685 |
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2862 FrameView* frameView = document().view(); | 2858 FrameView* frameView = document().view(); |
2863 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); | 2859 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); |
2864 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); | 2860 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); |
2865 if (height() < visibleHeight) | 2861 if (height() < visibleHeight) |
2866 top += (visibleHeight - height()) / 2; | 2862 top += (visibleHeight - height()) / 2; |
2867 setY(top); | 2863 setY(top); |
2868 dialog->setCentered(top); | 2864 dialog->setCentered(top); |
2869 } | 2865 } |
2870 | 2866 |
2871 } // namespace blink | 2867 } // namespace blink |
OLD | NEW |