Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Adding masking test. #25

Merged
merged 1 commit into from

2 participants

@mattwkelly

No description provided.

@darobin darobin merged commit af00ec0 into coremob:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2012
  1. @mattwkelly

    Adding masking test.

    mattwkelly authored
This page is out of date. Refresh to see the latest.
View
BIN  tests/masking/alpha-test.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
5 tests/masking/config.yml
@@ -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
22 tests/masking/test.js
@@ -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" );
+ }
+});
Something went wrong with that request. Please try again.