Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2016-09-29 11:48:33 +02:00
Родитель 7024349851 5b45193594
Коммит c26581a004
214 изменённых файлов: 1584 добавлений и 1719 удалений

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

@ -82,6 +82,7 @@ tasks:
features: features:
taskclusterProxy: true taskclusterProxy: true
chainOfTrust: true
# Note: This task is built server side without the context or tooling that # Note: This task is built server side without the context or tooling that
# exist in tree so we must hard code the version # exist in tree so we must hard code the version

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

@ -172,7 +172,7 @@ faster: install-dist/idl
endif endif
.PHONY: tup .PHONY: tup
tup: install-manifests buildid.h tup: install-manifests buildid.h source-repo.h
@$(TUP) $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),,--verbose) @$(TUP) $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),,--verbose)
# process_install_manifest needs to be invoked with --no-remove when building # process_install_manifest needs to be invoked with --no-remove when building

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

@ -899,10 +899,8 @@ bin/libfreebl_32int64_3.so
#endif #endif
; media ; media
#ifdef MOZ_EME
@RESPATH@/gmp-clearkey/0.1/@DLL_PREFIX@clearkey@DLL_SUFFIX@ @RESPATH@/gmp-clearkey/0.1/@DLL_PREFIX@clearkey@DLL_SUFFIX@
@RESPATH@/gmp-clearkey/0.1/clearkey.info @RESPATH@/gmp-clearkey/0.1/clearkey.info
#endif
#ifdef PKG_LOCALE_MANIFEST #ifdef PKG_LOCALE_MANIFEST
#include @PKG_LOCALE_MANIFEST@ #include @PKG_LOCALE_MANIFEST@

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

@ -972,16 +972,24 @@ pref("security.sandbox.windows.log.stackTraceDepth", 0);
#endif #endif
#if defined(XP_MACOSX) && defined(MOZ_SANDBOX) && defined(MOZ_CONTENT_SANDBOX) #if defined(XP_MACOSX) && defined(MOZ_SANDBOX) && defined(MOZ_CONTENT_SANDBOX)
// This pref is discussed in bug 1083344, the naming is inspired from its Windows // This pref is discussed in bug 1083344, the naming is inspired from its
// counterpart, but on Mac it's an integer which means: // Windows counterpart, but on Mac it's an integer which means:
// 0 -> "no sandbox" // 0 -> "no sandbox"
// 1 -> "an imperfect sandbox designed to allow firefox to run reasonably well" // 1 -> "preliminary content sandboxing enabled: write access to
// 2 -> "an ideal sandbox which may break many things" // home directory is prevented"
// 2 -> "preliminary content sandboxing enabled with profile protection:
// write access to home directory is prevented, read and write access
// to ~/Library and profile directories are prevented (excluding
// $PROFILE/{extensions,weave})"
// This setting is read when the content process is started. On Mac the content // This setting is read when the content process is started. On Mac the content
// process is killed when all windows are closed, so a change will take effect // process is killed when all windows are closed, so a change will take effect
// when the 1st window is opened. // when the 1st window is opened.
#if defined(NIGHTLY_BUILD)
pref("security.sandbox.content.level", 2);
#else
pref("security.sandbox.content.level", 1); pref("security.sandbox.content.level", 1);
#endif #endif
#endif
#if defined(XP_LINUX) && defined(MOZ_SANDBOX) && defined(MOZ_CONTENT_SANDBOX) #if defined(XP_LINUX) && defined(MOZ_SANDBOX) && defined(MOZ_CONTENT_SANDBOX)
// This pref is introduced as part of bug 742434, the naming is inspired from // This pref is introduced as part of bug 742434, the naming is inspired from

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

@ -48,15 +48,22 @@
yield PlacesTestUtils.clearHistory(); yield PlacesTestUtils.clearHistory();
// Add some visits. // Add some visits.
let timeInMicroseconds = PlacesUtils.toPRTime(Date.now() - 10000);
function newTimeInMicroseconds() {
timeInMicroseconds = timeInMicroseconds + 1000;
return timeInMicroseconds;
}
let vtime = Date.now() * 1000; let vtime = Date.now() * 1000;
const ttype = PlacesUtils.history.TRANSITION_TYPED; const ttype = PlacesUtils.history.TRANSITION_TYPED;
let places = let places =
[{ uri: Services.io.newURI("http://example.tld/", null, null), [{ uri: Services.io.newURI("http://example.tld/", null, null),
visitDate: ++vtime, transition: ttype }, visitDate: newTimeInMicroseconds(), transition: ttype },
{ uri: Services.io.newURI("http://example2.tld/", null, null), { uri: Services.io.newURI("http://example2.tld/", null, null),
visitDate: ++vtime, transition: ttype }, visitDate: newTimeInMicroseconds(), transition: ttype },
{ uri: Services.io.newURI("http://example3.tld/", null, null), { uri: Services.io.newURI("http://example3.tld/", null, null),
visitDate: ++vtime, transition: ttype }]; visitDate: newTimeInMicroseconds(), transition: ttype }];
yield PlacesTestUtils.addVisits(places); yield PlacesTestUtils.addVisits(places);
@ -85,7 +92,7 @@
is(rc, 3, "Found expected number of rows."); is(rc, 3, "Found expected number of rows.");
// First check live-update of the view when adding visits. // First check live-update of the view when adding visits.
places.forEach(place => place.visitDate = ++vtime); places.forEach(place => place.visitDate = newTimeInMicroseconds());
yield PlacesTestUtils.addVisits(places); yield PlacesTestUtils.addVisits(places);
for (let i = 0; i < rc; i++) { for (let i = 0; i < rc; i++) {

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

@ -5,8 +5,6 @@
<?xml-stylesheet href="chrome://global/skin/global.css"?> <?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?> <?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://global/skin/in-content/common.css"?> <?xml-stylesheet href="chrome://global/skin/in-content/common.css"?>
<?xml-stylesheet <?xml-stylesheet

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

@ -11,11 +11,12 @@ var gSubDialog = {
_frame: null, _frame: null,
_overlay: null, _overlay: null,
_box: null, _box: null,
_injectedStyleSheets: ["chrome://mozapps/content/preferences/preferences.css", _injectedStyleSheets: [
"chrome://browser/skin/preferences/preferences.css", "chrome://browser/skin/preferences/preferences.css",
"chrome://global/skin/in-content/common.css", "chrome://global/skin/in-content/common.css",
"chrome://browser/skin/preferences/in-content/preferences.css", "chrome://browser/skin/preferences/in-content/preferences.css",
"chrome://browser/skin/preferences/in-content/dialog.css"], "chrome://browser/skin/preferences/in-content/dialog.css",
],
_resizeObserver: null, _resizeObserver: null,
init: function() { init: function() {

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

@ -150,7 +150,6 @@ var Agent = {
let stateString = JSON.stringify(state); let stateString = JSON.stringify(state);
let data = Encoder.encode(stateString); let data = Encoder.encode(stateString);
let startWriteMs, stopWriteMs;
try { try {
@ -167,7 +166,7 @@ var Agent = {
File.move(this.Paths.clean, this.Paths.cleanBackup); File.move(this.Paths.clean, this.Paths.cleanBackup);
} }
startWriteMs = Date.now(); let startWriteMs = Date.now();
if (options.isFinalWrite) { if (options.isFinalWrite) {
// We are shutting down. At this stage, we know that // We are shutting down. At this stage, we know that
@ -198,7 +197,8 @@ var Agent = {
}); });
} }
stopWriteMs = Date.now(); telemetry.FX_SESSION_RESTORE_WRITE_FILE_MS = Date.now() - startWriteMs;
telemetry.FX_SESSION_RESTORE_FILE_SIZE_BYTES = data.byteLength;
} catch (ex) { } catch (ex) {
// Don't throw immediately // Don't throw immediately
@ -276,10 +276,7 @@ var Agent = {
result: { result: {
upgradeBackup: upgradeBackupComplete upgradeBackup: upgradeBackupComplete
}, },
telemetry: { telemetry: telemetry,
FX_SESSION_RESTORE_WRITE_FILE_MS: stopWriteMs - startWriteMs,
FX_SESSION_RESTORE_FILE_SIZE_BYTES: data.byteLength,
}
}; };
}, },

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

@ -830,10 +830,8 @@ bin/libfreebl_32int64_3.so
; media ; media
#ifdef MOZ_EME
@RESPATH@/gmp-clearkey/0.1/@DLL_PREFIX@clearkey@DLL_SUFFIX@ @RESPATH@/gmp-clearkey/0.1/@DLL_PREFIX@clearkey@DLL_SUFFIX@
@RESPATH@/gmp-clearkey/0.1/clearkey.info @RESPATH@/gmp-clearkey/0.1/clearkey.info
#endif
; gfx ; gfx
#ifdef XP_WIN #ifdef XP_WIN

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

@ -346,238 +346,6 @@ menuitem.bookmark-item {
opacity: 0.7; opacity: 0.7;
} }
/* Stock icons for the menu bar items */
menuitem:not([type]):not(.menuitem-tooltip):not(.menuitem-iconic-tooltip) {
-moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic");
}
#placesContext_open\:newwindow,
#menu_newNavigator,
#context-openlink,
#context-openframe {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 80px 16px 64px);
}
#placesContext_open\:newtab,
#placesContext_openContainer\:tabs,
#menu_newNavigatorTab,
#context-openlinkintab,
#context-openlinkincontainertab,
#context-openframeintab {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 64px 16px 48px);
}
#menu_openFile {
list-style-image: url("moz-icon://stock/gtk-open?size=menu");
}
#menu_close {
list-style-image: url("moz-icon://stock/gtk-close?size=menu");
}
#context-media-play {
list-style-image: url("moz-icon://stock/gtk-media-play?size=menu");
}
#context-media-pause {
list-style-image: url("moz-icon://stock/gtk-media-pause?size=menu");
}
#menu_savePage,
#context-savelink,
#context-saveimage,
#context-savevideo,
#context-saveaudio,
#context-savepage,
#context-saveframe {
list-style-image: url("moz-icon://stock/gtk-save-as?size=menu");
}
#menu_printPreview {
list-style-image: url("moz-icon://stock/gtk-print-preview?size=menu");
}
#menu_print,
#context-printframe {
list-style-image: url("moz-icon://stock/gtk-print?size=menu");
}
#menu_FileQuitItem {
list-style-image: url("moz-icon://stock/gtk-quit?size=menu");
}
#menu_undo,
#context-undo {
list-style-image: url("moz-icon://stock/gtk-undo?size=menu");
}
#menu_undo[disabled],
#context-undo[disabled] {
list-style-image: url("moz-icon://stock/gtk-undo?size=menu&state=disabled");
}
#menu_redo {
list-style-image: url("moz-icon://stock/gtk-redo?size=menu");
}
#menu_redo[disabled] {
list-style-image: url("moz-icon://stock/gtk-redo?size=menu&state=disabled");
}
#menu_cut,
#placesContext_cut,
#context-cut {
list-style-image: url("moz-icon://stock/gtk-cut?size=menu");
}
#menu_cut[disabled],
#placesContext_cut[disabled],
#context-cut[disabled] {
list-style-image: url("moz-icon://stock/gtk-cut?size=menu&state=disabled");
}
#menu_copy,
#placesContext_copy,
#context-copy,
#context-copyimage,
#context-copyvideourl,
#context-copyaudiourl,
#context-copylink,
#context-copyemail {
list-style-image: url("moz-icon://stock/gtk-copy?size=menu");
}
#menu_copy[disabled],
#placesContext_copy[disabled],
#context-copy[disabled] {
list-style-image: url("moz-icon://stock/gtk-copy?size=menu&state=disabled");
}
#menu_paste,
#placesContext_paste,
#context-paste {
list-style-image: url("moz-icon://stock/gtk-paste?size=menu");
}
#menu_paste[disabled],
#placesContext_paste[disabled],
#context-paste[disabled] {
list-style-image: url("moz-icon://stock/gtk-paste?size=menu&state=disabled");
}
#menu_delete,
#placesContext_delete,
#placesContext_delete_history,
#context-delete {
list-style-image: url("moz-icon://stock/gtk-delete?size=menu");
}
#menu_delete[disabled],
#placesContext_delete[disabled],
#placesContext_delete_history[disabled],
#context-delete[disabled] {
list-style-image: url("moz-icon://stock/gtk-delete?size=menu&state=disabled");
}
#menu_selectAll,
#context-selectall {
list-style-image: url("moz-icon://stock/gtk-select-all?size=menu");
}
#menu_find {
list-style-image: url("moz-icon://stock/gtk-find?size=menu");
}
#menu_find[disabled] {
list-style-image: url("moz-icon://stock/gtk-find?size=menu&state=disabled");
}
#menu_preferences {
list-style-image: url("moz-icon://stock/gtk-preferences?size=menu");
}
#placesContext_reload,
#context-reloadframe {
list-style-image: url("moz-icon://stock/gtk-refresh?size=menu");
}
#menu_zoomEnlarge {
list-style-image: url("moz-icon://stock/gtk-zoom-in?size=menu");
}
#menu_zoomReduce {
list-style-image: url("moz-icon://stock/gtk-zoom-out?size=menu");
}
#menu_zoomReset {
list-style-image: url("moz-icon://stock/gtk-zoom-100?size=menu");
}
#menu_showAllHistory {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 32px 16px 16px);
}
#bookmarksShowAll {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 48px 16px 32px);
}
#subscribeToPageMenuitem:not([disabled]),
#subscribeToPageMenupopup {
list-style-image: url("chrome://browser/skin/page-livemarks.png");
}
#bookmarksToolbarFolderMenu,
#BMB_bookmarksToolbar,
#panelMenu_bookmarksToolbar {
list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.png");
}
#menu_unsortedBookmarks,
#BMB_unsortedBookmarks,
#panelMenu_unsortedBookmarks {
list-style-image: url("chrome://browser/skin/places/unsortedBookmarks.png");
}
#menu_openDownloads {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 16px 16px 0px);
}
#menu_openAddons {
list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric-16.png");
}
#menu_pageInfo,
#context-viewinfo,
#context-viewframeinfo {
list-style-image: url("moz-icon://stock/gtk-info?size=menu");
}
#placesContext_open\:newprivatewindow,
#privateBrowsingItem {
list-style-image: url("chrome://browser/skin/Privacy-16.png");
}
#placesContext_show\:info {
list-style-image: url("moz-icon://stock/gtk-properties?size=menu");
}
#sanitizeItem {
list-style-image: url("moz-icon://stock/gtk-clear?size=menu");
}
#menu_openHelp {
list-style-image: url("moz-icon://stock/gtk-help?size=menu");
}
#aboutName {
list-style-image: url("moz-icon://stock/gtk-about?size=menu");
}
/* Primary toolbar buttons */ /* Primary toolbar buttons */
:-moz-any(toolbar, .widget-overflow-list) .toolbarbutton-1 > .toolbarbutton-icon, :-moz-any(toolbar, .widget-overflow-list) .toolbarbutton-1 > .toolbarbutton-icon,
@ -1866,7 +1634,6 @@ notification.pluginVulnerable > .notification-inner > .messageCloseButton:not(:h
%include ../shared/contextmenu.inc.css %include ../shared/contextmenu.inc.css
#context-navigation > .menuitem-iconic > .menu-iconic-left { #context-navigation > .menuitem-iconic > .menu-iconic-left {
visibility: visible;
/* override toolkit/themes/linux/global/menu.css */ /* override toolkit/themes/linux/global/menu.css */
padding-inline-end: 0 !important; padding-inline-end: 0 !important;
margin-inline-end: 0 !important; margin-inline-end: 0 !important;
@ -1880,7 +1647,3 @@ notification.pluginVulnerable > .notification-inner > .messageCloseButton:not(:h
.webextension-popup-browser { .webextension-popup-browser {
border-radius: inherit; border-radius: inherit;
} }
.menuitem-iconic[usercontextid] > .menu-iconic-left > .menu-iconic-icon {
visibility: visible;
}

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

@ -265,16 +265,3 @@ treechildren::-moz-tree-cell-text(broken) {
#securityPanel row { #securityPanel row {
-moz-box-align: center; -moz-box-align: center;
} }
/* Icons for context menus */
menuitem:not([type]) {
-moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic");
}
#menu_selectall {
list-style-image: url("moz-icon://stock/gtk-select-all?size=menu");
}
#menu_copy {
list-style-image: url("moz-icon://stock/gtk-copy?size=menu");
}

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

@ -90,19 +90,6 @@
padding-inline-start: 2px; padding-inline-start: 2px;
} }
/**** menuitem stock icons ****/
#orgClose {
list-style-image: url("moz-icon://stock/gtk-close?size=menu");
}
#fileImport {
list-style-image: url("moz-icon://stock/gtk-revert-to-saved?size=menu");
}
#fileExport {
list-style-image: url("moz-icon://stock/gtk-save-as?size=menu");
}
/** /**
* Downloads pane * Downloads pane
*/ */

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

