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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2441373002: Percent height content should respect the height of its containing cell (Closed)
Patch Set: bug 637811 Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index eacc53ad8e68c5682e8e6777a151cf569e3e7e00..0dbbf9fa05eaff41515d2806a58ca7a46b089966 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1355,7 +1355,7 @@ void LayoutBox::clearExtraInlineAndBlockOffests() {
LayoutUnit LayoutBox::adjustBorderBoxLogicalWidthForBoxSizing(
float width) const {
- LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth();
+ LayoutUnit bordersPlusPadding = collapsedBorderAndCSSPaddingLogicalWidth();
LayoutUnit result(width);
if (style()->boxSizing() == BoxSizingContentBox)
return result + bordersPlusPadding;
@@ -1364,7 +1364,7 @@ LayoutUnit LayoutBox::adjustBorderBoxLogicalWidthForBoxSizing(
LayoutUnit LayoutBox::adjustBorderBoxLogicalHeightForBoxSizing(
float height) const {
- LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight();
+ LayoutUnit bordersPlusPadding = collapsedBorderAndCSSPaddingLogicalHeight();
LayoutUnit result(height);
if (style()->boxSizing() == BoxSizingContentBox)
return result + bordersPlusPadding;
@@ -1375,7 +1375,7 @@ LayoutUnit LayoutBox::adjustContentBoxLogicalWidthForBoxSizing(
float width) const {
LayoutUnit result(width);
if (style()->boxSizing() == BoxSizingBorderBox)
- result -= borderAndPaddingLogicalWidth();
+ result -= collapsedBorderAndCSSPaddingLogicalWidth();
return std::max(LayoutUnit(), result);
}
@@ -1383,7 +1383,7 @@ LayoutUnit LayoutBox::adjustContentBoxLogicalHeightForBoxSizing(
float height) const {
LayoutUnit result(height);
if (style()->boxSizing() == BoxSizingBorderBox)
- result -= borderAndPaddingLogicalHeight();
+ result -= collapsedBorderAndCSSPaddingLogicalHeight();
return std::max(LayoutUnit(), result);
}
@@ -3193,7 +3193,8 @@ LayoutUnit LayoutBox::computePercentageLogicalHeight(
// cases, but it is preferable to the alternative (sizing intrinsically
// and making the row end up too big).
LayoutTableCell* cell = toLayoutTableCell(cb);
- if (scrollsOverflowY() &&
+ if (style()->overflowY() != OverflowVisible &&
+ style()->overflowY() != OverflowHidden &&
(!cell->style()->logicalHeight().isAuto() ||
!cell->table()->style()->logicalHeight().isAuto()))
return LayoutUnit();

Powered by Google App Engine
This is Rietveld 408576698