Bug 455445 - -moz-transform skew() function should accept two parameters, and second should default to zero; r+sr=dbaron

This commit is contained in:
Keith Schwarz 2008-09-20 18:39:12 +02:00
Родитель 9b4349f536
Коммит d7e024ce53
8 изменённых файлов: 52 добавлений и 6 удалений

Просмотреть файл

@ -66,3 +66,7 @@ random == percent-1g.html percent-1-ref.html
== transform-svg-1a.xhtml transform-svg-1-ref.xhtml == transform-svg-1a.xhtml transform-svg-1-ref.xhtml
== transform-svg-2a.xhtml transform-svg-2-ref.xhtml == transform-svg-2a.xhtml transform-svg-2-ref.xhtml
!= transform-svg-2a.xhtml transform-svg-2-fail.xhtml != transform-svg-2a.xhtml transform-svg-2-fail.xhtml
# skew should allow a mix of one and two parameters.
== skew-1a.html skew-1-ref.html
== skew-1b.html skew-1-ref.html
== skew-2a.html skew-2-ref.html

Просмотреть файл

@ -0,0 +1,8 @@
<html>
<head>
</head>
<body>
<div style="width: 100px; height: 100px; background-color: gold; border: 1px solid black; -moz-transform: skewx(10deg);">
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,8 @@
<html>
<head>
</head>
<body>
<div style="width: 100px; height: 100px; background-color: gold; border: 1px solid black; -moz-transform: skew(10deg);">
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,8 @@
<html>
<head>
</head>
<body>
<div style="width: 100px; height: 100px; background-color: gold; border: 1px solid black; -moz-transform: skew(10deg, 0deg);">
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,8 @@
<html>
<head>
</head>
<body>
<div style="width: 100px; height: 100px; background-color: gold; border: 1px solid black; -moz-transform: skewy(10deg);">
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,8 @@
<html>
<head>
</head>
<body>
<div style="width: 100px; height: 100px; background-color: gold; border: 1px solid black; -moz-transform: skew(0deg, 10deg);">
</div>
</body>
</html>

Просмотреть файл

@ -6806,6 +6806,7 @@ static PRBool GetFunctionParseInformation(nsCSSKeyword aToken,
enum { eLengthPercent, enum { eLengthPercent,
eTwoLengthPercents, eTwoLengthPercents,
eAngle, eAngle,
eTwoAngles,
eNumber, eNumber,
eTwoNumbers, eTwoNumbers,
eMatrix, eMatrix,
@ -6815,6 +6816,7 @@ static PRBool GetFunctionParseInformation(nsCSSKeyword aToken,
{VARIANT_LENGTH | VARIANT_PERCENT}, {VARIANT_LENGTH | VARIANT_PERCENT},
{VARIANT_LENGTH | VARIANT_PERCENT, VARIANT_LENGTH | VARIANT_PERCENT}, {VARIANT_LENGTH | VARIANT_PERCENT, VARIANT_LENGTH | VARIANT_PERCENT},
{VARIANT_ANGLE}, {VARIANT_ANGLE},
{VARIANT_ANGLE, VARIANT_ANGLE},
{VARIANT_NUMBER}, {VARIANT_NUMBER},
{VARIANT_NUMBER, VARIANT_NUMBER}, {VARIANT_NUMBER, VARIANT_NUMBER},
{VARIANT_NUMBER, VARIANT_NUMBER, VARIANT_NUMBER, VARIANT_NUMBER, {VARIANT_NUMBER, VARIANT_NUMBER, VARIANT_NUMBER, VARIANT_NUMBER,
@ -6822,7 +6824,7 @@ static PRBool GetFunctionParseInformation(nsCSSKeyword aToken,
#ifdef DEBUG #ifdef DEBUG
static const PRUint8 kVariantMaskLengths[eNumVariantMasks] = static const PRUint8 kVariantMaskLengths[eNumVariantMasks] =
{1, 2, 1, 1, 2, 6}; {1, 2, 1, 2, 1, 2, 6};
#endif #endif
PRInt32 variantIndex = eNumVariantMasks; PRInt32 variantIndex = eNumVariantMasks;
@ -6865,10 +6867,10 @@ static PRBool GetFunctionParseInformation(nsCSSKeyword aToken,
aMaxElems = 2U; aMaxElems = 2U;
break; break;
case eCSSKeyword_skew: case eCSSKeyword_skew:
/* Exactly one angle. */ /* Exactly one or two angles. */
variantIndex = eAngle; variantIndex = eTwoAngles;
aMinElems = 1U; aMinElems = 1U;
aMaxElems = 1U; aMaxElems = 2U;
break; break;
case eCSSKeyword_scale: case eCSSKeyword_scale:
/* One or two scale factors. */ /* One or two scale factors. */

Просмотреть файл

@ -419,7 +419,7 @@ static void ProcessSkew(float aMain[4], const nsCSSValue::Array* aData)
NS_ASSERTION(aData->Count() == 2 || aData->Count() == 3, "Bad array!"); NS_ASSERTION(aData->Count() == 2 || aData->Count() == 3, "Bad array!");
float xSkew = CSSToRadians(aData->Item(1)); float xSkew = CSSToRadians(aData->Item(1));
float ySkew = (aData->Count() == 2 ? xSkew : CSSToRadians(aData->Item(2))); float ySkew = (aData->Count() == 2 ? 0.0f : CSSToRadians(aData->Item(2)));
ProcessSkewHelper(xSkew, ySkew, aMain); ProcessSkewHelper(xSkew, ySkew, aMain);
} }