forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 948265 - Add CSS grayscale filter to nsCSSFilterInstance. r=mstange
- Loading branch information
Showing
13 changed files
with
285 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
layout/reftests/svg/filters/css-filters/grayscale-one-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element Using a Factor of One</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<style type="text/css"> | ||
#target { | ||
background-color: rgb(53, 53, 53); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a gray square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
layout/reftests/svg/filters/css-filters/grayscale-one.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element Using a Factor of One</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/filter-effects-1/#funcdef-grayscale"> | ||
<link rel="match" href="grayscale-one-ref.html"> | ||
<meta name="assert" | ||
content="Given a factor of one, the CSS grayscale filter function should | ||
completely desaturate an HTML element."> | ||
<style type="text/css"> | ||
#target { | ||
filter: grayscale(1); | ||
background-color: #f00; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a gray square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
layout/reftests/svg/filters/css-filters/grayscale-over-one-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element Using a Factor Over One</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<style type="text/css"> | ||
#target { | ||
background-color: rgb(53, 53, 53); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a gray square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
layout/reftests/svg/filters/css-filters/grayscale-over-one.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element Using a Factor Over One</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/filter-effects-1/#funcdef-grayscale"> | ||
<link rel="match" href="grayscale-over-one-ref.html"> | ||
<meta name="assert" | ||
content="Given a factor over one, the CSS grayscale filter function | ||
should completely desaturate an HTML element."> | ||
<style type="text/css"> | ||
#target { | ||
filter: grayscale(1000); | ||
background-color: #f00; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a gray square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
layout/reftests/svg/filters/css-filters/grayscale-percent-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element Using a Percentage</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<style type="text/css"> | ||
#target { | ||
background-color: rgb(145, 197, 145); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a dull green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
layout/reftests/svg/filters/css-filters/grayscale-percent.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element Using a Percentage</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/filter-effects-1/#funcdef-grayscale"> | ||
<link rel="match" href="grayscale-percent-ref.html"> | ||
<meta name="assert" | ||
content="Given a percentage, the CSS grayscale filter function should | ||
desaturate an HTML element."> | ||
<style type="text/css"> | ||
#target { | ||
filter: grayscale(80%); | ||
background-color: #0f0; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a dull green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
layout/reftests/svg/filters/css-filters/grayscale-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<style type="text/css"> | ||
#target { | ||
background-color: rgb(145, 197, 145); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a dull green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
layout/reftests/svg/filters/css-filters/grayscale-zero-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element Using a Factor of Zero</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<style type="text/css"> | ||
#target { | ||
background-color: #0f0; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
layout/reftests/svg/filters/css-filters/grayscale-zero.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element Using a Factor of Zero</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/filter-effects-1/#funcdef-grayscale"> | ||
<link rel="match" href="grayscale-zero-ref.html"> | ||
<meta name="assert" | ||
content="Given a factor of zero, the CSS grayscale filter function | ||
should not change the color of an HTML element."> | ||
<style type="text/css"> | ||
#target { | ||
filter: grayscale(0); | ||
background-color: #0f0; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Grayscale an HTML Element</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<link rel="help" href="http://www.w3.org/TR/filter-effects-1/#funcdef-grayscale"> | ||
<link rel="match" href="grayscale-ref.html"> | ||
<meta name="assert" | ||
content="The CSS grayscale filter function should desaturate an HTML | ||
element."> | ||
<style type="text/css"> | ||
#target { | ||
filter: grayscale(0.8); | ||
background-color: #0f0; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a dull green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters