diff --git a/accessible/generic/Accessible.cpp b/accessible/generic/Accessible.cpp index 76447bab800d..c6ada3ad9547 100644 --- a/accessible/generic/Accessible.cpp +++ b/accessible/generic/Accessible.cpp @@ -525,11 +525,8 @@ Accessible::ChildAtPoint(int32_t aX, int32_t aY, { // If we can't find the point in a child, we will return the fallback answer: // we return |this| if the point is within it, otherwise nullptr. - nsIntRect rect = Bounds(); - if (rect.IsEmpty()) - return nullptr; - Accessible* fallbackAnswer = nullptr; + nsIntRect rect = Bounds(); if (aX >= rect.x && aX < rect.x + rect.width && aY >= rect.y && aY < rect.y + rect.height) fallbackAnswer = this; diff --git a/accessible/tests/mochitest/hittest/test_general.html b/accessible/tests/mochitest/hittest/test_general.html index 36fdd6e648bf..74ff4fe298d7 100644 --- a/accessible/tests/mochitest/hittest/test_general.html +++ b/accessible/tests/mochitest/hittest/test_general.html @@ -68,6 +68,8 @@ if (!MAC) { hitTest("imgmap", theLetterA, theLetterA); hitTest("container", "imgmap", theLetterA); + // hit testing for element contained by zero-width element + hitTest("container2", "container2_input", "container2_input"); SimpleTest.finish(); } @@ -106,5 +108,8 @@ if (!MAC) { +