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

Unified Diff: Source/core/rendering/RenderTable.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 12 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 | « Source/core/rendering/RenderScrollbarPart.cpp ('k') | Source/core/rendering/RenderTableCell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderTable.cpp
diff --git a/Source/core/rendering/RenderTable.cpp b/Source/core/rendering/RenderTable.cpp
index 6608150d5c5b08182775102d99fcdfb02dc46a64..e83b217775b4d939c46d9e00808a67f81b412f02 100644
--- a/Source/core/rendering/RenderTable.cpp
+++ b/Source/core/rendering/RenderTable.cpp
@@ -252,7 +252,6 @@ void RenderTable::updateLogicalWidth()
}
RenderBlock* cb = containingBlock();
- RenderView* renderView = view();
LayoutUnit availableLogicalWidth = containingBlockLogicalWidthForContent();
bool hasPerpendicularContainingBlock = cb->style()->isHorizontalWritingMode() != style()->isHorizontalWritingMode();
@@ -263,8 +262,8 @@ void RenderTable::updateLogicalWidth()
setLogicalWidth(convertStyleLogicalWidthToComputedWidth(styleLogicalWidth, containerWidthInInlineDirection));
else {
// Subtract out any fixed margins from our available width for auto width tables.
- LayoutUnit marginStart = minimumValueForLength(style()->marginStart(), availableLogicalWidth, renderView);
- LayoutUnit marginEnd = minimumValueForLength(style()->marginEnd(), availableLogicalWidth, renderView);
+ LayoutUnit marginStart = minimumValueForLength(style()->marginStart(), availableLogicalWidth);
+ LayoutUnit marginEnd = minimumValueForLength(style()->marginEnd(), availableLogicalWidth);
LayoutUnit marginTotal = marginStart + marginEnd;
// Subtract out our margins to get the available content width.
@@ -311,8 +310,8 @@ void RenderTable::updateLogicalWidth()
setMarginStart(marginValues.m_start);
setMarginEnd(marginValues.m_end);
} else {
- setMarginStart(minimumValueForLength(style()->marginStart(), availableLogicalWidth, renderView));
- setMarginEnd(minimumValueForLength(style()->marginEnd(), availableLogicalWidth, renderView));
+ setMarginStart(minimumValueForLength(style()->marginStart(), availableLogicalWidth));
+ setMarginEnd(minimumValueForLength(style()->marginEnd(), availableLogicalWidth));
}
// We should NEVER shrink the table below the min-content logical width, or else the table can't accomodate
@@ -334,7 +333,7 @@ LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st
if (isCSSTable && styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive() && style()->boxSizing() == CONTENT_BOX)
borders = borderStart() + borderEnd() + (collapseBorders() ? LayoutUnit() : paddingStart() + paddingEnd());
- return minimumValueForLength(styleLogicalWidth, availableWidth, view()) + borders;
+ return minimumValueForLength(styleLogicalWidth, availableWidth) + borders;
}
LayoutUnit RenderTable::convertStyleLogicalHeightToComputedHeight(const Length& styleLogicalHeight)
@@ -353,8 +352,6 @@ LayoutUnit RenderTable::convertStyleLogicalHeightToComputedHeight(const Length&
computedLogicalHeight = styleLogicalHeight.value() - borders;
} else if (styleLogicalHeight.isPercent())
computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeight);
- else if (styleLogicalHeight.isViewportPercentage())
- computedLogicalHeight = minimumValueForLength(styleLogicalHeight, 0, view());
else if (styleLogicalHeight.isIntrinsic())
computedLogicalHeight = computeIntrinsicLogicalContentHeightUsing(styleLogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding);
else
@@ -773,13 +770,13 @@ void RenderTable::computePreferredLogicalWidths()
m_minPreferredLogicalWidth = max(m_minPreferredLogicalWidth, m_captions[i]->minPreferredLogicalWidth());
RenderStyle* styleToUse = style();
- // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for min-width.
+ // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for min-width.
if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth().value() > 0) {
m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
}
- // FIXME: This should probably be checking for isSpecified since you should be able to use percentage, calc or viewport relative values for maxWidth.
+ // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for maxWidth.
if (styleToUse->logicalMaxWidth().isFixed()) {
// We don't constrain m_minPreferredLogicalWidth as the table should be at least the size of its min-content, regardless of 'max-width'.
m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
« no previous file with comments | « Source/core/rendering/RenderScrollbarPart.cpp ('k') | Source/core/rendering/RenderTableCell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698