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

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

Issue 1902293003: Revert "Treat percent-height div inside auto-height cells as auto" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/div-height-inside-auto-table-cell-is-auto-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 48877bf242b0da447ce1ed0133974cf6ad08d964..b2a229ce609f11523a9b73a3db4c24c3e0317320 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2606,14 +2606,10 @@ LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const
availableHeight = overrideContainingBlockContentLogicalHeight();
} else if (cb->isTableCell()) {
if (!skippedAutoHeightContainingBlock) {
- // The second clause in this conditional (after the ||) is to support this line from the
- // definition of height in CSS 2.2:
- // "If the height of the containing block is not specified explicitly (i.e., it depends on
- // content height), and this element is not absolutely positioned, the used height is
- // calculated as if 'auto' was specified."
- // But FF doesn't apply this logic (1) in quirks mode or (2) when "this element" is a table.
- // TODO(dgrogan): Maybe we shouldn't make tables an exception. See https://crbug.com/353580
- if (!cb->hasOverrideLogicalContentHeight() || (!document().inQuirksMode() && !isTable() && cbstyle.logicalHeight().isAuto())) {
+ // Table cells violate what the CSS spec says to do with heights. Basically we
+ // don't care if the cell specified a height or not. We just always make ourselves
+ // be a percentage of the cell's current content height.
+ if (!cb->hasOverrideLogicalContentHeight()) {
// Normally we would let the cell size intrinsically, but scrolling overflow has to be
// treated differently, since WinIE lets scrolled overflow regions shrink as needed.
// While we can't get all cases right, we can at least detect when the cell has a specified
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/div-height-inside-auto-table-cell-is-auto-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698