зеркало из https://github.com/mozilla/gecko-dev.git
Merge inbound to mozilla-central a=merge
This commit is contained in:
Коммит
374b919ce6
|
@ -7,5 +7,6 @@ support-files =
|
|||
|
||||
[browser_test_docload.js]
|
||||
skip-if = e10s
|
||||
[browser_test_textcaret.js]
|
||||
[browser_test_focus_browserui.js]
|
||||
[browser_test_focus_dialog.js]
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Caret move events checker.
|
||||
*/
|
||||
function caretMoveChecker(target, caretOffset) {
|
||||
return function(event) {
|
||||
let cmEvent = event.QueryInterface(nsIAccessibleCaretMoveEvent);
|
||||
return cmEvent.accessible == getAccessible(target) && cmEvent.caretOffset == caretOffset;
|
||||
};
|
||||
}
|
||||
|
||||
async function checkURLBarCaretEvents() {
|
||||
let url = "about:mozilla";
|
||||
|
||||
let onDocLoad = waitForEvent(
|
||||
EVENT_DOCUMENT_LOAD_COMPLETE,
|
||||
event => {
|
||||
try {
|
||||
return event.accessible.QueryInterface(nsIAccessibleDocument).URL == url;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
let [ newWin ] = await Promise.all([
|
||||
BrowserTestUtils.openNewBrowserWindow({ url }),
|
||||
onDocLoad
|
||||
]);
|
||||
|
||||
let urlbarInputEl = newWin.document.getElementById("urlbar").inputField;
|
||||
let urlbarInput = getAccessible(urlbarInputEl, [ nsIAccessibleText ]);
|
||||
|
||||
let onCaretMove = waitForEvents([
|
||||
[ EVENT_TEXT_CARET_MOVED, caretMoveChecker(urlbarInput, url.length) ],
|
||||
[ EVENT_FOCUS, urlbarInput ]
|
||||
]);
|
||||
|
||||
urlbarInput.caretOffset = -1;
|
||||
await onCaretMove;
|
||||
ok(true, "Caret move in URL bar #1");
|
||||
|
||||
onCaretMove = waitForEvent(
|
||||
EVENT_TEXT_CARET_MOVED, caretMoveChecker(urlbarInput, 0)
|
||||
);
|
||||
|
||||
urlbarInput.caretOffset = 0;
|
||||
await onCaretMove;
|
||||
ok(true, "Caret move in URL bar #2");
|
||||
|
||||
await BrowserTestUtils.closeWindow(newWin);
|
||||
}
|
||||
|
||||
add_task(checkURLBarCaretEvents);
|
|
@ -2,5 +2,4 @@
|
|||
support-files =
|
||||
!/accessible/tests/mochitest/*.js
|
||||
|
||||
[test_browserui.xul]
|
||||
[test_general.html]
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="Accessibility Caret Offset Test.">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../browser.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Tests
|
||||
|
||||
gA11yEventDumpToConsole = true; // debug
|
||||
//enableLogging("tree,verbose");
|
||||
|
||||
var gQueue = null;
|
||||
function doTests()
|
||||
{
|
||||
gQueue = new eventQueue();
|
||||
gQueue.push(new setCaretOffset(urlbarInput(), -1, urlbarInput()));
|
||||
gQueue.push(new setCaretOffset(urlbarInput(), 0));
|
||||
gQueue.onFinish = function()
|
||||
{
|
||||
closeBrowserWindow();
|
||||
}
|
||||
|
||||
gQueue.invoke();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
openBrowserWindow(doTests, "about:mozilla");
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<vbox flex="1" style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=723833"
|
||||
title="IAccessibleText::setCaretOffset on location or search bar causes focus to jump">
|
||||
Bug 723833
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</vbox>
|
||||
</window>
|
|
@ -18,6 +18,13 @@ xpidl_cachedir = mozpath.join(buildconfig.topobjdir, 'xpcom', 'idl-parser',
|
|||
sys.path.extend([xpidl_dir, xpidl_cachedir])
|
||||
import xpidl
|
||||
|
||||
# Load the webidl configuration file.
|
||||
glbl = {}
|
||||
execfile(mozpath.join(buildconfig.topsrcdir,
|
||||
'dom', 'bindings', 'Bindings.conf'),
|
||||
glbl)
|
||||
webidlconfig = glbl['DOMInterfaces']
|
||||
|
||||
# Instantiate the parser.
|
||||
p = xpidl.IDLParser()
|
||||
|
||||
|
@ -34,7 +41,7 @@ def loadEventIDL(parser, includePath, eventname):
|
|||
eventidl = ("nsIAccessible%s.idl" % eventname)
|
||||
idlFile = findIDL(includePath, eventidl)
|
||||
idl = p.parse(open(idlFile).read(), idlFile)
|
||||
idl.resolve(includePath, p)
|
||||
idl.resolve(includePath, p, webidlconfig)
|
||||
return idl, idlFile
|
||||
|
||||
class Configuration:
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
installer:
|
||||
@$(MAKE) -C browser/installer installer
|
||||
|
||||
package:
|
||||
@$(MAKE) -C browser/installer
|
||||
|
||||
|
|
|
@ -136,7 +136,6 @@ disabled = bug 1438663
|
|||
[browser_ext_sessions_restore.js]
|
||||
[browser_ext_sessions_window_tab_value.js]
|
||||
[browser_ext_settings_overrides_default_search.js]
|
||||
[browser_ext_settings_overrides_search.js]
|
||||
[browser_ext_sidebarAction.js]
|
||||
[browser_ext_sidebarAction_browser_style.js]
|
||||
[browser_ext_sidebarAction_context.js]
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
|
||||
let delay = () => new Promise(resolve => setTimeout(resolve, 0));
|
||||
|
||||
const kSearchEngineURL = "https://example.com/?search={searchTerms}";
|
||||
const kSearchSuggestURL = "http://example.com/?suggest={searchTerms}";
|
||||
|
@ -10,6 +14,14 @@ const kSearchTerm = "foo";
|
|||
const kSearchTermIntl = "日";
|
||||
const URLTYPE_SUGGEST_JSON = "application/x-suggestions+json";
|
||||
|
||||
AddonTestUtils.init(this);
|
||||
AddonTestUtils.createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "42", "42");
|
||||
|
||||
add_task(async function setup() {
|
||||
await AddonTestUtils.promiseStartupManager();
|
||||
Services.search.init();
|
||||
});
|
||||
|
||||
add_task(async function test_extension_adding_engine() {
|
||||
let ext1 = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
|
@ -34,11 +46,12 @@ add_task(async function test_extension_adding_engine() {
|
|||
let submissionSuggest = engine.getSubmission(kSearchTerm, URLTYPE_SUGGEST_JSON);
|
||||
let encodedSubmissionURL = engine.getSubmission(kSearchTermIntl).uri.spec;
|
||||
let testSubmissionURL = kSearchEngineURL.replace("{searchTerms}", encodeURIComponent(kSearchTermIntl));
|
||||
is(encodedSubmissionURL, testSubmissionURL, "Encoded UTF-8 URLs should match");
|
||||
equal(encodedSubmissionURL, testSubmissionURL, "Encoded UTF-8 URLs should match");
|
||||
|
||||
is(submissionSuggest.uri.spec, expectedSuggestURL, "Suggest URLs should match");
|
||||
equal(submissionSuggest.uri.spec, expectedSuggestURL, "Suggest URLs should match");
|
||||
|
||||
await ext1.unload();
|
||||
await delay();
|
||||
|
||||
engine = Services.search.getEngineByName("MozSearch");
|
||||
ok(!engine, "Engine should not exist");
|
||||
|
@ -64,6 +77,7 @@ add_task(async function test_extension_adding_engine_with_spaces() {
|
|||
ok(engine, "Engine should exist.");
|
||||
|
||||
await ext1.unload();
|
||||
await delay();
|
||||
|
||||
engine = Services.search.getEngineByName("MozSearch");
|
||||
ok(!engine, "Engine should not exist");
|
||||
|
@ -90,7 +104,13 @@ add_task(async function test_upgrade_default_position_engine() {
|
|||
useAddonManager: "temporary",
|
||||
});
|
||||
|
||||
let ext2 = ExtensionTestUtils.loadExtension({
|
||||
await ext1.startup();
|
||||
|
||||
let engine = Services.search.getEngineByName("MozSearch");
|
||||
Services.search.currentEngine = engine;
|
||||
Services.search.moveEngine(engine, 1);
|
||||
|
||||
await ext1.upgrade({
|
||||
manifest: {
|
||||
"chrome_settings_overrides": {
|
||||
"search_provider": {
|
||||
|
@ -109,20 +129,12 @@ add_task(async function test_upgrade_default_position_engine() {
|
|||
useAddonManager: "temporary",
|
||||
});
|
||||
|
||||
await ext1.startup();
|
||||
|
||||
let engine = Services.search.getEngineByName("MozSearch");
|
||||
Services.search.currentEngine = engine;
|
||||
Services.search.moveEngine(engine, 1);
|
||||
|
||||
await ext2.startup();
|
||||
|
||||
engine = Services.search.getEngineByName("MozSearch");
|
||||
is(Services.search.currentEngine, engine, "Default engine should still be MozSearch");
|
||||
is(Services.search.getEngines().indexOf(engine), 1, "Engine is in position 1");
|
||||
equal(Services.search.currentEngine, engine, "Default engine should still be MozSearch");
|
||||
equal(Services.search.getEngines().indexOf(engine), 1, "Engine is in position 1");
|
||||
|
||||
await ext2.unload();
|
||||
await ext1.unload();
|
||||
await delay();
|
||||
|
||||
engine = Services.search.getEngineByName("MozSearch");
|
||||
ok(!engine, "Engine should not exist");
|
|
@ -7,6 +7,7 @@
|
|||
[test_ext_chrome_settings_overrides_update.js]
|
||||
[test_ext_geckoProfiler_control.js]
|
||||
[test_ext_history.js]
|
||||
[test_ext_settings_overrides_search.js]
|
||||
[test_ext_url_overrides_newtab.js]
|
||||
[test_ext_url_overrides_newtab_update.js]
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
/* global sinon */
|
||||
Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js");
|
||||
|
||||
registerCleanupFunction(function* () {
|
||||
registerCleanupFunction(async function() {
|
||||
// Cleanup window or the test runner will throw an error
|
||||
delete window.sinon;
|
||||
});
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_INSTALLER=0
|
||||
MOZ_AUTOMATION_L10N_CHECK=0
|
||||
MOZ_AUTOMATION_PACKAGE=0
|
||||
MOZ_AUTOMATION_PACKAGE_TESTS=0
|
||||
|
|
|
@ -173,11 +173,6 @@ package-compare::
|
|||
-diff -u $(DIST)/pack-list.txt $(DIST)/bin-list.txt
|
||||
rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt
|
||||
|
||||
installer::
|
||||
ifdef INSTALLER_DIR
|
||||
$(MAKE) -C $(INSTALLER_DIR)
|
||||
endif
|
||||
|
||||
ifdef ENABLE_MARIONETTE
|
||||
DEFINES += -DENABLE_MARIONETTE=1
|
||||
endif
|
||||
|
|
|
@ -44,24 +44,6 @@ else
|
|||
PPL_LOCALE_ARGS=$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer
|
||||
endif
|
||||
|
||||
OVERRIDE_DEFAULT_GOAL := installer
|
||||
installer::
|
||||
$(MAKE) -C .. installer-stage
|
||||
$(MAKE) $(CONFIG_DIR)/setup.exe
|
||||
|
||||
# For building the uninstaller during the application build so it can be
|
||||
# included for mar file generation.
|
||||
uninstaller::
|
||||
$(RM) -r $(CONFIG_DIR)
|
||||
$(MKDIR) $(CONFIG_DIR)
|
||||
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
|
||||
$(INSTALL) $(addprefix $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/,$(BRANDING_FILES)) $(CONFIG_DIR)
|
||||
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
|
||||
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
|
||||
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
|
||||
--preprocess-locale $(topsrcdir) \
|
||||
$(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
|
||||
|
||||
# For building the maintenanceservice installer
|
||||
ifdef MOZ_MAINTENANCE_SERVICE
|
||||
maintenanceservice_installer::
|
||||
|
|
|
@ -34,7 +34,6 @@ MOZ_PKG_MAC_EXTRA=--symlink '/Applications:/ '
|
|||
endif
|
||||
|
||||
MOZ_SFX_PACKAGE=$(topsrcdir)/other-licenses/7zstub/firefox/7zSD.sfx
|
||||
MOZ_INSTALLER_PATH=$(topsrcdir)/browser/installer/windows
|
||||
|
||||
SEARCHPLUGINS_FILENAMES := $(or $(shell $(call py_action,output_searchplugins_list,$(srcdir)/search/list.json $(AB_CD))), $(error Missing search plugins))
|
||||
SEARCHPLUGINS_PATH := .deps/generated_$(AB_CD)
|
||||
|
@ -107,26 +106,8 @@ endif
|
|||
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$*
|
||||
@$(MAKE) -C ../extensions/webcompat-reporter/locales chrome AB_CD=$*
|
||||
|
||||
package-win32-installer: WIN32_INSTALLER_OUT=$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
|
||||
package-win32-installer: $(SUBMAKEFILES)
|
||||
@echo 'Packaging $(WIN32_INSTALLER_OUT).'
|
||||
$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx
|
||||
$(RM) -r $(STAGEDIST)/uninstall
|
||||
$(NSINSTALL) -D $(STAGEDIST)/uninstall
|
||||
cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall
|
||||
$(RM) $(ABS_DIST)/l10n-stage/setup.exe
|
||||
cp ../installer/windows/l10ngen/setup.exe $(ABS_DIST)/l10n-stage
|
||||
$(NSINSTALL) -D '$(ABS_DIST)/$(PKG_INST_PATH)'
|
||||
(cd $(DIST)/l10n-stage; \
|
||||
$(MAKE_PACKAGE))
|
||||
mv -f '$(DIST)/l10n-stage/$(PACKAGE)' '$(WIN32_INSTALLER_OUT)'
|
||||
if test -f '$(DIST)/l10n-stage/$(PACKAGE).asc'; then mv -f '$(DIST)/l10n-stage/$(PACKAGE).asc' '$(WIN32_INSTALLER_OUT).asc'; fi
|
||||
ifdef MOZ_STUB_INSTALLER
|
||||
$(RM) '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'
|
||||
cp ../installer/windows/l10ngen/stub.exe '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'
|
||||
chmod 0755 '$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe'
|
||||
endif
|
||||
|
||||
$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer
|
||||
|
||||
langpack: langpack-$(AB_CD)
|
||||
|
||||
|
@ -141,7 +122,7 @@ installers-%:
|
|||
@$(MAKE) package-langpack-$*
|
||||
@$(MAKE) repackage-zip-$*
|
||||
ifeq (WINNT,$(OS_ARCH))
|
||||
@$(MAKE) package-win32-installer AB_CD=$* MOZ_PKG_FORMAT=SFX7Z
|
||||
@$(MAKE) package-win32-installer AB_CD=$*
|
||||
endif
|
||||
@echo 'repackaging done'
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ add_task(async function testExactHostMatch() {
|
|||
}
|
||||
});
|
||||
|
||||
add_task(function* testDefaultPrefs() {
|
||||
add_task(async function testDefaultPrefs() {
|
||||
let uri = Services.io.newURI("https://example.com");
|
||||
|
||||
// Check that without a pref the default return value is UNKNOWN.
|
||||
|
|
|
@ -28,7 +28,6 @@ endif
|
|||
# corresponding the make target
|
||||
tier_MOZ_AUTOMATION_BUILD_SYMBOLS = buildsymbols
|
||||
tier_MOZ_AUTOMATION_L10N_CHECK = l10n-check
|
||||
tier_MOZ_AUTOMATION_INSTALLER = installer
|
||||
tier_MOZ_AUTOMATION_PACKAGE = package
|
||||
tier_MOZ_AUTOMATION_PACKAGE_TESTS = package-tests
|
||||
tier_MOZ_AUTOMATION_UPDATE_PACKAGING = update-packaging
|
||||
|
@ -45,7 +44,6 @@ moz_automation_symbols = \
|
|||
MOZ_AUTOMATION_BUILD_SYMBOLS \
|
||||
MOZ_AUTOMATION_UPLOAD_SYMBOLS \
|
||||
MOZ_AUTOMATION_PACKAGE \
|
||||
MOZ_AUTOMATION_INSTALLER \
|
||||
MOZ_AUTOMATION_UPDATE_PACKAGING \
|
||||
MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES \
|
||||
MOZ_AUTOMATION_L10N_CHECK \
|
||||
|
@ -57,22 +55,15 @@ MOZ_AUTOMATION_TIERS := $(foreach sym,$(moz_automation_symbols),$(if $(filter 1,
|
|||
automation/uploadsymbols: automation/buildsymbols
|
||||
|
||||
automation/update-packaging: automation/package
|
||||
automation/update-packaging: automation/installer
|
||||
|
||||
automation/l10n-check: automation/package
|
||||
automation/l10n-check: automation/installer
|
||||
|
||||
automation/upload: automation/installer
|
||||
automation/upload: automation/package
|
||||
automation/upload: automation/package-tests
|
||||
automation/upload: automation/buildsymbols
|
||||
automation/upload: automation/update-packaging
|
||||
automation/upload: automation/package-generated-sources
|
||||
|
||||
# The installer and packager all run stage-package, and may conflict
|
||||
# with each other.
|
||||
automation/installer: automation/package
|
||||
|
||||
automation/build: $(addprefix automation/,$(MOZ_AUTOMATION_TIERS))
|
||||
@echo Automation steps completed.
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ mk_add_options "export MOZ_AUTOMATION_BUILD_SYMBOLS=${MOZ_AUTOMATION_BUILD_SYMBO
|
|||
mk_add_options "export MOZ_AUTOMATION_L10N_CHECK=${MOZ_AUTOMATION_L10N_CHECK-1}"
|
||||
mk_add_options "export MOZ_AUTOMATION_PACKAGE=${MOZ_AUTOMATION_PACKAGE-1}"
|
||||
mk_add_options "export MOZ_AUTOMATION_PACKAGE_TESTS=${MOZ_AUTOMATION_PACKAGE_TESTS-1}"
|
||||
mk_add_options "export MOZ_AUTOMATION_INSTALLER=${MOZ_AUTOMATION_INSTALLER-0}"
|
||||
mk_add_options "export MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-0}"
|
||||
mk_add_options "export MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES=${MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES-1}"
|
||||
mk_add_options "export MOZ_AUTOMATION_UPLOAD=${MOZ_AUTOMATION_UPLOAD-1}"
|
||||
|
|
|
@ -7,9 +7,5 @@ if [ "x$IS_NIGHTLY" = "xyes" ]; then
|
|||
MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-1}
|
||||
fi
|
||||
|
||||
# Some builds (eg: Mulet) don't want the installer, so only set this if it
|
||||
# hasn't already been set.
|
||||
MOZ_AUTOMATION_INSTALLER=${MOZ_AUTOMATION_INSTALLER-1}
|
||||
|
||||
TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
|
||||
export MAKECAB=$TOOLTOOL_DIR/makecab.exe
|
||||
|
|
|
@ -155,6 +155,10 @@ configure:: $(configure-preqs)
|
|||
ifneq (,$(MAKEFILE))
|
||||
$(OBJDIR)/Makefile: $(OBJDIR)/config.status
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(OBJDIR)/config.status: $(CONFIG_STATUS_DEPS)
|
||||
else
|
||||
$(OBJDIR)/Makefile: $(CONFIG_STATUS_DEPS)
|
||||
|
|
|
@ -42,9 +42,6 @@ import os
|
|||
import re
|
||||
import sys
|
||||
|
||||
from mozversioncontrol import get_repository_from_env
|
||||
|
||||
|
||||
# We don't bother checking files in these directories, because they're (a) auxiliary or (b)
|
||||
# imported code that doesn't follow our coding style.
|
||||
ignored_js_src_dirs = [
|
||||
|
@ -258,23 +255,42 @@ def check_style(enable_fixup):
|
|||
non_js_inclnames = set() # type: set(inclname)
|
||||
js_names = dict() # type: dict(filename, inclname)
|
||||
|
||||
with get_repository_from_env() as repo:
|
||||
# Select the appropriate files.
|
||||
for filename in repo.get_files_in_working_directory():
|
||||
for non_js_dir in non_js_dirnames:
|
||||
if filename.startswith(non_js_dir) and filename.endswith('.h'):
|
||||
inclname = 'mozilla/' + filename.split('/')[-1]
|
||||
# Process files in js/src.
|
||||
js_src_root = os.path.join('js', 'src')
|
||||
for dirpath, dirnames, filenames in os.walk(js_src_root):
|
||||
if dirpath == js_src_root:
|
||||
# Skip any subdirectories that contain a config.status file
|
||||
# (likely objdirs).
|
||||
builddirs = []
|
||||
for dirname in dirnames:
|
||||
path = os.path.join(dirpath, dirname, 'config.status')
|
||||
if os.path.isfile(path):
|
||||
builddirs.append(dirname)
|
||||
for dirname in builddirs:
|
||||
dirnames.remove(dirname)
|
||||
for filename in filenames:
|
||||
filepath = os.path.join(dirpath, filename).replace('\\', '/')
|
||||
if not filepath.startswith(tuple(ignored_js_src_dirs)) and \
|
||||
filepath.endswith(('.c', '.cpp', '.h', '.tbl', '.msg')):
|
||||
inclname = filepath[len('js/src/'):]
|
||||
js_names[filepath] = inclname
|
||||
|
||||
# Look for header files in directories in non_js_dirnames.
|
||||
for non_js_dir in non_js_dirnames:
|
||||
for dirpath, dirnames, filenames in os.walk(non_js_dir):
|
||||
for filename in filenames:
|
||||
if filename.endswith('.h'):
|
||||
inclname = 'mozilla/' + filename
|
||||
non_js_inclnames.add(inclname)
|
||||
|
||||
if filename.startswith('js/public/') and filename.endswith('.h'):
|
||||
inclname = 'js/' + filename[len('js/public/'):]
|
||||
js_names[filename] = inclname
|
||||
|
||||
if filename.startswith('js/src/') and \
|
||||
not filename.startswith(tuple(ignored_js_src_dirs)) and \
|
||||
filename.endswith(('.c', '.cpp', '.h', '.tbl', '.msg')):
|
||||
inclname = filename[len('js/src/'):]
|
||||
js_names[filename] = inclname
|
||||
# Look for header files in js/public.
|
||||
js_public_root = os.path.join('js', 'public')
|
||||
for dirpath, dirnames, filenames in os.walk(js_public_root):
|
||||
for filename in filenames:
|
||||
if filename.endswith('.h'):
|
||||
filepath = os.path.join(dirpath, filename).replace('\\', '/')
|
||||
inclname = 'js/' + filepath[len('js/public/'):]
|
||||
js_names[filepath] = inclname
|
||||
|
||||
all_inclnames = non_js_inclnames | set(js_names.values())
|
||||
|
||||
|
@ -293,15 +309,12 @@ def check_style(enable_fixup):
|
|||
file_kind == FileKind.H or file_kind == FileKind.INL_H:
|
||||
included_h_inclnames = set() # type: set(inclname)
|
||||
|
||||
# This script is run in js/src/, so prepend '../../' to get to the root of the Mozilla
|
||||
# source tree.
|
||||
filepath = os.path.join(repo.path, filename)
|
||||
with open(filepath) as f:
|
||||
with open(filename) as f:
|
||||
code = read_file(f)
|
||||
|
||||
if enable_fixup:
|
||||
code = code.sorted(inclname)
|
||||
with open(filepath, 'w') as f:
|
||||
with open(filename, 'w') as f:
|
||||
f.write(code.to_source())
|
||||
|
||||
check_file(filename, inclname, file_kind, code, all_inclnames, included_h_inclnames)
|
||||
|
|
|
@ -413,8 +413,6 @@ ifdef MOZ_DEBUG
|
|||
JAVAC_FLAGS += -g
|
||||
endif
|
||||
|
||||
CREATE_PRECOMPLETE_CMD = $(PYTHON) $(abspath $(MOZILLA_DIR)/config/createprecomplete.py)
|
||||
|
||||
# MDDEPDIR is the subdirectory where dependency files are stored
|
||||
MDDEPDIR := .deps
|
||||
|
||||
|
|
|
@ -30,8 +30,9 @@ dist_idl_dir := $(DIST)/idl
|
|||
dist_include_dir := $(DIST)/include
|
||||
dist_xpcrs_dir := $(DIST)/xpcrs
|
||||
process_py := $(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py
|
||||
generated_file := $(topobjdir)/xpcom/typelib/xpt/XPTInfo.cpp
|
||||
code_gen_py := $(topsrcdir)/xpcom/typelib/xpt/tools/xpt.py
|
||||
generated_file := $(topobjdir)/xpcom/reflect/xptinfo/xptdata.cpp
|
||||
code_gen_py := $(topsrcdir)/xpcom/reflect/xptinfo/xptcodegen.py
|
||||
code_gen_deps := $(topsrcdir)/xpcom/reflect/xptinfo/perfecthash.py
|
||||
|
||||
# TODO we should use py_action, but that would require extra directories to be
|
||||
# in the virtualenv.
|
||||
|
@ -39,6 +40,7 @@ code_gen_py := $(topsrcdir)/xpcom/typelib/xpt/tools/xpt.py
|
|||
$(REPORT_BUILD)
|
||||
$(PYTHON_PATH) $(PLY_INCLUDE) -I$(topsrcdir)/xpcom/idl-parser -I$(DEPTH)/xpcom/idl-parser/xpidl \
|
||||
$(process_py) --cache-dir $(DEPTH)/xpcom/idl-parser/xpidl --depsdir $(idl_deps_dir) \
|
||||
--bindings-conf $(topsrcdir)/dom/bindings/Bindings.conf \
|
||||
$(dist_idl_dir) $(dist_include_dir) $(dist_xpcrs_dir) $(@D) \
|
||||
$(basename $(notdir $@)) $($(basename $(notdir $@))_deps)
|
||||
# When some IDL is added or removed, if the actual IDL file was already, or
|
||||
|
@ -65,11 +67,9 @@ endif
|
|||
|
||||
$(xpt_files): $(process_py) $(call mkdir_deps,$(idl_deps_dir) $(dist_include_dir) $(dist_xpcrs_dir))
|
||||
|
||||
$(generated_file): $(xpt_files) $(code_gen_py)
|
||||
$(generated_file): $(xpt_files) $(code_gen_py) $(code_gen_deps)
|
||||
$(REPORT_BUILD)
|
||||
$(PYTHON_PATH) $(PLY_INCLUDE) \
|
||||
$(code_gen_py) linkgen \
|
||||
$(generated_file) $(xpt_files)
|
||||
$(PYTHON_PATH) $(PLY_INCLUDE) $(code_gen_py) $(generated_file) $(xpt_files)
|
||||
|
||||
-include $(depends_files)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
const { parseFileUri } =
|
||||
require("devtools/client/aboutdebugging/modules/addon");
|
||||
|
||||
add_task(function* testParseFileUri() {
|
||||
add_task(async function testParseFileUri() {
|
||||
equal(
|
||||
parseFileUri("file:///home/me/my-extension/"),
|
||||
"/home/me/my-extension/",
|
||||
|
|
|
@ -14,15 +14,15 @@ const SHEET_B = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetB.css";
|
|||
const SHEET_C = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetC.css";
|
||||
const SHEET_D = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetD.css";
|
||||
|
||||
add_task(function* () {
|
||||
let options = yield helpers.openTab(PAGE_3);
|
||||
yield helpers.openToolbar(options);
|
||||
add_task(async function() {
|
||||
let options = await helpers.openTab(PAGE_3);
|
||||
await helpers.openToolbar(options);
|
||||
|
||||
let usage = yield csscoverage.getUsage(options.target);
|
||||
let usage = await csscoverage.getUsage(options.target);
|
||||
|
||||
yield navigate(usage, options);
|
||||
yield checkPages(usage);
|
||||
yield checkEditorReport(usage);
|
||||
await navigate(usage, options);
|
||||
await checkPages(usage);
|
||||
await checkEditorReport(usage);
|
||||
// usage.createPageReport is not supported for usage.oneshot data as of
|
||||
// bug 1035300 because the page report assumed we have preload data which
|
||||
// oneshot can't gather. The ideal solution is to have a special no-preload
|
||||
|
@ -30,17 +30,17 @@ add_task(function* () {
|
|||
// function, we're currently not supporting page report for oneshot data
|
||||
// yield checkPageReport(usage);
|
||||
|
||||
yield helpers.closeToolbar(options);
|
||||
yield helpers.closeTab(options);
|
||||
await helpers.closeToolbar(options);
|
||||
await helpers.closeTab(options);
|
||||
});
|
||||
|
||||
/**
|
||||
* Just check current page
|
||||
*/
|
||||
function* navigate(usage, options) {
|
||||
async function navigate(usage, options) {
|
||||
ok(!usage.isRunning(), "csscoverage is not running");
|
||||
|
||||
yield usage.oneshot();
|
||||
await usage.oneshot();
|
||||
|
||||
ok(!usage.isRunning(), "csscoverage is still not running");
|
||||
}
|
||||
|
@ -48,24 +48,24 @@ function* navigate(usage, options) {
|
|||
/**
|
||||
* Check the expected pages have been visited
|
||||
*/
|
||||
function* checkPages(usage) {
|
||||
async function checkPages(usage) {
|
||||
let expectedVisited = [ PAGE_3 ];
|
||||
let actualVisited = yield usage._testOnlyVisitedPages();
|
||||
let actualVisited = await usage._testOnlyVisitedPages();
|
||||
isEqualJson(actualVisited, expectedVisited, "Visited");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that createEditorReport returns the expected JSON
|
||||
*/
|
||||
function* checkEditorReport(usage) {
|
||||
async function checkEditorReport(usage) {
|
||||
// Page1
|
||||
let expectedPage1 = { reports: [] };
|
||||
let actualPage1 = yield usage.createEditorReport(PAGE_1 + " \u2192 <style> index 0");
|
||||
let actualPage1 = await usage.createEditorReport(PAGE_1 + " \u2192 <style> index 0");
|
||||
isEqualJson(actualPage1, expectedPage1, "Page1");
|
||||
|
||||
// Page2
|
||||
let expectedPage2 = { reports: [] };
|
||||
let actualPage2 = yield usage.createEditorReport(PAGE_2 + " \u2192 <style> index 0");
|
||||
let actualPage2 = await usage.createEditorReport(PAGE_2 + " \u2192 <style> index 0");
|
||||
isEqualJson(actualPage2, expectedPage2, "Page2");
|
||||
|
||||
// Page3a
|
||||
|
@ -77,7 +77,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualPage3a = yield usage.createEditorReport(PAGE_3 + " \u2192 <style> index 0");
|
||||
let actualPage3a = await usage.createEditorReport(PAGE_3 + " \u2192 <style> index 0");
|
||||
isEqualJson(actualPage3a, expectedPage3a, "Page3a");
|
||||
|
||||
// Page3b
|
||||
|
@ -89,7 +89,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualPage3b = yield usage.createEditorReport(PAGE_3 + " \u2192 <style> index 1");
|
||||
let actualPage3b = await usage.createEditorReport(PAGE_3 + " \u2192 <style> index 1");
|
||||
isEqualJson(actualPage3b, expectedPage3b, "Page3b");
|
||||
|
||||
// SheetA
|
||||
|
@ -109,7 +109,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualSheetA = yield usage.createEditorReport(SHEET_A);
|
||||
let actualSheetA = await usage.createEditorReport(SHEET_A);
|
||||
isEqualJson(actualSheetA, expectedSheetA, "SheetA");
|
||||
|
||||
// SheetB
|
||||
|
@ -129,7 +129,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualSheetB = yield usage.createEditorReport(SHEET_B);
|
||||
let actualSheetB = await usage.createEditorReport(SHEET_B);
|
||||
isEqualJson(actualSheetB, expectedSheetB, "SheetB");
|
||||
|
||||
// SheetC
|
||||
|
@ -149,7 +149,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualSheetC = yield usage.createEditorReport(SHEET_C);
|
||||
let actualSheetC = await usage.createEditorReport(SHEET_C);
|
||||
isEqualJson(actualSheetC, expectedSheetC, "SheetC");
|
||||
|
||||
// SheetD
|
||||
|
@ -169,15 +169,15 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualSheetD = yield usage.createEditorReport(SHEET_D);
|
||||
let actualSheetD = await usage.createEditorReport(SHEET_D);
|
||||
isEqualJson(actualSheetD, expectedSheetD, "SheetD");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that checkPageReport returns the expected JSON
|
||||
*/
|
||||
function* checkPageReport(usage) {
|
||||
let actualReport = yield usage.createPageReport();
|
||||
async function checkPageReport(usage) {
|
||||
let actualReport = await usage.createPageReport();
|
||||
|
||||
// Quick check on trivial things. See doc comment for checkRuleProperties
|
||||
actualReport.preload.forEach(page => page.rules.forEach(checkRuleProperties));
|
||||
|
|
|
@ -15,65 +15,65 @@ const SHEET_B = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetB.css";
|
|||
const SHEET_C = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetC.css";
|
||||
const SHEET_D = TEST_BASE_HTTPS + "browser_cmd_csscoverage_sheetD.css";
|
||||
|
||||
add_task(function* () {
|
||||
let options = yield helpers.openTab("about:blank");
|
||||
yield helpers.openToolbar(options);
|
||||
add_task(async function() {
|
||||
let options = await helpers.openTab("about:blank");
|
||||
await helpers.openToolbar(options);
|
||||
|
||||
let usage = yield csscoverage.getUsage(options.target);
|
||||
let usage = await csscoverage.getUsage(options.target);
|
||||
|
||||
yield navigate(usage, options);
|
||||
yield checkPages(usage);
|
||||
yield checkEditorReport(usage);
|
||||
yield checkPageReport(usage);
|
||||
await navigate(usage, options);
|
||||
await checkPages(usage);
|
||||
await checkEditorReport(usage);
|
||||
await checkPageReport(usage);
|
||||
|
||||
yield helpers.closeToolbar(options);
|
||||
yield helpers.closeTab(options);
|
||||
await helpers.closeToolbar(options);
|
||||
await helpers.closeTab(options);
|
||||
});
|
||||
|
||||
/**
|
||||
* Visit all the pages in the test
|
||||
*/
|
||||
function* navigate(usage, options) {
|
||||
yield usage.start(options.chromeWindow, options.target);
|
||||
async function navigate(usage, options) {
|
||||
await usage.start(options.chromeWindow, options.target);
|
||||
|
||||
ok(usage.isRunning(), "csscoverage is running");
|
||||
|
||||
// Load page 1.
|
||||
options.browser.loadURI(PAGE_1);
|
||||
// And wait until page 1 and page 2 (an iframe inside page 1) are both loaded.
|
||||
yield Promise.all([
|
||||
await Promise.all([
|
||||
BrowserTestUtils.browserLoaded(options.browser, false, PAGE_1),
|
||||
BrowserTestUtils.browserLoaded(options.browser, true, PAGE_2)
|
||||
]);
|
||||
is(options.browser.currentURI.spec, PAGE_1, "page 1 loaded");
|
||||
|
||||
// page 2 has JS that navigates to page 3 after a timeout.
|
||||
yield BrowserTestUtils.browserLoaded(options.browser, false, PAGE_3);
|
||||
await BrowserTestUtils.browserLoaded(options.browser, false, PAGE_3);
|
||||
is(options.browser.currentURI.spec, PAGE_3, "page 3 loaded");
|
||||
|
||||
let toolboxReady = gDevTools.once("toolbox-ready");
|
||||
|
||||
yield usage.stop();
|
||||
await usage.stop();
|
||||
|
||||
ok(!usage.isRunning(), "csscoverage not is running");
|
||||
|
||||
yield toolboxReady;
|
||||
await toolboxReady;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the expected pages have been visited
|
||||
*/
|
||||
function* checkPages(usage) {
|
||||
async function checkPages(usage) {
|
||||
// 'load' event order. '' is for the initial location
|
||||
let expectedVisited = [ "", PAGE_2, PAGE_1, PAGE_3 ];
|
||||
let actualVisited = yield usage._testOnlyVisitedPages();
|
||||
let actualVisited = await usage._testOnlyVisitedPages();
|
||||
isEqualJson(actualVisited, expectedVisited, "Visited");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that createEditorReport returns the expected JSON
|
||||
*/
|
||||
function* checkEditorReport(usage) {
|
||||
async function checkEditorReport(usage) {
|
||||
// Page1
|
||||
let expectedPage1 = {
|
||||
reports: [
|
||||
|
@ -83,7 +83,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualPage1 = yield usage.createEditorReport(PAGE_1 + " \u2192 <style> index 0");
|
||||
let actualPage1 = await usage.createEditorReport(PAGE_1 + " \u2192 <style> index 0");
|
||||
isEqualJson(actualPage1, expectedPage1, "Page1");
|
||||
|
||||
// Page2
|
||||
|
@ -95,7 +95,7 @@ function* checkEditorReport(usage) {
|
|||
},
|
||||
]
|
||||
};
|
||||
let actualPage2 = yield usage.createEditorReport(PAGE_2 + " \u2192 <style> index 0");
|
||||
let actualPage2 = await usage.createEditorReport(PAGE_2 + " \u2192 <style> index 0");
|
||||
isEqualJson(actualPage2, expectedPage2, "Page2");
|
||||
|
||||
// Page3a
|
||||
|
@ -107,7 +107,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualPage3a = yield usage.createEditorReport(PAGE_3 + " \u2192 <style> index 0");
|
||||
let actualPage3a = await usage.createEditorReport(PAGE_3 + " \u2192 <style> index 0");
|
||||
isEqualJson(actualPage3a, expectedPage3a, "Page3a");
|
||||
|
||||
// Page3b
|
||||
|
@ -119,7 +119,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualPage3b = yield usage.createEditorReport(PAGE_3 + " \u2192 <style> index 1");
|
||||
let actualPage3b = await usage.createEditorReport(PAGE_3 + " \u2192 <style> index 1");
|
||||
isEqualJson(actualPage3b, expectedPage3b, "Page3b");
|
||||
|
||||
// SheetA
|
||||
|
@ -131,7 +131,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualSheetA = yield usage.createEditorReport(SHEET_A);
|
||||
let actualSheetA = await usage.createEditorReport(SHEET_A);
|
||||
isEqualJson(actualSheetA, expectedSheetA, "SheetA");
|
||||
|
||||
// SheetB
|
||||
|
@ -143,7 +143,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualSheetB = yield usage.createEditorReport(SHEET_B);
|
||||
let actualSheetB = await usage.createEditorReport(SHEET_B);
|
||||
isEqualJson(actualSheetB, expectedSheetB, "SheetB");
|
||||
|
||||
// SheetC
|
||||
|
@ -155,7 +155,7 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualSheetC = yield usage.createEditorReport(SHEET_C);
|
||||
let actualSheetC = await usage.createEditorReport(SHEET_C);
|
||||
isEqualJson(actualSheetC, expectedSheetC, "SheetC");
|
||||
|
||||
// SheetD
|
||||
|
@ -167,15 +167,15 @@ function* checkEditorReport(usage) {
|
|||
}
|
||||
]
|
||||
};
|
||||
let actualSheetD = yield usage.createEditorReport(SHEET_D);
|
||||
let actualSheetD = await usage.createEditorReport(SHEET_D);
|
||||
isEqualJson(actualSheetD, expectedSheetD, "SheetD");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that checkPageReport returns the expected JSON
|
||||
*/
|
||||
function* checkPageReport(usage) {
|
||||
let actualReport = yield usage.createPageReport();
|
||||
async function checkPageReport(usage) {
|
||||
let actualReport = await usage.createPageReport();
|
||||
|
||||
// Quick check on trivial things. See doc comment for checkRuleProperties
|
||||
actualReport.preload.forEach(page => page.rules.forEach(checkRuleProperties));
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
const csscoverage = require("devtools/server/actors/csscoverage");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
testDeconstructRuleId();
|
||||
});
|
||||
|
||||
|
|
|
@ -9,41 +9,41 @@
|
|||
|
||||
const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
|
||||
|
||||
add_task(function *() {
|
||||
add_task(async function() {
|
||||
let options = {
|
||||
source: TAB_URL,
|
||||
line: 1
|
||||
};
|
||||
let [tab,, panel] = yield initDebugger(TAB_URL, options);
|
||||
let [tab,, panel] = await initDebugger(TAB_URL, options);
|
||||
let panelWin = panel.panelWin;
|
||||
let toolbox = panel._toolbox;
|
||||
let toolboxTab = toolbox.doc.getElementById("toolbox-tab-jsdebugger");
|
||||
|
||||
let newTab = yield addTab(TAB_URL);
|
||||
let newTab = await addTab(TAB_URL);
|
||||
isnot(newTab, tab,
|
||||
"The newly added tab is different from the debugger's tab.");
|
||||
is(gBrowser.selectedTab, newTab,
|
||||
"Debugger's tab is not the selected tab.");
|
||||
|
||||
info("Run tests against bottom host.");
|
||||
yield testPause();
|
||||
yield testResume();
|
||||
await testPause();
|
||||
await testResume();
|
||||
|
||||
// testResume selected the console, select back the debugger.
|
||||
yield toolbox.selectTool("jsdebugger");
|
||||
await toolbox.selectTool("jsdebugger");
|
||||
|
||||
info("Switching to a toolbox window host.");
|
||||
yield toolbox.switchHost(Toolbox.HostType.WINDOW);
|
||||
await toolbox.switchHost(Toolbox.HostType.WINDOW);
|
||||
|
||||
info("Run tests against window host.");
|
||||
yield testPause();
|
||||
yield testResume();
|
||||
await testPause();
|
||||
await testResume();
|
||||
|
||||
info("Cleanup after the test.");
|
||||
yield toolbox.switchHost(Toolbox.HostType.BOTTOM);
|
||||
yield closeDebuggerAndFinish(panel);
|
||||
await toolbox.switchHost(Toolbox.HostType.BOTTOM);
|
||||
await closeDebuggerAndFinish(panel);
|
||||
|
||||
function* testPause() {
|
||||
async function testPause() {
|
||||
is(panelWin.gThreadClient.paused, false,
|
||||
"Should be running after starting the test.");
|
||||
|
||||
|
@ -68,37 +68,37 @@ add_task(function *() {
|
|||
// Evaluate a script to fully pause the debugger
|
||||
evalInTab(tab, "debugger;");
|
||||
|
||||
yield onPaused;
|
||||
yield onFocus;
|
||||
yield onTabSelect;
|
||||
await onPaused;
|
||||
await onFocus;
|
||||
await onTabSelect;
|
||||
|
||||
if (toolbox.hostType != Toolbox.HostType.WINDOW) {
|
||||
is(gBrowser.selectedTab, tab,
|
||||
"Debugger's tab got selected.");
|
||||
}
|
||||
|
||||
yield toolbox.selectTool("webconsole");
|
||||
await toolbox.selectTool("webconsole");
|
||||
ok(toolboxTab.classList.contains("highlighted"),
|
||||
"The highlighted class is present");
|
||||
ok(!toolboxTab.classList.contains("selected"),
|
||||
"The tab is not selected");
|
||||
yield toolbox.selectTool("jsdebugger");
|
||||
await toolbox.selectTool("jsdebugger");
|
||||
ok(toolboxTab.classList.contains("highlighted"),
|
||||
"The highlighted class is present");
|
||||
ok(toolboxTab.classList.contains("selected"),
|
||||
"...and the tab is selected, so the glow will not be present.");
|
||||
}
|
||||
|
||||
function* testResume() {
|
||||
async function testResume() {
|
||||
let onPaused = waitForEvent(panelWin.gThreadClient, "resumed");
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" },
|
||||
panelWin.document.getElementById("resume"),
|
||||
panelWin);
|
||||
|
||||
yield onPaused;
|
||||
await onPaused;
|
||||
|
||||
yield toolbox.selectTool("webconsole");
|
||||
await toolbox.selectTool("webconsole");
|
||||
ok(!toolboxTab.classList.contains("highlighted"),
|
||||
"The highlighted class is not present now after the resume");
|
||||
ok(!toolboxTab.classList.contains("selected"),
|
||||
|
|
|
@ -13,15 +13,15 @@ const FORM = "<form method=\"POST\"><input type=\"submit\"></form>";
|
|||
const GET_CONTENT = "<script>\"GET\";</script>" + FORM;
|
||||
const POST_CONTENT = "<script>\"POST\";</script>" + FORM;
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
// Disable rcwn to make cache behavior deterministic.
|
||||
yield pushPref("network.http.rcwn.enabled", false);
|
||||
await pushPref("network.http.rcwn.enabled", false);
|
||||
|
||||
let options = {
|
||||
source: TAB_URL,
|
||||
line: 1
|
||||
};
|
||||
let [tab,, panel] = yield initDebugger(TAB_URL, options);
|
||||
let [tab,, panel] = await initDebugger(TAB_URL, options);
|
||||
let win = panel.panelWin;
|
||||
let editor = win.DebuggerView.editor;
|
||||
let queries = win.require("./content/queries");
|
||||
|
@ -38,10 +38,10 @@ add_task(function* () {
|
|||
|
||||
// Submit the form and wait for debugger update
|
||||
let onSourceUpdated = waitForSourceShown(panel, TAB_URL);
|
||||
yield ContentTask.spawn(tab.linkedBrowser, null, function () {
|
||||
await ContentTask.spawn(tab.linkedBrowser, null, function () {
|
||||
content.document.querySelector("input[type=\"submit\"]").click();
|
||||
});
|
||||
yield onSourceUpdated;
|
||||
await onSourceUpdated;
|
||||
|
||||
// Verify that the source updates to the POST page content
|
||||
source = queries.getSelectedSource(getState());
|
||||
|
@ -52,5 +52,5 @@ add_task(function* () {
|
|||
is(editor.getText(), POST_CONTENT,
|
||||
"The currently shown source contains bacon. Mmm, delicious!");
|
||||
|
||||
yield closeDebuggerAndFinish(panel);
|
||||
await closeDebuggerAndFinish(panel);
|
||||
});
|
||||
|
|
|
@ -14,22 +14,22 @@ const IFRAME_URL = "data:text/html;charset=utf-8," +
|
|||
"<div onclick='fn()'>hello</div>";
|
||||
const TAB_URL = `data:text/html;charset=utf-8,<iframe src="${IFRAME_URL}"/>`;
|
||||
|
||||
add_task(function* () {
|
||||
let [,, panel] = yield initDebugger();
|
||||
add_task(async function() {
|
||||
let [,, panel] = await initDebugger();
|
||||
let dbg = panel.panelWin;
|
||||
let newSource;
|
||||
|
||||
newSource = waitForDebuggerEvents(panel, dbg.EVENTS.NEW_SOURCE);
|
||||
reload(panel, TAB_URL);
|
||||
yield newSource;
|
||||
await newSource;
|
||||
ok(true, "Source event fired on initial load");
|
||||
|
||||
for (let i = 0; i < 5; i++) {
|
||||
newSource = waitForDebuggerEvents(panel, dbg.EVENTS.NEW_SOURCE);
|
||||
reload(panel);
|
||||
yield newSource;
|
||||
await newSource;
|
||||
ok(true, `Source event fired after ${i + 1} reloads`);
|
||||
}
|
||||
|
||||
yield closeDebuggerAndFinish(panel);
|
||||
await closeDebuggerAndFinish(panel);
|
||||
});
|
||||
|
|
|
@ -4,18 +4,18 @@
|
|||
var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
|
||||
var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
|
||||
|
||||
add_task(function* testNormalExecution() {
|
||||
add_task(async function testNormalExecution() {
|
||||
let {client, tab, tabClient, workerClient, toolbox, gDebugger} =
|
||||
yield initWorkerDebugger(TAB_URL, WORKER_URL);
|
||||
await initWorkerDebugger(TAB_URL, WORKER_URL);
|
||||
|
||||
let jsterm = yield getSplitConsole(toolbox);
|
||||
let executed = yield jsterm.execute("this.location.toString()");
|
||||
let jsterm = await getSplitConsole(toolbox);
|
||||
let executed = await jsterm.execute("this.location.toString()");
|
||||
ok(executed.textContent.includes(WORKER_URL),
|
||||
"Evaluating the global's location works");
|
||||
|
||||
terminateWorkerInTab(tab, WORKER_URL);
|
||||
yield waitForWorkerClose(workerClient);
|
||||
yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
|
||||
yield close(client);
|
||||
yield removeTab(tab);
|
||||
await waitForWorkerClose(workerClient);
|
||||
await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
|
||||
await close(client);
|
||||
await removeTab(tab);
|
||||
});
|
||||
|
|
|
@ -4,17 +4,17 @@
|
|||
var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
|
||||
var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
|
||||
|
||||
add_task(function* testWhilePaused() {
|
||||
add_task(async function testWhilePaused() {
|
||||
let {client, tab, tabClient, workerClient, toolbox, gDebugger} =
|
||||
yield initWorkerDebugger(TAB_URL, WORKER_URL);
|
||||
await initWorkerDebugger(TAB_URL, WORKER_URL);
|
||||
|
||||
let gTarget = gDebugger.gTarget;
|
||||
let gResumeButton = gDebugger.document.getElementById("resume");
|
||||
let gResumeKey = gDebugger.document.getElementById("resumeKey");
|
||||
|
||||
// Execute some basic math to make sure evaluations are working.
|
||||
let jsterm = yield getSplitConsole(toolbox);
|
||||
let executed = yield jsterm.execute("10000+1");
|
||||
let jsterm = await getSplitConsole(toolbox);
|
||||
let executed = await jsterm.execute("10000+1");
|
||||
ok(executed.textContent.includes("10001"), "Text for message appeared correct");
|
||||
|
||||
// Pause the worker by waiting for next execution and then sending a message to
|
||||
|
@ -25,34 +25,34 @@ add_task(function* testWhilePaused() {
|
|||
info("Posting message to worker, then waiting for a pause");
|
||||
postMessageToWorkerInTab(tab, WORKER_URL, "ping");
|
||||
});
|
||||
yield oncePaused;
|
||||
await oncePaused;
|
||||
|
||||
let command1 = jsterm.execute("10000+2");
|
||||
let command2 = jsterm.execute("10000+3");
|
||||
let command3 = jsterm.execute("foobar"); // throw an error
|
||||
|
||||
info("Trying to get the result of command1");
|
||||
executed = yield command1;
|
||||
executed = await command1;
|
||||
ok(executed.textContent.includes("10002"),
|
||||
"command1 executed successfully");
|
||||
|
||||
info("Trying to get the result of command2");
|
||||
executed = yield command2;
|
||||
executed = await command2;
|
||||
ok(executed.textContent.includes("10003"),
|
||||
"command2 executed successfully");
|
||||
|
||||
info("Trying to get the result of command3");
|
||||
executed = yield command3;
|
||||
executed = await command3;
|
||||
ok(executed.textContent.includes("ReferenceError: foobar is not defined"),
|
||||
"command3 executed successfully");
|
||||
|
||||
let onceResumed = gTarget.once("thread-resumed");
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
|
||||
yield onceResumed;
|
||||
await onceResumed;
|
||||
|
||||
terminateWorkerInTab(tab, WORKER_URL);
|
||||
yield waitForWorkerClose(workerClient);
|
||||
yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
|
||||
yield close(client);
|
||||
yield removeTab(tab);
|
||||
await waitForWorkerClose(workerClient);
|
||||
await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
|
||||
await close(client);
|
||||
await removeTab(tab);
|
||||
});
|
||||
|
|
|
@ -5,16 +5,16 @@ var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
|
|||
var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
|
||||
|
||||
// Test to see if creating the pause from the console works.
|
||||
add_task(function* testPausedByConsole() {
|
||||
add_task(async function testPausedByConsole() {
|
||||
let {client, tab, tabClient, workerClient, toolbox, gDebugger} =
|
||||
yield initWorkerDebugger(TAB_URL, WORKER_URL);
|
||||
await initWorkerDebugger(TAB_URL, WORKER_URL);
|
||||
|
||||
let gTarget = gDebugger.gTarget;
|
||||
let gResumeButton = gDebugger.document.getElementById("resume");
|
||||
let gResumeKey = gDebugger.document.getElementById("resumeKey");
|
||||
|
||||
let jsterm = yield getSplitConsole(toolbox);
|
||||
let executed = yield jsterm.execute("10000+1");
|
||||
let jsterm = await getSplitConsole(toolbox);
|
||||
let executed = await jsterm.execute("10000+1");
|
||||
ok(executed.textContent.includes("10001"),
|
||||
"Text for message appeared correct");
|
||||
|
||||
|
@ -23,24 +23,24 @@ add_task(function* testPausedByConsole() {
|
|||
let pausedExecution = jsterm.execute("10000+2");
|
||||
|
||||
info("Executed a command with 'break on next' active, waiting for pause");
|
||||
yield oncePaused;
|
||||
await oncePaused;
|
||||
|
||||
executed = yield jsterm.execute("10000+3");
|
||||
executed = await jsterm.execute("10000+3");
|
||||
ok(executed.textContent.includes("10003"),
|
||||
"Text for message appeared correct");
|
||||
|
||||
info("Waiting for a resume");
|
||||
let onceResumed = gTarget.once("thread-resumed");
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
|
||||
yield onceResumed;
|
||||
await onceResumed;
|
||||
|
||||
executed = yield pausedExecution;
|
||||
executed = await pausedExecution;
|
||||
ok(executed.textContent.includes("10002"),
|
||||
"Text for message appeared correct");
|
||||
|
||||
terminateWorkerInTab(tab, WORKER_URL);
|
||||
yield waitForWorkerClose(workerClient);
|
||||
yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
|
||||
yield close(client);
|
||||
yield removeTab(tab);
|
||||
await waitForWorkerClose(workerClient);
|
||||
await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
|
||||
await close(client);
|
||||
await removeTab(tab);
|
||||
});
|
||||
|
|
|
@ -10,24 +10,24 @@ PromiseTestUtils.whitelistRejectionsGlobally(/connection just closed/);
|
|||
const TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
|
||||
const WORKER_URL = "code_WorkerActor.attachThread-worker.js";
|
||||
|
||||
add_task(function* testPausedByConsole() {
|
||||
add_task(async function testPausedByConsole() {
|
||||
let {client, tab, workerClient, toolbox} =
|
||||
yield initWorkerDebugger(TAB_URL, WORKER_URL);
|
||||
await initWorkerDebugger(TAB_URL, WORKER_URL);
|
||||
|
||||
info("Check Date objects can be used in the console");
|
||||
let jsterm = yield getSplitConsole(toolbox);
|
||||
let executed = yield jsterm.execute("new Date(0)");
|
||||
let jsterm = await getSplitConsole(toolbox);
|
||||
let executed = await jsterm.execute("new Date(0)");
|
||||
ok(executed.textContent.includes("1970-01-01T00:00:00.000Z"),
|
||||
"Text for message appeared correct");
|
||||
|
||||
info("Check RegExp objects can be used in the console");
|
||||
executed = yield jsterm.execute("new RegExp('.*')");
|
||||
executed = await jsterm.execute("new RegExp('.*')");
|
||||
ok(executed.textContent.includes("/.*/"),
|
||||
"Text for message appeared correct");
|
||||
|
||||
terminateWorkerInTab(tab, WORKER_URL);
|
||||
yield waitForWorkerClose(workerClient);
|
||||
yield gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
|
||||
yield close(client);
|
||||
yield removeTab(tab);
|
||||
await waitForWorkerClose(workerClient);
|
||||
await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
|
||||
await close(client);
|
||||
await removeTab(tab);
|
||||
});
|
||||
|
|
|
@ -11,33 +11,33 @@ PromiseTestUtils.expectUncaughtRejection(/[object Object]/);
|
|||
var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
|
||||
var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
|
||||
|
||||
add_task(function* () {
|
||||
yield pushPrefs(["devtools.scratchpad.enabled", true]);
|
||||
add_task(async function() {
|
||||
await pushPrefs(["devtools.scratchpad.enabled", true]);
|
||||
|
||||
DebuggerServer.init();
|
||||
DebuggerServer.registerAllActors();
|
||||
|
||||
let client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
yield connect(client);
|
||||
await connect(client);
|
||||
|
||||
let tab = yield addTab(TAB_URL);
|
||||
let { tabs } = yield listTabs(client);
|
||||
let [, tabClient] = yield attachTab(client, findTab(tabs, TAB_URL));
|
||||
let tab = await addTab(TAB_URL);
|
||||
let { tabs } = await listTabs(client);
|
||||
let [, tabClient] = await attachTab(client, findTab(tabs, TAB_URL));
|
||||
|
||||
yield listWorkers(tabClient);
|
||||
yield createWorkerInTab(tab, WORKER_URL);
|
||||
await listWorkers(tabClient);
|
||||
await createWorkerInTab(tab, WORKER_URL);
|
||||
|
||||
let { workers } = yield listWorkers(tabClient);
|
||||
let [, workerClient] = yield attachWorker(tabClient,
|
||||
let { workers } = await listWorkers(tabClient);
|
||||
let [, workerClient] = await attachWorker(tabClient,
|
||||
findWorker(workers, WORKER_URL));
|
||||
|
||||
let toolbox = yield gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
|
||||
let toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
|
||||
"jsdebugger",
|
||||
Toolbox.HostType.WINDOW);
|
||||
|
||||
is(toolbox.hostType, "window", "correct host");
|
||||
|
||||
yield new Promise(done => {
|
||||
await new Promise(done => {
|
||||
toolbox.win.parent.addEventListener("message", function onmessage(event) {
|
||||
if (event.data.name == "set-host-title") {
|
||||
toolbox.win.parent.removeEventListener("message", onmessage);
|
||||
|
@ -55,8 +55,8 @@ add_task(function* () {
|
|||
"Correct set of tools supported by worker");
|
||||
|
||||
terminateWorkerInTab(tab, WORKER_URL);
|
||||
yield waitForWorkerClose(workerClient);
|
||||
yield close(client);
|
||||
await waitForWorkerClose(workerClient);
|
||||
await close(client);
|
||||
|
||||
yield toolbox.destroy();
|
||||
await toolbox.destroy();
|
||||
});
|
||||
|
|
|
@ -35,7 +35,7 @@ const CHROME_URI = Services.io.newURI(CHROME_URL);
|
|||
|
||||
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
|
||||
|
||||
registerCleanupFunction(function* () {
|
||||
registerCleanupFunction(async function() {
|
||||
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
|
||||
|
||||
info("finish() was called, cleaning up...");
|
||||
|
@ -44,7 +44,7 @@ registerCleanupFunction(function* () {
|
|||
while (gBrowser && gBrowser.tabs && gBrowser.tabs.length > 1) {
|
||||
info("Destroying toolbox.");
|
||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||
yield gDevTools.closeToolbox(target);
|
||||
await gDevTools.closeToolbox(target);
|
||||
|
||||
info("Removing tab.");
|
||||
gBrowser.removeCurrentTab();
|
||||
|
@ -55,7 +55,7 @@ registerCleanupFunction(function* () {
|
|||
|
||||
// Debugger tests use a lot of memory, so force a GC to help fragmentation.
|
||||
info("Forcing GC/CC after debugger test.");
|
||||
yield new Promise(resolve => {
|
||||
await new Promise(resolve => {
|
||||
Cu.forceGC();
|
||||
Cu.forceCC();
|
||||
Cu.schedulePreciseGC(resolve);
|
||||
|
@ -1321,24 +1321,24 @@ function waitForDispatch(panel, type, eventRepeat = 1) {
|
|||
});
|
||||
}
|
||||
|
||||
function* initWorkerDebugger(TAB_URL, WORKER_URL) {
|
||||
async function initWorkerDebugger(TAB_URL, WORKER_URL) {
|
||||
DebuggerServer.init();
|
||||
DebuggerServer.registerAllActors();
|
||||
|
||||
let client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
yield connect(client);
|
||||
await connect(client);
|
||||
|
||||
let tab = yield addTab(TAB_URL);
|
||||
let { tabs } = yield listTabs(client);
|
||||
let [, tabClient] = yield attachTab(client, findTab(tabs, TAB_URL));
|
||||
let tab = await addTab(TAB_URL);
|
||||
let { tabs } = await listTabs(client);
|
||||
let [, tabClient] = await attachTab(client, findTab(tabs, TAB_URL));
|
||||
|
||||
yield createWorkerInTab(tab, WORKER_URL);
|
||||
await createWorkerInTab(tab, WORKER_URL);
|
||||
|
||||
let { workers } = yield listWorkers(tabClient);
|
||||
let [, workerClient] = yield attachWorker(tabClient,
|
||||
let { workers } = await listWorkers(tabClient);
|
||||
let [, workerClient] = await attachWorker(tabClient,
|
||||
findWorker(workers, WORKER_URL));
|
||||
|
||||
let toolbox = yield gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
|
||||
let toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
|
||||
"jsdebugger",
|
||||
Toolbox.HostType.WINDOW);
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
|
|||
|
||||
const { connect } = require("devtools/client/shared/vendor/react-redux");
|
||||
// DOM Panel
|
||||
const DomTree = createFactory(require("./dom-tree"));
|
||||
const DomTree = createFactory(require("./DomTree"));
|
||||
|
||||
const MainToolbar = createFactory(require("./main-toolbar"));
|
||||
const MainToolbar = createFactory(require("./MainToolbar"));
|
||||
// Shortcuts
|
||||
const { div } = dom;
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
DevToolsModules(
|
||||
'dom-tree.js',
|
||||
'main-frame.js',
|
||||
'main-toolbar.js'
|
||||
'DomTree.js',
|
||||
'MainFrame.js',
|
||||
'MainToolbar.js'
|
||||
)
|
||||
|
|
|
@ -12,7 +12,7 @@ const { Provider } = require("devtools/client/shared/vendor/react-redux");
|
|||
const { combineReducers } = require("devtools/client/shared/vendor/redux");
|
||||
|
||||
// DOM Panel
|
||||
const MainFrame = React.createFactory(require("./components/main-frame"));
|
||||
const MainFrame = React.createFactory(require("./components/MainFrame"));
|
||||
|
||||
// Store
|
||||
const createStore = require("devtools/client/shared/redux/create-store")({
|
||||
|
|
|
@ -10,7 +10,7 @@ registerCleanupFunction(() => {
|
|||
Services.prefs.clearUserPref(PREF_DEVTOOLS_THEME);
|
||||
});
|
||||
|
||||
add_task(function* testDevtoolsTheme() {
|
||||
add_task(async function testDevtoolsTheme() {
|
||||
info("Checking stylesheet and :root attributes based on devtools theme.");
|
||||
Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "light");
|
||||
is(document.getElementById("browser-bottombox").getAttribute("devtoolstheme"), "light",
|
||||
|
|
|
@ -62,7 +62,8 @@ async function testPolygonMovePoint(config) {
|
|||
x = left + width * x / 100;
|
||||
y = top + height * y / 100;
|
||||
let dx = width / 10;
|
||||
let dy = height / 10;
|
||||
let dyPercent = 10;
|
||||
let dy = height / dyPercent;
|
||||
|
||||
let onRuleViewChanged = view.once("ruleview-changed");
|
||||
info("Moving first polygon point");
|
||||
|
@ -75,7 +76,8 @@ async function testPolygonMovePoint(config) {
|
|||
await onRuleViewChanged;
|
||||
|
||||
let definition = await getComputedPropertyValue(selector, property, inspector);
|
||||
ok(definition.includes(`${dx}px ${dy}px`), `Point moved to ${dx}px ${dy}px`);
|
||||
ok(definition.includes(`${dx}px ${dyPercent}%`),
|
||||
`Point moved to ${dx}px ${dyPercent}%`);
|
||||
|
||||
await teardown({selector, property, ...config});
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ async function testPolygonIframeMovePoint(config) {
|
|||
|
||||
let onRuleViewChanged = view.once("ruleview-changed");
|
||||
info("Moving polygon point visible in iframe");
|
||||
// Iframe has 10px margin. Element in iframe is 800px by 800px. First point is at 0 0%
|
||||
await mouse.down(10, 10);
|
||||
await mouse.move(20, 20);
|
||||
await mouse.up();
|
||||
|
@ -43,7 +44,7 @@ async function testPolygonIframeMovePoint(config) {
|
|||
|
||||
let computedStyle = await inspector.pageStyle.getComputed(highlightedNode);
|
||||
let definition = computedStyle["clip-path"].value;
|
||||
ok(definition.includes("10px 10px"), "Point moved to 10px 10px");
|
||||
ok(definition.includes("10px 1.25%"), "Point moved to 10px 1.25%");
|
||||
|
||||
onRuleViewChanged = view.once("ruleview-changed");
|
||||
info("Moving polygon point not visible in iframe");
|
||||
|
@ -56,4 +57,7 @@ async function testPolygonIframeMovePoint(config) {
|
|||
computedStyle = await inspector.pageStyle.getComputed(highlightedNode);
|
||||
definition = computedStyle["clip-path"].value;
|
||||
ok(definition.includes("110px 51.25%"), "Point moved to 110px 51.25%");
|
||||
|
||||
info(`Turn off shapes highlighter for ${selector}`);
|
||||
await toggleShapesHighlighter(view, selector, property, false);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
background: #f06;
|
||||
}
|
||||
#polygon {
|
||||
clip-path: polygon(0 0,
|
||||
clip-path: polygon(0 0%,
|
||||
100px 50%,
|
||||
200px 0,
|
||||
300px 50%,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
let { setFilterString } = require("devtools/client/memory/actions/filter");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
let store = Store();
|
||||
const { getState, dispatch } = store;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
const { censusDisplays } = require("devtools/client/memory/constants");
|
||||
const { setCensusDisplay } = require("devtools/client/memory/actions/census-display");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
let store = Store();
|
||||
const { getState, dispatch } = store;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
const { drawBox } = require("devtools/client/memory/components/tree-map/draw");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
let fillRectValues, strokeRectValues;
|
||||
let ctx = {
|
||||
fillRect: (...args) => {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
const { drawText } = require("devtools/client/memory/components/tree-map/draw");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
// Mock out the Canvas2dContext
|
||||
let ctx = {
|
||||
fillText: (...args) => fillTextValues.push(args),
|
||||
|
|
|
@ -13,7 +13,7 @@ let utils = require("devtools/client/memory/utils");
|
|||
let { snapshotState: states, viewState } = require("devtools/client/memory/constants");
|
||||
let { Preferences } = require("resource://gre/modules/Preferences.jsm");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
let s1 = utils.createSnapshot({ view: { state: viewState.CENSUS } });
|
||||
let s2 = utils.createSnapshot({ view: { state: viewState.CENSUS } });
|
||||
equal(s1.state, states.SAVING,
|
||||
|
|
|
@ -12,8 +12,8 @@ const ADD_HEADER = "Test-header: true";
|
|||
const ADD_UA_HEADER = "User-Agent: Custom-Agent";
|
||||
const ADD_POSTDATA = "&t3=t4";
|
||||
|
||||
add_task(function* () {
|
||||
let { tab, monitor } = yield initNetMonitor(POST_DATA_URL);
|
||||
add_task(async function() {
|
||||
let { tab, monitor } = await initNetMonitor(POST_DATA_URL);
|
||||
info("Starting test... ");
|
||||
|
||||
let { document, store, windowRequire, connector } = monitor.panelWin;
|
||||
|
@ -26,7 +26,7 @@ add_task(function* () {
|
|||
store.dispatch(Actions.batchEnable(false));
|
||||
|
||||
// Execute requests.
|
||||
yield performRequests(monitor, tab, 2);
|
||||
await performRequests(monitor, tab, 2);
|
||||
|
||||
let origItem = getSortedRequests(store.getState()).get(0);
|
||||
|
||||
|
@ -35,13 +35,17 @@ add_task(function* () {
|
|||
// add a new custom request cloned from selected request
|
||||
|
||||
store.dispatch(Actions.cloneSelectedRequest());
|
||||
testCustomForm(origItem);
|
||||
// FIXME: This used to be a generator function that nothing awaited on
|
||||
// and therefore didn't run. It has been broken for some time.
|
||||
if (false) {
|
||||
testCustomForm(origItem);
|
||||
}
|
||||
|
||||
let customItem = getSelectedRequest(store.getState());
|
||||
testCustomItem(customItem, origItem);
|
||||
|
||||
// edit the custom request
|
||||
yield editCustomForm();
|
||||
await editCustomForm();
|
||||
|
||||
// FIXME: reread the customItem, it's been replaced by a new object (immutable!)
|
||||
customItem = getSelectedRequest(store.getState());
|
||||
|
@ -50,19 +54,19 @@ add_task(function* () {
|
|||
// send the new request
|
||||
wait = waitForNetworkEvents(monitor, 1);
|
||||
store.dispatch(Actions.sendCustomRequest(connector));
|
||||
yield wait;
|
||||
await wait;
|
||||
|
||||
let sentItem;
|
||||
// Testing sent request will require updated requestHeaders and requestPostData,
|
||||
// we must wait for both properties get updated before starting test.
|
||||
yield waitUntil(() => {
|
||||
await waitUntil(() => {
|
||||
sentItem = getSelectedRequest(store.getState());
|
||||
origItem = getSortedRequests(store.getState()).get(0);
|
||||
return sentItem.requestHeaders && sentItem.requestPostData &&
|
||||
origItem.requestHeaders && origItem.requestPostData;
|
||||
});
|
||||
|
||||
yield testSentRequest(sentItem, origItem);
|
||||
await testSentRequest(sentItem, origItem);
|
||||
|
||||
// Ensure the UI shows the new request, selected, and that the detail panel was closed.
|
||||
is(getSortedRequests(store.getState()).length, 3, "There are 3 requests shown");
|
||||
|
@ -88,8 +92,8 @@ add_task(function* () {
|
|||
/*
|
||||
* Test that the New Request form was populated correctly
|
||||
*/
|
||||
function* testCustomForm(data) {
|
||||
yield waitUntil(() => document.querySelector(".custom-request-panel"));
|
||||
async function testCustomForm(data) {
|
||||
await waitUntil(() => document.querySelector(".custom-request-panel"));
|
||||
is(document.getElementById("custom-method-value").value, data.method,
|
||||
"new request form showing correct method");
|
||||
|
||||
|
@ -113,7 +117,7 @@ add_task(function* () {
|
|||
/*
|
||||
* Add some params and headers to the request form
|
||||
*/
|
||||
function* editCustomForm() {
|
||||
async function editCustomForm() {
|
||||
monitor.panelWin.focus();
|
||||
|
||||
let query = document.getElementById("custom-query-value");
|
||||
|
@ -122,7 +126,7 @@ add_task(function* () {
|
|||
// focus only works if delayed by one tick.
|
||||
query.setSelectionRange(query.value.length, query.value.length);
|
||||
executeSoon(() => query.focus());
|
||||
yield queryFocus;
|
||||
await queryFocus;
|
||||
|
||||
// add params to url query string field
|
||||
type(["VK_RETURN"]);
|
||||
|
@ -132,7 +136,7 @@ add_task(function* () {
|
|||
let headersFocus = once(headers, "focus", false);
|
||||
headers.setSelectionRange(headers.value.length, headers.value.length);
|
||||
headers.focus();
|
||||
yield headersFocus;
|
||||
await headersFocus;
|
||||
|
||||
// add a header
|
||||
type(["VK_RETURN"]);
|
||||
|
@ -147,17 +151,17 @@ add_task(function* () {
|
|||
let postFocus = once(postData, "focus", false);
|
||||
postData.setSelectionRange(postData.value.length, postData.value.length);
|
||||
postData.focus();
|
||||
yield postFocus;
|
||||
await postFocus;
|
||||
|
||||
// add to POST data once textarea has updated
|
||||
yield waitUntil(() => postData.textContent !== "");
|
||||
await waitUntil(() => postData.textContent !== "");
|
||||
type(ADD_POSTDATA);
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure newly created event matches expected request
|
||||
*/
|
||||
function* testSentRequest(data, origData) {
|
||||
async function testSentRequest(data, origData) {
|
||||
is(data.method, origData.method, "correct method in sent request");
|
||||
is(data.url, origData.url + "&" + ADD_QUERY, "correct url in sent request");
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
const {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
let hash1 = FlameGraphUtils._getStringHash("abc");
|
||||
let hash2 = FlameGraphUtils._getStringHash("acb");
|
||||
let hash3 = FlameGraphUtils._getStringHash(Array.from(Array(100000)).join("a"));
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
const {KeyCodes} = require("devtools/client/shared/keycodes");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
for (let key in KeyCodes) {
|
||||
is(KeyCodes[key], KeyboardEvent[key], "checking value for " + key);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
const {getColor, getTheme, setTheme} = require("devtools/client/shared/theme");
|
||||
const {PrefObserver} = require("devtools/client/shared/prefs");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
testGetTheme();
|
||||
testSetTheme();
|
||||
testGetColor();
|
||||
|
|
|
@ -20,7 +20,7 @@ const CONTENT_URLS = [
|
|||
];
|
||||
|
||||
// Test `sourceUtils.parseURL`
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
let parsed = sourceUtils.parseURL("https://foo.com:8888/boo/bar.js?q=query");
|
||||
equal(parsed.fileName, "bar.js", "parseURL parsed valid fileName");
|
||||
equal(parsed.host, "foo.com:8888", "parseURL parsed valid host");
|
||||
|
@ -37,7 +37,7 @@ add_task(function* () {
|
|||
});
|
||||
|
||||
// Test `sourceUtils.isContentScheme`.
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
for (let url of CHROME_URLS) {
|
||||
ok(!sourceUtils.isContentScheme(url),
|
||||
`${url} correctly identified as not content scheme`);
|
||||
|
@ -48,7 +48,7 @@ add_task(function* () {
|
|||
});
|
||||
|
||||
// Test `sourceUtils.isChromeScheme`.
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
for (let url of CHROME_URLS) {
|
||||
ok(sourceUtils.isChromeScheme(url), `${url} correctly identified as chrome scheme`);
|
||||
}
|
||||
|
@ -59,14 +59,14 @@ add_task(function* () {
|
|||
});
|
||||
|
||||
// Test `sourceUtils.isWASM`.
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
ok(sourceUtils.isWASM("wasm-function[66240] (?:13870536)"),
|
||||
"wasm function correctly identified");
|
||||
ok(!sourceUtils.isWASM(CHROME_URLS[0]), `A chrome url does not identify as wasm.`);
|
||||
});
|
||||
|
||||
// Test `sourceUtils.isDataScheme`.
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
let dataURI = "data:text/html;charset=utf-8,<!DOCTYPE html></html>";
|
||||
ok(sourceUtils.isDataScheme(dataURI), `${dataURI} correctly identified as data scheme`);
|
||||
|
||||
|
@ -79,7 +79,7 @@ add_task(function* () {
|
|||
});
|
||||
|
||||
// Test `sourceUtils.getSourceNames`.
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
testAbbreviation("http://example.com/foo/bar/baz/boo.js",
|
||||
"boo.js",
|
||||
"http://example.com/foo/bar/baz/boo.js",
|
||||
|
@ -87,7 +87,7 @@ add_task(function* () {
|
|||
});
|
||||
|
||||
// Test `sourceUtils.isScratchpadTheme`
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
ok(sourceUtils.isScratchpadScheme("Scratchpad/1"),
|
||||
"Scratchpad/1 identified as scratchpad");
|
||||
ok(sourceUtils.isScratchpadScheme("Scratchpad/20"),
|
||||
|
@ -96,7 +96,7 @@ add_task(function* () {
|
|||
});
|
||||
|
||||
// Test `sourceUtils.getSourceNames`.
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
// Check length
|
||||
let longMalformedURL = `example.com${new Array(100).fill("/a").join("")}/file.js`;
|
||||
ok(sourceUtils.getSourceNames(longMalformedURL).short.length <= 100,
|
||||
|
@ -162,7 +162,7 @@ add_task(function* () {
|
|||
});
|
||||
|
||||
// Test for source mapped file name
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
const { getSourceMappedFile } = sourceUtils;
|
||||
const source = "baz.js";
|
||||
const output = getSourceMappedFile(source);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
const {Cu} = require("chrome");
|
||||
const {KeyCodes} = require("devtools/client/shared/keycodes");
|
||||
|
||||
const PANE_APPEARANCE_DELAY = 50;
|
||||
|
@ -169,7 +170,7 @@ const ViewHelpers = exports.ViewHelpers = {
|
|||
isNode: function(object) {
|
||||
return object instanceof Node ||
|
||||
object instanceof Element ||
|
||||
object instanceof DocumentFragment;
|
||||
Cu.getClassName(object) == "DocumentFragment";
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -787,12 +788,12 @@ const WidgetMethods = exports.WidgetMethods = {
|
|||
// If the two items were constructed with prebuilt nodes as
|
||||
// DocumentFragments, then those DocumentFragments are now
|
||||
// empty and need to be reassembled.
|
||||
if (firstPrebuiltTarget instanceof DocumentFragment) {
|
||||
if (Cu.getClassName(firstPrebuiltTarget) == "DocumentFragment") {
|
||||
for (let node of firstTarget.childNodes) {
|
||||
firstPrebuiltTarget.appendChild(node.cloneNode(true));
|
||||
}
|
||||
}
|
||||
if (secondPrebuiltTarget instanceof DocumentFragment) {
|
||||
if (Cu.getClassName(secondPrebuiltTarget) == "DocumentFragment") {
|
||||
for (let node of secondTarget.childNodes) {
|
||||
secondPrebuiltTarget.appendChild(node.cloneNode(true));
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
const TESTPAGE = "storage-file-url.html";
|
||||
|
||||
// We need to load TESTPAGE using a file:// path so we need to get that from
|
||||
|
@ -23,7 +23,7 @@ add_task(function* () {
|
|||
const uriString = Services.io.newFileURI(dir).spec;
|
||||
|
||||
// Now we have a valid file:// URL pointing to TESTPAGE.
|
||||
yield openTabAndSetupStorage(uriString);
|
||||
await openTabAndSetupStorage(uriString);
|
||||
|
||||
// uriString points to the test inside objdir e.g.
|
||||
// `/path/to/fx/objDir/_tests/testing/mochitest/browser/devtools/client/
|
||||
|
@ -35,13 +35,13 @@ add_task(function* () {
|
|||
// The easiest way to get the actual path is to request it from the content
|
||||
// process.
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
let actualPath = yield ContentTask.spawn(browser, null, () => {
|
||||
let actualPath = await ContentTask.spawn(browser, null, () => {
|
||||
return content.document.location.href;
|
||||
});
|
||||
|
||||
const cookiePath = actualPath.substr(0, actualPath.lastIndexOf("/") + 1)
|
||||
.replace(/file:\/\//g, "");
|
||||
yield checkState([
|
||||
await checkState([
|
||||
[
|
||||
["cookies", actualPath],
|
||||
[
|
||||
|
@ -60,5 +60,5 @@ add_task(function* () {
|
|||
]
|
||||
]);
|
||||
|
||||
yield finishTests();
|
||||
await finishTests();
|
||||
});
|
||||
|
|
|
@ -8,17 +8,17 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
add_task(function* () {
|
||||
yield openTabAndSetupStorage(MAIN_DOMAIN + "storage-blank.html");
|
||||
yield selectTreeItem(["localStorage", "http://test1.example.org"]);
|
||||
add_task(async function() {
|
||||
await openTabAndSetupStorage(MAIN_DOMAIN + "storage-blank.html");
|
||||
await selectTreeItem(["localStorage", "http://test1.example.org"]);
|
||||
|
||||
ok(isTableEmpty(), "Table empty on init");
|
||||
|
||||
for (let i = 0; i < 10; i++) {
|
||||
yield addRemove(`test${i}`);
|
||||
await addRemove(`test${i}`);
|
||||
}
|
||||
|
||||
yield finishTests();
|
||||
await finishTests();
|
||||
});
|
||||
|
||||
function* addRemove(name) {
|
||||
|
|
|
@ -23,7 +23,7 @@ add_task(async function() {
|
|||
// debugger still turned on
|
||||
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", true);
|
||||
Services.prefs.setBoolPref("devtools.webconsole.filter.log", true);
|
||||
registerCleanupFunction(function* () {
|
||||
registerCleanupFunction(async function() {
|
||||
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
|
||||
Services.prefs.clearUserPref("devtools.webconsole.filter.log");
|
||||
});
|
||||
|
|
|
@ -563,8 +563,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let valueX = (isUnitless(x)) ? xComputed : parseFloat(x);
|
||||
let valueY = (isUnitless(y)) ? yComputed : parseFloat(y);
|
||||
|
||||
let ratioX = (valueX / xComputed) || 1;
|
||||
let ratioY = (valueY / yComputed) || 1;
|
||||
let ratioX = this.getUnitToPixelRatio(unitX, width);
|
||||
let ratioY = this.getUnitToPixelRatio(unitY, height);
|
||||
return { unitX, unitY, valueX, valueY, ratioX, ratioY };
|
||||
});
|
||||
this[_dragging] = { type, pointsInfo, x: pageX, y: pageY, bb: this.boundingBox,
|
||||
|
@ -588,8 +588,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let valueX = (isUnitless(cx)) ? cxComputed : parseFloat(cx);
|
||||
let valueY = (isUnitless(cy)) ? cyComputed : parseFloat(cy);
|
||||
|
||||
let ratioX = (valueX / cxComputed) || 1;
|
||||
let ratioY = (valueY / cyComputed) || 1;
|
||||
let ratioX = this.getUnitToPixelRatio(unitX, width);
|
||||
let ratioY = this.getUnitToPixelRatio(unitY, height);
|
||||
|
||||
let { radius } = this.origCoordinates;
|
||||
let computedSize = Math.sqrt((width ** 2) + (height ** 2)) / Math.sqrt(2);
|
||||
|
@ -597,7 +597,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let valueRad = this.origCoordUnits.radius;
|
||||
let unitRad = getUnit(valueRad);
|
||||
valueRad = (isUnitless(valueRad)) ? radius : parseFloat(valueRad);
|
||||
let ratioRad = (valueRad / radius) || 1;
|
||||
let ratioRad = this.getUnitToPixelRatio(unitRad, computedSize);
|
||||
|
||||
this[_dragging] = { type, unitX, unitY, unitRad, valueX, valueY,
|
||||
ratioX, ratioY, ratioRad, x: pageX, y: pageY,
|
||||
|
@ -621,8 +621,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let valueX = (isUnitless(cx)) ? cxComputed : parseFloat(cx);
|
||||
let valueY = (isUnitless(cy)) ? cyComputed : parseFloat(cy);
|
||||
|
||||
let ratioX = (valueX / cxComputed) || 1;
|
||||
let ratioY = (valueY / cyComputed) || 1;
|
||||
let ratioX = this.getUnitToPixelRatio(unitX, width);
|
||||
let ratioY = this.getUnitToPixelRatio(unitY, height);
|
||||
|
||||
let { rx, ry } = this.origCoordinates;
|
||||
rx = rx / 100 * width;
|
||||
|
@ -658,7 +658,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let computedValue = this.origCoordinates[point] / 100 * size;
|
||||
let unit = getUnit(value);
|
||||
value = (isUnitless(value)) ? computedValue : parseFloat(value);
|
||||
let ratio = (value / computedValue) || 1;
|
||||
let ratio = this.getUnitToPixelRatio(unit, size);
|
||||
|
||||
pointsInfo[point] = { value, unit, ratio };
|
||||
});
|
||||
|
@ -946,8 +946,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let valueX = (isUnitless(x)) ? xComputed : parseFloat(x);
|
||||
let valueY = (isUnitless(y)) ? yComputed : parseFloat(y);
|
||||
|
||||
let ratioX = (valueX / xComputed) || 1;
|
||||
let ratioY = (valueY / yComputed) || 1;
|
||||
let ratioX = this.getUnitToPixelRatio(unitX, width);
|
||||
let ratioY = this.getUnitToPixelRatio(unitY, height);
|
||||
|
||||
this.setCursor("grabbing");
|
||||
this[_dragging] = { point, unitX, unitY, valueX, valueY,
|
||||
|
@ -1041,8 +1041,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let valueX = (isUnitless(cx)) ? cxComputed : parseFloat(cx);
|
||||
let valueY = (isUnitless(cy)) ? cyComputed : parseFloat(cy);
|
||||
|
||||
let ratioX = (valueX / cxComputed) || 1;
|
||||
let ratioY = (valueY / cyComputed) || 1;
|
||||
let ratioX = this.getUnitToPixelRatio(unitX, width);
|
||||
let ratioY = this.getUnitToPixelRatio(unitY, height);
|
||||
|
||||
this[_dragging] = { point, unitX, unitY, valueX, valueY,
|
||||
ratioX, ratioY, x: pageX, y: pageY };
|
||||
|
@ -1053,7 +1053,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let value = this.coordUnits.radius;
|
||||
let unit = getUnit(value);
|
||||
value = (isUnitless(value)) ? radius : parseFloat(value);
|
||||
let ratio = (value / radius) || 1;
|
||||
let ratio = this.getUnitToPixelRatio(unit, computedSize);
|
||||
|
||||
this[_dragging] = { point, value, origRadius: radius, unit, ratio };
|
||||
}
|
||||
|
@ -1120,8 +1120,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let valueX = (isUnitless(cx)) ? cxComputed : parseFloat(cx);
|
||||
let valueY = (isUnitless(cy)) ? cyComputed : parseFloat(cy);
|
||||
|
||||
let ratioX = (valueX / cxComputed) || 1;
|
||||
let ratioY = (valueY / cyComputed) || 1;
|
||||
let ratioX = this.getUnitToPixelRatio(unitX, width);
|
||||
let ratioY = this.getUnitToPixelRatio(unitY, height);
|
||||
|
||||
this[_dragging] = { point, unitX, unitY, valueX, valueY,
|
||||
ratioX, ratioY, x: pageX, y: pageY };
|
||||
|
@ -1131,7 +1131,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let value = this.coordUnits.rx;
|
||||
let unit = getUnit(value);
|
||||
value = (isUnitless(value)) ? rx : parseFloat(value);
|
||||
let ratio = (value / rx) || 1;
|
||||
let ratio = this.getUnitToPixelRatio(unit, width);
|
||||
|
||||
this[_dragging] = { point, value, origRadius: rx, unit, ratio };
|
||||
} else if (point === "ry") {
|
||||
|
@ -1140,7 +1140,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let value = this.coordUnits.ry;
|
||||
let unit = getUnit(value);
|
||||
value = (isUnitless(value)) ? ry : parseFloat(value);
|
||||
let ratio = (value / ry) || 1;
|
||||
let ratio = this.getUnitToPixelRatio(unit, height);
|
||||
|
||||
this[_dragging] = { point, value, origRadius: ry, unit, ratio };
|
||||
}
|
||||
|
@ -1213,7 +1213,7 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
let computedValue = this.coordinates[point] / 100 * size;
|
||||
let unit = getUnit(value);
|
||||
value = (isUnitless(value)) ? computedValue : parseFloat(value);
|
||||
let ratio = (value / computedValue) || 1;
|
||||
let ratio = this.getUnitToPixelRatio(unit, size);
|
||||
let origValue = (point === "left" || point === "right") ? pageX : pageY;
|
||||
|
||||
this[_dragging] = { point, value, origValue, unit, ratio };
|
||||
|
@ -2500,6 +2500,46 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
|||
}
|
||||
return "nwse";
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a unit type, get the ratio by which to multiply a pixel value in order to
|
||||
* convert pixels to that unit.
|
||||
*
|
||||
* Percentage units (%) are relative to a size. This must be provided when requesting
|
||||
* a ratio for converting from pixels to percentages.
|
||||
*
|
||||
* @param {String} unit
|
||||
* One of: %, em, rem, vw, vh
|
||||
* @param {Number} size
|
||||
* Size to which percentage values are relative to.
|
||||
* @return {Number}
|
||||
*/
|
||||
getUnitToPixelRatio(unit, size) {
|
||||
let ratio;
|
||||
switch (unit) {
|
||||
case "%":
|
||||
ratio = 100 / size;
|
||||
break;
|
||||
case "em":
|
||||
ratio = 1 / parseFloat(getComputedStyle(this.currentNode).fontSize);
|
||||
break;
|
||||
case "rem":
|
||||
const root = this.currentNode.ownerDocument.documentElement;
|
||||
ratio = 1 / parseFloat(getComputedStyle(root).fontSize);
|
||||
break;
|
||||
case "vw":
|
||||
ratio = 100 / this.win.innerWidth;
|
||||
break;
|
||||
case "vh":
|
||||
ratio = 100 / this.win.innerHeight;
|
||||
break;
|
||||
default:
|
||||
// If unit is not recognized, peg ratio 1:1 to pixels.
|
||||
ratio = 1;
|
||||
}
|
||||
|
||||
return ratio;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2689,11 +2729,10 @@ exports.getUnit = getUnit;
|
|||
* @returns {Boolean} whether the given value has a unit.
|
||||
*/
|
||||
const isUnitless = (point) => {
|
||||
// We treat all values that evaluate to 0 as unitless, regardless of whether
|
||||
// they originally had a unit.
|
||||
return !point ||
|
||||
!point.match(/[^\d]+$/) ||
|
||||
parseFloat(point) === 0 ||
|
||||
// If zero doesn't have a unit, its numeric and string forms should be equal.
|
||||
(parseFloat(point) === 0 && (parseFloat(point).toString() === point)) ||
|
||||
point.includes("(") ||
|
||||
point === "closest-side" ||
|
||||
point === "farthest-side";
|
||||
|
|
|
@ -606,7 +606,7 @@ previewers.Object = [
|
|||
|
||||
if (rawObj instanceof Ci.nsIDOMDocument && rawObj.location) {
|
||||
preview.location = hooks.createValueGrip(rawObj.location.href);
|
||||
} else if (rawObj instanceof Ci.nsIDOMDocumentFragment) {
|
||||
} else if (obj.class == "DocumentFragment") {
|
||||
preview.childNodesLength = rawObj.childNodes.length;
|
||||
|
||||
if (hooks.getGripDepth() < 2) {
|
||||
|
|
|
@ -168,10 +168,16 @@ function test_get_unit() {
|
|||
expr: "0", expected: "px"
|
||||
}, {
|
||||
desc: "getUnit with 0%",
|
||||
expr: "0%", expected: "px"
|
||||
expr: "0%", expected: "%"
|
||||
}, {
|
||||
desc: "getUnit with no unit",
|
||||
expr: "30", expected: "px"
|
||||
desc: "getUnit with 0.00%",
|
||||
expr: "0.00%", expected: "%"
|
||||
}, {
|
||||
desc: "getUnit with 0px",
|
||||
expr: "0px", expected: "px"
|
||||
}, {
|
||||
desc: "getUnit with 0em",
|
||||
expr: "0em", expected: "em"
|
||||
}, {
|
||||
desc: "getUnit with calc",
|
||||
expr: "calc(30px + 5%)", expected: "px"
|
||||
|
|
|
@ -262,7 +262,6 @@ exports.globals = {
|
|||
define(factory) {
|
||||
factory(this.require, this.exports, this.module);
|
||||
},
|
||||
DocumentFragment: Ci.nsIDOMDocumentFragment,
|
||||
Element: Ci.nsIDOMElement,
|
||||
FormData,
|
||||
isWorker: false,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// Test that the HeapAnalyses{Client,Worker} can send SavedFrame stacks from
|
||||
// by-allocation-stack reports from the worker.
|
||||
|
||||
add_task(function* test() {
|
||||
add_task(async function test() {
|
||||
const client = new HeapAnalysesClient();
|
||||
|
||||
// Track some allocation stacks.
|
||||
|
@ -40,13 +40,13 @@ add_task(function* test() {
|
|||
// Take a heap snapshot.
|
||||
|
||||
const snapshotFilePath = saveNewHeapSnapshot({ debugger: dbg });
|
||||
yield client.readHeapSnapshot(snapshotFilePath);
|
||||
await client.readHeapSnapshot(snapshotFilePath);
|
||||
ok(true, "Should have read the heap snapshot");
|
||||
|
||||
// Run a census broken down by class name -> allocation stack so we can grab
|
||||
// only the AllocationMarker objects we have complete control over.
|
||||
|
||||
const { report } = yield client.takeCensus(
|
||||
const { report } = await client.takeCensus(
|
||||
snapshotFilePath,
|
||||
{
|
||||
breakdown: {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
const { localizeMarkup, LocalizationHelper } = require("devtools/shared/l10n");
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function() {
|
||||
info("Check that the strings used for this test are still valid");
|
||||
let STARTUP_L10N = new LocalizationHelper("devtools/client/locales/startup.properties");
|
||||
let TOOLBOX_L10N = new LocalizationHelper("devtools/client/locales/toolbox.properties");
|
||||
|
|
|
@ -23,11 +23,13 @@ DOMPrefs::Initialize()
|
|||
|
||||
#define DOM_PREF(name, pref) DOMPrefs::name();
|
||||
#define DOM_WEBIDL_PREF(name)
|
||||
#define DOM_UINT32_PREF(name, pref, defaultValue) DOMPrefs::name();
|
||||
|
||||
#include "DOMPrefsInternal.h"
|
||||
|
||||
#undef DOM_PREF
|
||||
#undef DOM_WEBIDL_PREF
|
||||
#undef DOM_UINT32_PREF
|
||||
}
|
||||
|
||||
#define DOM_PREF(name, pref) \
|
||||
|
@ -50,6 +52,19 @@ DOMPrefs::Initialize()
|
|||
return DOMPrefs::name(); \
|
||||
}
|
||||
|
||||
#define DOM_UINT32_PREF(name, pref, defaultValue) \
|
||||
/* static */ uint32_t \
|
||||
DOMPrefs::name() \
|
||||
{ \
|
||||
static bool initialized = false; \
|
||||
static Atomic<uint32_t> cachedValue; \
|
||||
if (!initialized) { \
|
||||
initialized = true; \
|
||||
Preferences::AddAtomicUintVarCache(&cachedValue, pref, defaultValue); \
|
||||
} \
|
||||
return cachedValue; \
|
||||
}
|
||||
|
||||
#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
|
||||
DOM_PREF(DumpEnabled, "browser.dom.window.dump.enabled")
|
||||
#else
|
||||
|
@ -64,6 +79,7 @@ DOMPrefs::DumpEnabled()
|
|||
|
||||
#undef DOM_PREF
|
||||
#undef DOM_WEBIDL_PREF
|
||||
#undef DOM_UINT32_PREF
|
||||
|
||||
} // dom namespace
|
||||
} // mozilla namespace
|
||||
|
|
|
@ -21,11 +21,13 @@ public:
|
|||
|
||||
#define DOM_PREF(name, pref) static bool name();
|
||||
#define DOM_WEBIDL_PREF(name) static bool name(JSContext* aCx, JSObject* aObj);
|
||||
#define DOM_UINT32_PREF(name, pref, defaultValue) static uint32_t name();
|
||||
|
||||
#include "DOMPrefsInternal.h"
|
||||
|
||||
#undef DOM_PREF
|
||||
#undef DOM_WEBIDL_PREF
|
||||
#undef DOM_UINT32_PREF
|
||||
};
|
||||
|
||||
} // dom namespace
|
||||
|
|
|
@ -56,3 +56,7 @@ DOM_WEBIDL_PREF(WebkitBlinkDirectoryPickerEnabled)
|
|||
DOM_WEBIDL_PREF(NetworkInformationEnabled)
|
||||
DOM_WEBIDL_PREF(FetchObserverEnabled)
|
||||
DOM_WEBIDL_PREF(PerformanceObserverEnabled)
|
||||
|
||||
DOM_UINT32_PREF(WorkerCancelingTimeoutMillis,
|
||||
"dom.worker.canceling.timeoutMilliseconds",
|
||||
30000 /* 30 seconds */)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/*
|
||||
* Implementation of DOM Core's nsIDOMDocumentFragment.
|
||||
* Implementation of DOM Core's DocumentFragment.
|
||||
*/
|
||||
|
||||
#include "mozilla/dom/DocumentFragment.h"
|
||||
|
@ -119,7 +119,6 @@ NS_INTERFACE_MAP_BEGIN(DocumentFragment)
|
|||
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(DocumentFragment)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContent)
|
||||
NS_INTERFACE_MAP_ENTRY(nsINode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMDocumentFragment)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNode)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(mozilla::dom::EventTarget)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/BorrowedAttrInfo.h"
|
||||
#include "mozilla/dom/FragmentOrElement.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsStringFwd.h"
|
||||
|
||||
class nsAtom;
|
||||
|
@ -23,7 +23,7 @@ namespace dom {
|
|||
class Element;
|
||||
|
||||
class DocumentFragment : public FragmentOrElement,
|
||||
public nsIDOMDocumentFragment
|
||||
public nsIDOMNode
|
||||
{
|
||||
private:
|
||||
void Init()
|
||||
|
@ -45,9 +45,6 @@ public:
|
|||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DocumentFragment, FragmentOrElement)
|
||||
|
||||
// interface nsIDOMDocumentFragment
|
||||
NS_DECL_NSIDOMDOCUMENTFRAGMENT
|
||||
|
||||
explicit DocumentFragment(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
||||
: FragmentOrElement(aNodeInfo), mHost(nullptr)
|
||||
{
|
||||
|
|
|
@ -3869,15 +3869,11 @@ Element::SetOuterHTML(const nsAString& aOuterHTML, ErrorResult& aError)
|
|||
context = NS_NewHTMLBodyElement(info.forget(), FROM_PARSER_FRAGMENT);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentFragment> df;
|
||||
aError = nsContentUtils::CreateContextualFragment(context,
|
||||
aOuterHTML,
|
||||
true,
|
||||
getter_AddRefs(df));
|
||||
RefPtr<DocumentFragment> fragment =
|
||||
nsContentUtils::CreateContextualFragment(context, aOuterHTML, true, aError);
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
}
|
||||
nsCOMPtr<nsINode> fragment = do_QueryInterface(df);
|
||||
parent->ReplaceChild(*fragment, *this, aError);
|
||||
}
|
||||
|
||||
|
@ -3954,17 +3950,12 @@ Element::InsertAdjacentHTML(const nsAString& aPosition, const nsAString& aText,
|
|||
}
|
||||
|
||||
// couldn't parse directly
|
||||
nsCOMPtr<nsIDOMDocumentFragment> df;
|
||||
aError = nsContentUtils::CreateContextualFragment(destination,
|
||||
aText,
|
||||
true,
|
||||
getter_AddRefs(df));
|
||||
RefPtr<DocumentFragment> fragment =
|
||||
nsContentUtils::CreateContextualFragment(destination, aText, true, aError);
|
||||
if (aError.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINode> fragment = do_QueryInterface(df);
|
||||
|
||||
// Suppress assertion about node removal mutation events that can't have
|
||||
// listeners anyway, because no one has had the chance to register mutation
|
||||
// listeners on the fragment that comes from the parser.
|
||||
|
|
|
@ -68,6 +68,7 @@ EXPORTS += [
|
|||
'nsDOMString.h',
|
||||
'nsDOMTokenList.h',
|
||||
'nsFocusManager.h',
|
||||
'nsFrameLoader.h', # Because binding headers include it.
|
||||
'nsFrameMessageManager.h',
|
||||
'nsGlobalWindow.h', # Because binding headers include it.
|
||||
'nsGlobalWindowInner.h', # Because binding headers include it.
|
||||
|
|
|
@ -4929,19 +4929,6 @@ nsContentUtils::IsValidNodeName(nsAtom *aLocalName, nsAtom *aPrefix,
|
|||
(aNamespaceID == kNameSpaceID_XML || aPrefix != nsGkAtoms::xml);
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsresult
|
||||
nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
|
||||
const nsAString& aFragment,
|
||||
bool aPreventScriptExecution,
|
||||
nsIDOMDocumentFragment** aReturn)
|
||||
{
|
||||
ErrorResult rv;
|
||||
*aReturn = CreateContextualFragment(aContextNode, aFragment,
|
||||
aPreventScriptExecution, rv).take();
|
||||
return rv.StealNSResult();
|
||||
}
|
||||
|
||||
already_AddRefed<DocumentFragment>
|
||||
nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
|
||||
const nsAString& aFragment,
|
||||
|
@ -5053,11 +5040,11 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
|
|||
content = content->GetParent();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentFragment> frag;
|
||||
RefPtr<DocumentFragment> frag;
|
||||
aRv = ParseFragmentXML(aFragment, document, tagStack,
|
||||
aPreventScriptExecution, getter_AddRefs(frag),
|
||||
aSanitize);
|
||||
return frag.forget().downcast<DocumentFragment>();
|
||||
return frag.forget();
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -5168,7 +5155,7 @@ nsContentUtils::ParseFragmentXML(const nsAString& aSourceBuffer,
|
|||
nsIDocument* aDocument,
|
||||
nsTArray<nsString>& aTagStack,
|
||||
bool aPreventScriptExecution,
|
||||
nsIDOMDocumentFragment** aReturn,
|
||||
DocumentFragment** aReturn,
|
||||
SanitizeFragments aSanitize)
|
||||
{
|
||||
AutoTimelineMarker m(aDocument->GetDocShell(), "Parse XML");
|
||||
|
@ -5217,13 +5204,11 @@ nsContentUtils::ParseFragmentXML(const nsAString& aSourceBuffer,
|
|||
// Don't fire mutation events for nodes removed by the sanitizer.
|
||||
nsAutoScriptBlockerSuppressNodeRemoved scriptBlocker;
|
||||
|
||||
RefPtr<DocumentFragment> fragment = static_cast<DocumentFragment*>(*aReturn);
|
||||
|
||||
nsTreeSanitizer sanitizer(nsIParserUtils::SanitizerAllowStyle |
|
||||
nsIParserUtils::SanitizerAllowComments |
|
||||
nsIParserUtils::SanitizerDropForms |
|
||||
nsIParserUtils::SanitizerLogRemovals);
|
||||
sanitizer.Sanitize(fragment);
|
||||
sanitizer.Sanitize(*aReturn);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -70,7 +70,6 @@ class nsIContentSecurityPolicy;
|
|||
class nsIDocShellTreeItem;
|
||||
class nsIDocumentLoaderFactory;
|
||||
class nsIDOMDocument;
|
||||
class nsIDOMDocumentFragment;
|
||||
class nsIDOMEvent;
|
||||
class nsIDOMNode;
|
||||
class nsIDragSession;
|
||||
|
@ -1630,10 +1629,6 @@ public:
|
|||
* @param aSanitize whether the fragment should be sanitized prior to
|
||||
* injection
|
||||
*/
|
||||
static nsresult CreateContextualFragment(nsINode* aContextNode,
|
||||
const nsAString& aFragment,
|
||||
bool aPreventScriptExecution,
|
||||
nsIDOMDocumentFragment** aReturn);
|
||||
static already_AddRefed<mozilla::dom::DocumentFragment>
|
||||
CreateContextualFragment(nsINode* aContextNode, const nsAString& aFragment,
|
||||
bool aPreventScriptExecution,
|
||||
|
@ -1690,7 +1685,7 @@ public:
|
|||
nsIDocument* aDocument,
|
||||
nsTArray<nsString>& aTagStack,
|
||||
bool aPreventScriptExecution,
|
||||
nsIDOMDocumentFragment** aReturn,
|
||||
mozilla::dom::DocumentFragment** aReturn,
|
||||
SanitizeFragments aSanitize = SanitizeSystemPrivileged);
|
||||
|
||||
/**
|
||||
|
|
|
@ -1670,7 +1670,7 @@ nsDOMWindowUtils::GetScrollbarSize(bool aFlushLayout, int32_t* aWidth,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetBoundsWithoutFlushing(nsIDOMElement *aElement,
|
||||
nsISupports** aResult)
|
||||
DOMRect** aResult)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryReferent(mWindow);
|
||||
NS_ENSURE_STATE(window);
|
||||
|
@ -1739,7 +1739,7 @@ nsDOMWindowUtils::FlushLayoutWithoutThrottledAnimations()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetRootBounds(nsISupports** aResult)
|
||||
nsDOMWindowUtils::GetRootBounds(DOMRect** aResult)
|
||||
{
|
||||
nsIDocument* doc = GetDocument();
|
||||
NS_ENSURE_STATE(doc);
|
||||
|
|
|
@ -2522,9 +2522,8 @@ GetContentParent(Element* aBrowser)
|
|||
return ReturnTuple(nullptr, nullptr);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> otherLoaderAsSupports;
|
||||
browser->GetSameProcessAsFrameLoader(getter_AddRefs(otherLoaderAsSupports));
|
||||
RefPtr<nsFrameLoader> otherLoader = do_QueryObject(otherLoaderAsSupports);
|
||||
RefPtr<nsFrameLoader> otherLoader;
|
||||
browser->GetSameProcessAsFrameLoader(getter_AddRefs(otherLoader));
|
||||
if (!otherLoader) {
|
||||
return ReturnTuple(nullptr, nullptr);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ interface nsICursorContinueCallback : nsISupports
|
|||
void handleContinue();
|
||||
};
|
||||
|
||||
[builtinclass, uuid(062ea35a-5158-425a-b7bc-3ae9daa84398)]
|
||||
[uuid(062ea35a-5158-425a-b7bc-3ae9daa84398)]
|
||||
interface nsIDOMDOMCursor : nsISupports
|
||||
{
|
||||
readonly attribute boolean done;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
interface mozIDOMWindow;
|
||||
interface nsICursorContinueCallback;
|
||||
|
||||
[builtinclass, uuid(e39da69e-2232-4e49-9856-b8a4a6210336)]
|
||||
[shim(DOMRequest), uuid(e39da69e-2232-4e49-9856-b8a4a6210336)]
|
||||
interface nsIDOMDOMRequest : nsIDOMEventTarget
|
||||
{
|
||||
readonly attribute DOMString readyState; // "pending" or "done"
|
||||
|
|
|
@ -19,7 +19,7 @@ interface nsIGlobalObject;
|
|||
* parsing with the XMLHttpRequest interface, which can be used for
|
||||
* asynchronous (callback-based) loading.
|
||||
*/
|
||||
[uuid(70b9600e-8622-4c93-9ad8-22c28058dc44)]
|
||||
[shim(DOMParser), uuid(70b9600e-8622-4c93-9ad8-22c28058dc44)]
|
||||
interface nsIDOMParser : nsISupports
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
interface nsIDOMEvent;
|
||||
|
||||
webidl DragEvent;
|
||||
webidl DataTransfer;
|
||||
|
||||
[scriptable, uuid(69E14F91-2E09-4CA6-A511-A715C99A2804)]
|
||||
interface nsIDroppedLinkItem : nsISupports
|
||||
{
|
||||
|
@ -37,10 +40,8 @@ interface nsIDroppedLinkHandler : nsISupports
|
|||
* of the source of the drag is different from the destination. This check
|
||||
* includes any parent, sibling and child frames in the same content tree.
|
||||
* If true, the source is not checked.
|
||||
*
|
||||
* aEvent should be a DragEvent. See bug 1444991.
|
||||
*/
|
||||
boolean canDropLink(in nsIDOMEvent aEvent, in boolean aAllowSameDocument);
|
||||
boolean canDropLink(in DragEvent aEvent, in boolean aAllowSameDocument);
|
||||
|
||||
/**
|
||||
* Given a drop event aEvent, determines the link being dragged and returns
|
||||
|
@ -58,10 +59,8 @@ interface nsIDroppedLinkHandler : nsISupports
|
|||
*
|
||||
* aName is filled in with the link title if it exists, or an empty string
|
||||
* otherwise.
|
||||
*
|
||||
* aEvent should be a DragEvent. See bug 1444991.
|
||||
*/
|
||||
AString dropLink(in nsIDOMEvent aEvent, out AString aName,
|
||||
AString dropLink(in DragEvent aEvent, out AString aName,
|
||||
[optional] in boolean aDisallowInherit);
|
||||
|
||||
/**
|
||||
|
@ -77,10 +76,8 @@ interface nsIDroppedLinkHandler : nsISupports
|
|||
* the user into a dragging a chrome url, for example.
|
||||
* - aDisallowInherit is true, and the URI being dropped would inherit the
|
||||
* current document's security context (URI_INHERITS_SECURITY_CONTEXT).
|
||||
*
|
||||
* aEvent should be a DragEvent. See bug 1444991.
|
||||
*/
|
||||
void dropLinks(in nsIDOMEvent aEvent,
|
||||
void dropLinks(in DragEvent aEvent,
|
||||
[optional] in boolean aDisallowInherit,
|
||||
[optional] out unsigned long aCount,
|
||||
[retval, array, size_is(aCount)] out nsIDroppedLinkItem aLinks);
|
||||
|
@ -89,10 +86,8 @@ interface nsIDroppedLinkHandler : nsISupports
|
|||
* Given a drop event aEvent, validate the extra URIs for the event,
|
||||
* this is used when the caller extracts yet another URIs from the dropped
|
||||
* text, like home button that splits the text with "|".
|
||||
*
|
||||
* aEvent should be a DragEvent. See bug 1444991.
|
||||
*/
|
||||
void validateURIsForDrop(in nsIDOMEvent aEvent,
|
||||
void validateURIsForDrop(in DragEvent aEvent,
|
||||
in unsigned long aURIsCount,
|
||||
[array, size_is(aURIsCount)] in wstring aURIs,
|
||||
[optional] in boolean aDisallowInherit);
|
||||
|
@ -102,18 +97,14 @@ interface nsIDroppedLinkHandler : nsISupports
|
|||
* dragged. Since drag/drop performs a roundtrip of parent, child, parent,
|
||||
* it allows the parent to verify that the child did not modify links
|
||||
* being dropped.
|
||||
*
|
||||
* @param dataTransfer is a DataTransfer. See bug 1444991.
|
||||
*/
|
||||
void queryLinks(in nsISupports aDataTransfer,
|
||||
void queryLinks(in DataTransfer aDataTransfer,
|
||||
[optional] out unsigned long aCount,
|
||||
[retval, array, size_is(aCount)] out nsIDroppedLinkItem aLinks);
|
||||
|
||||
/**
|
||||
* Given a drop event aEvent, determines the triggering principal for the
|
||||
* event and returns it.
|
||||
*
|
||||
* aEvent should be a DragEvent. See bug 1444991.
|
||||
*/
|
||||
nsIPrincipal getTriggeringPrincipal(in nsIDOMEvent aEvent);
|
||||
nsIPrincipal getTriggeringPrincipal(in DragEvent aEvent);
|
||||
};
|
||||
|
|
|
@ -7,12 +7,14 @@
|
|||
|
||||
interface nsIContent;
|
||||
|
||||
[uuid(bb5d79e4-e73c-45e7-9651-4d718f4b994c)]
|
||||
[shim(MessageSender), shimfile(MessageManager),
|
||||
uuid(bb5d79e4-e73c-45e7-9651-4d718f4b994c)]
|
||||
interface nsIMessageSender : nsISupports
|
||||
{
|
||||
};
|
||||
|
||||
[uuid(694e367c-aa25-4446-8499-2c527c4bd838)]
|
||||
[shim(ContentFrameMessageManager), shimfile(MessageManager),
|
||||
uuid(694e367c-aa25-4446-8499-2c527c4bd838)]
|
||||
interface nsIContentFrameMessageManager : nsIMessageSender
|
||||
{
|
||||
};
|
||||
|
|
|
@ -25,7 +25,7 @@ class Selection;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(e0a4d4b3-f34e-44bd-b1f2-4e3bde9b6915)]
|
||||
[shim(Selection), uuid(e0a4d4b3-f34e-44bd-b1f2-4e3bde9b6915)]
|
||||
interface nsISelection : nsISupports
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsError.h"
|
||||
|
|
|
@ -386,7 +386,7 @@ private:
|
|||
/**
|
||||
* Cut or delete the range's contents.
|
||||
*
|
||||
* @param aFragment nsIDOMDocumentFragment containing the nodes.
|
||||
* @param aFragment DocumentFragment containing the nodes.
|
||||
* May be null to indicate the caller doesn't want a fragment.
|
||||
*/
|
||||
nsresult CutContents(mozilla::dom::DocumentFragment** frag);
|
||||
|
|
|
@ -56,7 +56,7 @@ function dumpFragment(aFragment) {
|
|||
* @return nsIDOMNode The target node retrieved from the XPath.
|
||||
*/
|
||||
function evalXPathInDocumentFragment(aContextNode, aPath) {
|
||||
Assert.ok(aContextNode instanceof Ci.nsIDOMDocumentFragment);
|
||||
Assert.equal(ChromeUtils.getClassName(aContextNode), "DocumentFragment");
|
||||
Assert.ok(aContextNode.childNodes.length > 0);
|
||||
if (aPath == ".") {
|
||||
return aContextNode;
|
||||
|
@ -149,7 +149,7 @@ function evalXPathInDocumentFragment(aContextNode, aPath) {
|
|||
*/
|
||||
function getRange(aSourceNode, aFragment) {
|
||||
Assert.ok(aSourceNode instanceof Ci.nsIDOMElement);
|
||||
Assert.ok(aFragment instanceof Ci.nsIDOMDocumentFragment);
|
||||
Assert.equal(ChromeUtils.getClassName(aFragment), "DocumentFragment");
|
||||
var doc = aSourceNode.ownerDocument;
|
||||
|
||||
var containerPath = aSourceNode.getAttribute("startContainer");
|
||||
|
|
|
@ -311,15 +311,15 @@ BroadcastChannel::Constructor(const GlobalObject& aGlobal,
|
|||
// We are already shutting down the worker. Let's return a non-active
|
||||
// object.
|
||||
if (NS_WARN_IF(!workerRef)) {
|
||||
bc->mState = StateClosed;
|
||||
return bc.forget();
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<ThreadSafeWorkerRef> tsr = new ThreadSafeWorkerRef(workerRef);
|
||||
|
||||
RefPtr<InitializeRunnable> runnable =
|
||||
new InitializeRunnable(tsr, origin, principalInfo, aRv);
|
||||
runnable->Dispatch(Closing, aRv);
|
||||
runnable->Dispatch(Canceling, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -68,11 +68,6 @@ private:
|
|||
|
||||
~BroadcastChannel();
|
||||
|
||||
void PostMessageData(BroadcastChannelMessage* aData);
|
||||
|
||||
void PostMessageInternal(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void RemoveDocFromBFCache();
|
||||
|
||||
void DisconnectFromOwner() override;
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
interface nsIDOMDOMRequest;
|
||||
|
||||
webidl FrameLoader;
|
||||
|
||||
[scriptable, function, uuid(00d0e19d-bd67-491f-8e85-b9905224d3bb)]
|
||||
interface nsIBrowserElementNextPaintListener : nsISupports
|
||||
{
|
||||
|
@ -39,8 +41,7 @@ interface nsIBrowserElementAPI : nsISupports
|
|||
*/
|
||||
void destroyFrameScripts();
|
||||
|
||||
// The argument should be a FrameLoader. Fix that when bug 1444991 is fixed.
|
||||
void setFrameLoader(in nsISupports frameLoader);
|
||||
void setFrameLoader(in FrameLoader frameLoader);
|
||||
|
||||
void sendMouseEvent(in DOMString type,
|
||||
in uint32_t x,
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "nsIChannel.h"
|
||||
#include "nsIChannelEventSink.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIHttpChannelInternal.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
||||
|
@ -125,17 +126,26 @@ class ClientChannelHelper final : public nsIInterfaceRequestor
|
|||
newLoadInfo->GiveReservedClientSource(Move(reservedClient));
|
||||
}
|
||||
|
||||
uint32_t redirectMode = nsIHttpChannelInternal::REDIRECT_MODE_MANUAL;
|
||||
nsCOMPtr<nsIHttpChannelInternal> http = do_QueryInterface(aOldChannel);
|
||||
if (http) {
|
||||
MOZ_ALWAYS_SUCCEEDS(http->GetRedirectMode(&redirectMode));
|
||||
}
|
||||
|
||||
// Normally we keep the controller across channel redirects, but we must
|
||||
// clear it when a non-subresource load redirects. Only do this for real
|
||||
// clear it when a document load redirects. Only do this for real
|
||||
// redirects, however.
|
||||
//
|
||||
// There is an open spec question about what to do in this case for
|
||||
// worker script redirects. For now we clear the controller as that
|
||||
// seems most sane. See:
|
||||
// This is effectively described in step 4.2 of:
|
||||
//
|
||||
// https://github.com/w3c/ServiceWorker/issues/1239
|
||||
// https://fetch.spec.whatwg.org/#http-fetch
|
||||
//
|
||||
if (!(aFlags & nsIChannelEventSink::REDIRECT_INTERNAL)) {
|
||||
// The spec sets the service-workers mode to none when the request is
|
||||
// configured to *not* follow redirects. This prevents any further
|
||||
// service workers from intercepting. The first service worker that
|
||||
// had a shot at the FetchEvent remains the controller in this case.
|
||||
if (!(aFlags & nsIChannelEventSink::REDIRECT_INTERNAL) &&
|
||||
redirectMode != nsIHttpChannelInternal::REDIRECT_MODE_FOLLOW) {
|
||||
newLoadInfo->ClearController();
|
||||
}
|
||||
|
||||
|
|
|
@ -443,7 +443,7 @@ FileReaderSync::SyncRead(nsIInputStream* aStream, char* aBuffer,
|
|||
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
|
||||
MOZ_ASSERT(workerPrivate);
|
||||
|
||||
AutoSyncLoopHolder syncLoop(workerPrivate, Closing);
|
||||
AutoSyncLoopHolder syncLoop(workerPrivate, Terminating);
|
||||
|
||||
nsCOMPtr<nsIEventTarget> syncLoopTarget = syncLoop.GetEventTarget();
|
||||
if (!syncLoopTarget) {
|
||||
|
|
|
@ -979,7 +979,7 @@ HTMLFormElement::NotifySubmitObservers(nsIURI* aActionURL,
|
|||
nsCOMPtr<nsIFormSubmitObserver> formSubmitObserver(
|
||||
do_QueryInterface(inst));
|
||||
if (formSubmitObserver) {
|
||||
rv = formSubmitObserver->Notify(static_cast<nsIContent*>(this),
|
||||
rv = formSubmitObserver->Notify(this,
|
||||
window ? window->GetCurrentInnerWindow() : nullptr,
|
||||
aActionURL,
|
||||
aCancelSubmit);
|
||||
|
@ -1977,7 +1977,7 @@ HTMLFormElement::CheckValidFormSubmission()
|
|||
observer = do_QueryInterface(inst);
|
||||
|
||||
if (observer) {
|
||||
observer->NotifyInvalidSubmit(static_cast<nsIContent*>(this),
|
||||
observer->NotifyInvalidSubmit(this,
|
||||
static_cast<nsIArray*>(invalidElements));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ nsBrowserElement::InitBrowserElementAPI()
|
|||
return;
|
||||
}
|
||||
}
|
||||
mBrowserElementAPI->SetFrameLoader(ToSupports(frameLoader));
|
||||
mBrowserElementAPI->SetFrameLoader(frameLoader);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "nsIContentViewer.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsMappedAttributes.h"
|
||||
|
|
|
@ -10,14 +10,14 @@ interface mozIDOMWindow;
|
|||
interface nsIURI;
|
||||
interface nsIArray;
|
||||
|
||||
webidl HTMLFormElement;
|
||||
|
||||
[scriptable, uuid(867cb7e7-835d-408b-9788-d2834d284e03)]
|
||||
interface nsIFormSubmitObserver: nsISupports
|
||||
{
|
||||
// formNode must be a HTMLFormElement (bug 1444991 can clean it up)
|
||||
void notify(in nsISupports formNode, in mozIDOMWindow window, in nsIURI actionURL, out boolean cancelSubmit);
|
||||
void notify(in HTMLFormElement formNode, in mozIDOMWindow window, in nsIURI actionURL, out boolean cancelSubmit);
|
||||
|
||||
// formNode must be a HTMLFormElement (bug 1444991 can clean it up)
|
||||
void notifyInvalidSubmit(in nsISupports formNode,
|
||||
void notifyInvalidSubmit(in HTMLFormElement formNode,
|
||||
in nsIArray invalidElements);
|
||||
};
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ typedef unsigned long long nsViewID;
|
|||
|
||||
// Core
|
||||
interface nsIDOMDocument;
|
||||
interface nsIDOMDocumentFragment;
|
||||
interface nsIDOMElement;
|
||||
interface nsIDOMNode;
|
||||
interface nsIDOMNodeList;
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
interface nsIPrincipal;
|
||||
|
||||
webidl FrameLoader;
|
||||
|
||||
[scriptable, uuid(14e5a0cb-e223-4202-95e8-fe53275193ea)]
|
||||
interface nsIBrowser : nsISupports
|
||||
{
|
||||
|
@ -14,11 +16,8 @@ interface nsIBrowser : nsISupports
|
|||
* this frame loader for any new tab parents. For example, view source
|
||||
* browsers set this to the frame loader for the original content to ensure
|
||||
* they are loaded in the same process as the content.
|
||||
*
|
||||
* This returns a FrameLoader, but we have no good way to represent
|
||||
* one in xpidl. Fix this when bug 1444991 is fixed.
|
||||
*/
|
||||
readonly attribute nsISupports sameProcessAsFrameLoader;
|
||||
readonly attribute FrameLoader sameProcessAsFrameLoader;
|
||||
|
||||
/*
|
||||
* Called by the child to inform the parent that links are dropped into
|
||||
|
|
|
@ -49,6 +49,8 @@ interface nsIContentPermissionRequest;
|
|||
interface nsIObserver;
|
||||
interface nsIDOMStorage;
|
||||
|
||||
webidl DOMRect;
|
||||
|
||||
[scriptable, uuid(4d6732ca-9da7-4176-b8a1-8dde15cd0bf9)]
|
||||
interface nsIDOMWindowUtils : nsISupports {
|
||||
|
||||
|
@ -842,9 +844,8 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||
|
||||
/**
|
||||
* Returns the given element's bounds without flushing pending layout changes.
|
||||
* The returned object is a DOMRect (bug 1444991 may remove this walkaround).
|
||||
*/
|
||||
nsISupports getBoundsWithoutFlushing(in nsIDOMElement aElement);
|
||||
DOMRect getBoundsWithoutFlushing(in nsIDOMElement aElement);
|
||||
|
||||
const long FLUSH_NONE = -1;
|
||||
const long FLUSH_STYLE = 0;
|
||||
|
@ -866,9 +867,8 @@ interface nsIDOMWindowUtils : nsISupports {
|
|||
* Returns the bounds of the window's currently loaded document. This will
|
||||
* generally be (0, 0, pageWidth, pageHeight) but in some cases (e.g. RTL
|
||||
* documents) may have a negative left value.
|
||||
* The returned object is a DOMRect (bug 1444991 may remove this walkaround).
|
||||
*/
|
||||
nsISupports getRootBounds();
|
||||
DOMRect getRootBounds();
|
||||
|
||||
/**
|
||||
* Get IME open state. TRUE means 'Open', otherwise, 'Close'.
|
||||
|
|
|
@ -138,12 +138,6 @@ interface nsIServiceWorkerManager : nsISupports
|
|||
in nsIServiceWorkerUnregisterCallback aCallback,
|
||||
in DOMString aScope);
|
||||
|
||||
// Returns a Promise
|
||||
nsISupports getRegistrations(in mozIDOMWindow aWindow);
|
||||
|
||||
// Returns a Promise
|
||||
nsISupports getRegistration(in mozIDOMWindow aWindow, in DOMString aScope);
|
||||
|
||||
nsIServiceWorkerRegistrationInfo getRegistrationByPrincipal(in nsIPrincipal aPrincipal,
|
||||
in DOMString aScope);
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ with Files("**"):
|
|||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMDocument.idl',
|
||||
'nsIDOMDocumentFragment.idl',
|
||||
'nsIDOMElement.idl',
|
||||
'nsIDOMNode.idl',
|
||||
'nsIDOMNodeList.idl',
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[uuid(b15fa0f4-97c1-4388-af62-2ceff7a89bdf)]
|
||||
[shim(Document), uuid(b15fa0f4-97c1-4388-af62-2ceff7a89bdf)]
|
||||
interface nsIDOMDocument : nsIDOMNode
|
||||
{
|
||||
};
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMNode.idl"
|
||||
|
||||
/**
|
||||
* DocumentFragment is a "lightweight" or "minimal" Document object.
|
||||
* nsIDOMDocumentFragment is used in situations where the Document
|
||||
* interface can potentially be a heavyweight interface.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(48eb8d72-95bb-402e-a8fc-f2b187abcbdb)]
|
||||
interface nsIDOMDocumentFragment : nsIDOMNode
|
||||
{
|
||||
};
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче