diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index a0d975a2a6ca..901bf75882b2 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -851,7 +851,9 @@ nsAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY, // Get accessible for the node with the point or the first accessible in // the DOM parent chain. - nsAccessible* accessible = accDocument->GetAccessibleOrContainer(content); + nsDocAccessible* contentDocAcc = GetAccService()-> + GetDocAccessible(content->OwnerDoc()); + nsAccessible* accessible = contentDocAcc->GetAccessibleOrContainer(content); if (!accessible) return fallbackAnswer; diff --git a/accessible/tests/mochitest/Makefile.in b/accessible/tests/mochitest/Makefile.in index 6266463a51c6..454ec5d8499c 100644 --- a/accessible/tests/mochitest/Makefile.in +++ b/accessible/tests/mochitest/Makefile.in @@ -49,6 +49,7 @@ DIRS = \ elm \ events \ focus \ + hittest \ hyperlink \ hypertext \ name \ @@ -96,8 +97,6 @@ _TEST_FILES =\ test_aria_roles.xul \ test_aria_token_attrs.html \ test_bug420863.html \ - test_childAtPoint.html \ - test_childAtPoint.xul \ test_descr.html \ test_nsIAccessibleDocument.html \ test_nsIAccessibleImage.html \ diff --git a/accessible/tests/mochitest/hittest/Makefile.in b/accessible/tests/mochitest/hittest/Makefile.in new file mode 100644 index 000000000000..3838210e8925 --- /dev/null +++ b/accessible/tests/mochitest/hittest/Makefile.in @@ -0,0 +1,55 @@ +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Foundation. +# Portions created by the Initial Developer are Copyright (C) 2012 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Hubert Figuière +# +# Alternatively, the contents of this file may be used under the terms of +# either of the GNU General Public License Version 2 or later (the "GPL"), +# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ +relativesrcdir = accessible/hittest + +include $(DEPTH)/config/autoconf.mk +include $(topsrcdir)/config/rules.mk + +_TEST_FILES = \ + test_general.html \ + test_general.xul \ + test_browser.html \ + $(NULL) + +libs:: $(_TEST_FILES) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/hittest/test_browser.html b/accessible/tests/mochitest/hittest/test_browser.html new file mode 100644 index 000000000000..81c007955e15 --- /dev/null +++ b/accessible/tests/mochitest/hittest/test_browser.html @@ -0,0 +1,64 @@ + + + + nsIAccessible::childAtPoint() from browser tests + + + + + + + + + + + + Mozilla Bug 726097 + +
+
imgitem
+
+ + diff --git a/accessible/tests/mochitest/test_childAtPoint.html b/accessible/tests/mochitest/hittest/test_general.html similarity index 97% rename from accessible/tests/mochitest/test_childAtPoint.html rename to accessible/tests/mochitest/hittest/test_general.html index 7d4363afff19..97d9e931fd57 100644 --- a/accessible/tests/mochitest/test_childAtPoint.html +++ b/accessible/tests/mochitest/hittest/test_general.html @@ -8,9 +8,9 @@ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"> + src="../common.js"> + src="../layout.js">