@ -120,102 +120,3 @@ treechildren::-moz-tree-image(cutting) {
treechildren::-moz-tree-cell-text(cutting) { treechildren::-moz-tree-cell-text(cutting) {
opacity: 0.7; opacity: 0.7;
} }
/**** menuitem stock icons ****/
menuitem:not([type]) {
-moz-binding: url("chrome://global/content/bindings/menu.xml#menuitem-iconic");
}
menuitem[command="cmd_cut"],
menuitem[cmd="cmd_cut"] {
list-style-image: url("moz-icon://stock/gtk-cut?size=menu");
}
menuitem[command="cmd_cut"][disabled],
menuitem[cmd="cmd_cut"][disabled] {
list-style-image: url("moz-icon://stock/gtk-cut?size=menu&state=disabled");
}
menuitem[command="cmd_copy"],
menuitem[cmd="cmd_copy"] {
list-style-image: url("moz-icon://stock/gtk-copy?size=menu");
}
menuitem[command="cmd_copy"][disabled],
menuitem[cmd="cmd_copy"][disabled] {
list-style-image: url("moz-icon://stock/gtk-copy?size=menu&state=disabled");
}
menuitem[command="cmd_paste"],
menuitem[cmd="cmd_paste"] {
list-style-image: url("moz-icon://stock/gtk-paste?size=menu");
}
menuitem[command="cmd_paste"][disabled],
menuitem[cmd="cmd_paste"][disabled] {
list-style-image: url("moz-icon://stock/gtk-paste?size=menu&state=disabled");
}
menuitem[command="cmd_delete"],
menuitem[cmd="cmd_delete"] {
list-style-image: url("moz-icon://stock/gtk-delete?size=menu");
}
menuitem[command="cmd_delete"][disabled],
menuitem[cmd="cmd_delete"][disabled] {
list-style-image: url("moz-icon://stock/gtk-delete?size=menu&state=disabled");
}
menuitem[command="cmd_undo"],
menuitem[cmd="cmd_undo"] {
list-style-image: url("moz-icon://stock/gtk-undo?size=menu");
}
menuitem[command="cmd_undo"][disabled],
menuitem[cmd="cmd_undo"][disabled] {
list-style-image: url("moz-icon://stock/gtk-undo?size=menu&state=disabled");
}
menuitem[command="cmd_redo"] {
list-style-image: url("moz-icon://stock/gtk-redo?size=menu");
}
menuitem[command="cmd_redo"][disabled] {
list-style-image: url("moz-icon://stock/gtk-redo?size=menu&state=disabled");
}
menuitem[command="cmd_selectAll"],
menuitem[cmd="cmd_selectAll"] {
list-style-image: url("moz-icon://stock/gtk-select-all?size=menu");
}
menuitem[command="cmd_selectAll"][disabled],
menuitem[cmd="cmd_selectAll"][disabled] {
list-style-image: url("moz-icon://stock/gtk-select-all?size=menu&state=disabled");
}
#placesContext_open\:newwindow,
menuitem[command="placesCmd_open:window"] {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 80px 16px 64px);
}
#placesContext_open\:newprivatewindow,
menuitem[command="placesCmd_open:privatewindow"] {
list-style-image: url("chrome://browser/skin/Privacy-16.png");
}
#placesContext_open\:newtab,
menuitem[command="placesCmd_open:tab"] {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 64px 16px 48px);
}
#placesContext_show\:info,
menuitem[command="placesCmd_show:info"] {
list-style-image: url("moz-icon://stock/gtk-properties?size=menu");
}
#placesContext_reload {
list-style-image: url("moz-icon://stock/gtk-refresh?size=menu");
}

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

@ -7,7 +7,7 @@
@depends(target) @depends(target)
def force_system_ffi(target): def force_system_ffi(target):
# Pre-emptively move to system ffi for non-tier one platforms. # Pre-emptively move to system ffi for non-tier one platforms.
if target.cpu not in ('x86', 'x86_64', 'arm'): if target.cpu not in ('x86', 'x86_64', 'arm', 'aarch64'):
return True return True
imply_option('--with-system-ffi', force_system_ffi, "target") imply_option('--with-system-ffi', force_system_ffi, "target")
@ -28,7 +28,7 @@ add_old_configure_assignment('MOZ_SYSTEM_FFI', system_ffi)
# Target selection, based on ffi/configure.ac. # Target selection, based on ffi/configure.ac.
@depends_when(target, when=building_ffi) @depends_when(target, when=building_ffi)
def ffi_target(target): def ffi_target(target):
if target.cpu not in ('x86', 'x86_64', 'arm'): if target.cpu not in ('x86', 'x86_64', 'arm', 'aarch64'):
die('Building libffi from the tree is not supported on this platform. ' die('Building libffi from the tree is not supported on this platform. '
'Use --with-system-ffi instead.') 'Use --with-system-ffi instead.')
@ -44,6 +44,9 @@ def ffi_target(target):
elif target.cpu == 'arm': elif target.cpu == 'arm':
target_dir = 'arm' target_dir = 'arm'
target_name = 'ARM' target_name = 'ARM'
elif target.cpu == 'aarch64':
target_dir = 'aarch64'
target_name = 'AARCH64'
else: else:
target_dir = 'x86' target_dir = 'x86'
target_name = target.cpu.upper() target_name = target.cpu.upper()

5
config/external/ffi/moz.build поставляемый
Просмотреть файл

@ -4,10 +4,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
FINAL_LIBRARY = 'js'
if CONFIG['MOZ_SYSTEM_FFI']: if CONFIG['MOZ_SYSTEM_FFI']:
OS_LIBS += CONFIG['MOZ_FFI_LIBS'] OS_LIBS += CONFIG['MOZ_FFI_LIBS']
else: else:
FINAL_LIBRARY = 'js'
ALLOW_COMPILER_WARNINGS = True ALLOW_COMPILER_WARNINGS = True
NO_VISIBILITY_FLAGS = True NO_VISIBILITY_FLAGS = True
@ -77,6 +78,8 @@ else:
ffi_srcs = ('sysv.S', 'ffi.c') ffi_srcs = ('sysv.S', 'ffi.c')
if CONFIG['CLANG_CXX']: if CONFIG['CLANG_CXX']:
ASFLAGS += ['-no-integrated-as'] ASFLAGS += ['-no-integrated-as']
elif CONFIG['FFI_TARGET'] == 'AARCH64':
ffi_srcs = ('sysv.S', 'ffi.c')
elif CONFIG['FFI_TARGET'] == 'X86': elif CONFIG['FFI_TARGET'] == 'X86':
ffi_srcs = ('ffi.c', 'sysv.S', 'win32.S') ffi_srcs = ('ffi.c', 'sysv.S', 'win32.S')
elif CONFIG['FFI_TARGET'] == 'X86_64': elif CONFIG['FFI_TARGET'] == 'X86_64':

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

@ -6,6 +6,12 @@
const TEST_URI = "data:text/html;charset=utf-8,gcli-commands"; const TEST_URI = "data:text/html;charset=utf-8,gcli-commands";
const HUDService = require("devtools/client/webconsole/hudservice"); const HUDService = require("devtools/client/webconsole/hudservice");
// Use the old webconsole since pprint isn't working on new one (Bug 1304794)
Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
});
function test() { function test() {
return Task.spawn(spawnTest).then(finish, helpers.handleError); return Task.spawn(spawnTest).then(finish, helpers.handleError);
} }

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

