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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 LayoutUnit previousHeight = logicalHeight(); | 362 LayoutUnit previousHeight = logicalHeight(); |
363 setLogicalHeight(beforeEdge); | 363 setLogicalHeight(beforeEdge); |
364 | 364 |
365 m_paintInvalidationLogicalTop = 0; | 365 m_paintInvalidationLogicalTop = 0; |
366 m_paintInvalidationLogicalBottom = 0; | 366 m_paintInvalidationLogicalBottom = 0; |
367 if (!firstChild() && !isAnonymousBlock()) | 367 if (!firstChild() && !isAnonymousBlock()) |
368 setChildrenInline(true); | 368 setChildrenInline(true); |
369 | 369 |
370 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); | 370 TextAutosizer::LayoutScope textAutosizerLayoutScope(this); |
371 | 371 |
| 372 // Reset the flag here instead of in layoutInlineChildren() in case that |
| 373 // all inline children are removed from this block. |
| 374 setContainsInlineWithOutlineAndContinuation(false); |
372 if (childrenInline()) | 375 if (childrenInline()) |
373 layoutInlineChildren(relayoutChildren, m_paintInvalidationLogicalTop, m_
paintInvalidationLogicalBottom, afterEdge); | 376 layoutInlineChildren(relayoutChildren, m_paintInvalidationLogicalTop, m_
paintInvalidationLogicalBottom, afterEdge); |
374 else | 377 else |
375 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge
); | 378 layoutBlockChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge
); |
376 | 379 |
377 if (needsRecalcLogicalWidthAfterLayoutChildren()) { | 380 if (needsRecalcLogicalWidthAfterLayoutChildren()) { |
378 // In perpendicular writing-mode, min-content logicalWidth depends on th
e child's logicalHeight, | 381 // In perpendicular writing-mode, min-content logicalWidth depends on th
e child's logicalHeight, |
379 // so logicalWidth needs to be updated after children layout is done. | 382 // so logicalWidth needs to be updated after children layout is done. |
380 // Strictly speaking, children need re-layout if logicalWidth is changed
, but in most cases, | 383 // Strictly speaking, children need re-layout if logicalWidth is changed
, but in most cases, |
381 // perpendicular children do not re-flow according to parent's logicalWi
dth. | 384 // perpendicular children do not re-flow according to parent's logicalWi
dth. |
(...skipping 2685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3067 FrameView* frameView = document().view(); | 3070 FrameView* frameView = document().view(); |
3068 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); | 3071 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr
ollOffset().height(); |
3069 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); | 3072 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(
); |
3070 if (size().height() < visibleHeight) | 3073 if (size().height() < visibleHeight) |
3071 top += (visibleHeight - size().height()) / 2; | 3074 top += (visibleHeight - size().height()) / 2; |
3072 setY(top); | 3075 setY(top); |
3073 dialog->setCentered(top); | 3076 dialog->setCentered(top); |
3074 } | 3077 } |
3075 | 3078 |
3076 } // namespace blink | 3079 } // namespace blink |
OLD | NEW |