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 opacity filter to nsCSSFilterInstance. r=mstange
- Loading branch information
Showing
15 changed files
with
360 additions
and
1 deletion.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
layout/reftests/svg/filters/css-filters/opacity-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: Apply Opacity to 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: #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,36 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Apply Opacity to 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-opacity"> | ||
<link rel="match" href="opacity-one-ref.html"> | ||
<meta name="assert" | ||
content="Given a factor of one, the CSS opacity filter function should | ||
not change the opaqueness of an HTML element."> | ||
<style type="text/css"> | ||
#below-target { | ||
background-color: #f00; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
#target { | ||
filter: opacity(1000); | ||
background-color: #0f0; | ||
position: relative; | ||
top: -100px; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a green square.</p> | ||
<div id="below-target"></div> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
layout/reftests/svg/filters/css-filters/opacity-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: Apply Opacity to 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: #0f0; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
layout/reftests/svg/filters/css-filters/opacity-over-one-translucent-source-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,21 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Apply Opacity to a Translucent HTML Element Using a Factor Over One</title> | ||
<style type="text/css"> | ||
#target { | ||
background-color: rgba(0, 255, 0, 0.25); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a faded green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
layout/reftests/svg/filters/css-filters/opacity-over-one-translucent-source.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: Apply Opacity to a Translucent 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-opacity"> | ||
<link rel="match" href="opacity-over-one-translucent-source-ref.html"> | ||
<meta name="assert" | ||
content="Given a factor over one, the CSS opacity filter function should | ||
not change the translucency of an HTML element."> | ||
<style type="text/css"> | ||
#target { | ||
filter: opacity(1000); | ||
background-color: rgba(0, 255, 0, 0.25); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a faded green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
36 changes: 36 additions & 0 deletions
36
layout/reftests/svg/filters/css-filters/opacity-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,36 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Apply Opacity to 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-opacity"> | ||
<link rel="match" href="opacity-over-one-ref.html"> | ||
<meta name="assert" | ||
content="Given a factor over one, the CSS opacity filter function should | ||
not change the opaqueness of an HTML element."> | ||
<style type="text/css"> | ||
#below-target { | ||
background-color: #f00; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
#target { | ||
filter: opacity(1000); | ||
background-color: #0f0; | ||
position: relative; | ||
top: -100px; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a green square.</p> | ||
<div id="below-target"></div> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
layout/reftests/svg/filters/css-filters/opacity-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: Apply Opacity to 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(192, 255, 192); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a faded green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
28 changes: 28 additions & 0 deletions
28
layout/reftests/svg/filters/css-filters/opacity-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: Apply Opacity to 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-opacity"> | ||
<link rel="match" href="opacity-percent-ref.html"> | ||
<meta name="assert" | ||
content="Given a percentage, the CSS opacity filter function should make | ||
an HTML element translucent."> | ||
<style type="text/css"> | ||
#target { | ||
filter: opacity(25%); | ||
background-color: #0f0; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a faded 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,22 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Apply Opacity to an HTML Element</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<style type="text/css"> | ||
#target { | ||
background-color: rgb(192, 255, 192); | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a faded green square.</p> | ||
<div id="target"></div> | ||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
layout/reftests/svg/filters/css-filters/opacity-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: Apply Opacity to an HTML Element Using a Factor of Zero</title> | ||
<link rel="author" title="Max Vujovic" href="mailto:[email protected]"> | ||
<style type="text/css"> | ||
#below-target { | ||
background-color: #0f0; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a green square.</p> | ||
<div id="below-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,36 @@ | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>CSS Filters: Apply Opacity to 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-opacity"> | ||
<link rel="match" href="opacity-zero-ref.html"> | ||
<meta name="assert" | ||
content="Given a factor of zero, the CSS opacity filter function should | ||
make an HTML element completely transparent."> | ||
<style type="text/css"> | ||
#below-target { | ||
background-color: #0f0; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
#target { | ||
filter: opacity(0); | ||
background-color: #f00; | ||
position: relative; | ||
top: -100px; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a green square.</p> | ||
<div id="below-target"></div> | ||
<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: Apply Opacity to 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-opacity"> | ||
<link rel="match" href="opacity-ref.html"> | ||
<meta name="assert" | ||
content="The CSS opacity filter function should make an HTML element | ||
translucent."> | ||
<style type="text/css"> | ||
#target { | ||
filter: opacity(0.25); | ||
background-color: #0f0; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>You should see a faded 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
Oops, something went wrong.