Skip to content

Commit

Permalink
Merge branch 'master' into fixtypo
Browse files Browse the repository at this point in the history
  • Loading branch information
tauqirkhan committed Sep 18, 2024
2 parents 87d05df + a13db27 commit 0af2b9d
Show file tree
Hide file tree
Showing 729 changed files with 21,929 additions and 24,850 deletions.
18 changes: 4 additions & 14 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2429,20 +2429,10 @@ void DocAccessible::ContentRemoved(nsIContent* aContentNode) {
}

bool DocAccessible::RelocateARIAOwnedIfNeeded(nsIContent* aElement) {
if (!aElement->HasID()) return false;

AttrRelProviders* list = GetRelProviders(
aElement->AsElement(), nsDependentAtomString(aElement->GetID()));
if (list) {
for (uint32_t idx = 0; idx < list->Length(); idx++) {
if (list->ElementAt(idx)->mRelAttr == nsGkAtoms::aria_owns) {
LocalAccessible* owner = GetAccessible(list->ElementAt(idx)->mContent);
if (owner) {
mNotificationController->ScheduleRelocation(owner);
return true;
}
}
}
RelatedAccIterator owners(mDoc, aElement, nsGkAtoms::aria_owns);
if (Accessible* owner = owners.Next()) {
mNotificationController->ScheduleRelocation(owner->AsLocal());
return true;
}

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
addAccessibleTask(
`<div id="test">test</div>`,
async function (browser, docAcc) {
// On Linux, the viewport cache is populated on the DocAccessible without
// explicitly requesting it and is present once the document has loaded.
// On Linux and macOS, inconsistently, the viewport cache is populated on
// the DocAccessible without explicitly requesting it and is present once
// the document has loaded.
await testCachingPerPlatform(docAcc, "viewport", () => {
docAcc.getState({}, {});
});
Expand Down
3 changes: 2 additions & 1 deletion accessible/tests/browser/caching_granularity/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ async function testCachingPerPlatform(accessible, attribute, queryCb) {
attribute == "layout-guess" ||
attribute == "language" ||
attribute == "text" ||
attribute == "style")
attribute == "style" ||
attribute == "viewport")
) {
// These attributes work on macOS, but aren't consistent. Events may happen
// before document load complete that cause caching before the test starts.
Expand Down
62 changes: 62 additions & 0 deletions accessible/tests/browser/e10s/browser_treeupdate_ariaowns.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,3 +544,65 @@ customElements.define("custom-listbox",
await onReorder;
}
);

/**
* Test insertion of relocated by ID child after initial load
*/
addAccessibleTask(
`<div id='a' aria-owns='b'></div>`,
async function (browser, accDoc) {
const a = findAccessibleChildByID(accDoc, "a");
is(a.children.length, 0, "'a' has no children");
const waitFor = {
expected: [
[EVENT_SHOW, "b"],
[EVENT_INNER_REORDER, a],
[EVENT_REORDER, accDoc],
],
};
await contentSpawnMutation(browser, waitFor, function () {
const b = content.document.createElement("div");
b.id = "b";
content.document.body.appendChild(b);
});
is(getAccessibleDOMNodeID(a.firstChild), "b", "'a' owns relocated child");
}
);

/**
* Test insertion of relocated by child element reflection after initial load
*/
addAccessibleTask(`<div id='a'></div>`, async function (browser, accDoc) {
const a = findAccessibleChildByID(accDoc, "a");
is(a.children.length, 0, "'a' has no children");

// Create div and add it to a's ariaOwnsElements.
// The refresh ticks called in contentSpawnMutation
// will cause a relocation to be scheduled and performed.
// Nothing will happen because 'b' is not parented yet.
let waitFor = {
unexpected: [
[EVENT_SHOW, "b"],
[EVENT_INNER_REORDER, a],
[EVENT_REORDER, accDoc],
],
};
await contentSpawnMutation(browser, waitFor, function () {
content.b = content.document.createElement("div");
content.b.id = "b";
content.document.getElementById("a").ariaOwnsElements = [content.b];
});

// Parent 'b'. It should relocate into 'a'.
waitFor = {
expected: [
[EVENT_SHOW, "b"],
[EVENT_INNER_REORDER, a],
[EVENT_REORDER, accDoc],
],
};
await contentSpawnMutation(browser, waitFor, function () {
content.document.body.appendChild(content.b);
});
is(getAccessibleDOMNodeID(a.firstChild), "b", "'a' owns relocated child");
});
31 changes: 3 additions & 28 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ ChromeUtils.defineESModuleGetters(this, {
E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs",
ExtensionsUI: "resource:///modules/ExtensionsUI.sys.mjs",
HomePage: "resource:///modules/HomePage.sys.mjs",
isProductURL: "chrome://global/content/shopping/ShoppingProduct.mjs",
LightweightThemeConsumer:
"resource://gre/modules/LightweightThemeConsumer.sys.mjs",
LoginHelper: "resource://gre/modules/LoginHelper.sys.mjs",
Expand Down Expand Up @@ -3600,14 +3599,8 @@ var XULBrowserWindow = {
},

// Properties used to cache security state used to update the UI
_state: null,
_lastLocation: null,
_event: null,
_lastLocationForEvent: null,
// _isSecureContext can change without the state/location changing, due to security
// error pages that intercept certain loads. For example this happens sometimes
// with the the HTTPS-Only Mode error page (more details in bug 1656027)
_isSecureContext: null,

// This is called in multiple ways:
// 1. Due to the nsIWebProgressListener.onContentBlockingEvent notification.
Expand Down Expand Up @@ -3654,41 +3647,23 @@ var XULBrowserWindow = {
// 3. Called directly during this object's initializations.
// aRequest will be null always in case 2 and 3, and sometimes in case 1.
onSecurityChange(aWebProgress, aRequest, aState, _aIsSimulated) {
// Don't need to do anything if the data we use to update the UI hasn't
// changed
let uri = gBrowser.currentURI;
let spec = uri.spec;
let isSecureContext = gBrowser.securityUI.isSecureContext;
if (
this._state == aState &&
this._lastLocation == spec &&
this._isSecureContext === isSecureContext
) {
// Switching to a tab of the same URL doesn't change most security
// information, but tab specific permissions may be different.
gIdentityHandler.refreshIdentityBlock();
return;
}
this._state = aState;
this._lastLocation = spec;
this._isSecureContext = isSecureContext;

// Make sure the "https" part of the URL is striked out or not,
// depending on the current mixed active content blocking state.
gURLBar.formatValue();

// Update the identity panel, making sure we use the precursorPrincipal's
// URI where appropriate, for example about:blank windows.
let uri = gBrowser.currentURI;
let uriOverride = this._securityURIOverride(gBrowser.selectedBrowser);
if (uriOverride) {
uri = uriOverride;
this._state |= Ci.nsIWebProgressListener.STATE_IDENTITY_ASSOCIATED;
aState |= Ci.nsIWebProgressListener.STATE_IDENTITY_ASSOCIATED;
}

try {
uri = Services.io.createExposableURI(uri);
} catch (e) {}
gIdentityHandler.updateIdentity(this._state, uri);
gIdentityHandler.updateIdentity(aState, uri);
},

// simulate all change notifications after switching tabs
Expand Down
1 change: 0 additions & 1 deletion browser/base/content/browser.js.globals
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
"E10SUtils",
"ExtensionsUI",
"HomePage",
"isProductURL",
"LightweightThemeConsumer",
"LoginHelper",
"LoginManagerParent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ add_task(async function navigate_around() {
// Disable bfcache so that we can measure more accurately the number of
// pref accesses in the child processes.
// If bfcache is enabled on Fission
// dom.ipc.keepProcessesAlive.webIsolated.perOrigin and
// security.sandbox.content.force-namespace are accessed only a couple of
// security.sandbox.content.force-namespace is accessed only a couple of
// times.
["browser.sessionhistory.max_total_viewers", 0],
],
Expand All @@ -183,12 +182,6 @@ add_task(async function navigate_around() {
min: 50,
max: 51,
};
// This pref is only accessed in automation to speed up tests.
knownProblematicPrefs["dom.ipc.keepProcessesAlive.webIsolated.perOrigin"] =
{
min: 50,
max: 51,
};
if (AppConstants.platform == "linux") {
// The following sandbox pref is covered by
// https://bugzilla.mozilla.org/show_bug.cgi?id=1600189
Expand Down
2 changes: 2 additions & 0 deletions browser/base/content/test/static/browser.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ skip-if = ["os == 'win' && msix"] # Permafail on MSIX packages due to it running
["browser_parsable_script.js"]
skip-if = ["ccov && os == 'linux'"] # https://bugzilla.mozilla.org/show_bug.cgi?id=1608081

["browser_glean_metrics_exist.js"]

["browser_sentence_case_strings.js"]

["browser_title_case_menus.js"]
Loading

0 comments on commit 0af2b9d

Please sign in to comment.