OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the layout object implementation for KHTML. | 2 * This file is part of the layout object implementation for KHTML. |
3 * | 3 * |
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
5 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 5 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
6 * Copyright (C) 2003 Apple Computer, Inc. | 6 * Copyright (C) 2003 Apple Computer, Inc. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 393 |
394 if (child->style()->visibility() == COLLAPSE) { | 394 if (child->style()->visibility() == COLLAPSE) { |
395 // visibility: collapsed children do not participate in our posi
tioning. | 395 // visibility: collapsed children do not participate in our posi
tioning. |
396 // But we need to lay them down. | 396 // But we need to lay them down. |
397 child->layoutIfNeeded(); | 397 child->layoutIfNeeded(); |
398 continue; | 398 continue; |
399 } | 399 } |
400 | 400 |
401 SubtreeLayoutScope layoutScope(*child); | 401 SubtreeLayoutScope layoutScope(*child); |
402 | 402 |
403 // We need to see if this child's height has changed, since we make
block elements | 403 // We need to see if this child's height will change, since we make
block elements fill |
404 // fill the height of a containing box by default. | 404 // the height of a containing box by default. We cannot actually *se
t* the new height |
405 // Now do a layout. | 405 // here, though. Need to do that from within layout, or we won't be
able to detect the |
406 LayoutUnit oldChildHeight = child->size().height(); | 406 // change and duly notify any positioned descendants that are affect
ed by it. |
407 child->updateLogicalHeight(); | 407 LayoutUnit oldChildHeight = child->logicalHeight(); |
408 if (oldChildHeight != child->size().height()) | 408 LogicalExtentComputedValues computedValues; |
| 409 child->computeLogicalHeight(child->logicalHeight(), child->logicalTo
p(), computedValues); |
| 410 LayoutUnit newChildHeight = computedValues.m_extent; |
| 411 if (oldChildHeight != newChildHeight) |
409 layoutScope.setChildNeedsLayout(child); | 412 layoutScope.setChildNeedsLayout(child); |
410 | 413 |
411 if (!child->needsLayout()) | 414 if (!child->needsLayout()) |
412 child->markForPaginationRelayoutIfNeeded(layoutScope); | 415 child->markForPaginationRelayoutIfNeeded(layoutScope); |
413 | 416 |
414 child->layoutIfNeeded(); | 417 child->layoutIfNeeded(); |
415 | 418 |
416 // We can place the child now, using our value of box-align. | 419 // We can place the child now, using our value of box-align. |
417 xPos += child->marginLeft(); | 420 xPos += child->marginLeft(); |
418 LayoutUnit childY = yPos; | 421 LayoutUnit childY = yPos; |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 if (minHeight.isFixed() || minHeight.isAuto()) { | 1005 if (minHeight.isFixed() || minHeight.isAuto()) { |
1003 LayoutUnit minHeight = child->style()->minHeight().value(); | 1006 LayoutUnit minHeight = child->style()->minHeight().value(); |
1004 LayoutUnit height = contentHeightForChild(child); | 1007 LayoutUnit height = contentHeightForChild(child); |
1005 LayoutUnit allowedShrinkage = std::min<LayoutUnit>(0, minHeight - height
); | 1008 LayoutUnit allowedShrinkage = std::min<LayoutUnit>(0, minHeight - height
); |
1006 return allowedShrinkage; | 1009 return allowedShrinkage; |
1007 } | 1010 } |
1008 return 0; | 1011 return 0; |
1009 } | 1012 } |
1010 | 1013 |
1011 } // namespace blink | 1014 } // namespace blink |
OLD | NEW |