Bugzilla
Quick Search
Browse
Advanced Search
Reports
Quick Search Help
Documentation
New Account
Log In
Login with GitHub
Remember
Forgot Password
Mozilla Home
Privacy
Cookies
Legal
Attachment 8848263 Details for
Bug 1347164
[patch]
css-color specified style test. v2
Bug-1347164---css-color-specified-style-test-rdhol.patch (text/plain), 7.34 KB, created by
Jerry Shih[:jerry] (UTC+8) (inactive)
(
hide
)
Description:
css-color specified style test. v2
Filename:
MIME Type:
Creator:
Jerry Shih[:jerry] (UTC+8) (inactive)
Size:
7.34 KB
patch
obsolete
># HG changeset patch ># User JerryShih <hshih@mozilla.com> > >Bug 1347164 - css-color specified style test. r=dholbert > >MozReview-Commit-ID: DQln6jtxolg > >diff --git a/layout/style/test/test_specified_value_serialization.html b/layout/style/test/test_specified_value_serialization.html >index 9cc2f9b..55ec132 100644 >--- a/layout/style/test/test_specified_value_serialization.html >+++ b/layout/style/test/test_specified_value_serialization.html >@@ -1,62 +1,106 @@ > <!doctype html> >-<!-- >-https://bugzilla.mozilla.org/show_bug.cgi?id=721136 >---> >-<title>Test for Bug 721136</title> >-<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> >-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> >-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=721136">Mozilla Bug 721136</a> >+<html> >+<head> >+ <title>Test for miscellaneous specified value issues</title> >+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> >+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> >+</head> >+<body> >+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a> >+<p id="display"></p> >+<div id="content" style="display: none"> >+ >+</div> >+ > <pre id="test"> >-<script> >-[ >- [" mAtRiX(1, 2,3,4, 5,6 ) ", "matrix(1, 2, 3, 4, 5, 6)"], >- [" mAtRiX3d( 1,2,3,0,4 ,5,6,0,7,8 , 9,0,10, 11,12,1 ) ", >- "matrix3d(1, 2, 3, 0, 4, 5, 6, 0, 7, 8, 9, 0, 10, 11, 12, 1)"], >- [" pErSpEcTiVe( 400Px ) ", "perspective(400px)"], >- [" rOtAtE( 90dEg ) ", "rotate(90deg)"], >- [" rOtAtE3d( 0,0 , 1 ,180DeG ) ", "rotate3d(0, 0, 1, 180deg)"], >- [" rOtAtEx( 100GrAD ) ", "rotateX(100grad)"], >- [" rOtAtEy( 1.57RaD ) ", "rotateY(1.57rad)"], >- [" rOtAtEz( 0.25TuRn ) ", "rotateZ(0.25turn)"], >- [" sCaLe( 2 ) ", "scale(2)"], >- [" sCaLe( 2,3 ) ", "scale(2, 3)"], >- [" sCaLe3D( 2,4 , -9 ) ", "scale3d(2, 4, -9)"], >- [" sCaLeX( 2 ) ", "scaleX(2)"], >- [" sCaLeY( 2 ) ", "scaleY(2)"], >- [" sCaLeZ( 2 ) ", "scaleZ(2)"], >- [" sKeW( 45dEg ) ", "skew(45deg)"], >- [" sKeW( 45dEg,45DeG ) ", "skew(45deg, 45deg)"], >- [" sKeWx( 45DeG ) ", "skewX(45deg)"], >- [" sKeWy( 45DeG ) ", "skewY(45deg)"], >- [" tRaNsLaTe( 1Px ) ", "translate(1px)"], >- [" tRaNsLaTe( 1Px,3Pt ) ", "translate(1px, 3pt)"], >- [" tRaNsLaTe3D( 21pX,-6pX , 4pX ) ", "translate3d(21px, -6px, 4px)"], >- [" tRaNsLaTeX( 1pT ) ", "translateX(1pt)"], >- [" tRaNsLaTeY( 1iN ) ", "translateY(1in)"], >- [" tRaNsLaTeZ( 15.4pX ) ", "translateZ(15.4px)"], >- ["tranSlatex( 16px )rotatez(-90deg) rotate(100grad)\ttranslate3d(12pt, 0pc, 0.0em)", >- "translateX(16px) rotateZ(-90deg) rotate(100grad) translate3d(12pt, 0pc, 0em)"], >-].forEach(function(arr) { >- document.documentElement.style.MozTransform = arr[0]; >- is(document.documentElement.style.MozTransform, arr[1], >- "incorrect serialization"); >-}); >- >-var elt = document.documentElement; >- >-elt.setAttribute("style", >- "transform: tRANslatEX(5px) TRanslATey(10px) translatez(2px) ROTATEX(30deg) rotateY(30deg) rotatez(5deg) SKEWx(10deg) skewy(10deg) scaleX(2) SCALEY(0.5) scalez(2)"); >-is(elt.style.getPropertyValue("transform"), >- "translateX(5px) translateY(10px) translateZ(2px) rotateX(30deg) rotateY(30deg) rotateZ(5deg) skewX(10deg) skewY(10deg) scaleX(2) scaleY(0.5) scaleZ(2)", >- "expected case canonicalization of transform functions"); >- >-elt.setAttribute("style", >- "font-variant-alternates: SWASH(fOo) stYLIStiC(Bar)"); >-is(elt.style.getPropertyValue("font-variant-alternates"), >- "swash(fOo) stylistic(Bar)", >- "expected case canonicalization of transform functions"); >- >-elt.setAttribute("style", ""); // leave the page in a useful state >+<script type="application/javascript"> >+ >+(function test_bug_721136() { >+ // Test for transform property serialization. >+ [ >+ [" mAtRiX(1, 2,3,4, 5,6 ) ", "matrix(1, 2, 3, 4, 5, 6)"], >+ [" mAtRiX3d( 1,2,3,0,4 ,5,6,0,7,8 , 9,0,10, 11,12,1 ) ", >+ "matrix3d(1, 2, 3, 0, 4, 5, 6, 0, 7, 8, 9, 0, 10, 11, 12, 1)"], >+ [" pErSpEcTiVe( 400Px ) ", "perspective(400px)"], >+ [" rOtAtE( 90dEg ) ", "rotate(90deg)"], >+ [" rOtAtE3d( 0,0 , 1 ,180DeG ) ", "rotate3d(0, 0, 1, 180deg)"], >+ [" rOtAtEx( 100GrAD ) ", "rotateX(100grad)"], >+ [" rOtAtEy( 1.57RaD ) ", "rotateY(1.57rad)"], >+ [" rOtAtEz( 0.25TuRn ) ", "rotateZ(0.25turn)"], >+ [" sCaLe( 2 ) ", "scale(2)"], >+ [" sCaLe( 2,3 ) ", "scale(2, 3)"], >+ [" sCaLe3D( 2,4 , -9 ) ", "scale3d(2, 4, -9)"], >+ [" sCaLeX( 2 ) ", "scaleX(2)"], >+ [" sCaLeY( 2 ) ", "scaleY(2)"], >+ [" sCaLeZ( 2 ) ", "scaleZ(2)"], >+ [" sKeW( 45dEg ) ", "skew(45deg)"], >+ [" sKeW( 45dEg,45DeG ) ", "skew(45deg, 45deg)"], >+ [" sKeWx( 45DeG ) ", "skewX(45deg)"], >+ [" sKeWy( 45DeG ) ", "skewY(45deg)"], >+ [" tRaNsLaTe( 1Px ) ", "translate(1px)"], >+ [" tRaNsLaTe( 1Px,3Pt ) ", "translate(1px, 3pt)"], >+ [" tRaNsLaTe3D( 21pX,-6pX , 4pX ) ", "translate3d(21px, -6px, 4px)"], >+ [" tRaNsLaTeX( 1pT ) ", "translateX(1pt)"], >+ [" tRaNsLaTeY( 1iN ) ", "translateY(1in)"], >+ [" tRaNsLaTeZ( 15.4pX ) ", "translateZ(15.4px)"], >+ ["tranSlatex( 16px )rotatez(-90deg) rotate(100grad)\ttranslate3d(12pt, 0pc, 0.0em)", >+ "translateX(16px) rotateZ(-90deg) rotate(100grad) translate3d(12pt, 0pc, 0em)"], >+ ].forEach(function(arr) { >+ document.documentElement.style.MozTransform = arr[0]; >+ is(document.documentElement.style.MozTransform, arr[1], >+ "incorrect serialization"); >+ }); >+ >+ var elt = document.documentElement; >+ >+ elt.setAttribute("style", >+ "transform: tRANslatEX(5px) TRanslATey(10px) translatez(2px) ROTATEX(30deg) rotateY(30deg) rotatez(5deg) SKEWx(10deg) skewy(10deg) scaleX(2) SCALEY(0.5) scalez(2)"); >+ is(elt.style.getPropertyValue("transform"), >+ "translateX(5px) translateY(10px) translateZ(2px) rotateX(30deg) rotateY(30deg) rotateZ(5deg) skewX(10deg) skewY(10deg) scaleX(2) scaleY(0.5) scaleZ(2)", >+ "expected case canonicalization of transform functions"); >+ >+ elt.setAttribute("style", >+ "font-variant-alternates: SWASH(fOo) stYLIStiC(Bar)"); >+ is(elt.style.getPropertyValue("font-variant-alternates"), >+ "swash(fOo) stylistic(Bar)", >+ "expected case canonicalization of transform functions"); >+ >+ elt.setAttribute("style", ""); // leave the page in a useful state >+})(); >+ >+(function test_bug_1347164() { >+ // Test that specified color values are serialized as "rgb()" >+ // IFF they're fully-opaque (and otherwise as "rgba()"). >+ var color = [ >+ ["rgba(0, 0, 0, 1)", "rgb(0, 0, 0)"], >+ ["rgba(0, 0, 0, 0.5)", "rgba(0, 0, 0, 0.5)"], >+ ["hsla(0, 0%, 0%, 1)", "rgb(0, 0, 0)"], >+ ["hsla(0, 0%, 0%, 0.5)", "rgba(0, 0, 0, 0.5)"], >+ // css-color-4 >+ ["rgba(0 0 0 / 1)", "rgb(0, 0, 0)"], >+ ["rgba(0 0 0 / 0.5)", "rgba(0, 0, 0, 0.5)"], >+ ["rgb(0 0 0 / 1)", "rgb(0, 0, 0)"], >+ ["rgb(0 0 0 / 0.5)", "rgba(0, 0, 0, 0.5)"], >+ ["hsla(0 0% 0% / 1)", "rgb(0, 0, 0)"], >+ ["hsla(0deg 0% 0% / 0.5)", "rgba(0, 0, 0, 0.5)"], >+ ["hsl(0 0% 0% / 1)", "rgb(0, 0, 0)"], >+ ["hsl(0 0% 0% / 0.5)", "rgba(0, 0, 0, 0.5)"], >+ ]; >+ >+ var frame_container = document.getElementById("display"); >+ var p = document.createElement("p"); >+ frame_container.appendChild(p); >+ >+ for (var i = 0; i < color.length; ++i) { >+ var test = color[i]; >+ p.style.color = test[0]; >+ is(p.style.color, test[1], "serialization value of " + test[0]); >+ } >+ >+ p.remove(); >+})(); > > </script> > </pre> >+</body> >+</html> >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Flags:
dholbert
: review-
Actions:
View
|
Diff
|
Review
Attachments on
bug 1347164
:
8847505
|
8847506
|
8847508
|
8848261
|
8848262
|
8848263
|
8848270
|
8848271
|
8848426
|
8849030
|
8849819
|
8849820
|
8849821
|
8849822
|
8849823
|
8849831
|
8849832
|
8849833
|
8849834
|
8849835