Issue #1992 - Part 1: Un-prefix -moz-{min|max}-content keywords.

This commit is contained in:
Moonchild 2022-09-20 20:41:33 +00:00 committed by roytam1
commit fa8bc1e81c
7 changed files with 15 additions and 18 deletions

View file

@ -1032,7 +1032,7 @@ OutputPanel.prototype._resize = function () {
break;
}
this.document.body.style.width = "-moz-max-content";
this.document.body.style.width = "max-content";
let style = this._frame.contentWindow.getComputedStyle(this.document.body);
let frameWidth = parseInt(style.width, 10);
let width = Math.min(maxWidth, frameWidth);

View file

@ -4676,7 +4676,7 @@ GetDefiniteSizeTakenByBoxSizing(StyleBoxSizing aBoxSizing,
return sizeTakenByBoxSizing;
}
// Handles only -moz-max-content and -moz-min-content, and
// Handles only max-content and min-content, and
// -moz-fit-content for min-width and max-width, since the others
// (-moz-fit-content for width, and -moz-available) have no effect on
// intrinsic widths.
@ -4704,10 +4704,10 @@ GetIntrinsicCoord(const nsStyleCoord& aStyle,
if (aProperty == PROP_WIDTH)
return false; // handle like 'width: auto'
if (aProperty == PROP_MAX_WIDTH)
// constrain large 'width' values down to -moz-max-content
// constrain large 'width' values down to max-content
val = NS_STYLE_WIDTH_MAX_CONTENT;
else
// constrain small 'width' or 'max-width' values up to -moz-min-content
// constrain small 'width' or 'max-width' values up to min-content
val = NS_STYLE_WIDTH_MIN_CONTENT;
}
@ -4991,7 +4991,7 @@ nsLayoutUtils::IntrinsicForAxis(PhysicalAxis aAxis,
styleISize.GetIntValue() == NS_STYLE_WIDTH_MIN_CONTENT)) {
// -moz-fit-content and -moz-available enumerated widths compute intrinsic
// widths just like auto.
// For -moz-max-content and -moz-min-content, we handle them like
// For max-content and min-content, we handle them like
// specified widths, but ignore box-sizing.
boxSizing = StyleBoxSizing::Content;
if (aMarginBoxMinSizeClamp != NS_MAXSIZE &&

View file

@ -98,13 +98,11 @@ CSS_KEY(-moz-mac-menutextdisable, _moz_mac_menutextdisable)
CSS_KEY(-moz-mac-menutextselect, _moz_mac_menutextselect)
CSS_KEY(-moz-mac-disabledtoolbartext, _moz_mac_disabledtoolbartext)
CSS_KEY(-moz-mac-secondaryhighlight, _moz_mac_secondaryhighlight)
CSS_KEY(-moz-max-content, _moz_max_content)
CSS_KEY(-moz-menuhover, _moz_menuhover)
CSS_KEY(-moz-menuhovertext, _moz_menuhovertext)
CSS_KEY(-moz-menubartext, _moz_menubartext)
CSS_KEY(-moz-menubarhovertext, _moz_menubarhovertext)
CSS_KEY(-moz-middle-with-baseline, _moz_middle_with_baseline)
CSS_KEY(-moz-min-content, _moz_min_content)
CSS_KEY(-moz-nativehyperlinktext, _moz_nativehyperlinktext)
CSS_KEY(-moz-none, _moz_none)
CSS_KEY(-moz-oddtreerow, _moz_oddtreerow)

View file

@ -2258,8 +2258,8 @@ const KTableEntry nsCSSProps::kWhitespaceKTable[] = {
};
const KTableEntry nsCSSProps::kWidthKTable[] = {
{ eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT },
{ eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT },
{ eCSSKeyword_max_content, NS_STYLE_WIDTH_MAX_CONTENT },
{ eCSSKeyword_min_content, NS_STYLE_WIDTH_MIN_CONTENT },
{ eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT },
{ eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE },
{ eCSSKeyword_UNKNOWN, -1 }
@ -2267,11 +2267,11 @@ const KTableEntry nsCSSProps::kWidthKTable[] = {
// This must be the same as kWidthKTable, but just with 'content' added:
const KTableEntry nsCSSProps::kFlexBasisKTable[] = {
{ eCSSKeyword__moz_max_content, NS_STYLE_WIDTH_MAX_CONTENT },
{ eCSSKeyword__moz_min_content, NS_STYLE_WIDTH_MIN_CONTENT },
{ eCSSKeyword_max_content, NS_STYLE_WIDTH_MAX_CONTENT },
{ eCSSKeyword_min_content, NS_STYLE_WIDTH_MIN_CONTENT },
{ eCSSKeyword__moz_fit_content, NS_STYLE_WIDTH_FIT_CONTENT },
{ eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE },
{ eCSSKeyword_content, NS_STYLE_FLEX_BASIS_CONTENT },
{ eCSSKeyword__moz_available, NS_STYLE_WIDTH_AVAILABLE },
{ eCSSKeyword_content, NS_STYLE_FLEX_BASIS_CONTENT },
{ eCSSKeyword_UNKNOWN, -1 }
};
static_assert(ArrayLength(nsCSSProps::kFlexBasisKTable) ==

View file

@ -8594,7 +8594,7 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
}
}
// We allow the enumerated box size property values -moz-min-content, etc. to
// We allow the enumerated box size property values min-content, etc. to
// be specified on both the {,min-,max-}width properties and the
// {,min-,max-}height properties, regardless of the writing mode. This is
// because the writing mode is not determined until here, at computed value

View file

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// vim:cindent:ts=4:et:sw=4:
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -181,7 +180,7 @@ GetISizeInfo(nsRenderingContext *aRenderingContext,
maxISize.SetNoneValue();
} else if (maxISize.GetIntValue() == NS_STYLE_WIDTH_FIT_CONTENT) {
// for 'max-inline-size', '-moz-fit-content' is like
// '-moz-max-content'
// 'max-content'
maxISize.SetIntValue(NS_STYLE_WIDTH_MAX_CONTENT,
eStyleUnit_Enumerated);
}
@ -208,7 +207,7 @@ GetISizeInfo(nsRenderingContext *aRenderingContext,
minISize.SetCoordValue(0);
} else if (minISize.GetIntValue() == NS_STYLE_WIDTH_FIT_CONTENT) {
// for 'min-inline-size', '-moz-fit-content' is like
// '-moz-min-content'
// 'min-content'
minISize.SetIntValue(NS_STYLE_WIDTH_MIN_CONTENT,
eStyleUnit_Enumerated);
}

View file

@ -3813,7 +3813,7 @@ nsTableFrame::IsAutoLayout()
if (StyleTable()->mLayoutStrategy == NS_STYLE_TABLE_LAYOUT_AUTO)
return true;
// a fixed-layout inline-table must have a inline size
// and tables with inline size set to '-moz-max-content' must be
// and tables with inline size set to 'max-content' must be
// auto-layout (at least as long as
// FixedTableLayoutStrategy::GetPrefISize returns nscoord_MAX)
const nsStyleCoord &iSize = StylePosition()->ISize(GetWritingMode());