@ -13,11 +13,14 @@ var gTab, gPanel, gDebugger;
var gPrefs, gOptions; var gPrefs, gOptions;
function test() { function test() {
let options = { Task.spawn(function* () {
source: TAB_URL, let options = {
line: 1 source: TAB_URL,
}; line: 1
initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => { };
let [aTab,, aPanel] = yield initDebugger(TAB_URL, options);
gTab = aTab; gTab = aTab;
gPanel = aPanel; gPanel = aPanel;
gDebugger = gPanel.panelWin; gDebugger = gPanel.panelWin;
@ -28,7 +31,7 @@ function test() {
gDebugger.DebuggerView.toggleInstrumentsPane({ visible: true, animated: false }); gDebugger.DebuggerView.toggleInstrumentsPane({ visible: true, animated: false });
testInstrumentsPaneCollapse(); yield testInstrumentsPaneCollapse();
testPanesStartupPref(); testPanesStartupPref();
closeDebuggerAndFinish(gPanel); closeDebuggerAndFinish(gPanel);
@ -50,7 +53,7 @@ function testPanesState() {
"The options menu item should not be checked."); "The options menu item should not be checked.");
} }
function testInstrumentsPaneCollapse() { function* testInstrumentsPaneCollapse () {
let instrumentsPane = let instrumentsPane =
gDebugger.document.getElementById("instruments-pane"); gDebugger.document.getElementById("instruments-pane");
let instrumentsPaneToggleButton = let instrumentsPaneToggleButton =
@ -69,8 +72,13 @@ function testInstrumentsPaneCollapse() {
!instrumentsPaneToggleButton.classList.contains("pane-collapsed"), !instrumentsPaneToggleButton.classList.contains("pane-collapsed"),
"The instruments pane should at this point be visible."); "The instruments pane should at this point be visible.");
// Trigger reflow to make sure the UI is in required state.
gDebugger.document.documentElement.getBoundingClientRect();
gDebugger.DebuggerView.toggleInstrumentsPane({ visible: false, animated: true }); gDebugger.DebuggerView.toggleInstrumentsPane({ visible: false, animated: true });
yield once(instrumentsPane, "transitionend");
is(gPrefs.panesVisibleOnStartup, false, is(gPrefs.panesVisibleOnStartup, false,
"The debugger view panes should still initially be preffed as hidden."); "The debugger view panes should still initially be preffed as hidden.");
isnot(gOptions._showPanesOnStartupItem.getAttribute("checked"), "true", isnot(gOptions._showPanesOnStartupItem.getAttribute("checked"), "true",
@ -83,7 +91,8 @@ function testInstrumentsPaneCollapse() {
"The instruments pane has an incorrect left margin after collapsing."); "The instruments pane has an incorrect left margin after collapsing.");
is(instrumentsPane.style.marginRight, margin, is(instrumentsPane.style.marginRight, margin,
"The instruments pane has an incorrect right margin after collapsing."); "The instruments pane has an incorrect right margin after collapsing.");
ok(instrumentsPane.hasAttribute("animated"),
ok(!instrumentsPane.hasAttribute("animated"),
"The instruments pane has an incorrect attribute after an animated collapsing."); "The instruments pane has an incorrect attribute after an animated collapsing.");
ok(instrumentsPane.classList.contains("pane-collapsed") && ok(instrumentsPane.classList.contains("pane-collapsed") &&
instrumentsPaneToggleButton.classList.contains("pane-collapsed"), instrumentsPaneToggleButton.classList.contains("pane-collapsed"),

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

@ -7,6 +7,8 @@
const PAGE_URL = "data:text/html;charset=utf-8,test select events"; const PAGE_URL = "data:text/html;charset=utf-8,test select events";
requestLongerTimeout(2);
add_task(function* () { add_task(function* () {
let tab = yield addTab(PAGE_URL); let tab = yield addTab(PAGE_URL);

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

@ -335,6 +335,7 @@ Toolbox.prototype = {
get splitConsole() { get splitConsole() {
return this._splitConsole; return this._splitConsole;
}, },
/** /**
* Get the focused state of the split console * Get the focused state of the split console
*/ */
@ -1267,6 +1268,16 @@ Toolbox.prototype = {
// backward compatibility with existing extensions do a check // backward compatibility with existing extensions do a check
// for a promise return value. // for a promise return value.
let built = definition.build(iframe.contentWindow, this); let built = definition.build(iframe.contentWindow, this);
// Set the dir attribute on the documents of panels using HTML.
let docEl = iframe.contentWindow && iframe.contentWindow.document.documentElement;
if (docEl && docEl.namespaceURI === HTML_NS) {
let top = this.win.top;
let topDocEl = top.document.documentElement;
let isRtl = top.getComputedStyle(topDocEl).direction === "rtl";
docEl.setAttribute("dir", isRtl ? "rtl" : "ltr");
}
if (!(typeof built.then == "function")) { if (!(typeof built.then == "function")) {
let panel = built; let panel = built;
iframe.panel = panel; iframe.panel = panel;

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

@ -138,7 +138,7 @@ function CssComputedView(inspector, document, pageStyle) {
this.propertyViews = []; this.propertyViews = [];
let cssProperties = getCssProperties(inspector.toolbox); let cssProperties = getCssProperties(inspector.toolbox);
this._outputParser = new OutputParser(document, cssProperties.supportsType); this._outputParser = new OutputParser(document, cssProperties);
// Create bound methods. // Create bound methods.
this.focusWindow = this.focusWindow.bind(this); this.focusWindow = this.focusWindow.bind(this);

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

@ -430,8 +430,6 @@ MarkupView.prototype = {
/** /**
* Hide the box model highlighter on a given node front * Hide the box model highlighter on a given node front
* *
* @param {NodeFront} nodeFront
* The node to hide the highlighter for
* @param {Boolean} forceHide * @param {Boolean} forceHide
* See toolbox-highlighter-utils/unhighlight * See toolbox-highlighter-utils/unhighlight
* @return {Promise} Resolves when the highlighter for this nodeFront is * @return {Promise} Resolves when the highlighter for this nodeFront is

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

@ -52,6 +52,7 @@ function TextProperty(rule, name, value, priority, enabled = true,
this.priority = priority; this.priority = priority;
this.enabled = !!enabled; this.enabled = !!enabled;
this.invisible = invisible; this.invisible = invisible;
this.panelDoc = this.rule.elementStyle.ruleView.inspector.panelDoc;
const toolbox = this.rule.elementStyle.ruleView.inspector.toolbox; const toolbox = this.rule.elementStyle.ruleView.inspector.toolbox;
this.cssProperties = getCssProperties(toolbox); this.cssProperties = getCssProperties(toolbox);
@ -204,7 +205,7 @@ TextProperty.prototype = {
// compute validity locally (which might not be correct, but better than // compute validity locally (which might not be correct, but better than
// nothing). // nothing).
if (!this.rule.domRule.declarations) { if (!this.rule.domRule.declarations) {
return domUtils.cssPropertyIsValid(this.name, this.value); return this.cssProperties.isValidOnClient(this.name, this.value, this.panelDoc);
} }
let selfIndex = this.rule.textProps.indexOf(this); let selfIndex = this.rule.textProps.indexOf(this);

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

@ -105,7 +105,7 @@ function CssRuleView(inspector, document, store, pageStyle) {
this.cssProperties = getCssProperties(inspector.toolbox); this.cssProperties = getCssProperties(inspector.toolbox);
this._outputParser = new OutputParser(document, this.cssProperties.supportsType); this._outputParser = new OutputParser(document, this.cssProperties);
this._onAddRule = this._onAddRule.bind(this); this._onAddRule = this._onAddRule.bind(this);
this._onContextMenu = this._onContextMenu.bind(this); this._onContextMenu = this._onContextMenu.bind(this);

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

@ -199,6 +199,7 @@ subsuite = clipboard
[browser_rules_selector-highlighter_01.js] [browser_rules_selector-highlighter_01.js]
[browser_rules_selector-highlighter_02.js] [browser_rules_selector-highlighter_02.js]
[browser_rules_selector-highlighter_03.js] [browser_rules_selector-highlighter_03.js]
[browser_rules_selector-highlighter_04.js]
[browser_rules_selector_highlight.js] [browser_rules_selector_highlight.js]
[browser_rules_strict-search-filter-computed-list_01.js] [browser_rules_strict-search-filter-computed-list_01.js]
[browser_rules_strict-search-filter_01.js] [browser_rules_strict-search-filter_01.js]

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

@ -76,9 +76,3 @@ add_task(function* () {
is(HighlighterFront.options.selector, "body", is(HighlighterFront.options.selector, "body",
"The right selector option is passed to the highlighter (2)"); "The right selector option is passed to the highlighter (2)");
}); });
function* clickSelectorIcon(icon, view) {
let onToggled = view.once("ruleview-selectorhighlighter-toggled");
EventUtils.synthesizeMouseAtCenter(icon, {}, view.styleWindow);
yield onToggled;
}

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

@ -76,9 +76,3 @@ add_task(function* () {
ok(!HighlighterFront.isShown, ok(!HighlighterFront.isShown,
"The highlighter is hidden now that the same selector was clicked"); "The highlighter is hidden now that the same selector was clicked");
}); });
function* clickSelectorIcon(icon, view) {
let onToggled = view.once("ruleview-selectorhighlighter-toggled");
EventUtils.synthesizeMouseAtCenter(icon, {}, view.styleWindow);
yield onToggled;
}

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

@ -0,0 +1,53 @@
/* 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 the selector highlighter is shown when clicking on a selector icon
// for the 'element {}' rule
// Note that in this test, we mock the highlighter front, merely testing the
// behavior of the style-inspector UI for now
const TEST_URI = `
<p>Testing the selector highlighter for the 'element {}' rule</p>
`;
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
// Mock the highlighter front to get the reference of the NodeFront
let HighlighterFront = {
isShown: false,
nodeFront: null,
options: null,
show: function (nodeFront, options) {
this.nodeFront = nodeFront;
this.options = options;
this.isShown = true;
},
hide: function () {
this.nodeFront = null;
this.options = null;
this.isShown = false;
}
};
// Inject the mock highlighter in the rule-view
view.selectorHighlighter = HighlighterFront;
info("Checking that the right NodeFront reference and options are passed");
yield selectNode("p", inspector);
let icon = getRuleViewSelectorHighlighterIcon(view, "element");
yield clickSelectorIcon(icon, view);
is(HighlighterFront.nodeFront.tagName, "P",
"The right NodeFront is passed to the highlighter (1)");
is(HighlighterFront.options.selector, "body > p:nth-child(1)",
"The right selector option is passed to the highlighter (1)");
ok(HighlighterFront.isShown, "The toggle event says the highlighter is visible");
yield clickSelectorIcon(icon, view);
ok(!HighlighterFront.isShown, "The toggle event says the highlighter is not visible");
});

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

@ -817,6 +817,17 @@ function waitForStyleModification(inspector) {
}); });
} }
/**
* Click on the selector icon
* @param {DOMNode} icon
* @param {CSSRuleView} view
*/
function* clickSelectorIcon(icon, view) {
let onToggled = view.once("ruleview-selectorhighlighter-toggled");
EventUtils.synthesizeMouseAtCenter(icon, {}, view.styleWindow);
yield onToggled;
}
/** /**
* Make sure window is properly focused before sending a key event. * Make sure window is properly focused before sending a key event.
* @param {Window} win * @param {Window} win

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

@ -149,9 +149,10 @@ RuleEditor.prototype = {
}); });
} }
if (this.rule.domRule.type !== CSSRule.KEYFRAME_RULE && if (this.rule.domRule.type !== CSSRule.KEYFRAME_RULE) {
this.rule.domRule.selectors) { let selector = this.rule.domRule.selectors
let selector = this.rule.domRule.selectors.join(", "); ? this.rule.domRule.selectors.join(", ")
: this.ruleView.inspector.selectionCssSelector;
let selectorHighlighter = createChild(header, "span", { let selectorHighlighter = createChild(header, "span", {
class: "ruleview-selectorhighlighter" + class: "ruleview-selectorhighlighter" +

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

@ -31,6 +31,7 @@ const EventEmitter = require("devtools/shared/event-emitter");
const promise = require("promise"); const promise = require("promise");
const {Task} = require("devtools/shared/task"); const {Task} = require("devtools/shared/task");
const Services = require("Services"); const Services = require("Services");
const {getCssProperties} = require("devtools/shared/fronts/css-properties");
const PREF_IMAGE_TOOLTIP_SIZE = "devtools.inspector.imagePreviewTooltipSize"; const PREF_IMAGE_TOOLTIP_SIZE = "devtools.inspector.imagePreviewTooltipSize";
@ -262,6 +263,7 @@ function TooltipsOverlay(view) {
let {CssRuleView} = require("devtools/client/inspector/rules/rules"); let {CssRuleView} = require("devtools/client/inspector/rules/rules");
this.isRuleView = view instanceof CssRuleView; this.isRuleView = view instanceof CssRuleView;
this._cssProperties = getCssProperties(this.view.inspector.toolbox);
this._onNewSelection = this._onNewSelection.bind(this); this._onNewSelection = this._onNewSelection.bind(this);
this.view.inspector.selection.on("new-node-front", this._onNewSelection); this.view.inspector.selection.on("new-node-front", this._onNewSelection);
@ -305,7 +307,8 @@ TooltipsOverlay.prototype = {
// Cubic bezier tooltip // Cubic bezier tooltip
this.cubicBezier = new SwatchCubicBezierTooltip(toolbox); this.cubicBezier = new SwatchCubicBezierTooltip(toolbox);
// Filter editor tooltip // Filter editor tooltip
this.filterEditor = new SwatchFilterTooltip(toolbox); this.filterEditor = new SwatchFilterTooltip(toolbox,
this._cssProperties.getValidityChecker(this.view.inspector.panelDoc));
} }
this._isStarted = true; this._isStarted = true;

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

@ -302,7 +302,7 @@ add_task(function* () {
yield initCssProperties(toolbox); yield initCssProperties(toolbox);
let cssProperties = getCssProperties(toolbox); let cssProperties = getCssProperties(toolbox);
let parser = new OutputParser(document, cssProperties.supportsType); let parser = new OutputParser(document, cssProperties);
for (let i = 0; i < TEST_DATA.length; i++) { for (let i = 0; i < TEST_DATA.length; i++) {
let data = TEST_DATA[i]; let data = TEST_DATA[i];
info("Output-parser test data " + i + ". {" + data.name + " : " + info("Output-parser test data " + i + ". {" + data.name + " : " +

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

@ -11,6 +11,13 @@ registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.toolbox.splitconsoleEnabled"); Services.prefs.clearUserPref("devtools.toolbox.splitconsoleEnabled");
}); });
// Use the old webconsole since the node isn't being rendered as an HTML tag
// in the new one (Bug 1304794)
Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
});
add_task(function* () { add_task(function* () {
let { inspector, toolbox } = yield openInspectorForURL(TEST_URL); let { inspector, toolbox } = yield openInspectorForURL(TEST_URL);

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

@ -4,9 +4,6 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd"> "DTD/xhtml1-strict.dtd">
%htmlDTD; %htmlDTD;
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]> ]>
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
@ -19,7 +16,7 @@
<link rel="stylesheet" href="chrome://devtools/skin/components-frame.css" type="text/css"/> <link rel="stylesheet" href="chrome://devtools/skin/components-frame.css" type="text/css"/>
<link rel="stylesheet" href="chrome://devtools/skin/components-h-split-box.css" type="text/css"/> <link rel="stylesheet" href="chrome://devtools/skin/components-h-split-box.css" type="text/css"/>
</head> </head>
<body class="theme-body" dir="&locale.dir;"> <body class="theme-body">
<div id="app"></div> <div id="app"></div>
<script type="application/javascript;version=1.8" <script type="application/javascript;version=1.8"

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

@ -34,8 +34,13 @@ add_task(function* () {
!detailsPaneToggleButton.classList.contains("pane-collapsed"), !detailsPaneToggleButton.classList.contains("pane-collapsed"),
"The details pane should at this point be visible."); "The details pane should at this point be visible.");
// Trigger reflow to make sure the UI is in required state.
document.documentElement.getBoundingClientRect();
NetMonitorView.toggleDetailsPane({ visible: false, animated: true }); NetMonitorView.toggleDetailsPane({ visible: false, animated: true });
yield once(detailsPane, "transitionend");
let margin = -(width + 1) + "px"; let margin = -(width + 1) + "px";
is(width, Prefs.networkDetailsWidth, is(width, Prefs.networkDetailsWidth,
"The details pane has an incorrect width after collapsing."); "The details pane has an incorrect width after collapsing.");
@ -43,7 +48,7 @@ add_task(function* () {
"The details pane has an incorrect left margin after collapsing."); "The details pane has an incorrect left margin after collapsing.");
is(detailsPane.style.marginRight, margin, is(detailsPane.style.marginRight, margin,
"The details pane has an incorrect right margin after collapsing."); "The details pane has an incorrect right margin after collapsing.");
ok(detailsPane.hasAttribute("animated"), ok(!detailsPane.hasAttribute("animated"),
"The details pane has an incorrect attribute after an animated collapsing."); "The details pane has an incorrect attribute after an animated collapsing.");
ok(detailsPane.classList.contains("pane-collapsed") && ok(detailsPane.classList.contains("pane-collapsed") &&
detailsPaneToggleButton.classList.contains("pane-collapsed"), detailsPaneToggleButton.classList.contains("pane-collapsed"),

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

@ -3,6 +3,11 @@
http://creativecommons.org/publicdomain/zero/1.0/ */ http://creativecommons.org/publicdomain/zero/1.0/ */
/* Bug 661762 */ /* Bug 661762 */
// Use the old webconsole since scratchpad focus isn't working on new one (Bug 1304794)
Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
});
function test() function test()
{ {

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

@ -7,26 +7,26 @@
display: block; display: block;
} }
.sidebar-toggle:-moz-locale-dir(ltr)::before, .sidebar-toggle::before,
.sidebar-toggle.pane-collapsed:-moz-locale-dir(rtl)::before { .sidebar-toggle.pane-collapsed:dir(rtl)::before {
background-image: var(--theme-pane-collapse-image); background-image: var(--theme-pane-collapse-image);
} }
.sidebar-toggle.pane-collapsed:-moz-locale-dir(ltr)::before, .sidebar-toggle.pane-collapsed::before,
.sidebar-toggle:-moz-locale-dir(rtl)::before { .sidebar-toggle:dir(rtl)::before {
background-image: var(--theme-pane-expand-image); background-image: var(--theme-pane-expand-image);
} }
/* Rotate button icon 90deg if the toolbox container is /* Rotate button icon 90deg if the toolbox container is
in vertical mode (sidebar displayed under the main panel) */ in vertical mode (sidebar displayed under the main panel) */
@media (max-width: 700px) { @media (max-width: 700px) {
.sidebar-toggle:-moz-locale-dir(ltr)::before { .sidebar-toggle::before {
transform: rotate(90deg); transform: rotate(90deg);
} }
/* Since RTL swaps the used images, we need to flip them /* Since RTL swaps the used images, we need to flip them
the other way round */ the other way round */
.sidebar-toggle:-moz-locale-dir(rtl)::before { .sidebar-toggle:dir(rtl)::before {
transform: rotate(-90deg); transform: rotate(-90deg);
} }
} }

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

@ -29,7 +29,7 @@ loader.lazyRequireGetter(this, "util", "gcli/util/util");
loader.lazyRequireGetter(this, "ConsoleServiceListener", "devtools/server/actors/utils/webconsole-utils", true); loader.lazyRequireGetter(this, "ConsoleServiceListener", "devtools/server/actors/utils/webconsole-utils", true);
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true); loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
loader.lazyRequireGetter(this, "gDevToolsBrowser", "devtools/client/framework/devtools-browser", true); loader.lazyRequireGetter(this, "gDevToolsBrowser", "devtools/client/framework/devtools-browser", true);
loader.lazyRequireGetter(this, "nodeConstants", "devtools/shared/dom-node-constants", true); loader.lazyRequireGetter(this, "nodeConstants", "devtools/shared/dom-node-constants");
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter"); loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
/** /**

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

@ -4,7 +4,6 @@
"use strict"; "use strict";
const {Cc, Ci} = require("chrome");
const {angleUtils} = require("devtools/client/shared/css-angle"); const {angleUtils} = require("devtools/client/shared/css-angle");
const {colorUtils} = require("devtools/shared/css/color"); const {colorUtils} = require("devtools/shared/css/color");
const {getCSSLexer} = require("devtools/shared/css/lexer"); const {getCSSLexer} = require("devtools/shared/css/lexer");
@ -18,10 +17,6 @@ const {
const HTML_NS = "http://www.w3.org/1999/xhtml"; const HTML_NS = "http://www.w3.org/1999/xhtml";
loader.lazyGetter(this, "DOMUtils", function () {
return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
});
/** /**
* This module is used to process text for output by developer tools. This means * This module is used to process text for output by developer tools. This means
* linking JS files with the debugger, CSS files with the style editor, JS * linking JS files with the debugger, CSS files with the style editor, JS
@ -37,15 +32,18 @@ loader.lazyGetter(this, "DOMUtils", function () {
* parser.parseCssProperty("color", "red"); // Returns document fragment. * parser.parseCssProperty("color", "red"); // Returns document fragment.
* *
* @param {Document} document Used to create DOM nodes. * @param {Document} document Used to create DOM nodes.
* @param {Function} supportsTypes A function that returns a boolean when asked if a css * @param {Function} supportsTypes - A function that returns a boolean when asked if a css
* property name supports a given css type. * property name supports a given css type.
* The function is executed like supportsType("color", CSS_TYPES.COLOR) where CSS_TYPES is * The function is executed like supportsType("color", CSS_TYPES.COLOR)
* defined in devtools/shared/css/properties-db.js * where CSS_TYPES is defined in devtools/shared/css/properties-db.js
* @param {Function} isValidOnClient - A function that checks if a css property
* name/value combo is valid.
*/ */
function OutputParser(document, supportsType) { function OutputParser(document, {supportsType, isValidOnClient}) {
this.parsed = []; this.parsed = [];
this.doc = document; this.doc = document;
this.supportsType = supportsType; this.supportsType = supportsType;
this.isValidOnClient = isValidOnClient;
this.colorSwatches = new WeakMap(); this.colorSwatches = new WeakMap();
this.angleSwatches = new WeakMap(); this.angleSwatches = new WeakMap();
this._onColorSwatchMouseDown = this._onColorSwatchMouseDown.bind(this); this._onColorSwatchMouseDown = this._onColorSwatchMouseDown.bind(this);
@ -341,7 +339,7 @@ OutputParser.prototype = {
* CSS Property value to check * CSS Property value to check
*/ */
_cssPropertySupportsValue: function (name, value) { _cssPropertySupportsValue: function (name, value) {
return DOMUtils.cssPropertyIsValid(name, value); return this.isValidOnClient(name, value, this.doc);
}, },
/** /**

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

@ -10,6 +10,7 @@ const DOMUtils =
Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils); Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
const TEST_URI = `data:text/html,<div id="filter-container" />`; const TEST_URI = `data:text/html,<div id="filter-container" />`;
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
// Verify that the given string consists of a valid CSS URL token. // Verify that the given string consists of a valid CSS URL token.
// Return true on success, false on error. // Return true on success, false on error.
@ -26,9 +27,10 @@ function verifyURL(string) {
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
let widget = new CSSFilterEditorWidget(container, "none"); let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
info("Test parsing of a valid CSS Filter value"); info("Test parsing of a valid CSS Filter value");
widget.setCssValue("blur(2px) contrast(200%)"); widget.setCssValue("blur(2px) contrast(200%)");

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

@ -6,6 +6,7 @@
// Tests that the Filter Editor Widget renders filters correctly // Tests that the Filter Editor Widget renders filters correctly
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const { LocalizationHelper } = require("devtools/shared/l10n"); const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "devtools/locale/filterwidget.properties"; const STRINGS_URI = "devtools/locale/filterwidget.properties";
@ -15,6 +16,7 @@ const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const TEST_DATA = [ const TEST_DATA = [
{ {
@ -69,7 +71,7 @@ add_task(function* () {
]; ];
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
let widget = new CSSFilterEditorWidget(container, "none"); let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
info("Test rendering of different types"); info("Test rendering of different types");

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

@ -6,6 +6,7 @@
// Tests the Filter Editor Widget add, removeAt, updateAt, getValueAt methods // Tests the Filter Editor Widget add, removeAt, updateAt, getValueAt methods
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const GRAYSCALE_MAX = 100; const GRAYSCALE_MAX = 100;
const INVERT_MIN = 0; const INVERT_MIN = 0;
@ -13,9 +14,10 @@ const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
let widget = new CSSFilterEditorWidget(container, "none"); let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
info("Test add method"); info("Test add method");
const blur = widget.add("blur", "10.2px"); const blur = widget.add("blur", "10.2px");

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

@ -6,16 +6,18 @@
// Tests the Filter Editor Widget's drag-drop re-ordering // Tests the Filter Editor Widget's drag-drop re-ordering
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const LIST_ITEM_HEIGHT = 32; const LIST_ITEM_HEIGHT = 32;
const TEST_URI = `data:text/html,<div id="filter-container" />`; const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
const initialValue = "blur(2px) contrast(200%) brightness(200%)"; const initialValue = "blur(2px) contrast(200%) brightness(200%)";
let widget = new CSSFilterEditorWidget(container, initialValue); let widget = new CSSFilterEditorWidget(container, initialValue, cssIsValid);
const filters = widget.el.querySelector("#filters"); const filters = widget.el.querySelector("#filters");
function first() { function first() {

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

@ -8,6 +8,7 @@ requestLongerTimeout(2);
// Tests the Filter Editor Widget's label-dragging // Tests the Filter Editor Widget's label-dragging
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const FAST_VALUE_MULTIPLIER = 10; const FAST_VALUE_MULTIPLIER = 10;
const SLOW_VALUE_MULTIPLIER = 0.1; const SLOW_VALUE_MULTIPLIER = 0.1;
@ -20,9 +21,10 @@ const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
let widget = new CSSFilterEditorWidget(container, "grayscale(0%) url(test.svg)"); let widget = new CSSFilterEditorWidget(container, "grayscale(0%) url(test.svg)", cssIsValid);
const filters = widget.el.querySelector("#filters"); const filters = widget.el.querySelector("#filters");
const grayscale = filters.children[0]; const grayscale = filters.children[0];

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

@ -6,6 +6,7 @@
// Tests the Filter Editor Widget's add button // Tests the Filter Editor Widget's add button
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const { LocalizationHelper } = require("devtools/shared/l10n"); const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "devtools/locale/filterwidget.properties"; const STRINGS_URI = "devtools/locale/filterwidget.properties";
@ -15,9 +16,10 @@ const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
let widget = new CSSFilterEditorWidget(container, "none"); let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
const select = widget.el.querySelector("select"), const select = widget.el.querySelector("select"),
add = widget.el.querySelector("#add-filter"); add = widget.el.querySelector("#add-filter");

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

@ -6,6 +6,7 @@
// Tests the Filter Editor Widget's remove button // Tests the Filter Editor Widget's remove button
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const { LocalizationHelper } = require("devtools/shared/l10n"); const { LocalizationHelper } = require("devtools/shared/l10n");
const STRINGS_URI = "devtools/locale/filterwidget.properties"; const STRINGS_URI = "devtools/locale/filterwidget.properties";
@ -15,9 +16,10 @@ const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
let widget = new CSSFilterEditorWidget(container, "blur(2px) contrast(200%)"); let widget = new CSSFilterEditorWidget(container, "blur(2px) contrast(200%)", cssIsValid);
info("Test removing filters with remove button"); info("Test removing filters with remove button");
widget.el.querySelector(".filter button").click(); widget.el.querySelector(".filter button").click();

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

@ -7,6 +7,7 @@
// arrow keys, applying multiplier using alt/shift on number-type filters // arrow keys, applying multiplier using alt/shift on number-type filters
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const FAST_VALUE_MULTIPLIER = 10; const FAST_VALUE_MULTIPLIER = 10;
const SLOW_VALUE_MULTIPLIER = 0.1; const SLOW_VALUE_MULTIPLIER = 0.1;
@ -16,10 +17,11 @@ const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
const initialValue = "blur(2px)"; const initialValue = "blur(2px)";
let widget = new CSSFilterEditorWidget(container, initialValue); let widget = new CSSFilterEditorWidget(container, initialValue, cssIsValid);
let value = 2; let value = 2;

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

@ -7,6 +7,7 @@
// on a number using arrow keys, applying multiplier using alt/shift on strings // on a number using arrow keys, applying multiplier using alt/shift on strings
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const FAST_VALUE_MULTIPLIER = 10; const FAST_VALUE_MULTIPLIER = 10;
const SLOW_VALUE_MULTIPLIER = 0.1; const SLOW_VALUE_MULTIPLIER = 0.1;
@ -16,10 +17,11 @@ const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
const initialValue = "drop-shadow(rgb(0, 0, 0) 1px 1px 0px)"; const initialValue = "drop-shadow(rgb(0, 0, 0) 1px 1px 0px)";
let widget = new CSSFilterEditorWidget(container, initialValue); let widget = new CSSFilterEditorWidget(container, initialValue, cssIsValid);
widget.el.querySelector("#filters input").setSelectionRange(13, 13); widget.el.querySelector("#filters input").setSelectionRange(13, 13);
let value = 1; let value = 1;

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

@ -7,6 +7,7 @@
// on a number using arrow keys if cursor is behind/mid/after the number strings // on a number using arrow keys if cursor is behind/mid/after the number strings
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const FAST_VALUE_MULTIPLIER = 10; const FAST_VALUE_MULTIPLIER = 10;
const SLOW_VALUE_MULTIPLIER = 0.1; const SLOW_VALUE_MULTIPLIER = 0.1;
@ -16,10 +17,11 @@ const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
const initialValue = "drop-shadow(rgb(0, 0, 0) 10px 1px 0px)"; const initialValue = "drop-shadow(rgb(0, 0, 0) 10px 1px 0px)";
let widget = new CSSFilterEditorWidget(container, initialValue); let widget = new CSSFilterEditorWidget(container, initialValue, cssIsValid);
const input = widget.el.querySelector("#filters input"); const input = widget.el.querySelector("#filters input");
let value = 10; let value = 10;

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

@ -6,14 +6,16 @@
// Tests saving presets // Tests saving presets
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const TEST_URI = `data:text/html,<div id="filter-container" />`; const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
let widget = new CSSFilterEditorWidget(container, "none"); let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
// First render // First render
yield widget.once("render"); yield widget.once("render");

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

@ -6,14 +6,16 @@
// Tests loading presets // Tests loading presets
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const TEST_URI = `data:text/html,<div id="filter-container" />`; const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
let widget = new CSSFilterEditorWidget(container, "none"); let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
// First render // First render
yield widget.once("render"); yield widget.once("render");

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

@ -6,14 +6,16 @@
// Tests deleting presets // Tests deleting presets
const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget"); const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
const TEST_URI = `data:text/html,<div id="filter-container" />`; const TEST_URI = `data:text/html,<div id="filter-container" />`;
add_task(function* () { add_task(function* () {
let [host, win, doc] = yield createHost("bottom", TEST_URI); let [host, win, doc] = yield createHost("bottom", TEST_URI);
const cssIsValid = getClientCssProperties().getValidityChecker(doc);
const container = doc.querySelector("#filter-container"); const container = doc.querySelector("#filter-container");
let widget = new CSSFilterEditorWidget(container, "none"); let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
// First render // First render
yield widget.once("render"); yield widget.once("render");

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

@ -21,7 +21,7 @@ function* performTest() {
yield initCssProperties(toolbox); yield initCssProperties(toolbox);
let cssProperties = getCssProperties(toolbox); let cssProperties = getCssProperties(toolbox);
let parser = new OutputParser(doc, cssProperties.supportsType); let parser = new OutputParser(doc, cssProperties);
testParseCssProperty(doc, parser); testParseCssProperty(doc, parser);
testParseCssVar(doc, parser); testParseCssVar(doc, parser);
testParseURL(doc, parser); testParseURL(doc, parser);
@ -288,4 +288,3 @@ function testParseAngle(doc, parser) {
swatchCount = frag.querySelectorAll(".test-angleswatch").length; swatchCount = frag.querySelectorAll(".test-angleswatch").length;
is(swatchCount, 1, "angle swatch was created"); is(swatchCount, 1, "angle swatch was created");
} }

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

@ -3,6 +3,14 @@
// Tests that the developer toolbar errors count works properly. // Tests that the developer toolbar errors count works properly.
// Use the old webconsole since this is directly accessing old DOM, and
// the error count isn't reset when pressing the clear button in new one
// See Bug 1304794.
Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
});
function test() { function test() {
const TEST_URI = TEST_URI_ROOT + "browser_toolbar_webconsole_errors_count.html"; const TEST_URI = TEST_URI_ROOT + "browser_toolbar_webconsole_errors_count.html";

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

@ -115,11 +115,14 @@ const SPECIAL_VALUES = new Set(["none", "unset", "initial", "inherit"]);
* The widget container. * The widget container.
* @param {String} value * @param {String} value
* CSS filter value * CSS filter value
* @param {Function} cssIsValid
* Test whether css name / value is valid.
*/ */
function CSSFilterEditorWidget(el, value = "") { function CSSFilterEditorWidget(el, value = "", cssIsValid) {
this.doc = el.ownerDocument; this.doc = el.ownerDocument;
this.win = this.doc.defaultView; this.win = this.doc.defaultView;
this.el = el; this.el = el;
this._cssIsValid = cssIsValid;
this._addButtonClick = this._addButtonClick.bind(this); this._addButtonClick = this._addButtonClick.bind(this);
this._removeButtonClick = this._removeButtonClick.bind(this); this._removeButtonClick = this._removeButtonClick.bind(this);
@ -768,7 +771,7 @@ CSSFilterEditorWidget.prototype = {
// If the specified value is invalid, replace it with the // If the specified value is invalid, replace it with the
// default. // default.
if (name !== "url") { if (name !== "url") {
if (!DOMUtils.cssPropertyIsValid("filter", name + "(" + value + ")")) { if (!this._cssIsValid("filter", name + "(" + value + ")")) {
value = null; value = null;
} }
} }

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

@ -918,10 +918,14 @@ Heritage.extend(SwatchBasedEditorTooltip.prototype, {
* *
* @param {Toolbox} toolbox * @param {Toolbox} toolbox
* The devtools toolbox, needed to get the devtools main window. * The devtools toolbox, needed to get the devtools main window.
* @param {function} cssIsValid
* A function to check that css declaration's name and values are valid together.
* This can be obtained from "shared/fronts/css-properties.js".
*/ */
function SwatchFilterTooltip(toolbox) { function SwatchFilterTooltip(toolbox, cssIsValid) {
let stylesheet = "chrome://devtools/content/shared/widgets/filter-widget.css"; let stylesheet = "chrome://devtools/content/shared/widgets/filter-widget.css";
SwatchBasedEditorTooltip.call(this, toolbox, stylesheet); SwatchBasedEditorTooltip.call(this, toolbox, stylesheet);
this._cssIsValid = cssIsValid;
// Creating a filter editor instance. // Creating a filter editor instance.
this.widget = this.setFilterContent("none"); this.widget = this.setFilterContent("none");
@ -945,7 +949,7 @@ Heritage.extend(SwatchBasedEditorTooltip.prototype, {
this.tooltip.setContent(container, { width: 510, height: 200 }); this.tooltip.setContent(container, { width: 510, height: 200 });
return new CSSFilterEditorWidget(container, filter); return new CSSFilterEditorWidget(container, filter, this._cssIsValid);
}, },
show: Task.async(function* () { show: Task.async(function* () {

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

@ -252,6 +252,11 @@ const ViewHelpers = exports.ViewHelpers = {
// Add a class to the pane to handle min-widths, margins and animations. // Add a class to the pane to handle min-widths, margins and animations.
pane.classList.add("generic-toggled-pane"); pane.classList.add("generic-toggled-pane");
// Avoid toggles in the middle of animation.
if (pane.hasAttribute("animated")) {
return;
}
// Avoid useless toggles. // Avoid useless toggles.
if (flags.visible == !pane.classList.contains("pane-collapsed")) { if (flags.visible == !pane.classList.contains("pane-collapsed")) {
if (flags.callback) { if (flags.callback) {
@ -283,23 +288,36 @@ const ViewHelpers = exports.ViewHelpers = {
pane.style.marginLeft = -width + "px"; pane.style.marginLeft = -width + "px";
pane.style.marginRight = -width + "px"; pane.style.marginRight = -width + "px";
pane.style.marginBottom = -height + "px"; pane.style.marginBottom = -height + "px";
pane.classList.add("pane-collapsed");
} }
// Wait for the animation to end before calling afterToggle() // Wait for the animation to end before calling afterToggle()
if (flags.animated) { if (flags.animated) {
pane.addEventListener("transitionend", function onEvent() { let options = {
pane.removeEventListener("transitionend", onEvent, false); useCapture: false,
once: true
};
pane.addEventListener("transitionend", () => {
// Prevent unwanted transitions: if the panel is hidden and the layout // Prevent unwanted transitions: if the panel is hidden and the layout
// changes margins will be updated and the panel will pop out. // changes margins will be updated and the panel will pop out.
pane.removeAttribute("animated"); pane.removeAttribute("animated");
if (!flags.visible) {
pane.classList.add("pane-collapsed");
}
if (flags.callback) { if (flags.callback) {
flags.callback(); flags.callback();
} }
}, false); }, options);
} else if (flags.callback) { } else {
if (!flags.visible) {
pane.classList.add("pane-collapsed");
}
// Invoke the callback immediately since there's no transition. // Invoke the callback immediately since there's no transition.
flags.callback(); if (flags.callback) {
flags.callback();
}
} }
}; };

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

@ -325,7 +325,7 @@
display: inline-block; display: inline-block;
} }
.ruleview-expander.theme-twisty:-moz-locale-dir(rtl) { .ruleview-expander.theme-twisty:dir(rtl) {
/* for preventing .theme-twisty's wrong direction in rtl; Bug 1296648 */ /* for preventing .theme-twisty's wrong direction in rtl; Bug 1296648 */
transform: none; transform: none;
} }

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

@ -282,23 +282,23 @@
/* RTL support: move the images that were on the left to the right, /* RTL support: move the images that were on the left to the right,
* and move images that were on the right to the left. * and move images that were on the right to the left.
*/ */
.breadcrumbs-widget-item:-moz-locale-dir(rtl) { .breadcrumbs-widget-item:dir(rtl) {
padding: 0 20px 0 8px; padding: 0 20px 0 8px;
} }
.breadcrumbs-widget-item:-moz-locale-dir(rtl), .breadcrumbs-widget-item:dir(rtl),
.breadcrumbs-widget-item[checked] + .breadcrumbs-widget-item:-moz-locale-dir(rtl) { .breadcrumbs-widget-item[checked] + .breadcrumbs-widget-item:dir(rtl) {
background-position: center right; background-position: center right;
} }
#breadcrumb-separator-before:-moz-locale-dir(rtl), #breadcrumb-separator-before:dir(rtl),
#breadcrumb-separator-after:-moz-locale-dir(rtl), #breadcrumb-separator-after:dir(rtl),
#breadcrumb-separator-normal:-moz-locale-dir(rtl) { #breadcrumb-separator-normal:dir(rtl) {
transform: scaleX(-1); transform: scaleX(-1);
} }
#breadcrumb-separator-before:-moz-locale-dir(rtl):after, #breadcrumb-separator-before:dir(rtl):after,
#breadcrumb-separator-after:-moz-locale-dir(rtl):after { #breadcrumb-separator-after:dir(rtl):after {
transform: translateX(-5px) rotate(45deg); transform: translateX(-5px) rotate(45deg);
} }

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

@ -377,8 +377,7 @@ JSTerm.prototype = {
if (this.hud.NEW_CONSOLE_OUTPUT_ENABLED) { if (this.hud.NEW_CONSOLE_OUTPUT_ENABLED) {
this.hud.newConsoleOutput.dispatchMessageAdd(response); this.hud.newConsoleOutput.dispatchMessageAdd(response);
// @TODO figure out what to do about the callback. callback && callback(this.hud.newConsoleOutput.getLastMessage());
callback && callback();
return; return;
} }
let msg = new Messages.JavaScriptEvalOutput(response, let msg = new Messages.JavaScriptEvalOutput(response,
@ -426,7 +425,7 @@ JSTerm.prototype = {
let deferred = promise.defer(); let deferred = promise.defer();
let resultCallback; let resultCallback;
if (this.hud.NEW_CONSOLE_OUTPUT_ENABLED) { if (this.hud.NEW_CONSOLE_OUTPUT_ENABLED) {
resultCallback = () => deferred.resolve(); resultCallback = (msg) => deferred.resolve(msg);
} else { } else {
resultCallback = (msg) => { resultCallback = (msg) => {
deferred.resolve(msg); deferred.resolve(msg);
@ -453,7 +452,7 @@ JSTerm.prototype = {
let message = new ConsoleCommand({ let message = new ConsoleCommand({
messageText: executeString, messageText: executeString,
}); });
this.hud.newConsoleOutput.dispatchMessageAdd(message); this.hud.proxy.dispatchMessageAdd(message);
} else { } else {
let message = new Messages.Simple(executeString, { let message = new Messages.Simple(executeString, {
category: "input", category: "input",

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

@ -25,6 +25,13 @@ registerCleanupFunction(() => {
Services.prefs.clearUserPref(NET_XHR_PREF, true); Services.prefs.clearUserPref(NET_XHR_PREF, true);
}); });
// Use the old webconsole since the new one doesn't yet support
// XHR spy. See Bug 1304794.
Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
});
/** /**
* Add a new test tab in the browser and load the given url. * Add a new test tab in the browser and load the given url.
* @param {String} url The url to be loaded in the new tab * @param {String} url The url to be loaded in the new tab

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

@ -17,6 +17,7 @@ const FilterBar = React.createFactory(require("devtools/client/webconsole/new-co
const store = configureStore(); const store = configureStore();
function NewConsoleOutputWrapper(parentNode, jsterm, toolbox, owner) { function NewConsoleOutputWrapper(parentNode, jsterm, toolbox, owner) {
this.parentNode = parentNode;
this.parentNode = parentNode; this.parentNode = parentNode;
this.jsterm = jsterm; this.jsterm = jsterm;
this.toolbox = toolbox; this.toolbox = toolbox;
@ -68,6 +69,12 @@ NewConsoleOutputWrapper.prototype = {
dispatchMessagesClear: () => { dispatchMessagesClear: () => {
store.dispatch(actions.messagesClear()); store.dispatch(actions.messagesClear());
}, },
getLastMessage: function() {
// Return the last message in the DOM as the message that was just dispatched. This may not
// always be correct in the case of filtered messages, but it's close enough for our tests.
let messageNodes = this.parentNode.querySelectorAll(".message");
return messageNodes[messageNodes.length - 1]
},
}; };
// Exports from this module // Exports from this module

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

@ -52,16 +52,19 @@ var openNewTabAndConsole = Task.async(function* (url) {
function waitForMessages({ hud, messages }) { function waitForMessages({ hud, messages }) {
return new Promise(resolve => { return new Promise(resolve => {
let numMatched = 0; let numMatched = 0;
let receivedLog = hud.ui.on("new-messages", function messagesReceieved(e, newMessage) { let receivedLog = hud.ui.on("new-messages", function messagesReceieved(e, newMessages) {
for (let message of messages) { for (let message of messages) {
if (message.matched) { if (message.matched) {
continue; continue;
} }
if (newMessage.node.querySelector(".message-body").textContent == message.text) { for (let newMessage of newMessages) {
numMatched++; if (newMessage.node.querySelector(".message-body").textContent == message.text) {
message.matched = true; numMatched++;
info("Matched a message with text: " + message.text + ", still waiting for " + (messages.length - numMatched) + " messages"); message.matched = true;
info("Matched a message with text: " + message.text + ", still waiting for " + (messages.length - numMatched) + " messages");
break;
}
} }
if (numMatched === messages.length) { if (numMatched === messages.length) {

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

@ -321,6 +321,12 @@ var finishTest = Task.async(function* () {
finish(); finish();
}); });
// Always use the 'old' frontend for tests that rely on it
Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
});
registerCleanupFunction(function* () { registerCleanupFunction(function* () {
flags.testing = false; flags.testing = false;

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

@ -3266,14 +3266,10 @@ WebConsoleConnectionProxy.prototype = {
*/ */
dispatchMessageAdd: function(packet) { dispatchMessageAdd: function(packet) {
this.webConsoleFrame.newConsoleOutput.dispatchMessageAdd(packet); this.webConsoleFrame.newConsoleOutput.dispatchMessageAdd(packet);
this.webConsoleFrame.emit("new-messages", new Set([{
// Return the last message in the DOM as the message that was just dispatched. This may not
// always be true in the case of filtered messages, but it's close enough for our tests.
let messageNodes = this.webConsoleFrame.experimentalOutputNode.querySelectorAll(".message");
this.webConsoleFrame.emit("new-messages", {
response: packet, response: packet,
node: messageNodes[messageNodes.length - 1], node: this.webConsoleFrame.newConsoleOutput.getLastMessage(),
}); }]));
}, },
/** /**

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

@ -626,14 +626,20 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
/** /**
* Handle a request to set a breakpoint. * Handle a request to set a breakpoint.
* *
* @param JSON request * @param Number line
* A JSON object representing the request. * Line to break on.
* @param Number column
* Column to break on.
* @param String condition
* A condition which must be true for breakpoint to be hit.
* @param Boolean noSliding
* If true, disables breakpoint sliding.
* *
* @returns Promise * @returns Promise
* A promise that resolves to a JSON object representing the * A promise that resolves to a JSON object representing the
* response. * response.
*/ */
setBreakpoint: function (line, column, condition) { setBreakpoint: function (line, column, condition, noSliding) {
if (this.threadActor.state !== "paused") { if (this.threadActor.state !== "paused") {
throw { throw {
error: "wrongState", error: "wrongState",
@ -644,7 +650,8 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
let location = new OriginalLocation(this, line, column); let location = new OriginalLocation(this, line, column);
return this._getOrCreateBreakpointActor( return this._getOrCreateBreakpointActor(
location, location,
condition condition,
noSliding
).then((actor) => { ).then((actor) => {
let response = { let response = {
actor: actor.actorID, actor: actor.actorID,
@ -671,11 +678,13 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
* @param String condition * @param String condition
* A string that is evaluated whenever the breakpoint is hit. If the * A string that is evaluated whenever the breakpoint is hit. If the
* string evaluates to false, the breakpoint is ignored. * string evaluates to false, the breakpoint is ignored.
* @param Boolean noSliding
* If true, disables breakpoint sliding.
* *
* @returns BreakpointActor * @returns BreakpointActor
* A BreakpointActor representing the breakpoint. * A BreakpointActor representing the breakpoint.
*/ */
_getOrCreateBreakpointActor: function (originalLocation, condition) { _getOrCreateBreakpointActor: function (originalLocation, condition, noSliding) {
let actor = this.breakpointActorMap.getActor(originalLocation); let actor = this.breakpointActorMap.getActor(originalLocation);
if (!actor) { if (!actor) {
actor = new BreakpointActor(this.threadActor, originalLocation); actor = new BreakpointActor(this.threadActor, originalLocation);
@ -685,7 +694,7 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
actor.condition = condition; actor.condition = condition;
return this._setBreakpoint(actor); return this._setBreakpoint(actor, noSliding);
}, },
/* /*
@ -705,18 +714,19 @@ let SourceActor = ActorClassWithSpec(sourceSpec, {
* *
* @param BreakpointActor actor * @param BreakpointActor actor
* The BreakpointActor to be set as a breakpoint handler. * The BreakpointActor to be set as a breakpoint handler.
* @param Boolean noSliding
* If true, disables breakpoint sliding.
* *
* @returns A Promise that resolves to the given BreakpointActor. * @returns A Promise that resolves to the given BreakpointActor.
*/ */
_setBreakpoint: function (actor) { _setBreakpoint: function (actor, noSliding) {
const { originalLocation } = actor; const { originalLocation } = actor;
const { originalLine, originalSourceActor } = originalLocation; const { originalLine, originalSourceActor } = originalLocation;
if (!this.isSourceMapped) { if (!this.isSourceMapped) {
if (!this._setBreakpointAtGeneratedLocation( const generatedLocation = GeneratedLocation.fromOriginalLocation(originalLocation);
actor, if (!this._setBreakpointAtGeneratedLocation(actor, generatedLocation) &&
GeneratedLocation.fromOriginalLocation(originalLocation) !noSliding) {
)) {
const query = { line: originalLine }; const query = { line: originalLine };
// For most cases, we have a real source to query for. The // For most cases, we have a real source to query for. The
// only time we don't is for HTML pages. In that case we want // only time we don't is for HTML pages. In that case we want

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

@ -94,6 +94,11 @@ window.onload = function() {
"A property with color values includes papayawhip."); "A property with color values includes papayawhip.");
ok(bgColorValues.includes("rgb"), ok(bgColorValues.includes("rgb"),
"A property with color values includes non-colors."); "A property with color values includes non-colors.");
ok(cssProperties.isValidOnClient("margin", "0px", window.document),
"Margin and 0px are valid CSS values");
ok(!cssProperties.isValidOnClient("margin", "foo", window.document),
"Margin and foo are not valid CSS values");
}); });
addAsyncTest(function* setup() { addAsyncTest(function* setup() {

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

@ -36,40 +36,52 @@ function run_test_with_server(aServer, aCallback)
}); });
} }
function test_skip_breakpoint() var test_no_skip_breakpoint = Task.async(function*(source, location) {
{ let [aResponse, bpClient] = yield source.setBreakpoint(
gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) { Object.assign({}, location, { noSliding: true })
);
do_check_true(!aResponse.actualLocation);
do_check_eq(bpClient.location.line, gDebuggee.line0 + 3);
yield bpClient.remove();
});
var test_skip_breakpoint = function() {
gThreadClient.addOneTimeListener("paused", Task.async(function *(aEvent, aPacket) {
let location = { line: gDebuggee.line0 + 3 }; let location = { line: gDebuggee.line0 + 3 };
let source = gThreadClient.source(aPacket.frame.where.source); let source = gThreadClient.source(aPacket.frame.where.source);
source.setBreakpoint(location, function (aResponse, bpClient) { // First, make sure that we can disable sliding with the
// Check that the breakpoint has properly skipped forward one line. // `noSliding` option.
do_check_true(!!aResponse.actualLocation); yield test_no_skip_breakpoint(source, location);
do_check_eq(aResponse.actualLocation.source.actor, source.actor);
do_check_eq(aResponse.actualLocation.line, location.line + 1);
gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) { // Now make sure that the breakpoint properly slides forward one line.
// Check the return value. const [aResponse, bpClient] = yield source.setBreakpoint(location);
do_check_eq(aPacket.type, "paused"); do_check_true(!!aResponse.actualLocation);
do_check_eq(aPacket.frame.where.source.actor, source.actor); do_check_eq(aResponse.actualLocation.source.actor, source.actor);
do_check_eq(aPacket.frame.where.line, location.line + 1); do_check_eq(aResponse.actualLocation.line, location.line + 1);
do_check_eq(aPacket.why.type, "breakpoint");
do_check_eq(aPacket.why.actors[0], bpClient.actor);
// Check that the breakpoint worked.
do_check_eq(gDebuggee.a, 1);
do_check_eq(gDebuggee.b, undefined);
// Remove the breakpoint. gThreadClient.addOneTimeListener("paused", function (aEvent, aPacket) {
bpClient.remove(function (aResponse) { // Check the return value.
gThreadClient.resume(function () { do_check_eq(aPacket.type, "paused");
gClient.close().then(gCallback); do_check_eq(aPacket.frame.where.source.actor, source.actor);
}); do_check_eq(aPacket.frame.where.line, location.line + 1);
do_check_eq(aPacket.why.type, "breakpoint");
do_check_eq(aPacket.why.actors[0], bpClient.actor);
// Check that the breakpoint worked.
do_check_eq(gDebuggee.a, 1);
do_check_eq(gDebuggee.b, undefined);
// Remove the breakpoint.
bpClient.remove(function (aResponse) {
gThreadClient.resume(function () {
gClient.close().then(gCallback);
}); });
}); });
gThreadClient.resume();
}); });
});
gThreadClient.resume();
}));
// Use `evalInSandbox` to make the debugger treat it as normal // Use `evalInSandbox` to make the debugger treat it as normal
// globally-scoped code, where breakpoint sliding rules apply. // globally-scoped code, where breakpoint sliding rules apply.

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

@ -2893,7 +2893,7 @@ SourceClient.prototype = {
* @param function aOnResponse * @param function aOnResponse
* Called with the thread's response. * Called with the thread's response.
*/ */
setBreakpoint: function ({ line, column, condition }, aOnResponse = noop) { setBreakpoint: function ({ line, column, condition, noSliding }, aOnResponse = noop) {
// A helper function that sets the breakpoint. // A helper function that sets the breakpoint.
let doSetBreakpoint = aCallback => { let doSetBreakpoint = aCallback => {
let root = this._client.mainRoot; let root = this._client.mainRoot;
@ -2906,7 +2906,8 @@ SourceClient.prototype = {
to: this.actor, to: this.actor,
type: "setBreakpoint", type: "setBreakpoint",
location: location, location: location,
condition: condition condition: condition,
noSliding: noSliding
}; };
// Backwards compatibility: send the breakpoint request to the // Backwards compatibility: send the breakpoint request to the

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

@ -65,6 +65,10 @@ function CssProperties(db) {
this.isKnown = this.isKnown.bind(this); this.isKnown = this.isKnown.bind(this);
this.isInherited = this.isInherited.bind(this); this.isInherited = this.isInherited.bind(this);
this.supportsType = this.supportsType.bind(this); this.supportsType = this.supportsType.bind(this);
this.isValidOnClient = this.isValidOnClient.bind(this);
// A weakly held dummy HTMLDivElement to test CSS properties on the client.
this._dummyElements = new WeakMap();
} }
CssProperties.prototype = { CssProperties.prototype = {
@ -79,6 +83,45 @@ CssProperties.prototype = {
return !!this.properties[property] || isCssVariable(property); return !!this.properties[property] || isCssVariable(property);
}, },
/**
* Quickly check if a CSS name/value combo is valid on the client.
*
* @param {String} Property name.
* @param {String} Property value.
* @param {Document} The client's document object.
* @return {Boolean}
*/
isValidOnClient(name, value, doc) {
let dummyElement = this._dummyElements.get(doc);
if (!dummyElement) {
dummyElement = doc.createElement("div");
this._dummyElements.set(doc, dummyElement);
}
// `!important` is not a valid value when setting a style declaration in the
// CSS Object Model.
const sanitizedValue = ("" + value).replace(/!\s*important\s*$/, "");
// Test the style on the element.
dummyElement.style[name] = sanitizedValue;
const isValid = !!dummyElement.style[name];
// Reset the state of the dummy element;
dummyElement.style[name] = "";
return isValid;
},
/**
* Get a function that will check the validity of css name/values for a given document.
* Useful for injecting isValidOnClient into components when needed.
*
* @param {Document} The client's document object.
* @return {Function} this.isValidOnClient with the document pre-set.
*/
getValidityChecker(doc) {
return (name, value) => this.isValidOnClient(name, value, doc);
},
/** /**
* Checks to see if the property is an inherited one. * Checks to see if the property is an inherited one.
* *

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

@ -29,7 +29,8 @@ const sourceSpec = generateActorSpec({
line: Arg(0, "number"), line: Arg(0, "number"),
column: Arg(1, "nullable:number") column: Arg(1, "nullable:number")
}, },
condition: Arg(2, "nullable:string") condition: Arg(2, "nullable:string"),
noSliding: Arg(3, "nullable:boolean")
}, },
response: RetVal("json") response: RetVal("json")
}, },

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

@ -46,7 +46,7 @@ DocumentTimeline::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
/* static */ already_AddRefed<DocumentTimeline> /* static */ already_AddRefed<DocumentTimeline>
DocumentTimeline::Constructor(const GlobalObject& aGlobal, DocumentTimeline::Constructor(const GlobalObject& aGlobal,
const DOMHighResTimeStamp& aOriginTime, const DocumentTimelineOptions& aOptions,
ErrorResult& aRv) ErrorResult& aRv)
{ {
nsIDocument* doc = AnimationUtils::GetCurrentRealmDocument(aGlobal.Context()); nsIDocument* doc = AnimationUtils::GetCurrentRealmDocument(aGlobal.Context());
@ -54,12 +54,11 @@ DocumentTimeline::Constructor(const GlobalObject& aGlobal,
aRv.Throw(NS_ERROR_FAILURE); aRv.Throw(NS_ERROR_FAILURE);
return nullptr; return nullptr;
} }
TimeDuration originTime =
TimeDuration::FromMilliseconds(aOptions.mOriginTime);
TimeDuration originTime = TimeDuration::FromMilliseconds(aOriginTime);
if (originTime == TimeDuration::Forever() || if (originTime == TimeDuration::Forever() ||
originTime == -TimeDuration::Forever()) { originTime == -TimeDuration::Forever()) {
nsAutoString inputOriginTime;
inputOriginTime.AppendFloat(aOriginTime);
aRv.ThrowTypeError<dom::MSG_TIME_VALUE_OUT_OF_RANGE>( aRv.ThrowTypeError<dom::MSG_TIME_VALUE_OUT_OF_RANGE>(
NS_LITERAL_STRING("Origin time")); NS_LITERAL_STRING("Origin time"));
return nullptr; return nullptr;

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

@ -7,6 +7,7 @@
#ifndef mozilla_dom_DocumentTimeline_h #ifndef mozilla_dom_DocumentTimeline_h
#define mozilla_dom_DocumentTimeline_h #define mozilla_dom_DocumentTimeline_h
#include "mozilla/dom/DocumentTimelineBinding.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "AnimationTimeline.h" #include "AnimationTimeline.h"
#include "nsIDocument.h" #include "nsIDocument.h"
@ -54,7 +55,7 @@ public:
static already_AddRefed<DocumentTimeline> static already_AddRefed<DocumentTimeline>
Constructor(const GlobalObject& aGlobal, Constructor(const GlobalObject& aGlobal,
const DOMHighResTimeStamp& aOriginTime, const DocumentTimelineOptions& aOptions,
ErrorResult& aRv); ErrorResult& aRv);
// AnimationTimeline methods // AnimationTimeline methods

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

@ -12,13 +12,17 @@
// inside the allowed range will just mean we overflow elsewhere. // inside the allowed range will just mean we overflow elsewhere.
test(function(t) { test(function(t) {
assert_throws({name: 'TypeError'}, assert_throws({ name: 'TypeError'},
function() { new DocumentTimeline(Number.MAX_SAFE_INTEGER); }); function() {
new DocumentTimeline({ originTime: Number.MAX_SAFE_INTEGER });
});
}, 'Calculated current time is positive infinity'); }, 'Calculated current time is positive infinity');
test(function(t) { test(function(t) {
assert_throws({name: 'TypeError'}, assert_throws({ name: 'TypeError'},
function() { new DocumentTimeline(-1 * Number.MAX_SAFE_INTEGER); }); function() {
new DocumentTimeline({ originTime: -1 * Number.MAX_SAFE_INTEGER });
});
}, 'Calculated current time is negative infinity'); }, 'Calculated current time is negative infinity');
done(); done();

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

@ -116,10 +116,8 @@
#endif #endif
#include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentChild.h"
#ifdef MOZ_EME
#include "mozilla/EMEUtils.h" #include "mozilla/EMEUtils.h"
#include "mozilla/DetailedPromise.h" #include "mozilla/DetailedPromise.h"
#endif
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
@ -249,9 +247,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mServiceWorkerContainer) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mServiceWorkerContainer)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
#ifdef MOZ_EME
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaKeySystemAccessManager) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaKeySystemAccessManager)
#endif
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDeviceStorageAreaListener) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDeviceStorageAreaListener)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPresentation) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPresentation)
#ifdef MOZ_GAMEPAD #ifdef MOZ_GAMEPAD
@ -386,12 +382,10 @@ Navigator::Invalidate()
mServiceWorkerContainer = nullptr; mServiceWorkerContainer = nullptr;
#ifdef MOZ_EME
if (mMediaKeySystemAccessManager) { if (mMediaKeySystemAccessManager) {
mMediaKeySystemAccessManager->Shutdown(); mMediaKeySystemAccessManager->Shutdown();
mMediaKeySystemAccessManager = nullptr; mMediaKeySystemAccessManager = nullptr;
} }
#endif
if (mDeviceStorageAreaListener) { if (mDeviceStorageAreaListener) {
mDeviceStorageAreaListener = nullptr; mDeviceStorageAreaListener = nullptr;
@ -2324,7 +2318,6 @@ Navigator::GetUserAgent(nsPIDOMWindowInner* aWindow, nsIURI* aURI,
return siteSpecificUA->GetUserAgentForURIAndWindow(aURI, aWindow, aUserAgent); return siteSpecificUA->GetUserAgentForURIAndWindow(aURI, aWindow, aUserAgent);
} }
#ifdef MOZ_EME
static nsCString static nsCString
ToCString(const nsString& aString) ToCString(const nsString& aString)
{ {
@ -2450,7 +2443,6 @@ Navigator::RequestMediaKeySystemAccess(const nsAString& aKeySystem,
mMediaKeySystemAccessManager->Request(promise, aKeySystem, aConfigs); mMediaKeySystemAccessManager->Request(promise, aKeySystem, aConfigs);
return promise.forget(); return promise.forget();
} }
#endif
Presentation* Presentation*
Navigator::GetPresentation(ErrorResult& aRv) Navigator::GetPresentation(ErrorResult& aRv)

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

@ -18,9 +18,7 @@
#include "nsString.h" #include "nsString.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "nsWeakPtr.h" #include "nsWeakPtr.h"
#ifdef MOZ_EME
#include "mozilla/dom/MediaKeySystemAccessManager.h" #include "mozilla/dom/MediaKeySystemAccessManager.h"
#endif
class nsPluginArray; class nsPluginArray;
class nsMimeTypeArray; class nsMimeTypeArray;
@ -317,14 +315,12 @@ public:
// any, else null. // any, else null.
static already_AddRefed<nsPIDOMWindowInner> GetWindowFromGlobal(JSObject* aGlobal); static already_AddRefed<nsPIDOMWindowInner> GetWindowFromGlobal(JSObject* aGlobal);
#ifdef MOZ_EME
already_AddRefed<Promise> already_AddRefed<Promise>
RequestMediaKeySystemAccess(const nsAString& aKeySystem, RequestMediaKeySystemAccess(const nsAString& aKeySystem,
const Sequence<MediaKeySystemConfiguration>& aConfig, const Sequence<MediaKeySystemConfiguration>& aConfig,
ErrorResult& aRv); ErrorResult& aRv);
private: private:
RefPtr<MediaKeySystemAccessManager> mMediaKeySystemAccessManager; RefPtr<MediaKeySystemAccessManager> mMediaKeySystemAccessManager;
#endif
public: public:
void NotifyVRDisplaysUpdated(); void NotifyVRDisplaysUpdated();

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

@ -4356,7 +4356,6 @@ nsDocument::SetScopeObject(nsIGlobalObject* aGlobal)
} }
} }
#ifdef MOZ_EME
static void static void
CheckIfContainsEMEContent(nsISupports* aSupports, void* aContainsEME) CheckIfContainsEMEContent(nsISupports* aSupports, void* aContainsEME)
{ {
@ -4380,7 +4379,6 @@ nsDocument::ContainsEMEContent()
static_cast<void*>(&containsEME)); static_cast<void*>(&containsEME));
return containsEME; return containsEME;
} }
#endif // MOZ_EME
static void static void
CheckIfContainsMSEContent(nsISupports* aSupports, void* aContainsMSE) CheckIfContainsMSEContent(nsISupports* aSupports, void* aContainsMSE)
@ -8361,13 +8359,11 @@ nsDocument::CanSavePresentation(nsIRequest *aNewRequest)
} }
#endif // MOZ_WEBRTC #endif // MOZ_WEBRTC
#ifdef MOZ_EME
// Don't save presentations for documents containing EME content, so that // Don't save presentations for documents containing EME content, so that
// CDMs reliably shutdown upon user navigation. // CDMs reliably shutdown upon user navigation.
if (ContainsEMEContent()) { if (ContainsEMEContent()) {
return false; return false;
} }
#endif
// Don't save presentations for documents containing MSE content, to // Don't save presentations for documents containing MSE content, to
// reduce memory usage. // reduce memory usage.

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

@ -1264,9 +1264,7 @@ public:
js::ExpandoAndGeneration mExpandoAndGeneration; js::ExpandoAndGeneration mExpandoAndGeneration;
#ifdef MOZ_EME
bool ContainsEMEContent(); bool ContainsEMEContent();
#endif
bool ContainsMSEContent(); bool ContainsMSEContent();

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

@ -2228,8 +2228,6 @@ GK_ATOM(scrollbar_start_forward, "scrollbar-start-forward")
GK_ATOM(scrollbar_end_backward, "scrollbar-end-backward") GK_ATOM(scrollbar_end_backward, "scrollbar-end-backward")
GK_ATOM(scrollbar_end_forward, "scrollbar-end-forward") GK_ATOM(scrollbar_end_forward, "scrollbar-end-forward")
GK_ATOM(scrollbar_thumb_proportional, "scrollbar-thumb-proportional") GK_ATOM(scrollbar_thumb_proportional, "scrollbar-thumb-proportional")
GK_ATOM(images_in_menus, "images-in-menus")
GK_ATOM(images_in_buttons, "images-in-buttons")
GK_ATOM(overlay_scrollbars, "overlay-scrollbars") GK_ATOM(overlay_scrollbars, "overlay-scrollbars")
GK_ATOM(windows_default_theme, "windows-default-theme") GK_ATOM(windows_default_theme, "windows-default-theme")
GK_ATOM(mac_graphite_theme, "mac-graphite-theme") GK_ATOM(mac_graphite_theme, "mac-graphite-theme")
@ -2259,8 +2257,6 @@ GK_ATOM(_moz_scrollbar_start_forward, "-moz-scrollbar-start-forward")
GK_ATOM(_moz_scrollbar_end_backward, "-moz-scrollbar-end-backward") GK_ATOM(_moz_scrollbar_end_backward, "-moz-scrollbar-end-backward")
GK_ATOM(_moz_scrollbar_end_forward, "-moz-scrollbar-end-forward") GK_ATOM(_moz_scrollbar_end_forward, "-moz-scrollbar-end-forward")
GK_ATOM(_moz_scrollbar_thumb_proportional, "-moz-scrollbar-thumb-proportional") GK_ATOM(_moz_scrollbar_thumb_proportional, "-moz-scrollbar-thumb-proportional")
GK_ATOM(_moz_images_in_menus, "-moz-images-in-menus")
GK_ATOM(_moz_images_in_buttons, "-moz-images-in-buttons")
GK_ATOM(_moz_overlay_scrollbars, "-moz-overlay-scrollbars") GK_ATOM(_moz_overlay_scrollbars, "-moz-overlay-scrollbars")
GK_ATOM(_moz_windows_default_theme, "-moz-windows-default-theme") GK_ATOM(_moz_windows_default_theme, "-moz-windows-default-theme")
GK_ATOM(_moz_mac_graphite_theme, "-moz-mac-graphite-theme") GK_ATOM(_moz_mac_graphite_theme, "-moz-mac-graphite-theme")

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

@ -4785,12 +4785,10 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
return; return;
} }
#ifdef MOZ_EME
if (video->ContainsRestrictedContent()) { if (video->ContainsRestrictedContent()) {
aError.Throw(NS_ERROR_NOT_AVAILABLE); aError.Throw(NS_ERROR_NOT_AVAILABLE);
return; return;
} }
#endif
uint16_t readyState; uint16_t readyState;
if (NS_SUCCEEDED(video->GetReadyState(&readyState)) && if (NS_SUCCEEDED(video->GetReadyState(&readyState)) &&

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

@ -53,6 +53,7 @@ fail-if = (os == 'android') || (os == 'win' && os_version == '5.1')
[test_backbuffer_channels.html] [test_backbuffer_channels.html]
fail-if = (os == 'b2g') fail-if = (os == 'b2g')
[test_depth_readpixels.html] [test_depth_readpixels.html]
[test_canvas_size.html]
[test_capture.html] [test_capture.html]
support-files = ../captureStream_common.js support-files = ../captureStream_common.js
# Even though we use ../ here, in the test HTML, we need to omit this. Sub-CWD relative # Even though we use ../ here, in the test HTML, we need to omit this. Sub-CWD relative

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

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset='UTF-8'>
<script src='/tests/SimpleTest/SimpleTest.js'></script>
<link rel='stylesheet' href='/tests/SimpleTest/test.css'>
</head>
<title>WebGL test: Framebuffer maximum size test. (Bug 1290333)</title>
<body>
<script>
function TestSize(contextName, testSize) {
var attributes = {
antialias: false,
};
var canvas = document.createElement('canvas');
var gl = canvas.getContext(contextName, attributes);
if (!gl) {
todo(false, contextName + 'is unavailable.');
return;
}
gl.canvas.width = testSize;
gl.canvas.height = testSize;
ok(true, contextName + 'test complete.');
}
function run() {
TestSize('webgl', 16384);
TestSize('webgl2', 16384);
ok(true, 'Test complete.');
SimpleTest.finish();
}
////////////////////////////////////////
SimpleTest.waitForExplicitFinish();
try {
var prefPairList = [
['webgl.force-enabled', true],
];
var prefEnv = {'set': prefPairList};
SpecialPowers.pushPrefEnv(prefEnv, run);
} catch (e) {
warning('No SpecialPowers, but trying WebGL2 anyway...');
run();
}
</script>
</body>
</html>

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

@ -11,9 +11,7 @@
#include "mozilla/ArrayUtils.h" #include "mozilla/ArrayUtils.h"
#include "mozilla/MathAlgorithms.h" #include "mozilla/MathAlgorithms.h"
#include "mozilla/AsyncEventDispatcher.h" #include "mozilla/AsyncEventDispatcher.h"
#ifdef MOZ_EME
#include "mozilla/dom/MediaEncryptedEvent.h" #include "mozilla/dom/MediaEncryptedEvent.h"
#endif
#include "base/basictypes.h" #include "base/basictypes.h"
#include "nsIDOMHTMLMediaElement.h" #include "nsIDOMHTMLMediaElement.h"
@ -711,9 +709,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTM
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTextTrackManager) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTextTrackManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAudioTrackList) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAudioTrackList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVideoTrackList) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVideoTrackList)
#ifdef MOZ_EME
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaKeys) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaKeys)
#endif
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelectedVideoStreamTrack) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelectedVideoStreamTrack)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
@ -738,9 +734,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLE
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTextTrackManager) NS_IMPL_CYCLE_COLLECTION_UNLINK(mTextTrackManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAudioTrackList) NS_IMPL_CYCLE_COLLECTION_UNLINK(mAudioTrackList)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mVideoTrackList) NS_IMPL_CYCLE_COLLECTION_UNLINK(mVideoTrackList)
#ifdef MOZ_EME
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMediaKeys) NS_IMPL_CYCLE_COLLECTION_UNLINK(mMediaKeys)
#endif
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSelectedVideoStreamTrack) NS_IMPL_CYCLE_COLLECTION_UNLINK(mSelectedVideoStreamTrack)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_UNLINK_END
@ -918,14 +912,12 @@ void HTMLMediaElement::ShutdownDecoder()
void HTMLMediaElement::AbortExistingLoads() void HTMLMediaElement::AbortExistingLoads()
{ {
#ifdef MOZ_EME
// If there is no existing decoder then we don't have anything to // If there is no existing decoder then we don't have anything to
// report. This prevents reporting the initial load from an // report. This prevents reporting the initial load from an
// empty video element as a failed EME load. // empty video element as a failed EME load.
if (mDecoder) { if (mDecoder) {
ReportEMETelemetry(); ReportEMETelemetry();
} }
#endif
// Abort any already-running instance of the resource selection algorithm. // Abort any already-running instance of the resource selection algorithm.
mLoadWaitStatus = NOT_WAITING; mLoadWaitStatus = NOT_WAITING;
@ -984,9 +976,7 @@ void HTMLMediaElement::AbortExistingLoads()
mDownloadSuspendedByCache = false; mDownloadSuspendedByCache = false;
mMediaInfo = MediaInfo(); mMediaInfo = MediaInfo();
mIsEncrypted = false; mIsEncrypted = false;
#ifdef MOZ_EME
mPendingEncryptedInitData.mInitDatas.Clear(); mPendingEncryptedInitData.mInitDatas.Clear();
#endif // MOZ_EME
mWaitingForKey = false; mWaitingForKey = false;
mSourcePointer = nullptr; mSourcePointer = nullptr;
@ -1627,6 +1617,18 @@ nsresult HTMLMediaElement::LoadResource()
// Set the media element's CORS mode only when loading a resource // Set the media element's CORS mode only when loading a resource
mCORSMode = AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin)); mCORSMode = AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin));
bool isBlob = false;
if (mMediaKeys &&
Preferences::GetBool("media.eme.mse-only", true) &&
// We only want mediaSource URLs, but they are BlobURL, so we have to
// check the schema and if they are not MediaStream or real Blob.
(NS_FAILED(mLoadingSrc->SchemeIs(BLOBURI_SCHEME, &isBlob)) ||
!isBlob ||
IsMediaStreamURI(mLoadingSrc) ||
IsBlobURI(mLoadingSrc))) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
HTMLMediaElement* other = LookupMediaElementURITable(mLoadingSrc); HTMLMediaElement* other = LookupMediaElementURITable(mLoadingSrc);
if (other && other->mDecoder) { if (other && other->mDecoder) {
// Clone it. // Clone it.
@ -2525,11 +2527,9 @@ HTMLMediaElement::CaptureStreamInternal(bool aFinishWhenEnded,
if (!window) { if (!window) {
return nullptr; return nullptr;
} }
#ifdef MOZ_EME
if (ContainsRestrictedContent()) { if (ContainsRestrictedContent()) {
return nullptr; return nullptr;
} }
#endif
if (!mOutputStreams.IsEmpty() && if (!mOutputStreams.IsEmpty() &&
aGraph != mOutputStreams[0].mStream->GetInputStream()->Graph()) { aGraph != mOutputStreams[0].mStream->GetInputStream()->Graph()) {
@ -3463,7 +3463,6 @@ void HTMLMediaElement::HiddenVideoStop()
mVideoDecodeSuspendTimer = nullptr; mVideoDecodeSuspendTimer = nullptr;
} }
#ifdef MOZ_EME
void void
HTMLMediaElement::ReportEMETelemetry() HTMLMediaElement::ReportEMETelemetry()
{ {
@ -3475,7 +3474,6 @@ HTMLMediaElement::ReportEMETelemetry()
this, mLoadedDataFired ? "true" : "false")); this, mLoadedDataFired ? "true" : "false"));
} }
} }
#endif
void void
HTMLMediaElement::ReportTelemetry() HTMLMediaElement::ReportTelemetry()
@ -3832,7 +3830,6 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
ms.mFinishWhenEnded); ms.mFinishWhenEnded);
} }
#ifdef MOZ_EME
if (mMediaKeys) { if (mMediaKeys) {
if (mMediaKeys->GetCDMProxy()) { if (mMediaKeys->GetCDMProxy()) {
mDecoder->SetCDMProxy(mMediaKeys->GetCDMProxy()); mDecoder->SetCDMProxy(mMediaKeys->GetCDMProxy());
@ -3842,7 +3839,6 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
} }
#endif
MediaEventSource<void>* waitingForKeyProducer = mDecoder->WaitingForKeyEvent(); MediaEventSource<void>* waitingForKeyProducer = mDecoder->WaitingForKeyEvent();
// Not every decoder will produce waitingForKey events, only add ones that can // Not every decoder will produce waitingForKey events, only add ones that can
@ -4305,11 +4301,7 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
SetMediaInfo(*aInfo); SetMediaInfo(*aInfo);
mIsEncrypted = aInfo->IsEncrypted() mIsEncrypted = aInfo->IsEncrypted() || mPendingEncryptedInitData.IsEncrypted();
#ifdef MOZ_EME
|| mPendingEncryptedInitData.IsEncrypted()
#endif // MOZ_EME
;
mTags = aTags.forget(); mTags = aTags.forget();
mLoadedDataFired = false; mLoadedDataFired = false;
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_METADATA); ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_METADATA);
@ -4335,13 +4327,11 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
return; return;
} }
#ifdef MOZ_EME
// Dispatch a distinct 'encrypted' event for each initData we have. // Dispatch a distinct 'encrypted' event for each initData we have.
for (const auto& initData : mPendingEncryptedInitData.mInitDatas) { for (const auto& initData : mPendingEncryptedInitData.mInitDatas) {
DispatchEncrypted(initData.mInitData, initData.mType); DispatchEncrypted(initData.mInitData, initData.mType);
} }
mPendingEncryptedInitData.mInitDatas.Clear(); mPendingEncryptedInitData.mInitDatas.Clear();
#endif // MOZ_EME
} }
mWatchManager.ManualNotify(&HTMLMediaElement::UpdateReadyStateInternal); mWatchManager.ManualNotify(&HTMLMediaElement::UpdateReadyStateInternal);
@ -4871,17 +4861,14 @@ void HTMLMediaElement::ChangeReadyState(nsMediaReadyState aState)
if (oldState < nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA && if (oldState < nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA &&
mReadyState >= nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA) { mReadyState >= nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA) {
DispatchAsyncEvent(NS_LITERAL_STRING("canplay")); DispatchAsyncEvent(NS_LITERAL_STRING("canplay"));
if (!mPaused) {
mWaitingForKey = false;
DispatchAsyncEvent(NS_LITERAL_STRING("playing"));
}
} }
CheckAutoplayDataReady(); CheckAutoplayDataReady();
if (oldState < nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA &&
mReadyState >= nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA &&
IsPotentiallyPlaying()) {
mWaitingForKey = false;
DispatchAsyncEvent(NS_LITERAL_STRING("playing"));
}
if (oldState < nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA && if (oldState < nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA &&
mReadyState >= nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA) { mReadyState >= nsIDOMHTMLMediaElement::HAVE_ENOUGH_DATA) {
DispatchAsyncEvent(NS_LITERAL_STRING("canplaythrough")); DispatchAsyncEvent(NS_LITERAL_STRING("canplaythrough"));
@ -4990,6 +4977,8 @@ void HTMLMediaElement::CheckAutoplayDataReady()
// For blocked media, the event would be pending until it is resumed. // For blocked media, the event would be pending until it is resumed.
DispatchAsyncEvent(NS_LITERAL_STRING("play")); DispatchAsyncEvent(NS_LITERAL_STRING("play"));
DispatchAsyncEvent(NS_LITERAL_STRING("playing"));
} }
bool HTMLMediaElement::IsActive() const bool HTMLMediaElement::IsActive() const
@ -5260,11 +5249,8 @@ void HTMLMediaElement::SuspendOrResumeElement(bool aPauseElement, bool aSuspendE
UpdateAudioChannelPlayingState(); UpdateAudioChannelPlayingState();
if (aPauseElement) { if (aPauseElement) {
ReportTelemetry(); ReportTelemetry();
#ifdef MOZ_EME
ReportEMETelemetry(); ReportEMETelemetry();
#endif
#ifdef MOZ_EME
// For EME content, force destruction of the CDM client (and CDM // For EME content, force destruction of the CDM client (and CDM
// instance if this is the last client for that CDM instance) and // instance if this is the last client for that CDM instance) and
// the CDM's decoder. This ensures the CDM gets reliable and prompt // the CDM's decoder. This ensures the CDM gets reliable and prompt
@ -5277,16 +5263,13 @@ void HTMLMediaElement::SuspendOrResumeElement(bool aPauseElement, bool aSuspendE
ShutdownDecoder(); ShutdownDecoder();
} }
} }
#endif
if (mDecoder) { if (mDecoder) {
mDecoder->Pause(); mDecoder->Pause();
mDecoder->Suspend(); mDecoder->Suspend();
} }
mEventDeliveryPaused = aSuspendEvents; mEventDeliveryPaused = aSuspendEvents;
} else { } else {
#ifdef MOZ_EME
MOZ_ASSERT(!mMediaKeys); MOZ_ASSERT(!mMediaKeys);
#endif
if (mDecoder) { if (mDecoder) {
mDecoder->Resume(); mDecoder->Resume();
if (!mPaused && !mDecoder->IsEnded()) { if (!mPaused && !mDecoder->IsEnded()) {
@ -6069,7 +6052,7 @@ HTMLMediaElement::OnVisibilityChange(Visibility aNewVisibility)
} }
} }
#ifdef MOZ_EME
MediaKeys* MediaKeys*
HTMLMediaElement::GetMediaKeys() const HTMLMediaElement::GetMediaKeys() const
{ {
@ -6275,7 +6258,6 @@ HTMLMediaElement::GetTopLevelPrincipal()
principal = doc->NodePrincipal(); principal = doc->NodePrincipal();
return principal.forget(); return principal.forget();
} }
#endif // MOZ_EME
void void
HTMLMediaElement::CannotDecryptWaitingForKey() HTMLMediaElement::CannotDecryptWaitingForKey()

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

@ -20,9 +20,7 @@
#include "mozilla/dom/TextTrackManager.h" #include "mozilla/dom/TextTrackManager.h"
#include "mozilla/WeakPtr.h" #include "mozilla/WeakPtr.h"
#include "MediaDecoder.h" #include "MediaDecoder.h"
#ifdef MOZ_EME
#include "mozilla/dom/MediaKeys.h" #include "mozilla/dom/MediaKeys.h"
#endif
#include "mozilla/StateWatching.h" #include "mozilla/StateWatching.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "PrincipalChangeObserver.h" #include "PrincipalChangeObserver.h"
@ -626,7 +624,6 @@ public:
// XPCOM MozPreservesPitch() is OK // XPCOM MozPreservesPitch() is OK
#ifdef MOZ_EME
MediaKeys* GetMediaKeys() const; MediaKeys* GetMediaKeys() const;
already_AddRefed<Promise> SetMediaKeys(MediaKeys* mediaKeys, already_AddRefed<Promise> SetMediaKeys(MediaKeys* mediaKeys,
@ -648,7 +645,6 @@ public:
already_AddRefed<nsIPrincipal> GetTopLevelPrincipal(); already_AddRefed<nsIPrincipal> GetTopLevelPrincipal();
bool ContainsRestrictedContent(); bool ContainsRestrictedContent();
#endif // MOZ_EME
void CannotDecryptWaitingForKey(); void CannotDecryptWaitingForKey();
@ -1191,9 +1187,8 @@ protected:
*/ */
void HiddenVideoStop(); void HiddenVideoStop();
#ifdef MOZ_EME
void ReportEMETelemetry(); void ReportEMETelemetry();
#endif
void ReportTelemetry(); void ReportTelemetry();
// Check the permissions for audiochannel. // Check the permissions for audiochannel.
@ -1452,10 +1447,8 @@ protected:
// Timer used to simulate video-suspend. // Timer used to simulate video-suspend.
nsCOMPtr<nsITimer> mVideoDecodeSuspendTimer; nsCOMPtr<nsITimer> mVideoDecodeSuspendTimer;
#ifdef MOZ_EME
// Encrypted Media Extension media keys. // Encrypted Media Extension media keys.
RefPtr<MediaKeys> mMediaKeys; RefPtr<MediaKeys> mMediaKeys;
#endif
// Stores the time at the start of the current 'played' range. // Stores the time at the start of the current 'played' range.
double mCurrentPlayRangeStart; double mCurrentPlayRangeStart;
@ -1604,10 +1597,8 @@ protected:
// Listens for waitingForKey events from the owned decoder. // Listens for waitingForKey events from the owned decoder.
MediaEventListener mWaitingForKeyListener; MediaEventListener mWaitingForKeyListener;
#ifdef MOZ_EME
// Init Data that needs to be sent in 'encrypted' events in MetadataLoaded(). // Init Data that needs to be sent in 'encrypted' events in MetadataLoaded().
EncryptionInfo mPendingEncryptedInitData; EncryptionInfo mPendingEncryptedInitData;
#endif // MOZ_EME
// True if the media's channel's download has been suspended. // True if the media's channel's download has been suspended.
Watchable<bool> mDownloadSuspendedByCache; Watchable<bool> mDownloadSuspendedByCache;

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

@ -46,9 +46,7 @@
#include "mozilla/dom/ExternalHelperAppParent.h" #include "mozilla/dom/ExternalHelperAppParent.h"
#include "mozilla/dom/GetFilesHelper.h" #include "mozilla/dom/GetFilesHelper.h"
#include "mozilla/dom/GeolocationBinding.h" #include "mozilla/dom/GeolocationBinding.h"
#ifdef MOZ_EME
#include "mozilla/dom/MediaKeySystemAccess.h" #include "mozilla/dom/MediaKeySystemAccess.h"
#endif
#include "mozilla/dom/Notification.h" #include "mozilla/dom/Notification.h"
#include "mozilla/dom/PContentBridgeParent.h" #include "mozilla/dom/PContentBridgeParent.h"
#include "mozilla/dom/PContentPermissionRequestParent.h" #include "mozilla/dom/PContentPermissionRequestParent.h"
@ -975,14 +973,9 @@ ContentParent::RecvIsGMPPresentOnDisk(const nsString& aKeySystem,
bool* aIsPresent, bool* aIsPresent,
nsCString* aMessage) nsCString* aMessage)
{ {
#ifdef MOZ_EME
*aIsPresent = MediaKeySystemAccess::IsGMPPresentOnDisk(aKeySystem, *aIsPresent = MediaKeySystemAccess::IsGMPPresentOnDisk(aKeySystem,
aVersion, aVersion,
*aMessage); *aMessage);
#else
*aIsPresent = false;
#endif
return true; return true;
} }

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

@ -30,9 +30,7 @@ class MediaResource;
class ReentrantMonitor; class ReentrantMonitor;
class VideoFrameContainer; class VideoFrameContainer;
class MediaDecoderOwner; class MediaDecoderOwner;
#ifdef MOZ_EME
class CDMProxy; class CDMProxy;
#endif
typedef nsDataHashtable<nsCStringHashKey, nsCString> MetadataTags; typedef nsDataHashtable<nsCStringHashKey, nsCString> MetadataTags;

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

@ -311,13 +311,10 @@ MediaDecoder::IsHeuristicDormantSupported() const
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
return // We disallow dormant for encrypted media until bug 1181864 is fixed.
#if defined(MOZ_EME) return mInfo &&
// We disallow dormant for encrypted media until bug 1181864 is fixed. !mInfo->IsEncrypted() &&
mInfo && mIsHeuristicDormantSupported;
!mInfo->IsEncrypted() &&
#endif
mIsHeuristicDormantSupported;
} }
void void
@ -494,9 +491,7 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
, mLogicalPosition(0.0) , mLogicalPosition(0.0)
, mDuration(std::numeric_limits<double>::quiet_NaN()) , mDuration(std::numeric_limits<double>::quiet_NaN())
, mResourceCallback(new ResourceCallback()) , mResourceCallback(new ResourceCallback())
#ifdef MOZ_EME
, mCDMProxyPromise(mCDMProxyPromiseHolder.Ensure(__func__)) , mCDMProxyPromise(mCDMProxyPromiseHolder.Ensure(__func__))
#endif
, mIgnoreProgressData(false) , mIgnoreProgressData(false)
, mInfiniteStream(false) , mInfiniteStream(false)
, mOwner(aOwner) , mOwner(aOwner)
@ -592,9 +587,7 @@ MediaDecoder::Shutdown()
mResourceCallback->Disconnect(); mResourceCallback->Disconnect();
#ifdef MOZ_EME
mCDMProxyPromiseHolder.RejectIfExists(true, __func__); mCDMProxyPromiseHolder.RejectIfExists(true, __func__);
#endif
DiscardOngoingSeekIfExists(); DiscardOngoingSeekIfExists();
@ -1707,7 +1700,6 @@ MediaDecoder::CanPlayThrough()
return GetStatistics().CanPlayThrough(); return GetStatistics().CanPlayThrough();
} }
#ifdef MOZ_EME
RefPtr<MediaDecoder::CDMProxyPromise> RefPtr<MediaDecoder::CDMProxyPromise>
MediaDecoder::RequestCDMProxy() const MediaDecoder::RequestCDMProxy() const
{ {
@ -1722,7 +1714,6 @@ MediaDecoder::SetCDMProxy(CDMProxy* aProxy)
mCDMProxyPromiseHolder.ResolveIfExists(aProxy, __func__); mCDMProxyPromiseHolder.ResolveIfExists(aProxy, __func__);
} }
#endif
bool bool
MediaDecoder::IsOpusEnabled() MediaDecoder::IsOpusEnabled()

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

@ -7,11 +7,8 @@
#if !defined(MediaDecoder_h_) #if !defined(MediaDecoder_h_)
#define MediaDecoder_h_ #define MediaDecoder_h_
#ifdef MOZ_EME
#include "mozilla/CDMProxy.h"
#endif
#include "mozilla/Atomics.h" #include "mozilla/Atomics.h"
#include "mozilla/CDMProxy.h"
#include "mozilla/MozPromise.h" #include "mozilla/MozPromise.h"
#include "mozilla/ReentrantMonitor.h" #include "mozilla/ReentrantMonitor.h"
#include "mozilla/StateMirroring.h" #include "mozilla/StateMirroring.h"
@ -444,7 +441,6 @@ private:
MediaDecoderOwner* GetOwner() const override; MediaDecoderOwner* GetOwner() const override;
#ifdef MOZ_EME
typedef MozPromise<RefPtr<CDMProxy>, bool /* aIgnored */, /* IsExclusive = */ true> CDMProxyPromise; typedef MozPromise<RefPtr<CDMProxy>, bool /* aIgnored */, /* IsExclusive = */ true> CDMProxyPromise;
// Resolved when a CDMProxy is available and the capabilities are known or // Resolved when a CDMProxy is available and the capabilities are known or
@ -452,7 +448,6 @@ private:
RefPtr<CDMProxyPromise> RequestCDMProxy() const; RefPtr<CDMProxyPromise> RequestCDMProxy() const;
void SetCDMProxy(CDMProxy* aProxy); void SetCDMProxy(CDMProxy* aProxy);
#endif
void EnsureTelemetryReported(); void EnsureTelemetryReported();
@ -620,10 +615,8 @@ private:
RefPtr<ResourceCallback> mResourceCallback; RefPtr<ResourceCallback> mResourceCallback;
#ifdef MOZ_EME
MozPromiseHolder<CDMProxyPromise> mCDMProxyPromiseHolder; MozPromiseHolder<CDMProxyPromise> mCDMProxyPromiseHolder;
RefPtr<CDMProxyPromise> mCDMProxyPromise; RefPtr<CDMProxyPromise> mCDMProxyPromise;
#endif
protected: protected:
// The promise resolving/rejection is queued as a "micro-task" which will be // The promise resolving/rejection is queued as a "micro-task" which will be

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

@ -143,13 +143,11 @@ public:
// reference to the decoder to prevent further calls into the decoder. // reference to the decoder to prevent further calls into the decoder.
virtual void NotifyXPCOMShutdown() = 0; virtual void NotifyXPCOMShutdown() = 0;
#ifdef MOZ_EME
// Dispatches a "encrypted" event to the HTMLMediaElement, with the // Dispatches a "encrypted" event to the HTMLMediaElement, with the
// provided init data. Actual dispatch may be delayed until HAVE_METADATA. // provided init data. Actual dispatch may be delayed until HAVE_METADATA.
// Main thread only. // Main thread only.
virtual void DispatchEncrypted(const nsTArray<uint8_t>& aInitData, virtual void DispatchEncrypted(const nsTArray<uint8_t>& aInitData,
const nsAString& aInitDataType) = 0; const nsAString& aInitDataType) = 0;
#endif // MOZ_EME
}; };
} // namespace mozilla } // namespace mozilla

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

@ -186,9 +186,7 @@ public:
// when to call SetIdle(). // when to call SetIdle().
virtual void SetIdle() {} virtual void SetIdle() {}
#ifdef MOZ_EME
virtual void SetCDMProxy(CDMProxy* aProxy) {} virtual void SetCDMProxy(CDMProxy* aProxy) {}
#endif
// Tell the reader that the data decoded are not for direct playback, so it // Tell the reader that the data decoded are not for direct playback, so it
// can accept more files, in particular those which have more channels than // can accept more files, in particular those which have more channels than

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

@ -116,9 +116,7 @@ public:
return mReader->CanonicalIsSuspended(); return mReader->CanonicalIsSuspended();
} }
#ifdef MOZ_EME
void SetCDMProxy(CDMProxy* aProxy) { mReader->SetCDMProxy(aProxy); } void SetCDMProxy(CDMProxy* aProxy) { mReader->SetCDMProxy(aProxy); }
#endif
void SetVideoBlankDecode(bool aIsBlankDecode); void SetVideoBlankDecode(bool aIsBlankDecode);

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

@ -317,12 +317,7 @@ private:
// feeding in the CDM, which we need to decode the first frame (and // feeding in the CDM, which we need to decode the first frame (and
// thus get the metadata). We could fix this if we could compute the start // thus get the metadata). We could fix this if we could compute the start
// time by demuxing without necessaring decoding. // time by demuxing without necessaring decoding.
bool waitingForCDM = bool waitingForCDM = mMaster->mInfo.IsEncrypted() && !mMaster->mCDMProxy;
#ifdef MOZ_EME
mMaster->mInfo.IsEncrypted() && !mMaster->mCDMProxy;
#else
false;
#endif
mMaster->mNotifyMetadataBeforeFirstFrame = mMaster->mNotifyMetadataBeforeFirstFrame =
mMaster->mDuration.Ref().isSome() || waitingForCDM; mMaster->mDuration.Ref().isSome() || waitingForCDM;
@ -1346,12 +1341,10 @@ nsresult MediaDecoderStateMachine::Init(MediaDecoder* aDecoder)
mMediaSink = CreateMediaSink(mAudioCaptured); mMediaSink = CreateMediaSink(mAudioCaptured);
#ifdef MOZ_EME
mCDMProxyPromise.Begin(aDecoder->RequestCDMProxy()->Then( mCDMProxyPromise.Begin(aDecoder->RequestCDMProxy()->Then(
OwnerThread(), __func__, this, OwnerThread(), __func__, this,
&MediaDecoderStateMachine::OnCDMProxyReady, &MediaDecoderStateMachine::OnCDMProxyReady,
&MediaDecoderStateMachine::OnCDMProxyNotReady)); &MediaDecoderStateMachine::OnCDMProxyNotReady));
#endif
nsresult rv = mReader->Init(); nsresult rv = mReader->Init();
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
@ -1678,9 +1671,7 @@ MediaDecoderStateMachine::Shutdown()
// dispose of the timer. // dispose of the timer.
mVideoDecodeSuspendTimer.Reset(); mVideoDecodeSuspendTimer.Reset();
#ifdef MOZ_EME
mCDMProxyPromise.DisconnectIfExists(); mCDMProxyPromise.DisconnectIfExists();
#endif
if (IsPlaying()) { if (IsPlaying()) {
StopPlayback(); StopPlayback();
@ -2392,6 +2383,10 @@ bool MediaDecoderStateMachine::HasLowBufferedData(int64_t aUsecs)
int64_t start = endOfDecodedData; int64_t start = endOfDecodedData;
int64_t end = std::min(GetMediaTime() + aUsecs, Duration().ToMicroseconds()); int64_t end = std::min(GetMediaTime() + aUsecs, Duration().ToMicroseconds());
if (start >= end) {
// Duration of decoded samples is greater than our threshold.
return false;
}
media::TimeInterval interval(media::TimeUnit::FromMicroseconds(start), media::TimeInterval interval(media::TimeUnit::FromMicroseconds(start),
media::TimeUnit::FromMicroseconds(end)); media::TimeUnit::FromMicroseconds(end));
return !mBuffered.Ref().Contains(interval); return !mBuffered.Ref().Contains(interval);
@ -2907,7 +2902,6 @@ void MediaDecoderStateMachine::OnMediaSinkAudioError(nsresult aResult)
DecodeError(MediaResult(NS_ERROR_DOM_MEDIA_MEDIASINK_ERR, __func__)); DecodeError(MediaResult(NS_ERROR_DOM_MEDIA_MEDIASINK_ERR, __func__));
} }
#ifdef MOZ_EME
void void
MediaDecoderStateMachine::OnCDMProxyReady(RefPtr<CDMProxy> aProxy) MediaDecoderStateMachine::OnCDMProxyReady(RefPtr<CDMProxy> aProxy)
{ {
@ -2924,7 +2918,6 @@ MediaDecoderStateMachine::OnCDMProxyNotReady()
MOZ_ASSERT(OnTaskQueue()); MOZ_ASSERT(OnTaskQueue());
mCDMProxyPromise.Complete(); mCDMProxyPromise.Complete();
} }
#endif
void void
MediaDecoderStateMachine::SetAudioCaptured(bool aCaptured) MediaDecoderStateMachine::SetAudioCaptured(bool aCaptured)

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

@ -873,12 +873,10 @@ private:
// Playback will not start when audio is offloading. // Playback will not start when audio is offloading.
bool mAudioOffloading; bool mAudioOffloading;
#ifdef MOZ_EME
void OnCDMProxyReady(RefPtr<CDMProxy> aProxy); void OnCDMProxyReady(RefPtr<CDMProxy> aProxy);
void OnCDMProxyNotReady(); void OnCDMProxyNotReady();
RefPtr<CDMProxy> mCDMProxy; RefPtr<CDMProxy> mCDMProxy;
MozPromiseRequestHolder<MediaDecoder::CDMProxyPromise> mCDMProxyPromise; MozPromiseRequestHolder<MediaDecoder::CDMProxyPromise> mCDMProxyPromise;
#endif
private: private:
// The buffered range. Mirrored from the decoder thread. // The buffered range. Mirrored from the decoder thread.

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

@ -4,6 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/CDMProxy.h"
#include "mozilla/dom/HTMLMediaElement.h" #include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
@ -21,10 +22,6 @@
#include <algorithm> #include <algorithm>
#ifdef MOZ_EME
#include "mozilla/CDMProxy.h"
#endif
using namespace mozilla::media; using namespace mozilla::media;
using mozilla::layers::Image; using mozilla::layers::Image;
@ -185,7 +182,6 @@ MediaFormatReader::Init()
return NS_OK; return NS_OK;
} }
#ifdef MOZ_EME
class DispatchKeyNeededEvent : public Runnable { class DispatchKeyNeededEvent : public Runnable {
public: public:
DispatchKeyNeededEvent(AbstractMediaDecoder* aDecoder, DispatchKeyNeededEvent(AbstractMediaDecoder* aDecoder,
@ -223,16 +219,11 @@ MediaFormatReader::SetCDMProxy(CDMProxy* aProxy)
}); });
OwnerThread()->Dispatch(r.forget()); OwnerThread()->Dispatch(r.forget());
} }
#endif // MOZ_EME
bool bool
MediaFormatReader::IsWaitingOnCDMResource() { MediaFormatReader::IsWaitingOnCDMResource() {
MOZ_ASSERT(OnTaskQueue()); MOZ_ASSERT(OnTaskQueue());
#ifdef MOZ_EME
return IsEncrypted() && !mCDMProxy; return IsEncrypted() && !mCDMProxy;
#else
return false;
#endif
} }
RefPtr<MediaDecoderReader::MetadataPromise> RefPtr<MediaDecoderReader::MetadataPromise>
@ -337,13 +328,11 @@ MediaFormatReader::OnDemuxerInitDone(nsresult)
UniquePtr<EncryptionInfo> crypto = mDemuxer->GetCrypto(); UniquePtr<EncryptionInfo> crypto = mDemuxer->GetCrypto();
if (mDecoder && crypto && crypto->IsEncrypted()) { if (mDecoder && crypto && crypto->IsEncrypted()) {
#ifdef MOZ_EME
// Try and dispatch 'encrypted'. Won't go if ready state still HAVE_NOTHING. // Try and dispatch 'encrypted'. Won't go if ready state still HAVE_NOTHING.
for (uint32_t i = 0; i < crypto->mInitDatas.Length(); i++) { for (uint32_t i = 0; i < crypto->mInitDatas.Length(); i++) {
NS_DispatchToMainThread( NS_DispatchToMainThread(
new DispatchKeyNeededEvent(mDecoder, crypto->mInitDatas[i].mInitData, crypto->mInitDatas[i].mType)); new DispatchKeyNeededEvent(mDecoder, crypto->mInitDatas[i].mInitData, crypto->mInitDatas[i].mType));
} }
#endif // MOZ_EME
mInfo.mCrypto = *crypto; mInfo.mCrypto = *crypto;
} }
@ -400,12 +389,8 @@ MediaFormatReader::EnsureDecoderCreated(TrackType aTrack)
if (!mPlatform) { if (!mPlatform) {
mPlatform = new PDMFactory(); mPlatform = new PDMFactory();
if (IsEncrypted()) { if (IsEncrypted()) {
#ifdef MOZ_EME
MOZ_ASSERT(mCDMProxy); MOZ_ASSERT(mCDMProxy);
mPlatform->SetCDMProxy(mCDMProxy); mPlatform->SetCDMProxy(mCDMProxy);
#else
return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, "EME not supported");
#endif
} }
} }

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

