Merge mozilla-central to inbound. a=merge CLOSED TREE

This commit is contained in:
Bogdan Tara 2018-08-01 01:07:12 +03:00
Родитель b78acae439 9c44097a0d
Коммит eb256a84b2
28 изменённых файлов: 160 добавлений и 178 удалений

Просмотреть файл

@ -609,7 +609,8 @@ HistoryMenu.prototype = {
},
toggleHiddenTabs() {
if (gBrowser.visibleTabs.length < gBrowser.tabs.length) {
if (window.gBrowser &&
gBrowser.visibleTabs.length < gBrowser.tabs.length) {
this.hiddenTabsMenu.removeAttribute("hidden");
} else {
this.hiddenTabsMenu.setAttribute("hidden", "true");

Просмотреть файл

@ -2589,23 +2589,24 @@ window._gBrowser = {
removeTabs(tabs) {
let tabsWithBeforeUnload = [];
let lastToClose;
let aParams = { animate: true };
let params = { animate: true };
for (let tab of tabs) {
if (tab.selected)
if (tab.selected) {
lastToClose = tab;
else if (this._hasBeforeUnload(tab))
} else if (this._hasBeforeUnload(tab)) {
tabsWithBeforeUnload.push(tab);
else
this.removeTab(tab, aParams);
} else {
this.removeTab(tab, params);
}
}
for (let tab of tabsWithBeforeUnload) {
this.removeTab(tab, aParams);
this.removeTab(tab, params);
}
// Avoid changing the selected browser several times by removing it,
// if appropriate, lastly.
if (lastToClose) {
this.removeTab(lastToClose, aParams);
this.removeTab(lastToClose, params);
}
},

Просмотреть файл

@ -1919,10 +1919,7 @@ CustomizeMode.prototype = {
// The items in the palette are wrapped, so we need the target node's parent here:
this.visiblePalette.insertBefore(draggedItem, aTargetNode.parentNode);
}
if (aOriginArea.id !== kPaletteId) {
// The dragend event already fires when the item moves within the palette.
this._onDragEnd(aEvent);
}
return;
}
@ -2025,6 +2022,8 @@ CustomizeMode.prototype = {
/**
* To workaround bug 460801 we manually forward the drop event here when dragend wouldn't be fired.
*
* Note that that means that this function may be called multiple times by a single drag operation.
*/
_onDragEnd(aEvent) {
if (this._isUnwantedDragDrop(aEvent)) {

Просмотреть файл

@ -32,7 +32,7 @@ class ContextMenusClickPropHandler {
// No need for runSafe or anything because we are already being run inside
// an event handler -- the event is just being forwarded to the actual
// handler.
onclick(info, tab);
withHandlingUserInput(this.context.contentWindow, () => onclick(info, tab));
}
}

Просмотреть файл

@ -210,7 +210,6 @@ skip-if = os == 'mac' # Save as PDF not supported on Mac OS X
[browser_ext_themes_validation.js]
[browser_ext_url_overrides_newtab.js]
[browser_ext_user_events.js]
skip-if = debug || os == "linux" #Bug 1381305
[browser_ext_webRequest.js]
[browser_ext_webNavigation_frameId0.js]
[browser_ext_webNavigation_getFrames.js]

Просмотреть файл

@ -48,20 +48,29 @@ add_task(async function testSources() {
browser.pageAction.onClicked.addListener(() => request("bookmarks"));
browser.browserAction.onClicked.addListener(() => request("tabs"));
browser.contextMenus.create({
id: "menu",
title: "test user events",
contexts: ["page"],
});
browser.contextMenus.onClicked.addListener(() => request("webNavigation"));
browser.test.onMessage.addListener(msg => {
if (msg === "contextMenus.update") {
browser.contextMenus.onClicked.addListener(() => request("webNavigation"));
browser.contextMenus.update("menu", {
title: "test user events in onClicked",
onclick: null,
}, () => browser.test.sendMessage("contextMenus.update-done"));
}
if (msg === "openOptionsPage") {
browser.runtime.openOptionsPage();
}
});
browser.contextMenus.create({
id: "menu",
title: "test user events in onclick",
contexts: ["page"],
onclick() {
request("cookies");
},
}, () => {
browser.test.sendMessage("actions-ready");
});
},
files: {
@ -111,7 +120,7 @@ add_task(async function testSources() {
browser_action: {default_title: "test"},
page_action: {default_title: "test"},
permissions: ["contextMenus"],
optional_permissions: ["bookmarks", "tabs", "webNavigation", "webRequest"],
optional_permissions: ["bookmarks", "tabs", "webNavigation", "webRequest", "cookies"],
options_ui: {page: "options.html"},
content_security_policy: "script-src 'self' https://example.com; object-src 'none';",
},
@ -153,15 +162,23 @@ add_task(async function testSources() {
gBrowser.selectedTab = tab;
let menu = await openContextMenu("body");
let items = menu.getElementsByAttribute("label", "test user events");
let items = menu.getElementsByAttribute("label", "test user events in onclick");
is(items.length, 1, "Found context menu item");
EventUtils.synthesizeMouseAtCenter(items[0], {});
await check("context menu click");
await check("context menu in onclick");
extension.sendMessage("contextMenus.update");
await extension.awaitMessage("contextMenus.update-done");
menu = await openContextMenu("body");
items = menu.getElementsByAttribute("label", "test user events in onClicked");
is(items.length, 1, "Found context menu item again");
EventUtils.synthesizeMouseAtCenter(items[0], {});
await check("context menu in onClicked");
extension.sendMessage("openOptionsPage");
promisePopupNotificationShown("addon-webext-permissions").then(panel => {
panel.button.click();
});
extension.sendMessage("openOptionsPage");
await check("options page link click");
await BrowserTestUtils.removeTab(gBrowser.selectedTab);

Просмотреть файл

@ -308,28 +308,12 @@ WebContentConverterRegistrar.prototype = {
browser.contentWindow == aContentWindow);
},
/**
* See nsIFactory
*/
createInstance(outer, iid) {
if (outer != null)
throw Cr.NS_ERROR_NO_AGGREGATION;
return this.QueryInterface(iid);
},
classID: WCCR_CLASSID,
/**
* See nsISupports
*/
QueryInterface: ChromeUtils.generateQI(
[Ci.nsIWebContentHandlerRegistrar,
Ci.nsIFactory]),
_xpcom_categories: [{
category: "app-startup",
service: true
}]
QueryInterface: ChromeUtils.generateQI([Ci.nsIWebContentHandlerRegistrar]),
};
function WebContentConverterRegistrarContent() {
@ -355,23 +339,12 @@ WebContentConverterRegistrarContent.prototype = {
title: aTitle });
},
/**
* See nsIFactory
*/
createInstance(outer, iid) {
if (outer != null)
throw Cr.NS_ERROR_NO_AGGREGATION;
return this.QueryInterface(iid);
},
classID: WCCR_CLASSID,
/**
* See nsISupports
*/
QueryInterface: ChromeUtils.generateQI(
[Ci.nsIWebContentHandlerRegistrar,
Ci.nsIFactory])
QueryInterface: ChromeUtils.generateQI([Ci.nsIWebContentHandlerRegistrar])
};
this.NSGetFactory =

Просмотреть файл

@ -102,7 +102,6 @@ AboutNewTabService.prototype = {
Ci.nsIAboutNewTabService,
Ci.nsIObserver
]),
_xpcom_categories: [{service: true}],
observe(subject, topic, data) {
switch (topic) {

Просмотреть файл

@ -670,7 +670,7 @@ a.learn-more-link.webconsole-learn-more-link {
}
.webconsole-output-wrapper .message-flex-body > .message-body {
overflow-x: auto;
overflow: hidden;
}
.webconsole-output-wrapper .message-body > * {

Просмотреть файл

@ -21,6 +21,12 @@ add_task(async function() {
hud.ui.window.document.querySelector(".devtools-clear-icon").click();
await onBrowserConsoleOutputCleared;
// Check that there are no other messages logged (see Bug 1457478).
// Log a message to make sure the console handled any prior log.
await logTextToConsole(hud, "after clear");
const messages = hud.ui.outputNode.querySelectorAll(".message");
is(messages.length, 1, "There is only the new message in the output");
info("Close and re-open the browser console");
await HUDService.toggleBrowserConsole();
hud = await HUDService.toggleBrowserConsole();

Просмотреть файл

@ -1167,7 +1167,6 @@ WebConsoleActor.prototype =
});
if (this.parentActor.isRootActor) {
Services.console.logStringMessage(null); // for the Error Console
Services.console.reset();
}
return {};

Просмотреть файл

@ -1013,18 +1013,22 @@ Proxy::HandleEvent(Event* aEvent)
RefPtr<EventRunnable> runnable;
if (progressEvent) {
if (!mIsSyncXHR || !type.EqualsASCII(sEventStrings[STRING_progress])) {
runnable = new EventRunnable(this, isUploadTarget, type,
progressEvent->LengthComputable(),
progressEvent->Loaded(),
progressEvent->Total(),
scope);
}
}
else {
runnable = new EventRunnable(this, isUploadTarget, type, scope);
}
if (runnable) {
runnable->Dispatch();
}
}
if (!isUploadTarget) {
if (type.EqualsASCII(sEventStrings[STRING_loadstart])) {
@ -1741,6 +1745,11 @@ XMLHttpRequestWorker::DispatchPrematureAbortEvent(EventTarget* aTarget,
event->InitEvent(aEventType, false, false);
}
else {
if (mProxy->mIsSyncXHR &&
aEventType.EqualsASCII(sEventStrings[STRING_progress])) {
return;
}
ProgressEventInit init;
init.mBubbles = false;
init.mCancelable = false;

Просмотреть файл

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html class="reftest-wait"><body>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 966 520">
<defs>
<filter id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="11" result="blur"></feGaussianBlur>
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 21 -9"></feColorMatrix>
<feBlend></feBlend>
</filter>
<path id="bean" d="M468,146.24c8,4.81,3.39,13.19,10.53,14.61s21.48-.6,21.77,9.12c.23,8-18.6,18.21-38,9.64-12-5.29-16.84-17.93-15.69-25.65C448.27,142.45,460.86,142,468,146.24Z"></path>
</defs>
<g filter="url(#goo)" clip-path="url(#worldMapMask)" opacity="0.1" fill="#3ac0f0" style="opacity: 0.054;">
<use id="animated" xlink:href="#bean" style="transform-origin: 0px 0px 0px;" transform="matrix(0.40499,0,0,0.40499,281.6573805236819,97.17512744903576)"></use>
</g>
</svg>
<script>
var animated = document.getElementById('animated');
var transforms = [
'matrix(0.40499,0,0,0.40499,281.65738000000005,97.17513000000001)',
'matrix(0,0,0,0,473.36901451812747,163.31791128669738)',
'matrix(0.40499,0,0,0.40499,281.65738000000005,97.17513000000001)',
'matrix(0,0,0,0,473.36901451812747,163.31791128669738)',
'matrix(9,0,0,9,-3786.9947244955442,-1306.5579660936737)',
'matrix(0,0,0,0,473.36901451812747,163.31791128669738)',
'matrix(3,0,0,3,-946.7522318197632,-326.64071450675965)'
];
var index = 0;
function nextFrame() {
animated.setAttribute('transform', transforms[index]);
index++;
if (index < transforms.length) {
requestAnimationFrame(nextFrame);
} else {
document.documentElement.classList.remove('reftest-wait');
}
}
window.addEventListener('load', nextFrame);
</script>
</body></html>

Просмотреть файл

@ -167,3 +167,4 @@ load 1408078-1.html
load 1464243.html
load 1467847-1.html
load 1468020.html
load 1478035.html

Просмотреть файл

@ -54,28 +54,6 @@
* classDescription: "unique text description",
* contractID: "@example.com/xxx;1",
*
* // [optional] an array of categories to register this component in.
* _xpcom_categories: [{
* // Each object in the array specifies the parameters to pass to
* // nsICategoryManager.addCategoryEntry(). 'true' is passed for
* // both aPersist and aReplace params.
* category: "some-category",
* // optional, defaults to the object's classDescription
* entry: "entry name",
* // optional, defaults to the object's contractID (unless
* // 'service' is specified)
* value: "...",
* // optional, defaults to false. When set to true, and only if 'value'
* // is not specified, the concatenation of the string "service," and the
* // object's contractID is passed as aValue parameter of addCategoryEntry.
* service: true,
* // optional, it can be an array of applications' IDs in the form:
* // [ "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", ... ]
* // If defined the component will be registered in this category only for
* // the provided applications.
* apps: [...]
* }],
*
* // ...component implementation...
* };
*

Просмотреть файл

@ -1493,6 +1493,11 @@ MediaPipelineTransmit::UpdateSinkIdentity_m(const MediaStreamTrack* aTrack,
return;
}
if (!mDomTrack) {
// Nothing to do here
return;
}
bool enableTrack = aPrincipal->Subsumes(mDomTrack->GetPrincipal());
if (!enableTrack) {
// first try didn't work, but there's a chance that this is still available

Просмотреть файл

@ -125,7 +125,7 @@ TransceiverImpl::UpdateSinkIdentity(const dom::MediaStreamTrack* aTrack,
nsIPrincipal* aPrincipal,
const PeerIdentity* aSinkIdentity)
{
if (!(mJsepTransceiver->mJsDirection & sdp::kSend)) {
if (mJsepTransceiver->IsStopped()) {
return NS_OK;
}

Просмотреть файл

@ -268,10 +268,7 @@ class GeckoViewContent extends GeckoViewModule {
finder.caseSensitive = !!aData.matchCase;
finder.entireWord = !!aData.wholeWord;
if (aCallback) {
finder.addResultListener(this._finderListener);
}
const drawOutline = this._matchDisplayOptions &&
!!this._matchDisplayOptions.drawOutline;
@ -290,9 +287,21 @@ class GeckoViewContent extends GeckoViewModule {
}
_clearMatches() {
debug `clearMatches`;
let finder;
try {
this.browser.finder.removeSelection();
finder = this.browser.finder;
} catch (e) {
return;
}
finder.removeSelection();
finder.highlight(false);
if (this._finderListener) {
finder.removeResultListener(this._finderListener);
this._finderListener = null;
}
}
@ -310,15 +319,15 @@ class GeckoViewContent extends GeckoViewModule {
finder.onModalHighlightChange(!!aData.dimPage);
finder.onHighlightAllChange(!!aData.highlightAll);
if (!finder.searchString) {
return;
}
if (!aData.highlightAll && !aData.dimPage) {
finder.highlight(false);
return;
}
const linksOnly = this._finderListener &&
this._finderListener.response.linksOnly;
if (!this._finderListener || !finder.searchString) {
return;
}
const linksOnly = this._finderListener.response.linksOnly;
finder.highlight(true, finder.searchString, linksOnly, !!aData.drawOutline);
}
}

Просмотреть файл

@ -532,15 +532,9 @@ Marionette.prototype = {
classID: Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}"),
contractID: "@mozilla.org/remote/marionette;1",
/* eslint-disable camelcase */
/* eslint-disable-next-line camelcase */
_xpcom_factory: MarionetteFactory,
_xpcom_categories: [
{category: "command-line-handler", entry: "b-marionette"},
{category: "profile-after-change", service: true},
],
/* eslint-enable camelcase */
helpInfo: " --marionette Enable remote control server.\n",
};

Просмотреть файл

@ -1,4 +0,0 @@
[sync-no-progress.any.worker.html]
[progress event should not be fired by sync XHR]
expected: FAIL

Просмотреть файл

@ -0,0 +1,2 @@
def map_files_to_multiline_text(files):
return "\n".join(map(lambda f: str(f), files))

Просмотреть файл

@ -1,18 +1,6 @@
import pytest
@pytest.fixture
def create_file(tmpdir_factory):
def inner(filename):
fh = tmpdir_factory.mktemp("tmp").join(filename)
fh.write(filename)
return fh
inner.__name__ = "create_file"
return inner
@pytest.fixture
def create_files(tmpdir_factory):
def inner(filenames):

Просмотреть файл

@ -5,9 +5,10 @@ from tests.support.asserts import (
assert_events_equal,
assert_success,
)
from tests.support.inline import inline
from . import map_files_to_multiline_text
@pytest.fixture
def tracked_events():
@ -30,19 +31,19 @@ def element_send_keys(session, element, text):
{"text": text})
def test_file_upload(session, create_file, add_event_listeners, tracked_events):
def test_file_upload(session, create_files, add_event_listeners, tracked_events):
expected_events = [
"input",
"change",
]
single_file = create_file("foo")
files = create_files(["foo", "bar"])
session.url = inline("<input type=file multiple>")
element = session.find.css("input", all=False)
add_event_listeners(element, tracked_events)
response = element_send_keys(session, element, str(single_file))
response = element_send_keys(session, element, map_files_to_multiline_text(files))
assert_success(response)
assert_events_equal(session, expected_events)

Просмотреть файл

@ -1,9 +1,7 @@
from tests.support.asserts import assert_error, assert_files_uploaded, assert_success
from tests.support.inline import inline
def map_files_to_multiline_text(files):
return "\n".join(map(lambda f: str(f), files))
from . import map_files_to_multiline_text
def element_send_keys(session, element, text):
@ -35,19 +33,6 @@ def test_multiple_files(session, create_files):
assert_files_uploaded(session, element, files)
def test_multiple_files_multiple_directories(session, create_file):
files = [create_file("foo"), create_file("bar")]
session.url = inline("<input type=file multiple>")
element = session.find.css("input", all=False)
response = element_send_keys(session, element,
map_files_to_multiline_text(files))
assert_success(response)
assert_files_uploaded(session, element, files)
def test_multiple_files_last_path_not_found(session, create_files):
files = create_files(["foo", "bar"])
files.append("foo bar")
@ -115,32 +100,31 @@ def test_multiple_files_reset_with_element_clear(session, create_files):
assert_files_uploaded(session, element, second_files)
def test_single_file(session, create_file):
single_file = create_file("foo")
def test_single_file(session, create_files):
files = create_files(["foo"])
session.url = inline("<input type=file>")
element = session.find.css("input", all=False)
response = element_send_keys(session, element, str(single_file))
response = element_send_keys(session, element, str(files[0]))
assert_success(response)
assert_files_uploaded(session, element, [single_file])
assert_files_uploaded(session, element, files)
def test_single_file_replaces_without_multiple_attribute(session, create_file):
first_file = create_file("foo")
second_file = create_file("bar")
def test_single_file_replaces_without_multiple_attribute(session, create_files):
files = create_files(["foo", "bar"])
session.url = inline("<input type=file>")
element = session.find.css("input", all=False)
response = element_send_keys(session, element, str(first_file))
response = element_send_keys(session, element, str(files[0]))
assert_success(response)
response = element_send_keys(session, element, str(second_file))
response = element_send_keys(session, element, str(files[1]))
assert_success(response)
assert_files_uploaded(session, element, [second_file])
assert_files_uploaded(session, element, [files[1]])
def test_single_file_appends_with_multiple_attribute(session, create_files):
@ -156,19 +140,3 @@ def test_single_file_appends_with_multiple_attribute(session, create_files):
assert_success(response)
assert_files_uploaded(session, element, files)
def test_single_file_multiple_directory_appends_with_multiple_attribute(session, create_file):
first_file = create_file("foo")
second_file = create_file("bar")
session.url = inline("<input type=file multiple>")
element = session.find.css("input", all=False)
response = element_send_keys(session, element, str(first_file))
assert_success(response)
response = element_send_keys(session, element, str(second_file))
assert_success(response)
assert_files_uploaded(session, element, [first_file, second_file])

Просмотреть файл

@ -18,9 +18,6 @@ function PageThumbsStorageService() {}
PageThumbsStorageService.prototype = {
classID: Components.ID("{97943eec-0e48-49ef-b7b7-cf4aa0109bb6}"),
QueryInterface: ChromeUtils.generateQI([Ci.nsIPageThumbsStorageService]),
_xpcom_categories: [{
service: true
}],
// The path for the storage
_path: null,
get path() {

Просмотреть файл

@ -30,15 +30,11 @@ interface nsIUpdateTimerManager : nsISupports
*
* Note: to avoid having to instantiate a component to call registerTimer
* the component can intead register an update-timer category with comma
* separated values as a single string representing the timer as follows.
* separated values as a single string:
*
* _xpcom_categories: [{ category: "update-timer",
* value: "contractID," +
* "method," +
* "id," +
* "preference," +
* "interval" }],
* the values are as follows
* contractID,method,id,preference,interval
*
* via a manifest entry. The values are as follows:
* contractID : the contract ID for the component.
* method : the method used to instantiate the interface. This should be
* either getService or createInstance depending on your

Просмотреть файл

@ -52,7 +52,7 @@ let ProcessObserver = {
let registeredURLs = Services.cpmm.sharedData.get("RemotePageManager:urls");
if (!registeredURLs.has(url))
if (!registeredURLs || !registeredURLs.has(url))
return;
// Get the frame message manager for this window so we can associate this

Просмотреть файл

@ -2095,6 +2095,10 @@ nsChildView::AddWindowOverlayWebRenderCommands(layers::WebRenderBridgeChild* aWr
{
PrepareWindowEffects();
if (!mIsCoveringTitlebar || mIsFullscreen || mTitlebarRect.IsEmpty()) {
return;
}
bool needUpdate = mUpdatedTitlebarRegion.Intersects(mTitlebarRect);
mUpdatedTitlebarRegion.SetEmpty();