Skip to content

Commit

Permalink
Merge commit '40205f1b55f1ba8a26fcbd362c20d843e8718a87'
Browse files Browse the repository at this point in the history
  • Loading branch information
mineyoshikawasnow committed Feb 4, 2021
2 parents 826d27b + 40205f1 commit beeaa14
Show file tree
Hide file tree
Showing 473 changed files with 7,959 additions and 4,062 deletions.
9 changes: 4 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

266 changes: 0 additions & 266 deletions a.patch

This file was deleted.

10 changes: 6 additions & 4 deletions accessible/base/DocManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,22 @@ Accessible* DocManager::FindAccessibleInCache(nsINode* aNode) const {
return nullptr;
}

void DocManager::RemoveFromXPCDocumentCache(DocAccessible* aDocument) {
void DocManager::RemoveFromXPCDocumentCache(DocAccessible* aDocument,
bool aAllowServiceShutdown) {
xpcAccessibleDocument* xpcDoc = mXPCDocumentCache.GetWeak(aDocument);
if (xpcDoc) {
xpcDoc->Shutdown();
mXPCDocumentCache.Remove(aDocument);

if (!HasXPCDocuments()) {
if (aAllowServiceShutdown && !HasXPCDocuments()) {
MaybeShutdownAccService(nsAccessibilityService::eXPCOM);
}
}
}

void DocManager::NotifyOfDocumentShutdown(DocAccessible* aDocument,
Document* aDOMDocument) {
Document* aDOMDocument,
bool aAllowServiceShutdown) {
// We need to remove listeners in both cases, when document is being shutdown
// or when accessibility service is being shut down as well.
RemoveListeners(aDOMDocument);
Expand All @@ -115,7 +117,7 @@ void DocManager::NotifyOfDocumentShutdown(DocAccessible* aDocument,
return;
}

RemoveFromXPCDocumentCache(aDocument);
RemoveFromXPCDocumentCache(aDocument, aAllowServiceShutdown);
mDocAccessibleCache.Remove(aDOMDocument);
}

Expand Down
8 changes: 6 additions & 2 deletions accessible/base/DocManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ class DocManager : public nsIWebProgressListener,

/**
* Called by document accessible when it gets shutdown.
* @param aAllowServiceShutdown true to shut down nsAccessibilityService
* if it is no longer required, false to prevent it.
*/
void NotifyOfDocumentShutdown(DocAccessible* aDocument,
dom::Document* aDOMDocument);
dom::Document* aDOMDocument,
bool aAllowServiceShutdown = true);

void RemoveFromXPCDocumentCache(DocAccessible* aDocument);
void RemoveFromXPCDocumentCache(DocAccessible* aDocument,
bool aAllowServiceShutdown = true);

/**
* Return XPCOM accessible document.
Expand Down
17 changes: 13 additions & 4 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ void DocAccessible::Shutdown() {

RemoveEventListeners();

// mParent->RemoveChild clears mParent, but we need to know whether we were a
// child later, so use a flag.
const bool isChild = !!mParent;
if (mParent) {
DocAccessible* parentDocument = mParent->Document();
if (parentDocument) parentDocument->RemoveChildDocument(this);
Expand All @@ -404,6 +407,9 @@ void DocAccessible::Shutdown() {
MOZ_ASSERT(!mParent, "Parent has to be null!");
}

mPresShell->SetDocAccessible(nullptr);
mPresShell = nullptr; // Avoid reentrancy

// Walk the array backwards because child documents remove themselves from the
// array as they are shutdown.
int32_t childDocCount = mChildDocuments.Length();
Expand All @@ -424,9 +430,6 @@ void DocAccessible::Shutdown() {
mVirtualCursor = nullptr;
}

mPresShell->SetDocAccessible(nullptr);
mPresShell = nullptr; // Avoid reentrancy

mDependentIDsHashes.Clear();
mNodeToAccessibleMap.Clear();

Expand All @@ -446,7 +449,13 @@ void DocAccessible::Shutdown() {

HyperTextAccessibleWrap::Shutdown();

GetAccService()->NotifyOfDocumentShutdown(this, mDocumentNode);
MOZ_ASSERT(GetAccService());
GetAccService()->NotifyOfDocumentShutdown(
this, mDocumentNode,
// Make sure we don't shut down AccService while a parent document is
// still shutting down. The parent will allow service shutdown when it
// reaches this point.
/* aAllowServiceShutdown */ !isChild);
mDocumentNode = nullptr;
}