@ -93,9 +93,7 @@ public:
return mTrackDemuxersMayBlock; return mTrackDemuxersMayBlock;
} }
#ifdef MOZ_EME
void SetCDMProxy(CDMProxy* aProxy) override; void SetCDMProxy(CDMProxy* aProxy) override;
#endif
// Returns a string describing the state of the decoder data. // Returns a string describing the state of the decoder data.
// Used for debugging purposes. // Used for debugging purposes.
@ -565,9 +563,8 @@ private:
RefPtr<VideoFrameContainer> mVideoFrameContainer; RefPtr<VideoFrameContainer> mVideoFrameContainer;
layers::ImageContainer* GetImageContainer(); layers::ImageContainer* GetImageContainer();
#ifdef MOZ_EME
RefPtr<CDMProxy> mCDMProxy; RefPtr<CDMProxy> mCDMProxy;
#endif
RefPtr<GMPCrashHelper> mCrashHelper; RefPtr<GMPCrashHelper> mCrashHelper;
void SetBlankDecode(TrackType aTrack, bool aIsBlankDecode); void SetBlankDecode(TrackType aTrack, bool aIsBlankDecode);

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

@ -222,7 +222,9 @@ ChannelMediaResource::OnStartRequest(nsIRequest* aRequest)
int64_t contentLength = -1; int64_t contentLength = -1;
hc->GetContentLength(&contentLength); hc->GetContentLength(&contentLength);
if (contentLength >= 0 && responseStatus == HTTP_OK_CODE) { if (contentLength >= 0 &&
(responseStatus == HTTP_OK_CODE ||
responseStatus == HTTP_PARTIAL_RESPONSE_CODE)) {
// "OK" status means Content-Length is for the whole resource. // "OK" status means Content-Length is for the whole resource.
// Since that's bounded, we know we have a finite-length resource. // Since that's bounded, we know we have a finite-length resource.
dataIsBounded = true; dataIsBounded = true;

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

@ -9,9 +9,7 @@
#include "MP4Demuxer.h" #include "MP4Demuxer.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "nsCharSeparatedTokenizer.h" #include "nsCharSeparatedTokenizer.h"
#ifdef MOZ_EME
#include "mozilla/CDMProxy.h" #include "mozilla/CDMProxy.h"
#endif
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/SharedThreadPool.h" #include "mozilla/SharedThreadPool.h"
#include "nsMimeTypes.h" #include "nsMimeTypes.h"

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

@ -41,10 +41,8 @@ using CrashReporter::GetIDFromMinidump;
#include "WMFDecoderModule.h" #include "WMFDecoderModule.h"
#endif #endif
#ifdef MOZ_EME
#include "mozilla/dom/WidevineCDMManifestBinding.h" #include "mozilla/dom/WidevineCDMManifestBinding.h"
#include "widevine-adapter/WidevineAdapter.h" #include "widevine-adapter/WidevineAdapter.h"
#endif
namespace mozilla { namespace mozilla {
@ -810,7 +808,6 @@ GMPParent::ReadGMPMetaData()
return ReadGMPInfoFile(infoFile); return ReadGMPInfoFile(infoFile);
} }
#ifdef MOZ_EME
// Maybe this is the Widevine adapted plugin? // Maybe this is the Widevine adapted plugin?
nsCOMPtr<nsIFile> manifestFile; nsCOMPtr<nsIFile> manifestFile;
rv = mDirectory->Clone(getter_AddRefs(manifestFile)); rv = mDirectory->Clone(getter_AddRefs(manifestFile));
@ -819,9 +816,6 @@ GMPParent::ReadGMPMetaData()
} }
manifestFile->AppendRelativePath(NS_LITERAL_STRING("manifest.json")); manifestFile->AppendRelativePath(NS_LITERAL_STRING("manifest.json"));
return ReadChromiumManifestFile(manifestFile); return ReadChromiumManifestFile(manifestFile);
#else
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
#endif
} }
RefPtr<GenericPromise> RefPtr<GenericPromise>
@ -935,7 +929,6 @@ GMPParent::ParseChromiumManifest(nsString aJSON)
LOGD("%s: for '%s'", __FUNCTION__, NS_LossyConvertUTF16toASCII(aJSON).get()); LOGD("%s: for '%s'", __FUNCTION__, NS_LossyConvertUTF16toASCII(aJSON).get());
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
#ifdef MOZ_EME
mozilla::dom::WidevineCDMManifest m; mozilla::dom::WidevineCDMManifest m;
if (!m.Init(aJSON)) { if (!m.Init(aJSON)) {
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
@ -970,10 +963,6 @@ GMPParent::ParseChromiumManifest(nsString aJSON)
#endif #endif
return GenericPromise::CreateAndResolve(true, __func__); return GenericPromise::CreateAndResolve(true, __func__);
#else
MOZ_ASSERT_UNREACHABLE("don't call me if EME isn't enabled");
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
#endif
} }
bool bool

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

