Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2376483002: Initialize properly availableHeight in computePercentageLogicalHeight (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/quirks-mode-percent-height-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after
2832 LayoutUnit rootMarginBorderPaddingHeight; 2832 LayoutUnit rootMarginBorderPaddingHeight;
2833 while (!cb->isLayoutView() && skipContainingBlockForPercentHeightCalculation (cb)) { 2833 while (!cb->isLayoutView() && skipContainingBlockForPercentHeightCalculation (cb)) {
2834 if (cb->isBody() || cb->isDocumentElement()) 2834 if (cb->isBody() || cb->isDocumentElement())
2835 rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfte r() + cb->borderAndPaddingLogicalHeight(); 2835 rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfte r() + cb->borderAndPaddingLogicalHeight();
2836 skippedAutoHeightContainingBlock = true; 2836 skippedAutoHeightContainingBlock = true;
2837 containingBlockChild = cb; 2837 containingBlockChild = cb;
2838 cb = cb->containingBlock(); 2838 cb = cb->containingBlock();
2839 } 2839 }
2840 cb->addPercentHeightDescendant(const_cast<LayoutBox*>(this)); 2840 cb->addPercentHeightDescendant(const_cast<LayoutBox*>(this));
2841 2841
2842 LayoutUnit availableHeight; 2842 LayoutUnit availableHeight(-1);
2843 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) { 2843 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) {
2844 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo ntent(); 2844 availableHeight = containingBlockChild->containingBlockLogicalWidthForCo ntent();
2845 } else if (hasOverrideContainingBlockLogicalHeight()) { 2845 } else if (hasOverrideContainingBlockLogicalHeight()) {
2846 availableHeight = overrideContainingBlockContentLogicalHeight(); 2846 availableHeight = overrideContainingBlockContentLogicalHeight();
2847 } else if (cb->isTableCell()) { 2847 } else if (cb->isTableCell()) {
2848 if (!skippedAutoHeightContainingBlock) { 2848 if (!skippedAutoHeightContainingBlock) {
2849 // Table cells violate what the CSS spec says to do with heights. Ba sically we 2849 // Table cells violate what the CSS spec says to do with heights. Ba sically we
2850 // don't care if the cell specified a height or not. We just always make ourselves 2850 // don't care if the cell specified a height or not. We just always make ourselves
2851 // be a percentage of the cell's current content height. 2851 // be a percentage of the cell's current content height.
2852 if (!cb->hasOverrideLogicalContentHeight()) { 2852 if (!cb->hasOverrideLogicalContentHeight()) {
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after
4874 LayoutRect rect = frameRect(); 4874 LayoutRect rect = frameRect();
4875 4875
4876 LayoutBlock* block = containingBlock(); 4876 LayoutBlock* block = containingBlock();
4877 if (block) 4877 if (block)
4878 block->adjustChildDebugRect(rect); 4878 block->adjustChildDebugRect(rect);
4879 4879
4880 return rect; 4880 return rect;
4881 } 4881 }
4882 4882
4883 } // namespace blink 4883 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/quirks-mode-percent-height-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698