Expand Down
31 changes: 25 additions & 6 deletions browser/base/content/test/forms/browser_selectpopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,10 @@ async function performLargePopupTests(win) {
EventUtils.synthesizeMouseAtPoint(
popupRect.left + 5,
popupRect.top - 10,
{ type: "mousemove" },
{
type: "mousemove",
buttons: 1,
},
win
);
is(
Expand All @@ -661,7 +664,10 @@ async function performLargePopupTests(win) {
EventUtils.synthesizeMouseAtPoint(
popupRect.left + 20,
popupRect.top + 10,
{ type: "mousemove" },
{
type: "mousemove",
buttons: 1,
},
win
);

Expand All @@ -675,7 +681,10 @@ async function performLargePopupTests(win) {
EventUtils.synthesizeMouseAtPoint(
popupRect.left + 20,
popupRect.top - 20,
{ type: "mousemove" },
{
type: "mousemove",
buttons: 1,
},
win
);
await scrolledPromise;
Expand All @@ -692,7 +701,10 @@ async function performLargePopupTests(win) {
EventUtils.synthesizeMouseAtPoint(
popupRect.left + 20,
popupRect.bottom + 20,
{ type: "mousemove" },
{
type: "mousemove",
buttons: 1,
},
win
);
await scrolledPromise;
Expand Down Expand Up @@ -739,7 +751,10 @@ async function performLargePopupTests(win) {
EventUtils.synthesizeMouseAtPoint(
popupRect.left + 20,
popupRect.bottom + 20,
{ type: "mousemove" },
{
type: "mousemove",
buttons: 1,
},
win
);
await scrolledPromise;
Expand All @@ -755,7 +770,10 @@ async function performLargePopupTests(win) {
EventUtils.synthesizeMouseAtPoint(
popupRect.left + 20,
popupRect.top - 20,
{ type: "mousemove" },
{
type: "mousemove",
buttons: 1,
},
win
);
await scrolledPromise;
Expand Down Expand Up @@ -1042,6 +1060,7 @@ add_task(async function test_mousemove_correcttarget() {

EventUtils.synthesizeMouseAtCenter(selectPopup.firstElementChild, {
type: "mousemove",
buttons: 1,
});
});

Expand Down
7 changes: 6 additions & 1 deletion browser/components/enterprisepolicies/Policies.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,7 @@ var Policies = {
onBeforeAddons(manager, param) {
const allowedPrefixes = [
"accessibility.",
"app.update.",
"browser.",
"datareporting.policy.",
"dom.",
Expand Down Expand Up @@ -1523,7 +1524,11 @@ var Policies = {
"security.tls.version.enable-deprecated",
"security.warn_submit_secure_to_insecure",
];
const blockedPrefs = [];
const blockedPrefs = [
"app.update.channel",
"app.update.lastUpdateTime",
"app.update.migrated",
];

for (let preference in param) {
if (blockedPrefs.includes(preference)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,15 @@ class WelcomeScreen extends react__WEBPACK_IMPORTED_MODULE_0___default.a.PureCom
muted: "true",
src: _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_3__["AboutWelcomeUtils"].hasDarkMode() ? this.props.content.tiles.source.dark : this.props.content.tiles.source.default
})) : null;

case "image":
return this.props.content.tiles.source ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
className: `${this.props.content.tiles.media_type}`
}, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", {
src: _lib_aboutwelcome_utils__WEBPACK_IMPORTED_MODULE_3__["AboutWelcomeUtils"].hasDarkMode() && this.props.content.tiles.source.dark ? this.props.content.tiles.source.dark : this.props.content.tiles.source.default,
role: "presentation",
alt: ""
})) : null;
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,21 @@ export class WelcomeScreen extends React.PureComponent {
/>
</div>
) : null;
case "image":
return this.props.content.tiles.source ? (
<div className={`${this.props.content.tiles.media_type}`}>
<img
src={
AboutWelcomeUtils.hasDarkMode() &&
this.props.content.tiles.source.dark
? this.props.content.tiles.source.dark
: this.props.content.tiles.source.default
}
role="presentation"
alt=""
/>
</div>
) : null;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
padding-block: 7px;
padding-inline: 10px 13px;
margin-inline-start: 2px;
margin-bottom: 2px;
-moz-context-properties: fill;
fill: var(--customize-menu-primary-text-color);
background: url('#{$image-path}glyph-arrowhead-down-12.svg') right no-repeat;
Expand Down
1 change: 1 addition & 0 deletions browser/components/newtab/css/activity-stream-linux.css
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,7 @@ main {
padding-block: 7px;
padding-inline: 10px 13px;
margin-inline-start: 2px;
margin-bottom: 2px;
-moz-context-properties: fill;
fill: var(--customize-menu-primary-text-color);
background: url("chrome://activity-stream/content/data/content/assets/glyph-arrowhead-down-12.svg") right no-repeat;
Expand Down
1 change: 1 addition & 0 deletions browser/components/newtab/css/activity-stream-mac.css
Original file line number Diff line number Diff line change
Expand Up @@ -1774,6 +1774,7 @@ main {
padding-block: 7px;
padding-inline: 10px 13px;
margin-inline-start: 2px;
margin-bottom: 2px;
-moz-context-properties: fill;
fill: var(--customize-menu-primary-text-color);
background: url("chrome://activity-stream/content/data/content/assets/glyph-arrowhead-down-12.svg") right no-repeat;
Expand Down
1 change: 1 addition & 0 deletions browser/components/newtab/css/activity-stream-windows.css
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,7 @@ main {
padding-block: 7px;
padding-inline: 10px 13px;
margin-inline-start: 2px;
margin-bottom: 2px;
-moz-context-properties: fill;
fill: var(--customize-menu-primary-text-color);
background: url("chrome://activity-stream/content/data/content/assets/glyph-arrowhead-down-12.svg") right no-repeat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ const TEST_MULTISTAGE_CONTENT = {
order: 2,
content: {
title: "Step 3",
tiles: {
type: "image",
media_type: "test-img",
source: {
default:
"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iIzQ1YTFmZiIgZmlsbC1vcGFjaXR5PSJjb250ZXh0LWZpbGwtb3BhY2l0eSIgZD0iTTE1Ljg0NSA2LjA2NEExLjEgMS4xIDAgMCAwIDE1IDUuMzMxTDEwLjkxMSA0LjYgOC45ODUuNzM1YTEuMSAxLjEgMCAwIDAtMS45NjkgMEw1LjA4OSA0LjZsLTQuMDgxLjcyOWExLjEgMS4xIDAgMCAwLS42MTUgMS44MzRMMy4zMiAxMC4zMWwtLjYwOSA0LjM2YTEuMSAxLjEgMCAwIDAgMS42IDEuMTI3TDggMTMuODczbDMuNjkgMS45MjdhMS4xIDEuMSAwIDAgMCAxLjYtMS4xMjdsLS42MS00LjM2MyAyLjkyNi0zLjE0NmExLjEgMS4xIDAgMCAwIC4yMzktMS4xeiIvPjwvc3ZnPg==",
},
},
primary_button: {
label: "Next",
action: {
Expand Down Expand Up @@ -308,7 +316,7 @@ add_task(async function test_multistage_aboutwelcome_experimentAPI() {
"div.tiles-container.info",
],
// Unexpected selectors:
["main.AW_STEP1", "main.AW_STEP3", "div.secondary-cta.top"]
["main.AW_STEP1", "main.AW_STEP3", "div.secondary-cta.top", "div.test-img"]
);
await onButtonClick(browser, "button.primary");
await test_screen_content(
Expand All @@ -321,6 +329,7 @@ add_task(async function test_multistage_aboutwelcome_experimentAPI() {
"div.brand-logo",
"div.welcome-text",
"p.helptext",
"div.test-img",
],
// Unexpected selectors:
["main.AW_STEP1", "main.AW_STEP2"]
Expand Down
1 change: 0 additions & 1 deletion browser/components/sessionstore/test/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ skip-if = fission # Bug 1572084
[browser_sizemodeBeforeMinimized.js]
[browser_tab_label_during_restore.js]
[browser_swapDocShells.js]
fail-if = sessionHistoryInParent # Bug 1602501
[browser_switch_remoteness.js]
run-if = e10s
[browser_upgrade_backup.js]
Expand Down
4 changes: 3 additions & 1 deletion browser/components/urlbar/UrlbarInput.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -2931,7 +2931,9 @@ class UrlbarInput {

// Autofill only when text is inserted (i.e., event.data is not empty) and
// it's not due to pasting.
let allowAutofill =
const allowAutofill =
(!UrlbarPrefs.get("keepPanelOpenDuringImeComposition") ||
compositionState !== UrlbarUtils.COMPOSITION.COMPOSING) &&
!!event.data &&
!UrlbarUtils.isPasteEvent(event) &&
this._maybeAutofillOnInput(value);
Expand Down
33 changes: 33 additions & 0 deletions browser/components/urlbar/tests/browser/browser_ime_composition.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ add_task(async function() {
await test_composition(val);
await test_composition_searchMode_preview(val);
await test_composition_tabToSearch(val);
await test_composition_autofill(val);
}
});

Expand Down Expand Up @@ -287,3 +288,35 @@ async function test_composition_tabToSearch(keepPanelOpenDuringImeComposition) {
});
await UrlbarTestUtils.exitSearchMode(window);
}

async function test_composition_autofill(keepPanelOpenDuringImeComposition) {
info("Check whether autofills or not");
await UrlbarTestUtils.promisePopupClose(window);

info("Check the urlbar value during composition");
composeAndCheckPanel("m", false);

if (keepPanelOpenDuringImeComposition) {
info("Wait for search suggestions");
await UrlbarTestUtils.promiseSearchComplete(window);
}

Assert.equal(
gURLBar.value,
"m",
"The urlbar value is not autofilled while turning IME on"
);

info("Check the urlbar value after committing composition");
await UrlbarTestUtils.promisePopupOpen(window, () => {
EventUtils.synthesizeComposition({
type: "compositioncommitasis",
key: { key: "KEY_Enter" },
});
});
await UrlbarTestUtils.promiseSearchComplete(window);
Assert.equal(gURLBar.value, "mozilla.org/", "The urlbar value is autofilled");

// Clean-up.
gURLBar.value = "";
}
Loading

0 comments on commit beeaa14

Please sign in to comment.