@ -35,6 +35,8 @@ EXPORTS += [
'GMPAudioDecoderProxy.h', 'GMPAudioDecoderProxy.h',
'GMPAudioHost.h', 'GMPAudioHost.h',
'GMPCallbackBase.h', 'GMPCallbackBase.h',
'GMPCDMCallbackProxy.h',
'GMPCDMProxy.h',
'GMPChild.h', 'GMPChild.h',
'GMPContentChild.h', 'GMPContentChild.h',
'GMPContentParent.h', 'GMPContentParent.h',
@ -71,12 +73,6 @@ EXPORTS += [
'GMPVideoPlaneImpl.h', 'GMPVideoPlaneImpl.h',
] ]
if CONFIG['MOZ_EME']:
EXPORTS += [
'GMPCDMCallbackProxy.h',
'GMPCDMProxy.h',
]
# We link GMPLoader into xul on B2G/Fennec as its code does not need to be # We link GMPLoader into xul on B2G/Fennec as its code does not need to be
# covered by a DRM vendor's voucher. # covered by a DRM vendor's voucher.
if CONFIG['OS_TARGET'] == 'Android': if CONFIG['OS_TARGET'] == 'Android':
@ -91,6 +87,8 @@ UNIFIED_SOURCES += [
'GMPAudioDecoderChild.cpp', 'GMPAudioDecoderChild.cpp',
'GMPAudioDecoderParent.cpp', 'GMPAudioDecoderParent.cpp',
'GMPAudioHost.cpp', 'GMPAudioHost.cpp',
'GMPCDMCallbackProxy.cpp',
'GMPCDMProxy.cpp',
'GMPChild.cpp', 'GMPChild.cpp',
'GMPContentChild.cpp', 'GMPContentChild.cpp',
'GMPContentParent.cpp', 'GMPContentParent.cpp',
@ -122,12 +120,6 @@ UNIFIED_SOURCES += [
'GMPVideoPlaneImpl.cpp', 'GMPVideoPlaneImpl.cpp',
] ]
if CONFIG['MOZ_EME']:
UNIFIED_SOURCES += [
'GMPCDMCallbackProxy.cpp',
'GMPCDMProxy.cpp',
]
DIRS += [ DIRS += [
'rlz', 'rlz',
'widevine-adapter', 'widevine-adapter',

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

@ -34,10 +34,8 @@ public:
void DownloadProgressed() override {} void DownloadProgressed() override {}
void UpdateReadyState() override {} void UpdateReadyState() override {}
void FirstFrameLoaded() override {} void FirstFrameLoaded() override {}
#ifdef MOZ_EME
void DispatchEncrypted(const nsTArray<uint8_t>& aInitData, void DispatchEncrypted(const nsTArray<uint8_t>& aInitData,
const nsAString& aInitDataType) override {} const nsAString& aInitDataType) override {}
#endif // MOZ_EME
bool IsActive() const override { return true; } bool IsActive() const override { return true; }
bool IsHidden() const override { return false; } bool IsHidden() const override { return false; }
void DownloadSuspended() override {} void DownloadSuspended() override {}

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

@ -7,6 +7,7 @@
UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
'MockMediaResource.cpp', 'MockMediaResource.cpp',
'TestAudioCompactor.cpp', 'TestAudioCompactor.cpp',
'TestEME.cpp',
'TestGMPCrossOrigin.cpp', 'TestGMPCrossOrigin.cpp',
'TestGMPRemoveAndDelete.cpp', 'TestGMPRemoveAndDelete.cpp',
'TestGMPUtils.cpp', 'TestGMPUtils.cpp',
@ -25,11 +26,6 @@ UNIFIED_SOURCES += [
'TestWebMBuffered.cpp', 'TestWebMBuffered.cpp',
] ]
if CONFIG['MOZ_EME']:
UNIFIED_SOURCES += [
'TestEME.cpp',
]
if CONFIG['MOZ_WEBM_ENCODER']: if CONFIG['MOZ_WEBM_ENCODER']:
UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
'TestVideoTrackEncoder.cpp', 'TestVideoTrackEncoder.cpp',

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше