Permalink
Browse files

Adding masking test.

  • Loading branch information...
1 parent f906014 commit ea0268fd59ee644d39828bc426304fe01fad4eb4 @mattwkelly mattwkelly committed Apr 10, 2012
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 ea0268f

Please sign in to comment.