mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Make nsMediaFeature::mKeywordTable an mData union. (Bug 522149) r=bzbarsky
This commit is contained in:
parent
87dadf6778
commit
b52b7d6d82
@ -1823,7 +1823,7 @@ CSSParserImpl::ParseMediaQueryExpression(nsMediaQuery* aQuery)
|
||||
break;
|
||||
case nsMediaFeature::eEnumerated:
|
||||
rv = ParseVariant(expr->mValue, VARIANT_KEYWORD,
|
||||
feature->mKeywordTable);
|
||||
feature->mData.mKeywordTable);
|
||||
break;
|
||||
}
|
||||
if (!rv || !ExpectSymbol(')', PR_TRUE)) {
|
||||
|
@ -462,7 +462,7 @@ nsMediaQuery::AppendToString(nsAString& aString) const
|
||||
"bad unit");
|
||||
AppendASCIItoUTF16(
|
||||
nsCSSProps::ValueToKeyword(expr.mValue.GetIntValue(),
|
||||
feature->mKeywordTable),
|
||||
feature->mData.mKeywordTable),
|
||||
aString);
|
||||
break;
|
||||
}
|
||||
|
@ -262,91 +262,91 @@ nsMediaFeatures::features[] = {
|
||||
&nsGkAtoms::width,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eLength,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetWidth
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::height,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eLength,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetHeight
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::deviceWidth,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eLength,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetDeviceWidth
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::deviceHeight,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eLength,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetDeviceHeight
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::orientation,
|
||||
nsMediaFeature::eMinMaxNotAllowed,
|
||||
nsMediaFeature::eEnumerated,
|
||||
kOrientationKeywords,
|
||||
{ kOrientationKeywords },
|
||||
GetOrientation
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::aspectRatio,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eIntRatio,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetAspectRatio
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::deviceAspectRatio,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eIntRatio,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetDeviceAspectRatio
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::color,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eInteger,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetColor
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::colorIndex,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eInteger,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetColorIndex
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::monochrome,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eInteger,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetMonochrome
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::resolution,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eResolution,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetResolution
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::scan,
|
||||
nsMediaFeature::eMinMaxNotAllowed,
|
||||
nsMediaFeature::eEnumerated,
|
||||
kScanKeywords,
|
||||
{ kScanKeywords },
|
||||
GetScan
|
||||
},
|
||||
{
|
||||
&nsGkAtoms::grid,
|
||||
nsMediaFeature::eMinMaxNotAllowed,
|
||||
nsMediaFeature::eBoolInteger,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
GetGrid
|
||||
},
|
||||
// Null-mName terminator:
|
||||
@ -354,7 +354,7 @@ nsMediaFeatures::features[] = {
|
||||
nsnull,
|
||||
nsMediaFeature::eMinMaxAllowed,
|
||||
nsMediaFeature::eInteger,
|
||||
nsnull,
|
||||
{ nsnull },
|
||||
nsnull
|
||||
},
|
||||
};
|
||||
|
@ -73,8 +73,15 @@ struct nsMediaFeature {
|
||||
};
|
||||
ValueType mValueType;
|
||||
|
||||
// The same format as the keyword tables in nsCSSProps.
|
||||
const PRInt32* mKeywordTable;
|
||||
union {
|
||||
// In static arrays, it's the first member that's initialized. We
|
||||
// need that to be void* so we can initialize both other types.
|
||||
// This member should never be accessed by name.
|
||||
const void* mInitializer_;
|
||||
// If mValueType == eEnumerated: const PRInt32*: keyword table in
|
||||
// the same format as the keyword tables in nsCSSProps.
|
||||
const PRInt32* mKeywordTable;
|
||||
} mData;
|
||||
|
||||
// A function that returns the current value for this feature for a
|
||||
// given presentation. If it returns eCSSUnit_Null, the feature is
|
||||
|
Loading…
Reference in New Issue
Block a user