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 1518099 - Add support for lighter operator in feComposite r=jrmui…
…zel,emilio Spec: https://www.w3.org/TR/filter-effects-1/#attr-valuedef-operator-lighter Lighter is defined in the compositing & blending spec as equivalent to porter-duff plus, https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators_plus. The 'lighter' composite mode already works in <canvas> (via globalCompositeOperation), and it's the same there. Chrome implemented support in https://bugs.chromium.org/p/chromium/issues/detail?id=439037 Per w3c/svgwg#424 we should expose the new value in webidl and Chrome uses 7 too (https://codereview.chromium.org/779963002/patch/120001/130009) Differential Revision: https://phabricator.services.mozilla.com/D100605
Showing
13 changed files
with
76 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
19 changes: 19 additions & 0 deletions
19
layout/reftests/svg/filters/feComposite-operator-lighter-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,19 @@ | ||
<!doctype html> | ||
<style>* { margin: 0; padding: 0; }</style> | ||
<canvas id="canvas" width="200" height="200"></canvas> | ||
<script> | ||
var canvas = document.getElementById('canvas'); | ||
var ctx = canvas.getContext('2d'); | ||
var width = canvas.width; | ||
var height = canvas.height; | ||
|
||
ctx.globalCompositeOperation = 'lighter'; | ||
ctx.fillStyle = '#f00'; | ||
ctx.fillRect(0,0,width,height); | ||
|
||
gradient = ctx.createLinearGradient(0, 0, 0, height); | ||
gradient.addColorStop(0, "#0f0"); | ||
gradient.addColorStop(1, "#00f"); | ||
ctx.fillStyle = gradient; | ||
ctx.fillRect(0, 0, width, height); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
layout/reftests/svg/filters/feComposite-operator-lighter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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