summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderBox.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-21 17:23:42 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-21 17:23:42 +0100
commitbfa56c39850f4db30ffe6a5026d8bcf34ebaf3e2 (patch)
tree06d9416a2307ba771e09e25441e7272541384da8 /Source/WebCore/rendering/RenderBox.cpp
parente9b369b16f5b6070d11888474f1b652db6f4b4e2 (diff)
parent5cd506a8e1bcad3d0b414827db51b907e9f4a94b (diff)
downloadqtwebkit-bfa56c39850f4db30ffe6a5026d8bcf34ebaf3e2.tar.gz
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: .qmake.conf Change-Id: Ib65e8e98ec09b9cc934c8ab7d9f1df3bc377a718
Diffstat (limited to 'Source/WebCore/rendering/RenderBox.cpp')
-rw-r--r--Source/WebCore/rendering/RenderBox.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index 03b81ac9a..355a4f958 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -2680,6 +2680,17 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
LayoutUnit contentBoxHeight = cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight());
availableHeight = max<LayoutUnit>(0, contentBoxHeight);
}
+ } else if (cbstyle->logicalHeight().isViewportPercentage()) {
+ LayoutUnit heightWithScrollbar = valueForLength(cbstyle->logicalHeight(), 0, view());
+ if (heightWithScrollbar != -1) {
+ LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHeightForBoxSizing(heightWithScrollbar);
+ // We need to adjust for min/max height because this method does
+ // not handle the min/max of the current block, its caller does.
+ // So the return value from the recursive call will not have been
+ // adjusted yet.
+ LayoutUnit contentBoxHeight = cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight());
+ availableHeight = std::max<LayoutUnit>(0, contentBoxHeight);
+ }
} else if (isOutOfFlowPositionedWithSpecifiedHeight) {
// Don't allow this to affect the block' height() member variable, since this
// can get called while the block is still laying out its kids.