зеркало из https://github.com/mozilla/gecko-dev.git
merge fx-team to mozilla-central a=merge
--HG-- rename : browser/base/content/test/general/browser_bug550565.js => browser/base/content/test/general/browser_bug408415.js rename : browser/base/content/test/general/file_bug550565_favicon.ico => browser/base/content/test/general/file_generic_favicon.ico rename : browser/base/content/test/general/file_bug550565_popup.html => browser/base/content/test/general/file_with_favicon.html extra : rebase_source : 07fe5cfcd64f0ecd8eb1b849c50e65bfcbc2a77f
This commit is contained in:
Коммит
42caa9c913
|
@ -1102,6 +1102,12 @@ var gBrowserInit = {
|
|||
// the original tab in the other window.
|
||||
let tabToOpen = uriToLoad;
|
||||
|
||||
// If this tab was passed as a window argument, clear the
|
||||
// reference to it from the arguments array.
|
||||
if (window.arguments[0] == tabToOpen) {
|
||||
window.arguments[0] = null;
|
||||
}
|
||||
|
||||
// Stop the about:blank load
|
||||
gBrowser.stop();
|
||||
// make sure it has a docshell
|
||||
|
|
|
@ -694,20 +694,21 @@ Sanitizer.sanitize = function(aParentWindow)
|
|||
Sanitizer.onStartup = Task.async(function*() {
|
||||
// Make sure that we are triggered during shutdown, at the right time,
|
||||
// and only once.
|
||||
let placesClient = Cc["@mozilla.org/browser/nav-history-service;1"] .getService(Ci.nsPIPlacesDatabase)
|
||||
.shutdownClient
|
||||
.jsclient;
|
||||
let placesClient = Cc["@mozilla.org/browser/nav-history-service;1"]
|
||||
.getService(Ci.nsPIPlacesDatabase)
|
||||
.shutdownClient
|
||||
.jsclient;
|
||||
|
||||
let deferredSanitization = PromiseUtils.defer();
|
||||
let sanitizationInProgress = false;
|
||||
let doSanitize = function() {
|
||||
if (sanitizationInProgress) {
|
||||
return deferredSanitization.promise;
|
||||
if (!sanitizationInProgress) {
|
||||
sanitizationInProgress = true;
|
||||
Sanitizer.onShutdown().catch(er => {Promise.reject(er) /* Do not return rejected promise */;}).then(() =>
|
||||
deferredSanitization.resolve()
|
||||
);
|
||||
}
|
||||
sanitizationInProgress = true;
|
||||
Sanitizer.onShutdown().catch(er => {Promise.reject(er) /* Do not return rejected promise */;}).then(() =>
|
||||
deferredSanitization.resolve()
|
||||
);
|
||||
return deferredSanitization.promise;
|
||||
}
|
||||
placesClient.addBlocker("sanitize.js: Sanitize on shutdown", doSanitize);
|
||||
|
||||
|
|
|
@ -747,6 +747,8 @@
|
|||
let topLevel = aWebProgress.isTopLevel;
|
||||
|
||||
if (topLevel) {
|
||||
let isSameDocument =
|
||||
!!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT);
|
||||
// If userTypedClear > 0, the document loaded correctly and we should be
|
||||
// clearing the user typed value. We also need to clear the typed value
|
||||
// if the document failed to load, to make sure the urlbar reflects the
|
||||
|
@ -758,14 +760,12 @@
|
|||
if (this.mBrowser.userTypedClear > 0 ||
|
||||
((aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) &&
|
||||
aLocation.spec != "about:blank") ||
|
||||
aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
|
||||
isSameDocument) {
|
||||
this.mBrowser.userTypedValue = null;
|
||||
}
|
||||
|
||||
// If the browser was playing audio, we should remove the playing state.
|
||||
if (this.mTab.hasAttribute("soundplaying") &&
|
||||
(!this.mBrowser.lastURI ||
|
||||
this.mBrowser.lastURI.spec != aLocation.spec)) {
|
||||
if (this.mTab.hasAttribute("soundplaying") && !isSameDocument) {
|
||||
this.mTab.removeAttribute("soundplaying");
|
||||
this.mTabBrowser._tabAttrModified(this.mTab, ["soundplaying"]);
|
||||
}
|
||||
|
@ -788,9 +788,9 @@
|
|||
}
|
||||
|
||||
// Don't clear the favicon if this onLocationChange was
|
||||
// triggered by a pushState or a replaceState. See bug 550565.
|
||||
if (aWebProgress.isLoadingDocument &&
|
||||
!(aWebProgress.loadType & Ci.nsIDocShell.LOAD_CMD_PUSHSTATE)) {
|
||||
// triggered by a pushState or a replaceState (bug 550565) or
|
||||
// a hash change (bug 408415).
|
||||
if (aWebProgress.isLoadingDocument && !isSameDocument) {
|
||||
this.mBrowser.mIconURL = null;
|
||||
}
|
||||
|
||||
|
@ -1758,6 +1758,7 @@
|
|||
var aForceNotRemote;
|
||||
var aNoReferrer;
|
||||
var aUserContextId;
|
||||
var aEventDetail;
|
||||
if (arguments.length == 2 &&
|
||||
typeof arguments[1] == "object" &&
|
||||
!(arguments[1] instanceof Ci.nsIURI)) {
|
||||
|
@ -1775,6 +1776,7 @@
|
|||
aForceNotRemote = params.forceNotRemote;
|
||||
aNoReferrer = params.noReferrer;
|
||||
aUserContextId = params.userContextId;
|
||||
aEventDetail = params.eventDetail;
|
||||
}
|
||||
|
||||
// if we're adding tabs, we're past interrupt mode, ditch the owner
|
||||
|
@ -1893,8 +1895,8 @@
|
|||
// Dispatch a new tab notification. We do this once we're
|
||||
// entirely done, so that things are in a consistent state
|
||||
// even if the event listener opens or closes tabs.
|
||||
var evt = document.createEvent("Events");
|
||||
evt.initEvent("TabOpen", true, false);
|
||||
var detail = aEventDetail || {};
|
||||
var evt = new CustomEvent("TabOpen", { bubbles: true, detail });
|
||||
t.dispatchEvent(evt);
|
||||
|
||||
// If we didn't swap docShells with a preloaded browser
|
||||
|
@ -2128,7 +2130,7 @@
|
|||
|
||||
var isLastTab = (this.tabs.length - this._removingTabs.length == 1);
|
||||
|
||||
if (!this._beginRemoveTab(aTab, false, null, true, skipPermitUnload))
|
||||
if (!this._beginRemoveTab(aTab, null, null, true, skipPermitUnload))
|
||||
return;
|
||||
|
||||
if (!aTab.pinned && !aTab.hidden && aTab._fullyOpen && byMouse)
|
||||
|
@ -2173,7 +2175,7 @@
|
|||
|
||||
<method name="_beginRemoveTab">
|
||||
<parameter name="aTab"/>
|
||||
<parameter name="aTabWillBeMoved"/>
|
||||
<parameter name="aAdoptedByTab"/>
|
||||
<parameter name="aCloseWindowWithLastTab"/>
|
||||
<parameter name="aCloseWindowFastpath"/>
|
||||
<parameter name="aSkipPermitUnload"/>
|
||||
|
@ -2207,7 +2209,7 @@
|
|||
newTab = true;
|
||||
}
|
||||
|
||||
if (!aTab._pendingPermitUnload && !aTabWillBeMoved && !aSkipPermitUnload) {
|
||||
if (!aTab._pendingPermitUnload && !aAdoptedByTab && !aSkipPermitUnload) {
|
||||
// We need to block while calling permitUnload() because it
|
||||
// processes the event queue and may lead to another removeTab()
|
||||
// call before permitUnload() returns.
|
||||
|
@ -2241,11 +2243,10 @@
|
|||
// Dispatch a notification.
|
||||
// We dispatch it before any teardown so that event listeners can
|
||||
// inspect the tab that's about to close.
|
||||
var evt = document.createEvent("UIEvent");
|
||||
evt.initUIEvent("TabClose", true, false, window, aTabWillBeMoved ? 1 : 0);
|
||||
var evt = new CustomEvent("TabClose", { bubbles: true, detail: { adoptedBy: aAdoptedByTab } });
|
||||
aTab.dispatchEvent(evt);
|
||||
|
||||
if (!aTabWillBeMoved && !gMultiProcessBrowser) {
|
||||
if (!aAdoptedByTab && !gMultiProcessBrowser) {
|
||||
// Prevent this tab from showing further dialogs, since we're closing it
|
||||
var windowUtils = browser.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils);
|
||||
|
@ -2261,7 +2262,7 @@
|
|||
filter.removeProgressListener(listener);
|
||||
listener.destroy();
|
||||
|
||||
if (browser.registeredOpenURI && !aTabWillBeMoved) {
|
||||
if (browser.registeredOpenURI && !aAdoptedByTab) {
|
||||
this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
|
||||
this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI);
|
||||
delete browser.registeredOpenURI;
|
||||
|
@ -2495,7 +2496,7 @@
|
|||
// First, start teardown of the other browser. Make sure to not
|
||||
// fire the beforeunload event in the process. Close the other
|
||||
// window if this was its last tab.
|
||||
if (!remoteBrowser._beginRemoveTab(aOtherTab, true, true))
|
||||
if (!remoteBrowser._beginRemoveTab(aOtherTab, aOurTab, true))
|
||||
return;
|
||||
|
||||
let modifiedAttrs = [];
|
||||
|
@ -2946,7 +2947,7 @@
|
|||
// Swap the dropped tab with a new one we create and then close
|
||||
// it in the other window (making it seem to have moved between
|
||||
// windows).
|
||||
let newTab = this.addTab("about:blank");
|
||||
let newTab = this.addTab("about:blank", { eventDetail: { adoptedTab: aTab } });
|
||||
let newBrowser = this.getBrowserForTab(newTab);
|
||||
let newURL = aTab.linkedBrowser.currentURI.spec;
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ support-files =
|
|||
download_page.html
|
||||
dummy_page.html
|
||||
feed_tab.html
|
||||
file_bug550565_favicon.ico
|
||||
file_bug550565_popup.html
|
||||
file_generic_favicon.ico
|
||||
file_with_favicon.html
|
||||
file_bug822367_1.html
|
||||
file_bug822367_1.js
|
||||
file_bug822367_2.html
|
||||
|
@ -165,6 +165,7 @@ skip-if = e10s # Bug 1236991 - Update or remove tests that use fillInPageTooltip
|
|||
[browser_bug380960.js]
|
||||
[browser_bug386835.js]
|
||||
[browser_bug406216.js]
|
||||
[browser_bug408415.js]
|
||||
[browser_bug409481.js]
|
||||
[browser_bug409624.js]
|
||||
[browser_bug413915.js]
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let testPath = getRootDirectory(gTestPath);
|
||||
|
||||
let tab = gBrowser.addTab(testPath + "file_with_favicon.html");
|
||||
|
||||
tab.linkedBrowser.addEventListener("DOMContentLoaded", function() {
|
||||
tab.linkedBrowser.removeEventListener("DOMContentLoaded", arguments.callee, true);
|
||||
|
||||
let expectedIcon = testPath + "file_generic_favicon.ico";
|
||||
|
||||
is(gBrowser.getIcon(tab), expectedIcon, "Correct icon before hash change.");
|
||||
tab.linkedBrowser.contentWindow.location.href += "#foo";
|
||||
is(gBrowser.getIcon(tab), expectedIcon, "Correct icon after hash change.");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
|
||||
finish();
|
||||
}, true);
|
||||
}
|
|
@ -13,14 +13,14 @@ function test() {
|
|||
tabA = gBrowser.addTab(testPage);
|
||||
gBrowser.tabContainer.addEventListener("TabClose", function(aEvent) {
|
||||
gBrowser.tabContainer.removeEventListener("TabClose", arguments.callee, true);
|
||||
ok(!aEvent.detail, "This was a normal tab close");
|
||||
ok(!aEvent.detail.adoptedBy, "This was a normal tab close");
|
||||
|
||||
// test tab close by moving
|
||||
tabB = gBrowser.addTab(testPage);
|
||||
gBrowser.tabContainer.addEventListener("TabClose", function(aEvent) {
|
||||
gBrowser.tabContainer.removeEventListener("TabClose", arguments.callee, true);
|
||||
executeSoon(function() {
|
||||
ok(aEvent.detail, "This was a tab closed by moving");
|
||||
ok(aEvent.detail.adoptedBy, "This was a tab closed by moving");
|
||||
|
||||
// cleanup
|
||||
newWin.close();
|
||||
|
|
|
@ -3,12 +3,12 @@ function test() {
|
|||
|
||||
let testPath = getRootDirectory(gTestPath);
|
||||
|
||||
let tab = gBrowser.addTab(testPath + "file_bug550565_popup.html");
|
||||
let tab = gBrowser.addTab(testPath + "file_with_favicon.html");
|
||||
|
||||
tab.linkedBrowser.addEventListener("DOMContentLoaded", function() {
|
||||
tab.linkedBrowser.removeEventListener("DOMContentLoaded", arguments.callee, true);
|
||||
|
||||
let expectedIcon = testPath + "file_bug550565_favicon.ico";
|
||||
let expectedIcon = testPath + "file_generic_favicon.ico";
|
||||
|
||||
is(gBrowser.getIcon(tab), expectedIcon, "Correct icon before pushState.");
|
||||
tab.linkedBrowser.contentWindow.history.pushState("page2", "page2", "page2");
|
||||
|
|
|
@ -147,3 +147,33 @@ add_task(function* test_dragging_blacklisted() {
|
|||
yield BrowserTestUtils.closeWindow(remoteWin1);
|
||||
yield BrowserTestUtils.closeWindow(remoteWin2);
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Tests that tabs dragged between windows dispatch TabOpen and TabClose
|
||||
* events with the appropriate adoption details.
|
||||
*/
|
||||
add_task(function* test_dragging_adoption_events() {
|
||||
let win1 = yield BrowserTestUtils.openNewBrowserWindow();
|
||||
let win2 = yield BrowserTestUtils.openNewBrowserWindow();
|
||||
|
||||
let tab1 = yield BrowserTestUtils.openNewForegroundTab(win1.gBrowser);
|
||||
let tab2 = yield BrowserTestUtils.openNewForegroundTab(win2.gBrowser);
|
||||
|
||||
let awaitCloseEvent = BrowserTestUtils.waitForEvent(tab1, "TabClose");
|
||||
let awaitOpenEvent = BrowserTestUtils.waitForEvent(win2, "TabOpen");
|
||||
|
||||
let effect = ChromeUtils.synthesizeDrop(tab1, tab2,
|
||||
[[{type: TAB_DROP_TYPE, data: tab1}]],
|
||||
null, win1, win2);
|
||||
is(effect, "move", "Tab should be moved from win1 to win2.");
|
||||
|
||||
let closeEvent = yield awaitCloseEvent;
|
||||
let openEvent = yield awaitOpenEvent;
|
||||
|
||||
is(openEvent.detail.adoptedTab, tab1, "New tab adopted old tab");
|
||||
is(closeEvent.detail.adoptedBy, openEvent.target, "Old tab adopted by new tab");
|
||||
|
||||
yield BrowserTestUtils.closeWindow(win1);
|
||||
yield BrowserTestUtils.closeWindow(win2);
|
||||
});
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test file for bug 550565.</title>
|
||||
|
||||
<!--Set a favicon; that's the whole point of this file.-->
|
||||
<link rel="icon" href="file_bug550565_favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
Test file for bug 550565.
|
||||
</body>
|
||||
</html>
|
До Ширина: | Высота: | Размер: 1.4 KiB После Ширина: | Высота: | Размер: 1.4 KiB |
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test file for bugs with favicons</title>
|
||||
|
||||
<!--Set a favicon; that's the whole point of this file.-->
|
||||
<link rel="icon" href="file_generic_favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
Test file for bugs with favicons
|
||||
</body>
|
||||
</html>
|
|
@ -891,8 +891,9 @@ var SessionStoreInternal = {
|
|||
this.onTabAdd(win, target);
|
||||
break;
|
||||
case "TabClose":
|
||||
// aEvent.detail determines if the tab was closed by moving to a different window
|
||||
if (!aEvent.detail)
|
||||
// `adoptedBy` will be set if the tab was closed because it is being
|
||||
// moved to a new window.
|
||||
if (!aEvent.detail.adoptedBy)
|
||||
this.onTabClose(win, target);
|
||||
this.onTabRemove(win, target);
|
||||
break;
|
||||
|
|
24
configure.in
24
configure.in
|
@ -3758,6 +3758,7 @@ MOZ_SCTP=
|
|||
MOZ_ANDROID_OMX=
|
||||
MOZ_MEDIA_NAVIGATOR=
|
||||
MOZ_OMX_PLUGIN=
|
||||
MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=
|
||||
MOZ_VPX_ERROR_CONCEALMENT=
|
||||
MOZ_WEBSPEECH=1
|
||||
MOZ_WEBSPEECH_MODELS=
|
||||
|
@ -5366,8 +5367,26 @@ if test -n "$MOZ_OMX_PLUGIN"; then
|
|||
dnl Only allow building OMX plugin on Gonk (B2G) or Android
|
||||
AC_DEFINE(MOZ_OMX_PLUGIN)
|
||||
else
|
||||
dnl fail if we're not building on Gonk or Android
|
||||
AC_MSG_ERROR([OMX media plugin can only be built on B2G or Android])
|
||||
dnl fail if we're not building on Gonk or Android
|
||||
AC_MSG_ERROR([OMX media plugin can only be built on B2G or Android])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Enable building mobile/android with Gradle
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(gradle-mobile-android-builds,
|
||||
[ --enable-gradle-mobile-android-builds Enable building mobile/android with Gradle],
|
||||
MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=1,
|
||||
MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=)
|
||||
|
||||
if test -n "$MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE"; then
|
||||
if test "$OS_TARGET" = "Android" -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
|
||||
dnl Only allow building mobile/android with Gradle.
|
||||
AC_DEFINE(MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE)
|
||||
else
|
||||
dnl fail if we're not building mobile/android.
|
||||
AC_MSG_ERROR([Can only build mobile/android with Gradle])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -8907,6 +8926,7 @@ AC_SUBST(MOZ_DIRECTSHOW)
|
|||
AC_SUBST(MOZ_ANDROID_OMX)
|
||||
AC_SUBST(MOZ_APPLEMEDIA)
|
||||
AC_SUBST(MOZ_OMX_PLUGIN)
|
||||
AC_SUBST(MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE)
|
||||
AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT)
|
||||
AC_SUBST(VPX_AS)
|
||||
AC_SUBST_LIST(VPX_ASFLAGS)
|
||||
|
|
|
@ -82,7 +82,7 @@ function reload(event) {
|
|||
devtools.reload(reloadToolbox);
|
||||
|
||||
// Also tells gDevTools to reload its dependencies
|
||||
const {gDevTools} = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
const {gDevTools} = devtools.require("devtools/client/framework/devtools");
|
||||
gDevTools.reload();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ loader.lazyRequireGetter(this, "Services");
|
|||
|
||||
loader.lazyImporter(this, "BrowserToolboxProcess",
|
||||
"resource://devtools/client/framework/ToolboxProcess.jsm");
|
||||
loader.lazyImporter(this, "gDevTools",
|
||||
"resource://devtools/client/framework/gDevTools.jsm");
|
||||
loader.lazyRequireGetter(this, "gDevTools",
|
||||
"devtools/client/framework/devtools", true);
|
||||
|
||||
const Strings = Services.strings.createBundle(
|
||||
"chrome://devtools/locale/aboutdebugging.properties");
|
||||
|
|
|
@ -148,13 +148,24 @@ AnimationTimeBlock.prototype = {
|
|||
|
||||
/**
|
||||
* Get a formatted title for this animation. This will be either:
|
||||
* "some-name", "some-name : CSS Transition", or "some-name : CSS Animation",
|
||||
* depending if the server provides the type, and what type it is.
|
||||
* "some-name", "some-name : CSS Transition", "some-name : CSS Animation",
|
||||
* "some-name : Script Animation", or "Script Animation", depending
|
||||
* if the server provides the type, what type it is and if the animation
|
||||
* has a name
|
||||
* @param {AnimationPlayerFront} animation
|
||||
*/
|
||||
function getFormattedAnimationTitle({state}) {
|
||||
// Older servers don't send the type.
|
||||
return state.type
|
||||
? L10N.getFormatStr("timeline." + state.type + ".nameLabel", state.name)
|
||||
: state.name;
|
||||
// Older servers don't send a type, and only know about
|
||||
// CSSAnimations and CSSTransitions, so it's safe to use
|
||||
// just the name.
|
||||
if (!state.type) {
|
||||
return state.name;
|
||||
}
|
||||
|
||||
// Script-generated animations may not have a name.
|
||||
if (state.type === "scriptanimation" && !state.name) {
|
||||
return L10N.getStr("timeline.scriptanimation.unnamedLabel");
|
||||
}
|
||||
|
||||
return L10N.getFormatStr(`timeline.${state.type}.nameLabel`, state.name);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ support-files =
|
|||
doc_modify_playbackRate.html
|
||||
doc_negative_animation.html
|
||||
doc_simple_animation.html
|
||||
doc_multiple_animation_types.html
|
||||
head.js
|
||||
|
||||
[browser_animation_animated_properties_displayed.js]
|
||||
|
|
|
@ -7,11 +7,41 @@
|
|||
// Test that player widgets are displayed right when the animation panel is
|
||||
// initialized, if the selected node (<body> by default) is animated.
|
||||
|
||||
const { ANIMATION_TYPES } = require("devtools/server/actors/animation");
|
||||
|
||||
add_task(function*() {
|
||||
yield addTab(TEST_URL_ROOT + "doc_body_animation.html");
|
||||
yield new Promise(resolve => {
|
||||
SpecialPowers.pushPrefEnv({"set": [
|
||||
["dom.animations-api.core.enabled", true]
|
||||
]}, resolve);
|
||||
});
|
||||
|
||||
yield addTab(TEST_URL_ROOT + "doc_multiple_animation_types.html");
|
||||
|
||||
let {panel} = yield openAnimationInspector();
|
||||
is(panel.animationsTimelineComponent.animations.length, 1,
|
||||
"One animation is handled by the timeline after init");
|
||||
assertAnimationsDisplayed(panel, 1, "One animation is displayed after init");
|
||||
is(panel.animationsTimelineComponent.animations.length, 3,
|
||||
"Three animations are handled by the timeline after init");
|
||||
assertAnimationsDisplayed(panel, 3,
|
||||
"Three animations are displayed after init");
|
||||
is(
|
||||
panel.animationsTimelineComponent
|
||||
.animationsEl
|
||||
.querySelectorAll(`.animation.${ANIMATION_TYPES.SCRIPT_ANIMATION}`)
|
||||
.length,
|
||||
1,
|
||||
"One script-generated animation is displayed");
|
||||
is(
|
||||
panel.animationsTimelineComponent
|
||||
.animationsEl
|
||||
.querySelectorAll(`.animation.${ANIMATION_TYPES.CSS_ANIMATION}`)
|
||||
.length,
|
||||
1,
|
||||
"One CSS animation is displayed");
|
||||
is(
|
||||
panel.animationsTimelineComponent
|
||||
.animationsEl
|
||||
.querySelectorAll(`.animation.${ANIMATION_TYPES.CSS_TRANSITION}`)
|
||||
.length,
|
||||
1,
|
||||
"One CSS transition is displayed");
|
||||
});
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
.ball {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.script-animation {
|
||||
background: #f06;
|
||||
}
|
||||
|
||||
.css-transition {
|
||||
background: #006;
|
||||
transition: background-color 20s;
|
||||
}
|
||||
|
||||
.css-animation {
|
||||
background: #a06;
|
||||
animation: flash 10s forwards;
|
||||
}
|
||||
|
||||
@keyframes flash {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="ball script-animation"></div>
|
||||
<div class="ball css-animation"></div>
|
||||
<div class="ball css-transition"></div>
|
||||
|
||||
<script>
|
||||
setTimeout(function(){
|
||||
document.querySelector(".css-transition").style.backgroundColor = "yellow";
|
||||
}, 0);
|
||||
|
||||
document.querySelector(".script-animation").animate([
|
||||
{ opacity: 1, offset: 0 },
|
||||
{ opacity: .1, offset: 1 }
|
||||
], {
|
||||
duration: 10000,
|
||||
fill: "forwards"
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -5,8 +5,8 @@
|
|||
"use strict";
|
||||
|
||||
var Cu = Components.utils;
|
||||
const {gDevTools} = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const promise = require("promise");
|
||||
const {TargetFactory} = require("devtools/client/framework/target");
|
||||
const {console} = Cu.import("resource://gre/modules/Console.jsm", {});
|
||||
|
|
|
@ -13,10 +13,10 @@ Services.prefs.setBoolPref("devtools.debugger.log", false);
|
|||
|
||||
var { generateUUID } = Cc['@mozilla.org/uuid-generator;1'].getService(Ci.nsIUUIDGenerator);
|
||||
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
var { gDevTools } = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
|
||||
var promise = require("promise");
|
||||
var { gDevTools } = require("devtools/client/framework/devtools");
|
||||
var { DebuggerClient } = require("devtools/shared/client/main");
|
||||
var { DebuggerServer } = require("devtools/server/main");
|
||||
var { CallWatcherFront } = require("devtools/server/actors/call-watcher");
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
|
||||
const { Cc, Ci, Cu } = require("chrome");
|
||||
const l10n = require("gcli/l10n");
|
||||
|
||||
loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
|
||||
/**
|
||||
* The commands and converters that are exported to GCLI
|
||||
|
|
|
@ -101,7 +101,7 @@ function removeTabA() {
|
|||
let deferred = promise.defer();
|
||||
|
||||
once(gBrowser.tabContainer, "TabClose").then(aEvent => {
|
||||
ok(!aEvent.detail, "This was a normal tab close");
|
||||
ok(!aEvent.detail.adoptedBy, "This was a normal tab close");
|
||||
|
||||
// Let the actor's TabClose handler finish first.
|
||||
executeSoon(deferred.resolve);
|
||||
|
@ -145,7 +145,7 @@ function removeTabC() {
|
|||
let deferred = promise.defer();
|
||||
|
||||
once(gBrowser.tabContainer, "TabClose").then(aEvent => {
|
||||
ok(aEvent.detail, "This was a tab closed by moving");
|
||||
ok(aEvent.detail.adoptedBy, "This was a tab closed by moving");
|
||||
|
||||
// Let the actor's TabClose handler finish first.
|
||||
executeSoon(deferred.resolve);
|
||||
|
@ -203,7 +203,7 @@ function removeTabB() {
|
|||
let deferred = promise.defer();
|
||||
|
||||
once(gBrowser.tabContainer, "TabClose").then(aEvent => {
|
||||
ok(!aEvent.detail, "This was a normal tab close");
|
||||
ok(!aEvent.detail.adoptedBy, "This was a normal tab close");
|
||||
|
||||
// Let the actor's TabClose handler finish first.
|
||||
executeSoon(deferred.resolve);
|
||||
|
|
|
@ -51,8 +51,13 @@ devtoolsCommandlineHandler.prototype = {
|
|||
let window = Services.wm.getMostRecentWindow("devtools:webconsole");
|
||||
if (!window) {
|
||||
let { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
// Load the browser devtools main module as the loader's main module.
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
// Ensure loading main devtools module that hooks up into browser UI
|
||||
// and initialize all devtools machinery.
|
||||
// browser.xul or main top-level document used to load this module,
|
||||
// but this code may be called without/before it.
|
||||
// Bug 1247203 should ease handling this.
|
||||
require("devtools/client/framework/devtools-browser");
|
||||
|
||||
let hudservice = require("devtools/client/webconsole/hudservice");
|
||||
let { console } = Cu.import("resource://gre/modules/Console.jsm", {});
|
||||
hudservice.toggleBrowserConsole().then(null, console.error);
|
||||
|
@ -71,9 +76,10 @@ devtoolsCommandlineHandler.prototype = {
|
|||
Services.obs.addObserver(function onStartup(window) {
|
||||
Services.obs.removeObserver(onStartup,
|
||||
"browser-delayed-startup-finished");
|
||||
const {gDevTools} = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
const {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
let target = devtools.TargetFactory.forTab(window.gBrowser.selectedTab);
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const {TargetFactory} = require("devtools/client/framework/target");
|
||||
let target = TargetFactory.forTab(window.gBrowser.selectedTab);
|
||||
gDevTools.showToolbox(target);
|
||||
}, "browser-delayed-startup-finished", false);
|
||||
},
|
||||
|
|
|
@ -10,8 +10,8 @@ var Cu = Components.utils;
|
|||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
var {gDevTools} = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var {gDevTools} = require("devtools/client/framework/devtools");
|
||||
var {TargetFactory} = require("devtools/client/framework/target");
|
||||
var {Toolbox} = require("devtools/client/framework/toolbox")
|
||||
var promise = require("promise");
|
||||
|
|
|
@ -9,18 +9,12 @@
|
|||
* Please now use the modules:
|
||||
* - devtools/client/framework/devtools for gDevTools
|
||||
* - devtools/client/framework/devtools-browser for gDevToolsBrowser
|
||||
*
|
||||
* We still do use gDevTools.jsm in our codebase,
|
||||
* bug 1245462 is going to ensure we no longer do that.
|
||||
*/
|
||||
|
||||
this.EXPORTED_SYMBOLS = [ "gDevTools", "gDevToolsBrowser" ];
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const { loader } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,11 +17,11 @@ function scopedCuImport(path) {
|
|||
}
|
||||
|
||||
const {Services} = scopedCuImport("resource://gre/modules/Services.jsm");
|
||||
const {gDevTools} = scopedCuImport("resource://devtools/client/framework/gDevTools.jsm");
|
||||
const {console} = scopedCuImport("resource://gre/modules/Console.jsm");
|
||||
const {ScratchpadManager} = scopedCuImport("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
|
||||
const {require} = scopedCuImport("resource://devtools/shared/Loader.jsm");
|
||||
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const {TargetFactory} = require("devtools/client/framework/target");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
let promise = require("promise");
|
||||
|
|
|
@ -9,7 +9,7 @@ const Services = require("Services");
|
|||
const promise = require("promise");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
|
||||
exports.OptionsPanel = OptionsPanel;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ const SCREENSIZE_HISTOGRAM = "DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER";
|
|||
|
||||
var {Cc, Ci, Cu} = require("chrome");
|
||||
var promise = require("promise");
|
||||
var {gDevTools} = require("devtools/client/framework/devtools");
|
||||
var EventEmitter = require("devtools/shared/event-emitter");
|
||||
var Telemetry = require("devtools/client/shared/telemetry");
|
||||
var HUDService = require("devtools/client/webconsole/hudservice");
|
||||
|
@ -23,7 +24,6 @@ var viewSource = require("devtools/client/shared/view-source");
|
|||
var { attachThread, detachThread } = require("./attach-thread");
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
Cu.import("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
|
||||
Cu.import("resource://devtools/client/shared/DOMHelpers.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
|
|
@ -18,7 +18,7 @@ const {setTimeout, clearTimeout} = Cu.import("resource://gre/modules/Timer.jsm",
|
|||
const {OutputParser} = require("devtools/client/shared/output-parser");
|
||||
const {PrefObserver, PREF_ORIG_SOURCES} = require("devtools/client/styleeditor/utils");
|
||||
const {createChild} = require("devtools/client/inspector/shared/utils");
|
||||
const {gDevTools} = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
|
||||
loader.lazyRequireGetter(this, "overlays",
|
||||
"devtools/client/inspector/shared/style-inspector-overlays");
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
const {Cu} = require("chrome");
|
||||
const {setTimeout, clearTimeout} =
|
||||
Cu.import("resource://gre/modules/Timer.jsm", {});
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
|
||||
const DEFAULT_PREVIEW_TEXT = "Abc";
|
||||
const PREVIEW_UPDATE_DELAY = 150;
|
||||
|
|
|
@ -22,7 +22,7 @@ exports.items = [{
|
|||
],
|
||||
exec: function(args, context) {
|
||||
let target = context.environment.target;
|
||||
let gDevTools = require("resource://devtools/client/framework/gDevTools.jsm").gDevTools;
|
||||
let {gDevTools} = require("devtools/client/framework/devtools");
|
||||
|
||||
return gDevTools.showToolbox(target, "inspector").then(toolbox => {
|
||||
toolbox.getCurrentPanel().selection.setNode(args.selector, "gcli");
|
||||
|
|
|
@ -24,11 +24,10 @@ const {RuleEditor} =
|
|||
require("devtools/client/inspector/rules/views/rule-editor");
|
||||
const {createChild, promiseWarn} =
|
||||
require("devtools/client/inspector/shared/utils");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
loader.lazyGetter(this, "gDevTools", () =>
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm", {}).gDevTools);
|
||||
loader.lazyRequireGetter(this, "overlays",
|
||||
"devtools/client/inspector/shared/style-inspector-overlays");
|
||||
loader.lazyRequireGetter(this, "EventEmitter",
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
"use strict";
|
||||
|
||||
var Cu = Components.utils;
|
||||
var {gDevTools} = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var {gDevTools} = require("devtools/client/framework/devtools");
|
||||
var {TargetFactory} = require("devtools/client/framework/target");
|
||||
var {CssRuleView, _ElementStyle} = require("devtools/client/inspector/rules/rules");
|
||||
var {CssLogic, CssSelector} = require("devtools/shared/inspector/css-logic");
|
||||
|
@ -14,8 +14,7 @@ var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
|||
var promise = require("promise");
|
||||
var {editableField, getInplaceEditorForSpan: inplaceEditor} =
|
||||
require("devtools/client/shared/inplace-editor");
|
||||
var {console} =
|
||||
Components.utils.import("resource://gre/modules/Console.jsm", {});
|
||||
var {console} = Cu.import("resource://gre/modules/Console.jsm", {});
|
||||
|
||||
// All tests are asynchronous
|
||||
waitForExplicitFinish();
|
||||
|
|
|
@ -18,7 +18,7 @@ XPCOMUtils.defineLazyGetter(this, "JsonViewService", function() {
|
|||
/**
|
||||
* Singleton object that represents the JSON View in-content tool.
|
||||
* It has the same lifetime as the browser. Initialization done by
|
||||
* DevTools() object from gDevTools.jsm
|
||||
* DevTools() object from devtools/client/framework/devtools.js
|
||||
*/
|
||||
var JsonView = {
|
||||
initialize: function() {
|
||||
|
|
|
@ -108,6 +108,17 @@ timeline.cssanimation.nameLabel=%S - CSS Animation
|
|||
# %S will be replaced by the name of the transition at run-time.
|
||||
timeline.csstransition.nameLabel=%S - CSS Transition
|
||||
|
||||
# LOCALIZATION NOTE (timeline.scriptanimation.nameLabel):
|
||||
# This string is displayed in a tooltip of the animation panel that is shown
|
||||
# when hovering over the name of a script-generated animation in the timeline UI.
|
||||
# %S will be replaced by the name of the animation at run-time.
|
||||
timeline.scriptanimation.nameLabel=%S - Script Animation
|
||||
|
||||
# LOCALIZATION NOTE (timeline.scriptanimation.unnamedLabel):
|
||||
# This string is displayed in a tooltip of the animation panel that is shown
|
||||
# when hovering over an unnamed script-generated animation in the timeline UI.
|
||||
timeline.scriptanimation.unnamedLabel=Script Animation
|
||||
|
||||
# LOCALIZATION NOTE (timeline.unknown.nameLabel):
|
||||
# This string is displayed in a tooltip of the animation panel that is shown
|
||||
# when hovering over the name of an unknown animation type in the timeline UI.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
const { Cu } = require("chrome");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
const { gDevTools } = require("resource://devtools/client/framework/gDevTools.jsm");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
|
||||
const { defaultTools, defaultThemes } = require("devtools/client/definitions");
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ support-files =
|
|||
[browser_memory_dominator_trees_01.js]
|
||||
[browser_memory_dominator_trees_02.js]
|
||||
[browser_memory_filter_01.js]
|
||||
[browser_memory_keyboard.js]
|
||||
[browser_memory_no_allocation_stacks.js]
|
||||
[browser_memory_no_auto_expand.js]
|
||||
skip-if = debug # bug 1219554
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Bug 1246570 - Check that when pressing on LEFT arrow, the parent tree node
|
||||
// gets focused.
|
||||
|
||||
"use strict";
|
||||
|
||||
const {
|
||||
snapshotState
|
||||
} = require("devtools/client/memory/constants");
|
||||
const {
|
||||
takeSnapshotAndCensus
|
||||
} = require("devtools/client/memory/actions/snapshot");
|
||||
|
||||
const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html";
|
||||
|
||||
function waitUntilFocused(store, node) {
|
||||
return waitUntilState(store, state =>
|
||||
state.snapshots.length === 1 &&
|
||||
state.snapshots[0].state === snapshotState.SAVED_CENSUS &&
|
||||
state.snapshots[0].census &&
|
||||
state.snapshots[0].census.focused &&
|
||||
state.snapshots[0].census.focused === node
|
||||
);
|
||||
}
|
||||
|
||||
function waitUntilExpanded(store, node) {
|
||||
return waitUntilState(store, state =>
|
||||
state.snapshots[0] &&
|
||||
state.snapshots[0].census &&
|
||||
state.snapshots[0].census.expanded.has(node.id));
|
||||
}
|
||||
|
||||
this.test = makeMemoryTest(TEST_URL, function* ({ tab, panel }) {
|
||||
const heapWorker = panel.panelWin.gHeapAnalysesClient;
|
||||
const front = panel.panelWin.gFront;
|
||||
const store = panel.panelWin.gStore;
|
||||
const { getState, dispatch } = store;
|
||||
const doc = panel.panelWin.document;
|
||||
|
||||
is(getState().breakdown.by, "coarseType");
|
||||
yield dispatch(takeSnapshotAndCensus(front, heapWorker));
|
||||
let census = getState().snapshots[0].census;
|
||||
let root1 = census.report.children[0];
|
||||
let root2 = census.report.children[0];
|
||||
let root3 = census.report.children[0];
|
||||
let root4 = census.report.children[0];
|
||||
let child1 = root1.children[0];
|
||||
|
||||
info("Click on first node.");
|
||||
let firstNode = doc.querySelector(".tree .heap-tree-item-name");
|
||||
EventUtils.synthesizeMouseAtCenter(firstNode, {}, panel.panelWin);
|
||||
yield waitUntilFocused(store, root1);
|
||||
ok(true, "First root is selected after click.");
|
||||
|
||||
info("Press DOWN key, expect second root focused.");
|
||||
EventUtils.synthesizeKey("VK_DOWN", {}, panel.panelWin);
|
||||
yield waitUntilFocused(store, root2);
|
||||
ok(true, "Second root is selected after pressing DOWN arrow.");
|
||||
|
||||
info("Press DOWN key, expect third root focused.");
|
||||
EventUtils.synthesizeKey("VK_DOWN", {}, panel.panelWin);
|
||||
yield waitUntilFocused(store, root3);
|
||||
ok(true, "Third root is selected after pressing DOWN arrow.");
|
||||
|
||||
info("Press DOWN key, expect fourth root focused.");
|
||||
EventUtils.synthesizeKey("VK_DOWN", {}, panel.panelWin);
|
||||
yield waitUntilFocused(store, root4);
|
||||
ok(true, "Fourth root is selected after pressing DOWN arrow.");
|
||||
|
||||
info("Press UP key, expect third root focused.");
|
||||
EventUtils.synthesizeKey("VK_UP", {}, panel.panelWin);
|
||||
yield waitUntilFocused(store, root3);
|
||||
ok(true, "Third root is selected after pressing UP arrow.");
|
||||
|
||||
info("Press UP key, expect second root focused.");
|
||||
EventUtils.synthesizeKey("VK_UP", {}, panel.panelWin);
|
||||
yield waitUntilFocused(store, root2);
|
||||
ok(true, "Second root is selected after pressing UP arrow.");
|
||||
|
||||
info("Press UP key, expect first root focused.");
|
||||
EventUtils.synthesizeKey("VK_UP", {}, panel.panelWin);
|
||||
yield waitUntilFocused(store, root1);
|
||||
ok(true, "First root is selected after pressing UP arrow.");
|
||||
|
||||
info("Press RIGHT key");
|
||||
EventUtils.synthesizeKey("VK_RIGHT", {}, panel.panelWin);
|
||||
yield waitUntilExpanded(store, root1);
|
||||
ok(true, "Root node is expanded.");
|
||||
|
||||
info("Press RIGHT key, expect first child focused.");
|
||||
EventUtils.synthesizeKey("VK_RIGHT", {}, panel.panelWin);
|
||||
yield waitUntilFocused(store, child1);
|
||||
ok(true, "First child is selected after pressing RIGHT arrow.");
|
||||
|
||||
info("Press LEFT key, expect first root focused.");
|
||||
EventUtils.synthesizeKey("VK_LEFT", {}, panel.panelWin);
|
||||
yield waitUntilFocused(store, root1);
|
||||
ok(true, "First root is selected after pressing LEFT arrow.");
|
||||
});
|
|
@ -5,14 +5,13 @@
|
|||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
var { gDevTools } = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
var { console } = Cu.import("resource://gre/modules/Console.jsm", {});
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
|
||||
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
DevToolsUtils.testing = true;
|
||||
DevToolsUtils.dumpn.wantLogging = true;
|
||||
DevToolsUtils.dumpv.wantLogging = true;
|
||||
DevToolsUtils.dumpv.wantVerbose = false;
|
||||
|
||||
var { OS } = require("resource://gre/modules/osfile.jsm");
|
||||
var { FileUtils } = require("resource://gre/modules/FileUtils.jsm");
|
||||
|
|
|
@ -6,8 +6,8 @@ var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
|||
|
||||
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
var { gDevTools } = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var { gDevTools } = require("devtools/client/framework/devtools");
|
||||
var { CurlUtils } = Cu.import("resource://devtools/client/shared/Curl.jsm", {});
|
||||
var promise = require("promise");
|
||||
var NetworkHelper = require("devtools/shared/webconsole/network-helper");
|
||||
|
|
|
@ -9,6 +9,7 @@ Cu.import("resource://devtools/client/shared/browser-loader.js", BrowserLoaderMo
|
|||
var { loader, require } = BrowserLoaderModule.BrowserLoader("resource://devtools/client/performance/", this);
|
||||
var { Task } = require("resource://gre/modules/Task.jsm");
|
||||
var { Heritage, ViewHelpers, WidgetMethods } = require("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
var {gDevTools} = require("devtools/client/framework/devtools");
|
||||
|
||||
// Events emitted by various objects in the panel.
|
||||
var EVENTS = require("devtools/client/performance/events");
|
||||
|
|
|
@ -8,7 +8,7 @@ var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
|||
var { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
|
||||
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var { gDevTools } = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
var { gDevTools } = require("devtools/client/framework/devtools");
|
||||
var { console } = require("resource://gre/modules/Console.jsm");
|
||||
var { TargetFactory } = require("devtools/client/framework/target");
|
||||
var Promise = require("promise");
|
||||
|
|
|
@ -17,6 +17,9 @@ createEnum([
|
|||
// Add an additional viewport to display the document.
|
||||
"ADD_VIEWPORT",
|
||||
|
||||
// Resize the viewport.
|
||||
"RESIZE_VIEWPORT",
|
||||
|
||||
// Rotate the viewport.
|
||||
"ROTATE_VIEWPORT",
|
||||
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { ADD_VIEWPORT, ROTATE_VIEWPORT } = require("./index");
|
||||
const {
|
||||
ADD_VIEWPORT,
|
||||
RESIZE_VIEWPORT,
|
||||
ROTATE_VIEWPORT
|
||||
} = require("./index");
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
@ -17,6 +21,18 @@ module.exports = {
|
|||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Resize the viewport.
|
||||
*/
|
||||
resizeViewport(id, width, height) {
|
||||
return {
|
||||
type: RESIZE_VIEWPORT,
|
||||
id,
|
||||
width,
|
||||
height,
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Rotate the viewport.
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,7 @@ const { createClass, createFactory, PropTypes } =
|
|||
require("devtools/client/shared/vendor/react");
|
||||
const { connect } = require("devtools/client/shared/vendor/react-redux");
|
||||
|
||||
const { rotateViewport } = require("./actions/viewports");
|
||||
const { resizeViewport, rotateViewport } = require("./actions/viewports");
|
||||
const Types = require("./types");
|
||||
const Viewports = createFactory(require("./components/viewports"));
|
||||
|
||||
|
@ -34,6 +34,8 @@ let App = createClass({
|
|||
location,
|
||||
viewports,
|
||||
onRotateViewport: id => dispatch(rotateViewport(id)),
|
||||
onResizeViewport: (id, width, height) =>
|
||||
dispatch(resizeViewport(id, width, height)),
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { DOM: dom, createClass } =
|
||||
const { DOM: dom, createClass, PropTypes } =
|
||||
require("devtools/client/shared/vendor/react");
|
||||
|
||||
const Types = require("../types");
|
||||
|
@ -17,6 +17,7 @@ module.exports = createClass({
|
|||
location: Types.location.isRequired,
|
||||
width: Types.viewport.width.isRequired,
|
||||
height: Types.viewport.height.isRequired,
|
||||
isResizing: PropTypes.bool.isRequired,
|
||||
},
|
||||
|
||||
render() {
|
||||
|
@ -24,11 +25,17 @@ module.exports = createClass({
|
|||
location,
|
||||
width,
|
||||
height,
|
||||
isResizing,
|
||||
} = this.props;
|
||||
|
||||
let className = "browser";
|
||||
if (isResizing) {
|
||||
className += " resizing";
|
||||
}
|
||||
|
||||
return dom.iframe(
|
||||
{
|
||||
className: "browser",
|
||||
className,
|
||||
src: location,
|
||||
width,
|
||||
height,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
DevToolsModules(
|
||||
'browser.js',
|
||||
'resizable-viewport.js',
|
||||
'viewport-toolbar.js',
|
||||
'viewport.js',
|
||||
'viewports.js',
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
/* 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/. */
|
||||
|
||||
/* global window */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { DOM: dom, createClass, createFactory, PropTypes } =
|
||||
require("devtools/client/shared/vendor/react");
|
||||
|
||||
const Types = require("../types");
|
||||
const Browser = createFactory(require("./browser"));
|
||||
const ViewportToolbar = createFactory(require("./viewport-toolbar"));
|
||||
|
||||
const VIEWPORT_MIN_WIDTH = 280;
|
||||
const VIEWPORT_MIN_HEIGHT = 280;
|
||||
|
||||
module.exports = createClass({
|
||||
|
||||
displayName: "ResizableViewport",
|
||||
|
||||
propTypes: {
|
||||
location: Types.location.isRequired,
|
||||
viewport: PropTypes.shape(Types.viewport).isRequired,
|
||||
onResizeViewport: PropTypes.func.isRequired,
|
||||
onRotateViewport: PropTypes.func.isRequired,
|
||||
},
|
||||
|
||||
getInitialState() {
|
||||
return {
|
||||
isResizing: false,
|
||||
lastClientX: 0,
|
||||
lastClientY: 0,
|
||||
ignoreX: false,
|
||||
ignoreY: false,
|
||||
};
|
||||
},
|
||||
|
||||
onResizeStart({ target, clientX, clientY }) {
|
||||
window.addEventListener("mousemove", this.onResizeDrag, true);
|
||||
window.addEventListener("mouseup", this.onResizeStop, true);
|
||||
|
||||
this.setState({
|
||||
isResizing: true,
|
||||
lastClientX: clientX,
|
||||
lastClientY: clientY,
|
||||
ignoreX: target === this.refs.resizeBarY,
|
||||
ignoreY: target === this.refs.resizeBarX,
|
||||
});
|
||||
},
|
||||
|
||||
onResizeStop() {
|
||||
window.removeEventListener("mousemove", this.onResizeDrag, true);
|
||||
window.removeEventListener("mouseup", this.onResizeStop, true);
|
||||
|
||||
this.setState({
|
||||
isResizing: false,
|
||||
lastClientX: 0,
|
||||
lastClientY: 0,
|
||||
ignoreX: false,
|
||||
ignoreY: false,
|
||||
});
|
||||
},
|
||||
|
||||
onResizeDrag({ clientX, clientY }) {
|
||||
if (!this.state.isResizing) {
|
||||
return;
|
||||
}
|
||||
|
||||
let { lastClientX, lastClientY, ignoreX, ignoreY } = this.state;
|
||||
let deltaX = clientX - lastClientX;
|
||||
let deltaY = clientY - lastClientY;
|
||||
|
||||
if (ignoreX) {
|
||||
deltaX = 0;
|
||||
}
|
||||
if (ignoreY) {
|
||||
deltaY = 0;
|
||||
}
|
||||
|
||||
let width = this.props.viewport.width + deltaX;
|
||||
let height = this.props.viewport.height + deltaY;
|
||||
|
||||
if (width < VIEWPORT_MIN_WIDTH) {
|
||||
width = VIEWPORT_MIN_WIDTH;
|
||||
} else {
|
||||
lastClientX = clientX;
|
||||
}
|
||||
|
||||
if (height < VIEWPORT_MIN_HEIGHT) {
|
||||
height = VIEWPORT_MIN_HEIGHT;
|
||||
} else {
|
||||
lastClientY = clientY;
|
||||
}
|
||||
|
||||
// Update the viewport store with the new width and height.
|
||||
this.props.onResizeViewport(width, height);
|
||||
|
||||
this.setState({
|
||||
lastClientX,
|
||||
lastClientY
|
||||
});
|
||||
},
|
||||
|
||||
render() {
|
||||
let {
|
||||
location,
|
||||
viewport,
|
||||
onRotateViewport,
|
||||
} = this.props;
|
||||
|
||||
return dom.div(
|
||||
{
|
||||
className: "resizable-viewport",
|
||||
},
|
||||
ViewportToolbar({
|
||||
onRotateViewport,
|
||||
}),
|
||||
Browser({
|
||||
location,
|
||||
width: viewport.width,
|
||||
height: viewport.height,
|
||||
isResizing: this.state.isResizing
|
||||
}),
|
||||
dom.div({
|
||||
className: "viewport-resize-handle",
|
||||
onMouseDown: this.onResizeStart,
|
||||
}),
|
||||
dom.div({
|
||||
ref: "resizeBarX",
|
||||
className: "viewport-horizontal-resize-handle",
|
||||
onMouseDown: this.onResizeStart,
|
||||
}),
|
||||
dom.div({
|
||||
ref: "resizeBarY",
|
||||
className: "viewport-vertical-resize-handle",
|
||||
onMouseDown: this.onResizeStart,
|
||||
})
|
||||
);
|
||||
},
|
||||
|
||||
});
|
|
@ -8,8 +8,7 @@ const { DOM: dom, createClass, createFactory, PropTypes } =
|
|||
require("devtools/client/shared/vendor/react");
|
||||
|
||||
const Types = require("../types");
|
||||
const Browser = createFactory(require("./browser"));
|
||||
const ViewportToolbar = createFactory(require("./viewport-toolbar"));
|
||||
const ResizableViewport = createFactory(require("./resizable-viewport"));
|
||||
|
||||
module.exports = createClass({
|
||||
|
||||
|
@ -18,6 +17,7 @@ module.exports = createClass({
|
|||
propTypes: {
|
||||
location: Types.location.isRequired,
|
||||
viewport: PropTypes.shape(Types.viewport).isRequired,
|
||||
onResizeViewport: PropTypes.func.isRequired,
|
||||
onRotateViewport: PropTypes.func.isRequired,
|
||||
},
|
||||
|
||||
|
@ -25,20 +25,19 @@ module.exports = createClass({
|
|||
let {
|
||||
location,
|
||||
viewport,
|
||||
onResizeViewport,
|
||||
onRotateViewport,
|
||||
} = this.props;
|
||||
|
||||
return dom.div(
|
||||
{
|
||||
className: "viewport"
|
||||
className: "viewport",
|
||||
},
|
||||
ViewportToolbar({
|
||||
onRotateViewport,
|
||||
}),
|
||||
Browser({
|
||||
ResizableViewport({
|
||||
location,
|
||||
width: viewport.width,
|
||||
height: viewport.height,
|
||||
viewport,
|
||||
onResizeViewport,
|
||||
onRotateViewport,
|
||||
})
|
||||
);
|
||||
},
|
||||
|
|
|
@ -17,6 +17,7 @@ module.exports = createClass({
|
|||
propTypes: {
|
||||
location: Types.location.isRequired,
|
||||
viewports: PropTypes.arrayOf(PropTypes.shape(Types.viewport)).isRequired,
|
||||
onResizeViewport: PropTypes.func.isRequired,
|
||||
onRotateViewport: PropTypes.func.isRequired,
|
||||
},
|
||||
|
||||
|
@ -24,6 +25,7 @@ module.exports = createClass({
|
|||
let {
|
||||
location,
|
||||
viewports,
|
||||
onResizeViewport,
|
||||
onRotateViewport,
|
||||
} = this.props;
|
||||
|
||||
|
@ -36,6 +38,8 @@ module.exports = createClass({
|
|||
key: viewport.id,
|
||||
location,
|
||||
viewport,
|
||||
onResizeViewport: (width, height) =>
|
||||
onResizeViewport(viewport.id, width, height),
|
||||
onRotateViewport: () => onRotateViewport(viewport.id),
|
||||
});
|
||||
})
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<!-- 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/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="#A5A5A5">
|
||||
<path d="M16 3.2L3.1 16h1.7L16 4.9zM16 7.2L7.1 16h1.8L16 8.9zM16 11.1L11.1 16h1.8l3.1-3.1z" />
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 392 B |
|
@ -5,5 +5,6 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
DevToolsModules(
|
||||
'grippers.svg',
|
||||
'rotate-viewport.svg',
|
||||
)
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
--viewport-box-shadow: 0 4px 4px 0 rgba(105, 105, 105, 0.26);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
|
@ -57,6 +61,10 @@ body {
|
|||
box-shadow: var(--viewport-box-shadow);
|
||||
}
|
||||
|
||||
.resizable-viewport {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport Toolbar
|
||||
*/
|
||||
|
@ -96,7 +104,51 @@ body {
|
|||
mask-image: url("./images/rotate-viewport.svg");
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport Browser
|
||||
*/
|
||||
|
||||
.browser {
|
||||
display: block;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.browser.resizing {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Viewport Resize Handles
|
||||
*/
|
||||
|
||||
.viewport-resize-handle {
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-image: url("./images/grippers.svg");
|
||||
background-position: bottom right;
|
||||
padding: 0 1px 1px 0;
|
||||
background-repeat: no-repeat;
|
||||
background-origin: content-box;
|
||||
cursor: se-resize;
|
||||
}
|
||||
|
||||
.viewport-horizontal-resize-handle {
|
||||
position: absolute;
|
||||
width: 5px;
|
||||
height: calc(100% - 16px);
|
||||
right: -4px;
|
||||
top: 0;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
.viewport-vertical-resize-handle {
|
||||
position: absolute;
|
||||
width: calc(100% - 16px);
|
||||
height: 5px;
|
||||
left: 0;
|
||||
bottom: -4px;
|
||||
cursor: s-resize;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { ADD_VIEWPORT, ROTATE_VIEWPORT } = require("../actions/index");
|
||||
const {
|
||||
ADD_VIEWPORT,
|
||||
RESIZE_VIEWPORT,
|
||||
ROTATE_VIEWPORT,
|
||||
} = require("../actions/index");
|
||||
|
||||
let nextViewportId = 0;
|
||||
|
||||
|
@ -25,6 +29,19 @@ let reducers = {
|
|||
return [...viewports, Object.assign({}, INITIAL_VIEWPORT)];
|
||||
},
|
||||
|
||||
[RESIZE_VIEWPORT](viewports, { id, width, height }) {
|
||||
return viewports.map(viewport => {
|
||||
if (viewport.id !== id) {
|
||||
return viewport;
|
||||
}
|
||||
|
||||
return Object.assign({}, viewport, {
|
||||
width,
|
||||
height,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
[ROTATE_VIEWPORT](viewports, { id }) {
|
||||
return viewports.map(viewport => {
|
||||
if (viewport.id !== id) {
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test resizing the viewport.
|
||||
|
||||
const { addViewport, resizeViewport } =
|
||||
require("devtools/client/responsive.html/actions/viewports");
|
||||
|
||||
add_task(function*() {
|
||||
let store = Store();
|
||||
const { getState, dispatch } = store;
|
||||
|
||||
dispatch(addViewport());
|
||||
dispatch(resizeViewport(0, 500, 500));
|
||||
|
||||
let viewport = getState().viewports[0];
|
||||
equal(viewport.width, 500, "Resized width of 500");
|
||||
equal(viewport.height, 500, "Resized height of 500");
|
||||
});
|
|
@ -6,4 +6,5 @@ firefox-appdir = browser
|
|||
|
||||
[test_add_viewport.js]
|
||||
[test_change_location.js]
|
||||
[test_resize_viewport.js]
|
||||
[test_rotate_viewport.js]
|
||||
|
|
|
@ -7,21 +7,18 @@
|
|||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
Cu.import("resource://devtools/shared/event-emitter.js");
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SystemAppProxy",
|
||||
"resource://gre/modules/SystemAppProxy.jsm");
|
||||
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var { loader, require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var Telemetry = require("devtools/client/shared/telemetry");
|
||||
var { showDoorhanger } = require("devtools/client/shared/doorhanger");
|
||||
var { TouchEventSimulator } = require("devtools/shared/touch/simulator");
|
||||
var { Task } = require("resource://gre/modules/Task.jsm");
|
||||
var promise = require("promise");
|
||||
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
var Services = require("Services");
|
||||
var EventEmitter = require("devtools/shared/event-emitter");
|
||||
var { ViewHelpers } = require("devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
loader.lazyImporter(this, "SystemAppProxy",
|
||||
"resource://gre/modules/SystemAppProxy.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["ResponsiveUIManager"];
|
||||
|
||||
|
@ -1092,6 +1089,6 @@ ResponsiveUI.prototype = {
|
|||
},
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyGetter(ResponsiveUI.prototype, "strings", function () {
|
||||
loader.lazyGetter(ResponsiveUI.prototype, "strings", function () {
|
||||
return Services.strings.createBundle("chrome://devtools/locale/responsiveUI.properties");
|
||||
});
|
||||
|
|
|
@ -52,13 +52,13 @@ const EventEmitter = require("devtools/shared/event-emitter");
|
|||
const {DevToolsWorker} = require("devtools/shared/worker/worker");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const promise = require("promise");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
|
||||
Cu.import("resource://gre/modules/jsdebugger.jsm");
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
Cu.import("resource://gre/modules/reflect.jsm");
|
||||
|
|
|
@ -11,10 +11,10 @@ var gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log");
|
|||
Services.prefs.setBoolPref("devtools.debugger.log", false);
|
||||
|
||||
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
var { gDevTools } = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
|
||||
var promise = require("promise");
|
||||
var { gDevTools } = require("devtools/client/framework/devtools");
|
||||
var { DebuggerClient } = require("devtools/shared/client/main");
|
||||
var { DebuggerServer } = require("devtools/server/main");
|
||||
var { WebGLFront } = require("devtools/server/actors/webgl");
|
||||
|
|
|
@ -9,7 +9,7 @@ const {Cc, Ci, Cu} = require("chrome");
|
|||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
|
||||
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const events = require("devtools/shared/event-emitter");
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,10 +8,10 @@ Cu.import("resource://testing-common/Assert.jsm");
|
|||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
|
||||
var { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var { gDevTools } = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
var { gDevTools } = require("devtools/client/framework/devtools");
|
||||
var { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
var promise = require("promise");
|
||||
var { DebuggerServer } = require("devtools/server/main");
|
||||
var { DebuggerClient } = require("devtools/shared/client/main");
|
||||
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
function test() {
|
||||
const TEST_URI = TEST_URI_ROOT + "browser_toolbar_webconsole_errors_count.html";
|
||||
|
||||
let gDevTools = Cu.import("resource://devtools/client/framework/gDevTools.jsm",
|
||||
{}).gDevTools;
|
||||
|
||||
let webconsole = document.getElementById("developer-toolbar-toolbox-button");
|
||||
let tab1, tab2;
|
||||
|
||||
|
|
|
@ -159,8 +159,8 @@
|
|||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
const {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const StylesheetUtils = require("sdk/stylesheet/utils");
|
||||
|
||||
if (documentElement.hasAttribute("force-theme")) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
const { Ci, Cu } = require("chrome");
|
||||
const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
loader.lazyRequireGetter(this, "Services");
|
||||
loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
|
||||
const VARIABLES_URI = "chrome://devtools/skin/variables.css";
|
||||
const THEME_SELECTOR_STRINGS = {
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
"use strict";
|
||||
|
||||
loader.lazyRequireGetter(this, "Services");
|
||||
loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm");
|
||||
loader.lazyImporter(this, "Task", "resource://gre/modules/Task.jsm");
|
||||
|
||||
var {gDevTools} = require("devtools/client/framework/devtools");
|
||||
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,7 +24,6 @@ if (Services.prefs.getBoolPref(WARNING_PREF)) {
|
|||
|
||||
this.EXPORTED_SYMBOLS = [
|
||||
"gDevTools",
|
||||
"DevTools",
|
||||
"gDevToolsBrowser"
|
||||
];
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ const {NetUtil} = Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
|||
const {OS} = Cu.import("resource://gre/modules/osfile.jsm", {});
|
||||
const {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {gDevTools} = require("resource://devtools/client/framework/gDevTools.jsm");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
/* import-globals-from StyleEditorUtil.jsm */
|
||||
Cu.import("resource://devtools/client/styleeditor/StyleEditorUtil.jsm");
|
||||
const {SplitView} = Cu.import("resource://devtools/client/shared/SplitView.jsm", {});
|
||||
|
|
|
@ -58,7 +58,7 @@ exports.items = [{
|
|||
to: "dom",
|
||||
exec: function(args, context) {
|
||||
let target = context.environment.target;
|
||||
let gDevTools = require("resource://devtools/client/framework/gDevTools.jsm").gDevTools;
|
||||
let {gDevTools} = require("devtools/client/framework/devtools");
|
||||
return gDevTools.showToolbox(target, "styleeditor").then(function(toolbox) {
|
||||
let styleEditor = toolbox.getCurrentPanel();
|
||||
styleEditor.selectStyleSheet(args.href, args.line);
|
||||
|
|
|
@ -42,6 +42,11 @@
|
|||
--timeline-background-color: var(--theme-highlight-blue);
|
||||
}
|
||||
|
||||
.animation.scriptanimation {
|
||||
--timeline-border-color: var(--theme-highlight-green);
|
||||
--timeline-background-color: var(--theme-graphs-green);
|
||||
}
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
@ -529,6 +534,10 @@ body {
|
|||
background-color: var(--theme-highlight-blue);
|
||||
}
|
||||
|
||||
.keyframes.scriptanimation {
|
||||
background-color: var(--theme-graphs-green);
|
||||
}
|
||||
|
||||
.keyframes .frame {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
|
|
@ -2,6 +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/. -->
|
||||
<svg height="16" width="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="#babec3">
|
||||
<path d="M10.2 4.1c-.6 0-1.2.2-1.8.4-.6-.4-1.4-.6-2.2-.6-2.5 0-4.6 2.1-4.6 4.6s2.1 4.6 4.6 4.6c.9 0 1.6-.2 2.3-.7.5.2 1.1.4 1.7.4 2.4 0 4.3-1.9 4.3-4.3.1-2.4-1.9-4.4-4.3-4.4zm-4 7.9c-1.9 0-3.5-1.6-3.5-3.5S4.2 5 6.2 5c.3 0 .7 0 1 .1-.8.9-1.4 2.1-1.4 3.4 0 1.3.6 2.5 1.5 3.3-.4.1-.8.2-1.1.2zm2.1-.7c-.9-.6-1.4-1.6-1.4-2.8 0-1.1.6-2.1 1.4-2.8.8.6 1.4 1.6 1.4 2.8 0 1.1-.6 2.1-1.4 2.8z"/>
|
||||
<path d="M7.6 8c-.2 0-.3-.1-.4-.2-.1-.2 0-.4.2-.5l1.1-.6c.2-.1.4 0 .5.2.1.2 0 .4-.2.5l-1.1.5c0 .1-.1.1-.1.1zM7.6 9.1c-.1 0-.3-.1-.4-.2-.1-.2 0-.4.2-.5l1.1-.6c.3-.1.5 0 .6.2.1.2 0 .4-.2.5l-1.1.6h-.2zM7.8 10.3c-.1 0-.3-.1-.4-.2-.1-.2 0-.4.2-.5L8.8 9c.2-.1.4 0 .5.2.1.2 0 .4-.2.5l-1.1.6h-.2z"/>
|
||||
<path d="M10.2 4.1c-.6 0-1.2.2-1.8.4-.6-.4-1.4-.6-2.2-.6-2.5 0-4.6 2.1-4.6 4.6s2.1 4.6 4.6 4.6c.9 0 1.6-.2 2.3-.7.5.2 1.1.4 1.7.4 2.4 0 4.3-1.9 4.3-4.3.1-2.4-1.9-4.4-4.3-4.4zm-4 7.9c-1.9 0-3.5-1.6-3.5-3.5S4.2 5 6.2 5c.3 0 .7 0 1 .1-.8.9-1.4 2.1-1.4 3.4 0 1.3.6 2.5 1.5 3.3-.4.1-.8.2-1.1.2zm2.1-.7c-.9-.6-1.4-1.6-1.4-2.8 0-1.1.6-2.1 1.4-2.8.8.6 1.4 1.6 1.4 2.8 0 1.1-.6 2.1-1.4 2.8z"/>
|
||||
<path d="M7.6 8c-.2 0-.3-.1-.4-.2-.1-.2 0-.4.2-.5l1.1-.6c.2-.1.4 0 .5.2.1.2 0 .4-.2.5l-1.1.5c0 .1-.1.1-.1.1zM7.6 9.1c-.1 0-.3-.1-.4-.2-.1-.2 0-.4.2-.5l1.1-.6c.3-.1.5 0 .6.2.1.2 0 .4-.2.5l-1.1.6h-.2zM7.8 10.3c-.1 0-.3-.1-.4-.2-.1-.2 0-.4.2-.5L8.8 9c.2-.1.4 0 .5.2.1.2 0 .4-.2.5l-1.1.6h-.2z"/>
|
||||
</svg>
|
||||
|
|
До Ширина: | Высота: | Размер: 1003 B После Ширина: | Высота: | Размер: 999 B |
|
@ -14,7 +14,7 @@ var {EPSILON, TiltMath, vec3, mat4, quat4} = require("devtools/client/tilt/tilt-
|
|||
var {TargetFactory} = require("devtools/client/framework/target");
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
var {gDevTools} = require("devtools/client/framework/devtools");
|
||||
|
||||
const ELEMENT_MIN_SIZE = 4;
|
||||
const INVISIBLE_ELEMENTS = {
|
||||
|
|
|
@ -8,7 +8,6 @@ var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
|||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
|
||||
const { loader, require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
|
||||
|
@ -23,6 +22,7 @@ const L10N = new ViewHelpers.L10N(STRINGS_URI);
|
|||
const Telemetry = require("devtools/client/shared/telemetry");
|
||||
const telemetry = new Telemetry();
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
|
||||
loader.lazyRequireGetter(this, "LineGraphWidget",
|
||||
"devtools/client/shared/widgets/LineGraphWidget");
|
||||
|
|
|
@ -12,8 +12,8 @@ var gEnableLogging = Services.prefs.getBoolPref("devtools.debugger.log");
|
|||
Services.prefs.setBoolPref("devtools.debugger.log", false);
|
||||
|
||||
var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||
var { gDevTools } = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
var { gDevTools } = require("devtools/client/framework/devtools");
|
||||
var { TargetFactory } = require("devtools/client/framework/target");
|
||||
var { DebuggerServer } = require("devtools/server/main");
|
||||
var { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"use strict";
|
||||
|
||||
const l10n = require("gcli/l10n");
|
||||
loader.lazyGetter(this, "gDevTools", () => require("resource://devtools/client/framework/gDevTools.jsm").gDevTools);
|
||||
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
|
||||
|
||||
exports.items = [
|
||||
{
|
||||
|
|
|
@ -12,11 +12,11 @@ const { Services } = require("resource://gre/modules/Services.jsm");
|
|||
|
||||
loader.lazyImporter(this, "VariablesView", "resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
loader.lazyImporter(this, "escapeHTML", "resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm");
|
||||
loader.lazyImporter(this, "Task", "resource://gre/modules/Task.jsm");
|
||||
loader.lazyImporter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
|
||||
|
||||
loader.lazyRequireGetter(this, "promise");
|
||||
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
|
||||
loader.lazyRequireGetter(this, "TableWidget", "devtools/client/shared/widgets/TableWidget", true);
|
||||
loader.lazyRequireGetter(this, "ObjectClient", "devtools/shared/client/main", true);
|
||||
|
||||
|
|
|
@ -14,13 +14,13 @@ var {TargetFactory} = require("devtools/client/framework/target");
|
|||
var {Tools} = require("devtools/client/definitions");
|
||||
var promise = require("promise");
|
||||
|
||||
loader.lazyGetter(this, "Telemetry", () => require("devtools/client/shared/telemetry"));
|
||||
loader.lazyGetter(this, "WebConsoleFrame", () => require("devtools/client/webconsole/webconsole").WebConsoleFrame);
|
||||
loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm");
|
||||
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
loader.lazyRequireGetter(this, "Telemetry", "devtools/client/shared/telemetry");
|
||||
loader.lazyRequireGetter(this, "WebConsoleFrame", "devtools/client/webconsole/webconsole", true);
|
||||
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
|
||||
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
||||
loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true);
|
||||
loader.lazyGetter(this, "showDoorhanger", () => require("devtools/client/shared/doorhanger").showDoorhanger);
|
||||
loader.lazyRequireGetter(this, "showDoorhanger", "devtools/client/shared/doorhanger", true);
|
||||
loader.lazyRequireGetter(this, "viewSource", "devtools/client/shared/view-source");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/webconsole.properties";
|
||||
|
|
|
@ -29,8 +29,8 @@ loader.lazyRequireGetter(this, "system", "devtools/shared/system");
|
|||
loader.lazyRequireGetter(this, "Timers", "sdk/timers");
|
||||
loader.lazyImporter(this, "VariablesView", "resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
loader.lazyImporter(this, "VariablesViewController", "resource://devtools/client/shared/widgets/VariablesViewController.jsm");
|
||||
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
|
||||
loader.lazyImporter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
|
||||
loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm");
|
||||
|
||||
const STRINGS_URI = "chrome://devtools/locale/webconsole.properties";
|
||||
var l10n = new WebConsoleUtils.l10n(STRINGS_URI);
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var Cu = Components.utils;
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {AppManager} = require("devtools/client/webide/modules/app-manager");
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var Cu = Components.utils;
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {AppManager} = require("devtools/client/webide/modules/app-manager");
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var Cu = Components.utils;
|
||||
Cu.import('resource://devtools/client/framework/gDevTools.jsm');
|
||||
const {require} = Cu.import('resource://devtools/shared/Loader.jsm', {});
|
||||
const {Services} = Cu.import('resource://gre/modules/Services.jsm');
|
||||
const {AppManager} = require('devtools/client/webide/modules/app-manager');
|
||||
|
|
|
@ -6,10 +6,11 @@ var Cc = Components.classes;
|
|||
var Cu = Components.utils;
|
||||
var Ci = Components.interfaces;
|
||||
|
||||
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const {gDevToolsBrowser} = require("devtools/client/framework/devtools-browser");
|
||||
const {Toolbox} = require("devtools/client/framework/toolbox");
|
||||
const Services = require("Services");
|
||||
const {AppProjects} = require("devtools/client/webide/modules/app-projects");
|
||||
|
|
|
@ -10,7 +10,7 @@ Cu.import("resource://gre/modules/FileUtils.jsm");
|
|||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
|
||||
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const {gDevTools} = Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const promise = require("promise");
|
||||
const {AppProjects} = require("devtools/client/webide/modules/app-projects");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
Task.spawn(function* () {
|
||||
let win = yield openWebIDE();
|
||||
|
||||
const {gDevToolsBrowser} = Cu.import("resource://devtools/client/framework/gDevTools.jsm");
|
||||
const {gDevToolsBrowser} = require("devtools/client/framework/devtools-browser");
|
||||
yield gDevToolsBrowser.isWebIDEInitialized.promise;
|
||||
ok(true, "WebIDE was initialized");
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ const events = require("sdk/event/core");
|
|||
const ANIMATION_TYPES = {
|
||||
CSS_ANIMATION: "cssanimation",
|
||||
CSS_TRANSITION: "csstransition",
|
||||
SCRIPT_ANIMATION: "scriptanimation",
|
||||
UNKNOWN: "unknown"
|
||||
};
|
||||
exports.ANIMATION_TYPES = ANIMATION_TYPES;
|
||||
|
@ -119,19 +120,28 @@ var AnimationPlayerActor = ActorClass({
|
|||
return data;
|
||||
},
|
||||
|
||||
isAnimation: function(player = this.player) {
|
||||
isCssAnimation: function(player = this.player) {
|
||||
return player instanceof this.window.CSSAnimation;
|
||||
},
|
||||
|
||||
isTransition: function(player = this.player) {
|
||||
isCssTransition: function(player = this.player) {
|
||||
return player instanceof this.window.CSSTransition;
|
||||
},
|
||||
|
||||
isScriptAnimation: function(player = this.player) {
|
||||
return player instanceof this.window.Animation && !(
|
||||
player instanceof this.window.CSSAnimation ||
|
||||
player instanceof this.window.CSSTransition
|
||||
);
|
||||
},
|
||||
|
||||
getType: function() {
|
||||
if (this.isAnimation()) {
|
||||
if (this.isCssAnimation()) {
|
||||
return ANIMATION_TYPES.CSS_ANIMATION;
|
||||
} else if (this.isTransition()) {
|
||||
} else if (this.isCssTransition()) {
|
||||
return ANIMATION_TYPES.CSS_TRANSITION;
|
||||
} else if (this.isScriptAnimation()) {
|
||||
return ANIMATION_TYPES.SCRIPT_ANIMATION;
|
||||
}
|
||||
|
||||
return ANIMATION_TYPES.UNKNOWN;
|
||||
|
@ -146,9 +156,9 @@ var AnimationPlayerActor = ActorClass({
|
|||
getName: function() {
|
||||
if (this.player.id) {
|
||||
return this.player.id;
|
||||
} else if (this.isAnimation()) {
|
||||
} else if (this.isCssAnimation()) {
|
||||
return this.player.animationName;
|
||||
} else if (this.isTransition()) {
|
||||
} else if (this.isCssTransition()) {
|
||||
return this.player.transitionProperty;
|
||||
}
|
||||
|
||||
|
@ -626,9 +636,9 @@ var AnimationsActor = exports.AnimationsActor = ActorClass({
|
|||
// a "removed" event for the one we already have.
|
||||
let index = this.actors.findIndex(a => {
|
||||
let isSameType = a.player.constructor === player.constructor;
|
||||
let isSameName = (a.isAnimation() &&
|
||||
let isSameName = (a.isCssAnimation() &&
|
||||
a.player.animationName === player.animationName) ||
|
||||
(a.isTransition() &&
|
||||
(a.isCssTransition() &&
|
||||
a.player.transitionProperty === player.transitionProperty);
|
||||
let isSameNode = a.player.effect.target === player.effect.target;
|
||||
|
||||
|
|
|
@ -12,10 +12,8 @@ const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
|
|||
const events = require("sdk/event/core");
|
||||
const protocol = require("devtools/server/protocol");
|
||||
const { method, custom, RetVal, Arg } = protocol;
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
|
||||
loader.lazyGetter(this, "gDevTools", () => {
|
||||
return require("resource://devtools/client/framework/gDevTools.jsm").gDevTools;
|
||||
});
|
||||
loader.lazyGetter(this, "DOMUtils", () => {
|
||||
return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils)
|
||||
});
|
||||
|
|
|
@ -24,6 +24,9 @@ function run_test() {
|
|||
}
|
||||
};
|
||||
|
||||
window.CSSAnimation.prototype = Object.create(window.Animation.prototype);
|
||||
window.CSSTransition.prototype = Object.create(window.Animation.prototype);
|
||||
|
||||
// Helper to get a mock DOM node.
|
||||
function getMockNode() {
|
||||
return {
|
||||
|
@ -46,6 +49,11 @@ function run_test() {
|
|||
animation: new window.Animation(),
|
||||
props: { id: "animation-id" },
|
||||
expectedName: "animation-id"
|
||||
}, {
|
||||
desc: "Animation without an id",
|
||||
animation: new window.Animation(),
|
||||
props: {},
|
||||
expectedName: ""
|
||||
}, {
|
||||
desc: "CSSTransition with an id",
|
||||
animation: new window.CSSTransition(),
|
||||
|
|
|
@ -24,6 +24,9 @@ function run_test() {
|
|||
}
|
||||
};
|
||||
|
||||
window.CSSAnimation.prototype = Object.create(window.Animation.prototype);
|
||||
window.CSSTransition.prototype = Object.create(window.Animation.prototype);
|
||||
|
||||
// Helper to get a mock DOM node.
|
||||
function getMockNode() {
|
||||
return {
|
||||
|
@ -47,6 +50,10 @@ function run_test() {
|
|||
desc: "Test CSSTransition type",
|
||||
animation: new window.CSSTransition(),
|
||||
expectedType: ANIMATION_TYPES.CSS_TRANSITION
|
||||
}, {
|
||||
desc: "Test ScriptAnimation type",
|
||||
animation: new window.Animation(),
|
||||
expectedType: ANIMATION_TYPES.SCRIPT_ANIMATION
|
||||
}, {
|
||||
desc: "Test unknown type",
|
||||
animation: {effect: {target: getMockNode()}},
|
||||
|
|
|
@ -444,7 +444,7 @@ DevToolsLoader.prototype = {
|
|||
setTimeout(() => {
|
||||
let { gBrowser } = window;
|
||||
let target = this.TargetFactory.forTab(gBrowser.selectedTab);
|
||||
const { gDevTools } = this.require("resource://devtools/client/framework/gDevTools.jsm");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
gDevTools.showToolbox(target);
|
||||
}, 1000);
|
||||
} else if (location.includes("/webide.xul")) {
|
||||
|
|
|
@ -7,18 +7,11 @@
|
|||
const { Cc, Ci, Cu } = require("chrome");
|
||||
const l10n = require("gcli/l10n");
|
||||
const gcli = require("gcli/index");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
const Debugger = require("Debugger");
|
||||
|
||||
loader.lazyRequireGetter(this, "TargetFactory", "devtools/client/framework/target", true);
|
||||
|
||||
loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm");
|
||||
|
||||
loader.lazyGetter(this, "Debugger", () => {
|
||||
let global = Cu.getGlobalForObject({});
|
||||
let JsDebugger = Cu.import("resource://gre/modules/jsdebugger.jsm", {});
|
||||
JsDebugger.addDebuggerToGlobal(global);
|
||||
return global.Debugger;
|
||||
});
|
||||
|
||||
var debuggers = [];
|
||||
var chromeDebuggers = [];
|
||||
var sandboxes = [];
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
|
||||
const { Cc, Ci } = require("chrome");
|
||||
|
||||
loader.lazyGetter(this, "gDevTools", () => require("resource://devtools/client/framework/gDevTools.jsm").gDevTools);
|
||||
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
const domtemplate = require("gcli/util/domtemplate");
|
||||
const csscoverage = require("devtools/server/actors/csscoverage");
|
||||
const l10n = csscoverage.l10n;
|
||||
|
|
|
@ -47,7 +47,7 @@ exports.lookup = function(name) {
|
|||
* <code>l10n:l10n.propertyLookup</code> in the template data and use it
|
||||
* like <code>${l10n.BLAH}</code>
|
||||
*/
|
||||
exports.propertyLookup = Proxy.create({
|
||||
exports.propertyLookup = new Proxy({}, {
|
||||
get: function(rcvr, name) {
|
||||
return exports.lookup(name);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ exports.lookup = function(key) {
|
|||
};
|
||||
|
||||
/** @see propertyLookup in lib/gcli/util/l10n.js */
|
||||
exports.propertyLookup = Proxy.create({
|
||||
exports.propertyLookup = new Proxy({}, {
|
||||
get: function(rcvr, name) {
|
||||
return exports.lookup(name);
|
||||
}
|
||||
|
|
|
@ -375,7 +375,7 @@ const createParentMap = exports.createParentMap = function (node,
|
|||
if (node.children) {
|
||||
for (let i = 0, length = node.children.length; i < length; i++) {
|
||||
const child = node.children[i];
|
||||
aggregator[getId(child)] = getId(node);
|
||||
aggregator[getId(child)] = node;
|
||||
createParentMap(child, getId, aggregator);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ var workerCounter = 0;
|
|||
const HeapAnalysesClient = module.exports = function () {
|
||||
this._worker = new DevToolsWorker(WORKER_URL, {
|
||||
name: `HeapAnalyses-${workerCounter++}`,
|
||||
verbose: DevToolsUtils.dumpv.wantLogging
|
||||
verbose: DevToolsUtils.dumpv.wantVerbose
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -4,3 +4,4 @@ distributionPath=wrapper/dists
|
|||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-all.zip
|
||||
distributionSha256Sum=2ba0aaa11a3e96ec0af31d532d808e1f09cc6dcad0954e637902a1ab544b9e60
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
# 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/.
|
||||
|
||||
# We call mach -> Make -> gradle -> mach, which races to find and
|
||||
# create .mozconfig files and to generate targets.
|
||||
ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
|
||||
.NOTPARALLEL:
|
||||
endif
|
||||
|
||||
MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
|
||||
|
||||
# Set the appropriate version code, based on the existance of the
|
||||
|
@ -201,9 +207,21 @@ endif # MOZ_INSTALL_TRACKING
|
|||
|
||||
library_jars := $(subst $(NULL) ,:,$(strip $(library_jars)))
|
||||
|
||||
gradle_dir := $(topobjdir)/gradle/build/mobile/android
|
||||
|
||||
ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
|
||||
.gradle.deps: .aapt.deps FORCE
|
||||
@$(TOUCH) $@
|
||||
$(topsrcdir)/mach gradle --no-daemon --offline app:dexAutomationDebug app:assembleAutomationDebugAndroidTest -x lint
|
||||
|
||||
classes.dex: .gradle.deps
|
||||
$(REPORT_BUILD)
|
||||
cp $(gradle_dir)/app/intermediates/dex/automation/debug/classes.dex $@
|
||||
else
|
||||
classes.dex: .proguard.deps
|
||||
$(REPORT_BUILD)
|
||||
$(DX) --dex --output=classes.dex jars-proguarded
|
||||
endif
|
||||
|
||||
ifdef MOZ_DISABLE_PROGUARD
|
||||
PROGUARD_PASSES=0
|
||||
|
@ -501,8 +519,13 @@ endef
|
|||
# .aapt.deps: $(all_resources)
|
||||
$(eval $(call aapt_command,.aapt.deps,$(all_resources),gecko.ap_,generated/,./))
|
||||
|
||||
# .aapt.nodeps: $(abspath $(CURDIR)/AndroidManifest.xml) FORCE
|
||||
$(eval $(call aapt_command,.aapt.nodeps,$(abspath $(CURDIR)/AndroidManifest.xml) FORCE,gecko-nodeps.ap_,gecko-nodeps/,gecko-nodeps/))
|
||||
ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
|
||||
.aapt.nodeps: FORCE
|
||||
cp $(gradle_dir)/app/intermediates/res/resources-automation-debug.ap_ gecko-nodeps.ap_
|
||||
else
|
||||
# .aapt.nodeps: $(CURDIR)/AndroidManifest.xml FORCE
|
||||
$(eval $(call aapt_command,.aapt.nodeps,$(CURDIR)/AndroidManifest.xml FORCE,gecko-nodeps.ap_,gecko-nodeps/,gecko-nodeps/))
|
||||
endif
|
||||
|
||||
# Override the Java settings with some specific android settings
|
||||
include $(topsrcdir)/config/android-common.mk
|
||||
|
@ -532,7 +555,14 @@ gradle-targets: $(foreach f,$(constants_PP_JAVAFILES),$(f))
|
|||
gradle-targets: $(abspath AndroidManifest.xml)
|
||||
gradle-targets: $(ANDROID_GENERATED_RESFILES)
|
||||
|
||||
gradle-omnijar: $(ABS_DIST)/fennec/$(OMNIJAR_NAME)
|
||||
ifndef MOZILLA_OFFICIAL
|
||||
# Local developers update omni.ja during their builds. There's a
|
||||
# chicken-and-egg problem here.
|
||||
gradle-omnijar: $(abspath $(DIST)/fennec/$(OMNIJAR_NAME))
|
||||
else
|
||||
# In automation, omni.ja is built only during packaging.
|
||||
gradle-omnijar:
|
||||
endif
|
||||
|
||||
.PHONY: gradle-targets gradle-omnijar
|
||||
|
||||
|
@ -543,8 +573,8 @@ endif
|
|||
|
||||
# GeneratedJNIWrappers.cpp target also generates
|
||||
# GeneratedJNIWrappers.h and GeneratedJNINatives.h
|
||||
libs:: classes.dex jni-stubs.inc GeneratedJNIWrappers.cpp $(CURDIR)/fennec_ids.txt
|
||||
$(INSTALL) classes.dex $(FINAL_TARGET)
|
||||
ifndef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
|
||||
libs:: jni-stubs.inc GeneratedJNIWrappers.cpp
|
||||
@(diff jni-stubs.inc $(topsrcdir)/mozglue/android/jni-stubs.inc >/dev/null && \
|
||||
diff GeneratedJNIWrappers.cpp $(topsrcdir)/widget/android/GeneratedJNIWrappers.cpp >/dev/null && \
|
||||
diff GeneratedJNIWrappers.h $(topsrcdir)/widget/android/GeneratedJNIWrappers.h >/dev/null && \
|
||||
|
@ -558,3 +588,9 @@ libs:: classes.dex jni-stubs.inc GeneratedJNIWrappers.cpp $(CURDIR)/fennec_ids.t
|
|||
echo '* Repeat the build, and check in any changes. *' && \
|
||||
echo '*****************************************************' && \
|
||||
exit 1)
|
||||
endif
|
||||
|
||||
libs:: $(CURDIR)/fennec_ids.txt
|
||||
|
||||
libs:: classes.dex
|
||||
$(INSTALL) classes.dex $(FINAL_TARGET)
|
||||
|
|
|
@ -57,6 +57,7 @@ public class URLMetadataTable extends BaseTable {
|
|||
// This table was added in v21 of the db. Force its creation if we're coming from an earlier version
|
||||
if (newVersion >= 21 && oldVersion < 21) {
|
||||
onCreate(db);
|
||||
return;
|
||||
}
|
||||
|
||||
// Removed the redundant metadata_url_idx index in version 26
|
||||
|
|
|
@ -269,6 +269,57 @@ public class DateTimePicker extends FrameLayout {
|
|||
Log.d(LOGTAG, "screen width: " + mScreenWidth + " screen height: " + mScreenHeight);
|
||||
}
|
||||
|
||||
// Set the min / max attribute.
|
||||
try {
|
||||
if (minDateValue != null && !minDateValue.equals("")) {
|
||||
mMinDate.setTime(new SimpleDateFormat(dateFormat).parse(minDateValue));
|
||||
} else {
|
||||
mMinDate.set(DEFAULT_START_YEAR, Calendar.JANUARY, 1);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOGTAG, "Error parsing format sting: " + ex);
|
||||
mMinDate.set(DEFAULT_START_YEAR, Calendar.JANUARY, 1);
|
||||
}
|
||||
|
||||
try {
|
||||
if (maxDateValue != null && !maxDateValue.equals("")) {
|
||||
mMaxDate.setTime(new SimpleDateFormat(dateFormat).parse(maxDateValue));
|
||||
} else {
|
||||
mMaxDate.set(DEFAULT_END_YEAR, Calendar.DECEMBER, 31);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOGTAG, "Error parsing format string: " + ex);
|
||||
mMaxDate.set(DEFAULT_END_YEAR, Calendar.DECEMBER, 31);
|
||||
}
|
||||
|
||||
// Find the initial date from the constructor arguments.
|
||||
try {
|
||||
if (!dateTimeValue.equals("")) {
|
||||
mTempDate.setTime(new SimpleDateFormat(dateFormat).parse(dateTimeValue));
|
||||
} else {
|
||||
mTempDate.setTimeInMillis(System.currentTimeMillis());
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOGTAG, "Error parsing format string: " + ex);
|
||||
mTempDate.setTimeInMillis(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
if (mMaxDate.before(mMinDate)) {
|
||||
// If the input date range is illogical/garbage, we should not restrict the input range (i.e. allow the
|
||||
// user to select any date). If we try to make any assumptions based on the illogical min/max date we could
|
||||
// potentially prevent the user from selecting dates that are in the developers intended range, so it's best
|
||||
// to allow anything.
|
||||
mMinDate.set(DEFAULT_START_YEAR, Calendar.JANUARY, 1);
|
||||
mMaxDate.set(DEFAULT_END_YEAR, Calendar.DECEMBER, 31);
|
||||
}
|
||||
|
||||
// mTempDate will either be a site-supplied value, or today's date otherwise. CalendarView implementations can
|
||||
// crash if they're supplied an invalid date (i.e. a date not in the specified range), hence we need to set
|
||||
// a sensible default date here.
|
||||
if (mTempDate.before(mMinDate) || mTempDate.after(mMaxDate)) {
|
||||
mTempDate.setTimeInMillis(mMinDate.getTimeInMillis());
|
||||
}
|
||||
|
||||
// If we're displaying a date, the screen is wide enough
|
||||
// (and if we're using an SDK where the calendar view exists)
|
||||
// then display a calendar.
|
||||
|
@ -312,41 +363,6 @@ public class DateTimePicker extends FrameLayout {
|
|||
mCalendar = null;
|
||||
}
|
||||
|
||||
// Find the initial date from the constructor arguments.
|
||||
try {
|
||||
if (!dateTimeValue.equals("")) {
|
||||
mTempDate.setTime(new SimpleDateFormat(dateFormat).parse(dateTimeValue));
|
||||
} else {
|
||||
mTempDate.setTimeInMillis(System.currentTimeMillis());
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOGTAG, "Error parsing format string: " + ex);
|
||||
mTempDate.setTimeInMillis(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
// Set the min / max attribute.
|
||||
try {
|
||||
if (minDateValue != null && !minDateValue.equals("")) {
|
||||
mMinDate.setTime(new SimpleDateFormat(dateFormat).parse(minDateValue));
|
||||
} else {
|
||||
mMinDate.set(DEFAULT_START_YEAR, Calendar.JANUARY, 1);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOGTAG, "Error parsing format sting: " + ex);
|
||||
mMinDate.set(DEFAULT_START_YEAR, Calendar.JANUARY, 1);
|
||||
}
|
||||
|
||||
try {
|
||||
if (maxDateValue != null && !maxDateValue.equals("")) {
|
||||
mMaxDate.setTime(new SimpleDateFormat(dateFormat).parse(maxDateValue));
|
||||
} else {
|
||||
mMaxDate.set(DEFAULT_END_YEAR, Calendar.DECEMBER, 31);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOGTAG, "Error parsing format string: " + ex);
|
||||
mMaxDate.set(DEFAULT_END_YEAR, Calendar.DECEMBER, 31);
|
||||
}
|
||||
|
||||
// Initialize all spinners.
|
||||
mDaySpinner = setupSpinner(R.id.day, 1,
|
||||
mTempDate.get(Calendar.DAY_OF_MONTH));
|
||||
|
|
|
@ -8,72 +8,19 @@
|
|||
<!ENTITY syncBrand.shortName.label "Sync">
|
||||
|
||||
<!-- Main titles. -->
|
||||
<!ENTITY sync.app.name.label '&syncBrand.fullName.label;'>
|
||||
<!ENTITY sync.title.connect.label 'Connect to &syncBrand.shortName.label;'>
|
||||
<!ENTITY sync.title.adddevice.label 'Add a &syncBrand.fullName.label; Account'>
|
||||
<!ENTITY sync.title.pair.label 'Pair a Device'>
|
||||
|
||||
<!-- J-PAKE Key Screen -->
|
||||
<!ENTITY sync.subtitle.connect.label 'To activate your new device, select “Set up &syncBrand.shortName.label;” on the device.'>
|
||||
<!ENTITY sync.subtitle.header2.label 'Enter this code on your other device'>
|
||||
<!ENTITY sync.subtitle.connectlocation2.label 'Select “&sync.title.pair.label;” in the &syncBrand.shortName.label; section of your other device\'s Firefox options.'>
|
||||
<!ENTITY sync.subtitle.pair.label 'To activate, select “Pair a device” on your other device.'>
|
||||
<!ENTITY sync.pin.default.label '...\n...\n...\n'>
|
||||
<!ENTITY sync.pin.oneline.label '...'>
|
||||
<!ENTITY sync.link.show.label 'Show me how.'>
|
||||
<!ENTITY sync.link.advancedsetup.label 'Advanced setup…'>
|
||||
<!ENTITY sync.link.nodevice.label 'I don\'t have the device with me…'>
|
||||
|
||||
<!-- J-PAKE Waiting Screen -->
|
||||
<!ENTITY sync.jpake.subtitle.waiting.label 'Waiting for other device…'>
|
||||
|
||||
<!-- Account Login Screen -->
|
||||
<!ENTITY sync.subtitle.account.label 'Enter your &syncBrand.fullName.label; account information'>
|
||||
<!ENTITY sync.input.username.label 'Account Name'>
|
||||
<!ENTITY sync.input.password.label 'Password'>
|
||||
<!ENTITY sync.input.key.label 'Recovery Key'>
|
||||
<!ENTITY sync.checkbox.server.label 'Use custom server'>
|
||||
<!ENTITY sync.input.server.label 'Server URL'>
|
||||
|
||||
<!-- Setup Fail -->
|
||||
<!ENTITY sync.title.fail.label 'Cannot Set Up &syncBrand.shortName.label;'>
|
||||
<!ENTITY sync.subtitle.fail.label '&syncBrand.fullName.label; could not connect to the server. Would you like to try again?'>
|
||||
<!ENTITY sync.button.tryagain.label 'Try again'>
|
||||
<!ENTITY sync.button.manual.label 'Manual Setup'>
|
||||
<!ENTITY sync.subtitle.nointernet.label 'No internet connection available.'>
|
||||
<!ENTITY sync.subtitle.failaccount.label 'Account creation on your device failed.'>
|
||||
<!ENTITY sync.subtitle.failmultiple.label 'Do you have more than one Firefox installed? Currently, &syncBrand.fullName.label; only supports one Firefox installation at a time. Please uninstall other instances to use &syncBrand.shortName.label;.'>
|
||||
|
||||
<!-- Setup Success -->
|
||||
<!ENTITY sync.title.success.label 'Setup Complete'>
|
||||
<!ENTITY sync.subtitle.success.label1 'Your data is now being downloaded in the background. You can go to Settings to manage your account, or start browsing with &brandShortName;.'>
|
||||
<!ENTITY sync.settings.label 'Settings'>
|
||||
<!ENTITY sync.subtitle.manage.label1 'Your &syncBrand.fullName.label; account is already set up. You can go to Settings to manage your account, or launch &brandShortName;.'>
|
||||
|
||||
<!-- Pair Device -->
|
||||
<!ENTITY sync.pair.tryagain.label 'Please try again.'>
|
||||
<!ENTITY sync.pair.connectlocation.label 'To activate your new device, select “Set up &syncBrand.shortName.label;” on the device, and then select “I Have an Account.”'>
|
||||
|
||||
<!-- Firefox SyncAdapter Settings Screen -->
|
||||
<!ENTITY sync.settings.options.label 'Options'>
|
||||
<!ENTITY sync.summary.pair.label 'Link another device to your &syncBrand.shortName.label; account'>
|
||||
|
||||
<!-- Configure Engines -->
|
||||
<!ENTITY sync.configure.engines.title.label 'What to sync'>
|
||||
<!ENTITY sync.configure.engines.sync.my.title.label 'Sync your…'>
|
||||
<!ENTITY sync.configure.engines.title.bookmarks 'Bookmarks'>
|
||||
<!ENTITY sync.configure.engines.title.passwords2 'Logins'>
|
||||
<!ENTITY sync.configure.engines.title.history 'History'>
|
||||
<!ENTITY sync.configure.engines.title.tabs 'Tabs'>
|
||||
|
||||
<!-- Common text -->
|
||||
<!ENTITY sync.button.cancel.label 'Cancel'>
|
||||
<!ENTITY sync.button.connect.label 'Connect'>
|
||||
<!ENTITY sync.button.ok.label 'OK'>
|
||||
|
||||
<!-- Account strings -->
|
||||
<!ENTITY sync.account.label '&syncBrand.fullName.label; (deprecated)'>
|
||||
|
||||
<!-- Localization note (sync.default.client.name): Default string of the "Device
|
||||
name" menu item upon setting up Firefox Sync. The placeholder &formatS1
|
||||
will be replaced by the name of the Firefox release channel and &formatS2
|
||||
|
@ -93,20 +40,7 @@
|
|||
<!-- Pinned sites on about:home. This folder should never be shown to the user, but we have to give it a string name -->
|
||||
<!ENTITY bookmarks.folder.pinned.label 'Pinned'>
|
||||
|
||||
<!-- Notification strings -->
|
||||
<!ENTITY sync.notification.oneaccount.label 'Only one &syncBrand.fullName.label; account is supported.'>
|
||||
<!ENTITY sync.notification.configure.saved 'Your selections have been saved.'>
|
||||
|
||||
<!-- Incorrect settings and changing credentials. -->
|
||||
<!ENTITY sync.invalidcreds.label 'Incorrect account name or password.'>
|
||||
<!ENTITY sync.invalidserver.label 'Please enter a valid server URL'>
|
||||
<!ENTITY sync.verifying.label 'Verifying…'>
|
||||
<!ENTITY sync.new.recoverykey.status.incorrect 'Recovery Key incorrect. Please try again.'>
|
||||
|
||||
<!-- Send tab to device. -->
|
||||
<!ENTITY sync.title.send.tab.label 'Send Tab To Devices'>
|
||||
<!ENTITY sync.button.send.label 'Send'>
|
||||
<!ENTITY sync.button.set.up.sync.label 'Set up &syncBrand.shortName.label;'>
|
||||
<!ENTITY sync.title.redirect.to.set.up.sync.label 'Set up &syncBrand.shortName.label; to send tabs'>
|
||||
<!ENTITY sync.text.redirect.to.set.up.sync.label 'Set up &syncBrand.fullName.label; on your device to send tabs to other devices.'>
|
||||
<!ENTITY sync.text.tab.sent.label 'Your tab was sent!'>
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче