зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1825611) for causing multiple mochitest failures. CLOSED TREE
Backed out changeset a30a125f2aea (bug 1825611) Backed out changeset ee5e3b614f91 (bug 1825611) Backed out changeset c79ad1ee1e32 (bug 1825611) Backed out changeset db2d550a788b (bug 1825611)
This commit is contained in:
Родитель
ab6b26a454
Коммит
0b022d176d
|
@ -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)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3619,17 +3619,6 @@ already_AddRefed<AccAttributes> LocalAccessible::BundleFieldsForCache(
|
|||
} else if (aUpdateType != CacheUpdateType::Initial) {
|
||||
fields->SetAttribute(nsGkAtoms::position, DeleteEntry());
|
||||
}
|
||||
|
||||
if (frame) {
|
||||
nsAutoCString overflow;
|
||||
frame->Style()->GetComputedPropertyValue(eCSSProperty_overflow, overflow);
|
||||
RefPtr<nsAtom> 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<nsAtom> oldAtom = NS_Atomize(oldOverflow);
|
||||
RefPtr<nsAtom> newAtom = NS_Atomize(newOverflow);
|
||||
if (oldAtom == nsGkAtoms::hidden || newAtom == nsGkAtoms::hidden) {
|
||||
mDoc->QueueCacheUpdate(this, CacheDomain::Style);
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoCString oldDisplay, newDisplay;
|
||||
mOldComputedStyle->GetComputedPropertyValue(eCSSProperty_display,
|
||||
oldDisplay);
|
||||
|
|
|
@ -629,17 +629,6 @@ bool RemoteAccessibleBase<Derived>::IsFixedPos() const {
|
|||
return false;
|
||||
}
|
||||
|
||||
template <class Derived>
|
||||
bool RemoteAccessibleBase<Derived>::IsOverflowHidden() const {
|
||||
MOZ_ASSERT(mCachedFields);
|
||||
if (auto maybeOverflow =
|
||||
mCachedFields->GetAttribute<RefPtr<nsAtom>>(nsGkAtoms::overflow)) {
|
||||
return *maybeOverflow == nsGkAtoms::hidden;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class Derived>
|
||||
LayoutDeviceIntRect RemoteAccessibleBase<Derived>::BoundsWithOffset(
|
||||
Maybe<nsRect> aOffset, bool aBoundsAreForHittesting) const {
|
||||
|
@ -720,12 +709,11 @@ LayoutDeviceIntRect RemoteAccessibleBase<Derived>::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()) {
|
||||
|
|
|
@ -443,7 +443,6 @@ class RemoteAccessibleBase : public Accessible, public HyperTextAccessibleBase {
|
|||
LayoutDeviceIntRect BoundsWithOffset(
|
||||
Maybe<nsRect> 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);
|
||||
|
|
|
@ -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(
|
||||
`
|
||||
<style>
|
||||
div div {
|
||||
overflow: hidden;
|
||||
font-family: monospace;
|
||||
width: 2ch;
|
||||
}
|
||||
</style>
|
||||
<div id="container" style="display: flex; flex-direction: row-reverse;">
|
||||
<div id="aNode">abcde</div><div id="fNode">fghij</div>
|
||||
</div>`,
|
||||
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 }
|
||||
);
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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(`<p>hello world</p>`, 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: [] }],
|
||||
});
|
||||
});
|
Загрузка…
Ссылка в новой задаче