summaryrefslogtreecommitdiff
path: root/layout/generic
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2022-04-17 01:26:10 +0800
committerMoonchild <moonchild@palemoon.org>2022-04-17 11:03:22 +0200
commitbb9700d982ee71799026030ade86e20fb12e09e7 (patch)
tree5b24263a5d20578bfdefcfdad2f7a5d7c0063808 /layout/generic
parent279ed4a9cf67740095672a6f62d7848627809993 (diff)
downloaduxp-bb9700d982ee71799026030ade86e20fb12e09e7.tar.gz
Issue #1370 - Follow-up: Give table wrapper boxes a special case during flex base size resolution, so that percent main-sizes can be respected
This is a workaround, based on https://bugzilla.mozilla.org/show_bug.cgi?id=1455976
Diffstat (limited to 'layout/generic')
-rw-r--r--layout/generic/nsFrame.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
index 458b18abd9..af3d2f9457 100644
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -4645,6 +4645,13 @@ nsFrame::SetCoordToFlexBasis(bool aIsInlineFlexItem,
auto mainAxisCoord = aIsInlineFlexItem ?
aInlineStyle :
aBlockStyle;
+ // NOTE: If we're a table-wrapper frame, we skip this clause and just stick
+ // with 'main-size:auto' behavior (which -- unlike 'content'
+ // i.e. 'max-content' -- will give us the ability to honor percent sizes on
+ // our table-box child when resolving the flex base size). The flexbox spec
+ // doesn't call for this special case, but webcompat & regression-avoidance
+ // seems to require it, for the time being... Tables sure are special.
+ bool isTableWrapperFrame = GetType() == nsGkAtoms::tableWrapperFrame;
// We have a used flex-basis of 'content' if flex-basis explicitly has that
// value, OR if flex-basis is 'auto' (deferring to the main-size property)
// and the main-size property is also 'auto'.
@@ -4665,7 +4672,7 @@ nsFrame::SetCoordToFlexBasis(bool aIsInlineFlexItem,
// which substep we fall into) by using the 'auto' keyword for our
// main-axis coordinate here. (This makes sense, because the spec is
// effectively trying to produce the 'auto' sizing behavior).
- if (aIntrinsic) {
+ if (aIntrinsic || MOZ_LIKELY(isTableWrapperFrame)) {
static const nsStyleCoord autoStyleCoord(eStyleUnit_Auto);
*mainAxisCoord = &autoStyleCoord;
} else {