зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to inbound. a=merge CLOSED TREE
This commit is contained in:
Коммит
46679701af
|
@ -179,7 +179,6 @@ pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla
|
|||
pref("extensions.update.interval", 86400); // Check for updates to Extensions and
|
||||
// Themes every day
|
||||
|
||||
pref("extensions.webextensions.themes.enabled", true);
|
||||
pref("extensions.webextensions.themes.icons.buttons", "back,forward,reload,stop,bookmark_star,bookmark_menu,downloads,home,app_menu,cut,copy,paste,new_window,new_private_window,save_page,print,history,full_screen,find,options,addons,developer,synced_tabs,open_file,sidebars,share_page,subscribe,text_encoding,email_link,forget,pocket");
|
||||
|
||||
pref("lightweightThemes.update.enabled", true);
|
||||
|
|
|
@ -3422,7 +3422,7 @@ window._gBrowser = {
|
|||
if (contextTab.multiselected) {
|
||||
tabs = this.selectedTabs;
|
||||
} else {
|
||||
tabs = [gBrowser.selectedTab];
|
||||
tabs = [contextTab];
|
||||
}
|
||||
|
||||
if (this.tabs.length == tabs.length) {
|
||||
|
|
|
@ -15,12 +15,6 @@ const DARK_THEME_COLORS = {
|
|||
"textcolor": "#FFF",
|
||||
};
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
async function testBrowserAction(extension, expectedIcon) {
|
||||
let browserActionWidget = getBrowserActionWidget(extension);
|
||||
await promiseAnimationFrame();
|
||||
|
|
|
@ -162,8 +162,7 @@ async function runTestWithIcons(icons) {
|
|||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true],
|
||||
["extensions.webextensions.themes.icons.enabled", true]],
|
||||
set: [["extensions.webextensions.themes.icons.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Helper function for testing a theme with invalid properties.
|
||||
* @param {object} invalidProps The invalid properties to load the theme with.
|
||||
|
|
|
@ -495,7 +495,7 @@
|
|||
permissions-button-cancel.label,
|
||||
permissions-button-ok.label,
|
||||
permissions-exceptions-autoplay-media-window.title,
|
||||
permissions-exceptions-autoplay-media-desc
|
||||
permissions-exceptions-autoplay-media-desc2
|
||||
" />
|
||||
</hbox>
|
||||
</hbox>
|
||||
|
@ -567,7 +567,7 @@
|
|||
<!-- Defined in dom/media/nsIAutoplay.idl -->
|
||||
<menuitem data-l10n-id="autoplay-option-allow" value="0"/>
|
||||
<menuitem data-l10n-id="autoplay-option-ask" value="2"/>
|
||||
<menuitem data-l10n-id="autoplay-option-block" value="1"/>
|
||||
<menuitem data-l10n-id="autoplay-option-dont" value="1"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
|
@ -580,7 +580,7 @@
|
|||
permissions-button-cancel.label,
|
||||
permissions-button-ok.label,
|
||||
permissions-exceptions-autoplay-media-window.title,
|
||||
permissions-exceptions-autoplay-media-desc
|
||||
permissions-exceptions-autoplay-media-desc2
|
||||
" />
|
||||
</hbox>
|
||||
</hbox>
|
||||
|
|
|
@ -28,7 +28,7 @@ const permissionExceptionsL10n = {
|
|||
},
|
||||
"autoplay-media": {
|
||||
window: "permissions-exceptions-autoplay-media-window",
|
||||
description: "permissions-exceptions-autoplay-media-desc",
|
||||
description: "permissions-exceptions-autoplay-media-desc2",
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@ MOZ_AUTOMATION_L10N_CHECK=0
|
|||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-dmd
|
||||
|
||||
# Save rust analysis (this requires unlocking the unstable features)
|
||||
export RUSTC_BOOTSTRAP=1
|
||||
export RUSTFLAGS="-Zsave-analysis"
|
||||
|
||||
ac_add_options --enable-clang-plugin
|
||||
ac_add_options --enable-mozsearch-plugin
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ permissions-exceptions-addons-desc = You can specify which websites are allowed
|
|||
permissions-exceptions-autoplay-media-window =
|
||||
.title = Allowed Websites - Autoplay
|
||||
.style = { permissions-window.style }
|
||||
permissions-exceptions-autoplay-media-desc = You can specify which websites are allowed to automatically play media elements. Type the exact address of the site you want to allow and then click Allow.
|
||||
permissions-exceptions-autoplay-media-desc2 = You can specify which websites are always or never allowed to autoplay media with sound. Type the address of the site you want to manage and then click Block or Allow.
|
||||
|
||||
## Site Permissions - Notifications
|
||||
|
||||
|
|
|
@ -854,8 +854,8 @@ autoplay-option-ask =
|
|||
.label = Always Ask
|
||||
autoplay-option-allow =
|
||||
.label = Allow Autoplay
|
||||
autoplay-option-block =
|
||||
.label = Block Autoplay
|
||||
autoplay-option-dont =
|
||||
.label = Don't Autoplay
|
||||
|
||||
permissions-block-popups =
|
||||
.label = Block pop-up windows
|
||||
|
|
|
@ -958,8 +958,8 @@ midi.shareSysexWithFile.message = Will you allow this local file to access your
|
|||
# LOCALIZATION NOTE (midi.shareSysexWithSite.message): %S is the name of the site URL (https://...) requesting MIDI access
|
||||
midi.shareSysexWithSite.message = Will you allow %S to access your MIDI devices and send/receive SysEx messages?
|
||||
|
||||
autoplay.Allow.label = Allow Autoplay
|
||||
autoplay.Allow.accesskey = A
|
||||
autoplay.Allow2.label = Allow
|
||||
autoplay.Allow2.accesskey = A
|
||||
autoplay.DontAllow.label = Don’t Allow
|
||||
autoplay.DontAllow.accesskey = n
|
||||
autoplay.remember = Remember this decision
|
||||
|
|
|
@ -821,8 +821,8 @@ AutoplayPermissionPrompt.prototype = {
|
|||
|
||||
get promptActions() {
|
||||
return [{
|
||||
label: gBrowserBundle.GetStringFromName("autoplay.Allow.label"),
|
||||
accessKey: gBrowserBundle.GetStringFromName("autoplay.Allow.accesskey"),
|
||||
label: gBrowserBundle.GetStringFromName("autoplay.Allow2.label"),
|
||||
accessKey: gBrowserBundle.GetStringFromName("autoplay.Allow2.accesskey"),
|
||||
action: Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -146,8 +146,12 @@ def normalize_path():
|
|||
needed = GetShortPathNameW(path, out, size)
|
||||
if size >= needed:
|
||||
if ' ' in out.value:
|
||||
die("GetShortPathName returned a long path name. "
|
||||
"Are 8dot3 filenames disabled?")
|
||||
die("GetShortPathName returned a long path name: `%s`. "
|
||||
"Use `fsutil file setshortname' "
|
||||
"to create a short name "
|
||||
"for any components of this path "
|
||||
"that have spaces.",
|
||||
out.value)
|
||||
return normsep(out.value)
|
||||
size = needed
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="context-fill #0b0b0b">
|
||||
<path d="
|
||||
M12 0a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-8a3 3 0 0 1-3-3v-10a3 3 0 0 1 3-3h8z
|
||||
M12 2h-8a1 1 0 0 0-1 1v7h10v-7a1 1 0 0 0-1-1z
|
||||
M13 11h-10v2a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1z"/>
|
||||
M13 1a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3z
|
||||
M13 3h-10a1 1 0 0 0-1 1v5h12v-5a1 1 0 0 0-1-1z
|
||||
M14 10h-12v2a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1z"/>
|
||||
</svg>
|
||||
|
|
До Ширина: | Высота: | Размер: 502 B После Ширина: | Высота: | Размер: 501 B |
|
@ -4,9 +4,8 @@
|
|||
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="context-fill #0b0b0b">
|
||||
<path d="
|
||||
M13 0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h-5a3 3 0 0 1-3-3v-5a3 3 0 0 1 3-3z
|
||||
M13 2h-5a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1z"/>
|
||||
<path d="M9 13v-1h2v1a3 3 0 0 1-3 3
|
||||
h-5a3 3 0 0 1-3-3v-5a3 3 0 0 1 3-3h1v2h-1a1 1 0 0 0-1 1v5
|
||||
a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1z"/>
|
||||
M5 1a1 1 0 0 1 0 2h-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1
|
||||
a1 1 0 0 1 2 0a3 3 0 0 1-3 3h-10a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3z
|
||||
M9 3a1 1 0 1 1 0-2h6a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-3.586l-5.293 5.293
|
||||
a1 1 0 0 1-1.414-1.414l5.293 -5.293z"/>
|
||||
</svg>
|
||||
|
|
До Ширина: | Высота: | Размер: 616 B После Ширина: | Высота: | Размер: 583 B |
|
@ -3,7 +3,15 @@
|
|||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"
|
||||
fill="context-fill #0b0b0b">
|
||||
<path d="M7.45 15.95a1.86 1.86 0 0 1-1.86-1.86v-.89c-.3-.14-.6-.3-.89-.5l-.77.43a1.87 1.87 0 0 1-2.54-.68l-.55-.96c-.51-.88-.21-2.02.68-2.54l.77-.44a5.8 5.8 0 0 1 0-1.02l-.77-.45A1.87 1.87 0 0 1 .84 4.5l.55-.95a1.87 1.87 0 0 1 2.54-.69l.77.45c.28-.2.58-.37.89-.52v-.88C5.58.88 6.42.05 7.45.05h1.1c1.03 0 1.86.83 1.86 1.86v.89c.3.14.6.3.89.5l.77-.44a1.86 1.86 0 0 1 2.54.69l.55.95c.52.9.21 2.03-.68 2.55l-.77.44c.03.34.03.68 0 1.02l.77.44c.89.52 1.2 1.66.68 2.55l-.55.95a1.87 1.87 0 0 1-2.54.69l-.77-.45c-.29.2-.58.38-.88.52v.88c0 1.03-.84 1.86-1.87 1.86h-1.1zM5.49 11.4c.26.2.53.35.82.48l.78.34v1.87c0 .2.17.35.36.35h1.1c.2 0 .36-.16.36-.35v-1.87l.78-.34c.3-.13.57-.29.82-.48l.69-.5 1.62.93a.36.36 0 0 0 .48-.13l.56-.96a.36.36 0 0 0-.13-.48l-1.62-.94.1-.85c.03-.31.03-.63 0-.95l-.1-.85 1.62-.93c.17-.1.22-.32.13-.49l-.56-.95a.36.36 0 0 0-.48-.13l-1.62.94-.69-.51a4.27 4.27 0 0 0-.82-.48l-.78-.34V1.91c0-.2-.16-.35-.36-.35h-1.1c-.2 0-.36.16-.36.35v1.87l-.78.34c-.3.13-.57.29-.82.48l-.69.5-1.62-.93a.36.36 0 0 0-.48.13l-.56.96c-.1.16-.03.38.13.48l1.62.94-.1.85c-.03.31-.03.63 0 .95l.1.84-1.62.94a.36.36 0 0 0-.13.48l.56.96c.06.1.18.18.3.18.07 0 .13-.02.18-.05l1.62-.94.69.51z"/>
|
||||
<circle cx="8" cy="8" r="1.5" stroke-width="1"
|
||||
stroke="context-fill" fill="none"/>
|
||||
<path fill-rule="evenodd"
|
||||
d="M8 16a1 1 0 0 1-1-1v-2.1a5 5 0 0 1-1.65-0.76
|
||||
l-1.5 1.5a1 1 0 0 1-1.5-1.5l1.5-1.5
|
||||
A5 5 0 0 1 3.1 9h-2.1a1 1 0 1 1 0-2h2.1a5 5 0 0 1 0.76-1.65
|
||||
l-1.5-1.5a1 1 0 0 1 1.5-1.5l1.5 1.5
|
||||
A5 5 0 0 1 7 3.1v-2.1a1 1 0 1 1 2 0v2.1a5 5 0 0 1 1.65 0.76
|
||||
l1.5-1.5a1 1 0 1 1 1.5 1.5l-1.5 1.5
|
||||
A5 5 0 0 1 12.9 7h2.1a1 1 0 1 1 0 2h-2.1a5 5 0 0 1-0.76 1.65
|
||||
l1.5 1.5a1 1 0 0 1-1.5 1.5l-1.5-1.5
|
||||
A5 5 0 0 1 9 12.9v2.1a1 1 0 0 1-1 1z
|
||||
M5 8a3 3 0 1 1 6 0 3 3 0 0 1-6 0z" />
|
||||
</svg>
|
||||
|
|
До Ширина: | Высота: | Размер: 1.5 KiB После Ширина: | Высота: | Размер: 853 B |
|
@ -11,6 +11,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "nsDocShellLoadTypes.h"
|
||||
#include "mozilla/net/ReferrerPolicy.h"
|
||||
|
||||
class nsIInputStream;
|
||||
class nsISHEntry;
|
||||
|
|
|
@ -87,6 +87,11 @@ method DataTransfer.mozGetDataAt
|
|||
attribute DataTransfer.mozUserCancelled
|
||||
attribute DataTransfer.mozSourceNode
|
||||
|
||||
// Marquee events
|
||||
custom onstart sets a <marquee> onstart event listener
|
||||
custom onbounce sets a <marquee> onbounce event listener
|
||||
custom onfinish sets a <marquee> onfinish event listener
|
||||
|
||||
// JavaScript feature usage
|
||||
custom JS_asmjs uses asm.js
|
||||
custom JS_wasm uses WebAssembly
|
||||
|
|
|
@ -2939,7 +2939,6 @@ nsContentUtils::GenerateStateKey(nsIContent* aContent,
|
|||
KeyAppendInt(control->ControlType(), aKey);
|
||||
|
||||
// If in a form, add form name / index of form / index in form
|
||||
int32_t index = -1;
|
||||
Element *formElement = control->GetFormElement();
|
||||
if (formElement) {
|
||||
if (IsAutocompleteOff(formElement)) {
|
||||
|
@ -2950,7 +2949,7 @@ nsContentUtils::GenerateStateKey(nsIContent* aContent,
|
|||
KeyAppendString(NS_LITERAL_CSTRING("f"), aKey);
|
||||
|
||||
// Append the index of the form in the document
|
||||
index = htmlForms->IndexOf(formElement, false);
|
||||
int32_t index = htmlForms->IndexOf(formElement, false);
|
||||
if (index <= -1) {
|
||||
//
|
||||
// XXX HACK this uses some state that was dumped into the document
|
||||
|
@ -2991,7 +2990,7 @@ nsContentUtils::GenerateStateKey(nsIContent* aContent,
|
|||
|
||||
// We have to flush sink notifications at this point to make
|
||||
// sure that htmlFormControls is up to date.
|
||||
index = htmlFormControls->IndexOf(aContent, true);
|
||||
int32_t index = htmlFormControls->IndexOf(aContent, true);
|
||||
if (index > -1) {
|
||||
KeyAppendInt(index, aKey);
|
||||
generatedUniqueKey = true;
|
||||
|
@ -6510,10 +6509,9 @@ nsContentUtils::WrapNative(JSContext *cx, nsISupports *native,
|
|||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
JS::Rooted<JSObject*> scope(cx, JS::CurrentGlobalOrNull(cx));
|
||||
rv = sXPConnect->WrapNativeToJSVal(cx, scope, native, cache, aIID,
|
||||
aAllowWrapping, vp);
|
||||
nsresult rv = sXPConnect->WrapNativeToJSVal(cx, scope, native, cache, aIID,
|
||||
aAllowWrapping, vp);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -1459,6 +1459,8 @@ nsIDocument::nsIDocument()
|
|||
mParserAborted(false),
|
||||
mReportedUseCounters(false),
|
||||
mHasReportedShadowDOMUsage(false),
|
||||
mDocTreeHadAudibleMedia(false),
|
||||
mDocTreeHadPlayRevoked(false),
|
||||
#ifdef DEBUG
|
||||
mWillReparent(false),
|
||||
#endif
|
||||
|
@ -1636,6 +1638,14 @@ nsDocument::~nsDocument()
|
|||
if (MOZ_UNLIKELY(mMathMLEnabled)) {
|
||||
ScalarAdd(Telemetry::ScalarID::MATHML_DOC_COUNT, 1);
|
||||
}
|
||||
|
||||
ScalarAdd(Telemetry::ScalarID::MEDIA_PAGE_COUNT, 1);
|
||||
if (mDocTreeHadAudibleMedia) {
|
||||
ScalarAdd(Telemetry::ScalarID::MEDIA_PAGE_HAD_MEDIA_COUNT, 1);
|
||||
}
|
||||
if (mDocTreeHadPlayRevoked) {
|
||||
ScalarAdd(Telemetry::ScalarID::MEDIA_PAGE_HAD_PLAY_REVOKED_COUNT, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12489,6 +12499,24 @@ nsIDocument::NotifyUserGestureActivation()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsIDocument::SetDocTreeHadAudibleMedia()
|
||||
{
|
||||
nsIDocument* topLevelDoc = GetTopLevelContentDocument();
|
||||
if (topLevelDoc) {
|
||||
topLevelDoc->mDocTreeHadAudibleMedia = true;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsIDocument::SetDocTreeHadPlayRevoked()
|
||||
{
|
||||
nsIDocument* topLevelDoc = GetTopLevelContentDocument();
|
||||
if (topLevelDoc) {
|
||||
topLevelDoc->mDocTreeHadPlayRevoked = true;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsIDocument::MaybeAllowStorageForOpener()
|
||||
{
|
||||
|
|
|
@ -4877,8 +4877,6 @@ nsGlobalWindowInner::DispatchSyncPopState()
|
|||
NS_ASSERTION(nsContentUtils::IsSafeToRunScript(),
|
||||
"Must be safe to run script here.");
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// Bail if the window is frozen.
|
||||
if (IsFrozen()) {
|
||||
return NS_OK;
|
||||
|
@ -4888,12 +4886,11 @@ nsGlobalWindowInner::DispatchSyncPopState()
|
|||
// going to send along with the popstate event. The object is serialized
|
||||
// using structured clone.
|
||||
nsCOMPtr<nsIVariant> stateObj;
|
||||
rv = mDoc->GetStateObject(getter_AddRefs(stateObj));
|
||||
nsresult rv = mDoc->GetStateObject(getter_AddRefs(stateObj));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
bool result = true;
|
||||
AutoJSAPI jsapi;
|
||||
result = jsapi.Init(this);
|
||||
bool result = jsapi.Init(this);
|
||||
NS_ENSURE_TRUE(result, NS_ERROR_FAILURE);
|
||||
|
||||
JSContext* cx = jsapi.cx();
|
||||
|
@ -6695,7 +6692,7 @@ nsGlobalWindowInner::RunTimeoutHandler(Timeout* aTimeout,
|
|||
options.setFileAndLine(filename, lineNo);
|
||||
options.setNoScriptRval(true);
|
||||
JS::Rooted<JSObject*> global(aes.cx(), FastGetGlobalJSObject());
|
||||
nsresult rv = NS_OK;
|
||||
nsresult rv;
|
||||
{
|
||||
nsJSUtils::ExecutionContext exec(aes.cx(), global);
|
||||
rv = exec.CompileAndExec(options, script);
|
||||
|
|
|
@ -1695,7 +1695,7 @@ nsGlobalWindowOuter::SetNewDocument(nsIDocument* aDocument,
|
|||
bool reUseInnerWindow = (aForceReuseInnerWindow || wouldReuseInnerWindow) &&
|
||||
GetCurrentInnerWindowInternal();
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsresult rv;
|
||||
|
||||
// We set mDoc even though this is an outer window to avoid
|
||||
// having to *always* reach into the inner window to find the
|
||||
|
|
|
@ -3575,6 +3575,10 @@ public:
|
|||
|
||||
void ReportShadowDOMUsage();
|
||||
|
||||
// Sets flags for media autoplay telemetry.
|
||||
void SetDocTreeHadAudibleMedia();
|
||||
void SetDocTreeHadPlayRevoked();
|
||||
|
||||
protected:
|
||||
void DoUpdateSVGUseElementShadowTrees();
|
||||
|
||||
|
@ -4096,6 +4100,16 @@ protected:
|
|||
|
||||
bool mHasReportedShadowDOMUsage: 1;
|
||||
|
||||
// True if this document contained, either directly or in a subdocument,
|
||||
// an HTMLMediaElement that played audibly. This should only be set on
|
||||
// top level content documents.
|
||||
bool mDocTreeHadAudibleMedia: 1;
|
||||
// True if this document contained, either directly or in a subdocument,
|
||||
// an HTMLMediaElement that was playing inaudibly and became audible and we
|
||||
// paused the HTMLMediaElement because it wasn't allowed to autoplay audibly.
|
||||
// This should only be set on top level content documents.
|
||||
bool mDocTreeHadPlayRevoked: 1;
|
||||
|
||||
#ifdef DEBUG
|
||||
public:
|
||||
bool mWillReparent: 1;
|
||||
|
|
|
@ -447,13 +447,12 @@ nsImageLoadingContent::AddObserver(imgINotificationObserver* aObserver)
|
|||
return;
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
RefPtr<imgRequestProxy> currentReq;
|
||||
if (mCurrentRequest) {
|
||||
// Scripted observers may not belong to the same document as us, so when we
|
||||
// create the imgRequestProxy, we shouldn't use any. This allows the request
|
||||
// to dispatch notifications from the correct scheduler group.
|
||||
rv = mCurrentRequest->Clone(aObserver, nullptr, getter_AddRefs(currentReq));
|
||||
nsresult rv = mCurrentRequest->Clone(aObserver, nullptr, getter_AddRefs(currentReq));
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
|
@ -462,7 +461,7 @@ nsImageLoadingContent::AddObserver(imgINotificationObserver* aObserver)
|
|||
RefPtr<imgRequestProxy> pendingReq;
|
||||
if (mPendingRequest) {
|
||||
// See above for why we don't use the loading document.
|
||||
rv = mPendingRequest->Clone(aObserver, nullptr, getter_AddRefs(pendingReq));
|
||||
nsresult rv = mPendingRequest->Clone(aObserver, nullptr, getter_AddRefs(pendingReq));
|
||||
if (NS_FAILED(rv)) {
|
||||
mCurrentRequest->CancelAndForgetObserver(NS_BINDING_ABORTED);
|
||||
return;
|
||||
|
|
|
@ -725,7 +725,6 @@ nsObjectLoadingContent::InstantiatePluginInstance(bool aIsLoading)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
|
||||
|
||||
if (!pluginHost) {
|
||||
|
@ -742,9 +741,9 @@ nsObjectLoadingContent::InstantiatePluginInstance(bool aIsLoading)
|
|||
}
|
||||
|
||||
RefPtr<nsPluginInstanceOwner> newOwner;
|
||||
rv = pluginHost->InstantiatePluginInstance(mContentType,
|
||||
mURI.get(), this,
|
||||
getter_AddRefs(newOwner));
|
||||
nsresult rv = pluginHost->InstantiatePluginInstance(mContentType,
|
||||
mURI.get(), this,
|
||||
getter_AddRefs(newOwner));
|
||||
|
||||
// XXX(johns): We don't suspend native inside stopping plugins...
|
||||
if (appShell) {
|
||||
|
@ -2150,7 +2149,6 @@ nsObjectLoadingContent::LoadObject(bool aNotify,
|
|||
mPendingCheckPluginStopEvent || mFinalListener)
|
||||
{
|
||||
MOZ_ASSERT_UNREACHABLE("Trying to load new plugin with existing content");
|
||||
rv = NS_ERROR_UNEXPECTED;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2158,7 +2156,6 @@ nsObjectLoadingContent::LoadObject(bool aNotify,
|
|||
// If mChannel is set, mChannelLoaded should be set, and vice-versa
|
||||
if (mType != eType_Null && !!mChannel != mChannelLoaded) {
|
||||
MOZ_ASSERT_UNREACHABLE("Trying to load with bad channel state");
|
||||
rv = NS_ERROR_UNEXPECTED;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -414,6 +414,27 @@ EventListenerManager::AddEventListenerInternal(
|
|||
if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
|
||||
window->SetHasSelectionChangeEventListeners();
|
||||
}
|
||||
} else if (aTypeAtom == nsGkAtoms::onstart) {
|
||||
if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
|
||||
nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
|
||||
if (doc) {
|
||||
doc->SetDocumentAndPageUseCounter(eUseCounter_custom_onstart);
|
||||
}
|
||||
}
|
||||
} else if (aTypeAtom == nsGkAtoms::onbounce) {
|
||||
if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
|
||||
nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
|
||||
if (doc) {
|
||||
doc->SetDocumentAndPageUseCounter(eUseCounter_custom_onbounce);
|
||||
}
|
||||
}
|
||||
} else if (aTypeAtom == nsGkAtoms::onfinish) {
|
||||
if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
|
||||
nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
|
||||
if (doc) {
|
||||
doc->SetDocumentAndPageUseCounter(eUseCounter_custom_onfinish);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (IsApzAwareListener(listener)) {
|
||||
|
|
|
@ -3064,6 +3064,7 @@ HTMLMediaElement::PauseIfShouldNotBePlaying()
|
|||
if (AutoplayPolicy::IsAllowedToPlay(*this) != nsIAutoplay::ALLOWED) {
|
||||
ErrorResult rv;
|
||||
Pause(rv);
|
||||
OwnerDoc()->SetDocTreeHadPlayRevoked();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4011,6 +4012,21 @@ HTMLMediaElement::AudioChannelAgentDelayingPlayback()
|
|||
return mAudioChannelWrapper && mAudioChannelWrapper->IsPlaybackBlocked();
|
||||
}
|
||||
|
||||
void
|
||||
HTMLMediaElement::ReportAutoplayTelemetry() const
|
||||
{
|
||||
// If we're audible, and autoplaying...
|
||||
if ((Volume() > 0.0 && !Muted()) &&
|
||||
(!OwnerDoc()->HasBeenUserGestureActivated() || Autoplay())) {
|
||||
OwnerDoc()->SetDocTreeHadAudibleMedia();
|
||||
if (AutoplayPolicy::WouldBeAllowedToPlayIfAutoplayDisabled(*this)) {
|
||||
ScalarAdd(Telemetry::ScalarID::MEDIA_AUTOPLAY_WOULD_BE_ALLOWED_COUNT, 1);
|
||||
} else {
|
||||
ScalarAdd(Telemetry::ScalarID::MEDIA_AUTOPLAY_WOULD_NOT_BE_ALLOWED_COUNT, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
already_AddRefed<Promise>
|
||||
HTMLMediaElement::Play(ErrorResult& aRv)
|
||||
{
|
||||
|
@ -4070,6 +4086,8 @@ HTMLMediaElement::Play(ErrorResult& aRv)
|
|||
return promise.forget();
|
||||
}
|
||||
|
||||
ReportAutoplayTelemetry();
|
||||
|
||||
const bool handlingUserInput = EventStateManager::IsHandlingUserInput();
|
||||
switch (AutoplayPolicy::IsAllowedToPlay(*this)) {
|
||||
case nsIAutoplay::ALLOWED: {
|
||||
|
@ -6228,6 +6246,7 @@ HTMLMediaElement::CheckAutoplayDataReady()
|
|||
return;
|
||||
}
|
||||
|
||||
ReportAutoplayTelemetry();
|
||||
switch (AutoplayPolicy::IsAllowedToPlay(*this)) {
|
||||
case nsIAutoplay::BLOCKED:
|
||||
return;
|
||||
|
|
|
@ -1781,6 +1781,8 @@ private:
|
|||
|
||||
already_AddRefed<PlayPromise> CreatePlayPromise(ErrorResult& aRv) const;
|
||||
|
||||
void ReportAutoplayTelemetry() const;
|
||||
|
||||
/**
|
||||
* This function is called by AfterSetAttr and OnAttrSetButNotChanged.
|
||||
* It will not be called if the value is being unset.
|
||||
|
|
|
@ -100,6 +100,20 @@ DefaultAutoplayBehaviour()
|
|||
return prefValue;
|
||||
}
|
||||
|
||||
static bool
|
||||
IsMediaElementAllowedToPlay(const HTMLMediaElement& aElement)
|
||||
{
|
||||
return ((aElement.Volume() == 0.0 || aElement.Muted()) &&
|
||||
Preferences::GetBool("media.autoplay.allow-muted", true)) ||
|
||||
IsWindowAllowedToPlay(aElement.OwnerDoc()->GetInnerWindow());
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
AutoplayPolicy::WouldBeAllowedToPlayIfAutoplayDisabled(const HTMLMediaElement& aElement)
|
||||
{
|
||||
return IsMediaElementAllowedToPlay(aElement);
|
||||
}
|
||||
|
||||
/* static */ uint32_t
|
||||
AutoplayPolicy::IsAllowedToPlay(const HTMLMediaElement& aElement)
|
||||
{
|
||||
|
@ -114,13 +128,7 @@ AutoplayPolicy::IsAllowedToPlay(const HTMLMediaElement& aElement)
|
|||
? nsIAutoplay::ALLOWED : nsIAutoplay::BLOCKED;
|
||||
}
|
||||
|
||||
// Muted content
|
||||
if ((aElement.Volume() == 0.0 || aElement.Muted()) &&
|
||||
Preferences::GetBool("media.autoplay.allow-muted", true)) {
|
||||
return nsIAutoplay::ALLOWED;
|
||||
}
|
||||
|
||||
if (IsWindowAllowedToPlay(aElement.OwnerDoc()->GetInnerWindow())) {
|
||||
if (IsMediaElementAllowedToPlay(aElement)) {
|
||||
return nsIAutoplay::ALLOWED;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,13 @@ public:
|
|||
// Returns whether a given media element is allowed to play.
|
||||
static uint32_t IsAllowedToPlay(const HTMLMediaElement& aElement);
|
||||
|
||||
// Returns true if a given media element would be allowed to play
|
||||
// if block autoplay was enabled. If this returns false, it means we would
|
||||
// either block or ask for permission.
|
||||
// Note: this is for telemetry purposes, and doesn't check the prefs
|
||||
// which enable/disable block autoplay. Do not use for blocking logic!
|
||||
static bool WouldBeAllowedToPlayIfAutoplayDisabled(const HTMLMediaElement& aElement);
|
||||
|
||||
// Returns whether a given AudioContext is allowed to play.
|
||||
static bool IsAudioContextAllowedToPlay(NotNull<AudioContext*> aContext);
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
#include "mozilla/HTMLEditor.h" // for HTMLEditor
|
||||
#include "mozilla/HTMLEditorCommands.h" // for SetDocumentOptionsCommand, etc
|
||||
#include "mozilla/TextEditor.h" // for TextEditor
|
||||
#include "nsCommandParams.h" // for nsCommandParams
|
||||
#include "nsCOMPtr.h" // for nsCOMPtr, do_QueryInterface, etc
|
||||
#include "nsCRT.h" // for nsCRT
|
||||
#include "nsDebug.h" // for NS_ENSURE_ARG_POINTER, etc
|
||||
#include "nsError.h" // for NS_ERROR_INVALID_ARG, etc
|
||||
#include "nsICommandParams.h" // for nsICommandParams
|
||||
#include "nsIDocShell.h" // for nsIDocShell
|
||||
#include "nsIDocument.h" // for nsIDocument
|
||||
#include "nsIEditingSession.h" // for nsIEditingSession, etc
|
||||
|
@ -40,7 +40,10 @@ SetDocumentOptionsCommand::IsCommandEnabled(const char* aCommandName,
|
|||
nsISupports* refCon,
|
||||
bool* outCmdEnabled)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(outCmdEnabled);
|
||||
if (NS_WARN_IF(!outCmdEnabled)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
|
||||
if (!editor) {
|
||||
*outCmdEnabled = false;
|
||||
|
@ -64,7 +67,9 @@ SetDocumentOptionsCommand::DoCommandParams(const char* aCommandName,
|
|||
nsICommandParams* aParams,
|
||||
nsISupports* refCon)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
if (NS_WARN_IF(!aParams)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
|
||||
if (NS_WARN_IF(!editor)) {
|
||||
|
@ -78,24 +83,32 @@ SetDocumentOptionsCommand::DoCommandParams(const char* aCommandName,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
int32_t animationMode;
|
||||
nsresult rv = aParams->GetLongValue("imageAnimation", &animationMode);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCommandParams* params = aParams->AsCommandParams();
|
||||
|
||||
IgnoredErrorResult error;
|
||||
int32_t animationMode = params->GetInt("imageAnimation", error);
|
||||
if (!error.Failed()) {
|
||||
// for possible values of animation mode, see:
|
||||
// http://lxr.mozilla.org/seamonkey/source/image/public/imgIContainer.idl
|
||||
presContext->SetImageAnimationMode(animationMode);
|
||||
} else {
|
||||
error.SuppressException();
|
||||
}
|
||||
|
||||
bool allowPlugins;
|
||||
rv = aParams->GetBooleanValue("plugins", &allowPlugins);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIDocShell> docShell(presContext->GetDocShell());
|
||||
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
||||
|
||||
rv = docShell->SetAllowPlugins(allowPlugins);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
bool allowPlugins = params->GetBool("plugins", error);
|
||||
if (error.Failed()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(presContext->GetDocShell());
|
||||
if (NS_WARN_IF(!docShell)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult rv = docShell->SetAllowPlugins(allowPlugins);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -104,8 +117,9 @@ SetDocumentOptionsCommand::GetCommandStateParams(const char* aCommandName,
|
|||
nsICommandParams* aParams,
|
||||
nsISupports* refCon)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
NS_ENSURE_ARG_POINTER(refCon);
|
||||
if (NS_WARN_IF(!aParams) || NS_WARN_IF(!refCon)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
// The base editor owns most state info
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
|
||||
|
@ -115,11 +129,15 @@ SetDocumentOptionsCommand::GetCommandStateParams(const char* aCommandName,
|
|||
TextEditor* textEditor = editor->AsTextEditor();
|
||||
MOZ_ASSERT(textEditor);
|
||||
|
||||
nsCommandParams* params = aParams->AsCommandParams();
|
||||
|
||||
// Always get the enabled state
|
||||
bool outCmdEnabled = false;
|
||||
IsCommandEnabled(aCommandName, refCon, &outCmdEnabled);
|
||||
nsresult rv = aParams->SetBooleanValue(STATE_ENABLED, outCmdEnabled);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsresult rv = params->SetBool(STATE_ENABLED, outCmdEnabled);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
// get pres context
|
||||
RefPtr<nsPresContext> presContext = textEditor->GetPresContext();
|
||||
|
@ -127,28 +145,34 @@ SetDocumentOptionsCommand::GetCommandStateParams(const char* aCommandName,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
int32_t animationMode;
|
||||
rv = aParams->GetLongValue("imageAnimation", &animationMode);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
IgnoredErrorResult error;
|
||||
Unused << params->GetInt("imageAnimation", error);
|
||||
if (!error.Failed()) {
|
||||
// for possible values of animation mode, see
|
||||
// http://lxr.mozilla.org/seamonkey/source/image/public/imgIContainer.idl
|
||||
rv = aParams->SetLongValue("imageAnimation",
|
||||
presContext->ImageAnimationMode());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = params->SetInt("imageAnimation", presContext->ImageAnimationMode());
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
} else {
|
||||
error.SuppressException();
|
||||
}
|
||||
|
||||
bool allowPlugins = false;
|
||||
rv = aParams->GetBooleanValue("plugins", &allowPlugins);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIDocShell> docShell(presContext->GetDocShell());
|
||||
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
|
||||
|
||||
allowPlugins = docShell->PluginsAllowedInCurrentDoc();
|
||||
|
||||
rv = aParams->SetBooleanValue("plugins", allowPlugins);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
bool allowPlugins = params->GetBool("plugins", error);
|
||||
if (error.Failed()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(presContext->GetDocShell());
|
||||
if (NS_WARN_IF(!docShell)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
allowPlugins = docShell->PluginsAllowedInCurrentDoc();
|
||||
rv = params->SetBool("plugins", allowPlugins);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -166,8 +190,11 @@ SetDocumentStateCommand::IsCommandEnabled(const char* aCommandName,
|
|||
nsISupports* refCon,
|
||||
bool* outCmdEnabled)
|
||||
{
|
||||
if (NS_WARN_IF(!outCmdEnabled)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
// These commands are always enabled
|
||||
NS_ENSURE_ARG_POINTER(outCmdEnabled);
|
||||
*outCmdEnabled = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -184,6 +211,10 @@ SetDocumentStateCommand::DoCommandParams(const char* aCommandName,
|
|||
nsICommandParams* aParams,
|
||||
nsISupports* refCon)
|
||||
{
|
||||
if (NS_WARN_IF(!aParams)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
|
||||
if (NS_WARN_IF(!editor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -191,73 +222,95 @@ SetDocumentStateCommand::DoCommandParams(const char* aCommandName,
|
|||
TextEditor* textEditor = editor->AsTextEditor();
|
||||
MOZ_ASSERT(textEditor);
|
||||
|
||||
nsCommandParams* params = aParams->AsCommandParams();
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_setDocumentModified")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
|
||||
bool modified;
|
||||
nsresult rv = aParams->GetBooleanValue(STATE_ATTRIBUTE, &modified);
|
||||
|
||||
ErrorResult error;
|
||||
bool modified = params->GetBool(STATE_ATTRIBUTE, error);
|
||||
// Should we fail if this param wasn't set?
|
||||
// I'm not sure we should be that strict
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (modified) {
|
||||
return textEditor->IncrementModificationCount(1);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
|
||||
return textEditor->ResetModificationCount();
|
||||
if (modified) {
|
||||
nsresult rv = textEditor->IncrementModificationCount(1);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult rv = textEditor->ResetModificationCount();
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_setDocumentReadOnly")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
bool isReadOnly;
|
||||
nsresult rvRO = aParams->GetBooleanValue(STATE_ATTRIBUTE, &isReadOnly);
|
||||
NS_ENSURE_SUCCESS(rvRO, rvRO);
|
||||
return isReadOnly ?
|
||||
textEditor->AddFlags(nsIPlaintextEditor::eEditorReadonlyMask) :
|
||||
ErrorResult error;
|
||||
bool isReadOnly = params->GetBool(STATE_ATTRIBUTE, error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
if (isReadOnly) {
|
||||
nsresult rv =
|
||||
textEditor->AddFlags(nsIPlaintextEditor::eEditorReadonlyMask);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult rv =
|
||||
textEditor->RemoveFlags(nsIPlaintextEditor::eEditorReadonlyMask);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_setDocumentUseCSS")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
bool desireCSS;
|
||||
nsresult rvCSS = aParams->GetBooleanValue(STATE_ATTRIBUTE, &desireCSS);
|
||||
NS_ENSURE_SUCCESS(rvCSS, rvCSS);
|
||||
|
||||
return htmlEditor->SetIsCSSEnabled(desireCSS);
|
||||
ErrorResult error;
|
||||
bool desireCSS = params->GetBool(STATE_ATTRIBUTE, error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
nsresult rv = htmlEditor->SetIsCSSEnabled(desireCSS);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_insertBrOnReturn")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
bool insertBrOnReturn;
|
||||
nsresult rvBR = aParams->GetBooleanValue(STATE_ATTRIBUTE,
|
||||
&insertBrOnReturn);
|
||||
NS_ENSURE_SUCCESS(rvBR, rvBR);
|
||||
|
||||
return htmlEditor->SetReturnInParagraphCreatesNewParagraph(!insertBrOnReturn);
|
||||
ErrorResult error;
|
||||
bool insertBrOnReturn = params->GetBool(STATE_ATTRIBUTE, error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
nsresult rv =
|
||||
htmlEditor->SetReturnInParagraphCreatesNewParagraph(!insertBrOnReturn);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_defaultParagraphSeparator")) {
|
||||
if (NS_WARN_IF(!aParams)) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
nsAutoCString newValue;
|
||||
nsresult rv = aParams->GetCStringValue(STATE_ATTRIBUTE, newValue);
|
||||
nsresult rv = params->GetCString(STATE_ATTRIBUTE, newValue);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -282,31 +335,37 @@ SetDocumentStateCommand::DoCommandParams(const char* aCommandName,
|
|||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_enableObjectResizing")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
bool enabled;
|
||||
nsresult rvOR = aParams->GetBooleanValue(STATE_ATTRIBUTE, &enabled);
|
||||
NS_ENSURE_SUCCESS(rvOR, rvOR);
|
||||
|
||||
return htmlEditor->SetObjectResizingEnabled(enabled);
|
||||
ErrorResult error;
|
||||
bool enabled = params->GetBool(STATE_ATTRIBUTE, error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
nsresult rv = htmlEditor->SetObjectResizingEnabled(enabled);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_enableInlineTableEditing")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
bool enabled;
|
||||
nsresult rvOR = aParams->GetBooleanValue(STATE_ATTRIBUTE, &enabled);
|
||||
NS_ENSURE_SUCCESS(rvOR, rvOR);
|
||||
|
||||
return htmlEditor->SetInlineTableEditingEnabled(enabled);
|
||||
ErrorResult error;
|
||||
bool enabled = params->GetBool(STATE_ATTRIBUTE, error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
nsresult rv = htmlEditor->SetInlineTableEditingEnabled(enabled);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
@ -317,8 +376,9 @@ SetDocumentStateCommand::GetCommandStateParams(const char* aCommandName,
|
|||
nsICommandParams* aParams,
|
||||
nsISupports* refCon)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
NS_ENSURE_ARG_POINTER(refCon);
|
||||
if (NS_WARN_IF(!aParams) || NS_WARN_IF(!refCon)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
// The base editor owns most state info
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
|
||||
|
@ -328,71 +388,93 @@ SetDocumentStateCommand::GetCommandStateParams(const char* aCommandName,
|
|||
TextEditor* textEditor = editor->AsTextEditor();
|
||||
MOZ_ASSERT(textEditor);
|
||||
|
||||
nsCommandParams* params = aParams->AsCommandParams();
|
||||
|
||||
// Always get the enabled state
|
||||
bool outCmdEnabled = false;
|
||||
IsCommandEnabled(aCommandName, refCon, &outCmdEnabled);
|
||||
nsresult rv = aParams->SetBooleanValue(STATE_ENABLED, outCmdEnabled);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsresult rv = params->SetBool(STATE_ENABLED, outCmdEnabled);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_setDocumentModified")) {
|
||||
bool modified;
|
||||
rv = textEditor->GetDocumentModified(&modified);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return aParams->SetBooleanValue(STATE_ATTRIBUTE, modified);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
rv = params->SetBool(STATE_ATTRIBUTE, modified);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_setDocumentReadOnly")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
return aParams->SetBooleanValue(STATE_ATTRIBUTE, textEditor->IsReadonly());
|
||||
rv = params->SetBool(STATE_ATTRIBUTE, textEditor->IsReadonly());
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_setDocumentUseCSS")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
bool isCSS;
|
||||
htmlEditor->GetIsCSSEnabled(&isCSS);
|
||||
return aParams->SetBooleanValue(STATE_ALL, isCSS);
|
||||
rv = params->SetBool(STATE_ALL, isCSS);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_insertBrOnReturn")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
bool createPOnReturn;
|
||||
htmlEditor->GetReturnInParagraphCreatesNewParagraph(&createPOnReturn);
|
||||
return aParams->SetBooleanValue(STATE_ATTRIBUTE, !createPOnReturn);
|
||||
rv = params->SetBool(STATE_ATTRIBUTE, !createPOnReturn);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_defaultParagraphSeparator")) {
|
||||
if (NS_WARN_IF(!aParams)) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
switch (htmlEditor->GetDefaultParagraphSeparator()) {
|
||||
case ParagraphSeparator::div:
|
||||
aParams->SetCStringValue(STATE_ATTRIBUTE, NS_LITERAL_CSTRING("div"));
|
||||
case ParagraphSeparator::div: {
|
||||
DebugOnly<nsresult> rv =
|
||||
params->SetCString(STATE_ATTRIBUTE, NS_LITERAL_CSTRING("div"));
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
|
||||
"Failed to set command params to return \"div\"");
|
||||
return NS_OK;
|
||||
|
||||
case ParagraphSeparator::p:
|
||||
aParams->SetCStringValue(STATE_ATTRIBUTE, NS_LITERAL_CSTRING("p"));
|
||||
}
|
||||
case ParagraphSeparator::p: {
|
||||
DebugOnly<nsresult> rv =
|
||||
params->SetCString(STATE_ATTRIBUTE, NS_LITERAL_CSTRING("p"));
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
|
||||
"Failed to set command params to return \"p\"");
|
||||
return NS_OK;
|
||||
|
||||
case ParagraphSeparator::br:
|
||||
aParams->SetCStringValue(STATE_ATTRIBUTE, NS_LITERAL_CSTRING("br"));
|
||||
}
|
||||
case ParagraphSeparator::br: {
|
||||
DebugOnly<nsresult> rv =
|
||||
params->SetCString(STATE_ATTRIBUTE, NS_LITERAL_CSTRING("br"));
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
|
||||
"Failed to set command params to return \"br\"");
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Invalid paragraph separator value");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
@ -400,27 +482,31 @@ SetDocumentStateCommand::GetCommandStateParams(const char* aCommandName,
|
|||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_enableObjectResizing")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
bool enabled;
|
||||
htmlEditor->GetObjectResizingEnabled(&enabled);
|
||||
return aParams->SetBooleanValue(STATE_ATTRIBUTE, enabled);
|
||||
rv = params->SetBool(STATE_ATTRIBUTE, enabled);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "cmd_enableInlineTableEditing")) {
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
HTMLEditor* htmlEditor = textEditor->AsHTMLEditor();
|
||||
if (NS_WARN_IF(!htmlEditor)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
bool enabled;
|
||||
htmlEditor->GetInlineTableEditingEnabled(&enabled);
|
||||
return aParams->SetBooleanValue(STATE_ATTRIBUTE, enabled);
|
||||
rv = params->SetBool(STATE_ATTRIBUTE, enabled);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
@ -468,7 +554,10 @@ DocumentStateCommand::IsCommandEnabled(const char* aCommandName,
|
|||
nsISupports* refCon,
|
||||
bool* outCmdEnabled)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(outCmdEnabled);
|
||||
if (NS_WARN_IF(!outCmdEnabled)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
// Always return false to discourage callers from using DoCommand()
|
||||
*outCmdEnabled = false;
|
||||
return NS_OK;
|
||||
|
@ -494,9 +583,11 @@ DocumentStateCommand::GetCommandStateParams(const char* aCommandName,
|
|||
nsICommandParams* aParams,
|
||||
nsISupports* refCon)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aParams);
|
||||
NS_ENSURE_ARG_POINTER(aCommandName);
|
||||
nsresult rv;
|
||||
if (NS_WARN_IF(!aParams) || NS_WARN_IF(!aCommandName)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
nsCommandParams* params = aParams->AsCommandParams();
|
||||
|
||||
if (!nsCRT::strcmp(aCommandName, "obs_documentCreated")) {
|
||||
uint32_t editorStatus = nsIEditingSession::eEditorErrorUnknown;
|
||||
|
@ -508,8 +599,10 @@ DocumentStateCommand::GetCommandStateParams(const char* aCommandName,
|
|||
// Embedder gets error status if this fails
|
||||
// If called before startup is finished,
|
||||
// status = eEditorCreationInProgress
|
||||
rv = editingSession->GetEditorStatus(&editorStatus);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsresult rv = editingSession->GetEditorStatus(&editorStatus);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
} else {
|
||||
// If refCon is an editor, then everything started up OK!
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
|
||||
|
@ -520,7 +613,8 @@ DocumentStateCommand::GetCommandStateParams(const char* aCommandName,
|
|||
|
||||
// Note that if refCon is not-null, but is neither
|
||||
// an nsIEditingSession or nsIEditor, we return "eEditorErrorUnknown"
|
||||
aParams->SetLongValue(STATE_DATA, editorStatus);
|
||||
DebugOnly<nsresult> rv = params->SetInt(STATE_DATA, editorStatus);
|
||||
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Failed to set editor status");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -533,12 +627,18 @@ DocumentStateCommand::GetCommandStateParams(const char* aCommandName,
|
|||
MOZ_ASSERT(textEditor);
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = textEditor->GetDocument();
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||
|
||||
nsIURI *uri = doc->GetDocumentURI();
|
||||
NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE);
|
||||
|
||||
return aParams->SetISupportsValue(STATE_DATA, (nsISupports*)uri);
|
||||
if (NS_WARN_IF(!doc)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsIURI* uri = doc->GetDocumentURI();
|
||||
if (NS_WARN_IF(!uri)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsresult rv = params->SetISupports(STATE_DATA, uri);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
|
|
@ -73,6 +73,18 @@ SharedSurface_ANGLEShareHandle::Create(GLContext* gl, EGLConfig config,
|
|||
LOCAL_EGL_DXGI_KEYED_MUTEX_ANGLE,
|
||||
&opaqueKeyedMutex);
|
||||
RefPtr<IDXGIKeyedMutex> keyedMutex = static_cast<IDXGIKeyedMutex*>(opaqueKeyedMutex);
|
||||
#ifdef DEBUG
|
||||
if (!keyedMutex) {
|
||||
std::string envStr("1");
|
||||
static auto env = PR_GetEnv("MOZ_REQUIRE_KEYED_MUTEX");
|
||||
if (env) {
|
||||
envStr = env;
|
||||
}
|
||||
if (envStr != "0") {
|
||||
MOZ_ASSERT(keyedMutex, "set MOZ_REQUIRE_KEYED_MUTEX=0 to allow");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
typedef SharedSurface_ANGLEShareHandle ptrT;
|
||||
UniquePtr<ptrT> ret( new ptrT(gl, egl, size, hasAlpha, pbuffer, shareHandle,
|
||||
|
|
|
@ -26,24 +26,48 @@ FrameMetrics::RecalculateViewportOffset()
|
|||
// Additionally, if the composition bounds changes (due to an orientation
|
||||
// change, window resize, etc.), it may take a few frames for mViewport to
|
||||
// update and during that time, the visual viewport may be larger than the
|
||||
// layout viewport, so don't attempt to make any adjustments.
|
||||
if (mViewport.Contains(visualViewport) ||
|
||||
(mViewport.Width() < visualViewport.Width() &&
|
||||
!FuzzyEqualsMultiplicative(mViewport.Width(), visualViewport.Width())) ||
|
||||
(mViewport.Height() < visualViewport.Height() &&
|
||||
!FuzzyEqualsMultiplicative(mViewport.Height(), visualViewport.Height()))) {
|
||||
// layout viewport. In such situations, we take an early exit if the visual
|
||||
// viewport contains the layout viewport.
|
||||
if (mViewport.Contains(visualViewport) || visualViewport.Contains(mViewport)) {
|
||||
return;
|
||||
}
|
||||
if (visualViewport.X() < mViewport.X()) {
|
||||
mViewport.MoveToX(visualViewport.X());
|
||||
} else if (mViewport.XMost() < visualViewport.XMost()) {
|
||||
mViewport.MoveByX(visualViewport.XMost() - mViewport.XMost());
|
||||
}
|
||||
if (visualViewport.Y() < mViewport.Y()) {
|
||||
mViewport.MoveToY(visualViewport.Y());
|
||||
} else if (mViewport.YMost() < visualViewport.YMost()) {
|
||||
mViewport.MoveByY(visualViewport.YMost() - mViewport.YMost());
|
||||
}
|
||||
|
||||
// If visual viewport size is greater than the layout viewport, move the layout
|
||||
// viewport such that it remains inside the visual viewport. Otherwise,
|
||||
// move the layout viewport such that the visual viewport is contained
|
||||
// inside the layout viewport.
|
||||
if ((mViewport.Width() < visualViewport.Width() &&
|
||||
!FuzzyEqualsMultiplicative(mViewport.Width(), visualViewport.Width())) ||
|
||||
(mViewport.Height() < visualViewport.Height() &&
|
||||
!FuzzyEqualsMultiplicative(mViewport.Height(), visualViewport.Height()))) {
|
||||
|
||||
if (mViewport.X() < visualViewport.X()) {
|
||||
// layout viewport moves right
|
||||
mViewport.MoveToX(visualViewport.X());
|
||||
} else if (visualViewport.XMost() < mViewport.XMost()) {
|
||||
// layout viewport moves left
|
||||
mViewport.MoveByX(visualViewport.XMost() - mViewport.XMost());
|
||||
}
|
||||
if (mViewport.Y() < visualViewport.Y()) {
|
||||
// layout viewport moves down
|
||||
mViewport.MoveToY(visualViewport.Y());
|
||||
} else if (visualViewport.YMost() < mViewport.YMost()) {
|
||||
// layout viewport moves up
|
||||
mViewport.MoveByY(visualViewport.YMost() - mViewport.YMost());
|
||||
}
|
||||
} else {
|
||||
|
||||
if (visualViewport.X() < mViewport.X()) {
|
||||
mViewport.MoveToX(visualViewport.X());
|
||||
} else if (mViewport.XMost() < visualViewport.XMost()) {
|
||||
mViewport.MoveByX(visualViewport.XMost() - mViewport.XMost());
|
||||
}
|
||||
if (visualViewport.Y() < mViewport.Y()) {
|
||||
mViewport.MoveToY(visualViewport.Y());
|
||||
} else if (mViewport.YMost() < visualViewport.YMost()) {
|
||||
mViewport.MoveByY(visualViewport.YMost() - mViewport.YMost());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "mozilla/Range.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/TypeTraits.h"
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
#include <memory>
|
||||
#include <new>
|
||||
|
@ -58,6 +59,7 @@ using mozilla::Nothing;
|
|||
using mozilla::PodCopy;
|
||||
using mozilla::PodZero;
|
||||
using mozilla::Some;
|
||||
using mozilla::Unused;
|
||||
|
||||
using JS::AutoGCRooter;
|
||||
|
||||
|
@ -1858,7 +1860,7 @@ NewGlobalScopeData(JSContext* context, ParseContext::Scope& scope, LifoAlloc& al
|
|||
cursor = FreshlyInitializeBindings(cursor, lets);
|
||||
|
||||
bindings->constStart = cursor - start;
|
||||
cursor = FreshlyInitializeBindings(cursor, consts);
|
||||
Unused << FreshlyInitializeBindings(cursor, consts);
|
||||
|
||||
bindings->length = numBindings;
|
||||
}
|
||||
|
@ -1928,7 +1930,7 @@ NewModuleScopeData(JSContext* context, ParseContext::Scope& scope, LifoAlloc& al
|
|||
cursor = FreshlyInitializeBindings(cursor, lets);
|
||||
|
||||
bindings->constStart = cursor - start;
|
||||
cursor = FreshlyInitializeBindings(cursor, consts);
|
||||
Unused << FreshlyInitializeBindings(cursor, consts);
|
||||
|
||||
bindings->length = numBindings;
|
||||
}
|
||||
|
@ -1968,7 +1970,7 @@ NewEvalScopeData(JSContext* context, ParseContext::Scope& scope, LifoAlloc& allo
|
|||
BindingName* start = bindings->trailingNames.start();
|
||||
BindingName* cursor = start;
|
||||
|
||||
cursor = FreshlyInitializeBindings(cursor, vars);
|
||||
Unused << FreshlyInitializeBindings(cursor, vars);
|
||||
|
||||
bindings->length = numBindings;
|
||||
}
|
||||
|
@ -2067,7 +2069,7 @@ NewFunctionScopeData(JSContext* context, ParseContext::Scope& scope, bool hasPar
|
|||
cursor = FreshlyInitializeBindings(cursor, formals);
|
||||
|
||||
bindings->varStart = cursor - start;
|
||||
cursor = FreshlyInitializeBindings(cursor, vars);
|
||||
Unused << FreshlyInitializeBindings(cursor, vars);
|
||||
|
||||
bindings->length = numBindings;
|
||||
}
|
||||
|
@ -2108,7 +2110,7 @@ NewVarScopeData(JSContext* context, ParseContext::Scope& scope, LifoAlloc& alloc
|
|||
BindingName* start = bindings->trailingNames.start();
|
||||
BindingName* cursor = start;
|
||||
|
||||
cursor = FreshlyInitializeBindings(cursor, vars);
|
||||
Unused << FreshlyInitializeBindings(cursor, vars);
|
||||
|
||||
bindings->length = numBindings;
|
||||
}
|
||||
|
@ -2165,7 +2167,7 @@ NewLexicalScopeData(JSContext* context, ParseContext::Scope& scope, LifoAlloc& a
|
|||
cursor = FreshlyInitializeBindings(cursor, lets);
|
||||
|
||||
bindings->constStart = cursor - start;
|
||||
cursor = FreshlyInitializeBindings(cursor, consts);
|
||||
Unused << FreshlyInitializeBindings(cursor, consts);
|
||||
|
||||
bindings->length = numBindings;
|
||||
}
|
||||
|
|
|
@ -17,8 +17,11 @@ namespace js {
|
|||
inline LexicalEnvironmentObject&
|
||||
NearestEnclosingExtensibleLexicalEnvironment(JSObject* env)
|
||||
{
|
||||
while (!IsExtensibleLexicalEnvironment(env))
|
||||
MOZ_ASSERT(env);
|
||||
while (!IsExtensibleLexicalEnvironment(env)) {
|
||||
env = env->enclosingEnvironment();
|
||||
MOZ_ASSERT(env);
|
||||
}
|
||||
return env->as<LexicalEnvironmentObject>();
|
||||
}
|
||||
|
||||
|
|
|
@ -501,12 +501,13 @@ OffsetToAlignedStaticPos(const ReflowInput& aKidReflowInput,
|
|||
AlignJustifyFlags flags = AlignJustifyFlags::eIgnoreAutoMargins;
|
||||
uint16_t alignConst =
|
||||
aPlaceholderContainer->CSSAlignmentForAbsPosChild(aKidReflowInput, pcAxis);
|
||||
// XXXdholbert: Handle <overflow-position> in bug 1311892 (by conditionally
|
||||
// setting AlignJustifyFlags::eOverflowSafe in |flags|.) For now, we behave
|
||||
// as if "unsafe" was the specified value (which is basically equivalent to
|
||||
// the default behavior, when no value is specified -- though the default
|
||||
// behavior also has some [at-risk] extra nuance about scroll containers...)
|
||||
// For now we ignore & strip off <overflow-position> bits, until bug 1311892.
|
||||
// If the safe bit in alignConst is set, set the safe flag in |flags|.
|
||||
// Note: If no <overflow-position> is specified, we behave as 'unsafe'.
|
||||
// This doesn't quite match the css-align spec, which has an [at-risk]
|
||||
// "smart default" behavior with some extra nuance about scroll containers.
|
||||
if (alignConst & NS_STYLE_ALIGN_SAFE) {
|
||||
flags |= AlignJustifyFlags::eOverflowSafe;
|
||||
}
|
||||
alignConst &= ~NS_STYLE_ALIGN_FLAG_BITS;
|
||||
|
||||
// Find out if placeholder-container & the OOF child have the same start-sides
|
||||
|
|
|
@ -1217,6 +1217,7 @@ nsFlexContainerFrame::CSSAlignmentForAbsPosChild(
|
|||
: axisTracker.IsCrossAxisReversed();
|
||||
|
||||
uint8_t alignment;
|
||||
uint8_t alignmentFlags = 0;
|
||||
if (isMainAxis) {
|
||||
alignment = SimplifyAlignOrJustifyContentForOneItem(
|
||||
containerStylePos->mJustifyContent,
|
||||
|
@ -1234,8 +1235,8 @@ nsFlexContainerFrame::CSSAlignmentForAbsPosChild(
|
|||
// Single-line, or multi-line but the (one) line stretches to fill
|
||||
// container. Respect align-self.
|
||||
alignment = aChildRI.mStylePosition->UsedAlignSelf(Style());
|
||||
// XXX strip off <overflow-position> bits until we implement it
|
||||
// (bug 1311892)
|
||||
// Extract and strip align flag bits
|
||||
alignmentFlags = alignment & NS_STYLE_ALIGN_FLAG_BITS;
|
||||
alignment &= ~NS_STYLE_ALIGN_FLAG_BITS;
|
||||
|
||||
if (alignment == NS_STYLE_ALIGN_NORMAL) {
|
||||
|
@ -1269,7 +1270,7 @@ nsFlexContainerFrame::CSSAlignmentForAbsPosChild(
|
|||
alignment = NS_STYLE_ALIGN_END;
|
||||
}
|
||||
|
||||
return alignment;
|
||||
return (alignment | alignmentFlags);
|
||||
}
|
||||
|
||||
UniquePtr<FlexItem>
|
||||
|
|
|
@ -6596,8 +6596,8 @@ nsGridContainerFrame::CSSAlignmentForAbsPosChild(const ReflowInput& aChildRI,
|
|||
aChildRI.mStylePosition->UsedJustifySelf(Style()) :
|
||||
aChildRI.mStylePosition->UsedAlignSelf(Style());
|
||||
|
||||
// XXX strip off <overflow-position> bits until we implement it
|
||||
// (bug 1311892)
|
||||
// Extract and strip the flag bits
|
||||
uint16_t alignmentFlags = alignment & NS_STYLE_ALIGN_FLAG_BITS;
|
||||
alignment &= ~NS_STYLE_ALIGN_FLAG_BITS;
|
||||
|
||||
if (alignment == NS_STYLE_ALIGN_NORMAL) {
|
||||
|
@ -6628,7 +6628,7 @@ nsGridContainerFrame::CSSAlignmentForAbsPosChild(const ReflowInput& aChildRI,
|
|||
alignment = NS_STYLE_ALIGN_END;
|
||||
}
|
||||
|
||||
return alignment;
|
||||
return (alignment | alignmentFlags);
|
||||
}
|
||||
|
||||
nscoord
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Reference: Testing safe overflow-position for align-self in absolutely positioned boxes in flex containers</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flex {
|
||||
display: flex;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
border: 3px solid black;
|
||||
vertical-align: top;
|
||||
margin: 20px;
|
||||
position: relative;
|
||||
}
|
||||
.child {
|
||||
border: 2px dotted purple;
|
||||
background: teal;
|
||||
width: 65px;
|
||||
height: 65px;
|
||||
align-self: start;
|
||||
position: absolute;
|
||||
background: yellow;
|
||||
}
|
||||
.rowDir {
|
||||
flex-direction: row;
|
||||
}
|
||||
.colDir {
|
||||
flex-direction: column;
|
||||
}
|
||||
.vertRL {
|
||||
writing-mode: vertical-rl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flex rowDir"><div class="child"></div></div>
|
||||
<div class="flex colDir"><div class="child"></div></div>
|
||||
<div class="flex rowDir vertRL"><div class="child"></div></div>
|
||||
<div class="flex colDir vertRL"><div class="child"></div></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS Test: Testing safe overflow-position for align-self in absolutely positioned boxes in flex containers</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-align-3/#overflow-values">
|
||||
<link rel="match" href="flex-abspos-staticpos-align-self-safe-001-ref.html">
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
.flex {
|
||||
display: flex;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
border: 3px solid black;
|
||||
vertical-align: top;
|
||||
margin: 20px;
|
||||
position: relative;
|
||||
}
|
||||
.child {
|
||||
border: 2px dotted purple;
|
||||
background: teal;
|
||||
width: 65px;
|
||||
height: 65px;
|
||||
align-self: safe center;
|
||||
position: absolute;
|
||||
background: yellow;
|
||||
}
|
||||
.rowDir {
|
||||
flex-direction: row;
|
||||
}
|
||||
.colDir {
|
||||
flex-direction: column;
|
||||
}
|
||||
.vertRL {
|
||||
writing-mode: vertical-rl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flex rowDir"><div class="child"></div></div>
|
||||
<div class="flex colDir"><div class="child"></div></div>
|
||||
<div class="flex rowDir vertRL"><div class="child"></div></div>
|
||||
<div class="flex colDir vertRL"><div class="child"></div></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Reference: Testing safe overflow-position for align-self and justify-self in absolutely positioned boxes in grid containers in both horizontal and vertical writing modes</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<style>
|
||||
.container {
|
||||
display: grid;
|
||||
padding: 2px 1px;
|
||||
border: 1px solid black;
|
||||
background: yellow;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 5px;
|
||||
float: left; /* For testing in "rows" of containers */
|
||||
position: relative;
|
||||
width: 30px;
|
||||
height: 25px;
|
||||
grid: 3px 14px 3px / 2px 20px 2px;
|
||||
}
|
||||
br { clear: both }
|
||||
.container > * {
|
||||
position: absolute;
|
||||
grid-area: 2 / 2 / 3 / 3;
|
||||
background: teal;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
justify-self: start;
|
||||
align-self: start;
|
||||
}
|
||||
.vertRL {
|
||||
writing-mode: vertical-rl;
|
||||
}
|
||||
.relPos {
|
||||
position: relative;
|
||||
}
|
||||
.relPos > * {
|
||||
height: 35px;
|
||||
width: 33px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container vertRL"><div></div></div>
|
||||
<div class="container"><div></div></div>
|
||||
<div class="container relPos vertRL"><div></div></div>
|
||||
<div class="container relPos"><div></div></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Test: Testing safe overflow-position for align-self and justify-self in absolutely positioned boxes in grid containers in both horizontal and vertical writing modes</title>
|
||||
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-align-3/#overflow-values">
|
||||
<link rel="match" href="grid-abspos-staticpos-align-self-safe-001-ref.html">
|
||||
<style>
|
||||
.container {
|
||||
display: grid;
|
||||
padding: 2px 1px;
|
||||
border: 1px solid black;
|
||||
background: yellow;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 5px;
|
||||
float: left; /* For testing in "rows" of containers */
|
||||
position: relative;
|
||||
width: 30px;
|
||||
height: 25px;
|
||||
grid: 3px 14px 3px / 2px 20px 2px;
|
||||
}
|
||||
br { clear: both }
|
||||
.container > * {
|
||||
position: absolute;
|
||||
grid-area: 2 / 2 / 3 / 3;
|
||||
background: teal;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
justify-self: safe end;
|
||||
align-self: safe center;
|
||||
}
|
||||
.vertRL {
|
||||
writing-mode: vertical-rl;
|
||||
}
|
||||
.relPos {
|
||||
position: relative;
|
||||
}
|
||||
.relPos > * {
|
||||
height: 35px;
|
||||
width: 33px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container vertRL"><div></div></div>
|
||||
<div class="container"><div></div></div>
|
||||
<div class="container relPos vertRL"><div></div></div>
|
||||
<div class="container relPos"><div></div></div>
|
||||
</body>
|
||||
</html>
|
|
@ -24,6 +24,7 @@
|
|||
== flex-abspos-staticpos-align-self-rtl-002.html flex-abspos-staticpos-align-self-rtl-002-ref.html
|
||||
== flex-abspos-staticpos-align-self-rtl-003.html flex-abspos-staticpos-align-self-rtl-003-ref.html
|
||||
== flex-abspos-staticpos-align-self-rtl-004.html flex-abspos-staticpos-align-self-rtl-004-ref.html
|
||||
== flex-abspos-staticpos-align-self-safe-001.html flex-abspos-staticpos-align-self-safe-001-ref.html
|
||||
== flex-abspos-staticpos-align-self-vertWM-001.html flex-abspos-staticpos-align-self-vertWM-001-ref.html
|
||||
== flex-abspos-staticpos-align-self-vertWM-002.html flex-abspos-staticpos-align-self-vertWM-002-ref.html
|
||||
== flex-abspos-staticpos-align-self-vertWM-003.html flex-abspos-staticpos-align-self-vertWM-003-ref.html
|
||||
|
@ -58,6 +59,7 @@
|
|||
== grid-abspos-staticpos-align-self-rtl-002.html grid-abspos-staticpos-align-self-rtl-002-ref.html
|
||||
== grid-abspos-staticpos-align-self-rtl-003.html grid-abspos-staticpos-align-self-rtl-003-ref.html
|
||||
== grid-abspos-staticpos-align-self-rtl-004.html grid-abspos-staticpos-align-self-rtl-004-ref.html
|
||||
== grid-abspos-staticpos-align-self-safe-001.html grid-abspos-staticpos-align-self-safe-001-ref.html
|
||||
== grid-abspos-staticpos-align-self-vertWM-001.html grid-abspos-staticpos-align-self-vertWM-001-ref.html
|
||||
== grid-abspos-staticpos-align-self-vertWM-002.html grid-abspos-staticpos-align-self-vertWM-002-ref.html
|
||||
== grid-abspos-staticpos-align-self-vertWM-003.html grid-abspos-staticpos-align-self-vertWM-003-ref.html
|
||||
|
|
|
@ -515,13 +515,13 @@ class MediaPipelineTest : public ::testing::Test {
|
|||
ASSERT_GE(p1_.GetAudioRtpCountSent(), 40);
|
||||
ASSERT_EQ(p1_.GetAudioRtpCountReceived(), p2_.GetAudioRtpCountSent());
|
||||
ASSERT_EQ(p1_.GetAudioRtpCountSent(), p2_.GetAudioRtpCountReceived());
|
||||
|
||||
// Calling ShutdownMedia_m on both pipelines does not stop the flow of
|
||||
// RTCP. So, we might be off by one here.
|
||||
ASSERT_LE(p2_.GetAudioRtcpCountReceived(), p1_.GetAudioRtcpCountSent());
|
||||
ASSERT_GE(p2_.GetAudioRtcpCountReceived() + 1, p1_.GetAudioRtcpCountSent());
|
||||
}
|
||||
|
||||
// No RTCP packets should have been dropped, because we do not filter them.
|
||||
// Calling ShutdownMedia_m on both pipelines does not stop the flow of
|
||||
// RTCP. So, we might be off by one here.
|
||||
ASSERT_LE(p2_.GetAudioRtcpCountReceived(), p1_.GetAudioRtcpCountSent());
|
||||
ASSERT_GE(p2_.GetAudioRtcpCountReceived() + 1, p1_.GetAudioRtcpCountSent());
|
||||
}
|
||||
|
||||
void TestAudioReceiverBundle(bool bundle_accepted,
|
||||
|
@ -588,89 +588,6 @@ TEST_F(MediaPipelineFilterTest, TestSSRCFilter) {
|
|||
#define RTCP_TYPEINFO(num_rrs, type, size) \
|
||||
0x80 + num_rrs, type, 0, size
|
||||
|
||||
const unsigned char rtcp_sr_s16[] = {
|
||||
// zero rrs, size 6 words
|
||||
RTCP_TYPEINFO(0, MediaPipelineFilter::SENDER_REPORT_T, 6),
|
||||
REPORT_FRAGMENT(16)
|
||||
};
|
||||
|
||||
const unsigned char rtcp_sr_s16_r17[] = {
|
||||
// one rr, size 12 words
|
||||
RTCP_TYPEINFO(1, MediaPipelineFilter::SENDER_REPORT_T, 12),
|
||||
REPORT_FRAGMENT(16),
|
||||
REPORT_FRAGMENT(17)
|
||||
};
|
||||
|
||||
const unsigned char unknown_type[] = {
|
||||
RTCP_TYPEINFO(1, 222, 0)
|
||||
};
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestEmptyFilterReport0) {
|
||||
MediaPipelineFilter filter;
|
||||
ASSERT_FALSE(filter.FilterSenderReport(rtcp_sr_s16, sizeof(rtcp_sr_s16)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestFilterReport0) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.AddRemoteSSRC(16);
|
||||
ASSERT_TRUE(filter.FilterSenderReport(rtcp_sr_s16, sizeof(rtcp_sr_s16)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestFilterReport0PTTruncated) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.AddRemoteSSRC(16);
|
||||
const unsigned char data[] = {0x80};
|
||||
ASSERT_FALSE(filter.FilterSenderReport(data, sizeof(data)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestFilterReport0CountTruncated) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.AddRemoteSSRC(16);
|
||||
const unsigned char* data = {};
|
||||
ASSERT_FALSE(filter.FilterSenderReport(data, sizeof(data)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestFilterReport1SSRCTruncated) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.AddRemoteSSRC(16);
|
||||
const unsigned char sr[] = {
|
||||
RTCP_TYPEINFO(1, MediaPipelineFilter::SENDER_REPORT_T, 12),
|
||||
REPORT_FRAGMENT(16),
|
||||
0,0,0
|
||||
};
|
||||
ASSERT_TRUE(filter.FilterSenderReport(sr, sizeof(sr)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestFilterReport1BigSSRC) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.AddRemoteSSRC(0x01020304);
|
||||
const unsigned char sr[] = {
|
||||
RTCP_TYPEINFO(1, MediaPipelineFilter::SENDER_REPORT_T, 12),
|
||||
SSRC(0x01020304),
|
||||
REPORT_FRAGMENT(0x11121314)
|
||||
};
|
||||
ASSERT_TRUE(filter.FilterSenderReport(sr, sizeof(sr)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestFilterReportMatch) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.AddRemoteSSRC(16);
|
||||
ASSERT_TRUE(filter.FilterSenderReport(rtcp_sr_s16_r17,
|
||||
sizeof(rtcp_sr_s16_r17)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestFilterReportNoMatch) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.AddRemoteSSRC(17);
|
||||
ASSERT_FALSE(filter.FilterSenderReport(rtcp_sr_s16_r17,
|
||||
sizeof(rtcp_sr_s16_r17)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestFilterUnknownRTCPType) {
|
||||
MediaPipelineFilter filter;
|
||||
ASSERT_FALSE(filter.FilterSenderReport(unknown_type, sizeof(unknown_type)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestCorrelatorFilter) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.SetCorrelator(7777);
|
||||
|
@ -679,9 +596,6 @@ TEST_F(MediaPipelineFilterTest, TestCorrelatorFilter) {
|
|||
// This should also have resulted in the SSRC 16 being added to the filter
|
||||
ASSERT_TRUE(Filter(filter, 0, 16, 110));
|
||||
ASSERT_FALSE(Filter(filter, 0, 17, 110));
|
||||
|
||||
// rtcp_sr_s16 has 16 as an SSRC
|
||||
ASSERT_TRUE(filter.FilterSenderReport(rtcp_sr_s16, sizeof(rtcp_sr_s16)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestPayloadTypeFilter) {
|
||||
|
@ -691,15 +605,6 @@ TEST_F(MediaPipelineFilterTest, TestPayloadTypeFilter) {
|
|||
ASSERT_FALSE(Filter(filter, 0, 556, 111));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestPayloadTypeFilterSSRCUpdate) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.AddUniquePT(110);
|
||||
ASSERT_TRUE(Filter(filter, 0, 16, 110));
|
||||
|
||||
// rtcp_sr_s16 has 16 as an SSRC
|
||||
ASSERT_TRUE(filter.FilterSenderReport(rtcp_sr_s16, sizeof(rtcp_sr_s16)));
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineFilterTest, TestSSRCMovedWithCorrelator) {
|
||||
MediaPipelineFilter filter;
|
||||
filter.SetCorrelator(7777);
|
||||
|
@ -752,8 +657,6 @@ TEST_F(MediaPipelineTest, TestAudioSendBundle) {
|
|||
ASSERT_GT(p1_.GetAudioRtpCountSent(), p2_.GetAudioRtpCountReceived());
|
||||
ASSERT_GT(p2_.GetAudioRtpCountReceived(), 40);
|
||||
ASSERT_GT(p1_.GetAudioRtcpCountSent(), 1);
|
||||
ASSERT_GT(p1_.GetAudioRtcpCountSent(), p2_.GetAudioRtcpCountReceived());
|
||||
ASSERT_GT(p2_.GetAudioRtcpCountReceived(), 0);
|
||||
}
|
||||
|
||||
TEST_F(MediaPipelineTest, TestAudioSendEmptyBundleFilter) {
|
||||
|
|
|
@ -1169,13 +1169,11 @@ MediaPipeline::RtcpPacketReceived(TransportLayer* aLayer, MediaPacket& packet)
|
|||
return;
|
||||
}
|
||||
|
||||
// We do not filter receiver reports, since the webrtc.org code for
|
||||
// senders already has logic to ignore RRs that do not apply.
|
||||
// TODO bug 1279153: remove SR check for reduced size RTCP
|
||||
if (mFilter && !mFilter->FilterSenderReport(packet.data(), packet.len())) {
|
||||
CSFLogWarn(LOGTAG, "Dropping incoming RTCP packet; filtered out");
|
||||
return;
|
||||
}
|
||||
// We do not filter RTCP. This is because a compound RTCP packet can contain
|
||||
// any collection of RTCP packets, and webrtc.org already knows how to filter
|
||||
// out what it is interested in, and what it is not. Maybe someday we should
|
||||
// have a TransportLayer that breaks up compound RTCP so we can filter them
|
||||
// individually, but I doubt that will matter much.
|
||||
|
||||
CSFLogDebug(LOGTAG, "%s received RTCP packet.", mDescription.c_str());
|
||||
IncrementRtcpPacketsReceived();
|
||||
|
|
|
@ -94,33 +94,5 @@ void MediaPipelineFilter::Update(const MediaPipelineFilter& filter_update) {
|
|||
correlator_ = filter_update.correlator_;
|
||||
}
|
||||
|
||||
bool
|
||||
MediaPipelineFilter::FilterSenderReport(const unsigned char* data,
|
||||
size_t len) const {
|
||||
|
||||
if (!data) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (len < FIRST_SSRC_OFFSET + 4) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t payload_type = data[PT_OFFSET];
|
||||
|
||||
if (payload_type != SENDER_REPORT_T) {
|
||||
// Not a sender report, let it through
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t ssrc = 0;
|
||||
ssrc += (uint32_t)data[FIRST_SSRC_OFFSET] << 24;
|
||||
ssrc += (uint32_t)data[FIRST_SSRC_OFFSET + 1] << 16;
|
||||
ssrc += (uint32_t)data[FIRST_SSRC_OFFSET + 2] << 8;
|
||||
ssrc += (uint32_t)data[FIRST_SSRC_OFFSET + 3];
|
||||
|
||||
return !!remote_ssrc_set_.count(ssrc);
|
||||
}
|
||||
|
||||
} // end namespace mozilla
|
||||
|
||||
|
|
|
@ -53,10 +53,6 @@ class MediaPipelineFilter {
|
|||
// the filter about ssrcs)
|
||||
bool Filter(const webrtc::RTPHeader& header, uint32_t correlator = 0);
|
||||
|
||||
// RTCP doesn't have things like the RTP correlator, and uses its own
|
||||
// payload types too.
|
||||
bool FilterSenderReport(const unsigned char* data, size_t len) const;
|
||||
|
||||
void AddRemoteSSRC(uint32_t ssrc);
|
||||
void AddRemoteRtpStreamId(const std::string& rtp_strm_id);
|
||||
|
||||
|
@ -66,9 +62,6 @@ class MediaPipelineFilter {
|
|||
|
||||
void Update(const MediaPipelineFilter& filter_update);
|
||||
|
||||
// Some payload types
|
||||
static const uint8_t SENDER_REPORT_T = 200;
|
||||
|
||||
private:
|
||||
// Payload type is always in the second byte
|
||||
static const size_t PT_OFFSET = 1;
|
||||
|
|
|
@ -4951,8 +4951,7 @@ pref("extensions.webextensions.keepUuidOnUninstall", false);
|
|||
// Redirect basedomain used by identity api
|
||||
pref("extensions.webextensions.identity.redirectDomain", "extensions.allizom.org");
|
||||
pref("extensions.webextensions.restrictedDomains", "accounts-static.cdn.mozilla.net,accounts.firefox.com,addons.cdn.mozilla.net,addons.mozilla.org,api.accounts.firefox.com,content.cdn.mozilla.net,content.cdn.mozilla.net,discovery.addons.mozilla.org,input.mozilla.org,install.mozilla.org,oauth.accounts.firefox.com,profile.accounts.firefox.com,support.mozilla.org,sync.services.mozilla.com,testpilot.firefox.com");
|
||||
// Whether or not webextension themes are supported.
|
||||
pref("extensions.webextensions.themes.enabled", false);
|
||||
// Whether or not webextension icon theming is supported.
|
||||
pref("extensions.webextensions.themes.icons.enabled", false);
|
||||
pref("extensions.webextensions.remote", false);
|
||||
// Whether or not the moz-extension resource loads are remoted. For debugging
|
||||
|
|
|
@ -566,9 +566,10 @@ def target_tasks_dmd(full_task_graph, parameters, graph_config):
|
|||
@_target_task('searchfox_index')
|
||||
def target_tasks_searchfox(full_task_graph, parameters, graph_config):
|
||||
"""Select tasks required for indexing Firefox for Searchfox web site each day"""
|
||||
# For now we only do Linux debug builds. Windows and Mac builds
|
||||
# For now we only do Linux and Mac debug builds. Windows builds
|
||||
# are currently broken (bug 1418415).
|
||||
return ['searchfox-linux64-searchfox/debug']
|
||||
return ['searchfox-linux64-searchfox/debug',
|
||||
'searchfox-macosx64-searchfox/debug']
|
||||
|
||||
|
||||
@_target_task('file_update')
|
||||
|
|
|
@ -7,10 +7,6 @@ ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
ChromeUtils.defineModuleGetter(this, "LightweightThemeManager",
|
||||
"resource://gre/modules/LightweightThemeManager.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gThemesEnabled", () => {
|
||||
return Services.prefs.getBoolPref("extensions.webextensions.themes.enabled");
|
||||
});
|
||||
|
||||
var {
|
||||
getWinUtils,
|
||||
} = ExtensionUtils;
|
||||
|
@ -40,17 +36,16 @@ class Theme {
|
|||
* @param {string} extension Extension that created the theme.
|
||||
* @param {Integer} windowId The windowId where the theme is applied.
|
||||
*/
|
||||
constructor(extension, windowId) {
|
||||
// The base URI of the extension, used to resolve relative filepaths.
|
||||
this.baseURI = extension.baseURI;
|
||||
// Logger that will be used to show manifest warnings to the theme author.
|
||||
this.logger = extension.logger;
|
||||
|
||||
constructor({extension, details, windowId}) {
|
||||
this.extension = extension;
|
||||
this.details = details;
|
||||
this.windowId = windowId;
|
||||
|
||||
this.lwtStyles = {
|
||||
icons: {},
|
||||
};
|
||||
|
||||
this.load();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,8 +55,8 @@ class Theme {
|
|||
* @param {Object} details Theme part of the manifest. Supported
|
||||
* properties can be found in the schema under ThemeType.
|
||||
*/
|
||||
load(details) {
|
||||
this.details = details;
|
||||
load() {
|
||||
const {details} = this;
|
||||
|
||||
if (details.colors) {
|
||||
this.loadColors(details.colors);
|
||||
|
@ -178,6 +173,8 @@ class Theme {
|
|||
* @param {Object} images Dictionary mapping image properties to values.
|
||||
*/
|
||||
loadImages(images) {
|
||||
const {baseURI} = this.extension;
|
||||
|
||||
for (let image of Object.keys(images)) {
|
||||
let val = images[image];
|
||||
|
||||
|
@ -187,13 +184,13 @@ class Theme {
|
|||
|
||||
switch (image) {
|
||||
case "additional_backgrounds": {
|
||||
let backgroundImages = val.map(img => this.baseURI.resolve(img));
|
||||
let backgroundImages = val.map(img => baseURI.resolve(img));
|
||||
this.lwtStyles.additionalBackgrounds = backgroundImages;
|
||||
break;
|
||||
}
|
||||
case "headerURL":
|
||||
case "theme_frame": {
|
||||
let resolvedURL = this.baseURI.resolve(val);
|
||||
let resolvedURL = baseURI.resolve(val);
|
||||
this.lwtStyles.headerURL = resolvedURL;
|
||||
break;
|
||||
}
|
||||
|
@ -207,6 +204,8 @@ class Theme {
|
|||
* @param {Object} icons Dictionary mapping icon properties to extension URLs.
|
||||
*/
|
||||
loadIcons(icons) {
|
||||
const {baseURI} = this.extension;
|
||||
|
||||
if (!Services.prefs.getBoolPref("extensions.webextensions.themes.icons.enabled")) {
|
||||
// Return early if icons are disabled.
|
||||
return;
|
||||
|
@ -217,11 +216,11 @@ class Theme {
|
|||
// We also have to compare against the baseURI spec because
|
||||
// `val` might have been resolved already. Resolving "" against
|
||||
// the baseURI just produces that URI, so check for equality.
|
||||
if (!val || val == this.baseURI.spec || !ICONS.includes(icon)) {
|
||||
if (!val || val == baseURI.spec || !ICONS.includes(icon)) {
|
||||
continue;
|
||||
}
|
||||
let variableName = `--${icon}-icon`;
|
||||
let resolvedURL = this.baseURI.resolve(val);
|
||||
let resolvedURL = baseURI.resolve(val);
|
||||
this.lwtStyles.icons[variableName] = resolvedURL;
|
||||
}
|
||||
}
|
||||
|
@ -237,13 +236,14 @@ class Theme {
|
|||
let additionalBackgroundsCount = (this.lwtStyles.additionalBackgrounds &&
|
||||
this.lwtStyles.additionalBackgrounds.length) || 0;
|
||||
const assertValidAdditionalBackgrounds = (property, valueCount) => {
|
||||
const {logger} = this.extension;
|
||||
if (!additionalBackgroundsCount) {
|
||||
this.logger.warn(`The '${property}' property takes effect only when one ` +
|
||||
logger.warn(`The '${property}' property takes effect only when one ` +
|
||||
`or more additional background images are specified using the 'additional_backgrounds' property.`);
|
||||
return false;
|
||||
}
|
||||
if (additionalBackgroundsCount !== valueCount) {
|
||||
this.logger.warn(`The amount of values specified for '${property}' ` +
|
||||
logger.warn(`The amount of values specified for '${property}' ` +
|
||||
`(${valueCount}) is not equal to the amount of additional background ` +
|
||||
`images (${additionalBackgroundsCount}), which may lead to unexpected results.`);
|
||||
}
|
||||
|
@ -312,21 +312,13 @@ class Theme {
|
|||
|
||||
this.theme = class extends ExtensionAPI {
|
||||
onManifestEntry(entryName) {
|
||||
if (!gThemesEnabled) {
|
||||
// Return early if themes are disabled.
|
||||
return;
|
||||
}
|
||||
|
||||
let {extension} = this;
|
||||
let {manifest} = extension;
|
||||
|
||||
if (!gThemesEnabled) {
|
||||
// Return early if themes are disabled.
|
||||
return;
|
||||
}
|
||||
|
||||
defaultTheme = new Theme(extension);
|
||||
defaultTheme.load(manifest.theme);
|
||||
defaultTheme = new Theme({
|
||||
extension,
|
||||
details: manifest.theme,
|
||||
});
|
||||
}
|
||||
|
||||
onShutdown(reason) {
|
||||
|
@ -363,11 +355,6 @@ this.theme = class extends ExtensionAPI {
|
|||
return Promise.resolve(defaultTheme.details);
|
||||
},
|
||||
update: (windowId, details) => {
|
||||
if (!gThemesEnabled) {
|
||||
// Return early if themes are disabled.
|
||||
return;
|
||||
}
|
||||
|
||||
if (windowId) {
|
||||
const browserWindow = windowTracker.getWindow(windowId, context);
|
||||
if (!browserWindow) {
|
||||
|
@ -375,15 +362,13 @@ this.theme = class extends ExtensionAPI {
|
|||
}
|
||||
}
|
||||
|
||||
let theme = new Theme(extension, windowId);
|
||||
theme.load(details);
|
||||
new Theme({
|
||||
extension,
|
||||
details,
|
||||
windowId,
|
||||
});
|
||||
},
|
||||
reset: (windowId) => {
|
||||
if (!gThemesEnabled) {
|
||||
// Return early if themes are disabled.
|
||||
return;
|
||||
}
|
||||
|
||||
if (windowId) {
|
||||
const browserWindow = windowTracker.getWindow(windowId, context);
|
||||
if (!browserWindow) {
|
||||
|
|
|
@ -7,12 +7,6 @@ const {LightweightThemeManager} = ChromeUtils.import("resource://gre/modules/Lig
|
|||
const {PromiseTestUtils} = ChromeUtils.import("resource://testing-common/PromiseTestUtils.jsm", null);
|
||||
PromiseTestUtils.whitelistRejectionsGlobally(/Message manager disconnected/);
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_management_themes() {
|
||||
const TEST_ID = "test_management_themes@tests.mozilla.com";
|
||||
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_support_theme_frame() {
|
||||
const FRAME_COLOR = [71, 105, 91];
|
||||
const TAB_TEXT_COLOR = [207, 221, 192];
|
||||
|
|
|
@ -36,12 +36,6 @@ function validateTheme(backgroundImage, accentColor, textColor, isLWT) {
|
|||
Assert.equal(style.color, textColor, "Expected correct text color");
|
||||
}
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_dynamic_theme_updates() {
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
// This test checks whether applied WebExtension themes that attempt to change
|
||||
// the toolbar and toolbar_field properties also theme the findbar.
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_support_toolbar_properties_on_findbar() {
|
||||
const TOOLBAR_COLOR = "#ff00ff";
|
||||
const TOOLBAR_TEXT_COLOR = "#9400ff";
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_support_LWT_properties() {
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_support_backgrounds_position() {
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
// This test checks whether applied WebExtension themes are persisted and applied
|
||||
// on newly opened windows.
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_multiple_windows() {
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
// This test checks whether applied WebExtension themes that attempt to change
|
||||
// the text color of the selected tab are applied properly.
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_support_tab_text_property_css_color() {
|
||||
const TAB_TEXT_COLOR = "#9400ff";
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
|
|
|
@ -7,10 +7,6 @@ ChromeUtils.import("resource://testing-common/CustomizableUITestUtils.jsm", this
|
|||
let gCUITestUtils = new CustomizableUITestUtils(window);
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({set: [
|
||||
["extensions.webextensions.themes.enabled", true],
|
||||
]});
|
||||
|
||||
await gCUITestUtils.addSearchBar();
|
||||
registerCleanupFunction(() => {
|
||||
gCUITestUtils.removeSearchBar();
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
// This test checks whether applied WebExtension themes that attempt to change
|
||||
// the background color of toolbars are applied properly.
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["extensions.webextensions.themes.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_support_toolbar_property() {
|
||||
const TOOLBAR_COLOR = "#ff00ff";
|
||||
const TOOLBAR_TEXT_COLOR = "#9400ff";
|
||||
|
|
|
@ -757,6 +757,87 @@ mediarecorder:
|
|||
- main
|
||||
- content
|
||||
|
||||
media:
|
||||
page_count:
|
||||
bug_numbers:
|
||||
- 1476456
|
||||
description: >
|
||||
The number of times a top level document is loaded.
|
||||
expires: "68"
|
||||
kind: uint
|
||||
notification_emails:
|
||||
- cpearce@mozilla.com
|
||||
- alwu@mozilla.com
|
||||
- nohlmeier@mozilla.com
|
||||
release_channel_collection: opt-in
|
||||
record_in_processes:
|
||||
- main
|
||||
- content
|
||||
|
||||
page_had_media_count:
|
||||
bug_numbers:
|
||||
- 1476456
|
||||
description: >
|
||||
The number of times a document hierarchy contained at least one audible HTMLMediaElement that had play() called upon it.
|
||||
expires: "68"
|
||||
kind: uint
|
||||
notification_emails:
|
||||
- cpearce@mozilla.com
|
||||
- alwu@mozilla.com
|
||||
- nohlmeier@mozilla.com
|
||||
release_channel_collection: opt-in
|
||||
record_in_processes:
|
||||
- main
|
||||
- content
|
||||
|
||||
page_had_play_revoked_count:
|
||||
bug_numbers:
|
||||
- 1476456
|
||||
description: >
|
||||
The number of times a document hierarchy contained at least one muted playing HTMLMediaElement that was paused due to becoming unmuted while not being allowed to autoplay.
|
||||
expires: "68"
|
||||
kind: uint
|
||||
notification_emails:
|
||||
- cpearce@mozilla.com
|
||||
- alwu@mozilla.com
|
||||
- nohlmeier@mozilla.com
|
||||
release_channel_collection: opt-in
|
||||
record_in_processes:
|
||||
- main
|
||||
- content
|
||||
|
||||
autoplay_would_not_be_allowed_count:
|
||||
bug_numbers:
|
||||
- 1476456
|
||||
description: >
|
||||
The number of HTMLMediaElement autoplays on audible HTMLMediaElements which would not be allowed to play if block autoplay was enabled; we'd either prompt for permission to play or block outright depending on user preferences.
|
||||
expires: "68"
|
||||
kind: uint
|
||||
notification_emails:
|
||||
- cpearce@mozilla.com
|
||||
- alwu@mozilla.com
|
||||
- nohlmeier@mozilla.com
|
||||
release_channel_collection: opt-in
|
||||
record_in_processes:
|
||||
- main
|
||||
- content
|
||||
|
||||
autoplay_would_be_allowed_count:
|
||||
bug_numbers:
|
||||
- 1476456
|
||||
description: >
|
||||
The number of HTMLMediaElement autoplays on audible HTMLMediaElements that would have been allowed (not blocked) by the autoplay policy if block autoplay was enabled.
|
||||
expires: "68"
|
||||
kind: uint
|
||||
notification_emails:
|
||||
- cpearce@mozilla.com
|
||||
- alwu@mozilla.com
|
||||
- nohlmeier@mozilla.com
|
||||
release_channel_collection: opt-in
|
||||
record_in_processes:
|
||||
- main
|
||||
- content
|
||||
|
||||
# The following section contains content process base counters.
|
||||
dom.contentprocess:
|
||||
troubled_due_to_memory:
|
||||
|
|
|
@ -692,6 +692,7 @@ GK_ATOM(onbeforescriptexecute, "onbeforescriptexecute")
|
|||
GK_ATOM(onbeforeunload, "onbeforeunload")
|
||||
GK_ATOM(onblocked, "onblocked")
|
||||
GK_ATOM(onblur, "onblur")
|
||||
GK_ATOM(onbounce, "onbounce")
|
||||
GK_ATOM(onbroadcast, "onbroadcast")
|
||||
GK_ATOM(onbufferedamountlow, "onbufferedamountlow")
|
||||
GK_ATOM(oncached, "oncached")
|
||||
|
|
Загрузка…
Ссылка в новой задаче