[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
cfleizach at apple.com
cfleizach at apple.com
Wed Dec 22 13:22:46 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 6ecb177146d53606fbf2e141fd3dfdeb1e784d25
Author: cfleizach at apple.com <cfleizach at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 13 16:03:00 2010 +0000
REGRESSION (r64816-r64889): Crash in WebCore::AccessibilityRenderObject
https://bugs.webkit.org/show_bug.cgi?id=43807
Reviewed by Darin Adler.
WebCore:
Ensure that visiblePositionForPoint can handle non RenderBoxModelObject types.
Test: platform/mac/accessibility/visible-position-crash-for-text-node.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::visiblePositionForPoint):
WebKitTools:
* DumpRenderTree/AccessibilityUIElement.cpp:
(textMarkerForPointCallback):
(AccessibilityUIElement::textMarkerForPoint):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::textMarkerForPoint):
LayoutTests:
* platform/mac/accessibility/visible-position-crash-for-text-node-expected.txt: Added.
* platform/mac/accessibility/visible-position-crash-for-text-node.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1eb8a1b..a236dec 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-13 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r64816-r64889): Crash in WebCore::AccessibilityRenderObject
+ https://bugs.webkit.org/show_bug.cgi?id=43807
+
+ * platform/mac/accessibility/visible-position-crash-for-text-node-expected.txt: Added.
+ * platform/mac/accessibility/visible-position-crash-for-text-node.html: Added.
+
2010-09-13 Martin Robinson <mrobinson at igalia.com>
Reviewed by Andreas Kling.
diff --git a/LayoutTests/platform/mac/accessibility/visible-position-crash-for-text-node-expected.txt b/LayoutTests/platform/mac/accessibility/visible-position-crash-for-text-node-expected.txt
new file mode 100644
index 0000000..915d569
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/visible-position-crash-for-text-node-expected.txt
@@ -0,0 +1,11 @@
+This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text.
+This protects against a crash in asking for visible point for position to ensure that it can handle all RenderText objects.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS content.childAtIndex(0).isEqual(textElement) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/visible-position-crash-for-text-node.html b/LayoutTests/platform/mac/accessibility/visible-position-crash-for-text-node.html
new file mode 100644
index 0000000..1dbda01
--- /dev/null
+++ b/LayoutTests/platform/mac/accessibility/visible-position-crash-for-text-node.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<div id="content" tabindex="0" style="width:200px;">
+This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text.
+This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text.
+This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text.
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("This protects against a crash in asking for visible point for position to ensure that it can handle all RenderText objects.");
+
+ if (window.accessibilityController) {
+
+ document.getElementById("content").focus();
+ var content = accessibilityController.focusedElement;
+
+ // Get the text marker at this point. It should not crash.
+ var markerAtPoint = content.textMarkerForPoint(content.x + content.width/2, content.y + content.height/2);
+ var textElement = content.accessibilityElementForTextMarker(markerAtPoint);
+
+ // Verify the element is the same as the one we wanted.
+ var textElement = content.accessibilityElementForTextMarker(markerAtPoint);
+ shouldBeTrue("content.childAtIndex(0).isEqual(textElement)");
+ }
+
+ successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index edaca82..61fe16a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-13 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r64816-r64889): Crash in WebCore::AccessibilityRenderObject
+ https://bugs.webkit.org/show_bug.cgi?id=43807
+
+ Ensure that visiblePositionForPoint can handle non RenderBoxModelObject types.
+
+ Test: platform/mac/accessibility/visible-position-crash-for-text-node.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
+
2010-09-13 Martin Robinson <mrobinson at igalia.com>
Reviewed by Andreas Kling.
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 0d5bf49..3cf32d4 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -2538,6 +2538,9 @@ void AccessibilityRenderObject::setSelectedVisiblePositionRange(const VisiblePos
VisiblePosition AccessibilityRenderObject::visiblePositionForPoint(const IntPoint& point) const
{
+ if (!m_renderer)
+ return VisiblePosition();
+
// convert absolute point to view coordinates
FrameView* frameView = m_renderer->document()->topDocument()->renderer()->view()->frameView();
RenderView* renderView = topRenderer();
@@ -2557,13 +2560,16 @@ VisiblePosition AccessibilityRenderObject::visiblePositionForPoint(const IntPoin
HitTestResult result(ourpoint);
renderView->layer()->hitTest(request, result);
innerNode = result.innerNode();
- if (!innerNode || !innerNode->renderer())
+ if (!innerNode)
+ return VisiblePosition();
+
+ RenderObject* renderer = innerNode->renderer();
+ if (!renderer)
return VisiblePosition();
pointResult = result.localPoint();
// done if hit something other than a widget
- RenderBoxModelObject* renderer = innerNode->renderBoxModelObject();
if (!renderer->isWidget())
break;
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 8ddeb83..5808341 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-13 Chris Fleizach <cfleizach at apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION (r64816-r64889): Crash in WebCore::AccessibilityRenderObject
+ https://bugs.webkit.org/show_bug.cgi?id=43807
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (textMarkerForPointCallback):
+ (AccessibilityUIElement::textMarkerForPoint):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::textMarkerForPoint):
+
2010-09-13 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 22bbbaa..5b5240a 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -424,6 +424,18 @@ static JSValueRef textMarkerRangeLengthCallback(JSContextRef context, JSObjectRe
return JSValueMakeNumber(context, (int)toAXElement(thisObject)->textMarkerRangeLength(range));
}
+static JSValueRef textMarkerForPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int x = 0;
+ int y = 0;
+ if (argumentCount == 2) {
+ x = JSValueToNumber(context, arguments[0], exception);
+ y = JSValueToNumber(context, arguments[1], exception);
+ }
+
+ return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->textMarkerForPoint(x, y));
+}
+
static JSValueRef textMarkerRangeForMarkersCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
AccessibilityTextMarker* startMarker = 0;
@@ -752,6 +764,11 @@ AccessibilityUIElement AccessibilityUIElement::accessibilityElementForTextMarker
return 0;
}
+AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
+{
+ return 0;
+}
+
#endif
// Destruction
@@ -872,6 +889,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "endTextMarkerForTextMarkerRange", endTextMarkerForTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "accessibilityElementForTextMarker", accessibilityElementForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "textMarkerRangeLength", textMarkerRangeLengthCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "textMarkerForPoint", textMarkerForPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0 }
};
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index 2606795..2cee2c3 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -189,6 +189,7 @@ public:
AccessibilityTextMarkerRange textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
AccessibilityTextMarker startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
AccessibilityTextMarker endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
+ AccessibilityTextMarker textMarkerForPoint(int x, int y);
AccessibilityUIElement accessibilityElementForTextMarker(AccessibilityTextMarker*);
int textMarkerRangeLength(AccessibilityTextMarkerRange*);
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index fa4acf5..9b2443c 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -1246,6 +1246,16 @@ AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForTextMarkerRange(
return 0;
}
+AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarker = [m_element accessibilityAttributeValue:@"AXTextMarkerForPosition" forParameter:[NSValue valueWithPoint:NSMakePoint(x, y)]];
+ return AccessibilityTextMarker(textMarker);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker)
{
BEGIN_AX_OBJC_EXCEPTIONS
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list