diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index 926919109361..25ce125ad767 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -197,8 +197,6 @@ static bool MustBeGenericAccessible(nsIContent* aContent, DocAccessible* aDocument) { nsIFrame* frame = aContent->GetPrimaryFrame(); MOZ_ASSERT(frame); - nsAutoCString overflow; - frame->Style()->GetComputedPropertyValue(eCSSProperty_overflow, overflow); // If the frame has been transformed, and the content has any children, we // should create an Accessible so that we can account for the transform when // calculating the Accessible's bounds using the parent process cache. @@ -209,8 +207,7 @@ static bool MustBeGenericAccessible(nsIContent* aContent, return aContent->HasChildren() && !aContent->IsXULElement() && (frame->IsTransformed() || frame->IsStickyPositioned() || (frame->StyleDisplay()->mPosition == StylePositionProperty::Fixed && - nsLayoutUtils::IsReallyFixedPos(frame)) || - overflow.Equals("hidden"_ns)); + nsLayoutUtils::IsReallyFixedPos(frame))); } /** diff --git a/accessible/generic/LocalAccessible.cpp b/accessible/generic/LocalAccessible.cpp index 21e1978b07c4..b09cf86b2588 100644 --- a/accessible/generic/LocalAccessible.cpp +++ b/accessible/generic/LocalAccessible.cpp @@ -3619,17 +3619,6 @@ already_AddRefed LocalAccessible::BundleFieldsForCache( } else if (aUpdateType != CacheUpdateType::Initial) { fields->SetAttribute(nsGkAtoms::position, DeleteEntry()); } - - if (frame) { - nsAutoCString overflow; - frame->Style()->GetComputedPropertyValue(eCSSProperty_overflow, overflow); - RefPtr overflowAtom = NS_Atomize(overflow); - if (overflowAtom == nsGkAtoms::hidden) { - fields->SetAttribute(nsGkAtoms::overflow, nsGkAtoms::hidden); - } else if (aUpdateType != CacheUpdateType::Initial) { - fields->SetAttribute(nsGkAtoms::overflow, DeleteEntry()); - } - } } if (aCacheDomain & CacheDomain::Table) { @@ -3834,19 +3823,6 @@ void LocalAccessible::MaybeQueueCacheUpdateForStyleChanges() { if (nsIFrame* frame = GetFrame()) { const ComputedStyle* newStyle = frame->Style(); - nsAutoCString oldOverflow, newOverflow; - mOldComputedStyle->GetComputedPropertyValue(eCSSProperty_overflow, - oldOverflow); - newStyle->GetComputedPropertyValue(eCSSProperty_overflow, newOverflow); - - if (oldOverflow != newOverflow) { - RefPtr oldAtom = NS_Atomize(oldOverflow); - RefPtr newAtom = NS_Atomize(newOverflow); - if (oldAtom == nsGkAtoms::hidden || newAtom == nsGkAtoms::hidden) { - mDoc->QueueCacheUpdate(this, CacheDomain::Style); - } - } - nsAutoCString oldDisplay, newDisplay; mOldComputedStyle->GetComputedPropertyValue(eCSSProperty_display, oldDisplay); diff --git a/accessible/ipc/RemoteAccessibleBase.cpp b/accessible/ipc/RemoteAccessibleBase.cpp index 45c3422c6a1c..0d932f7e21f8 100644 --- a/accessible/ipc/RemoteAccessibleBase.cpp +++ b/accessible/ipc/RemoteAccessibleBase.cpp @@ -629,17 +629,6 @@ bool RemoteAccessibleBase::IsFixedPos() const { return false; } -template -bool RemoteAccessibleBase::IsOverflowHidden() const { - MOZ_ASSERT(mCachedFields); - if (auto maybeOverflow = - mCachedFields->GetAttribute>(nsGkAtoms::overflow)) { - return *maybeOverflow == nsGkAtoms::hidden; - } - - return false; -} - template LayoutDeviceIntRect RemoteAccessibleBase::BoundsWithOffset( Maybe aOffset, bool aBoundsAreForHittesting) const { @@ -720,12 +709,11 @@ LayoutDeviceIntRect RemoteAccessibleBase::BoundsWithOffset( // that the bounds we've calculated so far are constrained to the // bounds of the scroll area. Without this, we'll "hit" the off-screen // portions of accs that are are partially (but not fully) within the - // scroll area. This is also a problem for accs with overflow:hidden; - if (aBoundsAreForHittesting && - (hasScrollArea || remoteAcc->IsOverflowHidden())) { - nsRect selfRelativeVisibleBounds(0, 0, remoteBounds.width, - remoteBounds.height); - bounds = bounds.SafeIntersect(selfRelativeVisibleBounds); + // scroll area. + if (aBoundsAreForHittesting && hasScrollArea) { + nsRect selfRelativeScrollBounds(0, 0, remoteBounds.width, + remoteBounds.height); + bounds = bounds.SafeIntersect(selfRelativeScrollBounds); } } if (remoteAcc->IsDoc()) { diff --git a/accessible/ipc/RemoteAccessibleBase.h b/accessible/ipc/RemoteAccessibleBase.h index b2fb411a3e41..30a0891bd26e 100644 --- a/accessible/ipc/RemoteAccessibleBase.h +++ b/accessible/ipc/RemoteAccessibleBase.h @@ -443,7 +443,6 @@ class RemoteAccessibleBase : public Accessible, public HyperTextAccessibleBase { LayoutDeviceIntRect BoundsWithOffset( Maybe aOffset, bool aBoundsAreForHittesting = false) const; bool IsFixedPos() const; - bool IsOverflowHidden() const; // This function is used exclusively for hit testing. bool ContainsPoint(int32_t aX, int32_t aY); diff --git a/accessible/tests/browser/hittest/browser_test_general.js b/accessible/tests/browser/hittest/browser_test_general.js index 16f8369da063..af8f6ac94e2d 100644 --- a/accessible/tests/browser/hittest/browser_test_general.js +++ b/accessible/tests/browser/hittest/browser_test_general.js @@ -232,47 +232,3 @@ addAccessibleTask( iframeAttrs: { style: "width: 600px; height: 600px; padding: 10px;" }, } ); - -/** - * Verify that hit testing returns the proper accessible when one acc content - * is partially hidden due to overflow:hidden; - */ -addAccessibleTask( - ` - -
-
abcde
fghij
-
`, - async function(browser, docAcc) { - const container = findAccessibleChildByID(docAcc, "container"); - const aNode = findAccessibleChildByID(docAcc, "aNode"); - const fNode = findAccessibleChildByID(docAcc, "fNode"); - const dpr = await getContentDPR(browser); - const [, , containerWidth] = Layout.getBounds(container, dpr); - const [, , aNodeWidth] = Layout.getBounds(aNode, dpr); - - await testChildAtPoint( - dpr, - containerWidth - 1, - 1, - container, - aNode, - aNode.firstChild - ); - await testChildAtPoint( - dpr, - containerWidth - aNodeWidth - 1, - 1, - container, - fNode, - fNode.firstChild - ); - }, - { chrome: true, iframe: true, remoteIframe: true } -); diff --git a/accessible/tests/browser/tree/browser.ini b/accessible/tests/browser/tree/browser.ini index bb4aedd1492d..62b45623eda1 100644 --- a/accessible/tests/browser/tree/browser.ini +++ b/accessible/tests/browser/tree/browser.ini @@ -12,7 +12,6 @@ prefs = skip-if = true || (verify && !debug && (os == 'linux')) #Bug 1445513 [browser_browser_element.js] [browser_css_content_visibility.js] -[browser_general.js] [browser_lazy_tabs.js] [browser_searchbar.js] [browser_shadowdom.js] diff --git a/accessible/tests/browser/tree/browser_general.js b/accessible/tests/browser/tree/browser_general.js deleted file mode 100644 index da23982899bf..000000000000 --- a/accessible/tests/browser/tree/browser_general.js +++ /dev/null @@ -1,43 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -/* import-globals-from ../../mochitest/role.js */ -loadScripts({ name: "role.js", dir: MOCHITESTS_DIR }); - -/** - * Verify adding `overflow:hidden;` styling to a div causes it to - * get an accessible. - */ -addAccessibleTask(`

hello world

`, async function(browser, docAcc) { - const originalTree = { DOCUMENT: [{ PARAGRAPH: [{ TEXT_LEAF: [] }] }] }; - - testAccessibleTree(docAcc, originalTree); - info("Adding div element"); - await contentSpawnMutation( - browser, - { unexpected: [[EVENT_REORDER, docAcc]] }, - function() { - const d = content.document.createElement("div"); - content.document.body.appendChild(d); - } - ); - - testAccessibleTree(docAcc, originalTree); - info("Adding overflow:hidden styling to div"); - await contentSpawnMutation( - browser, - { expected: [[EVENT_REORDER, docAcc]] }, - function() { - content.document.body.lastElementChild.setAttribute( - "style", - "overflow:hidden;" - ); - } - ); - - testAccessibleTree(docAcc, { - DOCUMENT: [{ PARAGRAPH: [{ TEXT_LEAF: [] }] }, { SECTION: [] }], - }); -});