Commit 513f1f02 authored by cbiesinger's avatar cbiesinger Committed by Commit bot

[layoutng] Use the override width even when we're not a flex item

(And also use it for positioned boxes)

We want to use this for layoutng/legacy interop. For legacy layout,
there should be no change in behavior because flexbox is currently
the only caller of this function:
https://cs.chromium.org/search/?q=setOverrideLogicalContentWidth&sq=package:chromium&type=cs

Interestingly, the height version did not have this limitation already.

This patch also deleted an outdated FIXME comment.

R=atotic@chromium.org,eae@chromium.org
BUG=635619

Review-Url: https://codereview.chromium.org/2624143005
Cr-Commit-Position: refs/heads/master@{#443056}
parent ff407634
...@@ -2479,22 +2479,19 @@ void LayoutBox::computeLogicalWidth( ...@@ -2479,22 +2479,19 @@ void LayoutBox::computeLogicalWidth(
computedValues.m_margins.m_start = marginStart(); computedValues.m_margins.m_start = marginStart();
computedValues.m_margins.m_end = marginEnd(); computedValues.m_margins.m_end = marginEnd();
if (isOutOfFlowPositioned()) {
computePositionedLogicalWidth(computedValues);
return;
}
// The parent box is flexing us, so it has increased or decreased our // The parent box is flexing us, so it has increased or decreased our
// width. Use the width from the style context. // width. Use the width from the style context.
// FIXME: Account for writing-mode in flexible boxes. if (hasOverrideLogicalContentWidth()) {
// https://bugs.webkit.org/show_bug.cgi?id=46418
if (hasOverrideLogicalContentWidth() &&
parent()->isFlexibleBoxIncludingDeprecated()) {
computedValues.m_extent = computedValues.m_extent =
overrideLogicalContentWidth() + borderAndPaddingLogicalWidth(); overrideLogicalContentWidth() + borderAndPaddingLogicalWidth();
return; return;
} }
if (isOutOfFlowPositioned()) {
computePositionedLogicalWidth(computedValues);
return;
}
// FIXME: Account for writing-mode in flexible boxes. // FIXME: Account for writing-mode in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418 // https://bugs.webkit.org/show_bug.cgi?id=46418
bool inVerticalBox = parent()->isDeprecatedFlexibleBox() && bool inVerticalBox = parent()->isDeprecatedFlexibleBox() &&
...@@ -2979,8 +2976,6 @@ void LayoutBox::computeLogicalHeight( ...@@ -2979,8 +2976,6 @@ void LayoutBox::computeLogicalHeight(
// The parent box is flexing us, so it has increased or decreased our // The parent box is flexing us, so it has increased or decreased our
// height. We have to grab our cached flexible height. // height. We have to grab our cached flexible height.
// FIXME: Account for writing-mode in flexible boxes.
// https://bugs.webkit.org/show_bug.cgi?id=46418
if (hasOverrideLogicalContentHeight()) { if (hasOverrideLogicalContentHeight()) {
h = Length(overrideLogicalContentHeight(), Fixed); h = Length(overrideLogicalContentHeight(), Fixed);
} else if (treatAsReplaced) { } else if (treatAsReplaced) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment