Commit e6e52bee authored by cfleizach@apple.com's avatar cfleizach@apple.com

Bug 25557: REGRESSION: Canvas elements are ignored instead of being exposed as AXImage

https://bugs.webkit.org/show_bug.cgi?id=25557



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 679e695a
2009-05-04 Chris Fleizach <cfleizach@apple.com>
Reviewed by Beth Dakin, Oliver Hunt.
Bug 25557: REGRESSION: Canvas elements are ignored instead of being exposed as AXImage
https://bugs.webkit.org/show_bug.cgi?id=25557
* accessibility/canvas-expected.txt: Added.
* accessibility/canvas.html: Added.
2009-05-04 Kai <set EMAIL_ADDRESS environment variable>
Reviewed by Eric Seidel.
<html>
<script type="text/javascript">
function drawCanvas(context) {
context.lineWidth = 10.0;
context.lineCap = "round";
context.beginPath();
// Draw a bounds rect (default color is black)
context.strokeRect(0, 0, 300, 300);
context.strokeStyle = "#808080";
// Draw a vertical line
context.moveTo(150, 100);
context.lineTo(150, 200);
context.stroke();
// Draw a horizontal line
context.moveTo(100, 150);
context.lineTo(200, 150);
context.stroke();
}
function _onload() {
var context = document.getElementById("myCanvas").getContext("2d");
drawCanvas(context);
}
</script>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<body id="body" onload="_onload()">
<html>
<!-- This test makes sure that a canvas element shows up as an image -->
<canvas id="myCanvas" style="width:300px;height:300px;" width='300' height='300' alt="canvas 1"></canvas>
<div id="result"></div>
<script>
if (window.accessibilityController) {
var result = document.getElementById("result");
var body = document.getElementById("body");
body.focus();
var canvasElement = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0);
var pattern = "AXRole: AXImage";
if (canvasElement.allAttributes().indexOf(pattern) != -1) {
result.innerText += "Test passed\n";
}
else {
result.innerText += "Test failed\n" + canvasElement.allAttributes();
}
}
</script>
</body>
</html>
2009-05-04 Chris Fleizach <cfleizach@apple.com>
Reviewed by Beth Dakin, Oliver Hunt.
Bug 25557: REGRESSION: Canvas elements are ignored instead of being exposed as AXImage
https://bugs.webkit.org/show_bug.cgi?id=25557
Test: accessibility/canvas.html
* page/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::roleValue):
2009-05-04 Brady Eidson <beidson@apple.com>
Fix an ancient Changelog entry where Sam Weinig flat out lied and confused my exploration of a bug.
......@@ -57,6 +57,7 @@
#include "Page.h"
#include "RenderFieldset.h"
#include "RenderFileUploadControl.h"
#include "RenderHTMLCanvas.h"
#include "RenderImage.h"
#include "RenderInline.h"
#include "RenderListBox.h"
......@@ -1228,6 +1229,13 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
return true;
}
if (node && node->hasTagName(canvasTag)) {
RenderHTMLCanvas* canvas = static_cast<RenderHTMLCanvas*>(m_renderer);
if (canvas->height() <= 1 || canvas->width() <= 1)
return true;
return false;
}
// check for one-dimensional image
RenderImage* image = toRenderImage(m_renderer);
if (image->height() <= 1 || image->width() <= 1)
......@@ -2171,6 +2179,9 @@ AccessibilityRole AccessibilityRenderObject::roleValue() const
return ButtonRole;
return ImageRole;
}
if (node && node->hasTagName(canvasTag))
return ImageRole;
if (m_renderer->isRenderView())
return WebAreaRole;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment