Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2016-09-30 12:08:17 +02:00
commit 53c63f69db
181 changed files with 2960 additions and 1378 deletions

View File

@ -172,8 +172,14 @@ faster: install-dist/idl
endif
.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)
$(call BUILDSTATUS,TIER_FINISH tup)
# process_install_manifest needs to be invoked with --no-remove when building
# js as standalone because automated builds are building nspr separately and

View File

@ -716,13 +716,9 @@ TextAttrsMgr::TextDecorValue::
TextDecorValue(nsIFrame* aFrame)
{
const nsStyleTextReset* textReset = aFrame->StyleTextReset();
mStyle = textReset->GetDecorationStyle();
bool isForegroundColor = false;
textReset->GetDecorationColor(mColor, isForegroundColor);
if (isForegroundColor)
mColor = aFrame->StyleColor()->mColor;
mStyle = textReset->mTextDecorationStyle;
mColor = aFrame->StyleColor()->
CalcComplexColor(textReset->mTextDecorationColor);
mLine = textReset->mTextDecorationLine &
(NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE |
NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH);

View File

@ -466,6 +466,9 @@ const CustomizableWidgets = [
// Create the element for the remote client.
let clientItem = doc.createElementNS(kNSXUL, "label");
clientItem.setAttribute("itemtype", "client");
let window = doc.defaultView;
clientItem.setAttribute("tooltiptext",
window.gSyncUI.formatLastSyncDate(new Date(client.lastModified)));
clientItem.textContent = client.name;
attachFragment.appendChild(clientItem);

View File

@ -8,7 +8,8 @@ XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
"resource://gre/modules/MatchPattern.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
"resource://gre/modules/PromiseUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services",
"resource://gre/modules/Services.jsm");
@ -242,6 +243,7 @@ let tabListener = {
tabReadyInitialized: false,
tabReadyPromises: new WeakMap(),
initializingTabs: new WeakSet(),
initTabReady() {
if (!this.tabReadyInitialized) {
@ -256,6 +258,10 @@ let tabListener = {
let gBrowser = browser.ownerGlobal.gBrowser;
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);
if (deferred) {
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) {
return new Promise((resolve, reject) => {
this.tabReadyPromises.set(tab, {resolve, reject});
});
let deferred = this.tabReadyPromises.get(tab);
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);
}
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,
// since it may be pre-rendered, in which case its initial
// 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);
});
},
@ -717,45 +738,49 @@ extensions.registerSchemaAPI("tabs", "addon_parent", context => {
WindowManager.topWindow :
WindowManager.getWindow(windowId, context);
let browser = window.gBrowser.selectedBrowser;
let recipient = {
innerWindowID: browser.innerWindowID,
};
let tab = window.gBrowser.selectedTab;
return tabListener.awaitTabReady(tab).then(() => {
let browser = tab.linkedBrowser;
let recipient = {
innerWindowID: browser.innerWindowID,
};
if (!options) {
options = {};
}
if (options.format == null) {
options.format = "png";
}
if (options.quality == null) {
options.quality = 92;
}
if (!options) {
options = {};
}
if (options.format == null) {
options.format = "png";
}
if (options.quality == null) {
options.quality = 92;
}
let message = {
options,
width: browser.clientWidth,
height: browser.clientHeight,
};
let message = {
options,
width: browser.clientWidth,
height: browser.clientHeight,
};
return context.sendMessage(browser.messageManager, "Extension:Capture",
message, {recipient});
return context.sendMessage(browser.messageManager, "Extension:Capture",
message, {recipient});
});
},
detectLanguage: function(tabId) {
let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
let browser = tab.linkedBrowser;
let recipient = {innerWindowID: browser.innerWindowID};
return tabListener.awaitTabReady(tab).then(() => {
let browser = tab.linkedBrowser;
let recipient = {innerWindowID: browser.innerWindowID};
return context.sendMessage(browser.messageManager, "Extension:DetectLanguage",
{}, {recipient});
return context.sendMessage(browser.messageManager, "Extension:DetectLanguage",
{}, {recipient});
});
},
// Used to executeScript, insertCSS and removeCSS.
_execute: function(tabId, details, kind, method) {
let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
let mm = tab.linkedBrowser.messageManager;
let options = {
js: [],
@ -772,10 +797,6 @@ extensions.registerSchemaAPI("tabs", "addon_parent", context => {
return Promise.reject({message: `'frameId' and 'allFrames' are mutually exclusive`});
}
let recipient = {
innerWindowID: tab.linkedBrowser.innerWindowID,
};
if (TabManager.for(extension).hasActiveTabPermission(tab)) {
// If we have the "activeTab" permission for this tab, ignore
// the host whitelist.
@ -809,7 +830,14 @@ extensions.registerSchemaAPI("tabs", "addon_parent", context => {
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) {

View 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

View 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

View 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

View 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

View File

@ -129,7 +129,7 @@ var pktUI = (function() {
*/
function showSignUp() {
// 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");
openTabWithUrl('https://' + site + '/firefox_learnmore?s=ffi&t=autoredirect&tv=page_learnmore&src=ff_ext', true);

View File

@ -610,7 +610,7 @@ var pktApi = (function() {
* Helper function to get current signup AB group the user is in
*/
function getSignupPanelTabTestVariant() {
return getMultipleTestOption('panelSignUp', {control: 2, v1: 7, v2: 1 })
return getMultipleTestOption('panelSignUp', {control: 1, v1: 2, v2: 7 })
}
function getMultipleTestOption(testName, testOptions) {

View 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. Its 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 Pockets <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

View 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

View 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 = જુઓ પોકેટની યાદી

View File

@ -6,11 +6,14 @@
# These are used for the big if statement, as the preprocessor can't handle
# dashes.
#define bn_BD bn-BD
#define en_GB en-GB
#define en_US en-US
#define es_AR es-AR
#define es_CL es-CL
#define es_ES es-ES
#define es_MX es-MX
#define fy_NL fy-NL
#define gu_IN gu-IN
#define nn_NO nn-NO
#define pt_BR pt-BR
#define pt_PT pt-PT
@ -23,7 +26,7 @@
# For locales we support, include the file from the locale's directory in the
# source tree.
# 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@/*)
#else
locale/@AB_CD@/ (en-US/*)

View 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 სიის ნახვა

View 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šą

View 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 = पॉकेट सूची पहा

View 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

View 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

View File

@ -112,7 +112,7 @@ html {
margin: 4px 8px 10px;
border-width: 3px;
border-style: solid;
border-color: -moz-use-text-color;
border-color: currentcolor;
border-image: none;
-moz-border-top-colors: transparent #888 #000;
-moz-border-right-colors: transparent #FFF #000;

View File

@ -816,5 +816,3 @@ add_old_configure_assignment('PKG_CONFIG', pkg_config)
@dependable
def gonkdir():
return None
include(include_project_configure)

View File

@ -82,8 +82,11 @@ elif test -z "$CCACHE_DIR" -a -z "$SCCACHE_DISABLE" -a -z "$no_sccache" -a -z "$
esac
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
case "${SYSTEMROOT}" in
*Windows)

View File

@ -142,7 +142,7 @@ var AnimationsController = {
this.onNewNodeFront = this.onNewNodeFront.bind(this);
this.onAnimationMutations = this.onAnimationMutations.bind(this);
let target = gToolbox.target;
let target = gInspector.target;
this.animationsFront = new AnimationsFront(target.client, target.form);
// Expose actor capabilities.

View File

@ -9,7 +9,7 @@ const osString = Services.appinfo.OS;
// Panels
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, "DebuggerPanel", () => require("devtools/client/debugger/panel").DebuggerPanel);
loader.lazyGetter(this, "StyleEditorPanel", () => require("devtools/client/styleeditor/styleeditor-panel").StyleEditorPanel);

View File

@ -141,6 +141,10 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
}
}
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);
},
/**
* 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
*
* @param {XULDocument} doc
* The document to which devtools should be hooked to.
* @param {ChromeWindow} win
* The window to which devtools should be hooked to.
*/
_registerBrowserWindow: function (win) {
if (gDevToolsBrowser._trackedBrowserWindows.has(win)) {
@ -413,8 +437,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
}
gDevToolsBrowser._trackedBrowserWindows.add(win);
BrowserMenus.addMenus(win.document);
// Register the Developer widget in the Hamburger menu or navbar
// only once menus are registered as it depends on it.
gDevToolsBrowser.installDeveloperWidget();
@ -427,7 +449,6 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
this.updateCommandAvailability(win);
this.ensurePrefObserver();
win.addEventListener("unload", this);
let tabContainer = win.gBrowser.tabContainer;
tabContainer.addEventListener("TabSelect", this, false);
@ -624,13 +645,16 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
* The window containing the menu entry
*/
_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)) {
return;
}
gDevToolsBrowser._trackedBrowserWindows.delete(win);
win.removeEventListener("unload", this);
BrowserMenus.removeMenus(win.document);
// Destroy toolboxes for closed window
for (let [target, toolbox] of gDevTools._toolboxes) {
@ -679,6 +703,9 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
case "TabSelect":
gDevToolsBrowser._updateMenuCheckbox();
break;
case "DOMContentLoaded":
gDevToolsBrowser._onBrowserWindowLoaded(event.target.defaultView);
break;
case "unload":
// top-level browser window unload
gDevToolsBrowser._forgetBrowserWindow(event.target.defaultView);
@ -708,6 +735,7 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
*/
destroy: function () {
Services.prefs.removeObserver("devtools.", gDevToolsBrowser);
Services.ww.unregisterNotification(gDevToolsBrowser);
Services.obs.removeObserver(gDevToolsBrowser, "browser-delayed-startup-finished");
Services.obs.removeObserver(gDevToolsBrowser.destroy, "quit-application");
@ -740,6 +768,7 @@ gDevTools.on("toolbox-ready", gDevToolsBrowser._updateMenuCheckbox);
gDevTools.on("toolbox-destroyed", gDevToolsBrowser._updateMenuCheckbox);
Services.obs.addObserver(gDevToolsBrowser.destroy, "quit-application", false);
Services.ww.registerNotification(gDevToolsBrowser);
Services.obs.addObserver(gDevToolsBrowser, "browser-delayed-startup-finished", false);
// 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()) {
let win = enumerator.getNext();
if (win.gBrowserInit && win.gBrowserInit.delayedStartupFinished) {
gDevToolsBrowser._onBrowserWindowLoaded(win);
gDevToolsBrowser._registerBrowserWindow(win);
}
}

View File

@ -7,7 +7,7 @@ const URL = "data:text/html;charset=utf8,test for textbox context menu";
add_task(function* () {
let toolbox = yield openNewTabAndToolbox(URL, "inspector");
let textboxContextMenu = toolbox.textboxContextMenuPopup;
let textboxContextMenu = toolbox.textBoxContextMenuPopup;
emptyClipboard();

View File

@ -137,7 +137,7 @@ function Toolbox(target, selectedTool, hostType, hostOptions) {
this._saveSplitConsoleHeight = this._saveSplitConsoleHeight.bind(this);
this._onFocus = this._onFocus.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._onBottomHostMaximized = this._onBottomHostMaximized.bind(this);
this._onToolSelectWhileMinimized = this._onToolSelectWhileMinimized.bind(this);
@ -402,10 +402,10 @@ Toolbox.prototype = {
let noautohideMenu = this.doc.getElementById("command-button-noautohide");
noautohideMenu.addEventListener("click", this._toggleAutohide, true);
this.textboxContextMenuPopup =
this.textBoxContextMenuPopup =
this.doc.getElementById("toolbox-textbox-context-popup");
this.textboxContextMenuPopup.addEventListener("popupshowing",
this._updateTextboxMenuItems, true);
this.textBoxContextMenuPopup.addEventListener("popupshowing",
this._updateTextBoxMenuItems, true);
this.shortcuts = new KeyShortcuts({
window: this.doc.defaultView
@ -2096,10 +2096,10 @@ Toolbox.prototype = {
this.closeButton.removeEventListener("click", this.destroy, true);
this.closeButton = null;
}
if (this.textboxContextMenuPopup) {
this.textboxContextMenuPopup.removeEventListener("popupshowing",
this._updateTextboxMenuItems, true);
this.textboxContextMenuPopup = null;
if (this.textBoxContextMenuPopup) {
this.textBoxContextMenuPopup.removeEventListener("popupshowing",
this._updateTextBoxMenuItems, true);
this.textBoxContextMenuPopup = null;
}
if (this.tabbar) {
this.tabbar.removeEventListener("focus", this._onTabbarFocus, true);
@ -2235,12 +2235,23 @@ Toolbox.prototype = {
/**
* Enable / disable necessary textbox menu items using globalOverlay.js.
*/
_updateTextboxMenuItems: function () {
_updateTextBoxMenuItems: function () {
let window = this.win;
["cmd_undo", "cmd_delete", "cmd_cut",
"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
* necessary because of the WebConsole's `profile` and `profileEnd` methods.

View File

@ -341,10 +341,10 @@ BoxModelView.prototype = {
*/
trackReflows: function () {
if (!this.reflowFront) {
let toolbox = this.inspector.toolbox;
if (toolbox.target.form.reflowActor) {
this.reflowFront = ReflowFront(toolbox.target.client,
toolbox.target.form);
let { target } = this.inspector;
if (target.form.reflowActor) {
this.reflowFront = ReflowFront(target.client,
target.form);
} else {
return;
}
@ -384,7 +384,6 @@ BoxModelView.prototype = {
start: self => {
self.elt.parentNode.classList.add("boxmodel-editing");
},
change: value => {
if (NUMERIC.test(value)) {
value += "px";
@ -404,7 +403,6 @@ BoxModelView.prototype = {
session.setProperties(properties).catch(e => console.error(e));
},
done: (value, commit) => {
editor.elt.parentNode.classList.remove("boxmodel-editing");
if (!commit) {
@ -413,6 +411,7 @@ BoxModelView.prototype = {
}, e => console.error(e));
}
},
contextMenu: this.inspector.onTextBoxContextMenu,
cssProperties: this._cssProperties
}, event);
},
@ -468,7 +467,7 @@ BoxModelView.prototype = {
this.inspector.sidebar.off("computedview-selected", this.onNewNode);
this.inspector.selection.off("new-node-front", this.onNewSelection);
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 = null;
@ -792,7 +791,7 @@ BoxModelView.prototype = {
this.inspector.markup.on("node-hover", this.onMarkupViewNodeHover);
// Release the actor on will-navigate event
this.inspector._target.once("will-navigate", this.onWillNavigate);
this.inspector.target.once("will-navigate", this.onWillNavigate);
});
},

View File

@ -148,8 +148,6 @@ function CssComputedView(inspector, document, pageStyle) {
this._onFilterStyles = this._onFilterStyles.bind(this);
this._onClearSearch = this._onClearSearch.bind(this);
this._onIncludeBrowserStyles = this._onIncludeBrowserStyles.bind(this);
this._onFilterTextboxContextMenu =
this._onFilterTextboxContextMenu.bind(this);
let doc = this.styleDocument;
this.element = doc.getElementById("propertyContainer");
@ -167,8 +165,7 @@ function CssComputedView(inspector, document, pageStyle) {
this.element.addEventListener("copy", this._onCopy);
this.element.addEventListener("contextmenu", this._onContextMenu);
this.searchField.addEventListener("input", this._onFilterStyles);
this.searchField.addEventListener("contextmenu",
this._onFilterTextboxContextMenu);
this.searchField.addEventListener("contextmenu", this.inspector.onTextBoxContextMenu);
this.searchClearButton.addEventListener("click", this._onClearSearch);
this.includeBrowserStylesCheckbox.addEventListener("input",
this._onIncludeBrowserStyles);
@ -546,19 +543,6 @@ CssComputedView.prototype = {
}, 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
* box. Returns true if the search box is cleared and false otherwise.
@ -654,8 +638,7 @@ CssComputedView.prototype = {
* Focus the window on mousedown.
*/
focusWindow: function () {
let win = this.styleDocument.defaultView;
win.focus();
this.styleWindow.focus();
},
/**
@ -692,7 +675,7 @@ CssComputedView.prototype = {
*/
copySelection: function () {
try {
let win = this.styleDocument.defaultView;
let win = this.styleWindow;
let text = win.getSelection().toString().trim();
// Tidy up block headings by moving CSS property names and their
@ -758,7 +741,7 @@ CssComputedView.prototype = {
this.element.removeEventListener("contextmenu", this._onContextMenu);
this.searchField.removeEventListener("input", this._onFilterStyles);
this.searchField.removeEventListener("contextmenu",
this._onFilterTextboxContextMenu);
this.inspector.onTextBoxContextMenu);
this.searchClearButton.removeEventListener("click", this._onClearSearch);
this.includeBrowserStylesCheckbox.removeEventListener("input",
this._onIncludeBrowserStyles);

View File

@ -17,7 +17,7 @@ add_task(function* () {
let win = view.styleWindow;
let searchField = view.searchField;
let searchContextMenu = toolbox.textboxContextMenuPopup;
let searchContextMenu = toolbox.textBoxContextMenuPopup;
ok(searchContextMenu,
"The search filter context menu is loaded in the computed view");

View File

@ -32,9 +32,10 @@ FontInspector.prototype = {
this.showAllLink = this.chromeDoc.getElementById("font-showall");
this.showAllLink.addEventListener("click", this.showAll);
this.previewTextChanged = this.previewTextChanged.bind(this);
this.previewInput =
this.chromeDoc.getElementById("font-preview-text-input");
this.previewInput = this.chromeDoc.getElementById("font-preview-text-input");
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
gDevTools.on("theme-switched", this.onThemeChanged);
@ -59,6 +60,8 @@ FontInspector.prototype = {
this.inspector.selection.off("new-node-front", this.onNewNode);
this.showAllLink.removeEventListener("click", this.showAll);
this.previewInput.removeEventListener("input", this.previewTextChanged);
this.previewInput.removeEventListener("contextmenu",
this.inspector.onTextBoxContextMenu);
gDevTools.off("theme-switched", this.onThemeChanged);

View File

@ -42,12 +42,9 @@ function InspectorSearch(inspector, input, clearBtn) {
this._onKeyDown = this._onKeyDown.bind(this);
this._onInput = this._onInput.bind(this);
this._onClearSearch = this._onClearSearch.bind(this);
this._onFilterTextboxContextMenu =
this._onFilterTextboxContextMenu.bind(this);
this.searchBox.addEventListener("keydown", this._onKeyDown, true);
this.searchBox.addEventListener("input", this._onInput, true);
this.searchBox.addEventListener("contextmenu",
this._onFilterTextboxContextMenu);
this.searchBox.addEventListener("contextmenu", this.inspector.onTextBoxContextMenu);
this.searchClearButton.addEventListener("click", this._onClearSearch);
// 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("input", this._onInput, true);
this.searchBox.removeEventListener("contextmenu",
this._onFilterTextboxContextMenu);
this.inspector.onTextBoxContextMenu);
this.searchClearButton.removeEventListener("click", this._onClearSearch);
this.searchBox = 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 () {
this.searchBox.classList.remove("devtools-style-searchbox-no-match");
this.searchBox.value = "";

View File

@ -4,8 +4,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* global window */
"use strict";
var Cu = Components.utils;
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var promise = require("promise");
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
* to source-mapped files)
*/
function InspectorPanel(iframeWindow, toolbox) {
function Inspector(toolbox) {
this._toolbox = toolbox;
this._target = toolbox.target;
this.panelDoc = iframeWindow.document;
this.panelWin = iframeWindow;
this.panelDoc = window.document;
this.panelWin = window;
this.panelWin.inspector = this;
this.telemetry = new Telemetry();
@ -96,6 +100,7 @@ function InspectorPanel(iframeWindow, toolbox) {
this._onBeforeNavigate = this._onBeforeNavigate.bind(this);
this.onNewRoot = this.onNewRoot.bind(this);
this._onContextMenu = this._onContextMenu.bind(this);
this.onTextBoxContextMenu = this.onTextBoxContextMenu.bind(this);
this._updateSearchResultsLabel = this._updateSearchResultsLabel.bind(this);
this.onNewSelection = this.onNewSelection.bind(this);
this.onBeforeNewSelection = this.onBeforeNewSelection.bind(this);
@ -112,13 +117,11 @@ function InspectorPanel(iframeWindow, toolbox) {
EventEmitter.decorate(this);
}
exports.InspectorPanel = InspectorPanel;
InspectorPanel.prototype = {
Inspector.prototype = {
/**
* open is effectively an asynchronous constructor
*/
open: Task.async(function* () {
init: Task.async(function* () {
// Localize all the nodes containing a data-localization attribute.
localizeMarkup(this.panelDoc);
@ -146,6 +149,10 @@ InspectorPanel.prototype = {
return this._toolbox.selection;
},
get highlighter() {
return this._toolbox.highlighter;
},
get isOuterHTMLEditable() {
return this._target.client.traits.editOuterHTML;
},
@ -275,7 +282,7 @@ InspectorPanel.prototype = {
},
_getPageStyle: function () {
return this._toolbox.inspector.getPageStyle().then(pageStyle => {
return this.inspector.getPageStyle().then(pageStyle => {
this.pageStyle = pageStyle;
}, this._handleRejectionIfNotDestroyed);
},
@ -441,8 +448,6 @@ InspectorPanel.prototype = {
let SplitBox = this.React.createFactory(this.browserRequire(
"devtools/client/shared/components/splitter/split-box"));
this.panelWin.addEventListener("resize", this.onPanelWindowResize, true);
let splitter = SplitBox({
className: "inspector-sidebar-splitter",
initialWidth: INITIAL_SIDEBAR_SIZE,
@ -462,6 +467,8 @@ InspectorPanel.prototype = {
this._splitter = this.ReactDOM.render(splitter,
this.panelDoc.getElementById("inspector-splitter-box"));
this.panelWin.addEventListener("resize", this.onPanelWindowResize, true);
// Persist splitter state in preferences.
this.sidebar.on("show", this.onSidebarShown);
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.
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) {
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 } = { }) {
let markupContainer = this.markup.getContainer(this.selection.nodeFront);
@ -1273,7 +1291,7 @@ InspectorPanel.prototype = {
this._markupFrame = doc.createElement("iframe");
this._markupFrame.setAttribute("flex", "1");
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._markupFrame.addEventListener("load", this._onMarkupFrameLoad, true);
@ -1302,7 +1320,7 @@ InspectorPanel.prototype = {
if (this._markupFrame) {
this._markupFrame.removeEventListener("load", this._onMarkupFrameLoad, true);
this._markupFrame.removeEventListener("contextmenu", this._onContextMenu, true);
this._markupFrame.removeEventListener("contextmenu", this._onContextMenu);
}
if (this.markup) {
@ -1816,3 +1834,90 @@ InspectorPanel.prototype = {
}, 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);
});
}

View File

@ -25,6 +25,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="application/javascript;version=1.8"
src="chrome://devtools/content/shared/theme-switching.js"></script>
<script type="application/javascript;version=1.8" src="inspector.js" defer="true"></script>
</head>
<body class="theme-body" role="application">
<div class="inspector-responsive-container theme-body inspector">

View File

@ -84,8 +84,8 @@ const INSPECTOR_L10N = new LocalizationHelper("devtools/locale/inspector.propert
* An iframe in which the caller has kindly loaded markup.xhtml.
*/
function MarkupView(inspector, frame, controllerWindow) {
this._inspector = inspector;
this.walker = this._inspector.walker;
this.inspector = inspector;
this.walker = this.inspector.walker;
this._frame = frame;
this.win = this._frame.contentWindow;
this.doc = this._frame.contentDocument;
@ -109,7 +109,7 @@ function MarkupView(inspector, frame, controllerWindow) {
theme: "auto",
};
this.popup = new AutocompletePopup(inspector._toolbox, options);
this.popup = new AutocompletePopup(inspector.toolbox, options);
this.undo = new UndoStack();
this.undo.installController(controllerWindow);
@ -145,8 +145,8 @@ function MarkupView(inspector, frame, controllerWindow) {
this._frame.addEventListener("focus", this._onFocus, false);
this.walker.on("mutations", this._mutationObserver);
this.walker.on("display-change", this._onDisplayChange);
this._inspector.selection.on("new-node-front", this._onNewSelection);
this._inspector.toolbox.on("picker-node-hovered", this._onToolboxPickerHover);
this.inspector.selection.on("new-node-front", this._onNewSelection);
this.toolbox.on("picker-node-hovered", this._onToolboxPickerHover);
this._onNewSelection();
this._initTooltips();
@ -168,6 +168,10 @@ MarkupView.prototype = {
_selectedContainer: null,
get toolbox() {
return this.inspector.toolbox;
},
/**
* Handle promise rejections for various asynchronous actions, and only log errors if
* the markup view still exists.
@ -181,9 +185,9 @@ MarkupView.prototype = {
},
_initTooltips: function () {
this.eventDetailsTooltip = new HTMLTooltip(this._inspector.toolbox,
this.eventDetailsTooltip = new HTMLTooltip(this.toolbox,
{type: "arrow"});
this.imagePreviewTooltip = new HTMLTooltip(this._inspector.toolbox,
this.imagePreviewTooltip = new HTMLTooltip(this.toolbox,
{type: "arrow", useXulWrapper: "true"});
this._enableImagePreviewTooltip();
},
@ -423,8 +427,7 @@ MarkupView.prototype = {
* requests queued up
*/
_showBoxModel: function (nodeFront) {
return this._inspector.toolbox.highlighterUtils
.highlightNodeFront(nodeFront);
return this.toolbox.highlighterUtils.highlightNodeFront(nodeFront);
},
/**
@ -437,7 +440,7 @@ MarkupView.prototype = {
* requests queued up
*/
_hideBoxModel: function (forceHide) {
return this._inspector.toolbox.highlighterUtils.unhighlight(forceHide);
return this.toolbox.highlighterUtils.unhighlight(forceHide);
},
_briefBoxModelTimer: null,
@ -551,14 +554,14 @@ MarkupView.prototype = {
* highlighted.
*/
_shouldNewSelectionBeHighlighted: function () {
let reason = this._inspector.selection.reason;
let reason = this.inspector.selection.reason;
let unwantedReasons = [
"inspector-open",
"navigateaway",
"nodeselected",
"test"
];
let isHighlight = this._hoveredNode === this._inspector.selection.nodeFront;
let isHighlight = this._hoveredNode === this.inspector.selection.nodeFront;
return !isHighlight && reason && unwantedReasons.indexOf(reason) === -1;
},
@ -568,7 +571,7 @@ MarkupView.prototype = {
* the view.
*/
_onNewSelection: function () {
let selection = this._inspector.selection;
let selection = this.inspector.selection;
this.htmlEditor.hide();
if (this._hoveredNode && this._hoveredNode !== selection.nodeFront) {
@ -581,7 +584,7 @@ MarkupView.prototype = {
return;
}
let done = this._inspector.updating("markup-view");
let done = this.inspector.updating("markup-view");
let onShowBoxModel, onShow;
// Highlight the element briefly if needed.
@ -611,7 +614,7 @@ MarkupView.prototype = {
* on why the current node got selected.
*/
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.
let reasonsToNavigate = [
@ -656,9 +659,9 @@ MarkupView.prototype = {
return;
}
let selection = this._inspector.selection;
let selection = this.inspector.selection;
if (selection.isNode()) {
this._inspector.copyOuterHTML();
this.inspector.copyOuterHTML();
}
evt.stopPropagation();
evt.preventDefault();
@ -713,7 +716,7 @@ MarkupView.prototype = {
}
case "markupView.scrollInto.key": {
let selection = this._selectedContainer.node;
this._inspector.scrollNodeIntoView(selection);
this.inspector.scrollNodeIntoView(selection);
break;
}
// Generic keys
@ -965,12 +968,12 @@ MarkupView.prototype = {
this._elt.appendChild(container.elt);
this._rootNode = node;
} 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 ||
nodeType == nodeConstants.TEXT_NODE) {
container = new MarkupTextContainer(this, node, this._inspector);
container = new MarkupTextContainer(this, node, this.inspector);
} else {
container = new MarkupReadOnlyContainer(this, node, this._inspector);
container = new MarkupReadOnlyContainer(this, node, this.inspector);
}
if (flashNode) {
@ -982,7 +985,7 @@ MarkupView.prototype = {
this._updateChildren(container);
this._inspector.emit("container-created", container);
this.inspector.emit("container-created", container);
return container;
},
@ -1039,7 +1042,7 @@ MarkupView.prototype = {
return;
}
this._flashMutatedNodes(mutations);
this._inspector.emit("markupmutation", mutations);
this.inspector.emit("markupmutation", mutations);
// Since the htmlEditor is absolutely positioned, a mutation may change
// the location in which it should be shown.
@ -1277,13 +1280,13 @@ MarkupView.prototype = {
return;
}
this._inspector.off("markupmutation", onMutations);
this.inspector.off("markupmutation", onMutations);
this._removedNodeObserver = null;
// Don't select the new node if the user has already changed the current
// selection.
if (this._inspector.selection.nodeFront === parentContainer.node ||
(this._inspector.selection.nodeFront === removedNode && isHTMLTag)) {
if (this.inspector.selection.nodeFront === parentContainer.node ||
(this.inspector.selection.nodeFront === removedNode && isHTMLTag)) {
let childContainers = parentContainer.getChildContainers();
if (childContainers && childContainers[childIndex]) {
this.markNodeAsSelected(childContainers[childIndex].node, reason);
@ -1297,7 +1300,7 @@ MarkupView.prototype = {
// Start listening for mutations until we find a childList change that has
// removedNode removed.
this._inspector.on("markupmutation", onMutations);
this.inspector.on("markupmutation", onMutations);
},
/**
@ -1307,7 +1310,7 @@ MarkupView.prototype = {
*/
cancelReselectOnRemoved: function () {
if (this._removedNodeObserver) {
this._inspector.off("markupmutation", this._removedNodeObserver);
this.inspector.off("markupmutation", this._removedNodeObserver);
this._removedNodeObserver = null;
this.emit("canceledreselectonremoved");
}
@ -1479,8 +1482,8 @@ MarkupView.prototype = {
}
// Change the current selection if needed.
if (this._inspector.selection.nodeFront !== node) {
this._inspector.selection.setNodeFront(node, reason || "nodeselected");
if (this.inspector.selection.nodeFront !== node) {
this.inspector.selection.setNodeFront(node, reason || "nodeselected");
}
return true;
@ -1526,7 +1529,7 @@ MarkupView.prototype = {
*/
_checkSelectionVisible: function (container) {
let centered = null;
let node = this._inspector.selection.nodeFront;
let node = this.inspector.selection.nodeFront;
while (node) {
if (node.parentNode() === container.node) {
centered = node;
@ -1741,8 +1744,8 @@ MarkupView.prototype = {
this._frame.removeEventListener("focus", this._onFocus, false);
this.walker.off("mutations", this._mutationObserver);
this.walker.off("display-change", this._onDisplayChange);
this._inspector.selection.off("new-node-front", this._onNewSelection);
this._inspector.toolbox.off("picker-node-hovered",
this.inspector.selection.off("new-node-front", this._onNewSelection);
this.toolbox.off("picker-node-hovered",
this._onToolboxPickerHover);
this._prefObserver.off(ATTR_COLLAPSE_ENABLED_PREF,
@ -2338,7 +2341,7 @@ MarkupContainer.prototype = {
let type = target.dataset.type;
// Make container tabbable descendants not tabbable (by default).
this.canFocus = false;
this.markup._inspector.followAttributeLink(type, link);
this.markup.inspector.followAttributeLink(type, link);
return;
}
@ -2646,7 +2649,7 @@ MarkupElementContainer.prototype = Heritage.extend(MarkupContainer.prototype, {
let listenerInfo = yield this.node.getEventListenerInfo();
let toolbox = this.markup._inspector.toolbox;
let toolbox = this.markup.toolbox;
setEventTooltip(tooltip, listenerInfo, toolbox);
// Disable the image preview tooltip while we display the event details
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();
@ -2966,7 +2970,7 @@ function ElementEditor(container, node) {
this.markup = this.container.markup;
this.template = this.markup.template.bind(this.markup);
this.doc = this.markup.doc;
this._cssProperties = getCssProperties(this.markup._inspector.toolbox);
this._cssProperties = getCssProperties(this.markup.toolbox);
this.attrElements = new Map();
this.animationTimers = {};
@ -2994,6 +2998,7 @@ function ElementEditor(container, node) {
trigger: "dblclick",
stopOnReturn: true,
done: this.onTagEdit.bind(this),
contextMenu: this.markup.inspector.onTextBoxContextMenu,
cssProperties: this._cssProperties
});
}
@ -3021,6 +3026,7 @@ function ElementEditor(container, node) {
undoMods.apply();
});
},
contextMenu: this.markup.inspector.onTextBoxContextMenu,
cssProperties: this._cssProperties
});
@ -3262,6 +3268,7 @@ ElementEditor.prototype = {
undoMods.apply();
});
},
contextMenu: this.markup.inspector.onTextBoxContextMenu,
cssProperties: this._cssProperties
});
@ -3362,8 +3369,7 @@ ElementEditor.prototype = {
// Only allow one refocus on attribute change at a time, so when there's
// more than 1 request in parallel, the last one wins.
if (this._editedAttributeObserver) {
this.markup._inspector.off("markupmutation",
this._editedAttributeObserver);
this.markup.inspector.off("markupmutation", this._editedAttributeObserver);
this._editedAttributeObserver = null;
}
@ -3448,7 +3454,7 @@ ElementEditor.prototype = {
// Start listening for mutations until we find an attributes change
// that modifies this attribute.
this.markup._inspector.once("markupmutation", onMutations);
this.markup.inspector.once("markupmutation", onMutations);
},
/**

View File

@ -15,7 +15,7 @@ add_task(function* () {
assertMarkupViewIsLoaded();
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}"`);
info("Waiting for will-navigate");

View File

@ -14,9 +14,9 @@ DIRS += [
DevToolsModules(
'breadcrumbs.js',
'inspector-commands.js',
'inspector-panel.js',
'inspector-search.js',
'inspector.xhtml',
'panel.js',
'toolsidebar.js',
)

View 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;

View File

@ -112,8 +112,6 @@ function CssRuleView(inspector, document, store, pageStyle) {
this._onCopy = this._onCopy.bind(this);
this._onFilterStyles = this._onFilterStyles.bind(this);
this._onClearSearch = this._onClearSearch.bind(this);
this._onFilterTextboxContextMenu =
this._onFilterTextboxContextMenu.bind(this);
this._onTogglePseudoClassPanel = this._onTogglePseudoClassPanel.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.addRuleButton.addEventListener("click", this._onAddRule);
this.searchField.addEventListener("input", this._onFilterStyles);
this.searchField.addEventListener("contextmenu",
this._onFilterTextboxContextMenu);
this.searchField.addEventListener("contextmenu", this.inspector.onTextBoxContextMenu);
this.searchClearButton.addEventListener("click", this._onClearSearch);
this.pseudoClassToggle.addEventListener("click",
this._onTogglePseudoClassPanel);
@ -470,7 +467,7 @@ CssRuleView.prototype = {
_onAddRule: function () {
let elementStyle = this._elementStyle;
let element = elementStyle.element;
let client = this.inspector.toolbox.target.client;
let client = this.inspector.target.client;
let pseudoClasses = element.pseudoClassLocks;
if (!client.traits.addNewRule) {
@ -644,19 +641,6 @@ CssRuleView.prototype = {
}, 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
* 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.searchField.removeEventListener("input", this._onFilterStyles);
this.searchField.removeEventListener("contextmenu",
this._onFilterTextboxContextMenu);
this.inspector.onTextBoxContextMenu);
this.searchClearButton.removeEventListener("click", this._onClearSearch);
this.pseudoClassToggle.removeEventListener("click",
this._onTogglePseudoClassPanel);

View File

@ -16,7 +16,7 @@ add_task(function* () {
let win = view.styleWindow;
let searchField = view.searchField;
let searchContextMenu = toolbox.textboxContextMenuPopup;
let searchContextMenu = toolbox.textBoxContextMenuPopup;
ok(searchContextMenu,
"The search filter context menu is loaded in the rule view");

View File

@ -87,7 +87,7 @@ RuleEditor.prototype = {
get isSelectorEditable() {
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 !== CSSRule.KEYFRAME_RULE;
@ -145,7 +145,8 @@ RuleEditor.prototype = {
editableField({
element: this.selectorText,
done: this._onSelectorDone,
cssProperties: this.rule.cssProperties
cssProperties: this.rule.cssProperties,
contextMenu: this.ruleView.inspector.onTextBoxContextMenu
});
}
@ -448,7 +449,8 @@ RuleEditor.prototype = {
advanceChars: ":",
contentType: InplaceEditor.CONTENT_TYPES.CSS_PROPERTY,
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.

View File

@ -219,7 +219,8 @@ TextPropertyEditor.prototype = {
advanceChars: ":",
contentType: InplaceEditor.CONTENT_TYPES.CSS_PROPERTY,
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.
@ -289,7 +290,8 @@ TextPropertyEditor.prototype = {
popup: this.popup,
multiline: true,
maxWidth: () => this.container.getBoundingClientRect().width,
cssProperties: this.cssProperties
cssProperties: this.cssProperties,
contextMenu: this.ruleView.inspector.onTextBoxContextMenu
});
}
},

View File

@ -161,3 +161,4 @@ subsuite = clipboard
[browser_inspector_search-navigation.js]
[browser_inspector_sidebarstate.js]
[browser_inspector_switch-to-inspector-on-pick.js]
[browser_inspector_textbox-menu.js]

View File

@ -34,7 +34,7 @@ add_task(function* () {
info("Waiting for box mode to show.");
let body = yield getNodeFront("body", inspector);
yield toolbox.highlighter.showBoxModel(body);
yield inspector.highlighter.showBoxModel(body);
info("Waiting for element picker to become active.");
yield startPicker(toolbox);

View File

@ -27,11 +27,11 @@ const ELEMENTS = ["box-model-root",
"box-model-infobar-dimensions"];
add_task(function* () {
let {inspector, toolbox, testActor} = yield openInspectorForURL(TEST_URL);
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("Show the box-model highlighter");
let divFront = yield getNodeFront("div", inspector);
yield toolbox.highlighter.showBoxModel(divFront);
yield inspector.highlighter.showBoxModel(divFront);
for (let id of ELEMENTS) {
let foundId = yield testActor.getHighlighterNodeAttribute(id, "id");
@ -39,5 +39,5 @@ add_task(function* () {
}
info("Hide the box-model highlighter");
yield toolbox.highlighter.hideBoxModel();
yield inspector.highlighter.hideBoxModel();
});

View File

@ -11,7 +11,7 @@
const TEST_URL = "data:text/html;charset=utf-8,<p>Select me!</p>";
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 " +
"currently hovered node");
@ -24,7 +24,7 @@ add_task(function* () {
info("listen to the highlighter's hidden event");
let onHidden = testActor.waitForHighlighterEvent("hidden",
toolbox.highlighter);
inspector.highlighter);
info("mouse-leave the markup-view");
yield mouseLeaveMarkupView(inspector);
yield onHidden;

View File

@ -46,7 +46,7 @@ add_task(function* () {
info("Key pressed. Waiting for element to be picked");
testActor.synthesizeKey(args);
return promise.all([
toolbox.selection.once("new-node-front"),
inspector.selection.once("new-node-front"),
inspector.once("inspector-updated")
]);
}

View File

@ -185,7 +185,7 @@ const TEST_DATA = [
];
add_task(function* () {
let {inspector, toolbox, testActor} = yield openInspectorForURL(
let {inspector, testActor} = yield openInspectorForURL(
"data:text/html;charset=utf-8," + encodeURI(TEST_URL));
let divFront = yield getNodeFront("div", inspector);
@ -194,11 +194,11 @@ add_task(function* () {
info("Running test: " + desc);
info("Show the box-model highlighter with options " + options);
yield toolbox.highlighter.showBoxModel(divFront, options);
yield inspector.highlighter.showBoxModel(divFront, options);
yield checkHighlighter(testActor);
info("Hide the box-model highlighter");
yield toolbox.highlighter.hideBoxModel();
yield inspector.highlighter.hideBoxModel();
}
});

View File

@ -22,7 +22,7 @@ add_task(function* () {
info("Key pressed. Waiting for element to be picked");
testActor.synthesizeKey(msg);
return promise.all([
toolbox.selection.once("new-node-front"),
inspector.selection.once("new-node-front"),
inspector.once("inspector-updated")
]);
}

View File

@ -15,7 +15,7 @@ add_task(function* () {
let divFront = yield getNodeFront("div", inspector);
info("Waiting for highlighter to activate");
yield inspector.toolbox.highlighter.showBoxModel(divFront);
yield inspector.highlighter.showBoxModel(divFront);
let rect = yield testActor.getSimpleBorderRect();
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");
info("Waiting for highlighter to hide");
yield inspector.toolbox.highlighter.hideBoxModel();
yield inspector.highlighter.hideBoxModel();
});

View File

@ -89,9 +89,8 @@ function* testNavigate(inspector, testActor, ruleview) {
}
function* showPickerOn(selector, inspector) {
let highlighter = inspector.toolbox.highlighter;
let nodeFront = yield getNodeFront(selector, inspector);
yield highlighter.showBoxModel(nodeFront);
yield inspector.highlighter.showBoxModel(nodeFront);
}
function* assertPseudoAddedToNode(inspector, testActor, ruleview) {
@ -119,7 +118,7 @@ function* assertPseudoAddedToNode(inspector, testActor, ruleview) {
let value = yield testActor.getHighlighterNodeTextContent(
"box-model-infobar-pseudo-classes");
is(value, PSEUDO, "pseudo-class in infobar selector");
yield inspector.toolbox.highlighter.hideBoxModel();
yield inspector.highlighter.hideBoxModel();
}
function* assertPseudoRemovedFromNode(testActor) {
@ -145,5 +144,5 @@ function* assertPseudoRemovedFromView(inspector, testActor, ruleview) {
let value = yield testActor.getHighlighterNodeTextContent(
"box-model-infobar-pseudo-classes");
is(value, "", "pseudo-class removed from infobar selector");
yield inspector.toolbox.highlighter.hideBoxModel();
yield inspector.highlighter.hideBoxModel();
}

View File

@ -15,7 +15,7 @@ add_task(function* () {
yield selectNode("h1", inspector);
let win = inspector.panelWin;
let searchContextMenu = toolbox.textboxContextMenuPopup;
let searchContextMenu = toolbox.textBoxContextMenuPopup;
ok(searchContextMenu,
"The search filter context menu is loaded in the inspector");

View File

@ -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");
}

View File

@ -25,6 +25,7 @@ devtools.jar:
content/shared/frame-script-utils.js (shared/frame-script-utils.js)
content/styleeditor/styleeditor.xul (styleeditor/styleeditor.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/markup/markup.xhtml (inspector/markup/markup.xhtml)
content/animationinspector/animation-controller.js (animationinspector/animation-controller.js)

View File

@ -350,6 +350,10 @@ pref("devtools.jsonview.enabled", false);
pref("devtools.jsonview.enabled", true);
#endif
// Disable the HTML responsive design tool by default. Currently disabled until
// ready to replace the legacy XUL version.
// Enable the HTML responsive design tool in Nightly only. Disabled by default for all
// other channels.
#ifdef NIGHTLY_BUILD
pref("devtools.responsive.html.enabled", true);
#else
pref("devtools.responsive.html.enabled", false);
#endif

View File

@ -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 {
bootstrap.dispatch(resizeViewport(0, width, height));
} catch (e) {

View File

@ -172,7 +172,7 @@ const ResponsiveUIManager = exports.ResponsiveUIManager = {
switch (command) {
case "resize to":
completed = this.openIfNeeded(window, tab, { command: true });
this.activeTabs.get(tab).setViewportSize(args.width, args.height);
this.activeTabs.get(tab).setViewportSize(args);
break;
case "resize on":
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;
this.toolWindow.setViewportSize(width, height);
this.toolWindow.setViewportSize(size);
}),
/**

View File

@ -49,6 +49,13 @@ let reducers = {
return viewport;
}
if (!width) {
width = viewport.width;
}
if (!height) {
height = viewport.height;
}
return Object.assign({}, viewport, {
width,
height,

View File

@ -142,7 +142,7 @@ var setViewportSize = Task.async(function* (ui, manager, width, height) {
`set to: ${width} x ${height}`);
if (size.width != width || size.height != height) {
let resized = waitForViewportResizeTo(ui, width, height);
ui.setViewportSize(width, height);
ui.setViewportSize({ width, height });
yield resized;
}
});

View File

@ -62,7 +62,7 @@ var Manager = {
if (this.isActiveForTab(aTab)) {
ActiveTabs.get(aTab).close();
} else {
this.runIfNeeded(aWindow, aTab);
this.openIfNeeded(aWindow, aTab);
}
},
@ -73,7 +73,7 @@ var Manager = {
* @param aTab the tab targeted.
* @returns {ResponsiveUI} the instance of ResponsiveUI for the current tab.
*/
runIfNeeded: Task.async(function* (aWindow, aTab) {
openIfNeeded: Task.async(function* (aWindow, aTab) {
let ui;
if (!this.isActiveForTab(aTab)) {
ui = new ResponsiveUI(aWindow, aTab);
@ -111,11 +111,11 @@ var Manager = {
handleGcliCommand: Task.async(function* (aWindow, aTab, aCommand, aArgs) {
switch (aCommand) {
case "resize to":
let ui = yield this.runIfNeeded(aWindow, aTab);
ui.setSize(aArgs.width, aArgs.height);
let ui = yield this.openIfNeeded(aWindow, aTab);
ui.setViewportSize(aArgs);
break;
case "resize on":
this.runIfNeeded(aWindow, aTab);
this.openIfNeeded(aWindow, aTab);
break;
case "resize off":
if (this.isActiveForTab(aTab)) {
@ -131,10 +131,12 @@ var Manager = {
EventEmitter.decorate(Manager);
// If the experimental HTML UI is enabled, delegate the ResponsiveUIManager API
// over to that tool instead. Performing this delegation here allows us to
// contain the pref check to a single place.
if (Services.prefs.getBoolPref("devtools.responsive.html.enabled")) {
// If the new HTML RDM UI is enabled and e10s is enabled by default (e10s is required for
// the new HTML RDM UI to function), delegate the ResponsiveUIManager API over to that
// tool instead. Performing this delegation here allows us to contain the pref check to a
// single place.
if (Services.prefs.getBoolPref("devtools.responsive.html.enabled") &&
Services.appinfo.browserTabsRemoteAutostart) {
let { ResponsiveUIManager } =
require("devtools/client/responsive.html/manager");
this.ResponsiveUIManager = ResponsiveUIManager;
@ -417,7 +419,7 @@ ResponsiveUI.prototype = {
* Emit an event when the content has been resized. Only used in tests.
*/
onContentResize: function (msg) {
ResponsiveUIManager.emit("contentResize", {
ResponsiveUIManager.emit("content-resize", {
tab: this.tab,
width: msg.data.width,
height: msg.data.height,
@ -443,6 +445,10 @@ ResponsiveUI.prototype = {
}
},
getViewportBrowser() {
return this.browser;
},
/**
* Check the menu items.
*/
@ -673,7 +679,10 @@ ResponsiveUI.prototype = {
let h = this.customPreset.height = parseInt(value[2], 10);
this.saveCustomSize();
this.setSize(w, h);
this.setViewportSize({
width: w,
height: h,
});
},
/**
@ -755,11 +764,9 @@ ResponsiveUI.prototype = {
/**
* Apply a preset.
*
* @param aPreset preset to apply.
*/
loadPreset: function RUI_loadPreset(aPreset) {
this.setSize(aPreset.width, aPreset.height);
loadPreset(preset) {
this.setViewportSize(preset);
},
/**
@ -845,7 +852,10 @@ ResponsiveUI.prototype = {
this.menulist.selectedItem = menuitem;
this.currentPresetKey = this.customPreset.key;
this.setSize(w, h);
this.setViewportSize({
width: w,
height: h,
});
this.savePresets();
},
@ -858,7 +868,10 @@ ResponsiveUI.prototype = {
let width = this.rotateValue ? selectedPreset.height : selectedPreset.width;
let height = this.rotateValue ? selectedPreset.width : selectedPreset.height;
this.setSize(height, width);
this.setViewportSize({
width: height,
height: width,
});
if (selectedPreset.custom) {
this.saveCustomSize();
@ -999,15 +1012,16 @@ ResponsiveUI.prototype = {
},
/**
* Change the size of the browser.
*
* @param aWidth width of the browser.
* @param aHeight height of the browser.
* Change the size of the viewport.
*/
setSize: function RUI_setSize(aWidth, aHeight) {
debug(`SET SIZE TO ${aWidth} x ${aHeight}`);
this.setWidth(aWidth);
this.setHeight(aHeight);
setViewportSize({ width, height }) {
debug(`SET SIZE TO ${width} x ${height}`);
if (width) {
this.setWidth(width);
}
if (height) {
this.setHeight(height);
}
},
setWidth: function RUI_setWidth(aWidth) {
@ -1122,7 +1136,7 @@ ResponsiveUI.prototype = {
this.lastScreenY = screenY;
}
this.setSize(width, height);
this.setViewportSize({ width, height });
},
/**

View File

@ -111,7 +111,7 @@ function* testManualMouseResize(rdm, manager, pressedKey) {
EventUtils.synthesizeMouse(rdm.resizer, x, y, mouseMoveParams, window);
EventUtils.synthesizeMouse(rdm.resizer, x, y, {type: "mouseup"}, window);
yield once(manager, "contentResize");
yield once(manager, "content-resize");
let expectedWidth = initialWidth + 20;
let expectedHeight = initialHeight + 10;
@ -138,7 +138,7 @@ function* testResizeUsingCustomInput(rdm, manager) {
// Only the `change` event must change the size
EventUtils.synthesizeKey("VK_RETURN", {});
yield once(manager, "contentResize");
yield once(manager, "content-resize");
yield verifyResize(rdm, expectedWidth, expectedHeight);
}
@ -172,7 +172,7 @@ function* testRotate(rdm, manager) {
let {width: initialWidth, height: initialHeight} = yield getSizing();
rdm.rotate();
yield once(manager, "contentResize");
yield once(manager, "content-resize");
let newSize = yield getSizing();
is(newSize.width, initialHeight, "The width should now be the height.");

View File

@ -12,7 +12,7 @@ add_task(function* () {
yield once(newWindow.gBrowser, "load", true);
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
// wait for the UI to gracefully shutdown. This has leaked the window

View File

@ -46,10 +46,13 @@ add_task(function* () {
Services.prompt.value = "Testing preset";
Services.prompt.returnBool = true;
let resized = once(manager, "contentResize");
let resized = once(manager, "content-resize");
let customHeight = 123, customWidth = 456;
rdm.startResizing({});
rdm.setSize(customWidth, customHeight);
rdm.setViewportSize({
width: customWidth,
height: customHeight,
});
rdm.stopResizing({});
rdm.addbutton.doCommand();

View File

@ -13,8 +13,11 @@ let gcliHelpersURI = testDir + "../../../commandline/test/helpers.js";
Services.scriptloader.loadSubScript(gcliHelpersURI, this);
flags.testing = true;
Services.prefs.setBoolPref("devtools.responsive.html.enabled", false);
registerCleanupFunction(() => {
flags.testing = false;
Services.prefs.clearUserPref("devtools.responsive.html.enabled");
Services.prefs.clearUserPref("devtools.responsiveUI.currentPreset");
Services.prefs.clearUserPref("devtools.responsiveUI.customHeight");
Services.prefs.clearUserPref("devtools.responsiveUI.customWidth");
@ -37,7 +40,7 @@ var openRDM = Task.async(function* (tab = gBrowser.selectedTab,
let manager = ResponsiveUIManager;
let opened = once(manager, "on");
let resized = once(manager, "contentResize");
let resized = once(manager, "content-resize");
if (method == "menu") {
document.getElementById("menu_responsiveUI").doCommand();
} else {
@ -68,7 +71,7 @@ var closeRDM = Task.async(function* (rdm) {
rdm = manager.getResponsiveUIForTab(gBrowser.selectedTab);
}
let closed = once(manager, "off");
let resized = once(manager, "contentResize");
let resized = once(manager, "content-resize");
rdm.close();
yield resized;
yield closed;
@ -269,19 +272,19 @@ function waitForResizeTo(manager, width, height) {
if (data.width != width || data.height != height) {
return;
}
manager.off("contentResize", onResize);
info(`Got contentResize to ${width} x ${height}`);
manager.off("content-resize", onResize);
info(`Got content-resize to ${width} x ${height}`);
resolve();
};
info(`Waiting for contentResize to ${width} x ${height}`);
manager.on("contentResize", onResize);
info(`Waiting for content-resize to ${width} x ${height}`);
manager.on("content-resize", onResize);
});
}
var setPresetIndex = Task.async(function* (rdm, manager, index) {
info(`Current preset: ${rdm.menulist.selectedIndex}, change to: ${index}`);
if (rdm.menulist.selectedIndex != index) {
let resized = once(manager, "contentResize");
let resized = once(manager, "content-resize");
rdm.menulist.selectedIndex = index;
yield resized;
}
@ -293,7 +296,7 @@ var setSize = Task.async(function* (rdm, manager, width, height) {
`set to: ${width} x ${height}`);
if (size.width != width || size.height != height) {
let resized = waitForResizeTo(manager, width, height);
rdm.setSize(width, height);
rdm.setViewportSize({ width, height });
yield resized;
}
});

View File

@ -88,6 +88,8 @@ function isKeyIn(key, ...keys) {
* This function is called before the editor has been torn down.
* {Function} destroy:
* 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:
* This can be either a string or a function.
* 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.change = options.change;
this.done = options.done;
this.contextMenu = options.contextMenu;
this.destroy = options.destroy;
this.initial = options.initial ? options.initial : this.elt.textContent;
this.multiline = options.multiline || false;
@ -249,6 +252,7 @@ function InplaceEditor(options, event) {
this._onInput = this._onInput.bind(this);
this._onKeyup = this._onKeyup.bind(this);
this._onAutocompletePopupClick = this._onAutocompletePopupClick.bind(this);
this._onContextMenu = this._onContextMenu.bind(this);
this._createInput();
@ -290,6 +294,7 @@ function InplaceEditor(options, event) {
this.input.addEventListener("dblclick", this._stopEventPropagation, false);
this.input.addEventListener("click", 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.validate = options.validate;
@ -349,11 +354,10 @@ InplaceEditor.prototype = {
this.input.removeEventListener("keypress", this._onKeyPress, false);
this.input.removeEventListener("keyup", this._onKeyup, false);
this.input.removeEventListener("input", this._onInput, false);
this.input.removeEventListener("dblclick", this._stopEventPropagation,
false);
this.input.removeEventListener("dblclick", this._stopEventPropagation, false);
this.input.removeEventListener("click", this._stopEventPropagation, false);
this.input.removeEventListener("mousedown", this._stopEventPropagation,
false);
this.input.removeEventListener("mousedown", this._stopEventPropagation, false);
this.input.removeEventListener("contextmenu", this._onContextMenu, false);
this.doc.defaultView.removeEventListener("blur", this._onWindowBlur, false);
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.
*

View File

@ -741,7 +741,7 @@ Heritage.extend(SwatchBasedEditorTooltip.prototype, {
this.spectrum.updateUI();
}
let {target} = this.inspector.toolbox;
let {target} = this.inspector;
target.actorHasMethod("inspector", "pickColorFromPage").then(value => {
let tooltipDoc = this.tooltip.doc;
let eyeButton = tooltipDoc.querySelector("#eyedropper-button");

View File

@ -961,15 +961,8 @@ StyleEditorUI.prototype = {
let tab = this._target.tab;
let win = this._target.tab.ownerDocument.defaultView;
yield ResponsiveUIManager.runIfNeeded(win, tab);
if (options.width && options.height) {
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);
}
yield ResponsiveUIManager.openIfNeeded(win, tab);
ResponsiveUIManager.getResponsiveUIForTab(tab).setViewportSize(options);
}),
/**

View File

@ -56,6 +56,7 @@ support-files =
!/devtools/client/inspector/shared/test/head.js
!/devtools/client/inspector/test/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.js

View File

@ -10,9 +10,9 @@ const MEDIA_PREF = "devtools.styleeditor.showMediaSidebar";
const RESIZE = 300;
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)"];
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; } }";
waitForExplicitFinish();

View File

@ -7,6 +7,15 @@
/* Tests responsive mode links for
* @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 {ResponsiveUIManager} = Cu.import(mgr, {});
const TESTCASE_URI = TEST_BASE_HTTPS + "media-rules.html";
@ -21,7 +30,7 @@ add_task(function* () {
let tab = gBrowser.selectedTab;
testNumberOfLinks(editor);
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);
doFinalChecks(editor);
@ -47,12 +56,13 @@ function* testMediaLink(editor, tab, ui, itemIndex, type, value) {
let conditions = sidebar.querySelectorAll(".media-rule-condition");
let onMediaChange = once(ui, "media-list-changed");
let onContentResize = waitForResizeTo(ResponsiveUIManager, type, value);
info("Launching responsive mode");
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");
yield onMediaChange;
@ -64,14 +74,14 @@ function* testMediaLink(editor, tab, ui, itemIndex, type, value) {
ok(!conditions[itemIndex].classList.contains("media-condition-unmatched"),
"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.`);
}
function* closeRDM(tab, ui) {
info("Closing responsive mode");
ResponsiveUIManager.toggle(window, tab);
let onMediaChange = once(ui, "media-list-changed");
let onMediaChange = waitForNEvents(ui, "media-list-changed", 2);
yield once(ResponsiveUIManager, "off");
yield onMediaChange;
ok(!ResponsiveUIManager.isActiveForTab(tab),
@ -89,23 +99,31 @@ function doFinalChecks(editor) {
}
/* Helpers */
function waitForResizeTo(manager, type, value) {
function waitForResizeTo(rdmUI, type, value) {
return new Promise(resolve => {
let onResize = (_, data) => {
if (data[type] != value) {
return;
}
manager.off("contentResize", onResize);
info(`Got contentResize to a ${type} of ${value}`);
ResponsiveUIManager.off("content-resize", onResize);
if (rdmUI.off) {
rdmUI.off("content-resize", onResize);
}
info(`Got content-resize to a ${type} of ${value}`);
resolve();
};
info(`Waiting for contentResize to a ${type} of ${value}`);
manager.on("contentResize", onResize);
info(`Waiting for content-resize to a ${type} of ${value}`);
// 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() {
let browser = gBrowser.selectedBrowser;
function* getSizing(rdmUI) {
let browser = rdmUI.getViewportBrowser();
let sizing = yield ContentTask.spawn(browser, {}, function* () {
return {
width: content.innerWidth,

View File

@ -22,8 +22,8 @@ div {
}
}
@media (min-height: 200px) and (max-height: 250px) {
@media (min-height: 300px) and (max-height: 320px) {
div {
color: orange;
}
}
}

View File

@ -11,6 +11,14 @@
--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 */
window {
overflow: hidden;
@ -117,6 +125,10 @@ window {
padding: 0px;
border-bottom-width: 0px;
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;
position: relative;
}

View File

@ -214,7 +214,7 @@
#breadcrumb-separator-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

View File

@ -112,13 +112,13 @@ class MachCommands(MachCommandBase):
destination_path = resolve_path(self.topsrcdir,
'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()
preamble = '/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */\n\n'
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)
print('The database was successfully generated at ' + destination_path)

File diff suppressed because one or more lines are too long

View File

@ -308,8 +308,7 @@ ContentEventHandler::Init(WidgetQueryContentEvent* aEvent)
} else {
LineBreakType lineBreakType = GetLineBreakType(aEvent);
uint32_t selectionStart = 0;
rv = GetFlatTextLengthBefore(mFirstSelectedRange,
&selectionStart, lineBreakType);
rv = GetStartOffset(mFirstSelectedRange, &selectionStart, lineBreakType);
if (NS_WARN_IF(NS_FAILED(rv))) {
return NS_ERROR_FAILURE;
}
@ -1309,8 +1308,8 @@ ContentEventHandler::OnQuerySelectedText(WidgetQueryContentEvent* aEvent)
"The reply string must be empty");
LineBreakType lineBreakType = GetLineBreakType(aEvent);
rv = GetFlatTextLengthBefore(mFirstSelectedRange,
&aEvent->mReply.mOffset, lineBreakType);
rv = GetStartOffset(mFirstSelectedRange,
&aEvent->mReply.mOffset, lineBreakType);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsINode> anchorNode, focusNode;
@ -2440,8 +2439,8 @@ ContentEventHandler::OnQueryCaretRect(WidgetQueryContentEvent* aEvent)
nsIFrame* caretFrame = nsCaret::GetGeometry(mSelection, &caretRect);
if (caretFrame) {
uint32_t offset;
rv = GetFlatTextLengthBefore(mFirstSelectedRange,
&offset, GetLineBreakType(aEvent));
rv = GetStartOffset(mFirstSelectedRange,
&offset, GetLineBreakType(aEvent));
NS_ENSURE_SUCCESS(rv, rv);
if (offset == aEvent->mInput.mOffset) {
rv = ConvertToRootRelativeOffset(caretFrame, caretRect);
@ -2698,6 +2697,10 @@ ContentEventHandler::GetFlatTextLengthInRange(
// destroying without initializing causes unexpected NS_ASSERTION() call.
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
// 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
@ -2707,12 +2710,12 @@ ContentEventHandler::GetFlatTextLengthInRange(
MOZ_ASSERT(parent && parent->IndexOf(aStartPosition.mNode) == -1,
"At removing the node, the node shouldn't be in the array of children "
"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");
MOZ_ASSERT(aStartPosition.mOffset == 0,
"When the node is being removed, the start offset should be 0");
MOZ_ASSERT(static_cast<uint32_t>(aEndPosition.mOffset) ==
aEndPosition.mNode->GetChildCount(),
MOZ_ASSERT(static_cast<uint32_t>(endPosition.mOffset) ==
endPosition.mNode->GetChildCount(),
"When the node is being removed, the end offset should be child count");
iter = NS_NewPreContentIterator();
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,
// we need to include a line break caused by the open tag.
NodePosition endPosition;
if (aEndPosition.mNode != aRootContent &&
aEndPosition.IsImmediatelyAfterOpenTag()) {
if (aEndPosition.mNode->HasChildren()) {
// When the end node has some children, move the end position to the
// start of its first child.
nsINode* firstChild = aEndPosition.mNode->GetFirstChild();
if (endPosition.mNode != aRootContent &&
endPosition.IsImmediatelyAfterOpenTag()) {
if (endPosition.mNode->HasChildren()) {
// When the end node has some children, move the end position to before
// the open tag of its first child.
nsINode* firstChild = endPosition.mNode->GetFirstChild();
if (NS_WARN_IF(!firstChild)) {
return NS_ERROR_FAILURE;
}
endPosition = NodePosition(firstChild, 0);
endPosition = NodePositionBefore(firstChild, 0);
} else {
// 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)) {
return NS_ERROR_FAILURE;
}
int32_t indexInParent = parentContent->IndexOf(aEndPosition.mNode);
int32_t indexInParent = parentContent->IndexOf(endPosition.mNode);
if (NS_WARN_IF(indexInParent < 0)) {
return NS_ERROR_FAILURE;
}
endPosition = NodePosition(parentContent, indexInParent + 1);
endPosition = NodePositionBefore(parentContent, indexInParent + 1);
}
} else {
endPosition = aEndPosition;
}
if (endPosition.OffsetIsValid()) {
@ -2800,9 +2800,9 @@ ContentEventHandler::GetFlatTextLengthInRange(
if (node->IsNodeOfType(nsINode::eTEXT)) {
// Note: our range always starts from offset 0
if (node == aEndPosition.mNode) {
if (node == endPosition.mNode) {
*aLength += GetTextLength(content, aLineBreakType,
aEndPosition.mOffset);
endPosition.mOffset);
} else {
*aLength += GetTextLength(content, aLineBreakType);
}
@ -2812,6 +2812,11 @@ ContentEventHandler::GetFlatTextLengthInRange(
if (node == aStartPosition.mNode && !aStartPosition.IsBeforeOpenTag()) {
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);
}
}
@ -2819,14 +2824,14 @@ ContentEventHandler::GetFlatTextLengthInRange(
}
nsresult
ContentEventHandler::GetFlatTextLengthBefore(nsRange* aRange,
uint32_t* aOffset,
LineBreakType aLineBreakType)
ContentEventHandler::GetStartOffset(nsRange* aRange,
uint32_t* aOffset,
LineBreakType aLineBreakType)
{
MOZ_ASSERT(aRange);
return GetFlatTextLengthInRange(
NodePosition(mRootContent, 0),
NodePositionBefore(aRange->GetStartParent(), aRange->StartOffset()),
NodePosition(aRange->GetStartParent(), aRange->StartOffset()),
mRootContent, aOffset, aLineBreakType);
}

View File

@ -252,10 +252,12 @@ protected:
nsresult GenerateFlatTextContent(nsRange* aRange,
nsAFlatString& aString,
LineBreakType aLineBreakType);
// Get the text length before the start position of aRange.
nsresult GetFlatTextLengthBefore(nsRange* aRange,
uint32_t* aOffset,
LineBreakType aLineBreakType);
// Get offset of start of aRange. Note that the result includes the length
// of line breaker caused by the start of aContent because aRange never
// includes the line breaker caused by its start node.
nsresult GetStartOffset(nsRange* aRange,
uint32_t* aOffset,
LineBreakType aLineBreakType);
// Check if we should insert a line break before aContent.
// This should return false only when aContent is an html element which
// is typically used in a paragraph like <em>.

View File

@ -1514,16 +1514,16 @@ nsGenericHTMLElement::MapImageBorderAttributeInto(const nsMappedAttributes* aAtt
nsCSSValue* borderLeftColor = aData->ValueForBorderLeftColor();
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();
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();
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();
if (borderBottomColor->GetUnit() == eCSSUnit_Null)
borderBottomColor->SetIntValue(NS_STYLE_COLOR_MOZ_USE_TEXT_COLOR, eCSSUnit_Enumerated);
borderBottomColor->SetIntValue(NS_COLOR_CURRENTCOLOR, eCSSUnit_EnumColor);
}
void

View File

@ -499,7 +499,6 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
, mVideoFrameContainer(aOwner->GetVideoFrameContainer())
, mPlaybackStatistics(new MediaChannelStatistics())
, mPinnedForSeek(false)
, mPausedForPlaybackRateNull(false)
, mMinimizePreroll(false)
, mMediaTracksConstructed(false)
, mFiredMetadataLoaded(false)
@ -794,7 +793,7 @@ MediaDecoder::Play()
UpdateDormantState(false /* aDormantTimeout */, true /* aActivity */);
NS_ASSERTION(mDecoderStateMachine != nullptr, "Should have state machine.");
if (mPausedForPlaybackRateNull) {
if (mPlaybackRate == 0) {
return NS_OK;
}
@ -1522,21 +1521,19 @@ void
MediaDecoder::SetPlaybackRate(double aPlaybackRate)
{
MOZ_ASSERT(NS_IsMainThread());
double oldRate = mPlaybackRate;
mPlaybackRate = aPlaybackRate;
if (mPlaybackRate == 0.0) {
mPausedForPlaybackRateNull = true;
if (aPlaybackRate == 0) {
Pause();
return;
}
if (mPausedForPlaybackRateNull) {
// Play() uses mPausedForPlaybackRateNull value, so must reset it first
mPausedForPlaybackRateNull = false;
// If the playbackRate is no longer null, restart the playback, iff the
// media was playing.
if (!mOwner->GetPaused()) {
Play();
}
if (oldRate == 0 && !mOwner->GetPaused()) {
// PlaybackRate is no longer null.
// Restart the playback if the media was playing.
Play();
}
if (mDecoderStateMachine) {

View File

@ -676,9 +676,6 @@ protected:
// while seeking.
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
// AudioStream Class.
dom::AudioChannel mAudioChannel;

View File

@ -907,28 +907,6 @@ MediaDecoderStateMachine::GetDecodedAudioDuration()
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()
{
MOZ_ASSERT(OnTaskQueue());
@ -2644,10 +2622,6 @@ MediaDecoderStateMachine::UpdatePlaybackPositionPeriodically()
return;
}
if (mAudioCaptured) {
DiscardStreamData();
}
// 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
// advance the clock to after the media end time.

View File

@ -333,8 +333,6 @@ private:
// request is discarded.
void ScheduleStateMachineIn(int64_t aMicroseconds);
// Discard audio/video data that are already played by MSG.
void DiscardStreamData();
bool HaveEnoughDecodedAudio();
bool HaveEnoughDecodedVideo();

View File

@ -36,7 +36,6 @@ public:
MozPromiseHolder<GenericPromise>&& aPromise)
: mMutex("DecodedStreamGraphListener::mMutex")
, mStream(aStream)
, mLastOutputTime(aStream->StreamTimeToMicroseconds(aStream->GetCurrentTime()))
{
mFinishPromise = Move(aPromise);
}
@ -45,8 +44,9 @@ public:
{
MutexAutoLock lock(mMutex);
if (mStream) {
mLastOutputTime = mStream->StreamTimeToMicroseconds(
mStream->GraphTimeToStreamTime(aCurrentTime));
int64_t t = mStream->StreamTimeToMicroseconds(
mStream->GraphTimeToStreamTime(aCurrentTime));
mOnOutput.Notify(t);
}
}
@ -64,12 +64,6 @@ public:
mFinishPromise.ResolveIfExists(true, __func__);
}
int64_t GetLastOutputTime()
{
MutexAutoLock lock(mMutex);
return mLastOutputTime;
}
void Forget()
{
MOZ_ASSERT(NS_IsMainThread());
@ -78,11 +72,17 @@ public:
mStream = nullptr;
}
MediaEventSource<int64_t>& OnOutput()
{
return mOnOutput;
}
private:
MediaEventProducer<int64_t> mOnOutput;
Mutex mMutex;
// Members below are protected by mMutex.
RefPtr<MediaStream> mStream;
int64_t mLastOutputTime; // microseconds
// Main thread only.
MozPromiseHolder<GenericPromise> mFinishPromise;
};
@ -121,8 +121,8 @@ public:
PlaybackInfoInit&& aInit,
MozPromiseHolder<GenericPromise>&& aPromise);
~DecodedStreamData();
int64_t GetPosition() const;
void SetPlaying(bool aPlaying);
MediaEventSource<int64_t>& OnOutput();
/* The following group of fields are protected by the decoder's monitor
* and can be read or written on any thread.
@ -192,10 +192,10 @@ DecodedStreamData::~DecodedStreamData()
mStream->Destroy();
}
int64_t
DecodedStreamData::GetPosition() const
MediaEventSource<int64_t>&
DecodedStreamData::OnOutput()
{
return mListener->GetLastOutputTime();
return mListener->OnOutput();
}
void
@ -266,6 +266,7 @@ DecodedStream::Start(int64_t aStartTime, const MediaInfo& aInfo)
MOZ_ASSERT(mStartTime.isNothing(), "playback already started.");
mStartTime.emplace(aStartTime);
mLastOutputTime = 0;
mInfo = aInfo;
mPlaying = true;
ConnectListener();
@ -314,6 +315,8 @@ DecodedStream::Start(int64_t aStartTime, const MediaInfo& aInfo)
mData = static_cast<R*>(r.get())->ReleaseData();
if (mData) {
mOutputListener = mData->OnOutput().Connect(
mOwnerThread, this, &DecodedStream::NotifyOutput);
mData->SetPlaying(mPlaying);
SendData();
}
@ -357,6 +360,8 @@ DecodedStream::DestroyData(UniquePtr<DecodedStreamData> aData)
return;
}
mOutputListener.Disconnect();
DecodedStreamData* data = aData.release();
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([=] () {
delete data;
@ -691,7 +696,21 @@ DecodedStream::GetPosition(TimeStamp* aTimeStamp) const
if (aTimeStamp) {
*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

View File

@ -72,6 +72,7 @@ private:
void SendAudio(double aVolume, bool aIsSameOrigin, const PrincipalHandle& aPrincipalHandle);
void SendVideo(bool aIsSameOrigin, const PrincipalHandle& aPrincipalHandle);
void SendData();
void NotifyOutput(int64_t aTime);
void AssertOwnerThread() const {
MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
@ -101,6 +102,7 @@ private:
PlaybackParams mParams;
Maybe<int64_t> mStartTime;
int64_t mLastOutputTime = 0; // microseconds
MediaInfo mInfo;
MediaQueue<MediaData>& mAudioQueue;
@ -110,6 +112,7 @@ private:
MediaEventListener mVideoPushListener;
MediaEventListener mAudioFinishListener;
MediaEventListener mVideoFinishListener;
MediaEventListener mOutputListener;
};
} // namespace mozilla

View File

@ -1141,8 +1141,17 @@ _dwrite_draw_glyphs_to_gdi_surface_gdi(cairo_win32_surface_t *surface,
IDWriteBitmapRenderTarget *rt;
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 =
DWriteFactory::RenderingParams(scaled_font->rendering_mode);
DWriteFactory::RenderingParams(renderingState);
rv = gdiInterop->CreateBitmapRenderTarget(surface->dc,
area.right - area.left,
@ -1174,7 +1183,7 @@ _dwrite_draw_glyphs_to_gdi_surface_gdi(cairo_win32_surface_t *surface,
area.left, area.top,
SRCCOPY | NOMIRRORBITMAP);
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_NO_CLEARTYPE:
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
* having no alpha */
if ((op != CAIRO_OPERATOR_SOURCE && op != CAIRO_OPERATOR_OVER) ||
(dst->format != CAIRO_FORMAT_RGB24))
if (op != CAIRO_OPERATOR_SOURCE && op != CAIRO_OPERATOR_OVER)
return CAIRO_INT_STATUS_UNSUPPORTED;
/* If we have a fallback mask clip set on the dst, we have

View File

@ -132,9 +132,23 @@ ContentClientBasic::CreateBuffer(ContentType aType,
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(
mBackend,
IntSize(aRect.width, aRect.height),
mBackend, size,
gfxPlatform::GetPlatform()->Optimal2DFormatForContent(aType));
}

View File

@ -40,20 +40,12 @@
#endif
#if !defined(OVR_ALIGNAS)
#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 408) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L))
#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__)
#if defined(__GNUC__) || defined(__clang__)
#define OVR_ALIGNAS(n) __attribute__((aligned(n)))
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
#define OVR_ALIGNAS(n) __declspec(align(n))
#elif defined(__CC_ARM)
#define OVR_ALIGNAS(n) __align(n)
#else
#error Need to define OVR_ALIGNAS
#endif

View File

@ -3907,7 +3907,7 @@ BuildTypeName(JSContext* cx, JSObject* typeObj_)
// of the rules for building C type declarations can be found at:
// http://unixwiz.net/techtips/reading-cdecl.html
TypeCode prevGrouping = CType::GetTypeCode(typeObj), currentGrouping;
while (1) {
while (true) {
currentGrouping = CType::GetTypeCode(typeObj);
switch (currentGrouping) {
case TYPE_pointer: {

View File

@ -452,7 +452,7 @@ class ParseNode
: pn_type(kind),
pn_op(op),
pn_arity(arity),
pn_parens(0),
pn_parens(false),
pn_pos(0, 0),
pn_next(nullptr)
{
@ -464,7 +464,7 @@ class ParseNode
: pn_type(kind),
pn_op(op),
pn_arity(arity),
pn_parens(0),
pn_parens(false),
pn_pos(pos),
pn_next(nullptr)
{

View File

@ -1814,7 +1814,8 @@ class LIRGraph
return mir_.numBlockIds();
}
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());
}
uint32_t getVirtualRegister() {

View File

@ -6180,7 +6180,7 @@ class MAbs
TRIVIAL_NEW_WRAPPERS
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)
ins->implicitTruncate_ = true;
return ins;
@ -6718,7 +6718,7 @@ class MAdd : public MBinaryArithInstruction
static MAdd* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
MIRType type)
{
MAdd* add = new(alloc) MAdd(left, right);
auto* add = new(alloc) MAdd(left, right);
add->specialization_ = type;
add->setResultType(type);
if (type == MIRType::Int32) {
@ -6763,7 +6763,7 @@ class MSub : public MBinaryArithInstruction
static MSub* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
MIRType type, bool mustPreserveNaN = false)
{
MSub* sub = new(alloc) MSub(left, right);
auto* sub = new(alloc) MSub(left, right);
sub->specialization_ = type;
sub->setResultType(type);
sub->setMustPreserveNaN(mustPreserveNaN);
@ -6941,7 +6941,7 @@ class MDiv : public MBinaryArithInstruction
MIRType type, bool unsignd, bool trapOnError = false,
bool mustPreserveNaN = false)
{
MDiv* div = new(alloc) MDiv(left, right, type);
auto* div = new(alloc) MDiv(left, right, type);
div->unsigned_ = unsignd;
div->trapOnError_ = trapOnError;
if (trapOnError)
@ -7068,7 +7068,7 @@ class MMod : public MBinaryArithInstruction
static MMod* NewAsmJS(TempAllocator& alloc, MDefinition* left, MDefinition* right,
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->trapOnError_ = trapOnError;
if (trapOnError)
@ -8893,7 +8893,7 @@ class MNot
public:
static MNot* NewAsmJS(TempAllocator& alloc, MDefinition* input) {
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);
return ins;
}
@ -11718,7 +11718,7 @@ class MGetDOMProperty
static MGetDOMProperty* New(TempAllocator& alloc, const JSJitInfo* info, MDefinition* obj,
MDefinition* guard, MDefinition* globalGuard)
{
MGetDOMProperty* res = new(alloc) MGetDOMProperty(info);
auto* res = new(alloc) MGetDOMProperty(info);
if (!res || !res->init(alloc, obj, guard, globalGuard))
return nullptr;
return res;
@ -11792,7 +11792,7 @@ class MGetDOMMember : public MGetDOMProperty
static MGetDOMMember* New(TempAllocator& alloc, const JSJitInfo* info, MDefinition* obj,
MDefinition* guard, MDefinition* globalGuard)
{
MGetDOMMember* res = new(alloc) MGetDOMMember(info);
auto* res = new(alloc) MGetDOMMember(info);
if (!res || !res->init(alloc, obj, guard, globalGuard))
return nullptr;
return res;

View File

@ -121,8 +121,8 @@ Impl::~Impl()
// Close all active counter descriptors. Take care to do the group
// leader last (this may not be necessary, but it's unclear what
// happens if you close the group leader out from under a group).
for (int i = 0; i < PerfMeasurement::NUM_MEASURABLE_EVENTS; i++) {
int fd = this->*(kSlots[i].fd);
for (const auto& slot : kSlots) {
int fd = this->*(slot.fd);
if (fd != -1 && fd != group_leader)
close(fd);
}
@ -140,8 +140,8 @@ Impl::init(EventMask toMeasure)
EventMask measured = EventMask(0);
struct perf_event_attr attr;
for (int i = 0; i < PerfMeasurement::NUM_MEASURABLE_EVENTS; i++) {
if (!(toMeasure & kSlots[i].bit))
for (const auto& slot : kSlots) {
if (!(toMeasure & slot.bit))
continue;
memset(&attr, 0, sizeof(attr));
@ -150,8 +150,8 @@ Impl::init(EventMask toMeasure)
// Set the type and config fields to indicate the counter we
// want to enable. We want read format 0, and we're not using
// sampling, so leave those fields unset.
attr.type = kSlots[i].type;
attr.config = kSlots[i].config;
attr.type = slot.type;
attr.config = slot.config;
// If this will be the group leader it should start off
// disabled. Otherwise it should start off enabled (but blocked
@ -175,8 +175,8 @@ Impl::init(EventMask toMeasure)
if (fd == -1)
continue;
measured = EventMask(measured | kSlots[i].bit);
this->*(kSlots[i].fd) = fd;
measured = EventMask(measured | slot.bit);
this->*(slot.fd) = fd;
if (group_leader == -1)
group_leader = fd;
}
@ -207,15 +207,15 @@ Impl::stop(PerfMeasurement* counters)
running = false;
// read out and reset all the counter values
for (int i = 0; i < PerfMeasurement::NUM_MEASURABLE_EVENTS; i++) {
int fd = this->*(kSlots[i].fd);
for (const auto& slot : kSlots) {
int fd = this->*(slot.fd);
if (fd == -1)
continue;
if (read(fd, buf, sizeof(buf)) == sizeof(uint64_t)) {
uint64_t cur;
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
@ -273,11 +273,11 @@ PerfMeasurement::stop()
void
PerfMeasurement::reset()
{
for (int i = 0; i < NUM_MEASURABLE_EVENTS; i++) {
if (eventsMeasured & kSlots[i].bit)
this->*(kSlots[i].counter) = 0;
for (const auto& slot : kSlots) {
if (eventsMeasured & slot.bit)
this->*(slot.counter) = 0;
else
this->*(kSlots[i].counter) = -1;
this->*(slot.counter) = -1;
}
}

View File

@ -283,15 +283,15 @@ TraceLoggerGraph::~TraceLoggerGraph()
// Make sure every start entry has a corresponding stop value.
// We temporarily enable logging for this. Stop doesn't need any extra data,
// so is safe to do even when we have encountered OOM.
enabled = 1;
enabled = true;
while (stack.size() > 1)
stopEvent(0);
enabled = 0;
enabled = false;
}
if (!failed && !flush()) {
fprintf(stderr, "TraceLogging: Couldn't write the data to disk.\n");
enabled = 0;
enabled = false;
failed = true;
}
@ -364,7 +364,7 @@ TraceLoggerGraph::startEvent(uint32_t id, uint64_t timestamp)
if (tree.size() >= treeSizeFlushLimit() || !tree.ensureSpaceBeforeAdd()) {
if (!flush()) {
fprintf(stderr, "TraceLogging: Couldn't write the data to disk.\n");
enabled = 0;
enabled = false;
failed = true;
return;
}
@ -373,7 +373,7 @@ TraceLoggerGraph::startEvent(uint32_t id, uint64_t timestamp)
if (!startEventInternal(id, timestamp)) {
fprintf(stderr, "TraceLogging: Failed to start an event.\n");
enabled = 0;
enabled = false;
failed = true;
return;
}
@ -462,7 +462,7 @@ TraceLoggerGraph::stopEvent(uint64_t timestamp)
if (enabled && stack.lastEntry().active()) {
if (!updateStop(stack.lastEntry().treeId(), timestamp)) {
fprintf(stderr, "TraceLogging: Failed to stop an event.\n");
enabled = 0;
enabled = false;
failed = true;
return;
}

View File

@ -34,7 +34,7 @@ class JSObject2WrappedJSMap
public:
static JSObject2WrappedJSMap* newMap(int length) {
JSObject2WrappedJSMap* map = new JSObject2WrappedJSMap();
auto* map = new JSObject2WrappedJSMap();
if (!map->mTable.init(length)) {
// This is a decent estimate of the size of the hash table's
// entry storage. The |2| is because on average the capacity is
@ -592,7 +592,7 @@ class JSObject2JSObjectMap
public:
static JSObject2JSObjectMap* newMap(int length) {
JSObject2JSObjectMap* map = new JSObject2JSObjectMap();
auto* map = new JSObject2JSObjectMap();
if (!map->mTable.init(length)) {
// This is a decent estimate of the size of the hash table's
// entry storage. The |2| is because on average the capacity is

View File

@ -673,9 +673,9 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
newStyleBorder.TrackImage(aPresContext);
NS_FOR_CSS_SIDES(side) {
newStyleBorder.SetBorderColor(side,
aStyleContext->GetVisitedDependentColor(
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_color)[side]));
nscolor color = aStyleContext->GetVisitedDependentColor(
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_color)[side]);
newStyleBorder.mBorderColor[side] = StyleComplexColor::FromColor(color);
}
DrawResult result =
PaintBorderWithStyleBorder(aPresContext, aRenderingContext, aForFrame,
@ -804,13 +804,9 @@ nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
// pull out styles, colors, composite colors
NS_FOR_CSS_SIDES (i) {
bool foreground;
borderStyles[i] = aStyleBorder.GetBorderStyle(i);
aStyleBorder.GetBorderColor(i, borderColors[i], foreground);
borderColors[i] = ourColor->CalcComplexColor(aStyleBorder.mBorderColor[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]);
@ -876,7 +872,7 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
MOZ_ASSERT(ourOutline != NS_STYLE_BORDER_STYLE_NONE,
"shouldn't have created nsDisplayOutline item");
uint8_t outlineStyle = ourOutline->GetOutlineStyle();
uint8_t outlineStyle = ourOutline->mOutlineStyle;
nscoord width = ourOutline->GetOutlineWidth();
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)
return false;
nscolor color;
bool isForeground;
aBorder.GetBorderColor(aSide, color, isForeground);
StyleComplexColor color = aBorder.mBorderColor[aSide];
// We don't know the foreground color here, so if it's being used
// we must assume it might be transparent.
if (isForeground)
if (!color.IsNumericColor()) {
return false;
return NS_GET_A(color) == 255;
}
return NS_GET_A(color.mColor) == 255;
}
/**

View File

@ -95,13 +95,13 @@ nsColumnSetFrame::PaintColumnRule(nsRenderingContext* aCtx,
if (isVertical) {
border.SetBorderWidth(NS_SIDE_TOP, ruleWidth);
border.SetBorderStyle(NS_SIDE_TOP, ruleStyle);
border.SetBorderColor(NS_SIDE_TOP, ruleColor);
border.mBorderTopColor = StyleComplexColor::FromColor(ruleColor);
skipSides |= mozilla::eSideBitsLeftRight;
skipSides |= mozilla::eSideBitsBottom;
} else {
border.SetBorderWidth(NS_SIDE_LEFT, ruleWidth);
border.SetBorderStyle(NS_SIDE_LEFT, ruleStyle);
border.SetBorderColor(NS_SIDE_LEFT, ruleColor);
border.mBorderLeftColor = StyleComplexColor::FromColor(ruleColor);
skipSides |= mozilla::eSideBitsTopBottom;
skipSides |= mozilla::eSideBitsRight;
}

View File

@ -1718,7 +1718,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
mAlignSelf = ConvertLegacyStyleToAlignItems(containerStyleXUL);
} else {
mAlignSelf = aFlexItemReflowInput.mStylePosition->ComputedAlignSelf(
mFrame->StyleContext()->GetParent());
containerRS->mFrame->StyleContext());
if (MOZ_LIKELY(mAlignSelf == NS_STYLE_ALIGN_NORMAL)) {
mAlignSelf = NS_STYLE_ALIGN_STRETCH;
}

View File

@ -1799,8 +1799,9 @@ void
nsFrame::DisplayOutlineUnconditional(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists)
{
if (StyleOutline()->GetOutlineStyle() == NS_STYLE_BORDER_STYLE_NONE)
if (StyleOutline()->mOutlineStyle == NS_STYLE_BORDER_STYLE_NONE) {
return;
}
aLists.Outlines()->AppendNewToTop(
new (aBuilder) nsDisplayOutline(aBuilder, this));
@ -4847,7 +4848,7 @@ nsIFrame::ComputeTightBounds(DrawTarget* aDrawTarget) const
nsRect
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() ||
StyleDisplay()->mAppearance) {
// Not necessarily tight, due to clipping, negative
@ -7970,7 +7971,7 @@ ComputeAndIncludeOutlineArea(nsIFrame* aFrame, nsOverflowAreas& aOverflowAreas,
const nsSize& aNewSize)
{
const nsStyleOutline* outline = aFrame->StyleOutline();
const uint8_t outlineStyle = outline->GetOutlineStyle();
const uint8_t outlineStyle = outline->mOutlineStyle;
if (outlineStyle == NS_STYLE_BORDER_STYLE_NONE) {
return;
}
@ -8680,11 +8681,9 @@ void nsFrame::FillCursorInformationFromStyle(const nsStyleUserInterface* ui,
aCursor.mLoading = false;
aCursor.mHotspotX = aCursor.mHotspotY = 0.0f;
for (nsCursorImage *item = ui->mCursorArray,
*item_end = ui->mCursorArray + ui->mCursorArrayLength;
item < item_end; ++item) {
for (const nsCursorImage& item : ui->mCursorImages) {
uint32_t status;
nsresult rv = item->GetImage()->GetImageStatus(&status);
nsresult rv = item.GetImage()->GetImageStatus(&status);
if (NS_SUCCEEDED(rv)) {
if (!(status & imgIRequest::STATUS_LOAD_COMPLETE)) {
// If we are falling back because any cursor before is loading,
@ -8692,10 +8691,10 @@ void nsFrame::FillCursorInformationFromStyle(const nsStyleUserInterface* ui,
aCursor.mLoading = true;
} else if (!(status & imgIRequest::STATUS_ERROR)) {
// This is the one we want
item->GetImage()->GetImage(getter_AddRefs(aCursor.mContainer));
aCursor.mHaveHotspot = item->mHaveHotspot;
aCursor.mHotspotX = item->mHotspotX;
aCursor.mHotspotY = item->mHotspotY;
item.GetImage()->GetImage(getter_AddRefs(aCursor.mContainer));
aCursor.mHaveHotspot = item.mHaveHotspot;
aCursor.mHotspotX = item.mHotspotX;
aCursor.mHotspotY = item.mHotspotY;
break;
}
}

View File

@ -1265,9 +1265,7 @@ struct nsRecessedBorder : public nsStyleBorder {
: nsStyleBorder(aPresContext)
{
NS_FOR_CSS_SIDES(side) {
// Note: use SetBorderColor here because we want to make sure
// the "special" flags are unset.
SetBorderColor(side, NS_RGB(0, 0, 0));
mBorderColor[side] = StyleComplexColor::FromColor(NS_RGB(0, 0, 0));
mBorder.Side(side) = aBorderWidth;
// Note: use SetBorderStyle here because we want to affect
// mComputedBorder

View File

@ -5175,7 +5175,7 @@ nsTextFrame::GetTextDecorations(
physicalBlockStartOffset +=
vertical ? f->GetNormalPosition().x : f->GetNormalPosition().y;
const uint8_t style = styleText->GetDecorationStyle();
const uint8_t style = styleText->mTextDecorationStyle;
if (textDecorations) {
nscolor color;
if (useOverride) {
@ -5384,7 +5384,7 @@ nsTextFrame::UnionAdditionalOverflow(nsPresContext* aPresContext,
// rect when this is in floating first letter frame at *both* modes.
// In this case, aBlock is the ::first-letter frame.
uint8_t decorationStyle = aBlock->StyleContext()->
StyleTextReset()->GetDecorationStyle();
StyleTextReset()->mTextDecorationStyle;
// 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
// reflow.

Some files were not shown because too many files have changed in this diff Show More