mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Support range media query syntax
This commit is contained in:
parent
8f8a4e7936
commit
667a753448
4 changed files with 62 additions and 6 deletions
|
|
@ -283,6 +283,10 @@ nsMediaExpression::Matches(nsPresContext *aPresContext,
|
|||
return cmp != 1;
|
||||
case nsMediaExpression::eEqual:
|
||||
return cmp == 0;
|
||||
case nsMediaExpression::eMinExclusive:
|
||||
return cmp == 1;
|
||||
case nsMediaExpression::eMaxExclusive:
|
||||
return cmp == -1;
|
||||
}
|
||||
NS_NOTREACHED("unexpected mRange");
|
||||
return false;
|
||||
|
|
@ -487,7 +491,13 @@ nsMediaQuery::AppendToString(nsAString& aString) const
|
|||
aString.Append(nsDependentAtomString(*feature->mName));
|
||||
|
||||
if (expr.mValue.GetUnit() != eCSSUnit_Null) {
|
||||
aString.AppendLiteral(": ");
|
||||
if (expr.mRange == nsMediaExpression::eMinExclusive) {
|
||||
aString.AppendLiteral(" > ");
|
||||
} else if (expr.mRange == nsMediaExpression::eMaxExclusive) {
|
||||
aString.AppendLiteral(" < ");
|
||||
} else {
|
||||
aString.AppendLiteral(": ");
|
||||
}
|
||||
switch (feature->mValueType) {
|
||||
case nsMediaFeature::eLength:
|
||||
NS_ASSERTION(expr.mValue.IsLengthUnit(), "bad unit");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue