mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Merge mozilla-central to mozilla-inbound
This commit is contained in:
commit
53c63f69db
@ -172,8 +172,14 @@ faster: install-dist/idl
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: tup
|
.PHONY: tup
|
||||||
tup: install-manifests buildid.h source-repo.h
|
tup:
|
||||||
|
$(call BUILDSTATUS,TIERS make tup)
|
||||||
|
$(call BUILDSTATUS,TIER_START make)
|
||||||
|
$(MAKE) install-manifests buildid.h source-repo.h
|
||||||
|
$(call BUILDSTATUS,TIER_FINISH make)
|
||||||
|
$(call BUILDSTATUS,TIER_START tup)
|
||||||
@$(TUP) $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),,--verbose)
|
@$(TUP) $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),,--verbose)
|
||||||
|
$(call BUILDSTATUS,TIER_FINISH tup)
|
||||||
|
|
||||||
# process_install_manifest needs to be invoked with --no-remove when building
|
# process_install_manifest needs to be invoked with --no-remove when building
|
||||||
# js as standalone because automated builds are building nspr separately and
|
# js as standalone because automated builds are building nspr separately and
|
||||||
|
@ -716,13 +716,9 @@ TextAttrsMgr::TextDecorValue::
|
|||||||
TextDecorValue(nsIFrame* aFrame)
|
TextDecorValue(nsIFrame* aFrame)
|
||||||
{
|
{
|
||||||
const nsStyleTextReset* textReset = aFrame->StyleTextReset();
|
const nsStyleTextReset* textReset = aFrame->StyleTextReset();
|
||||||
mStyle = textReset->GetDecorationStyle();
|
mStyle = textReset->mTextDecorationStyle;
|
||||||
|
mColor = aFrame->StyleColor()->
|
||||||
bool isForegroundColor = false;
|
CalcComplexColor(textReset->mTextDecorationColor);
|
||||||
textReset->GetDecorationColor(mColor, isForegroundColor);
|
|
||||||
if (isForegroundColor)
|
|
||||||
mColor = aFrame->StyleColor()->mColor;
|
|
||||||
|
|
||||||
mLine = textReset->mTextDecorationLine &
|
mLine = textReset->mTextDecorationLine &
|
||||||
(NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE |
|
(NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE |
|
||||||
NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH);
|
NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH);
|
||||||
|
@ -466,6 +466,9 @@ const CustomizableWidgets = [
|
|||||||
// Create the element for the remote client.
|
// Create the element for the remote client.
|
||||||
let clientItem = doc.createElementNS(kNSXUL, "label");
|
let clientItem = doc.createElementNS(kNSXUL, "label");
|
||||||
clientItem.setAttribute("itemtype", "client");
|
clientItem.setAttribute("itemtype", "client");
|
||||||
|
let window = doc.defaultView;
|
||||||
|
clientItem.setAttribute("tooltiptext",
|
||||||
|
window.gSyncUI.formatLastSyncDate(new Date(client.lastModified)));
|
||||||
clientItem.textContent = client.name;
|
clientItem.textContent = client.name;
|
||||||
|
|
||||||
attachFragment.appendChild(clientItem);
|
attachFragment.appendChild(clientItem);
|
||||||
|
@ -8,7 +8,8 @@ XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
|
|||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
|
XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
|
||||||
"resource://gre/modules/MatchPattern.jsm");
|
"resource://gre/modules/MatchPattern.jsm");
|
||||||
|
XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
|
||||||
|
"resource://gre/modules/PromiseUtils.jsm");
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "Services",
|
XPCOMUtils.defineLazyModuleGetter(this, "Services",
|
||||||
"resource://gre/modules/Services.jsm");
|
"resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
@ -242,6 +243,7 @@ let tabListener = {
|
|||||||
|
|
||||||
tabReadyInitialized: false,
|
tabReadyInitialized: false,
|
||||||
tabReadyPromises: new WeakMap(),
|
tabReadyPromises: new WeakMap(),
|
||||||
|
initializingTabs: new WeakSet(),
|
||||||
|
|
||||||
initTabReady() {
|
initTabReady() {
|
||||||
if (!this.tabReadyInitialized) {
|
if (!this.tabReadyInitialized) {
|
||||||
@ -256,6 +258,10 @@ let tabListener = {
|
|||||||
let gBrowser = browser.ownerGlobal.gBrowser;
|
let gBrowser = browser.ownerGlobal.gBrowser;
|
||||||
let tab = gBrowser.getTabForBrowser(browser);
|
let tab = gBrowser.getTabForBrowser(browser);
|
||||||
|
|
||||||
|
// Now we are certain that the first page in the tab was loaded.
|
||||||
|
this.initializingTabs.delete(tab);
|
||||||
|
|
||||||
|
// browser.innerWindowID is now set, resolve the promises if any.
|
||||||
let deferred = this.tabReadyPromises.get(tab);
|
let deferred = this.tabReadyPromises.get(tab);
|
||||||
if (deferred) {
|
if (deferred) {
|
||||||
deferred.resolve(tab);
|
deferred.resolve(tab);
|
||||||
@ -264,10 +270,25 @@ let tabListener = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a promise that resolves when the tab is ready.
|
||||||
|
* Tabs created via the `tabs.create` method are "ready" once the location
|
||||||
|
* changed to the requested URL. Other tabs are always assumed to be ready.
|
||||||
|
*
|
||||||
|
* @param {XULElement} tab The <tab> element.
|
||||||
|
* @returns {Promise} Resolves with the given tab once ready.
|
||||||
|
*/
|
||||||
awaitTabReady(tab) {
|
awaitTabReady(tab) {
|
||||||
return new Promise((resolve, reject) => {
|
let deferred = this.tabReadyPromises.get(tab);
|
||||||
this.tabReadyPromises.set(tab, {resolve, reject});
|
if (!deferred) {
|
||||||
});
|
deferred = PromiseUtils.defer();
|
||||||
|
if (!this.initializingTabs.has(tab) && tab.linkedBrowser.innerWindowID) {
|
||||||
|
deferred.resolve(tab);
|
||||||
|
} else {
|
||||||
|
this.tabReadyPromises.set(tab, deferred);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return deferred.promise;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -538,18 +559,18 @@ extensions.registerSchemaAPI("tabs", "addon_parent", context => {
|
|||||||
window.gBrowser.pinTab(tab);
|
window.gBrowser.pinTab(tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!createProperties.url || createProperties.url.startsWith("about:")) {
|
if (createProperties.url && !createProperties.url.startsWith("about:")) {
|
||||||
// We can't wait for a location change event for about:newtab,
|
// We can't wait for a location change event for about:newtab,
|
||||||
// since it may be pre-rendered, in which case its initial
|
// since it may be pre-rendered, in which case its initial
|
||||||
// location change event has already fired.
|
// location change event has already fired.
|
||||||
return tab;
|
|
||||||
|
// Mark the tab as initializing, so that operations like
|
||||||
|
// `executeScript` wait until the requested URL is loaded in
|
||||||
|
// the tab before dispatching messages to the inner window
|
||||||
|
// that contains the URL we're attempting to load.
|
||||||
|
tabListener.initializingTabs.add(tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the first location change event, so that operations
|
|
||||||
// like `executeScript` are dispatched to the inner window that
|
|
||||||
// contains the URL we're attempting to load.
|
|
||||||
return tabListener.awaitTabReady(tab);
|
|
||||||
}).then(tab => {
|
|
||||||
return TabManager.convert(extension, tab);
|
return TabManager.convert(extension, tab);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -717,45 +738,49 @@ extensions.registerSchemaAPI("tabs", "addon_parent", context => {
|
|||||||
WindowManager.topWindow :
|
WindowManager.topWindow :
|
||||||
WindowManager.getWindow(windowId, context);
|
WindowManager.getWindow(windowId, context);
|
||||||
|
|
||||||
let browser = window.gBrowser.selectedBrowser;
|
let tab = window.gBrowser.selectedTab;
|
||||||
let recipient = {
|
return tabListener.awaitTabReady(tab).then(() => {
|
||||||
innerWindowID: browser.innerWindowID,
|
let browser = tab.linkedBrowser;
|
||||||
};
|
let recipient = {
|
||||||
|
innerWindowID: browser.innerWindowID,
|
||||||
|
};
|
||||||
|
|
||||||
if (!options) {
|
if (!options) {
|
||||||
options = {};
|
options = {};
|
||||||
}
|
}
|
||||||
if (options.format == null) {
|
if (options.format == null) {
|
||||||
options.format = "png";
|
options.format = "png";
|
||||||
}
|
}
|
||||||
if (options.quality == null) {
|
if (options.quality == null) {
|
||||||
options.quality = 92;
|
options.quality = 92;
|
||||||
}
|
}
|
||||||
|
|
||||||
let message = {
|
let message = {
|
||||||
options,
|
options,
|
||||||
width: browser.clientWidth,
|
width: browser.clientWidth,
|
||||||
height: browser.clientHeight,
|
height: browser.clientHeight,
|
||||||
};
|
};
|
||||||
|
|
||||||
return context.sendMessage(browser.messageManager, "Extension:Capture",
|
return context.sendMessage(browser.messageManager, "Extension:Capture",
|
||||||
message, {recipient});
|
message, {recipient});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
detectLanguage: function(tabId) {
|
detectLanguage: function(tabId) {
|
||||||
let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
|
let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
|
||||||
|
|
||||||
let browser = tab.linkedBrowser;
|
return tabListener.awaitTabReady(tab).then(() => {
|
||||||
let recipient = {innerWindowID: browser.innerWindowID};
|
let browser = tab.linkedBrowser;
|
||||||
|
let recipient = {innerWindowID: browser.innerWindowID};
|
||||||
|
|
||||||
return context.sendMessage(browser.messageManager, "Extension:DetectLanguage",
|
return context.sendMessage(browser.messageManager, "Extension:DetectLanguage",
|
||||||
{}, {recipient});
|
{}, {recipient});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// Used to executeScript, insertCSS and removeCSS.
|
// Used to executeScript, insertCSS and removeCSS.
|
||||||
_execute: function(tabId, details, kind, method) {
|
_execute: function(tabId, details, kind, method) {
|
||||||
let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
|
let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
|
||||||
let mm = tab.linkedBrowser.messageManager;
|
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
js: [],
|
js: [],
|
||||||
@ -772,10 +797,6 @@ extensions.registerSchemaAPI("tabs", "addon_parent", context => {
|
|||||||
return Promise.reject({message: `'frameId' and 'allFrames' are mutually exclusive`});
|
return Promise.reject({message: `'frameId' and 'allFrames' are mutually exclusive`});
|
||||||
}
|
}
|
||||||
|
|
||||||
let recipient = {
|
|
||||||
innerWindowID: tab.linkedBrowser.innerWindowID,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (TabManager.for(extension).hasActiveTabPermission(tab)) {
|
if (TabManager.for(extension).hasActiveTabPermission(tab)) {
|
||||||
// If we have the "activeTab" permission for this tab, ignore
|
// If we have the "activeTab" permission for this tab, ignore
|
||||||
// the host whitelist.
|
// the host whitelist.
|
||||||
@ -809,7 +830,14 @@ extensions.registerSchemaAPI("tabs", "addon_parent", context => {
|
|||||||
options.run_at = "document_idle";
|
options.run_at = "document_idle";
|
||||||
}
|
}
|
||||||
|
|
||||||
return context.sendMessage(mm, "Extension:Execute", {options}, {recipient});
|
return tabListener.awaitTabReady(tab).then(() => {
|
||||||
|
let browser = tab.linkedBrowser;
|
||||||
|
let recipient = {
|
||||||
|
innerWindowID: browser.innerWindowID,
|
||||||
|
};
|
||||||
|
|
||||||
|
return context.sendMessage(browser.messageManager, "Extension:Execute", {options}, {recipient});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
executeScript: function(tabId, details) {
|
executeScript: function(tabId, details) {
|
||||||
|
9
browser/config/mozconfigs/linux32/artifact
Normal file
9
browser/config/mozconfigs/linux32/artifact
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||||
|
MOZ_AUTOMATION_L10N_CHECK=0
|
||||||
|
|
||||||
|
. "$topsrcdir/browser/config/mozconfigs/linux32/common-opt"
|
||||||
|
. "$topsrcdir/build/mozconfig.common.override"
|
||||||
|
|
||||||
|
ac_add_options --enable-artifact-builds
|
||||||
|
unset CC
|
||||||
|
unset CXX
|
7
browser/config/mozconfigs/macosx64/artifact
Normal file
7
browser/config/mozconfigs/macosx64/artifact
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||||
|
MOZ_AUTOMATION_L10N_CHECK=0
|
||||||
|
|
||||||
|
. "$topsrcdir/build/macosx/mozconfig.common"
|
||||||
|
. "$topsrcdir/build/mozconfig.common.override"
|
||||||
|
|
||||||
|
ac_add_options --enable-artifact-builds
|
9
browser/config/mozconfigs/win32/artifact
Normal file
9
browser/config/mozconfigs/win32/artifact
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||||
|
MOZ_AUTOMATION_L10N_CHECK=0
|
||||||
|
|
||||||
|
. "$topsrcdir/browser/config/mozconfigs/common"
|
||||||
|
. "$topsrcdir/build/mozconfig.win-common"
|
||||||
|
. "$topsrcdir/build/win32/mozconfig.vs-latest"
|
||||||
|
. "$topsrcdir/build/mozconfig.common.override"
|
||||||
|
|
||||||
|
ac_add_options --enable-artifact-builds
|
10
browser/config/mozconfigs/win64/artifact
Normal file
10
browser/config/mozconfigs/win64/artifact
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||||
|
MOZ_AUTOMATION_L10N_CHECK=0
|
||||||
|
|
||||||
|
. "$topsrcdir/browser/config/mozconfigs/win64/common-win64"
|
||||||
|
. "$topsrcdir/browser/config/mozconfigs/common"
|
||||||
|
. "$topsrcdir/build/mozconfig.win-common"
|
||||||
|
. "$topsrcdir/build/win64/mozconfig.vs-latest"
|
||||||
|
. "$topsrcdir/build/mozconfig.common.override"
|
||||||
|
|
||||||
|
ac_add_options --enable-artifact-builds
|
@ -129,7 +129,7 @@ var pktUI = (function() {
|
|||||||
*/
|
*/
|
||||||
function showSignUp() {
|
function showSignUp() {
|
||||||
// AB test: Direct logged-out users to tab vs panel
|
// AB test: Direct logged-out users to tab vs panel
|
||||||
if (pktApi.getSignupPanelTabTestVariant() == 'tab')
|
if (pktApi.getSignupPanelTabTestVariant() == 'v2')
|
||||||
{
|
{
|
||||||
let site = Services.prefs.getCharPref("extensions.pocket.site");
|
let site = Services.prefs.getCharPref("extensions.pocket.site");
|
||||||
openTabWithUrl('https://' + site + '/firefox_learnmore?s=ffi&t=autoredirect&tv=page_learnmore&src=ff_ext', true);
|
openTabWithUrl('https://' + site + '/firefox_learnmore?s=ffi&t=autoredirect&tv=page_learnmore&src=ff_ext', true);
|
||||||
|
@ -610,7 +610,7 @@ var pktApi = (function() {
|
|||||||
* Helper function to get current signup AB group the user is in
|
* Helper function to get current signup AB group the user is in
|
||||||
*/
|
*/
|
||||||
function getSignupPanelTabTestVariant() {
|
function getSignupPanelTabTestVariant() {
|
||||||
return getMultipleTestOption('panelSignUp', {control: 2, v1: 7, v2: 1 })
|
return getMultipleTestOption('panelSignUp', {control: 1, v1: 2, v2: 7 })
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMultipleTestOption(testName, testOptions) {
|
function getMultipleTestOption(testName, testOptions) {
|
||||||
|
43
browser/extensions/pocket/locale/en-GB/pocket.properties
Normal file
43
browser/extensions/pocket/locale/en-GB/pocket.properties
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
addtags = Add Tags
|
||||||
|
alreadyhaveacct = Already a Pocket user?
|
||||||
|
continueff = Continue with Firefox
|
||||||
|
errorgeneric = There was an error when trying to save to Pocket.
|
||||||
|
learnmore = Learn More
|
||||||
|
loginnow = Log in
|
||||||
|
maxtaglength = Tags are limited to 25 characters
|
||||||
|
mustbeconnected = You must be connected to the Internet in order to save to Pocket. Please check your connection and try again.
|
||||||
|
onlylinkssaved = Only links can be saved
|
||||||
|
pagenotsaved = Page Not Saved
|
||||||
|
pageremoved = Page Removed
|
||||||
|
pagesaved = Saved to Pocket
|
||||||
|
processingremove = Removing Page…
|
||||||
|
processingtags = Adding tags…
|
||||||
|
removepage = Remove Page
|
||||||
|
save = Save
|
||||||
|
saving = Saving…
|
||||||
|
signupemail = Sign up with email
|
||||||
|
signuptosave = Sign up for Pocket. It’s free.
|
||||||
|
suggestedtags = Suggested Tags
|
||||||
|
tagline = Save articles and videos from Firefox to view in Pocket on any device, any time.
|
||||||
|
taglinestory_one = Click the Pocket Button to save any article, video or page from Firefox.
|
||||||
|
taglinestory_two = View in Pocket on any device, any time.
|
||||||
|
tagssaved = Tags Added
|
||||||
|
tos = By continuing, you agree to Pocket’s <a href="%1$S" target="_blank">Terms of Service</a> and <a href="%2$S" target="_blank">Privacy Policy</a>
|
||||||
|
tryitnow = Try It Now
|
||||||
|
signinfirefox = Sign in with Firefox
|
||||||
|
signupfirefox = Sign up with Firefox
|
||||||
|
viewlist = View List
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label):
|
||||||
|
# "Pocket" is a brand name.
|
||||||
|
pocket-button.label = Pocket
|
||||||
|
pocket-button.tooltiptext = Save to Pocket
|
||||||
|
saveToPocketCmd.label = Save Page to Pocket
|
||||||
|
saveToPocketCmd.accesskey = k
|
||||||
|
saveLinkToPocketCmd.label = Save Link to Pocket
|
||||||
|
saveLinkToPocketCmd.accesskey = o
|
||||||
|
pocketMenuitem.label = View Pocket List
|
43
browser/extensions/pocket/locale/es-AR/pocket.properties
Normal file
43
browser/extensions/pocket/locale/es-AR/pocket.properties
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
addtags = Agregar etiquetas
|
||||||
|
alreadyhaveacct = ¿Ya es un usuario de Pocket?
|
||||||
|
continueff = Continuar con Firefox
|
||||||
|
errorgeneric = Hubo un error al tratar de guardar en Pocket.
|
||||||
|
learnmore = Conocer más
|
||||||
|
loginnow = Ingresar
|
||||||
|
maxtaglength = Las etiquetas están limitadas a 25 caracteres
|
||||||
|
mustbeconnected = Debe estar conectado a Internet para poder guardar en Pocket. Verifique la conexión e intente nuevamente.
|
||||||
|
onlylinkssaved = Solamente pueden guardarle enlaces
|
||||||
|
pagenotsaved = Página no guardada
|
||||||
|
pageremoved = Página eliminada
|
||||||
|
pagesaved = Guardado en Pocket
|
||||||
|
processingremove = Eliminando página…
|
||||||
|
processingtags = Agregando etiquetas…
|
||||||
|
removepage = Eliminar página
|
||||||
|
save = Guardar
|
||||||
|
saving = Guardando…
|
||||||
|
signupemail = Ingresar con correo electrónico
|
||||||
|
signuptosave = Registrarse en Pocket. En grátis.
|
||||||
|
suggestedtags = Etiquetas sugeridas
|
||||||
|
tagline = Guardar artículos y videos desde Firefox para ver en Pocket en cualquier dispositivo en cualquier momento.
|
||||||
|
taglinestory_one = Clic en el botón Pocket para guardar cualquier artículo, video o página desde Firefox.
|
||||||
|
taglinestory_two = Ver en Pocket en cualquier dispositivo en cualquier momento.
|
||||||
|
tagssaved = Etiquetas agregadas
|
||||||
|
tos = Al continuar acepta los <a href="%1$S" target="_blank">términos de servicio</a> y la <a href="%2$S" target="_blank">política de privacidad</a> de Pocket
|
||||||
|
tryitnow = Probalo ahora
|
||||||
|
signinfirefox = Ingresar con Firefox
|
||||||
|
signupfirefox = Registrarse con Firefox
|
||||||
|
viewlist = Ver lista
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label):
|
||||||
|
# "Pocket" is a brand name.
|
||||||
|
pocket-button.label = Pocket
|
||||||
|
pocket-button.tooltiptext = Guardar en Pocket
|
||||||
|
saveToPocketCmd.label = Guardar página en Pocket
|
||||||
|
saveToPocketCmd.accesskey = G
|
||||||
|
saveLinkToPocketCmd.label = Guardar enlace en Pocket
|
||||||
|
saveLinkToPocketCmd.accesskey = o
|
||||||
|
pocketMenuitem.label = Ver lista de Pocket
|
43
browser/extensions/pocket/locale/gu-IN/pocket.properties
Normal file
43
browser/extensions/pocket/locale/gu-IN/pocket.properties
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
addtags = ટૅગ્સ ઉમેરો
|
||||||
|
alreadyhaveacct = પહેલેથી જ એક પોકેટ વપરાશકર્તા છો?
|
||||||
|
continueff = ફાયરફોક્સ સાથે ચાલુ રાખો
|
||||||
|
errorgeneric = પોકેટ સાચવી રાખવા માટે પ્રયાસ હતો ત્યારે એક ભૂલ હતી.
|
||||||
|
learnmore = વધુ શીખો
|
||||||
|
loginnow = પ્રવેશ કરો
|
||||||
|
maxtaglength = ટૅગ્સ 25 અક્ષરો સુધી મર્યાદિત છે
|
||||||
|
mustbeconnected = તમે પોકેટ પર સેવ કરવા માટે ઇન્ટરનેટ સાથે જોડાયેલ હોવા જ જોઈએ. કૃપા કરીને તમારા જોડાણ તપાસ કરો અને ફરીથી પ્રયત્ન કરો.
|
||||||
|
onlylinkssaved = માત્ર લિંક્સ સાચવી શકાય છે
|
||||||
|
pagenotsaved = પૃષ્ઠ સાચવેલા નથી
|
||||||
|
pageremoved = પૃષ્ઠ દૂર
|
||||||
|
pagesaved = પોકેટ પર સાચવ્યું
|
||||||
|
processingremove = પૃષ્ઠ દૂર કરી રહ્યા છીએ…
|
||||||
|
processingtags = ટૅગ્સ ઉમેરી રહ્યું છે…
|
||||||
|
removepage = પૃષ્ઠ દૂર
|
||||||
|
save = સાચવો
|
||||||
|
saving = સાચવી રહ્યું છે…
|
||||||
|
signupemail = ઇમેઇલ સાથે સાઇનઅપ
|
||||||
|
signuptosave = પોકેટ માટે સાઇન અપ કરો. તે મફત છે.
|
||||||
|
suggestedtags = સૂચવેલ ટૅગ્સ
|
||||||
|
tagline = કોઈપણ ઉપકરણ, કોઈ પણ સમય પર પોકેટ માં જોવા માટે ફાયરફોક્સ ના લેખો અને વીડિયો સાચવો.
|
||||||
|
taglinestory_one = ફાયરફોક્સ એક લેખ, વિડિઓ અથવા પાનું સેવ કરવા પોકેટ બટન પર ક્લિક કરો.
|
||||||
|
taglinestory_two = કોઈપણ ઉપકરણ, કોઈ પણ સમય પર પોકેટ માં જુઓ.
|
||||||
|
tagssaved = ટૅગ્સ ઉમેર્યું
|
||||||
|
tos = ચાલુ કરવાથી, તમે પોકેટ માટેની <a href="%1$S" target="_blank">સેવાની શરતો</a> અને <a href="%2$S" target="_blank">ગોપનીયતા નીતિ</a>સંમત થશો
|
||||||
|
tryitnow = અત્યારે પ્રયાસ કરો
|
||||||
|
signinfirefox = ફાયરફોક્સ સાથે ચાલુ રાખો
|
||||||
|
signupfirefox = ફાયરફોક્સ સાથે સાઇન અપ કરો
|
||||||
|
viewlist = યાદી જુઓ
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label):
|
||||||
|
# "Pocket" is a brand name.
|
||||||
|
pocket-button.label = પોકેટ
|
||||||
|
pocket-button.tooltiptext = પોકેટ પર સાચવો
|
||||||
|
saveToPocketCmd.label = પોકેટ પર પૃષ્ઠ સાચવો
|
||||||
|
saveToPocketCmd.accesskey = k
|
||||||
|
saveLinkToPocketCmd.label = પોકેટ પર લિંક સાચવો
|
||||||
|
saveLinkToPocketCmd.accesskey = o
|
||||||
|
pocketMenuitem.label = જુઓ પોકેટની યાદી
|
@ -6,11 +6,14 @@
|
|||||||
# These are used for the big if statement, as the preprocessor can't handle
|
# These are used for the big if statement, as the preprocessor can't handle
|
||||||
# dashes.
|
# dashes.
|
||||||
#define bn_BD bn-BD
|
#define bn_BD bn-BD
|
||||||
|
#define en_GB en-GB
|
||||||
#define en_US en-US
|
#define en_US en-US
|
||||||
|
#define es_AR es-AR
|
||||||
#define es_CL es-CL
|
#define es_CL es-CL
|
||||||
#define es_ES es-ES
|
#define es_ES es-ES
|
||||||
#define es_MX es-MX
|
#define es_MX es-MX
|
||||||
#define fy_NL fy-NL
|
#define fy_NL fy-NL
|
||||||
|
#define gu_IN gu-IN
|
||||||
#define nn_NO nn-NO
|
#define nn_NO nn-NO
|
||||||
#define pt_BR pt-BR
|
#define pt_BR pt-BR
|
||||||
#define pt_PT pt-PT
|
#define pt_PT pt-PT
|
||||||
@ -23,7 +26,7 @@
|
|||||||
# For locales we support, include the file from the locale's directory in the
|
# For locales we support, include the file from the locale's directory in the
|
||||||
# source tree.
|
# source tree.
|
||||||
# For other locales (and en-US) fallback to the en-US directory.
|
# For other locales (and en-US) fallback to the en-US directory.
|
||||||
#if AB_CD == ast || AB_CD == az || AB_CD == bg || AB_CD == bn_BD || AB_CD == cs || AB_CD == da || AB_CD == de || AB_CD == dsb || AB_CD == en_US || AB_CD == es_CL || AB_CD == es_ES || AB_CD == es_MX || AB_CD == et || AB_CD == fi || AB_CD == fr || AB_CD == fy_NL || AB_CD == hr || AB_CD == hsb || AB_CD == hu || AB_CD == it || AB_CD == ja || AB_CD == kab || AB_CD == lv || AB_CD == nl || AB_CD == nn_NO || AB_CD == or || AB_CD == pt_BR || AB_CD == pt_PT || AB_CD == rm || AB_CD == ro || AB_CD == ru || AB_CD == sk || AB_CD == sl || AB_CD == sq || AB_CD == sr || AB_CD == sv_SE || AB_CD == te || AB_CD == th || AB_CD == tr || AB_CD == uk || AB_CD == zh_CN || AB_CD == zh_TW
|
#if AB_CD == ast || AB_CD == az || AB_CD == bg || AB_CD == bn_BD || AB_CD == cs || AB_CD == da || AB_CD == de || AB_CD == dsb || AB_CD == en_GB || AB_CD == en_US || AB_CD == es_AR || AB_CD == es_CL || AB_CD == es_ES || AB_CD == es_MX || AB_CD == et || AB_CD == fi || AB_CD == fr || AB_CD == fy_NL || AB_CD == gu_IN || AB_CD == hr || AB_CD == hsb || AB_CD == hu || AB_CD == it || AB_CD == ja || AB_CD == ka || AB_CD == kab || AB_CD == lt || AB_CD == lv || AB_CD == mr || AB_CD == ms || AB_CD == nl || AB_CD == nn_NO || AB_CD == or || AB_CD == pl || AB_CD == pt_BR || AB_CD == pt_PT || AB_CD == rm || AB_CD == ro || AB_CD == ru || AB_CD == sk || AB_CD == sl || AB_CD == sq || AB_CD == sr || AB_CD == sv_SE || AB_CD == te || AB_CD == th || AB_CD == tr || AB_CD == uk || AB_CD == zh_CN || AB_CD == zh_TW
|
||||||
locale/@AB_CD@/ (@AB_CD@/*)
|
locale/@AB_CD@/ (@AB_CD@/*)
|
||||||
#else
|
#else
|
||||||
locale/@AB_CD@/ (en-US/*)
|
locale/@AB_CD@/ (en-US/*)
|
||||||
|
43
browser/extensions/pocket/locale/ka/pocket.properties
Normal file
43
browser/extensions/pocket/locale/ka/pocket.properties
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
addtags = იარლიყების დამატება
|
||||||
|
alreadyhaveacct = უკვე იყენებთ Pocket-ს?
|
||||||
|
continueff = Firefox-ით გაგრძელება
|
||||||
|
errorgeneric = Pocket-ში შენახვისას დაფიქსირდა შეცდომა.
|
||||||
|
learnmore = დაწვრილებით
|
||||||
|
loginnow = შესვლა
|
||||||
|
maxtaglength = იარლიყები შეზღუდულია 25 ასომდე
|
||||||
|
mustbeconnected = Pocket-ში შესანახად საჭიროა ინტერნეთთან კავშირი. გთხოვთ შეამოწმეთ თქვენი კავშირი და ხელახლა ცადეთ.
|
||||||
|
onlylinkssaved = შესაძლებელია მხოლოდ ბმულების შენახვა
|
||||||
|
pagenotsaved = გვერდი არ შეინახა
|
||||||
|
pageremoved = გვერდი წაიშალა
|
||||||
|
pagesaved = შეინახა Pocket-ში
|
||||||
|
processingremove = იშლება გვერდი…
|
||||||
|
processingtags = ემატება იარლიყები…
|
||||||
|
removepage = გვერდის წაშლა
|
||||||
|
save = შენახვა
|
||||||
|
saving = ინახება…
|
||||||
|
signupemail = რეგისტრაცია ელ-ფოსტით
|
||||||
|
signuptosave = დარეგისტრირდით Pocket-ზე. ეს უფასოა.
|
||||||
|
suggestedtags = შემოთავაზებული იარლიყები
|
||||||
|
tagline = შეინახეთ სტატიები და ვიდეობეი Firefox-იდან მათ Pocket-ში სანახავად ნებისმიერ მოწყობილობაზე, ნებისმიერ დროს.
|
||||||
|
taglinestory_one = Firefox-იდან ნებისმიერი სტატიის, ვიდეოს ან გვერდის შესანახად დააწკაპეთ Pocket-ის ღილაკს.
|
||||||
|
taglinestory_two = დაათვალიერეთ Pocket-ში ნებისმიერ მოწყობილობაზე, ნებისმიერ დროს.
|
||||||
|
tagssaved = იარლიყები დაემატა
|
||||||
|
tos = გაგრძელების შემთხვევაში თქვენ ეთანხმებით Pocket-ის <a href="%1$S" target="_blank">მომსახურების პირობებს</a> და <a href="%2$S" target="_blank">პრივატულობის პოლიტიკას</a>
|
||||||
|
tryitnow = სცადეთ ახლავე
|
||||||
|
signinfirefox = შესვლა Firefox-ით
|
||||||
|
signupfirefox = რეგისრაცია Firefox-ით
|
||||||
|
viewlist = სიის ნახვა
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label):
|
||||||
|
# "Pocket" is a brand name.
|
||||||
|
pocket-button.label = Pocket
|
||||||
|
pocket-button.tooltiptext = Pocket-ში შენახვა
|
||||||
|
saveToPocketCmd.label = გვერდის შენახვა Pocket-ში
|
||||||
|
saveToPocketCmd.accesskey = k
|
||||||
|
saveLinkToPocketCmd.label = ბმულის შენახვა Pocket-ში
|
||||||
|
saveLinkToPocketCmd.accesskey = o
|
||||||
|
pocketMenuitem.label = Pocket სიის ნახვა
|
43
browser/extensions/pocket/locale/lt/pocket.properties
Normal file
43
browser/extensions/pocket/locale/lt/pocket.properties
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
addtags = Pridėkite gairių
|
||||||
|
alreadyhaveacct = Jau naudojatės „Pocket“?
|
||||||
|
continueff = Tęsti su „Firefox“
|
||||||
|
errorgeneric = Bandant išsaugoti į „Pocket“ įvyko klaida.
|
||||||
|
learnmore = Sužinokite daugiau
|
||||||
|
loginnow = Prisijungti
|
||||||
|
maxtaglength = Gaires gali sudaryti iki 25 simbolių
|
||||||
|
mustbeconnected = Norėdami saugoti į „Pocket“, turite būti prisijungę prie interneto. Prašome patikrinti savo ryšį ir bandyti vėl.
|
||||||
|
onlylinkssaved = Išsaugoti galima tik nuorodas
|
||||||
|
pagenotsaved = Tinklalapis neišsaugotas
|
||||||
|
pageremoved = Tinklalapis pašalintas
|
||||||
|
pagesaved = Išsaugota į „Pocket“
|
||||||
|
processingremove = Šalinamas tinklalapis…
|
||||||
|
processingtags = Pridedamos gairės…
|
||||||
|
removepage = Pašalinti tinklalapį
|
||||||
|
save = Išsaugoti
|
||||||
|
saving = Išsaugoma…
|
||||||
|
signupemail = Prisijungti su el. paštu
|
||||||
|
signuptosave = Pradėkite naudotis „Pocket“. Tai nemokama.
|
||||||
|
suggestedtags = Siūlomos gairės
|
||||||
|
tagline = Išsaugokite straipsnius bei vaizdo įrašus iš „Firefox“ norėdami juos peržiūrėti bet kokiame įrenginyje su „Pocket“, bet kuriuo metu.
|
||||||
|
taglinestory_one = Spustelėkite „Pocket“ mygtuką norėdami išsaugoti bet kokį straipsnį, vaizdo įrašą ar tinklalapį iš „Firefox“.
|
||||||
|
taglinestory_two = Peržiūrėkite bet kokiame įrenginyje su „Pocket“, bet kuriuo metu.
|
||||||
|
tagssaved = Gairės pridėtos
|
||||||
|
tos = Tęsdami sutinkate su „Pocket“ <a href="%1$S" target="_blank">paslaugos teikimo sąlygomis</a> bei <a href="%2$S" target="_blank">privatumo nuostatais</a>
|
||||||
|
tryitnow = Išbandykite dabar
|
||||||
|
signinfirefox = Prisijungti su „Firefox“
|
||||||
|
signupfirefox = Prisijungti su „Firefox“
|
||||||
|
viewlist = Peržiūrėti sąrašą
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label):
|
||||||
|
# "Pocket" is a brand name.
|
||||||
|
pocket-button.label = Pocket
|
||||||
|
pocket-button.tooltiptext = Išsaugoti į „Pocket“
|
||||||
|
saveToPocketCmd.label = Išsaugoti tinklalapį į „Pocket“
|
||||||
|
saveToPocketCmd.accesskey = k
|
||||||
|
saveLinkToPocketCmd.label = Išsaugoti saitą į „Pocket“
|
||||||
|
saveLinkToPocketCmd.accesskey = o
|
||||||
|
pocketMenuitem.label = Peržiūrėti „Pocket“ sąrašą
|
43
browser/extensions/pocket/locale/mr/pocket.properties
Normal file
43
browser/extensions/pocket/locale/mr/pocket.properties
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
addtags = टॅग जोडा
|
||||||
|
alreadyhaveacct = आधीपासून Pocket वापरताय?
|
||||||
|
continueff = Firefox सोबत पुढे चला
|
||||||
|
errorgeneric = Pocket मध्ये जतन करताना त्रुटी आली.
|
||||||
|
learnmore = अधिक जाणून घ्या
|
||||||
|
loginnow = लॉग इन
|
||||||
|
maxtaglength = टॅग्ज साठी 25 वर्णांची मर्यादा आहे
|
||||||
|
mustbeconnected = Pocket मध्ये साठविण्यासाठी आपले इंटरनेट चालू असणे आवश्यक आहे. कृपया आपली जोडणी तपासा आणि पुन्हा प्रयत्न करा.
|
||||||
|
onlylinkssaved = फक्त दुवे जतन केले जाऊ शकतात
|
||||||
|
pagenotsaved = पृष्ठ जतन झाले नाही
|
||||||
|
pageremoved = पृष्ठ काढले गेले
|
||||||
|
pagesaved = Pocket मध्ये जतन झाले
|
||||||
|
processingremove = पृष्ठ काढून टाकत आहे...
|
||||||
|
processingtags = टॅग्ज जोडत आहे…
|
||||||
|
removepage = पृष्ठ काढून टाका
|
||||||
|
save = जतन करा
|
||||||
|
saving = जतन करत आहे...
|
||||||
|
signupemail = ईमेलसह साईन अप करा
|
||||||
|
signuptosave = Pocket साठी साईन अप करा. हे मोफत आहे.
|
||||||
|
suggestedtags = सूचविलेले टॅग्स
|
||||||
|
tagline = Firefox मधील नोंदी आणि व्हिडीओ कुठल्याही साधनावर केंव्हाही Pocket मध्ये पाहण्यासाठी साठवा.
|
||||||
|
taglinestory_one = Firefox वरील कोणताही लेख, व्हिडिओ किंवा पृष्ठ जतन करण्यासाठी Pocket बटणावर क्लिक करा.
|
||||||
|
taglinestory_two = कधीही कुठल्याही साधनावर Pocket मध्ये पाहा.
|
||||||
|
tagssaved = टॅग्स जोडले
|
||||||
|
tos = सुरु ठेवुन, आपण Pocketच्या <a href="%1$S" target="_blank">सेवेच्या अटी</a> आणि <a href="%2$S" target="_blank">गोपनीयता धोरणांशी</a> सहमत आहात
|
||||||
|
tryitnow = आत्ताच वापरुन पाहा
|
||||||
|
signinfirefox = Firefox सह साइन इन करा
|
||||||
|
signupfirefox = Firefox सह साईन अप करा
|
||||||
|
viewlist = यादी पहा
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label):
|
||||||
|
# "Pocket" is a brand name.
|
||||||
|
pocket-button.label = Pocket
|
||||||
|
pocket-button.tooltiptext = Pocket मध्ये जतन करा
|
||||||
|
saveToPocketCmd.label = पृष्ठ Pocket मध्ये जतन करा
|
||||||
|
saveToPocketCmd.accesskey = k
|
||||||
|
saveLinkToPocketCmd.label = दुवा Pocket मध्ये संकलित करा
|
||||||
|
saveLinkToPocketCmd.accesskey = o
|
||||||
|
pocketMenuitem.label = पॉकेट सूची पहा
|
43
browser/extensions/pocket/locale/ms/pocket.properties
Normal file
43
browser/extensions/pocket/locale/ms/pocket.properties
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
addtags = Tambah Tag
|
||||||
|
alreadyhaveacct = Sudah menjadi pengguna Poket?
|
||||||
|
continueff = Teruskan dengan Firefox
|
||||||
|
errorgeneric = Ada ralat semasa cuba menyimpan ke Pocket.
|
||||||
|
learnmore = Ketahui Selanjutnya
|
||||||
|
loginnow = Log masuk
|
||||||
|
maxtaglength = Tag dihadkan hanya 25 aksara
|
||||||
|
mustbeconnected = Anda mesti ada sambungan Internet untuk menyimpan ke Pocket. Sila periksa sambungan anda dan cuba lagi.
|
||||||
|
onlylinkssaved = Hanya pautan boleh disimpan
|
||||||
|
pagenotsaved = Halaman Tidak Disimpan
|
||||||
|
pageremoved = Halaman Dialih keluar
|
||||||
|
pagesaved = Disimpan ke Pocket
|
||||||
|
processingremove = Sedang mengalih keluar Halaman…
|
||||||
|
processingtags = Sedang menambah tag…
|
||||||
|
removepage = Alih keluar Halaman
|
||||||
|
save = Simpan
|
||||||
|
saving = Sedang menyimpan…
|
||||||
|
signupemail = Daftar dengan e-mel
|
||||||
|
signuptosave = Daftar masuk ke Pocket. Percuma.
|
||||||
|
suggestedtags = Tag Disyorkan
|
||||||
|
tagline = Simpan artikel dan video dari Firefox untuk dilihat dalam Pocket pada apa jua peranti pada bila-bila masa.
|
||||||
|
taglinestory_one = Klik butang Pocket untuk menyimpan apa jua artikel, video atau halaman daripada Firefox.
|
||||||
|
taglinestory_two = Papar dalam Pocket dalam mana-mana peranti, bila-bila masa saja.
|
||||||
|
tagssaved = Tag Ditambah
|
||||||
|
tos = Dengan meneruskan, anda setuju dengan <a href="%1$S" target="_blank">Terma Perkhidmatan</a> Pocket dan <a href="%2$S" target="_blank">Polisi Privasi</a>
|
||||||
|
tryitnow = Cubanya Sekarang
|
||||||
|
signinfirefox = Daftar masuk Firefox
|
||||||
|
signupfirefox = Daftar dengan Firefox
|
||||||
|
viewlist = Senarai Paparan
|
||||||
|
|
||||||
|
# LOCALIZATION NOTE(pocket-button.label, pocket-button.tooltiptext, saveToPocketCmd.label, saveLinkToPocketCmd.label, pocketMenuitem.label):
|
||||||
|
# "Pocket" is a brand name.
|
||||||
|
pocket-button.label = Pocket
|
||||||
|
pocket-button.tooltiptext = Simpan ke Pocket
|
||||||
|
saveToPocketCmd.label = Simpan Halaman ke Pocket
|
||||||
|
saveToPocketCmd.accesskey = k
|
||||||
|
saveLinkToPocketCmd.label = Simpan Pautan ke Pocket
|
||||||
|
saveLinkToPocketCmd.accesskey = o
|
||||||
|
pocketMenuitem.label = Papar Senarai Pocket
|
48
browser/extensions/pocket/locale/pl/pocket.properties
Normal file
48
browser/extensions/pocket/locale/pl/pocket.properties
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# 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/.
|
||||||
|
|
||||||
|
taglinestory_one=Kliknij przycisk Pocket, aby wysłać dowolny artykuł, film lub stronę z Firefoksa.
|
||||||
|
taglinestory_two=Czytaj z Pocket o dowolnej porze na dowolnym urządzeniu.
|
||||||
|
learnmore=Więcej informacji
|
||||||
|
|
||||||
|
signuptosave=Utwórz konto w Pocket. Jest darmowe.
|
||||||
|
signupfirefox=Utwórz konto z Firefoksem
|
||||||
|
signupemail=Utwórz konto z adresem e-mail
|
||||||
|
alreadyhaveacct=Masz już konto Pocket?
|
||||||
|
loginnow=Zaloguj się
|
||||||
|
|
||||||
|
tos=Kontynuując, wyrażasz zgodę na <a href="%1$S" target="_blank">warunki korzystania z usługi</a> i <a href="%2$S" target="_blank">politykę prywatności</a>
|
||||||
|
tryitnow=Wypróbuj teraz
|
||||||
|
|
||||||
|
continueff=Kontynuuj z kontem Firefoksa
|
||||||
|
signinfirefox=Zaloguj się z Firefoksem
|
||||||
|
viewlist=Otwórz w Pocket
|
||||||
|
|
||||||
|
removepage=Usuń stronę
|
||||||
|
processingremove=Usuwanie strony…
|
||||||
|
pageremoved=Usunięto stronę
|
||||||
|
|
||||||
|
save=Wyślij
|
||||||
|
saving=Wysyłanie…
|
||||||
|
pagesaved=Wysłano do Pocket
|
||||||
|
|
||||||
|
addtags=Etykiety
|
||||||
|
processingtags=Wysyłanie etykiet…
|
||||||
|
tagssaved=Wysłano etykiety
|
||||||
|
maxtaglength=Etykiety są ograniczone do 25 znaków
|
||||||
|
suggestedtags=Sugerowane etykiety
|
||||||
|
tagline=Wysyłaj artykuły i filmy z Firefoksa do Pocket, aby wyświetlić je o dowolnej porze na dowolnym urządzeniu.
|
||||||
|
|
||||||
|
errorgeneric=Wystąpił błąd podczas wysyłania do Pocket.
|
||||||
|
mustbeconnected=Połączenie z Internetem jest konieczne do przesyłania do Pocket. Proszę sprawdzić połączenie i spróbować ponownie.
|
||||||
|
onlylinkssaved=Tylko odnośniki mogą być przesyłane
|
||||||
|
pagenotsaved=Nie przesłano strony
|
||||||
|
|
||||||
|
pocket-button.label=Pocket
|
||||||
|
pocket-button.tooltiptext=Wyślij do Pocket
|
||||||
|
saveToPocketCmd.label=Wyślij stronę do Pocket
|
||||||
|
saveToPocketCmd.accesskey=s
|
||||||
|
saveLinkToPocketCmd.label=Wyślij odnośnik do Pocket
|
||||||
|
saveLinkToPocketCmd.accesskey=o
|
||||||
|
pocketMenuitem.label=Wysłane do Pocket
|
@ -112,7 +112,7 @@ html {
|
|||||||
margin: 4px 8px 10px;
|
margin: 4px 8px 10px;
|
||||||
border-width: 3px;
|
border-width: 3px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: -moz-use-text-color;
|
border-color: currentcolor;
|
||||||
border-image: none;
|
border-image: none;
|
||||||
-moz-border-top-colors: transparent #888 #000;
|
-moz-border-top-colors: transparent #888 #000;
|
||||||
-moz-border-right-colors: transparent #FFF #000;
|
-moz-border-right-colors: transparent #FFF #000;
|
||||||
|
@ -816,5 +816,3 @@ add_old_configure_assignment('PKG_CONFIG', pkg_config)
|
|||||||
@dependable
|
@dependable
|
||||||
def gonkdir():
|
def gonkdir():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
include(include_project_configure)
|
|
||||||
|
@ -82,8 +82,11 @@ elif test -z "$CCACHE_DIR" -a -z "$SCCACHE_DISABLE" -a -z "$no_sccache" -a -z "$
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if platform hasn't been determined from buildprops, and we're on windows,
|
||||||
|
# it must be set to prevent adding ac_add_options --with-ccache below
|
||||||
|
if test -z "$platform"; then
|
||||||
# set platform based on the SYSTEMROOT env var
|
# set platform based on the SYSTEMROOT env var
|
||||||
case "${SYSTEMROOT}" in
|
case "${SYSTEMROOT}" in
|
||||||
*Windows)
|
*Windows)
|
||||||
|
@ -142,7 +142,7 @@ var AnimationsController = {
|
|||||||
this.onNewNodeFront = this.onNewNodeFront.bind(this);
|
this.onNewNodeFront = this.onNewNodeFront.bind(this);
|
||||||
this.onAnimationMutations = this.onAnimationMutations.bind(this);
|
this.onAnimationMutations = this.onAnimationMutations.bind(this);
|
||||||
|
|
||||||
let target = gToolbox.target;
|
let target = gInspector.target;
|
||||||
this.animationsFront = new AnimationsFront(target.client, target.form);
|
this.animationsFront = new AnimationsFront(target.client, target.form);
|
||||||
|
|
||||||
// Expose actor capabilities.
|
// Expose actor capabilities.
|
||||||
|
@ -9,7 +9,7 @@ const osString = Services.appinfo.OS;
|
|||||||
|
|
||||||
// Panels
|
// Panels
|
||||||
loader.lazyGetter(this, "OptionsPanel", () => require("devtools/client/framework/toolbox-options").OptionsPanel);
|
loader.lazyGetter(this, "OptionsPanel", () => require("devtools/client/framework/toolbox-options").OptionsPanel);
|
||||||
loader.lazyGetter(this, "InspectorPanel", () => require("devtools/client/inspector/inspector-panel").InspectorPanel);
|
loader.lazyGetter(this, "InspectorPanel", () => require("devtools/client/inspector/panel").InspectorPanel);
|
||||||
loader.lazyGetter(this, "WebConsolePanel", () => require("devtools/client/webconsole/panel").WebConsolePanel);
|
loader.lazyGetter(this, "WebConsolePanel", () => require("devtools/client/webconsole/panel").WebConsolePanel);
|
||||||
loader.lazyGetter(this, "DebuggerPanel", () => require("devtools/client/debugger/panel").DebuggerPanel);
|
loader.lazyGetter(this, "DebuggerPanel", () => require("devtools/client/debugger/panel").DebuggerPanel);
|
||||||
loader.lazyGetter(this, "StyleEditorPanel", () => require("devtools/client/styleeditor/styleeditor-panel").StyleEditorPanel);
|
loader.lazyGetter(this, "StyleEditorPanel", () => require("devtools/client/styleeditor/styleeditor-panel").StyleEditorPanel);
|
||||||
|
@ -141,6 +141,10 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "domwindowopened":
|
||||||
|
let win = subject.QueryInterface(Ci.nsIDOMEventTarget);
|
||||||
|
win.addEventListener("DOMContentLoaded", this, { once: true });
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -401,11 +405,31 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||||||
CustomizableUI.addWidgetToArea("webide-button", CustomizableUI.AREA_NAVBAR);
|
CustomizableUI.addWidgetToArea("webide-button", CustomizableUI.AREA_NAVBAR);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts setting up devtools on a given browser window. This method is
|
||||||
|
* called on DOMContentLoaded, so earlier than registerBrowserWindow which
|
||||||
|
* is called after delayed-startup notification. This method should only do
|
||||||
|
* what has to be done early. Otherwise devtools should be initialized lazily
|
||||||
|
* to prevent overloading Firefox startup.
|
||||||
|
*
|
||||||
|
* @param {ChromeWindow} window
|
||||||
|
* The window to which devtools should be hooked to.
|
||||||
|
*/
|
||||||
|
_onBrowserWindowLoaded: function (win) {
|
||||||
|
// This method is called for all top level window, only consider firefox
|
||||||
|
// windows
|
||||||
|
if (!win.gBrowser || !win.location.href.endsWith("browser.xul")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BrowserMenus.addMenus(win.document);
|
||||||
|
win.addEventListener("unload", this);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add this DevTools's presence to a browser window's document
|
* Add this DevTools's presence to a browser window's document
|
||||||
*
|
*
|
||||||
* @param {XULDocument} doc
|
* @param {ChromeWindow} win
|
||||||
* The document to which devtools should be hooked to.
|
* The window to which devtools should be hooked to.
|
||||||
*/
|
*/
|
||||||
_registerBrowserWindow: function (win) {
|
_registerBrowserWindow: function (win) {
|
||||||
if (gDevToolsBrowser._trackedBrowserWindows.has(win)) {
|
if (gDevToolsBrowser._trackedBrowserWindows.has(win)) {
|
||||||
@ -413,8 +437,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||||||
}
|
}
|
||||||
gDevToolsBrowser._trackedBrowserWindows.add(win);
|
gDevToolsBrowser._trackedBrowserWindows.add(win);
|
||||||
|
|
||||||
BrowserMenus.addMenus(win.document);
|
|
||||||
|
|
||||||
// Register the Developer widget in the Hamburger menu or navbar
|
// Register the Developer widget in the Hamburger menu or navbar
|
||||||
// only once menus are registered as it depends on it.
|
// only once menus are registered as it depends on it.
|
||||||
gDevToolsBrowser.installDeveloperWidget();
|
gDevToolsBrowser.installDeveloperWidget();
|
||||||
@ -427,7 +449,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||||||
|
|
||||||
this.updateCommandAvailability(win);
|
this.updateCommandAvailability(win);
|
||||||
this.ensurePrefObserver();
|
this.ensurePrefObserver();
|
||||||
win.addEventListener("unload", this);
|
|
||||||
|
|
||||||
let tabContainer = win.gBrowser.tabContainer;
|
let tabContainer = win.gBrowser.tabContainer;
|
||||||
tabContainer.addEventListener("TabSelect", this, false);
|
tabContainer.addEventListener("TabSelect", this, false);
|
||||||
@ -624,13 +645,16 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||||||
* The window containing the menu entry
|
* The window containing the menu entry
|
||||||
*/
|
*/
|
||||||
_forgetBrowserWindow: function (win) {
|
_forgetBrowserWindow: function (win) {
|
||||||
|
// _forgetBrowserWindow can only be called once for each window, but
|
||||||
|
// _registerBrowserWindow may not have been called. Instead, only
|
||||||
|
// _onBrowserWindowLoaded was and we only need to revert that.
|
||||||
|
win.removeEventListener("unload", this);
|
||||||
|
BrowserMenus.removeMenus(win.document);
|
||||||
|
|
||||||
if (!gDevToolsBrowser._trackedBrowserWindows.has(win)) {
|
if (!gDevToolsBrowser._trackedBrowserWindows.has(win)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gDevToolsBrowser._trackedBrowserWindows.delete(win);
|
gDevToolsBrowser._trackedBrowserWindows.delete(win);
|
||||||
win.removeEventListener("unload", this);
|
|
||||||
|
|
||||||
BrowserMenus.removeMenus(win.document);
|
|
||||||
|
|
||||||
// Destroy toolboxes for closed window
|
// Destroy toolboxes for closed window
|
||||||
for (let [target, toolbox] of gDevTools._toolboxes) {
|
for (let [target, toolbox] of gDevTools._toolboxes) {
|
||||||
@ -679,6 +703,9 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||||||
case "TabSelect":
|
case "TabSelect":
|
||||||
gDevToolsBrowser._updateMenuCheckbox();
|
gDevToolsBrowser._updateMenuCheckbox();
|
||||||
break;
|
break;
|
||||||
|
case "DOMContentLoaded":
|
||||||
|
gDevToolsBrowser._onBrowserWindowLoaded(event.target.defaultView);
|
||||||
|
break;
|
||||||
case "unload":
|
case "unload":
|
||||||
// top-level browser window unload
|
// top-level browser window unload
|
||||||
gDevToolsBrowser._forgetBrowserWindow(event.target.defaultView);
|
gDevToolsBrowser._forgetBrowserWindow(event.target.defaultView);
|
||||||
@ -708,6 +735,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||||||
*/
|
*/
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
Services.prefs.removeObserver("devtools.", gDevToolsBrowser);
|
Services.prefs.removeObserver("devtools.", gDevToolsBrowser);
|
||||||
|
Services.ww.unregisterNotification(gDevToolsBrowser);
|
||||||
Services.obs.removeObserver(gDevToolsBrowser, "browser-delayed-startup-finished");
|
Services.obs.removeObserver(gDevToolsBrowser, "browser-delayed-startup-finished");
|
||||||
Services.obs.removeObserver(gDevToolsBrowser.destroy, "quit-application");
|
Services.obs.removeObserver(gDevToolsBrowser.destroy, "quit-application");
|
||||||
|
|
||||||
@ -740,6 +768,7 @@ gDevTools.on("toolbox-ready", gDevToolsBrowser._updateMenuCheckbox);
|
|||||||
gDevTools.on("toolbox-destroyed", gDevToolsBrowser._updateMenuCheckbox);
|
gDevTools.on("toolbox-destroyed", gDevToolsBrowser._updateMenuCheckbox);
|
||||||
|
|
||||||
Services.obs.addObserver(gDevToolsBrowser.destroy, "quit-application", false);
|
Services.obs.addObserver(gDevToolsBrowser.destroy, "quit-application", false);
|
||||||
|
Services.ww.registerNotification(gDevToolsBrowser);
|
||||||
Services.obs.addObserver(gDevToolsBrowser, "browser-delayed-startup-finished", false);
|
Services.obs.addObserver(gDevToolsBrowser, "browser-delayed-startup-finished", false);
|
||||||
|
|
||||||
// Fake end of browser window load event for all already opened windows
|
// Fake end of browser window load event for all already opened windows
|
||||||
@ -748,6 +777,7 @@ let enumerator = Services.wm.getEnumerator(gDevTools.chromeWindowType);
|
|||||||
while (enumerator.hasMoreElements()) {
|
while (enumerator.hasMoreElements()) {
|
||||||
let win = enumerator.getNext();
|
let win = enumerator.getNext();
|
||||||
if (win.gBrowserInit && win.gBrowserInit.delayedStartupFinished) {
|
if (win.gBrowserInit && win.gBrowserInit.delayedStartupFinished) {
|
||||||
|
gDevToolsBrowser._onBrowserWindowLoaded(win);
|
||||||
gDevToolsBrowser._registerBrowserWindow(win);
|
gDevToolsBrowser._registerBrowserWindow(win);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ const URL = "data:text/html;charset=utf8,test for textbox context menu";
|
|||||||
|
|
||||||
add_task(function* () {
|
add_task(function* () {
|
||||||
let toolbox = yield openNewTabAndToolbox(URL, "inspector");
|
let toolbox = yield openNewTabAndToolbox(URL, "inspector");
|
||||||
let textboxContextMenu = toolbox.textboxContextMenuPopup;
|
let textboxContextMenu = toolbox.textBoxContextMenuPopup;
|
||||||
|
|
||||||
emptyClipboard();
|
emptyClipboard();
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ function Toolbox(target, selectedTool, hostType, hostOptions) {
|
|||||||
this._saveSplitConsoleHeight = this._saveSplitConsoleHeight.bind(this);
|
this._saveSplitConsoleHeight = this._saveSplitConsoleHeight.bind(this);
|
||||||
this._onFocus = this._onFocus.bind(this);
|
this._onFocus = this._onFocus.bind(this);
|
||||||
this._showDevEditionPromo = this._showDevEditionPromo.bind(this);
|
this._showDevEditionPromo = this._showDevEditionPromo.bind(this);
|
||||||
this._updateTextboxMenuItems = this._updateTextboxMenuItems.bind(this);
|
this._updateTextBoxMenuItems = this._updateTextBoxMenuItems.bind(this);
|
||||||
this._onBottomHostMinimized = this._onBottomHostMinimized.bind(this);
|
this._onBottomHostMinimized = this._onBottomHostMinimized.bind(this);
|
||||||
this._onBottomHostMaximized = this._onBottomHostMaximized.bind(this);
|
this._onBottomHostMaximized = this._onBottomHostMaximized.bind(this);
|
||||||
this._onToolSelectWhileMinimized = this._onToolSelectWhileMinimized.bind(this);
|
this._onToolSelectWhileMinimized = this._onToolSelectWhileMinimized.bind(this);
|
||||||
@ -402,10 +402,10 @@ Toolbox.prototype = {
|
|||||||
let noautohideMenu = this.doc.getElementById("command-button-noautohide");
|
let noautohideMenu = this.doc.getElementById("command-button-noautohide");
|
||||||
noautohideMenu.addEventListener("click", this._toggleAutohide, true);
|
noautohideMenu.addEventListener("click", this._toggleAutohide, true);
|
||||||
|
|
||||||
this.textboxContextMenuPopup =
|
this.textBoxContextMenuPopup =
|
||||||
this.doc.getElementById("toolbox-textbox-context-popup");
|
this.doc.getElementById("toolbox-textbox-context-popup");
|
||||||
this.textboxContextMenuPopup.addEventListener("popupshowing",
|
this.textBoxContextMenuPopup.addEventListener("popupshowing",
|
||||||
this._updateTextboxMenuItems, true);
|
this._updateTextBoxMenuItems, true);
|
||||||
|
|
||||||
this.shortcuts = new KeyShortcuts({
|
this.shortcuts = new KeyShortcuts({
|
||||||
window: this.doc.defaultView
|
window: this.doc.defaultView
|
||||||
@ -2096,10 +2096,10 @@ Toolbox.prototype = {
|
|||||||
this.closeButton.removeEventListener("click", this.destroy, true);
|
this.closeButton.removeEventListener("click", this.destroy, true);
|
||||||
this.closeButton = null;
|
this.closeButton = null;
|
||||||
}
|
}
|
||||||
if (this.textboxContextMenuPopup) {
|
if (this.textBoxContextMenuPopup) {
|
||||||
this.textboxContextMenuPopup.removeEventListener("popupshowing",
|
this.textBoxContextMenuPopup.removeEventListener("popupshowing",
|
||||||
this._updateTextboxMenuItems, true);
|
this._updateTextBoxMenuItems, true);
|
||||||
this.textboxContextMenuPopup = null;
|
this.textBoxContextMenuPopup = null;
|
||||||
}
|
}
|
||||||
if (this.tabbar) {
|
if (this.tabbar) {
|
||||||
this.tabbar.removeEventListener("focus", this._onTabbarFocus, true);
|
this.tabbar.removeEventListener("focus", this._onTabbarFocus, true);
|
||||||
@ -2235,12 +2235,23 @@ Toolbox.prototype = {
|
|||||||
/**
|
/**
|
||||||
* Enable / disable necessary textbox menu items using globalOverlay.js.
|
* Enable / disable necessary textbox menu items using globalOverlay.js.
|
||||||
*/
|
*/
|
||||||
_updateTextboxMenuItems: function () {
|
_updateTextBoxMenuItems: function () {
|
||||||
let window = this.win;
|
let window = this.win;
|
||||||
["cmd_undo", "cmd_delete", "cmd_cut",
|
["cmd_undo", "cmd_delete", "cmd_cut",
|
||||||
"cmd_copy", "cmd_paste", "cmd_selectAll"].forEach(window.goUpdateCommand);
|
"cmd_copy", "cmd_paste", "cmd_selectAll"].forEach(window.goUpdateCommand);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the textbox context menu at given coordinates.
|
||||||
|
* Panels in the toolbox can call this on contextmenu events with event.screenX/Y
|
||||||
|
* instead of having to implement their own copy/paste/selectAll menu.
|
||||||
|
* @param {Number} x
|
||||||
|
* @param {Number} y
|
||||||
|
*/
|
||||||
|
openTextBoxContextMenu: function (x, y) {
|
||||||
|
this.textBoxContextMenuPopup.openPopupAtScreen(x, y, true);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connects to the SPS profiler when the developer tools are open. This is
|
* Connects to the SPS profiler when the developer tools are open. This is
|
||||||
* necessary because of the WebConsole's `profile` and `profileEnd` methods.
|
* necessary because of the WebConsole's `profile` and `profileEnd` methods.
|
||||||
|
@ -341,10 +341,10 @@ BoxModelView.prototype = {
|
|||||||
*/
|
*/
|
||||||
trackReflows: function () {
|
trackReflows: function () {
|
||||||
if (!this.reflowFront) {
|
if (!this.reflowFront) {
|
||||||
let toolbox = this.inspector.toolbox;
|
let { target } = this.inspector;
|
||||||
if (toolbox.target.form.reflowActor) {
|
if (target.form.reflowActor) {
|
||||||
this.reflowFront = ReflowFront(toolbox.target.client,
|
this.reflowFront = ReflowFront(target.client,
|
||||||
toolbox.target.form);
|
target.form);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -384,7 +384,6 @@ BoxModelView.prototype = {
|
|||||||
start: self => {
|
start: self => {
|
||||||
self.elt.parentNode.classList.add("boxmodel-editing");
|
self.elt.parentNode.classList.add("boxmodel-editing");
|
||||||
},
|
},
|
||||||
|
|
||||||
change: value => {
|
change: value => {
|
||||||
if (NUMERIC.test(value)) {
|
if (NUMERIC.test(value)) {
|
||||||
value += "px";
|
value += "px";
|
||||||
@ -404,7 +403,6 @@ BoxModelView.prototype = {
|
|||||||
|
|
||||||
session.setProperties(properties).catch(e => console.error(e));
|
session.setProperties(properties).catch(e => console.error(e));
|
||||||
},
|
},
|
||||||
|
|
||||||
done: (value, commit) => {
|
done: (value, commit) => {
|
||||||
editor.elt.parentNode.classList.remove("boxmodel-editing");
|
editor.elt.parentNode.classList.remove("boxmodel-editing");
|
||||||
if (!commit) {
|
if (!commit) {
|
||||||
@ -413,6 +411,7 @@ BoxModelView.prototype = {
|
|||||||
}, e => console.error(e));
|
}, e => console.error(e));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
contextMenu: this.inspector.onTextBoxContextMenu,
|
||||||
cssProperties: this._cssProperties
|
cssProperties: this._cssProperties
|
||||||
}, event);
|
}, event);
|
||||||
},
|
},
|
||||||
@ -468,7 +467,7 @@ BoxModelView.prototype = {
|
|||||||
this.inspector.sidebar.off("computedview-selected", this.onNewNode);
|
this.inspector.sidebar.off("computedview-selected", this.onNewNode);
|
||||||
this.inspector.selection.off("new-node-front", this.onNewSelection);
|
this.inspector.selection.off("new-node-front", this.onNewSelection);
|
||||||
this.inspector.sidebar.off("select", this.onSidebarSelect);
|
this.inspector.sidebar.off("select", this.onSidebarSelect);
|
||||||
this.inspector._target.off("will-navigate", this.onWillNavigate);
|
this.inspector.target.off("will-navigate", this.onWillNavigate);
|
||||||
this.inspector.off("computed-view-filtered", this.onFilterComputedView);
|
this.inspector.off("computed-view-filtered", this.onFilterComputedView);
|
||||||
|
|
||||||
this.inspector = null;
|
this.inspector = null;
|
||||||
@ -792,7 +791,7 @@ BoxModelView.prototype = {
|
|||||||
this.inspector.markup.on("node-hover", this.onMarkupViewNodeHover);
|
this.inspector.markup.on("node-hover", this.onMarkupViewNodeHover);
|
||||||
|
|
||||||
// Release the actor on will-navigate event
|
// Release the actor on will-navigate event
|
||||||
this.inspector._target.once("will-navigate", this.onWillNavigate);
|
this.inspector.target.once("will-navigate", this.onWillNavigate);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -148,8 +148,6 @@ function CssComputedView(inspector, document, pageStyle) {
|
|||||||
this._onFilterStyles = this._onFilterStyles.bind(this);
|
this._onFilterStyles = this._onFilterStyles.bind(this);
|
||||||
this._onClearSearch = this._onClearSearch.bind(this);
|
this._onClearSearch = this._onClearSearch.bind(this);
|
||||||
this._onIncludeBrowserStyles = this._onIncludeBrowserStyles.bind(this);
|
this._onIncludeBrowserStyles = this._onIncludeBrowserStyles.bind(this);
|
||||||
this._onFilterTextboxContextMenu =
|
|
||||||
this._onFilterTextboxContextMenu.bind(this);
|
|
||||||
|
|
||||||
let doc = this.styleDocument;
|
let doc = this.styleDocument;
|
||||||
this.element = doc.getElementById("propertyContainer");
|
this.element = doc.getElementById("propertyContainer");
|
||||||
@ -167,8 +165,7 @@ function CssComputedView(inspector, document, pageStyle) {
|
|||||||
this.element.addEventListener("copy", this._onCopy);
|
this.element.addEventListener("copy", this._onCopy);
|
||||||
this.element.addEventListener("contextmenu", this._onContextMenu);
|
this.element.addEventListener("contextmenu", this._onContextMenu);
|
||||||
this.searchField.addEventListener("input", this._onFilterStyles);
|
this.searchField.addEventListener("input", this._onFilterStyles);
|
||||||
this.searchField.addEventListener("contextmenu",
|
this.searchField.addEventListener("contextmenu", this.inspector.onTextBoxContextMenu);
|
||||||
this._onFilterTextboxContextMenu);
|
|
||||||
this.searchClearButton.addEventListener("click", this._onClearSearch);
|
this.searchClearButton.addEventListener("click", this._onClearSearch);
|
||||||
this.includeBrowserStylesCheckbox.addEventListener("input",
|
this.includeBrowserStylesCheckbox.addEventListener("input",
|
||||||
this._onIncludeBrowserStyles);
|
this._onIncludeBrowserStyles);
|
||||||
@ -546,19 +543,6 @@ CssComputedView.prototype = {
|
|||||||
}, filterTimeout);
|
}, filterTimeout);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Context menu handler for filter style search box.
|
|
||||||
*/
|
|
||||||
_onFilterTextboxContextMenu: function (event) {
|
|
||||||
try {
|
|
||||||
this.styleDocument.defaultView.focus();
|
|
||||||
let contextmenu = this.inspector.toolbox.textboxContextMenuPopup;
|
|
||||||
contextmenu.openPopupAtScreen(event.screenX, event.screenY, true);
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the user clicks on the clear button in the filter style search
|
* Called when the user clicks on the clear button in the filter style search
|
||||||
* box. Returns true if the search box is cleared and false otherwise.
|
* box. Returns true if the search box is cleared and false otherwise.
|
||||||
@ -654,8 +638,7 @@ CssComputedView.prototype = {
|
|||||||
* Focus the window on mousedown.
|
* Focus the window on mousedown.
|
||||||
*/
|
*/
|
||||||
focusWindow: function () {
|
focusWindow: function () {
|
||||||
let win = this.styleDocument.defaultView;
|
this.styleWindow.focus();
|
||||||
win.focus();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -692,7 +675,7 @@ CssComputedView.prototype = {
|
|||||||
*/
|
*/
|
||||||
copySelection: function () {
|
copySelection: function () {
|
||||||
try {
|
try {
|
||||||
let win = this.styleDocument.defaultView;
|
let win = this.styleWindow;
|
||||||
let text = win.getSelection().toString().trim();
|
let text = win.getSelection().toString().trim();
|
||||||
|
|
||||||
// Tidy up block headings by moving CSS property names and their
|
// Tidy up block headings by moving CSS property names and their
|
||||||
@ -758,7 +741,7 @@ CssComputedView.prototype = {
|
|||||||
this.element.removeEventListener("contextmenu", this._onContextMenu);
|
this.element.removeEventListener("contextmenu", this._onContextMenu);
|
||||||
this.searchField.removeEventListener("input", this._onFilterStyles);
|
this.searchField.removeEventListener("input", this._onFilterStyles);
|
||||||
this.searchField.removeEventListener("contextmenu",
|
this.searchField.removeEventListener("contextmenu",
|
||||||
this._onFilterTextboxContextMenu);
|
this.inspector.onTextBoxContextMenu);
|
||||||
this.searchClearButton.removeEventListener("click", this._onClearSearch);
|
this.searchClearButton.removeEventListener("click", this._onClearSearch);
|
||||||
this.includeBrowserStylesCheckbox.removeEventListener("input",
|
this.includeBrowserStylesCheckbox.removeEventListener("input",
|
||||||
this._onIncludeBrowserStyles);
|
this._onIncludeBrowserStyles);
|
||||||
|
@ -17,7 +17,7 @@ add_task(function* () {
|
|||||||
|
|
||||||
let win = view.styleWindow;
|
let win = view.styleWindow;
|
||||||
let searchField = view.searchField;
|
let searchField = view.searchField;
|
||||||
let searchContextMenu = toolbox.textboxContextMenuPopup;
|
let searchContextMenu = toolbox.textBoxContextMenuPopup;
|
||||||
ok(searchContextMenu,
|
ok(searchContextMenu,
|
||||||
"The search filter context menu is loaded in the computed view");
|
"The search filter context menu is loaded in the computed view");
|
||||||
|
|
||||||
|
@ -32,9 +32,10 @@ FontInspector.prototype = {
|
|||||||
this.showAllLink = this.chromeDoc.getElementById("font-showall");
|
this.showAllLink = this.chromeDoc.getElementById("font-showall");
|
||||||
this.showAllLink.addEventListener("click", this.showAll);
|
this.showAllLink.addEventListener("click", this.showAll);
|
||||||
this.previewTextChanged = this.previewTextChanged.bind(this);
|
this.previewTextChanged = this.previewTextChanged.bind(this);
|
||||||
this.previewInput =
|
this.previewInput = this.chromeDoc.getElementById("font-preview-text-input");
|
||||||
this.chromeDoc.getElementById("font-preview-text-input");
|
|
||||||
this.previewInput.addEventListener("input", this.previewTextChanged);
|
this.previewInput.addEventListener("input", this.previewTextChanged);
|
||||||
|
this.previewInput.addEventListener("contextmenu",
|
||||||
|
this.inspector.onTextBoxContextMenu);
|
||||||
|
|
||||||
// Listen for theme changes as the color of the previews depend on the theme
|
// Listen for theme changes as the color of the previews depend on the theme
|
||||||
gDevTools.on("theme-switched", this.onThemeChanged);
|
gDevTools.on("theme-switched", this.onThemeChanged);
|
||||||
@ -59,6 +60,8 @@ FontInspector.prototype = {
|
|||||||
this.inspector.selection.off("new-node-front", this.onNewNode);
|
this.inspector.selection.off("new-node-front", this.onNewNode);
|
||||||
this.showAllLink.removeEventListener("click", this.showAll);
|
this.showAllLink.removeEventListener("click", this.showAll);
|
||||||
this.previewInput.removeEventListener("input", this.previewTextChanged);
|
this.previewInput.removeEventListener("input", this.previewTextChanged);
|
||||||
|
this.previewInput.removeEventListener("contextmenu",
|
||||||
|
this.inspector.onTextBoxContextMenu);
|
||||||
|
|
||||||
gDevTools.off("theme-switched", this.onThemeChanged);
|
gDevTools.off("theme-switched", this.onThemeChanged);
|
||||||
|
|
||||||
|
@ -42,12 +42,9 @@ function InspectorSearch(inspector, input, clearBtn) {
|
|||||||
this._onKeyDown = this._onKeyDown.bind(this);
|
this._onKeyDown = this._onKeyDown.bind(this);
|
||||||
this._onInput = this._onInput.bind(this);
|
this._onInput = this._onInput.bind(this);
|
||||||
this._onClearSearch = this._onClearSearch.bind(this);
|
this._onClearSearch = this._onClearSearch.bind(this);
|
||||||
this._onFilterTextboxContextMenu =
|
|
||||||
this._onFilterTextboxContextMenu.bind(this);
|
|
||||||
this.searchBox.addEventListener("keydown", this._onKeyDown, true);
|
this.searchBox.addEventListener("keydown", this._onKeyDown, true);
|
||||||
this.searchBox.addEventListener("input", this._onInput, true);
|
this.searchBox.addEventListener("input", this._onInput, true);
|
||||||
this.searchBox.addEventListener("contextmenu",
|
this.searchBox.addEventListener("contextmenu", this.inspector.onTextBoxContextMenu);
|
||||||
this._onFilterTextboxContextMenu);
|
|
||||||
this.searchClearButton.addEventListener("click", this._onClearSearch);
|
this.searchClearButton.addEventListener("click", this._onClearSearch);
|
||||||
|
|
||||||
// For testing, we need to be able to wait for the most recent node request
|
// For testing, we need to be able to wait for the most recent node request
|
||||||
@ -69,7 +66,7 @@ InspectorSearch.prototype = {
|
|||||||
this.searchBox.removeEventListener("keydown", this._onKeyDown, true);
|
this.searchBox.removeEventListener("keydown", this._onKeyDown, true);
|
||||||
this.searchBox.removeEventListener("input", this._onInput, true);
|
this.searchBox.removeEventListener("input", this._onInput, true);
|
||||||
this.searchBox.removeEventListener("contextmenu",
|
this.searchBox.removeEventListener("contextmenu",
|
||||||
this._onFilterTextboxContextMenu);
|
this.inspector.onTextBoxContextMenu);
|
||||||
this.searchClearButton.removeEventListener("click", this._onClearSearch);
|
this.searchClearButton.removeEventListener("click", this._onClearSearch);
|
||||||
this.searchBox = null;
|
this.searchBox = null;
|
||||||
this.searchClearButton = null;
|
this.searchClearButton = null;
|
||||||
@ -136,18 +133,6 @@ InspectorSearch.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Context menu handler for filter search box.
|
|
||||||
*/
|
|
||||||
_onFilterTextboxContextMenu: function (event) {
|
|
||||||
try {
|
|
||||||
let contextmenu = this.inspector.toolbox.textboxContextMenuPopup;
|
|
||||||
contextmenu.openPopupAtScreen(event.screenX, event.screenY, true);
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_onClearSearch: function () {
|
_onClearSearch: function () {
|
||||||
this.searchBox.classList.remove("devtools-style-searchbox-no-match");
|
this.searchBox.classList.remove("devtools-style-searchbox-no-match");
|
||||||
this.searchBox.value = "";
|
this.searchBox.value = "";
|
||||||
|
@ -4,8 +4,12 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
/* global window */
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var Cu = Components.utils;
|
||||||
|
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||||
var Services = require("Services");
|
var Services = require("Services");
|
||||||
var promise = require("promise");
|
var promise = require("promise");
|
||||||
var defer = require("devtools/shared/defer");
|
var defer = require("devtools/shared/defer");
|
||||||
@ -81,11 +85,11 @@ const PORTRAIT_MODE_WIDTH = 700;
|
|||||||
* Fired when the stylesheet source links have been updated (when switching
|
* Fired when the stylesheet source links have been updated (when switching
|
||||||
* to source-mapped files)
|
* to source-mapped files)
|
||||||
*/
|
*/
|
||||||
function InspectorPanel(iframeWindow, toolbox) {
|
function Inspector(toolbox) {
|
||||||
this._toolbox = toolbox;
|
this._toolbox = toolbox;
|
||||||
this._target = toolbox.target;
|
this._target = toolbox.target;
|
||||||
this.panelDoc = iframeWindow.document;
|
this.panelDoc = window.document;
|
||||||
this.panelWin = iframeWindow;
|
this.panelWin = window;
|
||||||
this.panelWin.inspector = this;
|
this.panelWin.inspector = this;
|
||||||
|
|
||||||
this.telemetry = new Telemetry();
|
this.telemetry = new Telemetry();
|
||||||
@ -96,6 +100,7 @@ function InspectorPanel(iframeWindow, toolbox) {
|
|||||||
this._onBeforeNavigate = this._onBeforeNavigate.bind(this);
|
this._onBeforeNavigate = this._onBeforeNavigate.bind(this);
|
||||||
this.onNewRoot = this.onNewRoot.bind(this);
|
this.onNewRoot = this.onNewRoot.bind(this);
|
||||||
this._onContextMenu = this._onContextMenu.bind(this);
|
this._onContextMenu = this._onContextMenu.bind(this);
|
||||||
|
this.onTextBoxContextMenu = this.onTextBoxContextMenu.bind(this);
|
||||||
this._updateSearchResultsLabel = this._updateSearchResultsLabel.bind(this);
|
this._updateSearchResultsLabel = this._updateSearchResultsLabel.bind(this);
|
||||||
this.onNewSelection = this.onNewSelection.bind(this);
|
this.onNewSelection = this.onNewSelection.bind(this);
|
||||||
this.onBeforeNewSelection = this.onBeforeNewSelection.bind(this);
|
this.onBeforeNewSelection = this.onBeforeNewSelection.bind(this);
|
||||||
@ -112,13 +117,11 @@ function InspectorPanel(iframeWindow, toolbox) {
|
|||||||
EventEmitter.decorate(this);
|
EventEmitter.decorate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.InspectorPanel = InspectorPanel;
|
Inspector.prototype = {
|
||||||
|
|
||||||
InspectorPanel.prototype = {
|
|
||||||
/**
|
/**
|
||||||
* open is effectively an asynchronous constructor
|
* open is effectively an asynchronous constructor
|
||||||
*/
|
*/
|
||||||
open: Task.async(function* () {
|
init: Task.async(function* () {
|
||||||
// Localize all the nodes containing a data-localization attribute.
|
// Localize all the nodes containing a data-localization attribute.
|
||||||
localizeMarkup(this.panelDoc);
|
localizeMarkup(this.panelDoc);
|
||||||
|
|
||||||
@ -146,6 +149,10 @@ InspectorPanel.prototype = {
|
|||||||
return this._toolbox.selection;
|
return this._toolbox.selection;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
get highlighter() {
|
||||||
|
return this._toolbox.highlighter;
|
||||||
|
},
|
||||||
|
|
||||||
get isOuterHTMLEditable() {
|
get isOuterHTMLEditable() {
|
||||||
return this._target.client.traits.editOuterHTML;
|
return this._target.client.traits.editOuterHTML;
|
||||||
},
|
},
|
||||||
@ -275,7 +282,7 @@ InspectorPanel.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_getPageStyle: function () {
|
_getPageStyle: function () {
|
||||||
return this._toolbox.inspector.getPageStyle().then(pageStyle => {
|
return this.inspector.getPageStyle().then(pageStyle => {
|
||||||
this.pageStyle = pageStyle;
|
this.pageStyle = pageStyle;
|
||||||
}, this._handleRejectionIfNotDestroyed);
|
}, this._handleRejectionIfNotDestroyed);
|
||||||
},
|
},
|
||||||
@ -441,8 +448,6 @@ InspectorPanel.prototype = {
|
|||||||
let SplitBox = this.React.createFactory(this.browserRequire(
|
let SplitBox = this.React.createFactory(this.browserRequire(
|
||||||
"devtools/client/shared/components/splitter/split-box"));
|
"devtools/client/shared/components/splitter/split-box"));
|
||||||
|
|
||||||
this.panelWin.addEventListener("resize", this.onPanelWindowResize, true);
|
|
||||||
|
|
||||||
let splitter = SplitBox({
|
let splitter = SplitBox({
|
||||||
className: "inspector-sidebar-splitter",
|
className: "inspector-sidebar-splitter",
|
||||||
initialWidth: INITIAL_SIDEBAR_SIZE,
|
initialWidth: INITIAL_SIDEBAR_SIZE,
|
||||||
@ -462,6 +467,8 @@ InspectorPanel.prototype = {
|
|||||||
this._splitter = this.ReactDOM.render(splitter,
|
this._splitter = this.ReactDOM.render(splitter,
|
||||||
this.panelDoc.getElementById("inspector-splitter-box"));
|
this.panelDoc.getElementById("inspector-splitter-box"));
|
||||||
|
|
||||||
|
this.panelWin.addEventListener("resize", this.onPanelWindowResize, true);
|
||||||
|
|
||||||
// Persist splitter state in preferences.
|
// Persist splitter state in preferences.
|
||||||
this.sidebar.on("show", this.onSidebarShown);
|
this.sidebar.on("show", this.onSidebarShown);
|
||||||
this.sidebar.on("hide", this.onSidebarHidden);
|
this.sidebar.on("hide", this.onSidebarHidden);
|
||||||
@ -602,7 +609,7 @@ InspectorPanel.prototype = {
|
|||||||
|
|
||||||
// Setup the eye-dropper icon if we're in an HTML document and we have actor support.
|
// Setup the eye-dropper icon if we're in an HTML document and we have actor support.
|
||||||
if (this.selection.nodeFront && this.selection.nodeFront.isInHTMLDocument) {
|
if (this.selection.nodeFront && this.selection.nodeFront.isInHTMLDocument) {
|
||||||
this.toolbox.target.actorHasMethod("inspector", "pickColorFromPage").then(value => {
|
this.target.actorHasMethod("inspector", "pickColorFromPage").then(value => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -926,6 +933,17 @@ InspectorPanel.prototype = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is meant to be called by all the search, filter, inplace text boxes in the
|
||||||
|
* inspector, and just calls through to the toolbox openTextBoxContextMenu helper.
|
||||||
|
* @param {DOMEvent} e
|
||||||
|
*/
|
||||||
|
onTextBoxContextMenu: function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
this.toolbox.openTextBoxContextMenu(e.screenX, e.screenY);
|
||||||
|
},
|
||||||
|
|
||||||
_openMenu: function ({ target, screenX = 0, screenY = 0 } = { }) {
|
_openMenu: function ({ target, screenX = 0, screenY = 0 } = { }) {
|
||||||
let markupContainer = this.markup.getContainer(this.selection.nodeFront);
|
let markupContainer = this.markup.getContainer(this.selection.nodeFront);
|
||||||
|
|
||||||
@ -1273,7 +1291,7 @@ InspectorPanel.prototype = {
|
|||||||
this._markupFrame = doc.createElement("iframe");
|
this._markupFrame = doc.createElement("iframe");
|
||||||
this._markupFrame.setAttribute("flex", "1");
|
this._markupFrame.setAttribute("flex", "1");
|
||||||
this._markupFrame.setAttribute("tooltip", "aHTMLTooltip");
|
this._markupFrame.setAttribute("tooltip", "aHTMLTooltip");
|
||||||
this._markupFrame.addEventListener("contextmenu", this._onContextMenu, true);
|
this._markupFrame.addEventListener("contextmenu", this._onContextMenu);
|
||||||
|
|
||||||
// This is needed to enable tooltips inside the iframe document.
|
// This is needed to enable tooltips inside the iframe document.
|
||||||
this._markupFrame.addEventListener("load", this._onMarkupFrameLoad, true);
|
this._markupFrame.addEventListener("load", this._onMarkupFrameLoad, true);
|
||||||
@ -1302,7 +1320,7 @@ InspectorPanel.prototype = {
|
|||||||
|
|
||||||
if (this._markupFrame) {
|
if (this._markupFrame) {
|
||||||
this._markupFrame.removeEventListener("load", this._onMarkupFrameLoad, true);
|
this._markupFrame.removeEventListener("load", this._onMarkupFrameLoad, true);
|
||||||
this._markupFrame.removeEventListener("contextmenu", this._onContextMenu, true);
|
this._markupFrame.removeEventListener("contextmenu", this._onContextMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.markup) {
|
if (this.markup) {
|
||||||
@ -1816,3 +1834,90 @@ InspectorPanel.prototype = {
|
|||||||
}, console.error);
|
}, console.error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// URL constructor doesn't support chrome: scheme
|
||||||
|
let href = window.location.href.replace(/chrome:/, "http://");
|
||||||
|
let url = new window.URL(href);
|
||||||
|
|
||||||
|
// Only use this method to attach the toolbox if some query parameters are given
|
||||||
|
if (url.search.length > 1) {
|
||||||
|
const { targetFromURL } = require("devtools/client/framework/target-from-url");
|
||||||
|
const { attachThread } = require("devtools/client/framework/attach-thread");
|
||||||
|
const { BrowserLoader } =
|
||||||
|
Cu.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||||
|
|
||||||
|
const { Selection } = require("devtools/client/framework/selection");
|
||||||
|
const { InspectorFront } = require("devtools/shared/fronts/inspector");
|
||||||
|
const { getHighlighterUtils } = require("devtools/client/framework/toolbox-highlighter-utils");
|
||||||
|
|
||||||
|
Task.spawn(function* () {
|
||||||
|
let target = yield targetFromURL(url);
|
||||||
|
|
||||||
|
let notImplemented = function () {
|
||||||
|
throw new Error("Not implemented in a tab");
|
||||||
|
};
|
||||||
|
let fakeToolbox = {
|
||||||
|
target,
|
||||||
|
hostType: "bottom",
|
||||||
|
doc: window.document,
|
||||||
|
win: window,
|
||||||
|
on() {}, emit() {}, off() {},
|
||||||
|
initInspector() {},
|
||||||
|
browserRequire: BrowserLoader({
|
||||||
|
window: window,
|
||||||
|
useOnlyShared: true
|
||||||
|
}).require,
|
||||||
|
get React() {
|
||||||
|
return this.browserRequire("devtools/client/shared/vendor/react");
|
||||||
|
},
|
||||||
|
get ReactDOM() {
|
||||||
|
return this.browserRequire("devtools/client/shared/vendor/react-dom");
|
||||||
|
},
|
||||||
|
isToolRegistered() {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
currentToolId: "inspector",
|
||||||
|
getCurrentPanel() {
|
||||||
|
return "inspector";
|
||||||
|
},
|
||||||
|
get textboxContextMenuPopup() {
|
||||||
|
notImplemented();
|
||||||
|
},
|
||||||
|
getPanel: notImplemented,
|
||||||
|
openSplitConsole: notImplemented,
|
||||||
|
viewCssSourceInStyleEditor: notImplemented,
|
||||||
|
viewJsSourceInDebugger: notImplemented,
|
||||||
|
viewSource: notImplemented,
|
||||||
|
viewSourceInDebugger: notImplemented,
|
||||||
|
viewSourceInStyleEditor: notImplemented,
|
||||||
|
|
||||||
|
// For attachThread:
|
||||||
|
highlightTool() {},
|
||||||
|
unhighlightTool() {},
|
||||||
|
selectTool() {},
|
||||||
|
raise() {},
|
||||||
|
getNotificationBox() {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// attachThread also expect a toolbox as argument
|
||||||
|
fakeToolbox.threadClient = yield attachThread(fakeToolbox);
|
||||||
|
|
||||||
|
let inspector = InspectorFront(target.client, target.form);
|
||||||
|
let showAllAnonymousContent =
|
||||||
|
Services.prefs.getBoolPref("devtools.inspector.showAllAnonymousContent");
|
||||||
|
let walker = yield inspector.getWalker({ showAllAnonymousContent });
|
||||||
|
let selection = new Selection(walker);
|
||||||
|
let highlighter = yield inspector.getHighlighter(false);
|
||||||
|
|
||||||
|
fakeToolbox.inspector = inspector;
|
||||||
|
fakeToolbox.walker = walker;
|
||||||
|
fakeToolbox.selection = selection;
|
||||||
|
fakeToolbox.highlighter = highlighter;
|
||||||
|
fakeToolbox.highlighterUtils = getHighlighterUtils(fakeToolbox);
|
||||||
|
|
||||||
|
let inspectorUI = new Inspector(fakeToolbox);
|
||||||
|
inspectorUI.init();
|
||||||
|
}).then(null, e => {
|
||||||
|
window.alert("Unable to start the inspector:" + e.message + "\n" + e.stack);
|
||||||
|
});
|
||||||
|
}
|
@ -25,6 +25,7 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
<script type="application/javascript;version=1.8"
|
<script type="application/javascript;version=1.8"
|
||||||
src="chrome://devtools/content/shared/theme-switching.js"></script>
|
src="chrome://devtools/content/shared/theme-switching.js"></script>
|
||||||
|
<script type="application/javascript;version=1.8" src="inspector.js" defer="true"></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="theme-body" role="application">
|
<body class="theme-body" role="application">
|
||||||
<div class="inspector-responsive-container theme-body inspector">
|
<div class="inspector-responsive-container theme-body inspector">
|
||||||
|
@ -84,8 +84,8 @@ const INSPECTOR_L10N = new LocalizationHelper("devtools/locale/inspector.propert
|
|||||||
* An iframe in which the caller has kindly loaded markup.xhtml.
|
* An iframe in which the caller has kindly loaded markup.xhtml.
|
||||||
*/
|
*/
|
||||||
function MarkupView(inspector, frame, controllerWindow) {
|
function MarkupView(inspector, frame, controllerWindow) {
|
||||||
this._inspector = inspector;
|
this.inspector = inspector;
|
||||||
this.walker = this._inspector.walker;
|
this.walker = this.inspector.walker;
|
||||||
this._frame = frame;
|
this._frame = frame;
|
||||||
this.win = this._frame.contentWindow;
|
this.win = this._frame.contentWindow;
|
||||||
this.doc = this._frame.contentDocument;
|
this.doc = this._frame.contentDocument;
|
||||||
@ -109,7 +109,7 @@ function MarkupView(inspector, frame, controllerWindow) {
|
|||||||
theme: "auto",
|
theme: "auto",
|
||||||
};
|
};
|
||||||
|
|
||||||
this.popup = new AutocompletePopup(inspector._toolbox, options);
|
this.popup = new AutocompletePopup(inspector.toolbox, options);
|
||||||
|
|
||||||
this.undo = new UndoStack();
|
this.undo = new UndoStack();
|
||||||
this.undo.installController(controllerWindow);
|
this.undo.installController(controllerWindow);
|
||||||
@ -145,8 +145,8 @@ function MarkupView(inspector, frame, controllerWindow) {
|
|||||||
this._frame.addEventListener("focus", this._onFocus, false);
|
this._frame.addEventListener("focus", this._onFocus, false);
|
||||||
this.walker.on("mutations", this._mutationObserver);
|
this.walker.on("mutations", this._mutationObserver);
|
||||||
this.walker.on("display-change", this._onDisplayChange);
|
this.walker.on("display-change", this._onDisplayChange);
|
||||||
this._inspector.selection.on("new-node-front", this._onNewSelection);
|
this.inspector.selection.on("new-node-front", this._onNewSelection);
|
||||||
this._inspector.toolbox.on("picker-node-hovered", this._onToolboxPickerHover);
|
this.toolbox.on("picker-node-hovered", this._onToolboxPickerHover);
|
||||||
|
|
||||||
this._onNewSelection();
|
this._onNewSelection();
|
||||||
this._initTooltips();
|
this._initTooltips();
|
||||||
@ -168,6 +168,10 @@ MarkupView.prototype = {
|
|||||||
|
|
||||||
_selectedContainer: null,
|
_selectedContainer: null,
|
||||||
|
|
||||||
|
get toolbox() {
|
||||||
|
return this.inspector.toolbox;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle promise rejections for various asynchronous actions, and only log errors if
|
* Handle promise rejections for various asynchronous actions, and only log errors if
|
||||||
* the markup view still exists.
|
* the markup view still exists.
|
||||||
@ -181,9 +185,9 @@ MarkupView.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_initTooltips: function () {
|
_initTooltips: function () {
|
||||||
this.eventDetailsTooltip = new HTMLTooltip(this._inspector.toolbox,
|
this.eventDetailsTooltip = new HTMLTooltip(this.toolbox,
|
||||||
{type: "arrow"});
|
{type: "arrow"});
|
||||||
this.imagePreviewTooltip = new HTMLTooltip(this._inspector.toolbox,
|
this.imagePreviewTooltip = new HTMLTooltip(this.toolbox,
|
||||||
{type: "arrow", useXulWrapper: "true"});
|
{type: "arrow", useXulWrapper: "true"});
|
||||||
this._enableImagePreviewTooltip();
|
this._enableImagePreviewTooltip();
|
||||||
},
|
},
|
||||||
@ -423,8 +427,7 @@ MarkupView.prototype = {
|
|||||||
* requests queued up
|
* requests queued up
|
||||||
*/
|
*/
|
||||||
_showBoxModel: function (nodeFront) {
|
_showBoxModel: function (nodeFront) {
|
||||||
return this._inspector.toolbox.highlighterUtils
|
return this.toolbox.highlighterUtils.highlightNodeFront(nodeFront);
|
||||||
.highlightNodeFront(nodeFront);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -437,7 +440,7 @@ MarkupView.prototype = {
|
|||||||
* requests queued up
|
* requests queued up
|
||||||
*/
|
*/
|
||||||
_hideBoxModel: function (forceHide) {
|
_hideBoxModel: function (forceHide) {
|
||||||
return this._inspector.toolbox.highlighterUtils.unhighlight(forceHide);
|
return this.toolbox.highlighterUtils.unhighlight(forceHide);
|
||||||
},
|
},
|
||||||
|
|
||||||
_briefBoxModelTimer: null,
|
_briefBoxModelTimer: null,
|
||||||
@ -551,14 +554,14 @@ MarkupView.prototype = {
|
|||||||
* highlighted.
|
* highlighted.
|
||||||
*/
|
*/
|
||||||
_shouldNewSelectionBeHighlighted: function () {
|
_shouldNewSelectionBeHighlighted: function () {
|
||||||
let reason = this._inspector.selection.reason;
|
let reason = this.inspector.selection.reason;
|
||||||
let unwantedReasons = [
|
let unwantedReasons = [
|
||||||
"inspector-open",
|
"inspector-open",
|
||||||
"navigateaway",
|
"navigateaway",
|
||||||
"nodeselected",
|
"nodeselected",
|
||||||
"test"
|
"test"
|
||||||
];
|
];
|
||||||
let isHighlight = this._hoveredNode === this._inspector.selection.nodeFront;
|
let isHighlight = this._hoveredNode === this.inspector.selection.nodeFront;
|
||||||
return !isHighlight && reason && unwantedReasons.indexOf(reason) === -1;
|
return !isHighlight && reason && unwantedReasons.indexOf(reason) === -1;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -568,7 +571,7 @@ MarkupView.prototype = {
|
|||||||
* the view.
|
* the view.
|
||||||
*/
|
*/
|
||||||
_onNewSelection: function () {
|
_onNewSelection: function () {
|
||||||
let selection = this._inspector.selection;
|
let selection = this.inspector.selection;
|
||||||
|
|
||||||
this.htmlEditor.hide();
|
this.htmlEditor.hide();
|
||||||
if (this._hoveredNode && this._hoveredNode !== selection.nodeFront) {
|
if (this._hoveredNode && this._hoveredNode !== selection.nodeFront) {
|
||||||
@ -581,7 +584,7 @@ MarkupView.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let done = this._inspector.updating("markup-view");
|
let done = this.inspector.updating("markup-view");
|
||||||
let onShowBoxModel, onShow;
|
let onShowBoxModel, onShow;
|
||||||
|
|
||||||
// Highlight the element briefly if needed.
|
// Highlight the element briefly if needed.
|
||||||
@ -611,7 +614,7 @@ MarkupView.prototype = {
|
|||||||
* on why the current node got selected.
|
* on why the current node got selected.
|
||||||
*/
|
*/
|
||||||
maybeNavigateToNewSelection: function () {
|
maybeNavigateToNewSelection: function () {
|
||||||
let {reason, nodeFront} = this._inspector.selection;
|
let {reason, nodeFront} = this.inspector.selection;
|
||||||
|
|
||||||
// The list of reasons that should lead to navigating to the node.
|
// The list of reasons that should lead to navigating to the node.
|
||||||
let reasonsToNavigate = [
|
let reasonsToNavigate = [
|
||||||
@ -656,9 +659,9 @@ MarkupView.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let selection = this._inspector.selection;
|
let selection = this.inspector.selection;
|
||||||
if (selection.isNode()) {
|
if (selection.isNode()) {
|
||||||
this._inspector.copyOuterHTML();
|
this.inspector.copyOuterHTML();
|
||||||
}
|
}
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
@ -713,7 +716,7 @@ MarkupView.prototype = {
|
|||||||
}
|
}
|
||||||
case "markupView.scrollInto.key": {
|
case "markupView.scrollInto.key": {
|
||||||
let selection = this._selectedContainer.node;
|
let selection = this._selectedContainer.node;
|
||||||
this._inspector.scrollNodeIntoView(selection);
|
this.inspector.scrollNodeIntoView(selection);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Generic keys
|
// Generic keys
|
||||||
@ -965,12 +968,12 @@ MarkupView.prototype = {
|
|||||||
this._elt.appendChild(container.elt);
|
this._elt.appendChild(container.elt);
|
||||||
this._rootNode = node;
|
this._rootNode = node;
|
||||||
} else if (nodeType == nodeConstants.ELEMENT_NODE && !isPseudoElement) {
|
} else if (nodeType == nodeConstants.ELEMENT_NODE && !isPseudoElement) {
|
||||||
container = new MarkupElementContainer(this, node, this._inspector);
|
container = new MarkupElementContainer(this, node, this.inspector);
|
||||||
} else if (nodeType == nodeConstants.COMMENT_NODE ||
|
} else if (nodeType == nodeConstants.COMMENT_NODE ||
|
||||||
nodeType == nodeConstants.TEXT_NODE) {
|
nodeType == nodeConstants.TEXT_NODE) {
|
||||||
container = new MarkupTextContainer(this, node, this._inspector);
|
container = new MarkupTextContainer(this, node, this.inspector);
|
||||||
} else {
|
} else {
|
||||||
container = new MarkupReadOnlyContainer(this, node, this._inspector);
|
container = new MarkupReadOnlyContainer(this, node, this.inspector);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flashNode) {
|
if (flashNode) {
|
||||||
@ -982,7 +985,7 @@ MarkupView.prototype = {
|
|||||||
|
|
||||||
this._updateChildren(container);
|
this._updateChildren(container);
|
||||||
|
|
||||||
this._inspector.emit("container-created", container);
|
this.inspector.emit("container-created", container);
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
@ -1039,7 +1042,7 @@ MarkupView.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._flashMutatedNodes(mutations);
|
this._flashMutatedNodes(mutations);
|
||||||
this._inspector.emit("markupmutation", mutations);
|
this.inspector.emit("markupmutation", mutations);
|
||||||
|
|
||||||
// Since the htmlEditor is absolutely positioned, a mutation may change
|
// Since the htmlEditor is absolutely positioned, a mutation may change
|
||||||
// the location in which it should be shown.
|
// the location in which it should be shown.
|
||||||
@ -1277,13 +1280,13 @@ MarkupView.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._inspector.off("markupmutation", onMutations);
|
this.inspector.off("markupmutation", onMutations);
|
||||||
this._removedNodeObserver = null;
|
this._removedNodeObserver = null;
|
||||||
|
|
||||||
// Don't select the new node if the user has already changed the current
|
// Don't select the new node if the user has already changed the current
|
||||||
// selection.
|
// selection.
|
||||||
if (this._inspector.selection.nodeFront === parentContainer.node ||
|
if (this.inspector.selection.nodeFront === parentContainer.node ||
|
||||||
(this._inspector.selection.nodeFront === removedNode && isHTMLTag)) {
|
(this.inspector.selection.nodeFront === removedNode && isHTMLTag)) {
|
||||||
let childContainers = parentContainer.getChildContainers();
|
let childContainers = parentContainer.getChildContainers();
|
||||||
if (childContainers && childContainers[childIndex]) {
|
if (childContainers && childContainers[childIndex]) {
|
||||||
this.markNodeAsSelected(childContainers[childIndex].node, reason);
|
this.markNodeAsSelected(childContainers[childIndex].node, reason);
|
||||||
@ -1297,7 +1300,7 @@ MarkupView.prototype = {
|
|||||||
|
|
||||||
// Start listening for mutations until we find a childList change that has
|
// Start listening for mutations until we find a childList change that has
|
||||||
// removedNode removed.
|
// removedNode removed.
|
||||||
this._inspector.on("markupmutation", onMutations);
|
this.inspector.on("markupmutation", onMutations);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1307,7 +1310,7 @@ MarkupView.prototype = {
|
|||||||
*/
|
*/
|
||||||
cancelReselectOnRemoved: function () {
|
cancelReselectOnRemoved: function () {
|
||||||
if (this._removedNodeObserver) {
|
if (this._removedNodeObserver) {
|
||||||
this._inspector.off("markupmutation", this._removedNodeObserver);
|
this.inspector.off("markupmutation", this._removedNodeObserver);
|
||||||
this._removedNodeObserver = null;
|
this._removedNodeObserver = null;
|
||||||
this.emit("canceledreselectonremoved");
|
this.emit("canceledreselectonremoved");
|
||||||
}
|
}
|
||||||
@ -1479,8 +1482,8 @@ MarkupView.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Change the current selection if needed.
|
// Change the current selection if needed.
|
||||||
if (this._inspector.selection.nodeFront !== node) {
|
if (this.inspector.selection.nodeFront !== node) {
|
||||||
this._inspector.selection.setNodeFront(node, reason || "nodeselected");
|
this.inspector.selection.setNodeFront(node, reason || "nodeselected");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1526,7 +1529,7 @@ MarkupView.prototype = {
|
|||||||
*/
|
*/
|
||||||
_checkSelectionVisible: function (container) {
|
_checkSelectionVisible: function (container) {
|
||||||
let centered = null;
|
let centered = null;
|
||||||
let node = this._inspector.selection.nodeFront;
|
let node = this.inspector.selection.nodeFront;
|
||||||
while (node) {
|
while (node) {
|
||||||
if (node.parentNode() === container.node) {
|
if (node.parentNode() === container.node) {
|
||||||
centered = node;
|
centered = node;
|
||||||
@ -1741,8 +1744,8 @@ MarkupView.prototype = {
|
|||||||
this._frame.removeEventListener("focus", this._onFocus, false);
|
this._frame.removeEventListener("focus", this._onFocus, false);
|
||||||
this.walker.off("mutations", this._mutationObserver);
|
this.walker.off("mutations", this._mutationObserver);
|
||||||
this.walker.off("display-change", this._onDisplayChange);
|
this.walker.off("display-change", this._onDisplayChange);
|
||||||
this._inspector.selection.off("new-node-front", this._onNewSelection);
|
this.inspector.selection.off("new-node-front", this._onNewSelection);
|
||||||
this._inspector.toolbox.off("picker-node-hovered",
|
this.toolbox.off("picker-node-hovered",
|
||||||
this._onToolboxPickerHover);
|
this._onToolboxPickerHover);
|
||||||
|
|
||||||
this._prefObserver.off(ATTR_COLLAPSE_ENABLED_PREF,
|
this._prefObserver.off(ATTR_COLLAPSE_ENABLED_PREF,
|
||||||
@ -2338,7 +2341,7 @@ MarkupContainer.prototype = {
|
|||||||
let type = target.dataset.type;
|
let type = target.dataset.type;
|
||||||
// Make container tabbable descendants not tabbable (by default).
|
// Make container tabbable descendants not tabbable (by default).
|
||||||
this.canFocus = false;
|
this.canFocus = false;
|
||||||
this.markup._inspector.followAttributeLink(type, link);
|
this.markup.inspector.followAttributeLink(type, link);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2646,7 +2649,7 @@ MarkupElementContainer.prototype = Heritage.extend(MarkupContainer.prototype, {
|
|||||||
|
|
||||||
let listenerInfo = yield this.node.getEventListenerInfo();
|
let listenerInfo = yield this.node.getEventListenerInfo();
|
||||||
|
|
||||||
let toolbox = this.markup._inspector.toolbox;
|
let toolbox = this.markup.toolbox;
|
||||||
setEventTooltip(tooltip, listenerInfo, toolbox);
|
setEventTooltip(tooltip, listenerInfo, toolbox);
|
||||||
// Disable the image preview tooltip while we display the event details
|
// Disable the image preview tooltip while we display the event details
|
||||||
this.markup._disableImagePreviewTooltip();
|
this.markup._disableImagePreviewTooltip();
|
||||||
@ -2912,7 +2915,8 @@ function TextEditor(container, node, templateId) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cssProperties: getCssProperties(this.markup._inspector.toolbox)
|
cssProperties: getCssProperties(this.markup.toolbox),
|
||||||
|
contextMenu: this.markup.inspector.onTextBoxContextMenu
|
||||||
});
|
});
|
||||||
|
|
||||||
this.update();
|
this.update();
|
||||||
@ -2966,7 +2970,7 @@ function ElementEditor(container, node) {
|
|||||||
this.markup = this.container.markup;
|
this.markup = this.container.markup;
|
||||||
this.template = this.markup.template.bind(this.markup);
|
this.template = this.markup.template.bind(this.markup);
|
||||||
this.doc = this.markup.doc;
|
this.doc = this.markup.doc;
|
||||||
this._cssProperties = getCssProperties(this.markup._inspector.toolbox);
|
this._cssProperties = getCssProperties(this.markup.toolbox);
|
||||||
|
|
||||||
this.attrElements = new Map();
|
this.attrElements = new Map();
|
||||||
this.animationTimers = {};
|
this.animationTimers = {};
|
||||||
@ -2994,6 +2998,7 @@ function ElementEditor(container, node) {
|
|||||||
trigger: "dblclick",
|
trigger: "dblclick",
|
||||||
stopOnReturn: true,
|
stopOnReturn: true,
|
||||||
done: this.onTagEdit.bind(this),
|
done: this.onTagEdit.bind(this),
|
||||||
|
contextMenu: this.markup.inspector.onTextBoxContextMenu,
|
||||||
cssProperties: this._cssProperties
|
cssProperties: this._cssProperties
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -3021,6 +3026,7 @@ function ElementEditor(container, node) {
|
|||||||
undoMods.apply();
|
undoMods.apply();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
contextMenu: this.markup.inspector.onTextBoxContextMenu,
|
||||||
cssProperties: this._cssProperties
|
cssProperties: this._cssProperties
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -3262,6 +3268,7 @@ ElementEditor.prototype = {
|
|||||||
undoMods.apply();
|
undoMods.apply();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
contextMenu: this.markup.inspector.onTextBoxContextMenu,
|
||||||
cssProperties: this._cssProperties
|
cssProperties: this._cssProperties
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -3362,8 +3369,7 @@ ElementEditor.prototype = {
|
|||||||
// Only allow one refocus on attribute change at a time, so when there's
|
// Only allow one refocus on attribute change at a time, so when there's
|
||||||
// more than 1 request in parallel, the last one wins.
|
// more than 1 request in parallel, the last one wins.
|
||||||
if (this._editedAttributeObserver) {
|
if (this._editedAttributeObserver) {
|
||||||
this.markup._inspector.off("markupmutation",
|
this.markup.inspector.off("markupmutation", this._editedAttributeObserver);
|
||||||
this._editedAttributeObserver);
|
|
||||||
this._editedAttributeObserver = null;
|
this._editedAttributeObserver = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3448,7 +3454,7 @@ ElementEditor.prototype = {
|
|||||||
|
|
||||||
// Start listening for mutations until we find an attributes change
|
// Start listening for mutations until we find an attributes change
|
||||||
// that modifies this attribute.
|
// that modifies this attribute.
|
||||||
this.markup._inspector.once("markupmutation", onMutations);
|
this.markup.inspector.once("markupmutation", onMutations);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,7 @@ add_task(function* () {
|
|||||||
assertMarkupViewIsLoaded();
|
assertMarkupViewIsLoaded();
|
||||||
yield selectNode("#one", inspector);
|
yield selectNode("#one", inspector);
|
||||||
|
|
||||||
let willNavigate = inspector.toolbox.target.once("will-navigate");
|
let willNavigate = inspector.target.once("will-navigate");
|
||||||
yield testActor.eval(`content.location = "${URL_2}"`);
|
yield testActor.eval(`content.location = "${URL_2}"`);
|
||||||
|
|
||||||
info("Waiting for will-navigate");
|
info("Waiting for will-navigate");
|
||||||
|
@ -14,9 +14,9 @@ DIRS += [
|
|||||||
DevToolsModules(
|
DevToolsModules(
|
||||||
'breadcrumbs.js',
|
'breadcrumbs.js',
|
||||||
'inspector-commands.js',
|
'inspector-commands.js',
|
||||||
'inspector-panel.js',
|
|
||||||
'inspector-search.js',
|
'inspector-search.js',
|
||||||
'inspector.xhtml',
|
'inspector.xhtml',
|
||||||
|
'panel.js',
|
||||||
'toolsidebar.js',
|
'toolsidebar.js',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
19
devtools/client/inspector/panel.js
Normal file
19
devtools/client/inspector/panel.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/* 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/. */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function InspectorPanel(iframeWindow, toolbox) {
|
||||||
|
this._inspector = new iframeWindow.Inspector(toolbox);
|
||||||
|
}
|
||||||
|
InspectorPanel.prototype = {
|
||||||
|
open() {
|
||||||
|
return this._inspector.init();
|
||||||
|
},
|
||||||
|
|
||||||
|
destroy() {
|
||||||
|
return this._inspector.destroy();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.InspectorPanel = InspectorPanel;
|
@ -112,8 +112,6 @@ function CssRuleView(inspector, document, store, pageStyle) {
|
|||||||
this._onCopy = this._onCopy.bind(this);
|
this._onCopy = this._onCopy.bind(this);
|
||||||
this._onFilterStyles = this._onFilterStyles.bind(this);
|
this._onFilterStyles = this._onFilterStyles.bind(this);
|
||||||
this._onClearSearch = this._onClearSearch.bind(this);
|
this._onClearSearch = this._onClearSearch.bind(this);
|
||||||
this._onFilterTextboxContextMenu =
|
|
||||||
this._onFilterTextboxContextMenu.bind(this);
|
|
||||||
this._onTogglePseudoClassPanel = this._onTogglePseudoClassPanel.bind(this);
|
this._onTogglePseudoClassPanel = this._onTogglePseudoClassPanel.bind(this);
|
||||||
this._onTogglePseudoClass = this._onTogglePseudoClass.bind(this);
|
this._onTogglePseudoClass = this._onTogglePseudoClass.bind(this);
|
||||||
|
|
||||||
@ -140,8 +138,7 @@ function CssRuleView(inspector, document, store, pageStyle) {
|
|||||||
this.element.addEventListener("contextmenu", this._onContextMenu);
|
this.element.addEventListener("contextmenu", this._onContextMenu);
|
||||||
this.addRuleButton.addEventListener("click", this._onAddRule);
|
this.addRuleButton.addEventListener("click", this._onAddRule);
|
||||||
this.searchField.addEventListener("input", this._onFilterStyles);
|
this.searchField.addEventListener("input", this._onFilterStyles);
|
||||||
this.searchField.addEventListener("contextmenu",
|
this.searchField.addEventListener("contextmenu", this.inspector.onTextBoxContextMenu);
|
||||||
this._onFilterTextboxContextMenu);
|
|
||||||
this.searchClearButton.addEventListener("click", this._onClearSearch);
|
this.searchClearButton.addEventListener("click", this._onClearSearch);
|
||||||
this.pseudoClassToggle.addEventListener("click",
|
this.pseudoClassToggle.addEventListener("click",
|
||||||
this._onTogglePseudoClassPanel);
|
this._onTogglePseudoClassPanel);
|
||||||
@ -470,7 +467,7 @@ CssRuleView.prototype = {
|
|||||||
_onAddRule: function () {
|
_onAddRule: function () {
|
||||||
let elementStyle = this._elementStyle;
|
let elementStyle = this._elementStyle;
|
||||||
let element = elementStyle.element;
|
let element = elementStyle.element;
|
||||||
let client = this.inspector.toolbox.target.client;
|
let client = this.inspector.target.client;
|
||||||
let pseudoClasses = element.pseudoClassLocks;
|
let pseudoClasses = element.pseudoClassLocks;
|
||||||
|
|
||||||
if (!client.traits.addNewRule) {
|
if (!client.traits.addNewRule) {
|
||||||
@ -644,19 +641,6 @@ CssRuleView.prototype = {
|
|||||||
}, filterTimeout);
|
}, filterTimeout);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Context menu handler for filter style search box.
|
|
||||||
*/
|
|
||||||
_onFilterTextboxContextMenu: function (event) {
|
|
||||||
try {
|
|
||||||
this.styleWindow.focus();
|
|
||||||
let contextmenu = this.inspector.toolbox.textboxContextMenuPopup;
|
|
||||||
contextmenu.openPopupAtScreen(event.screenX, event.screenY, true);
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the user clicks on the clear button in the filter style search
|
* Called when the user clicks on the clear button in the filter style search
|
||||||
* box. Returns true if the search box is cleared and false otherwise.
|
* box. Returns true if the search box is cleared and false otherwise.
|
||||||
@ -699,7 +683,7 @@ CssRuleView.prototype = {
|
|||||||
this.addRuleButton.removeEventListener("click", this._onAddRule);
|
this.addRuleButton.removeEventListener("click", this._onAddRule);
|
||||||
this.searchField.removeEventListener("input", this._onFilterStyles);
|
this.searchField.removeEventListener("input", this._onFilterStyles);
|
||||||
this.searchField.removeEventListener("contextmenu",
|
this.searchField.removeEventListener("contextmenu",
|
||||||
this._onFilterTextboxContextMenu);
|
this.inspector.onTextBoxContextMenu);
|
||||||
this.searchClearButton.removeEventListener("click", this._onClearSearch);
|
this.searchClearButton.removeEventListener("click", this._onClearSearch);
|
||||||
this.pseudoClassToggle.removeEventListener("click",
|
this.pseudoClassToggle.removeEventListener("click",
|
||||||
this._onTogglePseudoClassPanel);
|
this._onTogglePseudoClassPanel);
|
||||||
|
@ -16,7 +16,7 @@ add_task(function* () {
|
|||||||
|
|
||||||
let win = view.styleWindow;
|
let win = view.styleWindow;
|
||||||
let searchField = view.searchField;
|
let searchField = view.searchField;
|
||||||
let searchContextMenu = toolbox.textboxContextMenuPopup;
|
let searchContextMenu = toolbox.textBoxContextMenuPopup;
|
||||||
ok(searchContextMenu,
|
ok(searchContextMenu,
|
||||||
"The search filter context menu is loaded in the rule view");
|
"The search filter context menu is loaded in the rule view");
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ RuleEditor.prototype = {
|
|||||||
|
|
||||||
get isSelectorEditable() {
|
get isSelectorEditable() {
|
||||||
let trait = this.isEditable &&
|
let trait = this.isEditable &&
|
||||||
this.toolbox.target.client.traits.selectorEditable &&
|
this.ruleView.inspector.target.client.traits.selectorEditable &&
|
||||||
this.rule.domRule.type !== ELEMENT_STYLE &&
|
this.rule.domRule.type !== ELEMENT_STYLE &&
|
||||||
this.rule.domRule.type !== CSSRule.KEYFRAME_RULE;
|
this.rule.domRule.type !== CSSRule.KEYFRAME_RULE;
|
||||||
|
|
||||||
@ -145,7 +145,8 @@ RuleEditor.prototype = {
|
|||||||
editableField({
|
editableField({
|
||||||
element: this.selectorText,
|
element: this.selectorText,
|
||||||
done: this._onSelectorDone,
|
done: this._onSelectorDone,
|
||||||
cssProperties: this.rule.cssProperties
|
cssProperties: this.rule.cssProperties,
|
||||||
|
contextMenu: this.ruleView.inspector.onTextBoxContextMenu
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,7 +449,8 @@ RuleEditor.prototype = {
|
|||||||
advanceChars: ":",
|
advanceChars: ":",
|
||||||
contentType: InplaceEditor.CONTENT_TYPES.CSS_PROPERTY,
|
contentType: InplaceEditor.CONTENT_TYPES.CSS_PROPERTY,
|
||||||
popup: this.ruleView.popup,
|
popup: this.ruleView.popup,
|
||||||
cssProperties: this.rule.cssProperties
|
cssProperties: this.rule.cssProperties,
|
||||||
|
contextMenu: this.ruleView.inspector.onTextBoxContextMenu
|
||||||
});
|
});
|
||||||
|
|
||||||
// Auto-close the input if multiple rules get pasted into new property.
|
// Auto-close the input if multiple rules get pasted into new property.
|
||||||
|
@ -219,7 +219,8 @@ TextPropertyEditor.prototype = {
|
|||||||
advanceChars: ":",
|
advanceChars: ":",
|
||||||
contentType: InplaceEditor.CONTENT_TYPES.CSS_PROPERTY,
|
contentType: InplaceEditor.CONTENT_TYPES.CSS_PROPERTY,
|
||||||
popup: this.popup,
|
popup: this.popup,
|
||||||
cssProperties: this.cssProperties
|
cssProperties: this.cssProperties,
|
||||||
|
contextMenu: this.ruleView.inspector.onTextBoxContextMenu
|
||||||
});
|
});
|
||||||
|
|
||||||
// Auto blur name field on multiple CSS rules get pasted in.
|
// Auto blur name field on multiple CSS rules get pasted in.
|
||||||
@ -289,7 +290,8 @@ TextPropertyEditor.prototype = {
|
|||||||
popup: this.popup,
|
popup: this.popup,
|
||||||
multiline: true,
|
multiline: true,
|
||||||
maxWidth: () => this.container.getBoundingClientRect().width,
|
maxWidth: () => this.container.getBoundingClientRect().width,
|
||||||
cssProperties: this.cssProperties
|
cssProperties: this.cssProperties,
|
||||||
|
contextMenu: this.ruleView.inspector.onTextBoxContextMenu
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -161,3 +161,4 @@ subsuite = clipboard
|
|||||||
[browser_inspector_search-navigation.js]
|
[browser_inspector_search-navigation.js]
|
||||||
[browser_inspector_sidebarstate.js]
|
[browser_inspector_sidebarstate.js]
|
||||||
[browser_inspector_switch-to-inspector-on-pick.js]
|
[browser_inspector_switch-to-inspector-on-pick.js]
|
||||||
|
[browser_inspector_textbox-menu.js]
|
||||||
|
@ -34,7 +34,7 @@ add_task(function* () {
|
|||||||
|
|
||||||
info("Waiting for box mode to show.");
|
info("Waiting for box mode to show.");
|
||||||
let body = yield getNodeFront("body", inspector);
|
let body = yield getNodeFront("body", inspector);
|
||||||
yield toolbox.highlighter.showBoxModel(body);
|
yield inspector.highlighter.showBoxModel(body);
|
||||||
|
|
||||||
info("Waiting for element picker to become active.");
|
info("Waiting for element picker to become active.");
|
||||||
yield startPicker(toolbox);
|
yield startPicker(toolbox);
|
||||||
|
@ -27,11 +27,11 @@ const ELEMENTS = ["box-model-root",
|
|||||||
"box-model-infobar-dimensions"];
|
"box-model-infobar-dimensions"];
|
||||||
|
|
||||||
add_task(function* () {
|
add_task(function* () {
|
||||||
let {inspector, toolbox, testActor} = yield openInspectorForURL(TEST_URL);
|
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
|
||||||
|
|
||||||
info("Show the box-model highlighter");
|
info("Show the box-model highlighter");
|
||||||
let divFront = yield getNodeFront("div", inspector);
|
let divFront = yield getNodeFront("div", inspector);
|
||||||
yield toolbox.highlighter.showBoxModel(divFront);
|
yield inspector.highlighter.showBoxModel(divFront);
|
||||||
|
|
||||||
for (let id of ELEMENTS) {
|
for (let id of ELEMENTS) {
|
||||||
let foundId = yield testActor.getHighlighterNodeAttribute(id, "id");
|
let foundId = yield testActor.getHighlighterNodeAttribute(id, "id");
|
||||||
@ -39,5 +39,5 @@ add_task(function* () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
info("Hide the box-model highlighter");
|
info("Hide the box-model highlighter");
|
||||||
yield toolbox.highlighter.hideBoxModel();
|
yield inspector.highlighter.hideBoxModel();
|
||||||
});
|
});
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
const TEST_URL = "data:text/html;charset=utf-8,<p>Select me!</p>";
|
const TEST_URL = "data:text/html;charset=utf-8,<p>Select me!</p>";
|
||||||
|
|
||||||
add_task(function* () {
|
add_task(function* () {
|
||||||
let {toolbox, inspector, testActor} = yield openInspectorForURL(TEST_URL);
|
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
|
||||||
|
|
||||||
info("hover over the <p> line in the markup-view so that it's the " +
|
info("hover over the <p> line in the markup-view so that it's the " +
|
||||||
"currently hovered node");
|
"currently hovered node");
|
||||||
@ -24,7 +24,7 @@ add_task(function* () {
|
|||||||
|
|
||||||
info("listen to the highlighter's hidden event");
|
info("listen to the highlighter's hidden event");
|
||||||
let onHidden = testActor.waitForHighlighterEvent("hidden",
|
let onHidden = testActor.waitForHighlighterEvent("hidden",
|
||||||
toolbox.highlighter);
|
inspector.highlighter);
|
||||||
info("mouse-leave the markup-view");
|
info("mouse-leave the markup-view");
|
||||||
yield mouseLeaveMarkupView(inspector);
|
yield mouseLeaveMarkupView(inspector);
|
||||||
yield onHidden;
|
yield onHidden;
|
||||||
|
@ -46,7 +46,7 @@ add_task(function* () {
|
|||||||
info("Key pressed. Waiting for element to be picked");
|
info("Key pressed. Waiting for element to be picked");
|
||||||
testActor.synthesizeKey(args);
|
testActor.synthesizeKey(args);
|
||||||
return promise.all([
|
return promise.all([
|
||||||
toolbox.selection.once("new-node-front"),
|
inspector.selection.once("new-node-front"),
|
||||||
inspector.once("inspector-updated")
|
inspector.once("inspector-updated")
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ const TEST_DATA = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
add_task(function* () {
|
add_task(function* () {
|
||||||
let {inspector, toolbox, testActor} = yield openInspectorForURL(
|
let {inspector, testActor} = yield openInspectorForURL(
|
||||||
"data:text/html;charset=utf-8," + encodeURI(TEST_URL));
|
"data:text/html;charset=utf-8," + encodeURI(TEST_URL));
|
||||||
|
|
||||||
let divFront = yield getNodeFront("div", inspector);
|
let divFront = yield getNodeFront("div", inspector);
|
||||||
@ -194,11 +194,11 @@ add_task(function* () {
|
|||||||
info("Running test: " + desc);
|
info("Running test: " + desc);
|
||||||
|
|
||||||
info("Show the box-model highlighter with options " + options);
|
info("Show the box-model highlighter with options " + options);
|
||||||
yield toolbox.highlighter.showBoxModel(divFront, options);
|
yield inspector.highlighter.showBoxModel(divFront, options);
|
||||||
|
|
||||||
yield checkHighlighter(testActor);
|
yield checkHighlighter(testActor);
|
||||||
|
|
||||||
info("Hide the box-model highlighter");
|
info("Hide the box-model highlighter");
|
||||||
yield toolbox.highlighter.hideBoxModel();
|
yield inspector.highlighter.hideBoxModel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -22,7 +22,7 @@ add_task(function* () {
|
|||||||
info("Key pressed. Waiting for element to be picked");
|
info("Key pressed. Waiting for element to be picked");
|
||||||
testActor.synthesizeKey(msg);
|
testActor.synthesizeKey(msg);
|
||||||
return promise.all([
|
return promise.all([
|
||||||
toolbox.selection.once("new-node-front"),
|
inspector.selection.once("new-node-front"),
|
||||||
inspector.once("inspector-updated")
|
inspector.once("inspector-updated")
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ add_task(function* () {
|
|||||||
let divFront = yield getNodeFront("div", inspector);
|
let divFront = yield getNodeFront("div", inspector);
|
||||||
|
|
||||||
info("Waiting for highlighter to activate");
|
info("Waiting for highlighter to activate");
|
||||||
yield inspector.toolbox.highlighter.showBoxModel(divFront);
|
yield inspector.highlighter.showBoxModel(divFront);
|
||||||
|
|
||||||
let rect = yield testActor.getSimpleBorderRect();
|
let rect = yield testActor.getSimpleBorderRect();
|
||||||
is(rect.width, 100, "The highlighter has the right width.");
|
is(rect.width, 100, "The highlighter has the right width.");
|
||||||
@ -31,5 +31,5 @@ add_task(function* () {
|
|||||||
is(rect.width, 200, "The highlighter has the right width after update");
|
is(rect.width, 200, "The highlighter has the right width after update");
|
||||||
|
|
||||||
info("Waiting for highlighter to hide");
|
info("Waiting for highlighter to hide");
|
||||||
yield inspector.toolbox.highlighter.hideBoxModel();
|
yield inspector.highlighter.hideBoxModel();
|
||||||
});
|
});
|
||||||
|
@ -89,9 +89,8 @@ function* testNavigate(inspector, testActor, ruleview) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function* showPickerOn(selector, inspector) {
|
function* showPickerOn(selector, inspector) {
|
||||||
let highlighter = inspector.toolbox.highlighter;
|
|
||||||
let nodeFront = yield getNodeFront(selector, inspector);
|
let nodeFront = yield getNodeFront(selector, inspector);
|
||||||
yield highlighter.showBoxModel(nodeFront);
|
yield inspector.highlighter.showBoxModel(nodeFront);
|
||||||
}
|
}
|
||||||
|
|
||||||
function* assertPseudoAddedToNode(inspector, testActor, ruleview) {
|
function* assertPseudoAddedToNode(inspector, testActor, ruleview) {
|
||||||
@ -119,7 +118,7 @@ function* assertPseudoAddedToNode(inspector, testActor, ruleview) {
|
|||||||
let value = yield testActor.getHighlighterNodeTextContent(
|
let value = yield testActor.getHighlighterNodeTextContent(
|
||||||
"box-model-infobar-pseudo-classes");
|
"box-model-infobar-pseudo-classes");
|
||||||
is(value, PSEUDO, "pseudo-class in infobar selector");
|
is(value, PSEUDO, "pseudo-class in infobar selector");
|
||||||
yield inspector.toolbox.highlighter.hideBoxModel();
|
yield inspector.highlighter.hideBoxModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
function* assertPseudoRemovedFromNode(testActor) {
|
function* assertPseudoRemovedFromNode(testActor) {
|
||||||
@ -145,5 +144,5 @@ function* assertPseudoRemovedFromView(inspector, testActor, ruleview) {
|
|||||||
let value = yield testActor.getHighlighterNodeTextContent(
|
let value = yield testActor.getHighlighterNodeTextContent(
|
||||||
"box-model-infobar-pseudo-classes");
|
"box-model-infobar-pseudo-classes");
|
||||||
is(value, "", "pseudo-class removed from infobar selector");
|
is(value, "", "pseudo-class removed from infobar selector");
|
||||||
yield inspector.toolbox.highlighter.hideBoxModel();
|
yield inspector.highlighter.hideBoxModel();
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ add_task(function* () {
|
|||||||
yield selectNode("h1", inspector);
|
yield selectNode("h1", inspector);
|
||||||
|
|
||||||
let win = inspector.panelWin;
|
let win = inspector.panelWin;
|
||||||
let searchContextMenu = toolbox.textboxContextMenuPopup;
|
let searchContextMenu = toolbox.textBoxContextMenuPopup;
|
||||||
ok(searchContextMenu,
|
ok(searchContextMenu,
|
||||||
"The search filter context menu is loaded in the inspector");
|
"The search filter context menu is loaded in the inspector");
|
||||||
|
|
||||||
|
@ -0,0 +1,90 @@
|
|||||||
|
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
// Test that when right-clicking on various text boxes throughout the inspector does use
|
||||||
|
// the toolbox's context menu (copy/cut/paste/selectAll/Undo).
|
||||||
|
|
||||||
|
add_task(function* () {
|
||||||
|
yield addTab(`data:text/html;charset=utf-8,
|
||||||
|
<style>h1 { color: red; }</style>
|
||||||
|
<h1 id="title">textbox context menu test</h1>`);
|
||||||
|
let {toolbox, inspector} = yield openInspector();
|
||||||
|
yield selectNode("h1", inspector);
|
||||||
|
|
||||||
|
info("Testing the markup-view tagname");
|
||||||
|
let container = yield focusNode("h1", inspector);
|
||||||
|
let tag = container.editor.tag;
|
||||||
|
tag.focus();
|
||||||
|
EventUtils.sendKey("return", inspector.panelWin);
|
||||||
|
yield checkTextBox(inspector.markup.doc.activeElement, toolbox);
|
||||||
|
|
||||||
|
info("Testing the markup-view attribute");
|
||||||
|
EventUtils.sendKey("tab", inspector.panelWin);
|
||||||
|
yield checkTextBox(inspector.markup.doc.activeElement, toolbox);
|
||||||
|
|
||||||
|
info("Testing the markup-view new attribute");
|
||||||
|
// It takes 2 tabs to focus the newAttr field, the first one just moves the cursor to
|
||||||
|
// the end of the field.
|
||||||
|
EventUtils.sendKey("tab", inspector.panelWin);
|
||||||
|
EventUtils.sendKey("tab", inspector.panelWin);
|
||||||
|
yield checkTextBox(inspector.markup.doc.activeElement, toolbox);
|
||||||
|
|
||||||
|
info("Testing the markup-view textcontent");
|
||||||
|
EventUtils.sendKey("tab", inspector.panelWin);
|
||||||
|
yield checkTextBox(inspector.markup.doc.activeElement, toolbox);
|
||||||
|
// Blur this last markup-view field, since we're moving on to the rule-view next.
|
||||||
|
EventUtils.sendKey("escape", inspector.panelWin);
|
||||||
|
|
||||||
|
info("Testing the rule-view selector");
|
||||||
|
let ruleView = inspector.ruleview.view;
|
||||||
|
let cssRuleEditor = getRuleViewRuleEditor(ruleView, 1);
|
||||||
|
EventUtils.synthesizeMouse(cssRuleEditor.selectorText, 0, 0, {}, inspector.panelWin);
|
||||||
|
yield checkTextBox(inspector.panelDoc.activeElement, toolbox);
|
||||||
|
|
||||||
|
info("Testing the rule-view property name");
|
||||||
|
EventUtils.sendKey("tab", inspector.panelWin);
|
||||||
|
yield checkTextBox(inspector.panelDoc.activeElement, toolbox);
|
||||||
|
|
||||||
|
info("Testing the rule-view property value");
|
||||||
|
EventUtils.sendKey("tab", inspector.panelWin);
|
||||||
|
yield checkTextBox(inspector.panelDoc.activeElement, toolbox);
|
||||||
|
|
||||||
|
info("Testing the rule-view new property");
|
||||||
|
// Tabbing out of the value field triggers a ruleview-changed event that we need to wait
|
||||||
|
// for.
|
||||||
|
let onRuleViewChanged = once(ruleView, "ruleview-changed");
|
||||||
|
EventUtils.sendKey("tab", inspector.panelWin);
|
||||||
|
yield onRuleViewChanged;
|
||||||
|
yield checkTextBox(inspector.panelDoc.activeElement, toolbox);
|
||||||
|
|
||||||
|
info("Switching to the computed-view");
|
||||||
|
let onComputedViewReady = inspector.once("boxmodel-view-updated");
|
||||||
|
selectComputedView(inspector);
|
||||||
|
yield onComputedViewReady;
|
||||||
|
|
||||||
|
info("Testing the box-model region");
|
||||||
|
let margin = inspector.panelDoc.querySelector(".boxmodel-margin.boxmodel-top > span");
|
||||||
|
EventUtils.synthesizeMouseAtCenter(margin, {}, inspector.panelWin);
|
||||||
|
yield checkTextBox(inspector.panelDoc.activeElement, toolbox);
|
||||||
|
});
|
||||||
|
|
||||||
|
function* checkTextBox(textBox, {textBoxContextMenuPopup}) {
|
||||||
|
is(textBoxContextMenuPopup.state, "closed", "The menu is closed");
|
||||||
|
|
||||||
|
info("Simulating context click on the textbox and expecting the menu to open");
|
||||||
|
let onContextMenu = once(textBoxContextMenuPopup, "popupshown");
|
||||||
|
EventUtils.synthesizeMouse(textBox, 2, 2, {type: "contextmenu", button: 2},
|
||||||
|
textBox.ownerDocument.defaultView);
|
||||||
|
yield onContextMenu;
|
||||||
|
|
||||||
|
is(textBoxContextMenuPopup.state, "open", "The menu is now visible");
|
||||||
|
|
||||||
|
info("Closing the menu");
|
||||||
|
let onContextMenuHidden = once(textBoxContextMenuPopup, "popuphidden");
|
||||||
|
textBoxContextMenuPopup.hidePopup();
|
||||||
|
yield onContextMenuHidden;
|
||||||
|
|
||||||
|
is(textBoxContextMenuPopup.state, "closed", "The menu is closed again");
|
||||||
|
}
|
@ -25,6 +25,7 @@ devtools.jar:
|
|||||||
content/shared/frame-script-utils.js (shared/frame-script-utils.js)
|
content/shared/frame-script-utils.js (shared/frame-script-utils.js)
|
||||||
content/styleeditor/styleeditor.xul (styleeditor/styleeditor.xul)
|
content/styleeditor/styleeditor.xul (styleeditor/styleeditor.xul)
|
||||||
content/storage/storage.xul (storage/storage.xul)
|
content/storage/storage.xul (storage/storage.xul)
|
||||||
|
content/inspector/inspector.js (inspector/inspector.js)
|
||||||
content/inspector/fonts/fonts.js (inspector/fonts/fonts.js)
|
content/inspector/fonts/fonts.js (inspector/fonts/fonts.js)
|
||||||
content/inspector/markup/markup.xhtml (inspector/markup/markup.xhtml)
|
content/inspector/markup/markup.xhtml (inspector/markup/markup.xhtml)
|
||||||
content/animationinspector/animation-controller.js (animationinspector/animation-controller.js)
|
content/animationinspector/animation-controller.js (animationinspector/animation-controller.js)
|
||||||
|
@ -350,6 +350,10 @@ pref("devtools.jsonview.enabled", false);
|
|||||||
pref("devtools.jsonview.enabled", true);
|
pref("devtools.jsonview.enabled", true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Disable the HTML responsive design tool by default. Currently disabled until
|
// Enable the HTML responsive design tool in Nightly only. Disabled by default for all
|
||||||
// ready to replace the legacy XUL version.
|
// other channels.
|
||||||
|
#ifdef NIGHTLY_BUILD
|
||||||
|
pref("devtools.responsive.html.enabled", true);
|
||||||
|
#else
|
||||||
pref("devtools.responsive.html.enabled", false);
|
pref("devtools.responsive.html.enabled", false);
|
||||||
|
#endif
|
||||||
|
@ -110,9 +110,9 @@ window.getViewportSize = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by manager.js to set viewport size from GCLI.
|
* Called by manager.js to set viewport size from tests, GCLI, etc.
|
||||||
*/
|
*/
|
||||||
window.setViewportSize = (width, height) => {
|
window.setViewportSize = ({ width, height }) => {
|
||||||
try {
|
try {
|
||||||
bootstrap.dispatch(resizeViewport(0, width, height));
|
bootstrap.dispatch(resizeViewport(0, width, height));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -172,7 +172,7 @@ const ResponsiveUIManager = exports.ResponsiveUIManager = {
|
|||||||
switch (command) {
|
switch (command) {
|
||||||
case "resize to":
|
case "resize to":
|
||||||
completed = this.openIfNeeded(window, tab, { command: true });
|
completed = this.openIfNeeded(window, tab, { command: true });
|
||||||
this.activeTabs.get(tab).setViewportSize(args.width, args.height);
|
this.activeTabs.get(tab).setViewportSize(args);
|
||||||
break;
|
break;
|
||||||
case "resize on":
|
case "resize on":
|
||||||
completed = this.openIfNeeded(window, tab, { command: true });
|
completed = this.openIfNeeded(window, tab, { command: true });
|
||||||
@ -489,11 +489,11 @@ ResponsiveUI.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper for tests. Assumes a single viewport for now.
|
* Helper for tests, GCLI, etc. Assumes a single viewport for now.
|
||||||
*/
|
*/
|
||||||
setViewportSize: Task.async(function* (width, height) {
|
setViewportSize: Task.async(function* (size) {
|
||||||
yield this.inited;
|
yield this.inited;
|
||||||
this.toolWindow.setViewportSize(width, height);
|
this.toolWindow.setViewportSize(size);
|
||||||
}),
|
}),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -49,6 +49,13 @@ let reducers = {
|
|||||||
return viewport;
|
return viewport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!width) {
|
||||||
|
width = viewport.width;
|
||||||
|
}
|
||||||
|
if (!height) {
|
||||||
|
height = viewport.height;
|
||||||
|
}
|
||||||
|
|
||||||
return Object.assign({}, viewport, {
|
return Object.assign({}, viewport, {
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
|
@ -142,7 +142,7 @@ var setViewportSize = Task.async(function* (ui, manager, width, height) {
|
|||||||
`set to: ${width} x ${height}`);
|
`set to: ${width} x ${height}`);
|
||||||
if (size.width != width || size.height != height) {
|
if (size.width != width || size.height != height) {
|
||||||
let resized = waitForViewportResizeTo(ui, width, height);
|
let resized = waitForViewportResizeTo(ui, width, height);
|
||||||
ui.setViewportSize(width, height);
|
ui.setViewportSize({ width, height });
|
||||||
yield resized;
|
yield resized;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -62,7 +62,7 @@ var Manager = {
|
|||||||
if (this.isActiveForTab(aTab)) {
|
if (this.isActiveForTab(aTab)) {
|
||||||
ActiveTabs.get(aTab).close();
|
ActiveTabs.get(aTab).close();
|
||||||
} else {
|
} else {
|
||||||
this.runIfNeeded(aWindow, aTab);
|
this.openIfNeeded(aWindow, aTab);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ var Manager = {
|
|||||||
* @param aTab the tab targeted.
|
* @param aTab the tab targeted.
|
||||||
* @returns {ResponsiveUI} the instance of ResponsiveUI for the current tab.
|
* @returns {ResponsiveUI} the instance of ResponsiveUI for the current tab.
|
||||||
*/
|
*/
|
||||||
runIfNeeded: Task.async(function* (aWindow, aTab) {
|
openIfNeeded: Task.async(function* (aWindow, aTab) {
|
||||||
let ui;
|
let ui;
|
||||||
if (!this.isActiveForTab(aTab)) {
|
if (!this.isActiveForTab(aTab)) {
|
||||||
ui = new ResponsiveUI(aWindow, aTab);
|
ui = new ResponsiveUI(aWindow, aTab);
|
||||||
@ -111,11 +111,11 @@ var Manager = {
|
|||||||
handleGcliCommand: Task.async(function* (aWindow, aTab, aCommand, aArgs) {
|
handleGcliCommand: Task.async(function* (aWindow, aTab, aCommand, aArgs) {
|
||||||
switch (aCommand) {
|
switch (aCommand) {
|
||||||
case "resize to":
|
case "resize to":
|
||||||
let ui = yield this.runIfNeeded(aWindow, aTab);
|
let ui = yield this.openIfNeeded(aWindow, aTab);
|
||||||
ui.setSize(aArgs.width, aArgs.height);
|
ui.setViewportSize(aArgs);
|
||||||
break;
|
break;
|
||||||
case "resize on":
|
case "resize on":
|
||||||
this.runIfNeeded(aWindow, aTab);
|
this.openIfNeeded(aWindow, aTab);
|
||||||
break;
|
break;
|
||||||
case "resize off":
|
case "resize off":
|
||||||
if (this.isActiveForTab(aTab)) {
|
if (this.isActiveForTab(aTab)) {
|
||||||
@ -131,10 +131,12 @@ var Manager = {
|
|||||||
|
|
||||||
EventEmitter.decorate(Manager);
|
EventEmitter.decorate(Manager);
|
||||||
|
|
||||||
// If the experimental HTML UI is enabled, delegate the ResponsiveUIManager API
|
// If the new HTML RDM UI is enabled and e10s is enabled by default (e10s is required for
|
||||||
// over to that tool instead. Performing this delegation here allows us to
|
// the new HTML RDM UI to function), delegate the ResponsiveUIManager API over to that
|
||||||
// contain the pref check to a single place.
|
// tool instead. Performing this delegation here allows us to contain the pref check to a
|
||||||
if (Services.prefs.getBoolPref("devtools.responsive.html.enabled")) {
|
// single place.
|
||||||
|
if (Services.prefs.getBoolPref("devtools.responsive.html.enabled") &&
|
||||||
|
Services.appinfo.browserTabsRemoteAutostart) {
|
||||||
let { ResponsiveUIManager } =
|
let { ResponsiveUIManager } =
|
||||||
require("devtools/client/responsive.html/manager");
|
require("devtools/client/responsive.html/manager");
|
||||||
this.ResponsiveUIManager = ResponsiveUIManager;
|
this.ResponsiveUIManager = ResponsiveUIManager;
|
||||||
@ -417,7 +419,7 @@ ResponsiveUI.prototype = {
|
|||||||
* Emit an event when the content has been resized. Only used in tests.
|
* Emit an event when the content has been resized. Only used in tests.
|
||||||
*/
|
*/
|
||||||
onContentResize: function (msg) {
|
onContentResize: function (msg) {
|
||||||
ResponsiveUIManager.emit("contentResize", {
|
ResponsiveUIManager.emit("content-resize", {
|
||||||
tab: this.tab,
|
tab: this.tab,
|
||||||
width: msg.data.width,
|
width: msg.data.width,
|
||||||
height: msg.data.height,
|
height: msg.data.height,
|
||||||
@ -443,6 +445,10 @@ ResponsiveUI.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getViewportBrowser() {
|
||||||
|
return this.browser;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the menu items.
|
* Check the menu items.
|
||||||
*/
|
*/
|
||||||
@ -673,7 +679,10 @@ ResponsiveUI.prototype = {
|
|||||||
let h = this.customPreset.height = parseInt(value[2], 10);
|
let h = this.customPreset.height = parseInt(value[2], 10);
|
||||||
|
|
||||||
this.saveCustomSize();
|
this.saveCustomSize();
|
||||||
this.setSize(w, h);
|
this.setViewportSize({
|
||||||
|
width: w,
|
||||||
|
height: h,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -755,11 +764,9 @@ ResponsiveUI.prototype = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply a preset.
|
* Apply a preset.
|
||||||
*
|
|
||||||
* @param aPreset preset to apply.
|
|
||||||
*/
|
*/
|
||||||
loadPreset: function RUI_loadPreset(aPreset) {
|
loadPreset(preset) {
|
||||||
this.setSize(aPreset.width, aPreset.height);
|
this.setViewportSize(preset);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -845,7 +852,10 @@ ResponsiveUI.prototype = {
|
|||||||
this.menulist.selectedItem = menuitem;
|
this.menulist.selectedItem = menuitem;
|
||||||
this.currentPresetKey = this.customPreset.key;
|
this.currentPresetKey = this.customPreset.key;
|
||||||
|
|
||||||
this.setSize(w, h);
|
this.setViewportSize({
|
||||||
|
width: w,
|
||||||
|
height: h,
|
||||||
|
});
|
||||||
|
|
||||||
this.savePresets();
|
this.savePresets();
|
||||||
},
|
},
|
||||||
@ -858,7 +868,10 @@ ResponsiveUI.prototype = {
|
|||||||
let width = this.rotateValue ? selectedPreset.height : selectedPreset.width;
|
let width = this.rotateValue ? selectedPreset.height : selectedPreset.width;
|
||||||
let height = this.rotateValue ? selectedPreset.width : selectedPreset.height;
|
let height = this.rotateValue ? selectedPreset.width : selectedPreset.height;
|
||||||
|
|
||||||
this.setSize(height, width);
|
this.setViewportSize({
|
||||||
|
width: height,
|
||||||
|
height: width,
|
||||||
|
});
|
||||||
|
|
||||||
if (selectedPreset.custom) {
|
if (selectedPreset.custom) {
|
||||||
this.saveCustomSize();
|
this.saveCustomSize();
|
||||||
@ -999,15 +1012,16 @@ ResponsiveUI.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the size of the browser.
|
* Change the size of the viewport.
|
||||||
*
|
|
||||||
* @param aWidth width of the browser.
|
|
||||||
* @param aHeight height of the browser.
|
|
||||||
*/
|
*/
|
||||||
setSize: function RUI_setSize(aWidth, aHeight) {
|
setViewportSize({ width, height }) {
|
||||||
debug(`SET SIZE TO ${aWidth} x ${aHeight}`);
|
debug(`SET SIZE TO ${width} x ${height}`);
|
||||||
this.setWidth(aWidth);
|
if (width) {
|
||||||
this.setHeight(aHeight);
|
this.setWidth(width);
|
||||||
|
}
|
||||||
|
if (height) {
|
||||||
|
this.setHeight(height);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setWidth: function RUI_setWidth(aWidth) {
|
setWidth: function RUI_setWidth(aWidth) {
|
||||||
@ -1122,7 +1136,7 @@ ResponsiveUI.prototype = {
|
|||||||
this.lastScreenY = screenY;
|
this.lastScreenY = screenY;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setSize(width, height);
|
this.setViewportSize({ width, height });
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,7 +111,7 @@ function* testManualMouseResize(rdm, manager, pressedKey) {
|
|||||||
EventUtils.synthesizeMouse(rdm.resizer, x, y, mouseMoveParams, window);
|
EventUtils.synthesizeMouse(rdm.resizer, x, y, mouseMoveParams, window);
|
||||||
EventUtils.synthesizeMouse(rdm.resizer, x, y, {type: "mouseup"}, window);
|
EventUtils.synthesizeMouse(rdm.resizer, x, y, {type: "mouseup"}, window);
|
||||||
|
|
||||||
yield once(manager, "contentResize");
|
yield once(manager, "content-resize");
|
||||||
|
|
||||||
let expectedWidth = initialWidth + 20;
|
let expectedWidth = initialWidth + 20;
|
||||||
let expectedHeight = initialHeight + 10;
|
let expectedHeight = initialHeight + 10;
|
||||||
@ -138,7 +138,7 @@ function* testResizeUsingCustomInput(rdm, manager) {
|
|||||||
// Only the `change` event must change the size
|
// Only the `change` event must change the size
|
||||||
EventUtils.synthesizeKey("VK_RETURN", {});
|
EventUtils.synthesizeKey("VK_RETURN", {});
|
||||||
|
|
||||||
yield once(manager, "contentResize");
|
yield once(manager, "content-resize");
|
||||||
|
|
||||||
yield verifyResize(rdm, expectedWidth, expectedHeight);
|
yield verifyResize(rdm, expectedWidth, expectedHeight);
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ function* testRotate(rdm, manager) {
|
|||||||
let {width: initialWidth, height: initialHeight} = yield getSizing();
|
let {width: initialWidth, height: initialHeight} = yield getSizing();
|
||||||
rdm.rotate();
|
rdm.rotate();
|
||||||
|
|
||||||
yield once(manager, "contentResize");
|
yield once(manager, "content-resize");
|
||||||
|
|
||||||
let newSize = yield getSizing();
|
let newSize = yield getSizing();
|
||||||
is(newSize.width, initialHeight, "The width should now be the height.");
|
is(newSize.width, initialHeight, "The width should now be the height.");
|
||||||
|
@ -12,7 +12,7 @@ add_task(function* () {
|
|||||||
yield once(newWindow.gBrowser, "load", true);
|
yield once(newWindow.gBrowser, "load", true);
|
||||||
|
|
||||||
let tab = newWindow.gBrowser.selectedTab;
|
let tab = newWindow.gBrowser.selectedTab;
|
||||||
yield ResponsiveUIManager.runIfNeeded(newWindow, tab);
|
yield ResponsiveUIManager.openIfNeeded(newWindow, tab);
|
||||||
|
|
||||||
// Close the window on a tab with an active responsive design UI and
|
// Close the window on a tab with an active responsive design UI and
|
||||||
// wait for the UI to gracefully shutdown. This has leaked the window
|
// wait for the UI to gracefully shutdown. This has leaked the window
|
||||||
|
@ -46,10 +46,13 @@ add_task(function* () {
|
|||||||
Services.prompt.value = "Testing preset";
|
Services.prompt.value = "Testing preset";
|
||||||
Services.prompt.returnBool = true;
|
Services.prompt.returnBool = true;
|
||||||
|
|
||||||
let resized = once(manager, "contentResize");
|
let resized = once(manager, "content-resize");
|
||||||
let customHeight = 123, customWidth = 456;
|
let customHeight = 123, customWidth = 456;
|
||||||
rdm.startResizing({});
|
rdm.startResizing({});
|
||||||
rdm.setSize(customWidth, customHeight);
|
rdm.setViewportSize({
|
||||||
|
width: customWidth,
|
||||||
|
height: customHeight,
|
||||||
|
});
|
||||||
rdm.stopResizing({});
|
rdm.stopResizing({});
|
||||||
|
|
||||||
rdm.addbutton.doCommand();
|
rdm.addbutton.doCommand();
|
||||||
|
@ -13,8 +13,11 @@ let gcliHelpersURI = testDir + "../../../commandline/test/helpers.js";
|
|||||||
Services.scriptloader.loadSubScript(gcliHelpersURI, this);
|
Services.scriptloader.loadSubScript(gcliHelpersURI, this);
|
||||||
|
|
||||||
flags.testing = true;
|
flags.testing = true;
|
||||||
|
Services.prefs.setBoolPref("devtools.responsive.html.enabled", false);
|
||||||
|
|
||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
flags.testing = false;
|
flags.testing = false;
|
||||||
|
Services.prefs.clearUserPref("devtools.responsive.html.enabled");
|
||||||
Services.prefs.clearUserPref("devtools.responsiveUI.currentPreset");
|
Services.prefs.clearUserPref("devtools.responsiveUI.currentPreset");
|
||||||
Services.prefs.clearUserPref("devtools.responsiveUI.customHeight");
|
Services.prefs.clearUserPref("devtools.responsiveUI.customHeight");
|
||||||
Services.prefs.clearUserPref("devtools.responsiveUI.customWidth");
|
Services.prefs.clearUserPref("devtools.responsiveUI.customWidth");
|
||||||
@ -37,7 +40,7 @@ var openRDM = Task.async(function* (tab = gBrowser.selectedTab,
|
|||||||
let manager = ResponsiveUIManager;
|
let manager = ResponsiveUIManager;
|
||||||
|
|
||||||
let opened = once(manager, "on");
|
let opened = once(manager, "on");
|
||||||
let resized = once(manager, "contentResize");
|
let resized = once(manager, "content-resize");
|
||||||
if (method == "menu") {
|
if (method == "menu") {
|
||||||
document.getElementById("menu_responsiveUI").doCommand();
|
document.getElementById("menu_responsiveUI").doCommand();
|
||||||
} else {
|
} else {
|
||||||
@ -68,7 +71,7 @@ var closeRDM = Task.async(function* (rdm) {
|
|||||||
rdm = manager.getResponsiveUIForTab(gBrowser.selectedTab);
|
rdm = manager.getResponsiveUIForTab(gBrowser.selectedTab);
|
||||||
}
|
}
|
||||||
let closed = once(manager, "off");
|
let closed = once(manager, "off");
|
||||||
let resized = once(manager, "contentResize");
|
let resized = once(manager, "content-resize");
|
||||||
rdm.close();
|
rdm.close();
|
||||||
yield resized;
|
yield resized;
|
||||||
yield closed;
|
yield closed;
|
||||||
@ -269,19 +272,19 @@ function waitForResizeTo(manager, width, height) {
|
|||||||
if (data.width != width || data.height != height) {
|
if (data.width != width || data.height != height) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
manager.off("contentResize", onResize);
|
manager.off("content-resize", onResize);
|
||||||
info(`Got contentResize to ${width} x ${height}`);
|
info(`Got content-resize to ${width} x ${height}`);
|
||||||
resolve();
|
resolve();
|
||||||
};
|
};
|
||||||
info(`Waiting for contentResize to ${width} x ${height}`);
|
info(`Waiting for content-resize to ${width} x ${height}`);
|
||||||
manager.on("contentResize", onResize);
|
manager.on("content-resize", onResize);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var setPresetIndex = Task.async(function* (rdm, manager, index) {
|
var setPresetIndex = Task.async(function* (rdm, manager, index) {
|
||||||
info(`Current preset: ${rdm.menulist.selectedIndex}, change to: ${index}`);
|
info(`Current preset: ${rdm.menulist.selectedIndex}, change to: ${index}`);
|
||||||
if (rdm.menulist.selectedIndex != index) {
|
if (rdm.menulist.selectedIndex != index) {
|
||||||
let resized = once(manager, "contentResize");
|
let resized = once(manager, "content-resize");
|
||||||
rdm.menulist.selectedIndex = index;
|
rdm.menulist.selectedIndex = index;
|
||||||
yield resized;
|
yield resized;
|
||||||
}
|
}
|
||||||
@ -293,7 +296,7 @@ var setSize = Task.async(function* (rdm, manager, width, height) {
|
|||||||
`set to: ${width} x ${height}`);
|
`set to: ${width} x ${height}`);
|
||||||
if (size.width != width || size.height != height) {
|
if (size.width != width || size.height != height) {
|
||||||
let resized = waitForResizeTo(manager, width, height);
|
let resized = waitForResizeTo(manager, width, height);
|
||||||
rdm.setSize(width, height);
|
rdm.setViewportSize({ width, height });
|
||||||
yield resized;
|
yield resized;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -88,6 +88,8 @@ function isKeyIn(key, ...keys) {
|
|||||||
* This function is called before the editor has been torn down.
|
* This function is called before the editor has been torn down.
|
||||||
* {Function} destroy:
|
* {Function} destroy:
|
||||||
* Called when the editor is destroyed and has been torn down.
|
* Called when the editor is destroyed and has been torn down.
|
||||||
|
* {Function} contextMenu:
|
||||||
|
* Called when the user triggers a contextmenu event on the input.
|
||||||
* {Object} advanceChars:
|
* {Object} advanceChars:
|
||||||
* This can be either a string or a function.
|
* This can be either a string or a function.
|
||||||
* If it is a string, then if any characters in it are typed,
|
* If it is a string, then if any characters in it are typed,
|
||||||
@ -222,6 +224,7 @@ function InplaceEditor(options, event) {
|
|||||||
this.cssProperties = options.cssProperties;
|
this.cssProperties = options.cssProperties;
|
||||||
this.change = options.change;
|
this.change = options.change;
|
||||||
this.done = options.done;
|
this.done = options.done;
|
||||||
|
this.contextMenu = options.contextMenu;
|
||||||
this.destroy = options.destroy;
|
this.destroy = options.destroy;
|
||||||
this.initial = options.initial ? options.initial : this.elt.textContent;
|
this.initial = options.initial ? options.initial : this.elt.textContent;
|
||||||
this.multiline = options.multiline || false;
|
this.multiline = options.multiline || false;
|
||||||
@ -249,6 +252,7 @@ function InplaceEditor(options, event) {
|
|||||||
this._onInput = this._onInput.bind(this);
|
this._onInput = this._onInput.bind(this);
|
||||||
this._onKeyup = this._onKeyup.bind(this);
|
this._onKeyup = this._onKeyup.bind(this);
|
||||||
this._onAutocompletePopupClick = this._onAutocompletePopupClick.bind(this);
|
this._onAutocompletePopupClick = this._onAutocompletePopupClick.bind(this);
|
||||||
|
this._onContextMenu = this._onContextMenu.bind(this);
|
||||||
|
|
||||||
this._createInput();
|
this._createInput();
|
||||||
|
|
||||||
@ -290,6 +294,7 @@ function InplaceEditor(options, event) {
|
|||||||
this.input.addEventListener("dblclick", this._stopEventPropagation, false);
|
this.input.addEventListener("dblclick", this._stopEventPropagation, false);
|
||||||
this.input.addEventListener("click", this._stopEventPropagation, false);
|
this.input.addEventListener("click", this._stopEventPropagation, false);
|
||||||
this.input.addEventListener("mousedown", this._stopEventPropagation, false);
|
this.input.addEventListener("mousedown", this._stopEventPropagation, false);
|
||||||
|
this.input.addEventListener("contextmenu", this._onContextMenu, false);
|
||||||
this.doc.defaultView.addEventListener("blur", this._onWindowBlur, false);
|
this.doc.defaultView.addEventListener("blur", this._onWindowBlur, false);
|
||||||
|
|
||||||
this.validate = options.validate;
|
this.validate = options.validate;
|
||||||
@ -349,11 +354,10 @@ InplaceEditor.prototype = {
|
|||||||
this.input.removeEventListener("keypress", this._onKeyPress, false);
|
this.input.removeEventListener("keypress", this._onKeyPress, false);
|
||||||
this.input.removeEventListener("keyup", this._onKeyup, false);
|
this.input.removeEventListener("keyup", this._onKeyup, false);
|
||||||
this.input.removeEventListener("input", this._onInput, false);
|
this.input.removeEventListener("input", this._onInput, false);
|
||||||
this.input.removeEventListener("dblclick", this._stopEventPropagation,
|
this.input.removeEventListener("dblclick", this._stopEventPropagation, false);
|
||||||
false);
|
|
||||||
this.input.removeEventListener("click", this._stopEventPropagation, false);
|
this.input.removeEventListener("click", this._stopEventPropagation, false);
|
||||||
this.input.removeEventListener("mousedown", this._stopEventPropagation,
|
this.input.removeEventListener("mousedown", this._stopEventPropagation, false);
|
||||||
false);
|
this.input.removeEventListener("contextmenu", this._onContextMenu, false);
|
||||||
this.doc.defaultView.removeEventListener("blur", this._onWindowBlur, false);
|
this.doc.defaultView.removeEventListener("blur", this._onWindowBlur, false);
|
||||||
|
|
||||||
this._stopAutosize();
|
this._stopAutosize();
|
||||||
@ -1164,6 +1168,12 @@ InplaceEditor.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_onContextMenu: function (event) {
|
||||||
|
if (this.contextMenu) {
|
||||||
|
this.contextMenu(event);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open the autocomplete popup, adding a custom click handler and classname.
|
* Open the autocomplete popup, adding a custom click handler and classname.
|
||||||
*
|
*
|
||||||
|
@ -741,7 +741,7 @@ Heritage.extend(SwatchBasedEditorTooltip.prototype, {
|
|||||||
this.spectrum.updateUI();
|
this.spectrum.updateUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
let {target} = this.inspector.toolbox;
|
let {target} = this.inspector;
|
||||||
target.actorHasMethod("inspector", "pickColorFromPage").then(value => {
|
target.actorHasMethod("inspector", "pickColorFromPage").then(value => {
|
||||||
let tooltipDoc = this.tooltip.doc;
|
let tooltipDoc = this.tooltip.doc;
|
||||||
let eyeButton = tooltipDoc.querySelector("#eyedropper-button");
|
let eyeButton = tooltipDoc.querySelector("#eyedropper-button");
|
||||||
|
@ -961,15 +961,8 @@ StyleEditorUI.prototype = {
|
|||||||
let tab = this._target.tab;
|
let tab = this._target.tab;
|
||||||
let win = this._target.tab.ownerDocument.defaultView;
|
let win = this._target.tab.ownerDocument.defaultView;
|
||||||
|
|
||||||
yield ResponsiveUIManager.runIfNeeded(win, tab);
|
yield ResponsiveUIManager.openIfNeeded(win, tab);
|
||||||
if (options.width && options.height) {
|
ResponsiveUIManager.getResponsiveUIForTab(tab).setViewportSize(options);
|
||||||
ResponsiveUIManager.getResponsiveUIForTab(tab).setSize(options.width,
|
|
||||||
options.height);
|
|
||||||
} else if (options.width) {
|
|
||||||
ResponsiveUIManager.getResponsiveUIForTab(tab).setWidth(options.width);
|
|
||||||
} else if (options.height) {
|
|
||||||
ResponsiveUIManager.getResponsiveUIForTab(tab).setHeight(options.height);
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,6 +56,7 @@ support-files =
|
|||||||
!/devtools/client/inspector/shared/test/head.js
|
!/devtools/client/inspector/shared/test/head.js
|
||||||
!/devtools/client/inspector/test/head.js
|
!/devtools/client/inspector/test/head.js
|
||||||
!/devtools/client/inspector/test/shared-head.js
|
!/devtools/client/inspector/test/shared-head.js
|
||||||
|
!/devtools/client/responsive.html/test/browser/devices.json
|
||||||
!/devtools/client/shared/test/test-actor-registry.js
|
!/devtools/client/shared/test/test-actor-registry.js
|
||||||
!/devtools/client/shared/test/test-actor.js
|
!/devtools/client/shared/test/test-actor.js
|
||||||
|
|
||||||
|
@ -10,9 +10,9 @@ const MEDIA_PREF = "devtools.styleeditor.showMediaSidebar";
|
|||||||
|
|
||||||
const RESIZE = 300;
|
const RESIZE = 300;
|
||||||
const LABELS = ["not all", "all", "(max-width: 400px)",
|
const LABELS = ["not all", "all", "(max-width: 400px)",
|
||||||
"(min-height: 200px) and (max-height: 250px)",
|
"(min-height: 300px) and (max-height: 320px)",
|
||||||
"(max-width: 600px)"];
|
"(max-width: 600px)"];
|
||||||
const LINE_NOS = [1, 7, 19, 25, 30];
|
const LINE_NOS = [1, 7, 19, 25, 31];
|
||||||
const NEW_RULE = "\n@media (max-width: 600px) { div { color: blue; } }";
|
const NEW_RULE = "\n@media (max-width: 600px) { div { color: blue; } }";
|
||||||
|
|
||||||
waitForExplicitFinish();
|
waitForExplicitFinish();
|
||||||
|
@ -7,6 +7,15 @@
|
|||||||
/* Tests responsive mode links for
|
/* Tests responsive mode links for
|
||||||
* @media sidebar width and height related conditions */
|
* @media sidebar width and height related conditions */
|
||||||
|
|
||||||
|
const asyncStorage = require("devtools/shared/async-storage");
|
||||||
|
Services.prefs.setCharPref("devtools.devices.url",
|
||||||
|
"http://example.com/browser/devtools/client/responsive.html/test/browser/devices.json");
|
||||||
|
|
||||||
|
registerCleanupFunction(() => {
|
||||||
|
Services.prefs.clearUserPref("devtools.devices.url");
|
||||||
|
asyncStorage.removeItem("devtools.devices.url_cache");
|
||||||
|
});
|
||||||
|
|
||||||
const mgr = "resource://devtools/client/responsivedesign/responsivedesign.jsm";
|
const mgr = "resource://devtools/client/responsivedesign/responsivedesign.jsm";
|
||||||
const {ResponsiveUIManager} = Cu.import(mgr, {});
|
const {ResponsiveUIManager} = Cu.import(mgr, {});
|
||||||
const TESTCASE_URI = TEST_BASE_HTTPS + "media-rules.html";
|
const TESTCASE_URI = TEST_BASE_HTTPS + "media-rules.html";
|
||||||
@ -21,7 +30,7 @@ add_task(function* () {
|
|||||||
let tab = gBrowser.selectedTab;
|
let tab = gBrowser.selectedTab;
|
||||||
testNumberOfLinks(editor);
|
testNumberOfLinks(editor);
|
||||||
yield testMediaLink(editor, tab, ui, 2, "width", 400);
|
yield testMediaLink(editor, tab, ui, 2, "width", 400);
|
||||||
yield testMediaLink(editor, tab, ui, 3, "height", 200);
|
yield testMediaLink(editor, tab, ui, 3, "height", 300);
|
||||||
|
|
||||||
yield closeRDM(tab, ui);
|
yield closeRDM(tab, ui);
|
||||||
doFinalChecks(editor);
|
doFinalChecks(editor);
|
||||||
@ -47,12 +56,13 @@ function* testMediaLink(editor, tab, ui, itemIndex, type, value) {
|
|||||||
let conditions = sidebar.querySelectorAll(".media-rule-condition");
|
let conditions = sidebar.querySelectorAll(".media-rule-condition");
|
||||||
|
|
||||||
let onMediaChange = once(ui, "media-list-changed");
|
let onMediaChange = once(ui, "media-list-changed");
|
||||||
let onContentResize = waitForResizeTo(ResponsiveUIManager, type, value);
|
|
||||||
|
|
||||||
info("Launching responsive mode");
|
info("Launching responsive mode");
|
||||||
conditions[itemIndex].querySelector(responsiveModeToggleClass).click();
|
conditions[itemIndex].querySelector(responsiveModeToggleClass).click();
|
||||||
|
|
||||||
ResponsiveUIManager.getResponsiveUIForTab(tab).transitionsEnabled = false;
|
let rdmUI = ResponsiveUIManager.getResponsiveUIForTab(tab);
|
||||||
|
let onContentResize = waitForResizeTo(rdmUI, type, value);
|
||||||
|
rdmUI.transitionsEnabled = false;
|
||||||
|
|
||||||
info("Waiting for the @media list to update");
|
info("Waiting for the @media list to update");
|
||||||
yield onMediaChange;
|
yield onMediaChange;
|
||||||
@ -64,14 +74,14 @@ function* testMediaLink(editor, tab, ui, itemIndex, type, value) {
|
|||||||
ok(!conditions[itemIndex].classList.contains("media-condition-unmatched"),
|
ok(!conditions[itemIndex].classList.contains("media-condition-unmatched"),
|
||||||
"media rule should now be matched after responsive mode is active");
|
"media rule should now be matched after responsive mode is active");
|
||||||
|
|
||||||
let dimension = (yield getSizing())[type];
|
let dimension = (yield getSizing(rdmUI))[type];
|
||||||
is(dimension, value, `${type} should be properly set.`);
|
is(dimension, value, `${type} should be properly set.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function* closeRDM(tab, ui) {
|
function* closeRDM(tab, ui) {
|
||||||
info("Closing responsive mode");
|
info("Closing responsive mode");
|
||||||
ResponsiveUIManager.toggle(window, tab);
|
ResponsiveUIManager.toggle(window, tab);
|
||||||
let onMediaChange = once(ui, "media-list-changed");
|
let onMediaChange = waitForNEvents(ui, "media-list-changed", 2);
|
||||||
yield once(ResponsiveUIManager, "off");
|
yield once(ResponsiveUIManager, "off");
|
||||||
yield onMediaChange;
|
yield onMediaChange;
|
||||||
ok(!ResponsiveUIManager.isActiveForTab(tab),
|
ok(!ResponsiveUIManager.isActiveForTab(tab),
|
||||||
@ -89,23 +99,31 @@ function doFinalChecks(editor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Helpers */
|
/* Helpers */
|
||||||
function waitForResizeTo(manager, type, value) {
|
function waitForResizeTo(rdmUI, type, value) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
let onResize = (_, data) => {
|
let onResize = (_, data) => {
|
||||||
if (data[type] != value) {
|
if (data[type] != value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
manager.off("contentResize", onResize);
|
ResponsiveUIManager.off("content-resize", onResize);
|
||||||
info(`Got contentResize to a ${type} of ${value}`);
|
if (rdmUI.off) {
|
||||||
|
rdmUI.off("content-resize", onResize);
|
||||||
|
}
|
||||||
|
info(`Got content-resize to a ${type} of ${value}`);
|
||||||
resolve();
|
resolve();
|
||||||
};
|
};
|
||||||
info(`Waiting for contentResize to a ${type} of ${value}`);
|
info(`Waiting for content-resize to a ${type} of ${value}`);
|
||||||
manager.on("contentResize", onResize);
|
// Old RDM emits on manager
|
||||||
|
ResponsiveUIManager.on("content-resize", onResize);
|
||||||
|
// New RDM emits on ui
|
||||||
|
if (rdmUI.on) {
|
||||||
|
rdmUI.on("content-resize", onResize);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function* getSizing() {
|
function* getSizing(rdmUI) {
|
||||||
let browser = gBrowser.selectedBrowser;
|
let browser = rdmUI.getViewportBrowser();
|
||||||
let sizing = yield ContentTask.spawn(browser, {}, function* () {
|
let sizing = yield ContentTask.spawn(browser, {}, function* () {
|
||||||
return {
|
return {
|
||||||
width: content.innerWidth,
|
width: content.innerWidth,
|
||||||
|
@ -22,8 +22,8 @@ div {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-height: 200px) and (max-height: 250px) {
|
@media (min-height: 300px) and (max-height: 320px) {
|
||||||
div {
|
div {
|
||||||
color: orange;
|
color: orange;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,14 @@
|
|||||||
--eyedropper-image: url(images/firebug/command-eyedropper.svg);
|
--eyedropper-image: url(images/firebug/command-eyedropper.svg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root.theme-light {
|
||||||
|
--breadcrumbs-border-color: #f3f3f3;
|
||||||
|
}
|
||||||
|
|
||||||
|
:root.theme-dark {
|
||||||
|
--breadcrumbs-border-color: #454d5d;
|
||||||
|
}
|
||||||
|
|
||||||
/* Make sure to hide scroll bars for the parent window */
|
/* Make sure to hide scroll bars for the parent window */
|
||||||
window {
|
window {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -117,6 +125,10 @@ window {
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
border-bottom-width: 0px;
|
border-bottom-width: 0px;
|
||||||
border-top-width: 1px;
|
border-top-width: 1px;
|
||||||
|
border-top-color: var(--breadcrumbs-border-color);
|
||||||
|
/* Bug 1262668 - Use the same background as the body so the breadcrumbs toolbar doesn't
|
||||||
|
get mistaken as a splitter */
|
||||||
|
background-color: var(--theme-body-background);
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@
|
|||||||
|
|
||||||
#breadcrumb-separator-after,
|
#breadcrumb-separator-after,
|
||||||
#breadcrumb-separator-before:after {
|
#breadcrumb-separator-before:after {
|
||||||
background: var(--theme-toolbar-background);
|
background: var(--theme-body-background);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This chevron arrow cannot be replicated easily in CSS, so we are using
|
/* This chevron arrow cannot be replicated easily in CSS, so we are using
|
||||||
|
@ -112,13 +112,13 @@ class MachCommands(MachCommandBase):
|
|||||||
destination_path = resolve_path(self.topsrcdir,
|
destination_path = resolve_path(self.topsrcdir,
|
||||||
'devtools/shared/css/generated/properties-db.js')
|
'devtools/shared/css/generated/properties-db.js')
|
||||||
|
|
||||||
with open(js_template_path, 'r') as handle:
|
with open(js_template_path, 'rb') as handle:
|
||||||
js_template = handle.read()
|
js_template = handle.read()
|
||||||
|
|
||||||
preamble = '/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */\n\n'
|
preamble = '/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */\n\n'
|
||||||
contents = string.Template(js_template).substitute(substitutions)
|
contents = string.Template(js_template).substitute(substitutions)
|
||||||
|
|
||||||
with open(destination_path, 'w') as destination:
|
with open(destination_path, 'wb') as destination:
|
||||||
destination.write(preamble + contents)
|
destination.write(preamble + contents)
|
||||||
|
|
||||||
print('The database was successfully generated at ' + destination_path)
|
print('The database was successfully generated at ' + destination_path)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -308,8 +308,7 @@ ContentEventHandler::Init(WidgetQueryContentEvent* aEvent)
|
|||||||
} else {
|
} else {
|
||||||
LineBreakType lineBreakType = GetLineBreakType(aEvent);
|
LineBreakType lineBreakType = GetLineBreakType(aEvent);
|
||||||
uint32_t selectionStart = 0;
|
uint32_t selectionStart = 0;
|
||||||
rv = GetFlatTextLengthBefore(mFirstSelectedRange,
|
rv = GetStartOffset(mFirstSelectedRange, &selectionStart, lineBreakType);
|
||||||
&selectionStart, lineBreakType);
|
|
||||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
@ -1309,8 +1308,8 @@ ContentEventHandler::OnQuerySelectedText(WidgetQueryContentEvent* aEvent)
|
|||||||
"The reply string must be empty");
|
"The reply string must be empty");
|
||||||
|
|
||||||
LineBreakType lineBreakType = GetLineBreakType(aEvent);
|
LineBreakType lineBreakType = GetLineBreakType(aEvent);
|
||||||
rv = GetFlatTextLengthBefore(mFirstSelectedRange,
|
rv = GetStartOffset(mFirstSelectedRange,
|
||||||
&aEvent->mReply.mOffset, lineBreakType);
|
&aEvent->mReply.mOffset, lineBreakType);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCOMPtr<nsINode> anchorNode, focusNode;
|
nsCOMPtr<nsINode> anchorNode, focusNode;
|
||||||
@ -2440,8 +2439,8 @@ ContentEventHandler::OnQueryCaretRect(WidgetQueryContentEvent* aEvent)
|
|||||||
nsIFrame* caretFrame = nsCaret::GetGeometry(mSelection, &caretRect);
|
nsIFrame* caretFrame = nsCaret::GetGeometry(mSelection, &caretRect);
|
||||||
if (caretFrame) {
|
if (caretFrame) {
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
rv = GetFlatTextLengthBefore(mFirstSelectedRange,
|
rv = GetStartOffset(mFirstSelectedRange,
|
||||||
&offset, GetLineBreakType(aEvent));
|
&offset, GetLineBreakType(aEvent));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
if (offset == aEvent->mInput.mOffset) {
|
if (offset == aEvent->mInput.mOffset) {
|
||||||
rv = ConvertToRootRelativeOffset(caretFrame, caretRect);
|
rv = ConvertToRootRelativeOffset(caretFrame, caretRect);
|
||||||
@ -2698,6 +2697,10 @@ ContentEventHandler::GetFlatTextLengthInRange(
|
|||||||
// destroying without initializing causes unexpected NS_ASSERTION() call.
|
// destroying without initializing causes unexpected NS_ASSERTION() call.
|
||||||
nsCOMPtr<nsIContentIterator> iter;
|
nsCOMPtr<nsIContentIterator> iter;
|
||||||
|
|
||||||
|
// Working with ContentIterator, we may need to adjust the end position for
|
||||||
|
// including it forcibly.
|
||||||
|
NodePosition endPosition(aEndPosition);
|
||||||
|
|
||||||
// This may be called for retrieving the text of removed nodes. Even in this
|
// This may be called for retrieving the text of removed nodes. Even in this
|
||||||
// case, the node thinks it's still in the tree because UnbindFromTree() will
|
// case, the node thinks it's still in the tree because UnbindFromTree() will
|
||||||
// be called after here. However, the node was already removed from the
|
// be called after here. However, the node was already removed from the
|
||||||
@ -2707,12 +2710,12 @@ ContentEventHandler::GetFlatTextLengthInRange(
|
|||||||
MOZ_ASSERT(parent && parent->IndexOf(aStartPosition.mNode) == -1,
|
MOZ_ASSERT(parent && parent->IndexOf(aStartPosition.mNode) == -1,
|
||||||
"At removing the node, the node shouldn't be in the array of children "
|
"At removing the node, the node shouldn't be in the array of children "
|
||||||
"of its parent");
|
"of its parent");
|
||||||
MOZ_ASSERT(aStartPosition.mNode == aEndPosition.mNode,
|
MOZ_ASSERT(aStartPosition.mNode == endPosition.mNode,
|
||||||
"At removing the node, start and end node should be same");
|
"At removing the node, start and end node should be same");
|
||||||
MOZ_ASSERT(aStartPosition.mOffset == 0,
|
MOZ_ASSERT(aStartPosition.mOffset == 0,
|
||||||
"When the node is being removed, the start offset should be 0");
|
"When the node is being removed, the start offset should be 0");
|
||||||
MOZ_ASSERT(static_cast<uint32_t>(aEndPosition.mOffset) ==
|
MOZ_ASSERT(static_cast<uint32_t>(endPosition.mOffset) ==
|
||||||
aEndPosition.mNode->GetChildCount(),
|
endPosition.mNode->GetChildCount(),
|
||||||
"When the node is being removed, the end offset should be child count");
|
"When the node is being removed, the end offset should be child count");
|
||||||
iter = NS_NewPreContentIterator();
|
iter = NS_NewPreContentIterator();
|
||||||
nsresult rv = iter->Init(aStartPosition.mNode);
|
nsresult rv = iter->Init(aStartPosition.mNode);
|
||||||
@ -2728,31 +2731,28 @@ ContentEventHandler::GetFlatTextLengthInRange(
|
|||||||
|
|
||||||
// When the end position is immediately after non-root element's open tag,
|
// When the end position is immediately after non-root element's open tag,
|
||||||
// we need to include a line break caused by the open tag.
|
// we need to include a line break caused by the open tag.
|
||||||
NodePosition endPosition;
|
if (endPosition.mNode != aRootContent &&
|
||||||
if (aEndPosition.mNode != aRootContent &&
|
endPosition.IsImmediatelyAfterOpenTag()) {
|
||||||
aEndPosition.IsImmediatelyAfterOpenTag()) {
|
if (endPosition.mNode->HasChildren()) {
|
||||||
if (aEndPosition.mNode->HasChildren()) {
|
// When the end node has some children, move the end position to before
|
||||||
// When the end node has some children, move the end position to the
|
// the open tag of its first child.
|
||||||
// start of its first child.
|
nsINode* firstChild = endPosition.mNode->GetFirstChild();
|
||||||
nsINode* firstChild = aEndPosition.mNode->GetFirstChild();
|
|
||||||
if (NS_WARN_IF(!firstChild)) {
|
if (NS_WARN_IF(!firstChild)) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
endPosition = NodePosition(firstChild, 0);
|
endPosition = NodePositionBefore(firstChild, 0);
|
||||||
} else {
|
} else {
|
||||||
// When the end node is empty, move the end position after the node.
|
// When the end node is empty, move the end position after the node.
|
||||||
nsIContent* parentContent = aEndPosition.mNode->GetParent();
|
nsIContent* parentContent = endPosition.mNode->GetParent();
|
||||||
if (NS_WARN_IF(!parentContent)) {
|
if (NS_WARN_IF(!parentContent)) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
int32_t indexInParent = parentContent->IndexOf(aEndPosition.mNode);
|
int32_t indexInParent = parentContent->IndexOf(endPosition.mNode);
|
||||||
if (NS_WARN_IF(indexInParent < 0)) {
|
if (NS_WARN_IF(indexInParent < 0)) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
endPosition = NodePosition(parentContent, indexInParent + 1);
|
endPosition = NodePositionBefore(parentContent, indexInParent + 1);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
endPosition = aEndPosition;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (endPosition.OffsetIsValid()) {
|
if (endPosition.OffsetIsValid()) {
|
||||||
@ -2800,9 +2800,9 @@ ContentEventHandler::GetFlatTextLengthInRange(
|
|||||||
|
|
||||||
if (node->IsNodeOfType(nsINode::eTEXT)) {
|
if (node->IsNodeOfType(nsINode::eTEXT)) {
|
||||||
// Note: our range always starts from offset 0
|
// Note: our range always starts from offset 0
|
||||||
if (node == aEndPosition.mNode) {
|
if (node == endPosition.mNode) {
|
||||||
*aLength += GetTextLength(content, aLineBreakType,
|
*aLength += GetTextLength(content, aLineBreakType,
|
||||||
aEndPosition.mOffset);
|
endPosition.mOffset);
|
||||||
} else {
|
} else {
|
||||||
*aLength += GetTextLength(content, aLineBreakType);
|
*aLength += GetTextLength(content, aLineBreakType);
|
||||||
}
|
}
|
||||||
@ -2812,6 +2812,11 @@ ContentEventHandler::GetFlatTextLengthInRange(
|
|||||||
if (node == aStartPosition.mNode && !aStartPosition.IsBeforeOpenTag()) {
|
if (node == aStartPosition.mNode && !aStartPosition.IsBeforeOpenTag()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// If the end position is before the open tag, don't append the line
|
||||||
|
// break length.
|
||||||
|
if (node == endPosition.mNode && endPosition.IsBeforeOpenTag()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
*aLength += GetBRLength(aLineBreakType);
|
*aLength += GetBRLength(aLineBreakType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2819,14 +2824,14 @@ ContentEventHandler::GetFlatTextLengthInRange(
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
ContentEventHandler::GetFlatTextLengthBefore(nsRange* aRange,
|
ContentEventHandler::GetStartOffset(nsRange* aRange,
|
||||||
uint32_t* aOffset,
|
uint32_t* aOffset,
|
||||||
LineBreakType aLineBreakType)
|
LineBreakType aLineBreakType)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aRange);
|
MOZ_ASSERT(aRange);
|
||||||
return GetFlatTextLengthInRange(
|
return GetFlatTextLengthInRange(
|
||||||
NodePosition(mRootContent, 0),
|
NodePosition(mRootContent, 0),
|
||||||
NodePositionBefore(aRange->GetStartParent(), aRange->StartOffset()),
|
NodePosition(aRange->GetStartParent(), aRange->StartOffset()),
|
||||||
mRootContent, aOffset, aLineBreakType);
|
mRootContent, aOffset, aLineBreakType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,10 +252,12 @@ protected:
|
|||||||
nsresult GenerateFlatTextContent(nsRange* aRange,
|
nsresult GenerateFlatTextContent(nsRange* aRange,
|
||||||
nsAFlatString& aString,
|
nsAFlatString& aString,
|
||||||
LineBreakType aLineBreakType);
|
LineBreakType aLineBreakType);
|
||||||
// Get the text length before the start position of aRange.
|
// Get offset of start of aRange. Note that the result includes the length
|
||||||
nsresult GetFlatTextLengthBefore(nsRange* aRange,
|
// of line breaker caused by the start of aContent because aRange never
|
||||||
uint32_t* aOffset,
|
// includes the line breaker caused by its start node.
|
||||||
LineBreakType aLineBreakType);
|
nsresult GetStartOffset(nsRange* aRange,
|
||||||
|
uint32_t* aOffset,
|
||||||
|
LineBreakType aLineBreakType);
|
||||||
// Check if we should insert a line break before aContent.
|
// Check if we should insert a line break before aContent.
|
||||||
// This should return false only when aContent is an html element which
|
// This should return false only when aContent is an html element which
|
||||||
// is typically used in a paragraph like <em>.
|
// is typically used in a paragraph like <em>.
|
||||||
|
@ -1514,16 +1514,16 @@ nsGenericHTMLElement::MapImageBorderAttributeInto(const nsMappedAttributes* aAtt
|
|||||||
|
|
||||||
nsCSSValue* borderLeftColor = aData->ValueForBorderLeftColor();
|
nsCSSValue* borderLeftColor = aData->ValueForBorderLeftColor();
|
||||||
if (borderLeftColor->GetUnit() == eCSSUnit_Null)
|
if (borderLeftColor->GetUnit() == eCSSUnit_Null)
|
||||||
borderLeftColor->SetIntValue(NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR, eCSSUnit_Enumerated);
|
borderLeftColor->SetIntValue(NS_COLOR_CURRENTCOLOR, eCSSUnit_EnumColor);
|
||||||
nsCSSValue* borderTopColor = aData->ValueForBorderTopColor();
|
nsCSSValue* borderTopColor = aData->ValueForBorderTopColor();
|
||||||
if (borderTopColor->GetUnit() == eCSSUnit_Null)
|
if (borderTopColor->GetUnit() == eCSSUnit_Null)
|
||||||
borderTopColor->SetIntValue(NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR, eCSSUnit_Enumerated);
|
borderTopColor->SetIntValue(NS_COLOR_CURRENTCOLOR, eCSSUnit_EnumColor);
|
||||||
nsCSSValue* borderRightColor = aData->ValueForBorderRightColor();
|
nsCSSValue* borderRightColor = aData->ValueForBorderRightColor();
|
||||||
if (borderRightColor->GetUnit() == eCSSUnit_Null)
|
if (borderRightColor->GetUnit() == eCSSUnit_Null)
|
||||||
borderRightColor->SetIntValue(NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR, eCSSUnit_Enumerated);
|
borderRightColor->SetIntValue(NS_COLOR_CURRENTCOLOR, eCSSUnit_EnumColor);
|
||||||
nsCSSValue* borderBottomColor = aData->ValueForBorderBottomColor();
|
nsCSSValue* borderBottomColor = aData->ValueForBorderBottomColor();
|
||||||
if (borderBottomColor->GetUnit() == eCSSUnit_Null)
|
if (borderBottomColor->GetUnit() == eCSSUnit_Null)
|
||||||
borderBottomColor->SetIntValue(NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR, eCSSUnit_Enumerated);
|
borderBottomColor->SetIntValue(NS_COLOR_CURRENTCOLOR, eCSSUnit_EnumColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -499,7 +499,6 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
|
|||||||
, mVideoFrameContainer(aOwner->GetVideoFrameContainer())
|
, mVideoFrameContainer(aOwner->GetVideoFrameContainer())
|
||||||
, mPlaybackStatistics(new MediaChannelStatistics())
|
, mPlaybackStatistics(new MediaChannelStatistics())
|
||||||
, mPinnedForSeek(false)
|
, mPinnedForSeek(false)
|
||||||
, mPausedForPlaybackRateNull(false)
|
|
||||||
, mMinimizePreroll(false)
|
, mMinimizePreroll(false)
|
||||||
, mMediaTracksConstructed(false)
|
, mMediaTracksConstructed(false)
|
||||||
, mFiredMetadataLoaded(false)
|
, mFiredMetadataLoaded(false)
|
||||||
@ -794,7 +793,7 @@ MediaDecoder::Play()
|
|||||||
UpdateDormantState(false /* aDormantTimeout */, true /* aActivity */);
|
UpdateDormantState(false /* aDormantTimeout */, true /* aActivity */);
|
||||||
|
|
||||||
NS_ASSERTION(mDecoderStateMachine != nullptr, "Should have state machine.");
|
NS_ASSERTION(mDecoderStateMachine != nullptr, "Should have state machine.");
|
||||||
if (mPausedForPlaybackRateNull) {
|
if (mPlaybackRate == 0) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1522,21 +1521,19 @@ void
|
|||||||
MediaDecoder::SetPlaybackRate(double aPlaybackRate)
|
MediaDecoder::SetPlaybackRate(double aPlaybackRate)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
|
double oldRate = mPlaybackRate;
|
||||||
mPlaybackRate = aPlaybackRate;
|
mPlaybackRate = aPlaybackRate;
|
||||||
if (mPlaybackRate == 0.0) {
|
if (aPlaybackRate == 0) {
|
||||||
mPausedForPlaybackRateNull = true;
|
|
||||||
Pause();
|
Pause();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mPausedForPlaybackRateNull) {
|
|
||||||
// Play() uses mPausedForPlaybackRateNull value, so must reset it first
|
if (oldRate == 0 && !mOwner->GetPaused()) {
|
||||||
mPausedForPlaybackRateNull = false;
|
// PlaybackRate is no longer null.
|
||||||
// If the playbackRate is no longer null, restart the playback, iff the
|
// Restart the playback if the media was playing.
|
||||||
// media was playing.
|
Play();
|
||||||
if (!mOwner->GetPaused()) {
|
|
||||||
Play();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mDecoderStateMachine) {
|
if (mDecoderStateMachine) {
|
||||||
|
@ -676,9 +676,6 @@ protected:
|
|||||||
// while seeking.
|
// while seeking.
|
||||||
bool mPinnedForSeek;
|
bool mPinnedForSeek;
|
||||||
|
|
||||||
// True if the playback is paused because the playback rate member is 0.0.
|
|
||||||
bool mPausedForPlaybackRateNull;
|
|
||||||
|
|
||||||
// Be assigned from media element during the initialization and pass to
|
// Be assigned from media element during the initialization and pass to
|
||||||
// AudioStream Class.
|
// AudioStream Class.
|
||||||
dom::AudioChannel mAudioChannel;
|
dom::AudioChannel mAudioChannel;
|
||||||
|
@ -907,28 +907,6 @@ MediaDecoderStateMachine::GetDecodedAudioDuration()
|
|||||||
return AudioQueue().Duration();
|
return AudioQueue().Duration();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaDecoderStateMachine::DiscardStreamData()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(OnTaskQueue());
|
|
||||||
|
|
||||||
const auto clockTime = GetClock();
|
|
||||||
while (true) {
|
|
||||||
RefPtr<MediaData> a = AudioQueue().PeekFront();
|
|
||||||
|
|
||||||
// If we discard audio samples fed to the stream immediately, we will
|
|
||||||
// keep decoding audio samples till the end and consume a lot of memory.
|
|
||||||
// Therefore we only discard those behind the stream clock to throttle
|
|
||||||
// the decoding speed.
|
|
||||||
// Note we don't discard a sample when |a->mTime == clockTime| because that
|
|
||||||
// will discard the 1st sample when clockTime is still 0.
|
|
||||||
if (a && a->mTime < clockTime) {
|
|
||||||
RefPtr<MediaData> releaseMe = AudioQueue().PopFront();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MediaDecoderStateMachine::HaveEnoughDecodedAudio()
|
bool MediaDecoderStateMachine::HaveEnoughDecodedAudio()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(OnTaskQueue());
|
MOZ_ASSERT(OnTaskQueue());
|
||||||
@ -2644,10 +2622,6 @@ MediaDecoderStateMachine::UpdatePlaybackPositionPeriodically()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mAudioCaptured) {
|
|
||||||
DiscardStreamData();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cap the current time to the larger of the audio and video end time.
|
// Cap the current time to the larger of the audio and video end time.
|
||||||
// This ensures that if we're running off the system clock, we don't
|
// This ensures that if we're running off the system clock, we don't
|
||||||
// advance the clock to after the media end time.
|
// advance the clock to after the media end time.
|
||||||
|
@ -333,8 +333,6 @@ private:
|
|||||||
// request is discarded.
|
// request is discarded.
|
||||||
void ScheduleStateMachineIn(int64_t aMicroseconds);
|
void ScheduleStateMachineIn(int64_t aMicroseconds);
|
||||||
|
|
||||||
// Discard audio/video data that are already played by MSG.
|
|
||||||
void DiscardStreamData();
|
|
||||||
bool HaveEnoughDecodedAudio();
|
bool HaveEnoughDecodedAudio();
|
||||||
bool HaveEnoughDecodedVideo();
|
bool HaveEnoughDecodedVideo();
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ public:
|
|||||||
MozPromiseHolder<GenericPromise>&& aPromise)
|
MozPromiseHolder<GenericPromise>&& aPromise)
|
||||||
: mMutex("DecodedStreamGraphListener::mMutex")
|
: mMutex("DecodedStreamGraphListener::mMutex")
|
||||||
, mStream(aStream)
|
, mStream(aStream)
|
||||||
, mLastOutputTime(aStream->StreamTimeToMicroseconds(aStream->GetCurrentTime()))
|
|
||||||
{
|
{
|
||||||
mFinishPromise = Move(aPromise);
|
mFinishPromise = Move(aPromise);
|
||||||
}
|
}
|
||||||
@ -45,8 +44,9 @@ public:
|
|||||||
{
|
{
|
||||||
MutexAutoLock lock(mMutex);
|
MutexAutoLock lock(mMutex);
|
||||||
if (mStream) {
|
if (mStream) {
|
||||||
mLastOutputTime = mStream->StreamTimeToMicroseconds(
|
int64_t t = mStream->StreamTimeToMicroseconds(
|
||||||
mStream->GraphTimeToStreamTime(aCurrentTime));
|
mStream->GraphTimeToStreamTime(aCurrentTime));
|
||||||
|
mOnOutput.Notify(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,12 +64,6 @@ public:
|
|||||||
mFinishPromise.ResolveIfExists(true, __func__);
|
mFinishPromise.ResolveIfExists(true, __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t GetLastOutputTime()
|
|
||||||
{
|
|
||||||
MutexAutoLock lock(mMutex);
|
|
||||||
return mLastOutputTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Forget()
|
void Forget()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
@ -78,11 +72,17 @@ public:
|
|||||||
mStream = nullptr;
|
mStream = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MediaEventSource<int64_t>& OnOutput()
|
||||||
|
{
|
||||||
|
return mOnOutput;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
MediaEventProducer<int64_t> mOnOutput;
|
||||||
|
|
||||||
Mutex mMutex;
|
Mutex mMutex;
|
||||||
// Members below are protected by mMutex.
|
// Members below are protected by mMutex.
|
||||||
RefPtr<MediaStream> mStream;
|
RefPtr<MediaStream> mStream;
|
||||||
int64_t mLastOutputTime; // microseconds
|
|
||||||
// Main thread only.
|
// Main thread only.
|
||||||
MozPromiseHolder<GenericPromise> mFinishPromise;
|
MozPromiseHolder<GenericPromise> mFinishPromise;
|
||||||
};
|
};
|
||||||
@ -121,8 +121,8 @@ public:
|
|||||||
PlaybackInfoInit&& aInit,
|
PlaybackInfoInit&& aInit,
|
||||||
MozPromiseHolder<GenericPromise>&& aPromise);
|
MozPromiseHolder<GenericPromise>&& aPromise);
|
||||||
~DecodedStreamData();
|
~DecodedStreamData();
|
||||||
int64_t GetPosition() const;
|
|
||||||
void SetPlaying(bool aPlaying);
|
void SetPlaying(bool aPlaying);
|
||||||
|
MediaEventSource<int64_t>& OnOutput();
|
||||||
|
|
||||||
/* The following group of fields are protected by the decoder's monitor
|
/* The following group of fields are protected by the decoder's monitor
|
||||||
* and can be read or written on any thread.
|
* and can be read or written on any thread.
|
||||||
@ -192,10 +192,10 @@ DecodedStreamData::~DecodedStreamData()
|
|||||||
mStream->Destroy();
|
mStream->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t
|
MediaEventSource<int64_t>&
|
||||||
DecodedStreamData::GetPosition() const
|
DecodedStreamData::OnOutput()
|
||||||
{
|
{
|
||||||
return mListener->GetLastOutputTime();
|
return mListener->OnOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -266,6 +266,7 @@ DecodedStream::Start(int64_t aStartTime, const MediaInfo& aInfo)
|
|||||||
MOZ_ASSERT(mStartTime.isNothing(), "playback already started.");
|
MOZ_ASSERT(mStartTime.isNothing(), "playback already started.");
|
||||||
|
|
||||||
mStartTime.emplace(aStartTime);
|
mStartTime.emplace(aStartTime);
|
||||||
|
mLastOutputTime = 0;
|
||||||
mInfo = aInfo;
|
mInfo = aInfo;
|
||||||
mPlaying = true;
|
mPlaying = true;
|
||||||
ConnectListener();
|
ConnectListener();
|
||||||
@ -314,6 +315,8 @@ DecodedStream::Start(int64_t aStartTime, const MediaInfo& aInfo)
|
|||||||
mData = static_cast<R*>(r.get())->ReleaseData();
|
mData = static_cast<R*>(r.get())->ReleaseData();
|
||||||
|
|
||||||
if (mData) {
|
if (mData) {
|
||||||
|
mOutputListener = mData->OnOutput().Connect(
|
||||||
|
mOwnerThread, this, &DecodedStream::NotifyOutput);
|
||||||
mData->SetPlaying(mPlaying);
|
mData->SetPlaying(mPlaying);
|
||||||
SendData();
|
SendData();
|
||||||
}
|
}
|
||||||
@ -357,6 +360,8 @@ DecodedStream::DestroyData(UniquePtr<DecodedStreamData> aData)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mOutputListener.Disconnect();
|
||||||
|
|
||||||
DecodedStreamData* data = aData.release();
|
DecodedStreamData* data = aData.release();
|
||||||
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([=] () {
|
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([=] () {
|
||||||
delete data;
|
delete data;
|
||||||
@ -691,7 +696,21 @@ DecodedStream::GetPosition(TimeStamp* aTimeStamp) const
|
|||||||
if (aTimeStamp) {
|
if (aTimeStamp) {
|
||||||
*aTimeStamp = TimeStamp::Now();
|
*aTimeStamp = TimeStamp::Now();
|
||||||
}
|
}
|
||||||
return mStartTime.ref() + (mData ? mData->GetPosition() : 0);
|
return mStartTime.ref() + mLastOutputTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
DecodedStream::NotifyOutput(int64_t aTime)
|
||||||
|
{
|
||||||
|
AssertOwnerThread();
|
||||||
|
mLastOutputTime = aTime;
|
||||||
|
|
||||||
|
// Remove audio samples that have been played by MSG from the queue.
|
||||||
|
RefPtr<MediaData> a = mAudioQueue.PeekFront();
|
||||||
|
for (; a && a->mTime < aTime;) {
|
||||||
|
RefPtr<MediaData> releaseMe = mAudioQueue.PopFront();
|
||||||
|
a = mAudioQueue.PeekFront();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -72,6 +72,7 @@ private:
|
|||||||
void SendAudio(double aVolume, bool aIsSameOrigin, const PrincipalHandle& aPrincipalHandle);
|
void SendAudio(double aVolume, bool aIsSameOrigin, const PrincipalHandle& aPrincipalHandle);
|
||||||
void SendVideo(bool aIsSameOrigin, const PrincipalHandle& aPrincipalHandle);
|
void SendVideo(bool aIsSameOrigin, const PrincipalHandle& aPrincipalHandle);
|
||||||
void SendData();
|
void SendData();
|
||||||
|
void NotifyOutput(int64_t aTime);
|
||||||
|
|
||||||
void AssertOwnerThread() const {
|
void AssertOwnerThread() const {
|
||||||
MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
|
MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
|
||||||
@ -101,6 +102,7 @@ private:
|
|||||||
PlaybackParams mParams;
|
PlaybackParams mParams;
|
||||||
|
|
||||||
Maybe<int64_t> mStartTime;
|
Maybe<int64_t> mStartTime;
|
||||||
|
int64_t mLastOutputTime = 0; // microseconds
|
||||||
MediaInfo mInfo;
|
MediaInfo mInfo;
|
||||||
|
|
||||||
MediaQueue<MediaData>& mAudioQueue;
|
MediaQueue<MediaData>& mAudioQueue;
|
||||||
@ -110,6 +112,7 @@ private:
|
|||||||
MediaEventListener mVideoPushListener;
|
MediaEventListener mVideoPushListener;
|
||||||
MediaEventListener mAudioFinishListener;
|
MediaEventListener mAudioFinishListener;
|
||||||
MediaEventListener mVideoFinishListener;
|
MediaEventListener mVideoFinishListener;
|
||||||
|
MediaEventListener mOutputListener;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
@ -1141,8 +1141,17 @@ _dwrite_draw_glyphs_to_gdi_surface_gdi(cairo_win32_surface_t *surface,
|
|||||||
IDWriteBitmapRenderTarget *rt;
|
IDWriteBitmapRenderTarget *rt;
|
||||||
HRESULT rv;
|
HRESULT rv;
|
||||||
|
|
||||||
|
cairo_d2d_surface_t::TextRenderingState renderingState =
|
||||||
|
scaled_font->rendering_mode;
|
||||||
|
|
||||||
|
if ((renderingState == cairo_d2d_surface_t::TEXT_RENDERING_NORMAL ||
|
||||||
|
renderingState == cairo_d2d_surface_t::TEXT_RENDERING_GDI_CLASSIC) &&
|
||||||
|
!surface->base.permit_subpixel_antialiasing) {
|
||||||
|
renderingState = cairo_d2d_surface_t::TEXT_RENDERING_NO_CLEARTYPE;
|
||||||
|
}
|
||||||
|
|
||||||
IDWriteRenderingParams *params =
|
IDWriteRenderingParams *params =
|
||||||
DWriteFactory::RenderingParams(scaled_font->rendering_mode);
|
DWriteFactory::RenderingParams(renderingState);
|
||||||
|
|
||||||
rv = gdiInterop->CreateBitmapRenderTarget(surface->dc,
|
rv = gdiInterop->CreateBitmapRenderTarget(surface->dc,
|
||||||
area.right - area.left,
|
area.right - area.left,
|
||||||
@ -1174,7 +1183,7 @@ _dwrite_draw_glyphs_to_gdi_surface_gdi(cairo_win32_surface_t *surface,
|
|||||||
area.left, area.top,
|
area.left, area.top,
|
||||||
SRCCOPY | NOMIRRORBITMAP);
|
SRCCOPY | NOMIRRORBITMAP);
|
||||||
DWRITE_MEASURING_MODE measureMode;
|
DWRITE_MEASURING_MODE measureMode;
|
||||||
switch (scaled_font->rendering_mode) {
|
switch (renderingState) {
|
||||||
case cairo_d2d_surface_t::TEXT_RENDERING_GDI_CLASSIC:
|
case cairo_d2d_surface_t::TEXT_RENDERING_GDI_CLASSIC:
|
||||||
case cairo_d2d_surface_t::TEXT_RENDERING_NO_CLEARTYPE:
|
case cairo_d2d_surface_t::TEXT_RENDERING_NO_CLEARTYPE:
|
||||||
measureMode = DWRITE_MEASURING_MODE_GDI_CLASSIC;
|
measureMode = DWRITE_MEASURING_MODE_GDI_CLASSIC;
|
||||||
@ -1277,8 +1286,7 @@ _cairo_dwrite_show_glyphs_on_surface(void *surface,
|
|||||||
|
|
||||||
/* We can only handle operator SOURCE or OVER with the destination
|
/* We can only handle operator SOURCE or OVER with the destination
|
||||||
* having no alpha */
|
* having no alpha */
|
||||||
if ((op != CAIRO_OPERATOR_SOURCE && op != CAIRO_OPERATOR_OVER) ||
|
if (op != CAIRO_OPERATOR_SOURCE && op != CAIRO_OPERATOR_OVER)
|
||||||
(dst->format != CAIRO_FORMAT_RGB24))
|
|
||||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||||
|
|
||||||
/* If we have a fallback mask clip set on the dst, we have
|
/* If we have a fallback mask clip set on the dst, we have
|
||||||
|
@ -132,9 +132,23 @@ ContentClientBasic::CreateBuffer(ContentType aType,
|
|||||||
gfxDevCrash(LogReason::AlphaWithBasicClient) << "Asking basic content client for component alpha";
|
gfxDevCrash(LogReason::AlphaWithBasicClient) << "Asking basic content client for component alpha";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IntSize size(aRect.width, aRect.height);
|
||||||
|
#ifdef XP_WIN
|
||||||
|
if (mBackend == BackendType::CAIRO &&
|
||||||
|
(aType == gfxContentType::COLOR || aType == gfxContentType::COLOR_ALPHA)) {
|
||||||
|
RefPtr<gfxASurface> surf =
|
||||||
|
new gfxWindowsSurface(size, aType == gfxContentType::COLOR ? gfxImageFormat::X8R8G8B8_UINT32 :
|
||||||
|
gfxImageFormat::A8R8G8B8_UINT32);
|
||||||
|
*aBlackDT = gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(surf, size);
|
||||||
|
|
||||||
|
if (*aBlackDT) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
*aBlackDT = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend(
|
*aBlackDT = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend(
|
||||||
mBackend,
|
mBackend, size,
|
||||||
IntSize(aRect.width, aRect.height),
|
|
||||||
gfxPlatform::GetPlatform()->Optimal2DFormatForContent(aType));
|
gfxPlatform::GetPlatform()->Optimal2DFormatForContent(aType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,20 +40,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(OVR_ALIGNAS)
|
#if !defined(OVR_ALIGNAS)
|
||||||
#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 408) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L))
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
#define OVR_ALIGNAS(n) alignas(n)
|
|
||||||
#elif defined(__clang__) && !defined(__APPLE__) && (((__clang_major__ * 100) + __clang_minor__) >= 300) && (__cplusplus >= 201103L)
|
|
||||||
#define OVR_ALIGNAS(n) alignas(n)
|
|
||||||
#elif defined(__clang__) && defined(__APPLE__) && (((__clang_major__ * 100) + __clang_minor__) >= 401) && (__cplusplus >= 201103L)
|
|
||||||
#define OVR_ALIGNAS(n) alignas(n)
|
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1900)
|
|
||||||
#define OVR_ALIGNAS(n) alignas(n)
|
|
||||||
#elif defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 408)
|
|
||||||
#define OVR_ALIGNAS(n) alignas(n)
|
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
|
||||||
#define OVR_ALIGNAS(n) __attribute__((aligned(n)))
|
#define OVR_ALIGNAS(n) __attribute__((aligned(n)))
|
||||||
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
|
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
|
||||||
#define OVR_ALIGNAS(n) __declspec(align(n))
|
#define OVR_ALIGNAS(n) __declspec(align(n))
|
||||||
|
#elif defined(__CC_ARM)
|
||||||
|
#define OVR_ALIGNAS(n) __align(n)
|
||||||
#else
|
#else
|
||||||
#error Need to define OVR_ALIGNAS
|
#error Need to define OVR_ALIGNAS
|
||||||
#endif
|
#endif
|
||||||
|
@ -3907,7 +3907,7 @@ BuildTypeName(JSContext* cx, JSObject* typeObj_)
|
|||||||
// of the rules for building C type declarations can be found at:
|
// of the rules for building C type declarations can be found at:
|
||||||
// http://unixwiz.net/techtips/reading-cdecl.html
|
// http://unixwiz.net/techtips/reading-cdecl.html
|
||||||
TypeCode prevGrouping = CType::GetTypeCode(typeObj), currentGrouping;
|
TypeCode prevGrouping = CType::GetTypeCode(typeObj), currentGrouping;
|
||||||
while (1) {
|
while (true) {
|
||||||
currentGrouping = CType::GetTypeCode(typeObj);
|
currentGrouping = CType::GetTypeCode(typeObj);
|
||||||
switch (currentGrouping) {
|
switch (currentGrouping) {
|
||||||
case TYPE_pointer: {
|
case TYPE_pointer: {
|
||||||
|
@ -452,7 +452,7 @@ class ParseNode
|
|||||||
: pn_type(kind),
|
: pn_type(kind),
|
||||||
pn_op(op),
|
pn_op(op),
|
||||||
pn_arity(arity),
|
pn_arity(arity),
|
||||||
pn_parens(0),
|
pn_parens(false),
|
||||||
pn_pos(0, 0),
|
pn_pos(0, 0),
|
||||||
pn_next(nullptr)
|
pn_next(nullptr)
|
||||||
{
|
{
|
||||||
@ -464,7 +464,7 @@ class ParseNode
|
|||||||
: pn_type(kind),
|
: pn_type(kind),
|
||||||
pn_op(op),
|
pn_op(op),
|
||||||
pn_arity(arity),
|
pn_arity(arity),
|
||||||
pn_parens(0),
|
pn_parens(false),
|
||||||
pn_pos(pos),
|
pn_pos(pos),
|
||||||
pn_next(nullptr)
|
pn_next(nullptr)
|
||||||
{
|
{
|
||||||
|
@ -1814,7 +1814,8 @@ class LIRGraph
|
|||||||
return mir_.numBlockIds();
|
return mir_.numBlockIds();
|
||||||
}
|
}
|
||||||
MOZ_MUST_USE bool initBlock(MBasicBlock* mir) {
|
MOZ_MUST_USE bool initBlock(MBasicBlock* mir) {
|
||||||
LBlock* lir = new (&blocks_[mir->id()]) LBlock(mir);
|
auto* block = &blocks_[mir->id()];
|
||||||
|
auto* lir = new (block) LBlock(mir);
|
||||||
return lir->init(mir_.alloc());
|
return lir->init(mir_.alloc());
|
||||||
}
|
}
|
||||||
uint32_t getVirtualRegister() {
|
uint32_t getVirtualRegister() {
|
||||||
|
@ -6180,7 +6180,7 @@ class MAbs
|
|||||||
TRIVIAL_NEW_WRAPPERS
|
TRIVIAL_NEW_WRAPPERS
|
||||||
|
|
||||||
static MAbs* NewAsmJS(TempAllocator& alloc, MDefinition* num, MIRType type) {
|
static MAbs* NewAsmJS(TempAllocator& alloc, MDefinition* num, MIRType type) {
|
||||||
MAbs* ins = new(alloc) MAbs(num, type);
|
auto* ins = new(alloc) MAbs(num, type);
|
||||||
if (type == MIRType::Int32)
|
if (type == MIRType::Int32)
|
||||||
ins->implicitTruncate_ = true;
|
ins->implicitTruncate_ = true;
|
||||||
return ins;
|
return ins;
|
||||||
@ -6718,7 +6718,7 @@ class MAdd : public MBinaryArithInstruction
|
|||||||
static MAdd* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
|
static MAdd* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
|
||||||
MIRType type)
|
MIRType type)
|
||||||
{
|
{
|
||||||
MAdd* add = new(alloc) MAdd(left, right);
|
auto* add = new(alloc) MAdd(left, right);
|
||||||
add->specialization_ = type;
|
add->specialization_ = type;
|
||||||
add->setResultType(type);
|
add->setResultType(type);
|
||||||
if (type == MIRType::Int32) {
|
if (type == MIRType::Int32) {
|
||||||
@ -6763,7 +6763,7 @@ class MSub : public MBinaryArithInstruction
|
|||||||
static MSub* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
|
static MSub* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
|
||||||
MIRType type, bool mustPreserveNaN = false)
|
MIRType type, bool mustPreserveNaN = false)
|
||||||
{
|
{
|
||||||
MSub* sub = new(alloc) MSub(left, right);
|
auto* sub = new(alloc) MSub(left, right);
|
||||||
sub->specialization_ = type;
|
sub->specialization_ = type;
|
||||||
sub->setResultType(type);
|
sub->setResultType(type);
|
||||||
sub->setMustPreserveNaN(mustPreserveNaN);
|
sub->setMustPreserveNaN(mustPreserveNaN);
|
||||||
@ -6941,7 +6941,7 @@ class MDiv : public MBinaryArithInstruction
|
|||||||
MIRType type, bool unsignd, bool trapOnError = false,
|
MIRType type, bool unsignd, bool trapOnError = false,
|
||||||
bool mustPreserveNaN = false)
|
bool mustPreserveNaN = false)
|
||||||
{
|
{
|
||||||
MDiv* div = new(alloc) MDiv(left, right, type);
|
auto* div = new(alloc) MDiv(left, right, type);
|
||||||
div->unsigned_ = unsignd;
|
div->unsigned_ = unsignd;
|
||||||
div->trapOnError_ = trapOnError;
|
div->trapOnError_ = trapOnError;
|
||||||
if (trapOnError)
|
if (trapOnError)
|
||||||
@ -7068,7 +7068,7 @@ class MMod : public MBinaryArithInstruction
|
|||||||
static MMod* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
|
static MMod* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
|
||||||
MIRType type, bool unsignd, bool trapOnError = false)
|
MIRType type, bool unsignd, bool trapOnError = false)
|
||||||
{
|
{
|
||||||
MMod* mod = new(alloc) MMod(left, right, type);
|
auto* mod = new(alloc) MMod(left, right, type);
|
||||||
mod->unsigned_ = unsignd;
|
mod->unsigned_ = unsignd;
|
||||||
mod->trapOnError_ = trapOnError;
|
mod->trapOnError_ = trapOnError;
|
||||||
if (trapOnError)
|
if (trapOnError)
|
||||||
@ -8893,7 +8893,7 @@ class MNot
|
|||||||
public:
|
public:
|
||||||
static MNot* NewAsmJS(TempAllocator& alloc, MDefinition* input) {
|
static MNot* NewAsmJS(TempAllocator& alloc, MDefinition* input) {
|
||||||
MOZ_ASSERT(input->type() == MIRType::Int32 || input->type() == MIRType::Int64);
|
MOZ_ASSERT(input->type() == MIRType::Int32 || input->type() == MIRType::Int64);
|
||||||
MNot* ins = new(alloc) MNot(input);
|
auto* ins = new(alloc) MNot(input);
|
||||||
ins->setResultType(MIRType::Int32);
|
ins->setResultType(MIRType::Int32);
|
||||||
return ins;
|
return ins;
|
||||||
}
|
}
|
||||||
@ -11718,7 +11718,7 @@ class MGetDOMProperty
|
|||||||
static MGetDOMProperty* New(TempAllocator& alloc, const JSJitInfo* info, MDefinition* obj,
|
static MGetDOMProperty* New(TempAllocator& alloc, const JSJitInfo* info, MDefinition* obj,
|
||||||
MDefinition* guard, MDefinition* globalGuard)
|
MDefinition* guard, MDefinition* globalGuard)
|
||||||
{
|
{
|
||||||
MGetDOMProperty* res = new(alloc) MGetDOMProperty(info);
|
auto* res = new(alloc) MGetDOMProperty(info);
|
||||||
if (!res || !res->init(alloc, obj, guard, globalGuard))
|
if (!res || !res->init(alloc, obj, guard, globalGuard))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return res;
|
return res;
|
||||||
@ -11792,7 +11792,7 @@ class MGetDOMMember : public MGetDOMProperty
|
|||||||
static MGetDOMMember* New(TempAllocator& alloc, const JSJitInfo* info, MDefinition* obj,
|
static MGetDOMMember* New(TempAllocator& alloc, const JSJitInfo* info, MDefinition* obj,
|
||||||
MDefinition* guard, MDefinition* globalGuard)
|
MDefinition* guard, MDefinition* globalGuard)
|
||||||
{
|
{
|
||||||
MGetDOMMember* res = new(alloc) MGetDOMMember(info);
|
auto* res = new(alloc) MGetDOMMember(info);
|
||||||
if (!res || !res->init(alloc, obj, guard, globalGuard))
|
if (!res || !res->init(alloc, obj, guard, globalGuard))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return res;
|
return res;
|
||||||
|
@ -121,8 +121,8 @@ Impl::~Impl()
|
|||||||
// Close all active counter descriptors. Take care to do the group
|
// Close all active counter descriptors. Take care to do the group
|
||||||
// leader last (this may not be necessary, but it's unclear what
|
// leader last (this may not be necessary, but it's unclear what
|
||||||
// happens if you close the group leader out from under a group).
|
// happens if you close the group leader out from under a group).
|
||||||
for (int i = 0; i < PerfMeasurement::NUM_MEASURABLE_EVENTS; i++) {
|
for (const auto& slot : kSlots) {
|
||||||
int fd = this->*(kSlots[i].fd);
|
int fd = this->*(slot.fd);
|
||||||
if (fd != -1 && fd != group_leader)
|
if (fd != -1 && fd != group_leader)
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
@ -140,8 +140,8 @@ Impl::init(EventMask toMeasure)
|
|||||||
|
|
||||||
EventMask measured = EventMask(0);
|
EventMask measured = EventMask(0);
|
||||||
struct perf_event_attr attr;
|
struct perf_event_attr attr;
|
||||||
for (int i = 0; i < PerfMeasurement::NUM_MEASURABLE_EVENTS; i++) {
|
for (const auto& slot : kSlots) {
|
||||||
if (!(toMeasure & kSlots[i].bit))
|
if (!(toMeasure & slot.bit))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
memset(&attr, 0, sizeof(attr));
|
memset(&attr, 0, sizeof(attr));
|
||||||
@ -150,8 +150,8 @@ Impl::init(EventMask toMeasure)
|
|||||||
// Set the type and config fields to indicate the counter we
|
// Set the type and config fields to indicate the counter we
|
||||||
// want to enable. We want read format 0, and we're not using
|
// want to enable. We want read format 0, and we're not using
|
||||||
// sampling, so leave those fields unset.
|
// sampling, so leave those fields unset.
|
||||||
attr.type = kSlots[i].type;
|
attr.type = slot.type;
|
||||||
attr.config = kSlots[i].config;
|
attr.config = slot.config;
|
||||||
|
|
||||||
// If this will be the group leader it should start off
|
// If this will be the group leader it should start off
|
||||||
// disabled. Otherwise it should start off enabled (but blocked
|
// disabled. Otherwise it should start off enabled (but blocked
|
||||||
@ -175,8 +175,8 @@ Impl::init(EventMask toMeasure)
|
|||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
measured = EventMask(measured | kSlots[i].bit);
|
measured = EventMask(measured | slot.bit);
|
||||||
this->*(kSlots[i].fd) = fd;
|
this->*(slot.fd) = fd;
|
||||||
if (group_leader == -1)
|
if (group_leader == -1)
|
||||||
group_leader = fd;
|
group_leader = fd;
|
||||||
}
|
}
|
||||||
@ -207,15 +207,15 @@ Impl::stop(PerfMeasurement* counters)
|
|||||||
running = false;
|
running = false;
|
||||||
|
|
||||||
// read out and reset all the counter values
|
// read out and reset all the counter values
|
||||||
for (int i = 0; i < PerfMeasurement::NUM_MEASURABLE_EVENTS; i++) {
|
for (const auto& slot : kSlots) {
|
||||||
int fd = this->*(kSlots[i].fd);
|
int fd = this->*(slot.fd);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (read(fd, buf, sizeof(buf)) == sizeof(uint64_t)) {
|
if (read(fd, buf, sizeof(buf)) == sizeof(uint64_t)) {
|
||||||
uint64_t cur;
|
uint64_t cur;
|
||||||
memcpy(&cur, buf, sizeof(uint64_t));
|
memcpy(&cur, buf, sizeof(uint64_t));
|
||||||
counters->*(kSlots[i].counter) += cur;
|
counters->*(slot.counter) += cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset the counter regardless of whether the read did what
|
// Reset the counter regardless of whether the read did what
|
||||||
@ -273,11 +273,11 @@ PerfMeasurement::stop()
|
|||||||
void
|
void
|
||||||
PerfMeasurement::reset()
|
PerfMeasurement::reset()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NUM_MEASURABLE_EVENTS; i++) {
|
for (const auto& slot : kSlots) {
|
||||||
if (eventsMeasured & kSlots[i].bit)
|
if (eventsMeasured & slot.bit)
|
||||||
this->*(kSlots[i].counter) = 0;
|
this->*(slot.counter) = 0;
|
||||||
else
|
else
|
||||||
this->*(kSlots[i].counter) = -1;
|
this->*(slot.counter) = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,15 +283,15 @@ TraceLoggerGraph::~TraceLoggerGraph()
|
|||||||
// Make sure every start entry has a corresponding stop value.
|
// Make sure every start entry has a corresponding stop value.
|
||||||
// We temporarily enable logging for this. Stop doesn't need any extra data,
|
// We temporarily enable logging for this. Stop doesn't need any extra data,
|
||||||
// so is safe to do even when we have encountered OOM.
|
// so is safe to do even when we have encountered OOM.
|
||||||
enabled = 1;
|
enabled = true;
|
||||||
while (stack.size() > 1)
|
while (stack.size() > 1)
|
||||||
stopEvent(0);
|
stopEvent(0);
|
||||||
enabled = 0;
|
enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!failed && !flush()) {
|
if (!failed && !flush()) {
|
||||||
fprintf(stderr, "TraceLogging: Couldn't write the data to disk.\n");
|
fprintf(stderr, "TraceLogging: Couldn't write the data to disk.\n");
|
||||||
enabled = 0;
|
enabled = false;
|
||||||
failed = true;
|
failed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ TraceLoggerGraph::startEvent(uint32_t id, uint64_t timestamp)
|
|||||||
if (tree.size() >= treeSizeFlushLimit() || !tree.ensureSpaceBeforeAdd()) {
|
if (tree.size() >= treeSizeFlushLimit() || !tree.ensureSpaceBeforeAdd()) {
|
||||||
if (!flush()) {
|
if (!flush()) {
|
||||||
fprintf(stderr, "TraceLogging: Couldn't write the data to disk.\n");
|
fprintf(stderr, "TraceLogging: Couldn't write the data to disk.\n");
|
||||||
enabled = 0;
|
enabled = false;
|
||||||
failed = true;
|
failed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -373,7 +373,7 @@ TraceLoggerGraph::startEvent(uint32_t id, uint64_t timestamp)
|
|||||||
|
|
||||||
if (!startEventInternal(id, timestamp)) {
|
if (!startEventInternal(id, timestamp)) {
|
||||||
fprintf(stderr, "TraceLogging: Failed to start an event.\n");
|
fprintf(stderr, "TraceLogging: Failed to start an event.\n");
|
||||||
enabled = 0;
|
enabled = false;
|
||||||
failed = true;
|
failed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -462,7 +462,7 @@ TraceLoggerGraph::stopEvent(uint64_t timestamp)
|
|||||||
if (enabled && stack.lastEntry().active()) {
|
if (enabled && stack.lastEntry().active()) {
|
||||||
if (!updateStop(stack.lastEntry().treeId(), timestamp)) {
|
if (!updateStop(stack.lastEntry().treeId(), timestamp)) {
|
||||||
fprintf(stderr, "TraceLogging: Failed to stop an event.\n");
|
fprintf(stderr, "TraceLogging: Failed to stop an event.\n");
|
||||||
enabled = 0;
|
enabled = false;
|
||||||
failed = true;
|
failed = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class JSObject2WrappedJSMap
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static JSObject2WrappedJSMap* newMap(int length) {
|
static JSObject2WrappedJSMap* newMap(int length) {
|
||||||
JSObject2WrappedJSMap* map = new JSObject2WrappedJSMap();
|
auto* map = new JSObject2WrappedJSMap();
|
||||||
if (!map->mTable.init(length)) {
|
if (!map->mTable.init(length)) {
|
||||||
// This is a decent estimate of the size of the hash table's
|
// This is a decent estimate of the size of the hash table's
|
||||||
// entry storage. The |2| is because on average the capacity is
|
// entry storage. The |2| is because on average the capacity is
|
||||||
@ -592,7 +592,7 @@ class JSObject2JSObjectMap
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static JSObject2JSObjectMap* newMap(int length) {
|
static JSObject2JSObjectMap* newMap(int length) {
|
||||||
JSObject2JSObjectMap* map = new JSObject2JSObjectMap();
|
auto* map = new JSObject2JSObjectMap();
|
||||||
if (!map->mTable.init(length)) {
|
if (!map->mTable.init(length)) {
|
||||||
// This is a decent estimate of the size of the hash table's
|
// This is a decent estimate of the size of the hash table's
|
||||||
// entry storage. The |2| is because on average the capacity is
|
// entry storage. The |2| is because on average the capacity is
|
||||||
|
@ -673,9 +673,9 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
|
|||||||
newStyleBorder.TrackImage(aPresContext);
|
newStyleBorder.TrackImage(aPresContext);
|
||||||
|
|
||||||
NS_FOR_CSS_SIDES(side) {
|
NS_FOR_CSS_SIDES(side) {
|
||||||
newStyleBorder.SetBorderColor(side,
|
nscolor color = aStyleContext->GetVisitedDependentColor(
|
||||||
aStyleContext->GetVisitedDependentColor(
|
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_color)[side]);
|
||||||
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_color)[side]));
|
newStyleBorder.mBorderColor[side] = StyleComplexColor::FromColor(color);
|
||||||
}
|
}
|
||||||
DrawResult result =
|
DrawResult result =
|
||||||
PaintBorderWithStyleBorder(aPresContext, aRenderingContext, aForFrame,
|
PaintBorderWithStyleBorder(aPresContext, aRenderingContext, aForFrame,
|
||||||
@ -804,13 +804,9 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
// pull out styles, colors, composite colors
|
// pull out styles, colors, composite colors
|
||||||
NS_FOR_CSS_SIDES (i) {
|
NS_FOR_CSS_SIDES (i) {
|
||||||
bool foreground;
|
|
||||||
borderStyles[i] = aStyleBorder.GetBorderStyle(i);
|
borderStyles[i] = aStyleBorder.GetBorderStyle(i);
|
||||||
aStyleBorder.GetBorderColor(i, borderColors[i], foreground);
|
borderColors[i] = ourColor->CalcComplexColor(aStyleBorder.mBorderColor[i]);
|
||||||
aStyleBorder.GetCompositeColors(i, &compositeColors[i]);
|
aStyleBorder.GetCompositeColors(i, &compositeColors[i]);
|
||||||
|
|
||||||
if (foreground)
|
|
||||||
borderColors[i] = ourColor->mColor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAsFormatString(" borderStyles: %d %d %d %d\n", borderStyles[0], borderStyles[1], borderStyles[2], borderStyles[3]);
|
PrintAsFormatString(" borderStyles: %d %d %d %d\n", borderStyles[0], borderStyles[1], borderStyles[2], borderStyles[3]);
|
||||||
@ -876,7 +872,7 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
|
|||||||
MOZ_ASSERT(ourOutline != NS_STYLE_BORDER_STYLE_NONE,
|
MOZ_ASSERT(ourOutline != NS_STYLE_BORDER_STYLE_NONE,
|
||||||
"shouldn't have created nsDisplayOutline item");
|
"shouldn't have created nsDisplayOutline item");
|
||||||
|
|
||||||
uint8_t outlineStyle = ourOutline->GetOutlineStyle();
|
uint8_t outlineStyle = ourOutline->mOutlineStyle;
|
||||||
nscoord width = ourOutline->GetOutlineWidth();
|
nscoord width = ourOutline->GetOutlineWidth();
|
||||||
|
|
||||||
if (width == 0 && outlineStyle != NS_STYLE_BORDER_STYLE_AUTO) {
|
if (width == 0 && outlineStyle != NS_STYLE_BORDER_STYLE_AUTO) {
|
||||||
@ -1775,16 +1771,13 @@ IsOpaqueBorderEdge(const nsStyleBorder& aBorder, mozilla::css::Side aSide)
|
|||||||
if (aBorder.mBorderImageSource.GetType() != eStyleImageType_Null)
|
if (aBorder.mBorderImageSource.GetType() != eStyleImageType_Null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
nscolor color;
|
StyleComplexColor color = aBorder.mBorderColor[aSide];
|
||||||
bool isForeground;
|
|
||||||
aBorder.GetBorderColor(aSide, color, isForeground);
|
|
||||||
|
|
||||||
// We don't know the foreground color here, so if it's being used
|
// We don't know the foreground color here, so if it's being used
|
||||||
// we must assume it might be transparent.
|
// we must assume it might be transparent.
|
||||||
if (isForeground)
|
if (!color.IsNumericColor()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
return NS_GET_A(color) == 255;
|
return NS_GET_A(color.mColor) == 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,13 +95,13 @@ nsColumnSetFrame::PaintColumnRule(nsRenderingContext* aCtx,
|
|||||||
if (isVertical) {
|
if (isVertical) {
|
||||||
border.SetBorderWidth(NS_SIDE_TOP, ruleWidth);
|
border.SetBorderWidth(NS_SIDE_TOP, ruleWidth);
|
||||||
border.SetBorderStyle(NS_SIDE_TOP, ruleStyle);
|
border.SetBorderStyle(NS_SIDE_TOP, ruleStyle);
|
||||||
border.SetBorderColor(NS_SIDE_TOP, ruleColor);
|
border.mBorderTopColor = StyleComplexColor::FromColor(ruleColor);
|
||||||
skipSides |= mozilla::eSideBitsLeftRight;
|
skipSides |= mozilla::eSideBitsLeftRight;
|
||||||
skipSides |= mozilla::eSideBitsBottom;
|
skipSides |= mozilla::eSideBitsBottom;
|
||||||
} else {
|
} else {
|
||||||
border.SetBorderWidth(NS_SIDE_LEFT, ruleWidth);
|
border.SetBorderWidth(NS_SIDE_LEFT, ruleWidth);
|
||||||
border.SetBorderStyle(NS_SIDE_LEFT, ruleStyle);
|
border.SetBorderStyle(NS_SIDE_LEFT, ruleStyle);
|
||||||
border.SetBorderColor(NS_SIDE_LEFT, ruleColor);
|
border.mBorderLeftColor = StyleComplexColor::FromColor(ruleColor);
|
||||||
skipSides |= mozilla::eSideBitsTopBottom;
|
skipSides |= mozilla::eSideBitsTopBottom;
|
||||||
skipSides |= mozilla::eSideBitsRight;
|
skipSides |= mozilla::eSideBitsRight;
|
||||||
}
|
}
|
||||||
|
@ -1718,7 +1718,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
|
|||||||
mAlignSelf = ConvertLegacyStyleToAlignItems(containerStyleXUL);
|
mAlignSelf = ConvertLegacyStyleToAlignItems(containerStyleXUL);
|
||||||
} else {
|
} else {
|
||||||
mAlignSelf = aFlexItemReflowInput.mStylePosition->ComputedAlignSelf(
|
mAlignSelf = aFlexItemReflowInput.mStylePosition->ComputedAlignSelf(
|
||||||
mFrame->StyleContext()->GetParent());
|
containerRS->mFrame->StyleContext());
|
||||||
if (MOZ_LIKELY(mAlignSelf == NS_STYLE_ALIGN_NORMAL)) {
|
if (MOZ_LIKELY(mAlignSelf == NS_STYLE_ALIGN_NORMAL)) {
|
||||||
mAlignSelf = NS_STYLE_ALIGN_STRETCH;
|
mAlignSelf = NS_STYLE_ALIGN_STRETCH;
|
||||||
}
|
}
|
||||||
|
@ -1799,8 +1799,9 @@ void
|
|||||||
nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
|
nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists)
|
const nsDisplayListSet& aLists)
|
||||||
{
|
{
|
||||||
if (StyleOutline()->GetOutlineStyle() == NS_STYLE_BORDER_STYLE_NONE)
|
if (StyleOutline()->mOutlineStyle == NS_STYLE_BORDER_STYLE_NONE) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
aLists.Outlines()->AppendNewToTop(
|
aLists.Outlines()->AppendNewToTop(
|
||||||
new (aBuilder) nsDisplayOutline(aBuilder, this));
|
new (aBuilder) nsDisplayOutline(aBuilder, this));
|
||||||
@ -4847,7 +4848,7 @@ nsIFrame::ComputeTightBounds(DrawTarget* aDrawTarget) const
|
|||||||
nsRect
|
nsRect
|
||||||
nsFrame::ComputeSimpleTightBounds(DrawTarget* aDrawTarget) const
|
nsFrame::ComputeSimpleTightBounds(DrawTarget* aDrawTarget) const
|
||||||
{
|
{
|
||||||
if (StyleOutline()->GetOutlineStyle() != NS_STYLE_BORDER_STYLE_NONE ||
|
if (StyleOutline()->mOutlineStyle != NS_STYLE_BORDER_STYLE_NONE ||
|
||||||
StyleBorder()->HasBorder() || !StyleBackground()->IsTransparent() ||
|
StyleBorder()->HasBorder() || !StyleBackground()->IsTransparent() ||
|
||||||
StyleDisplay()->mAppearance) {
|
StyleDisplay()->mAppearance) {
|
||||||
// Not necessarily tight, due to clipping, negative
|
// Not necessarily tight, due to clipping, negative
|
||||||
@ -7970,7 +7971,7 @@ ComputeAndIncludeOutlineArea(nsIFrame* aFrame, nsOverflowAreas& aOverflowAreas,
|
|||||||
const nsSize& aNewSize)
|
const nsSize& aNewSize)
|
||||||
{
|
{
|
||||||
const nsStyleOutline* outline = aFrame->StyleOutline();
|
const nsStyleOutline* outline = aFrame->StyleOutline();
|
||||||
const uint8_t outlineStyle = outline->GetOutlineStyle();
|
const uint8_t outlineStyle = outline->mOutlineStyle;
|
||||||
if (outlineStyle == NS_STYLE_BORDER_STYLE_NONE) {
|
if (outlineStyle == NS_STYLE_BORDER_STYLE_NONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -8680,11 +8681,9 @@ void nsFrame::FillCursorInformationFromStyle(const nsStyleUserInterface* ui,
|
|||||||
aCursor.mLoading = false;
|
aCursor.mLoading = false;
|
||||||
aCursor.mHotspotX = aCursor.mHotspotY = 0.0f;
|
aCursor.mHotspotX = aCursor.mHotspotY = 0.0f;
|
||||||
|
|
||||||
for (nsCursorImage *item = ui->mCursorArray,
|
for (const nsCursorImage& item : ui->mCursorImages) {
|
||||||
*item_end = ui->mCursorArray + ui->mCursorArrayLength;
|
|
||||||
item < item_end; ++item) {
|
|
||||||
uint32_t status;
|
uint32_t status;
|
||||||
nsresult rv = item->GetImage()->GetImageStatus(&status);
|
nsresult rv = item.GetImage()->GetImageStatus(&status);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
if (!(status & imgIRequest::STATUS_LOAD_COMPLETE)) {
|
if (!(status & imgIRequest::STATUS_LOAD_COMPLETE)) {
|
||||||
// If we are falling back because any cursor before is loading,
|
// If we are falling back because any cursor before is loading,
|
||||||
@ -8692,10 +8691,10 @@ void nsFrame::FillCursorInformationFromStyle(const nsStyleUserInterface* ui,
|
|||||||
aCursor.mLoading = true;
|
aCursor.mLoading = true;
|
||||||
} else if (!(status & imgIRequest::STATUS_ERROR)) {
|
} else if (!(status & imgIRequest::STATUS_ERROR)) {
|
||||||
// This is the one we want
|
// This is the one we want
|
||||||
item->GetImage()->GetImage(getter_AddRefs(aCursor.mContainer));
|
item.GetImage()->GetImage(getter_AddRefs(aCursor.mContainer));
|
||||||
aCursor.mHaveHotspot = item->mHaveHotspot;
|
aCursor.mHaveHotspot = item.mHaveHotspot;
|
||||||
aCursor.mHotspotX = item->mHotspotX;
|
aCursor.mHotspotX = item.mHotspotX;
|
||||||
aCursor.mHotspotY = item->mHotspotY;
|
aCursor.mHotspotY = item.mHotspotY;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1265,9 +1265,7 @@ struct nsRecessedBorder : public nsStyleBorder {
|
|||||||
: nsStyleBorder(aPresContext)
|
: nsStyleBorder(aPresContext)
|
||||||
{
|
{
|
||||||
NS_FOR_CSS_SIDES(side) {
|
NS_FOR_CSS_SIDES(side) {
|
||||||
// Note: use SetBorderColor here because we want to make sure
|
mBorderColor[side] = StyleComplexColor::FromColor(NS_RGB(0, 0, 0));
|
||||||
// the "special" flags are unset.
|
|
||||||
SetBorderColor(side, NS_RGB(0, 0, 0));
|
|
||||||
mBorder.Side(side) = aBorderWidth;
|
mBorder.Side(side) = aBorderWidth;
|
||||||
// Note: use SetBorderStyle here because we want to affect
|
// Note: use SetBorderStyle here because we want to affect
|
||||||
// mComputedBorder
|
// mComputedBorder
|
||||||
|
@ -5175,7 +5175,7 @@ nsTextFrame::GetTextDecorations(
|
|||||||
physicalBlockStartOffset +=
|
physicalBlockStartOffset +=
|
||||||
vertical ? f->GetNormalPosition().x : f->GetNormalPosition().y;
|
vertical ? f->GetNormalPosition().x : f->GetNormalPosition().y;
|
||||||
|
|
||||||
const uint8_t style = styleText->GetDecorationStyle();
|
const uint8_t style = styleText->mTextDecorationStyle;
|
||||||
if (textDecorations) {
|
if (textDecorations) {
|
||||||
nscolor color;
|
nscolor color;
|
||||||
if (useOverride) {
|
if (useOverride) {
|
||||||
@ -5384,7 +5384,7 @@ nsTextFrame::UnionAdditionalOverflow(nsPresContext* aPresContext,
|
|||||||
// rect when this is in floating first letter frame at *both* modes.
|
// rect when this is in floating first letter frame at *both* modes.
|
||||||
// In this case, aBlock is the ::first-letter frame.
|
// In this case, aBlock is the ::first-letter frame.
|
||||||
uint8_t decorationStyle = aBlock->StyleContext()->
|
uint8_t decorationStyle = aBlock->StyleContext()->
|
||||||
StyleTextReset()->GetDecorationStyle();
|
StyleTextReset()->mTextDecorationStyle;
|
||||||
// If the style is none, let's include decoration line rect as solid style
|
// If the style is none, let's include decoration line rect as solid style
|
||||||
// since changing the style from none to solid/dotted/dashed doesn't cause
|
// since changing the style from none to solid/dotted/dashed doesn't cause
|
||||||
// reflow.
|
// reflow.
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user