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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 } | 860 } |
861 } else if (remainingLogicalHeight == pageLogicalHeight) { | 861 } else if (remainingLogicalHeight == pageLogicalHeight) { |
862 // We're at the very top of a page or column. | 862 // We're at the very top of a page or column. |
863 if (lineBox != firstRootBox()) | 863 if (lineBox != firstRootBox()) |
864 lineBox->setIsFirstAfterPageBreak(true); | 864 lineBox->setIsFirstAfterPageBreak(true); |
865 if (lineBox != firstRootBox() || offsetFromLogicalTopOfFirstPage()) | 865 if (lineBox != firstRootBox() || offsetFromLogicalTopOfFirstPage()) |
866 setPageBreak(logicalOffset, lineHeight); | 866 setPageBreak(logicalOffset, lineHeight); |
867 } | 867 } |
868 } | 868 } |
869 | 869 |
| 870 LayoutUnit RenderBlockFlow::adjustForUnsplittableChild(RenderBox* child, LayoutU
nit logicalOffset, bool includeMargins) |
| 871 { |
| 872 bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns() || flo
wThreadContainingBlock(); |
| 873 bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->pageLogi
calHeight(); |
| 874 bool isUnsplittable = child->isUnsplittableForPagination() || (checkColumnBr
eaks && child->style()->columnBreakInside() == PBAVOID) |
| 875 || (checkPageBreaks && child->style()->pageBreakInside() == PBAVOID); |
| 876 if (!isUnsplittable) |
| 877 return logicalOffset; |
| 878 LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargi
ns ? marginBeforeForChild(child) + marginAfterForChild(child) : LayoutUnit()); |
| 879 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); |
| 880 updateMinimumPageHeight(logicalOffset, childLogicalHeight); |
| 881 if (!pageLogicalHeight || childLogicalHeight > pageLogicalHeight) |
| 882 return logicalOffset; |
| 883 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logi
calOffset, ExcludePageBoundary); |
| 884 if (remainingLogicalHeight < childLogicalHeight) |
| 885 return logicalOffset + remainingLogicalHeight; |
| 886 return logicalOffset; |
| 887 } |
| 888 |
870 void RenderBlockFlow::rebuildFloatsFromIntruding() | 889 void RenderBlockFlow::rebuildFloatsFromIntruding() |
871 { | 890 { |
872 if (m_floatingObjects) | 891 if (m_floatingObjects) |
873 m_floatingObjects->setHorizontalWritingMode(isHorizontalWritingMode()); | 892 m_floatingObjects->setHorizontalWritingMode(isHorizontalWritingMode()); |
874 | 893 |
875 HashSet<RenderBox*> oldIntrudingFloatSet; | 894 HashSet<RenderBox*> oldIntrudingFloatSet; |
876 if (!childrenInline() && m_floatingObjects) { | 895 if (!childrenInline() && m_floatingObjects) { |
877 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 896 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
878 FloatingObjectSetIterator end = floatingObjectSet.end(); | 897 FloatingObjectSetIterator end = floatingObjectSet.end(); |
879 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { | 898 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end
; ++it) { |
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2905 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2924 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
2906 { | 2925 { |
2907 if (m_rareData) | 2926 if (m_rareData) |
2908 return *m_rareData; | 2927 return *m_rareData; |
2909 | 2928 |
2910 m_rareData = adoptPtrWillBeNoop(new RenderBlockFlowRareData(this)); | 2929 m_rareData = adoptPtrWillBeNoop(new RenderBlockFlowRareData(this)); |
2911 return *m_rareData; | 2930 return *m_rareData; |
2912 } | 2931 } |
2913 | 2932 |
2914 } // namespace blink | 2933 } // namespace blink |
OLD | NEW |