Permalink
Browse files

Merge pull request #25 from facebook/masking

Adding masking test.
NOTE: candidate for a QoI test
  • Loading branch information...
darobin committed Jun 6, 2012
2 parents 2ce5fb2 + ea0268f commit af00ec0bdde3d6d33afc8440b29bdafb62f4ae92
Showing with 27 additions and 0 deletions.
  1. BIN tests/masking/alpha-test.png
  2. +5 −0 tests/masking/config.yml
  3. +22 −0 tests/masking/test.js
Binary file not shown.
View
@@ -0,0 +1,5 @@
+---
+ r: 0
+ spec: "http://www.webkit.org/blog/181/css-masks/"
+ sources: ["https://developer.mozilla.org/En/Applying_SVG_effects_to_HTML_content#Example:.C2.A0Masking"]
+ title: "Masking Images"
View
@@ -0,0 +1,22 @@
+test("CSS Masks", function() {
+ var namespace = "http://www.w3.org/2000/svg",
+ elem = document.createElement("div"),
+ supported = H.test.cssProp( elem, "maskImage", true ),
+ svg, mask;
+
+
+ if ( !supported ) {
+ svg = document.createElementNS( namespace, "svg" );
+ mask = document.createElementNS( namespace, "mask" );
+
+ if ( "ownerSVGElement" in svg ) {
+
+ assert( ("maskContentUnits" in mask) && ("maskUnits" in mask), "image masking supported" );
+
+ } else {
+ assert( false, "no image masking is supported" );
+ }
+ } else {
+ assert( supported, "image masking supported" );
+ }
+});

0 comments on commit af00ec0

Please sign in to comment.