diff options
| author | Steve Block <steveblock@google.com> | 2011-05-13 06:44:40 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-05-13 06:44:40 -0700 |
| commit | 08014c20784f3db5df3a89b73cce46037b77eb59 (patch) | |
| tree | 47749210d31e19e6e2f64036fa8fae2ad693476f /Source/WebCore/manual-tests/canvas-mask-redraw.html | |
| parent | 860220379e56aeb66424861ad602b07ee22b4055 (diff) | |
| parent | 4c3661f7918f8b3f139f824efb7855bedccb4c94 (diff) | |
| download | external_webkit-08014c20784f3db5df3a89b73cce46037b77eb59.zip external_webkit-08014c20784f3db5df3a89b73cce46037b77eb59.tar.gz external_webkit-08014c20784f3db5df3a89b73cce46037b77eb59.tar.bz2 | |
Merge changes Ide388898,Ic49f367c,I1158a808,Iacb6ca5d,I2100dd3a,I5c1abe54,Ib0ef9902,I31dbc523,I570314b3
* changes:
Merge WebKit at r75315: Update WebKit version
Merge WebKit at r75315: Add FrameLoaderClient PageCache stubs
Merge WebKit at r75315: Stub out AXObjectCache::remove()
Merge WebKit at r75315: Fix ImageBuffer
Merge WebKit at r75315: Fix PluginData::initPlugins()
Merge WebKit at r75315: Fix conflicts
Merge WebKit at r75315: Fix Makefiles
Merge WebKit at r75315: Move Android-specific WebCore files to Source
Merge WebKit at r75315: Initial merge by git.
Diffstat (limited to 'Source/WebCore/manual-tests/canvas-mask-redraw.html')
| -rw-r--r-- | Source/WebCore/manual-tests/canvas-mask-redraw.html | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Source/WebCore/manual-tests/canvas-mask-redraw.html b/Source/WebCore/manual-tests/canvas-mask-redraw.html new file mode 100644 index 0000000..f166b3a --- /dev/null +++ b/Source/WebCore/manual-tests/canvas-mask-redraw.html @@ -0,0 +1,65 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> + +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>Canvas Mask</title> + <style type="text/css" media="screen"> + #canvas1 { + height: 300px; + width: 400px; + border: 1px solid black; + } + + .masked { +/* -webkit-transform: rotate(10deg);*/ + -webkit-mask: -webkit-canvas(canvas1); + } + </style> + <script type="text/javascript" charset="utf-8"> + + var gPageWidth = 320; + var gPageHeight = 200; + + function drawPageShadow(shadowWidth) + { + var ctx = document.getCSSCanvasContext('2d', 'canvas1', gPageWidth, gPageHeight); + ctx.clearRect (0, 0, gPageWidth, gPageHeight); + + var gradient = ctx.createLinearGradient(0, 0, shadowWidth, 0); + gradient.addColorStop(0, 'rgba(0,0,0,1)'); + gradient.addColorStop(1, 'rgba(0,0,0,0)'); + ctx.fillStyle = gradient; + ctx.fillRect (0, 0, shadowWidth, gPageHeight); + } + + function redrawCanvas(event) + { + drawPageShadow(event.pageX); + } + + function onPageLoad() + { + drawPageShadow(640); + } + + window.addEventListener('load', onPageLoad, false); + + </script> +</head> +<body> + + <p>Hovering over the image or text should cause the element to be redrawn with a new mask</p> + <a href="https://bugs.webkit.org/show_bug.cgi?id=19954">https://bugs.webkit.org/show_bug.cgi?id=19954</a> + <h2>Image with mask</h2> + <img src="http://www.google.com/intl/en_ALL/images/logo.gif" width="320" height="200" alt="Clown Fish" class="masked" + onmousemove="redrawCanvas(event)"> + + <h2>Div with mask</h2> + <div class="masked" style="width: 640px" onmousemove="redrawCanvas(event)"> + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + </div> + +</body> +</html> |
