| 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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 // We're at the very top of a page or column. | 831 // We're at the very top of a page or column. |
| 832 if (lineBox != firstRootBox()) | 832 if (lineBox != firstRootBox()) |
| 833 lineBox.setIsFirstAfterPageBreak(true); | 833 lineBox.setIsFirstAfterPageBreak(true); |
| 834 } | 834 } |
| 835 | 835 |
| 836 paginatedContentWasLaidOut(logicalOffset); | 836 paginatedContentWasLaidOut(logicalOffset); |
| 837 } | 837 } |
| 838 | 838 |
| 839 LayoutUnit LayoutBlockFlow::adjustForUnsplittableChild(LayoutBox& child, LayoutU
nit logicalOffset) | 839 LayoutUnit LayoutBlockFlow::adjustForUnsplittableChild(LayoutBox& child, LayoutU
nit logicalOffset) |
| 840 { | 840 { |
| 841 bool checkColumnBreaks = flowThreadContainingBlock(); | 841 if (child.paginationBreakability() == AllowAnyBreaks) |
| 842 bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->pageLogi
calHeight(); | |
| 843 bool isUnsplittable = child.isUnsplittableForPagination() || (checkColumnBre
aks && child.style()->columnBreakInside() == PBAVOID) | |
| 844 || (checkPageBreaks && child.style()->pageBreakInside() == PBAVOID); | |
| 845 if (!isUnsplittable) | |
| 846 return logicalOffset; | 842 return logicalOffset; |
| 847 LayoutUnit childLogicalHeight = logicalHeightForChild(child); | 843 LayoutUnit childLogicalHeight = logicalHeightForChild(child); |
| 848 // Floats' margins do not collapse with page or column boundaries. | 844 // Floats' margins do not collapse with page or column boundaries. |
| 849 if (child.isFloating()) | 845 if (child.isFloating()) |
| 850 childLogicalHeight += marginBeforeForChild(child) + marginAfterForChild(
child); | 846 childLogicalHeight += marginBeforeForChild(child) + marginAfterForChild(
child); |
| 851 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); | 847 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); |
| 852 updateMinimumPageHeight(logicalOffset, childLogicalHeight); | 848 updateMinimumPageHeight(logicalOffset, childLogicalHeight); |
| 853 if (!pageLogicalHeight) | 849 if (!pageLogicalHeight) |
| 854 return logicalOffset; | 850 return logicalOffset; |
| 855 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logi
calOffset, AssociateWithLatterPage); | 851 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logi
calOffset, AssociateWithLatterPage); |
| (...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3043 FrameView* frameView = document().view(); | 3039 FrameView* frameView = document().view(); |
| 3044 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); | 3040 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); |
| 3045 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 3041 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
| 3046 if (size().height() < visibleHeight) | 3042 if (size().height() < visibleHeight) |
| 3047 top += (visibleHeight - size().height()) / 2; | 3043 top += (visibleHeight - size().height()) / 2; |
| 3048 setY(top); | 3044 setY(top); |
| 3049 dialog->setCentered(top); | 3045 dialog->setCentered(top); |
| 3050 } | 3046 } |
| 3051 | 3047 |
| 3052 } // namespace blink | 3048 } // namespace blink |
| OLD | NEW |