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 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2880 { | 2880 { |
2881 // The block needs to be contained by a LayoutBlockFlow (and not by e.g. a f lexbox, grid, or a | 2881 // The block needs to be contained by a LayoutBlockFlow (and not by e.g. a f lexbox, grid, or a |
2882 // table (the latter being the case for table cell or table caption)). The r eason for this | 2882 // table (the latter being the case for table cell or table caption)). The r eason for this |
2883 // limitation is simply that LayoutBlockFlow child layout code is the only p lace where we pick | 2883 // limitation is simply that LayoutBlockFlow child layout code is the only p lace where we pick |
2884 // up the struts and handle them. We handle floats and regular in-flow child ren, and that's | 2884 // up the struts and handle them. We handle floats and regular in-flow child ren, and that's |
2885 // all. We could handle this in other layout modes as well (and even for out -of-flow children), | 2885 // all. We could handle this in other layout modes as well (and even for out -of-flow children), |
2886 // but currently we don't. | 2886 // but currently we don't. |
2887 // TODO(mstensho): But we *should*. | 2887 // TODO(mstensho): But we *should*. |
2888 if (isOutOfFlowPositioned()) | 2888 if (isOutOfFlowPositioned()) |
2889 return false; | 2889 return false; |
2890 if (isLayoutFlowThread()) { | |
2891 // Don't let the strut escape the fragmentation context and get lost. | |
2892 // TODO(mstensho): if we're in a nested fragmentation context, we should ideally convert | |
leviw_travelin_and_unemployed
2015/11/05 22:36:06
No capital 'i' in 'if'? I suppose I can let that s
mstensho (USE GERRIT)
2015/11/05 22:44:09
That's out of the question! Fixed.
| |
2893 // and propagate the strut to the outer fragmentation context, so that t he inner one is | |
2894 // fully pushed to the next outer fragmentainer, instead of taking up un usable space in the | |
2895 // previous one. But currently we have no mechanism in place to handle t his. | |
2896 return false; | |
2897 } | |
2890 LayoutBlock* containingBlock = this->containingBlock(); | 2898 LayoutBlock* containingBlock = this->containingBlock(); |
2891 return containingBlock && containingBlock->isLayoutBlockFlow(); | 2899 return containingBlock && containingBlock->isLayoutBlockFlow(); |
2892 } | 2900 } |
2893 | 2901 |
2894 void LayoutBlockFlow::setPaginationStrutPropagatedFromChild(LayoutUnit strut) | 2902 void LayoutBlockFlow::setPaginationStrutPropagatedFromChild(LayoutUnit strut) |
2895 { | 2903 { |
2896 if (!m_rareData) { | 2904 if (!m_rareData) { |
2897 if (!strut) | 2905 if (!strut) |
2898 return; | 2906 return; |
2899 m_rareData = adoptPtr(new LayoutBlockFlowRareData(this)); | 2907 m_rareData = adoptPtr(new LayoutBlockFlowRareData(this)); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3066 FrameView* frameView = document().view(); | 3074 FrameView* frameView = document().view(); |
3067 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); | 3075 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); |
3068 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); | 3076 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); |
3069 if (size().height() < visibleHeight) | 3077 if (size().height() < visibleHeight) |
3070 top += (visibleHeight - size().height()) / 2; | 3078 top += (visibleHeight - size().height()) / 2; |
3071 setY(top); | 3079 setY(top); |
3072 dialog->setCentered(top); | 3080 dialog->setCentered(top); |
3073 } | 3081 } |
3074 | 3082 |
3075 } // namespace blink | 3083 } // namespace blink |
OLD | NEW |