mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Merge mozilla-central to inbound. a=merge CLOSED TREE
This commit is contained in:
commit
a80f71effb
@ -1395,7 +1395,8 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
|
||||
table = aContext->Parent();
|
||||
|
||||
if (table) {
|
||||
nsIContent* parentContent = aContent->GetParentOrHostNode()->AsContent();
|
||||
nsIContent* parentContent =
|
||||
aContent->GetParentOrHostNode()->AsContent();
|
||||
nsIFrame* parentFrame = nullptr;
|
||||
if (parentContent) {
|
||||
parentFrame = parentContent->GetPrimaryFrame();
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<blocklist lastupdate="1555503879816" xmlns="http://www.mozilla.org/2006/addons-blocklist">
|
||||
<blocklist lastupdate="1555528639011" xmlns="http://www.mozilla.org/2006/addons-blocklist">
|
||||
<emItems>
|
||||
<emItem blockID="i334" id="{0F827075-B026-42F3-885D-98981EE7B1AE}">
|
||||
<prefs/>
|
||||
@ -2828,6 +2828,14 @@
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
<emItem blockID="cbd7444f-e62a-4639-b172-845548b6d4a7" id="/^((\{880cacfe-5793-4346-89ce-fbbd368d394c\})|(\{f0780038-50b9-11e9-9c72-4ba2d8f2ec9f\})|(\{22ffe411-2b0e-11e9-87f9-c329f1f9c8d2\})|(\{cf4bae43-026f-4e7e-a85a-952a7ca697a1\})|(\{17052516-09be-11e9-a008-03419f6c8bc6\})|(\{333fb3de-18a8-18e8-b6d3-e73213911efb\})|(\{aa4abac2-1ffa-12aa-bbdd-9305cb2c1254\})|(\{72222e70-2fd6-11e9-956b-27f7787b8d2d\})|(\{637212d8-3484-11e9-9812-005056b22b42\})|(\{4a222e60-31de-1eca-8476-37565daf6afb\})|(\{7fc6d222-48d5-11e9-b586-17e94c73a1b1\})|(\{e111c358-121b-13fa-bf23-bb57da32d184\})|(\{9674445c-8dff-4580-96b2-99442a7ae9af\}))$/">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
<emItem blockID="74ad8c8b-a65a-470c-aa2f-ca14e1e8774d" id="{3fab603e-3ee1-1222-a859-5f85a3441216}">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
</emItems>
|
||||
<pluginItems>
|
||||
<pluginItem blockID="p332">
|
||||
|
@ -346,15 +346,14 @@ LauncherVoidResult InitializeDllBlocklistOOP(const wchar_t* aFullImagePath,
|
||||
|
||||
// As part of our mitigation of binary tampering, copy our import directory
|
||||
// from the original in our executable file.
|
||||
LauncherVoidResult importDirRestored =
|
||||
RestoreImportDirectory(aFullImagePath, ourExeImage, aChildProcess,
|
||||
ourModule);
|
||||
LauncherVoidResult importDirRestored = RestoreImportDirectory(
|
||||
aFullImagePath, ourExeImage, aChildProcess, ourModule);
|
||||
if (importDirRestored.isErr()) {
|
||||
return importDirRestored;
|
||||
}
|
||||
|
||||
Maybe<nt::PEHeaders::IATThunks> ntdllThunks =
|
||||
ourExeImage.GetIATThunksForModule("ntdll.dll");
|
||||
ourExeImage.GetIATThunksForModule("ntdll.dll");
|
||||
if (!ntdllThunks) {
|
||||
return LAUNCHER_ERROR_FROM_WIN32(ERROR_INVALID_DATA);
|
||||
}
|
||||
|
@ -41,10 +41,9 @@
|
||||
*
|
||||
* @return Ok if browser startup should proceed
|
||||
*/
|
||||
static mozilla::LauncherVoidResult PostCreationSetup(const wchar_t* aFullImagePath,
|
||||
HANDLE aChildProcess,
|
||||
HANDLE aChildMainThread,
|
||||
const bool aIsSafeMode) {
|
||||
static mozilla::LauncherVoidResult PostCreationSetup(
|
||||
const wchar_t* aFullImagePath, HANDLE aChildProcess,
|
||||
HANDLE aChildMainThread, const bool aIsSafeMode) {
|
||||
// The launcher process's DLL blocking code is incompatible with ASAN because
|
||||
// it is able to execute before ASAN itself has even initialized.
|
||||
// Also, the AArch64 build doesn't yet have a working interceptor.
|
||||
@ -332,9 +331,8 @@ Maybe<int> LauncherMain(int& argc, wchar_t* argv[],
|
||||
nsAutoHandle process(pi.hProcess);
|
||||
nsAutoHandle mainThread(pi.hThread);
|
||||
|
||||
LauncherVoidResult setupResult =
|
||||
PostCreationSetup(argv[0], process.get(), mainThread.get(),
|
||||
isSafeMode.value());
|
||||
LauncherVoidResult setupResult = PostCreationSetup(
|
||||
argv[0], process.get(), mainThread.get(), isSafeMode.value());
|
||||
if (setupResult.isErr()) {
|
||||
HandleLauncherError(setupResult);
|
||||
::TerminateProcess(process.get(), 1);
|
||||
|
@ -8,7 +8,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="aboutCompat.css" />
|
||||
<link rel="stylesheet" media="screen and (min-device-width:481px), projection" type="text/css"
|
||||
<link rel="stylesheet" media="screen and (pointer:fine), projection" type="text/css"
|
||||
href="chrome://global/skin/in-content/common.css"/>
|
||||
<link rel="localization" href="toolkit/about/aboutCompat.ftl"/>
|
||||
<title data-l10n-id="text-title"></title>
|
||||
|
@ -6,9 +6,6 @@
|
||||
|
||||
/* global ExtensionAPI, Services, XPCOMUtils */
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
|
||||
@ -19,14 +16,8 @@ XPCOMUtils.defineLazyServiceGetter(this, "resProto",
|
||||
const ResourceSubstitution = "webcompat";
|
||||
const ProcessScriptURL = "resource://webcompat/aboutPageProcessScript.js";
|
||||
|
||||
const ShouldStart = ["default", "nightly", "nightly-try"].includes(AppConstants.MOZ_UPDATE_CHANNEL);
|
||||
|
||||
this.aboutPage = class extends ExtensionAPI {
|
||||
onStartup() {
|
||||
if (!ShouldStart) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {rootURI} = this.extension;
|
||||
|
||||
resProto.setSubstitution(ResourceSubstitution,
|
||||
@ -36,10 +27,6 @@ this.aboutPage = class extends ExtensionAPI {
|
||||
}
|
||||
|
||||
onShutdown() {
|
||||
if (!ShouldStart) {
|
||||
return;
|
||||
}
|
||||
|
||||
resProto.setSubstitution(ResourceSubstitution, null);
|
||||
|
||||
Services.ppmm.removeDelayedProcessScript(ProcessScriptURL);
|
||||
|
@ -268,7 +268,8 @@ class MOZ_STACK_CLASS PopulateFromSuffixIterator final
|
||||
}
|
||||
|
||||
if (aName.EqualsLiteral("geckoViewUserContextId")) {
|
||||
MOZ_RELEASE_ASSERT(mOriginAttributes->mGeckoViewSessionContextId.IsEmpty());
|
||||
MOZ_RELEASE_ASSERT(
|
||||
mOriginAttributes->mGeckoViewSessionContextId.IsEmpty());
|
||||
mOriginAttributes->mGeckoViewSessionContextId.Assign(aValue);
|
||||
return true;
|
||||
}
|
||||
|
@ -156,7 +156,8 @@ class OriginAttributesPattern : public dom::OriginAttributesPatternDictionary {
|
||||
}
|
||||
|
||||
if (mGeckoViewSessionContextId.WasPassed() &&
|
||||
mGeckoViewSessionContextId.Value() != aAttrs.mGeckoViewSessionContextId) {
|
||||
mGeckoViewSessionContextId.Value() !=
|
||||
aAttrs.mGeckoViewSessionContextId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -191,8 +192,10 @@ class OriginAttributesPattern : public dom::OriginAttributesPatternDictionary {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mGeckoViewSessionContextId.WasPassed() && aOther.mGeckoViewSessionContextId.WasPassed() &&
|
||||
mGeckoViewSessionContextId.Value() != aOther.mGeckoViewSessionContextId.Value()) {
|
||||
if (mGeckoViewSessionContextId.WasPassed() &&
|
||||
aOther.mGeckoViewSessionContextId.WasPassed() &&
|
||||
mGeckoViewSessionContextId.Value() !=
|
||||
aOther.mGeckoViewSessionContextId.Value()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -289,8 +289,8 @@ static bool ReadPrincipalInfo(JSStructuredCloneReader* aReader, uint32_t aTag,
|
||||
|
||||
static StaticRefPtr<nsIPrincipal> sActiveWorkerPrincipal;
|
||||
|
||||
nsJSPrincipals::AutoSetActiveWorkerPrincipal::AutoSetActiveWorkerPrincipal
|
||||
(nsIPrincipal* aPrincipal) {
|
||||
nsJSPrincipals::AutoSetActiveWorkerPrincipal::AutoSetActiveWorkerPrincipal(
|
||||
nsIPrincipal* aPrincipal) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_RELEASE_ASSERT(!sActiveWorkerPrincipal);
|
||||
sActiveWorkerPrincipal = aPrincipal;
|
||||
|
@ -9,7 +9,7 @@
|
||||
using mozilla::OriginAttributes;
|
||||
using mozilla::Preferences;
|
||||
|
||||
static void TestSuffix(const OriginAttributes& attrs) {
|
||||
static void TestSuffix(const OriginAttributes &attrs) {
|
||||
nsAutoCString suffix;
|
||||
attrs.CreateSuffix(suffix);
|
||||
|
||||
|
@ -170,6 +170,7 @@ class SourceFooter extends PureComponent<Props, State> {
|
||||
collapsed={this.props.endPanelCollapsed}
|
||||
horizontal={this.props.horizontal}
|
||||
handleClick={(this.props.togglePaneCollapse: any)}
|
||||
position="end"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ exports[`SourceFooter Component default case should render 1`] = `
|
||||
collapsed={false}
|
||||
horizontal={false}
|
||||
key="toggle"
|
||||
position="start"
|
||||
position="end"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,7 +46,7 @@ exports[`SourceFooter Component move cursor should render new cursor position 1`
|
||||
collapsed={false}
|
||||
horizontal={false}
|
||||
key="toggle"
|
||||
position="start"
|
||||
position="end"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -361,8 +361,7 @@ void DocumentOrShadowRoot::NodesFromRect(float aX, float aY, float aTopSize,
|
||||
float aRightSize, float aBottomSize,
|
||||
float aLeftSize,
|
||||
bool aIgnoreRootScrollFrame,
|
||||
bool aFlushLayout,
|
||||
bool aOnlyVisible,
|
||||
bool aFlushLayout, bool aOnlyVisible,
|
||||
nsTArray<RefPtr<nsINode>>& aReturn) {
|
||||
// Following the same behavior of elementFromPoint,
|
||||
// we don't return anything if either coord is negative
|
||||
|
@ -664,19 +664,16 @@ already_AddRefed<nsIHTMLCollection> Element::GetElementsByTagName(
|
||||
|
||||
nsIScrollableFrame* Element::GetScrollFrame(nsIFrame** aFrame,
|
||||
FlushType aFlushType) {
|
||||
// it isn't clear what to return for SVG nodes, so just return nothing
|
||||
if (IsSVGElement()) {
|
||||
if (aFrame) {
|
||||
*aFrame = nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIFrame* frame = GetPrimaryFrame(aFlushType);
|
||||
if (aFrame) {
|
||||
*aFrame = frame;
|
||||
}
|
||||
if (frame) {
|
||||
if (frame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT)) {
|
||||
// It's unclear what to return for SVG frames, so just return null.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// menu frames implement GetScrollTargetFrame but we don't want
|
||||
// to use it here. Similar for comboboxes.
|
||||
LayoutFrameType type = frame->Type();
|
||||
@ -932,7 +929,7 @@ void Element::MozScrollSnap() {
|
||||
}
|
||||
|
||||
static nsSize GetScrollRectSizeForOverflowVisibleFrame(nsIFrame* aFrame) {
|
||||
if (!aFrame) {
|
||||
if (!aFrame || aFrame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT)) {
|
||||
return nsSize(0, 0);
|
||||
}
|
||||
|
||||
@ -954,8 +951,6 @@ static nsSize GetScrollRectSizeForOverflowVisibleFrame(nsIFrame* aFrame) {
|
||||
}
|
||||
|
||||
int32_t Element::ScrollHeight() {
|
||||
if (IsSVGElement()) return 0;
|
||||
|
||||
nsIFrame* frame;
|
||||
nsIScrollableFrame* sf = GetScrollFrame(&frame);
|
||||
nscoord height;
|
||||
@ -969,8 +964,6 @@ int32_t Element::ScrollHeight() {
|
||||
}
|
||||
|
||||
int32_t Element::ScrollWidth() {
|
||||
if (IsSVGElement()) return 0;
|
||||
|
||||
nsIFrame* frame;
|
||||
nsIScrollableFrame* sf = GetScrollFrame(&frame);
|
||||
nscoord width;
|
||||
|
@ -20,7 +20,7 @@ namespace mozilla {
|
||||
namespace dom {
|
||||
class Document;
|
||||
class Selection;
|
||||
}
|
||||
} // namespace dom
|
||||
|
||||
class SelectionChangeEventDispatcher final {
|
||||
public:
|
||||
|
@ -1166,8 +1166,7 @@ nsDOMWindowUtils::NodesFromRect(float aX, float aY, float aTopSize,
|
||||
|
||||
AutoTArray<RefPtr<nsINode>, 8> nodes;
|
||||
doc->NodesFromRect(aX, aY, aTopSize, aRightSize, aBottomSize, aLeftSize,
|
||||
aIgnoreRootScrollFrame, aFlushLayout, aOnlyVisible,
|
||||
nodes);
|
||||
aIgnoreRootScrollFrame, aFlushLayout, aOnlyVisible, nodes);
|
||||
list->SetCapacity(nodes.Length());
|
||||
for (auto& node : nodes) {
|
||||
list->AppendElement(node->AsContent());
|
||||
|
@ -1464,8 +1464,13 @@ bool nsGlobalWindowOuter::IsBlackForCC(bool aTracingNeeded) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Unlike most wrappers, the outer window wrapper is not a wrapper for
|
||||
// the outer window. Instead, the outer window wrapper holds the inner
|
||||
// window binding object, which in turn holds the nsGlobalWindowInner, which
|
||||
// has a strong reference to the nsGlobalWindowOuter. We're using the
|
||||
// mInnerWindow pointer as a flag for that whole chain.
|
||||
return (nsCCUncollectableMarker::InGeneration(GetMarkedCCGeneration()) ||
|
||||
HasKnownLiveWrapper()) &&
|
||||
(mInnerWindow && HasKnownLiveWrapper())) &&
|
||||
(!aTracingNeeded || HasNothingToTrace(ToSupports(this)));
|
||||
}
|
||||
|
||||
@ -2819,8 +2824,8 @@ void nsPIDOMWindowOuter::SetInitialKeyboardIndicators(
|
||||
windowRoot->SetShowFocusRings(aShowFocusRings == UIStateChangeType_Set);
|
||||
}
|
||||
|
||||
nsContentUtils::SetKeyboardIndicatorsOnRemoteChildren(
|
||||
this, aShowAccelerators, aShowFocusRings);
|
||||
nsContentUtils::SetKeyboardIndicatorsOnRemoteChildren(this, aShowAccelerators,
|
||||
aShowFocusRings);
|
||||
}
|
||||
|
||||
Element* nsPIDOMWindowOuter::GetFrameElementInternal() const {
|
||||
@ -6277,9 +6282,7 @@ void nsGlobalWindowOuter::ReallyCloseWindow() {
|
||||
// XXXbz now that we have mHavePendingClose, is this needed?
|
||||
bool isTab;
|
||||
if (rootWin == this || !bwin ||
|
||||
(NS_SUCCEEDED(
|
||||
bwin->IsTabContentWindow(this, &isTab)) &&
|
||||
isTab)) {
|
||||
(NS_SUCCEEDED(bwin->IsTabContentWindow(this, &isTab)) && isTab)) {
|
||||
treeOwnerAsWin->Destroy();
|
||||
}
|
||||
}
|
||||
@ -6844,8 +6847,8 @@ void nsGlobalWindowOuter::SetKeyboardIndicators(
|
||||
windowRoot->SetShowFocusRings(aShowFocusRings == UIStateChangeType_Set);
|
||||
}
|
||||
|
||||
nsContentUtils::SetKeyboardIndicatorsOnRemoteChildren(
|
||||
this, aShowAccelerators, aShowFocusRings);
|
||||
nsContentUtils::SetKeyboardIndicatorsOnRemoteChildren(this, aShowAccelerators,
|
||||
aShowFocusRings);
|
||||
|
||||
bool newShouldShowFocusRing = ShouldShowFocusRing();
|
||||
if (mInnerWindow && nsGlobalWindowInner::Cast(mInnerWindow)->mHasFocus &&
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include "mozilla/dom/ChildSHistory.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIWeakReferenceUtils.h"// for nsWeakPtr
|
||||
#include "nsPIDOMWindow.h" // for GetParentObject
|
||||
#include "nsIWeakReferenceUtils.h" // for nsWeakPtr
|
||||
#include "nsPIDOMWindow.h" // for GetParentObject
|
||||
#include "nsStringFwd.h"
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
|
@ -94,12 +94,12 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
|
||||
nsIContent* aContent, \
|
||||
mozilla::EventStates aStateMask) override;
|
||||
|
||||
#define NS_DECL_NSIDOCUMENTOBSERVER \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_BEGINLOAD \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATECHANGED \
|
||||
#define NS_DECL_NSIDOCUMENTOBSERVER \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_BEGINLOAD \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD \
|
||||
NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATECHANGED \
|
||||
NS_DECL_NSIMUTATIONOBSERVER
|
||||
|
||||
#define NS_IMPL_NSIDOCUMENTOBSERVER_CORE_STUB(_class) \
|
||||
@ -111,9 +111,9 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
|
||||
void _class::BeginLoad(mozilla::dom::Document*) {} \
|
||||
void _class::EndLoad(mozilla::dom::Document*) {}
|
||||
|
||||
#define NS_IMPL_NSIDOCUMENTOBSERVER_STATE_STUB(_class) \
|
||||
void _class::ContentStateChanged(mozilla::dom::Document*, \
|
||||
nsIContent* aContent, \
|
||||
#define NS_IMPL_NSIDOCUMENTOBSERVER_STATE_STUB(_class) \
|
||||
void _class::ContentStateChanged(mozilla::dom::Document*, \
|
||||
nsIContent* aContent, \
|
||||
mozilla::EventStates aStateMask) {}
|
||||
|
||||
#define NS_IMPL_NSIDOCUMENTOBSERVER_CONTENT(_class) \
|
||||
|
@ -525,8 +525,9 @@ class CallbackObjectHolder : CallbackObjectHolderBase {
|
||||
void UnlinkSelf() {
|
||||
// NS_IF_RELEASE because we might have been unlinked before
|
||||
nsISupports* ptr = GetISupports();
|
||||
NS_IF_RELEASE(ptr);
|
||||
// Clear mPtrBits before the release to prevent reentrance.
|
||||
mPtrBits = 0;
|
||||
NS_IF_RELEASE(ptr);
|
||||
}
|
||||
|
||||
uintptr_t mPtrBits;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -344,10 +344,9 @@ nsresult HTMLLinkElement::AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
||||
UpdatePreload(aName, aValue, aOldValue);
|
||||
}
|
||||
|
||||
const bool forceUpdate = dropSheet || aName == nsGkAtoms::title ||
|
||||
aName == nsGkAtoms::media ||
|
||||
aName == nsGkAtoms::type ||
|
||||
aName == nsGkAtoms::disabled;
|
||||
const bool forceUpdate =
|
||||
dropSheet || aName == nsGkAtoms::title || aName == nsGkAtoms::media ||
|
||||
aName == nsGkAtoms::type || aName == nsGkAtoms::disabled;
|
||||
|
||||
Unused << UpdateStyleSheetInternal(
|
||||
nullptr, nullptr, forceUpdate ? ForceUpdate::Yes : ForceUpdate::No);
|
||||
|
@ -7853,8 +7853,7 @@ class QuotaClient final : public mozilla::dom::quota::Client {
|
||||
|
||||
nsresult InitOrigin(PersistenceType aPersistenceType,
|
||||
const nsACString& aGroup, const nsACString& aOrigin,
|
||||
const AtomicBool& aCanceled,
|
||||
UsageInfo* aUsageInfo,
|
||||
const AtomicBool& aCanceled, UsageInfo* aUsageInfo,
|
||||
bool aForGetUsage) override;
|
||||
|
||||
nsresult GetUsageForOrigin(PersistenceType aPersistenceType,
|
||||
@ -15960,8 +15959,7 @@ nsresult QuotaClient::InitOrigin(PersistenceType aPersistenceType,
|
||||
const nsACString& aGroup,
|
||||
const nsACString& aOrigin,
|
||||
const AtomicBool& aCanceled,
|
||||
UsageInfo* aUsageInfo,
|
||||
bool aForGetUsage) {
|
||||
UsageInfo* aUsageInfo, bool aForGetUsage) {
|
||||
AssertIsOnIOThread();
|
||||
|
||||
nsCOMPtr<nsIFile> directory;
|
||||
|
@ -3694,11 +3694,11 @@ already_AddRefed<nsIEventTarget> ContentChild::GetSpecificMessageEventTarget(
|
||||
|
||||
// If sameTabGroupAs is non-zero, then the new tab will be in the same
|
||||
// TabGroup as a previously created tab. Rather than try to find the
|
||||
// previously created tab (whose constructor message may not even have been
|
||||
// processed yet, in theory) and look up its event target, we just use the
|
||||
// default event target. This means that runnables for this tab will not be
|
||||
// labeled. However, this path is only taken for print preview and view
|
||||
// source, which are not performance-sensitive.
|
||||
// previously created tab (whose constructor message may not even have
|
||||
// been processed yet, in theory) and look up its event target, we just
|
||||
// use the default event target. This means that runnables for this tab
|
||||
// will not be labeled. However, this path is only taken for print preview
|
||||
// and view source, which are not performance-sensitive.
|
||||
if (sameTabGroupAs) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -1187,8 +1187,9 @@ TabParent* ContentParent::CreateBrowser(const TabContext& aContext,
|
||||
aBrowsingContext->Canonical()->SetOwnerProcessId(
|
||||
constructorSender->ChildID());
|
||||
|
||||
RefPtr<TabParent> tabParent = new TabParent(
|
||||
constructorSender, tabId, aContext, aBrowsingContext->Canonical(), chromeFlags);
|
||||
RefPtr<TabParent> tabParent =
|
||||
new TabParent(constructorSender, tabId, aContext,
|
||||
aBrowsingContext->Canonical(), chromeFlags);
|
||||
|
||||
// Open a remote endpoint for our PBrowser actor. DeallocPBrowserParent
|
||||
// releases the ref taken.
|
||||
|
@ -5,8 +5,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "AudioConverter.h"
|
||||
#include <string.h>
|
||||
#include <speex/speex_resampler.h>
|
||||
#include <string.h>
|
||||
#include <cmath>
|
||||
|
||||
/*
|
||||
@ -151,15 +151,16 @@ static void dumbUpDownMix(TYPE* aOut, int32_t aOutChannels, const TYPE* aIn,
|
||||
|
||||
size_t AudioConverter::DownmixAudio(void* aOut, const void* aIn,
|
||||
size_t aFrames) const {
|
||||
MOZ_ASSERT(mIn.Format() == AudioConfig::FORMAT_S16 ||
|
||||
mIn.Format() == AudioConfig::FORMAT_FLT);
|
||||
MOZ_ASSERT(mIn.Channels() >= mOut.Channels());
|
||||
MOZ_ASSERT(mOut.Layout() == AudioConfig::ChannelLayout(2) ||
|
||||
mOut.Layout() == AudioConfig::ChannelLayout(1));
|
||||
MOZ_DIAGNOSTIC_ASSERT(mIn.Format() == AudioConfig::FORMAT_S16 ||
|
||||
mIn.Format() == AudioConfig::FORMAT_FLT);
|
||||
MOZ_DIAGNOSTIC_ASSERT(mIn.Channels() >= mOut.Channels());
|
||||
MOZ_DIAGNOSTIC_ASSERT(mOut.Layout() == AudioConfig::ChannelLayout(2) ||
|
||||
mOut.Layout() == AudioConfig::ChannelLayout(1));
|
||||
|
||||
uint32_t channels = mIn.Channels();
|
||||
uint32_t inChannels = mIn.Channels();
|
||||
uint32_t outChannels = mOut.Channels();
|
||||
|
||||
if (channels == 1 && mOut.Channels() == 1) {
|
||||
if (inChannels == outChannels) {
|
||||
if (aOut != aIn) {
|
||||
memmove(aOut, aIn, FramesOutToBytes(aFrames));
|
||||
}
|
||||
@ -169,11 +170,11 @@ size_t AudioConverter::DownmixAudio(void* aOut, const void* aIn,
|
||||
if (!mIn.Layout().IsValid() || !mOut.Layout().IsValid()) {
|
||||
// Dumb copy dropping extra channels.
|
||||
if (mIn.Format() == AudioConfig::FORMAT_FLT) {
|
||||
dumbUpDownMix(static_cast<float*>(aOut), mOut.Channels(),
|
||||
static_cast<const float*>(aIn), mIn.Channels(), aFrames);
|
||||
dumbUpDownMix(static_cast<float*>(aOut), outChannels,
|
||||
static_cast<const float*>(aIn), inChannels, aFrames);
|
||||
} else if (mIn.Format() == AudioConfig::FORMAT_S16) {
|
||||
dumbUpDownMix(static_cast<int16_t*>(aOut), mOut.Channels(),
|
||||
static_cast<const int16_t*>(aIn), mIn.Channels(), aFrames);
|
||||
dumbUpDownMix(static_cast<int16_t*>(aOut), outChannels,
|
||||
static_cast<const int16_t*>(aIn), inChannels, aFrames);
|
||||
} else {
|
||||
MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type");
|
||||
}
|
||||
@ -183,7 +184,7 @@ size_t AudioConverter::DownmixAudio(void* aOut, const void* aIn,
|
||||
MOZ_ASSERT(
|
||||
mIn.Layout() == AudioConfig::ChannelLayout::SMPTEDefault(mIn.Layout()),
|
||||
"Can only downmix input data in SMPTE layout");
|
||||
if (channels > 2) {
|
||||
if (inChannels > 2) {
|
||||
if (mIn.Format() == AudioConfig::FORMAT_FLT) {
|
||||
// Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows
|
||||
// 5-8.
|
||||
@ -228,14 +229,16 @@ size_t AudioConverter::DownmixAudio(void* aOut, const void* aIn,
|
||||
for (uint32_t i = 0; i < aFrames; i++) {
|
||||
float sampL = 0.0;
|
||||
float sampR = 0.0;
|
||||
for (uint32_t j = 0; j < channels; j++) {
|
||||
sampL +=
|
||||
in[i * mIn.Channels() + j] * dmatrix[mIn.Channels() - 3][j][0];
|
||||
sampR +=
|
||||
in[i * mIn.Channels() + j] * dmatrix[mIn.Channels() - 3][j][1];
|
||||
for (uint32_t j = 0; j < inChannels; j++) {
|
||||
sampL += in[i * inChannels + j] * dmatrix[inChannels - 3][j][0];
|
||||
sampR += in[i * inChannels + j] * dmatrix[inChannels - 3][j][1];
|
||||
}
|
||||
if (outChannels == 2) {
|
||||
*out++ = sampL;
|
||||
*out++ = sampR;
|
||||
} else {
|
||||
*out++ = (sampL + sampR) * 0.5;
|
||||
}
|
||||
*out++ = sampL;
|
||||
*out++ = sampR;
|
||||
}
|
||||
} else if (mIn.Format() == AudioConfig::FORMAT_S16) {
|
||||
// Downmix matrix. Per-row normalization 1 for rows 3,4 and 2 for rows
|
||||
@ -275,45 +278,46 @@ size_t AudioConverter::DownmixAudio(void* aOut, const void* aIn,
|
||||
for (uint32_t i = 0; i < aFrames; i++) {
|
||||
int32_t sampL = 0;
|
||||
int32_t sampR = 0;
|
||||
for (uint32_t j = 0; j < channels; j++) {
|
||||
sampL += in[i * channels + j] * dmatrix[channels - 3][j][0];
|
||||
sampR += in[i * channels + j] * dmatrix[channels - 3][j][1];
|
||||
for (uint32_t j = 0; j < inChannels; j++) {
|
||||
sampL += in[i * inChannels + j] * dmatrix[inChannels - 3][j][0];
|
||||
sampR += in[i * inChannels + j] * dmatrix[inChannels - 3][j][1];
|
||||
}
|
||||
sampL = clipTo15((sampL + 8192) >> 14);
|
||||
sampR = clipTo15((sampR + 8192) >> 14);
|
||||
if (outChannels == 2) {
|
||||
*out++ = sampL;
|
||||
*out++ = sampR;
|
||||
} else {
|
||||
*out++ = (sampL + sampR) * 0.5;
|
||||
}
|
||||
*out++ = clipTo15((sampL + 8192) >> 14);
|
||||
*out++ = clipTo15((sampR + 8192) >> 14);
|
||||
}
|
||||
} else {
|
||||
MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type");
|
||||
}
|
||||
|
||||
// If we are to continue downmixing to mono, start working on the output
|
||||
// buffer.
|
||||
aIn = aOut;
|
||||
channels = 2;
|
||||
return aFrames;
|
||||
}
|
||||
|
||||
if (mOut.Channels() == 1) {
|
||||
if (mIn.Format() == AudioConfig::FORMAT_FLT) {
|
||||
const float* in = static_cast<const float*>(aIn);
|
||||
float* out = static_cast<float*>(aOut);
|
||||
for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) {
|
||||
float sample = 0.0;
|
||||
// The sample of the buffer would be interleaved.
|
||||
sample = (in[fIdx * channels] + in[fIdx * channels + 1]) * 0.5;
|
||||
*out++ = sample;
|
||||
}
|
||||
} else if (mIn.Format() == AudioConfig::FORMAT_S16) {
|
||||
const int16_t* in = static_cast<const int16_t*>(aIn);
|
||||
int16_t* out = static_cast<int16_t*>(aOut);
|
||||
for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) {
|
||||
int32_t sample = 0.0;
|
||||
// The sample of the buffer would be interleaved.
|
||||
sample = (in[fIdx * channels] + in[fIdx * channels + 1]) * 0.5;
|
||||
*out++ = sample;
|
||||
}
|
||||
} else {
|
||||
MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type");
|
||||
MOZ_DIAGNOSTIC_ASSERT(inChannels == 2 && outChannels == 1);
|
||||
if (mIn.Format() == AudioConfig::FORMAT_FLT) {
|
||||
const float* in = static_cast<const float*>(aIn);
|
||||
float* out = static_cast<float*>(aOut);
|
||||
for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) {
|
||||
float sample = 0.0;
|
||||
// The sample of the buffer would be interleaved.
|
||||
sample = (in[fIdx * inChannels] + in[fIdx * inChannels + 1]) * 0.5;
|
||||
*out++ = sample;
|
||||
}
|
||||
} else if (mIn.Format() == AudioConfig::FORMAT_S16) {
|
||||
const int16_t* in = static_cast<const int16_t*>(aIn);
|
||||
int16_t* out = static_cast<int16_t*>(aOut);
|
||||
for (size_t fIdx = 0; fIdx < aFrames; ++fIdx) {
|
||||
int32_t sample = 0.0;
|
||||
// The sample of the buffer would be interleaved.
|
||||
sample = (in[fIdx * inChannels] + in[fIdx * inChannels + 1]) * 0.5;
|
||||
*out++ = sample;
|
||||
}
|
||||
} else {
|
||||
MOZ_DIAGNOSTIC_ASSERT(false, "Unsupported data type");
|
||||
}
|
||||
return aFrames;
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ struct StreamAndPromiseForOperation {
|
||||
dom::AudioContextOperationFlags mFlags;
|
||||
};
|
||||
|
||||
enum class AsyncCubebOperation { INIT, START, STOP, SHUTDOWN };
|
||||
enum class AsyncCubebOperation { INIT, START, STOP, SHUTDOWN };
|
||||
enum class AudioInputType { Unknown, Voice };
|
||||
|
||||
/**
|
||||
|
@ -66,9 +66,8 @@ CheckedInt64 UsecsToFrames(int64_t aUsecs, uint32_t aRate) {
|
||||
|
||||
// Format TimeUnit as number of frames at given rate.
|
||||
CheckedInt64 TimeUnitToFrames(const TimeUnit& aTime, uint32_t aRate) {
|
||||
return aTime.IsValid() ?
|
||||
UsecsToFrames(aTime.ToMicroseconds(), aRate) :
|
||||
CheckedInt64(INT64_MAX) + 1;
|
||||
return aTime.IsValid() ? UsecsToFrames(aTime.ToMicroseconds(), aRate)
|
||||
: CheckedInt64(INT64_MAX) + 1;
|
||||
}
|
||||
|
||||
nsresult SecondsToUsecs(double aSeconds, int64_t& aOutUsecs) {
|
||||
|
@ -183,11 +183,11 @@ void MediaEngineWebRTC::EnumerateMicrophoneDevices(
|
||||
// This is possible on windows, there is a default communication
|
||||
// device, and a default device:
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1542739
|
||||
#ifndef XP_WIN
|
||||
# ifndef XP_WIN
|
||||
MOZ_ASSERT(!foundPreferredDevice,
|
||||
"Found more than one preferred audio input device"
|
||||
"while enumerating");
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
aDevices->InsertElementAt(0, device);
|
||||
|
@ -143,8 +143,7 @@ class Client {
|
||||
const nsACString& aGroup,
|
||||
const nsACString& aOrigin,
|
||||
const AtomicBool& aCanceled,
|
||||
UsageInfo* aUsageInfo,
|
||||
bool aForGetUsage) = 0;
|
||||
UsageInfo* aUsageInfo, bool aForGetUsage) = 0;
|
||||
|
||||
virtual nsresult GetUsageForOrigin(PersistenceType aPersistenceType,
|
||||
const nsACString& aGroup,
|
||||
|
@ -442,8 +442,7 @@ class QuotaClient final : public mozilla::dom::quota::Client {
|
||||
|
||||
nsresult InitOrigin(PersistenceType aPersistenceType,
|
||||
const nsACString& aGroup, const nsACString& aOrigin,
|
||||
const AtomicBool& aCanceled,
|
||||
UsageInfo* aUsageInfo,
|
||||
const AtomicBool& aCanceled, UsageInfo* aUsageInfo,
|
||||
bool aForGetUsage) override;
|
||||
|
||||
nsresult GetUsageForOrigin(PersistenceType aPersistenceType,
|
||||
@ -1611,8 +1610,7 @@ nsresult QuotaClient::InitOrigin(PersistenceType aPersistenceType,
|
||||
const nsACString& aGroup,
|
||||
const nsACString& aOrigin,
|
||||
const AtomicBool& aCanceled,
|
||||
UsageInfo* aUsageInfo,
|
||||
bool aForGetUsage) {
|
||||
UsageInfo* aUsageInfo, bool aForGetUsage) {
|
||||
AssertIsOnIOThread();
|
||||
|
||||
if (!aUsageInfo) {
|
||||
|
@ -32,6 +32,10 @@ function testElements(baseid, callback)
|
||||
callback();
|
||||
}
|
||||
|
||||
function usesSVGLayout(e) {
|
||||
return e instanceof SVGElement && !(e instanceof SVGSVGElement);
|
||||
}
|
||||
|
||||
function toNearestAppunit(v)
|
||||
{
|
||||
// 60 appunits per CSS pixel; round result to the nearest appunit
|
||||
@ -94,13 +98,13 @@ function testElement(element)
|
||||
}
|
||||
|
||||
if (doScrollCheck) {
|
||||
if (element instanceof SVGElement)
|
||||
if (usesSVGLayout(element))
|
||||
checkScrollState(element, 0, 0, 0, 0, element.id);
|
||||
else
|
||||
checkScrollState(element, 0, 0, scrollWidth, scrollHeight, element.id);
|
||||
}
|
||||
|
||||
if (element instanceof SVGElement)
|
||||
if (usesSVGLayout(element))
|
||||
checkClientState(element, 0, 0, 0, 0, element.id);
|
||||
else
|
||||
checkClientState(element, borderLeft, borderTop, clientWidth, clientHeight, element.id);
|
||||
@ -207,7 +211,7 @@ function checkCoords(element, type, left, top, width, height, testname)
|
||||
checkCoord(element, type + "Height", height, testname);
|
||||
}
|
||||
|
||||
if (element instanceof SVGElement)
|
||||
if (usesSVGLayout(element))
|
||||
return;
|
||||
|
||||
if (element.id == "outerpopup" && !element.parentNode.open) // closed popup
|
||||
@ -220,7 +224,7 @@ function checkCoords(element, type, left, top, width, height, testname)
|
||||
|
||||
function gcs(element, prop)
|
||||
{
|
||||
var propVal = (element instanceof SVGElement && (prop == "width" || prop == "height")) ?
|
||||
var propVal = (usesSVGLayout(element) && (prop == "width" || prop == "height")) ?
|
||||
element.getAttribute(prop) : getComputedStyle(element, "")[prop];
|
||||
if (propVal == "auto" || element.id == "nonappended")
|
||||
return 0;
|
||||
|
@ -200,12 +200,14 @@ void WorkerErrorNote::AssignErrorNote(JSErrorNotes::Note* aNote) {
|
||||
}
|
||||
|
||||
WorkerErrorReport::WorkerErrorReport(WorkerPrivate* aWorkerPrivate)
|
||||
: StructuredCloneHolder(CloningSupported, TransferringNotSupported,
|
||||
StructuredCloneScope::SameProcessDifferentThread),
|
||||
mFlags(0), mExnType(JSEXN_ERR), mMutedError(false) {
|
||||
: StructuredCloneHolder(CloningSupported, TransferringNotSupported,
|
||||
StructuredCloneScope::SameProcessDifferentThread),
|
||||
mFlags(0),
|
||||
mExnType(JSEXN_ERR),
|
||||
mMutedError(false) {
|
||||
if (aWorkerPrivate) {
|
||||
RefPtr<StrongWorkerRef> workerRef = StrongWorkerRef::Create(
|
||||
aWorkerPrivate, "WorkerErrorReport");
|
||||
RefPtr<StrongWorkerRef> workerRef =
|
||||
StrongWorkerRef::Create(aWorkerPrivate, "WorkerErrorReport");
|
||||
if (workerRef) {
|
||||
mWorkerRef = new ThreadSafeWorkerRef(workerRef);
|
||||
}
|
||||
|
@ -4059,7 +4059,8 @@ void WorkerPrivate::ReportError(JSContext* aCx,
|
||||
}
|
||||
|
||||
JS::RootedObject stack(aCx), stackGlobal(aCx);
|
||||
xpc::FindExceptionStackForConsoleReport(nullptr, exn, exnStack, &stack, &stackGlobal);
|
||||
xpc::FindExceptionStackForConsoleReport(nullptr, exn, exnStack, &stack,
|
||||
&stackGlobal);
|
||||
|
||||
if (stack) {
|
||||
JS::RootedValue stackValue(aCx, JS::ObjectValue(*stack));
|
||||
@ -4091,8 +4092,8 @@ void WorkerPrivate::ReportError(JSContext* aCx,
|
||||
report->mErrorNumber != JSMSG_OUT_OF_MEMORY &&
|
||||
JS::CurrentGlobalOrNull(aCx);
|
||||
|
||||
WorkerErrorReport::ReportError(aCx, this, fireAtScope,
|
||||
nullptr, std::move(report), 0, exn);
|
||||
WorkerErrorReport::ReportError(aCx, this, fireAtScope, nullptr,
|
||||
std::move(report), 0, exn);
|
||||
|
||||
data->mErrorHandlerRecursionCount--;
|
||||
}
|
||||
|
@ -218,9 +218,8 @@ void SharedWorkerService::GetOrCreateWorkerManagerOnMainThread(
|
||||
MOZ_ASSERT(aBackgroundEventTarget);
|
||||
MOZ_ASSERT(aActor);
|
||||
|
||||
auto closeMessagePortIdentifier = MakeScopeExit([&] {
|
||||
MessagePort::ForceClose(aPortIdentifier);
|
||||
});
|
||||
auto closeMessagePortIdentifier =
|
||||
MakeScopeExit([&] { MessagePort::ForceClose(aPortIdentifier); });
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIPrincipal> storagePrincipal =
|
||||
|
@ -2880,13 +2880,15 @@ void GLContext::AfterGLCall_Debug(const char* const funcName) const {
|
||||
|
||||
if (err && !mLocalErrorScopeStack.size()) {
|
||||
const auto errStr = GLErrorToString(err);
|
||||
const auto text = nsPrintfCString("%s: Generated unexpected %s error", funcName, errStr.c_str());
|
||||
const auto text = nsPrintfCString("%s: Generated unexpected %s error",
|
||||
funcName, errStr.c_str());
|
||||
printf_stderr("[gl:%p] %s.\n", this, text.BeginReading());
|
||||
|
||||
const bool abortOnError = mDebugFlags & DebugFlagAbortOnError;
|
||||
if (abortOnError && err != LOCAL_GL_CONTEXT_LOST) {
|
||||
gfxCriticalErrorOnce() << text.BeginReading();
|
||||
MOZ_CRASH("Aborting... (Run with MOZ_GL_DEBUG_ABORT_ON_ERROR=0 to disable)");
|
||||
MOZ_CRASH(
|
||||
"Aborting... (Run with MOZ_GL_DEBUG_ABORT_ON_ERROR=0 to disable)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -714,7 +714,8 @@ void APZCTreeManager::SampleForWebRender(wr::TransactionWrapper& aTxn,
|
||||
controller = aState.GetCompositorController();
|
||||
});
|
||||
if (controller) {
|
||||
controller->ScheduleRenderOnCompositorThread(wr::RenderRootSet(aRenderRoot));
|
||||
controller->ScheduleRenderOnCompositorThread(
|
||||
wr::RenderRootSet(aRenderRoot));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,9 +40,13 @@ CanvasLayerComposite::~CanvasLayerComposite() {
|
||||
|
||||
bool CanvasLayerComposite::SetCompositableHost(CompositableHost* aHost) {
|
||||
switch (aHost->GetType()) {
|
||||
case CompositableType::IMAGE:
|
||||
case CompositableType::IMAGE: {
|
||||
if (mCompositableHost && aHost != mCompositableHost) {
|
||||
mCompositableHost->Detach(this);
|
||||
}
|
||||
mCompositableHost = aHost;
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -47,9 +47,14 @@ ImageLayerComposite::~ImageLayerComposite() {
|
||||
|
||||
bool ImageLayerComposite::SetCompositableHost(CompositableHost* aHost) {
|
||||
switch (aHost->GetType()) {
|
||||
case CompositableType::IMAGE:
|
||||
mImageHost = static_cast<ImageHost*>(aHost);
|
||||
case CompositableType::IMAGE: {
|
||||
ImageHost* newImageHost = static_cast<ImageHost*>(aHost);
|
||||
if (mImageHost && newImageHost != mImageHost) {
|
||||
mImageHost->Detach(this);
|
||||
}
|
||||
mImageHost = newImageHost;
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -47,9 +47,14 @@ bool PaintedLayerComposite::SetCompositableHost(CompositableHost* aHost) {
|
||||
switch (aHost->GetType()) {
|
||||
case CompositableType::CONTENT_TILED:
|
||||
case CompositableType::CONTENT_SINGLE:
|
||||
case CompositableType::CONTENT_DOUBLE:
|
||||
mBuffer = static_cast<ContentHost*>(aHost);
|
||||
case CompositableType::CONTENT_DOUBLE: {
|
||||
ContentHost* newBuffer = static_cast<ContentHost*>(aHost);
|
||||
if (mBuffer && newBuffer != mBuffer) {
|
||||
mBuffer->Detach(this);
|
||||
}
|
||||
mBuffer = newBuffer;
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -436,8 +436,8 @@ class CompositorBridgeParent final : public CompositorBridgeParentBase,
|
||||
bool ScheduleResumeOnCompositorThread();
|
||||
bool ScheduleResumeOnCompositorThread(int x, int y, int width, int height);
|
||||
|
||||
void ScheduleComposition(const wr::RenderRootSet& aRenderRoots =
|
||||
wr::RenderRootSet());
|
||||
void ScheduleComposition(
|
||||
const wr::RenderRootSet& aRenderRoots = wr::RenderRootSet());
|
||||
|
||||
void NotifyShadowTreeTransaction(LayersId aId, bool aIsFirstPaint,
|
||||
const FocusTarget& aFocusTarget,
|
||||
|
@ -184,7 +184,7 @@ bool CompositorVsyncScheduler::NotifyVsync(const VsyncEvent& aVsync) {
|
||||
}
|
||||
#else
|
||||
PostCompositeTask(aVsync.mId, aVsync.mTime);
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
|
||||
PostVRTask(aVsync.mTime);
|
||||
return true;
|
||||
|
@ -65,12 +65,16 @@ bool PaintedLayerMLGPU::SetCompositableHost(CompositableHost* aHost) {
|
||||
switch (aHost->GetType()) {
|
||||
case CompositableType::CONTENT_TILED:
|
||||
case CompositableType::CONTENT_SINGLE:
|
||||
case CompositableType::CONTENT_DOUBLE:
|
||||
case CompositableType::CONTENT_DOUBLE: {
|
||||
if (mHost && mHost != aHost->AsContentHost()) {
|
||||
mHost->Detach(this);
|
||||
}
|
||||
mHost = aHost->AsContentHost();
|
||||
if (!mHost) {
|
||||
gfxWarning() << "ContentHostBase is not a ContentHostTexture";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -898,7 +898,7 @@ static already_AddRefed<gl::GLContext> CreateGLContext() {
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
return CreateGLContextEGL();
|
||||
return CreateGLContextEGL();
|
||||
#elif defined(MOZ_WAYLAND)
|
||||
if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
return CreateGLContextEGL();
|
||||
|
@ -374,7 +374,8 @@ void WebRenderAPI::SendTransactions(
|
||||
return;
|
||||
}
|
||||
|
||||
aApis[RenderRoot::Default]->UpdateDebugFlags(gfx::gfxVars::WebRenderDebugFlags());
|
||||
aApis[RenderRoot::Default]->UpdateDebugFlags(
|
||||
gfx::gfxVars::WebRenderDebugFlags());
|
||||
AutoTArray<DocumentHandle*, kRenderRootCount> documentHandles;
|
||||
AutoTArray<Transaction*, kRenderRootCount> txns;
|
||||
Maybe<bool> useSceneBuilderThread;
|
||||
|
@ -209,8 +209,9 @@ class WebRenderAPI final {
|
||||
RefPtr<widget::CompositorWidget>&& aWidget,
|
||||
const wr::WrWindowId& aWindowId, LayoutDeviceIntSize aSize);
|
||||
|
||||
static void SendTransactions(const RenderRootArray<RefPtr<WebRenderAPI>>& aApis,
|
||||
RenderRootArray<TransactionBuilder*>& aTxns);
|
||||
static void SendTransactions(
|
||||
const RenderRootArray<RefPtr<WebRenderAPI>>& aApis,
|
||||
RenderRootArray<TransactionBuilder*>& aTxns);
|
||||
|
||||
already_AddRefed<WebRenderAPI> CreateDocument(LayoutDeviceIntSize aSize,
|
||||
int8_t aLayerIndex,
|
||||
|
@ -115,9 +115,9 @@ struct MapTypeToTraceKind {
|
||||
inline constexpr bool IsCCTraceKind(JS::TraceKind aKind) {
|
||||
switch (aKind) {
|
||||
#define JS_EXPAND_DEF(name, _1, _2, inCCGraph) \
|
||||
case JS::TraceKind::name: \
|
||||
return inCCGraph;
|
||||
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
|
||||
case JS::TraceKind::name: \
|
||||
return inCCGraph;
|
||||
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
|
||||
#undef JS_EXPAND_DEF
|
||||
default:
|
||||
return false;
|
||||
@ -222,7 +222,7 @@ struct MapTypeToRootKind<JSFunction*> : public MapTypeToRootKind<JSObject*> {};
|
||||
template <typename F, typename... Args>
|
||||
auto DispatchTraceKindTyped(F f, JS::TraceKind traceKind, Args&&... args) {
|
||||
switch (traceKind) {
|
||||
#define JS_EXPAND_DEF(name, type, _, _1) \
|
||||
#define JS_EXPAND_DEF(name, type, _, _1) \
|
||||
case JS::TraceKind::name: \
|
||||
return f.JS_DEPENDENT_TEMPLATE_HINT operator()<type>( \
|
||||
std::forward<Args>(args)...);
|
||||
@ -241,7 +241,7 @@ template <typename F>
|
||||
auto MapGCThingTyped(void* thing, JS::TraceKind traceKind, F&& f) {
|
||||
switch (traceKind) {
|
||||
#define JS_EXPAND_DEF(name, type, _, _1) \
|
||||
case JS::TraceKind::name: \
|
||||
case JS::TraceKind::name: \
|
||||
return f(static_cast<type*>(thing));
|
||||
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
|
||||
#undef JS_EXPAND_DEF
|
||||
|
@ -77,88 +77,88 @@ namespace JS {
|
||||
// Ordering is important below. All outcomes before GenericSuccess will be
|
||||
// considered failures, and all outcomes after GenericSuccess will be
|
||||
// considered successes.
|
||||
#define TRACKED_OUTCOME_LIST(_) \
|
||||
_(GenericFailure) \
|
||||
_(Disabled) \
|
||||
_(NoTypeInfo) \
|
||||
_(NoShapeInfo) \
|
||||
_(UnknownProperties) \
|
||||
_(Singleton) \
|
||||
_(NotSingleton) \
|
||||
_(NotFixedSlot) \
|
||||
_(InconsistentFixedSlot) \
|
||||
_(NotObject) \
|
||||
_(NotStruct) \
|
||||
_(NotUndefined) \
|
||||
_(StructNoField) \
|
||||
_(NeedsTypeBarrier) \
|
||||
_(InDictionaryMode) \
|
||||
_(MultiProtoPaths) \
|
||||
_(NonWritableProperty) \
|
||||
_(ProtoIndexedProps) \
|
||||
_(ArrayBadFlags) \
|
||||
_(ArrayDoubleConversion) \
|
||||
_(ArrayRange) \
|
||||
_(ArraySeenNegativeIndex) \
|
||||
_(ArraySeenNonIntegerIndex) \
|
||||
_(TypedObjectHasDetachedBuffer) \
|
||||
_(TypedObjectArrayRange) \
|
||||
_(AccessNotDense) \
|
||||
_(AccessNotTypedObject) \
|
||||
_(AccessNotTypedArray) \
|
||||
_(AccessNotString) \
|
||||
_(OperandNotString) \
|
||||
_(OperandNotNumber) \
|
||||
_(OperandNotSimpleArith) \
|
||||
_(OperandNotEasilyCoercibleToString) \
|
||||
_(OutOfBounds) \
|
||||
_(IndexType) \
|
||||
_(NotModuleNamespace) \
|
||||
_(UnknownProperty) \
|
||||
_(NoTemplateObject) \
|
||||
_(LengthTooBig) \
|
||||
_(SpeculationOnInputTypesFailed) \
|
||||
_(RelationalCompare) \
|
||||
_(OperandTypeNotBitwiseComparable) \
|
||||
_(OperandMaybeEmulatesUndefined) \
|
||||
_(LoosyUndefinedNullCompare) \
|
||||
_(LoosyInt32BooleanCompare) \
|
||||
_(CallsValueOf) \
|
||||
_(StrictCompare) \
|
||||
_(InitHole) \
|
||||
\
|
||||
_(CantInlineGeneric) \
|
||||
_(CantInlineNoTarget) \
|
||||
_(CantInlineNotInterpreted) \
|
||||
_(CantInlineNoBaseline) \
|
||||
_(CantInlineLazy) \
|
||||
_(CantInlineNotConstructor) \
|
||||
_(CantInlineClassConstructor) \
|
||||
_(CantInlineDisabledIon) \
|
||||
_(CantInlineTooManyArgs) \
|
||||
_(CantInlineNeedsArgsObj) \
|
||||
_(CantInlineDebuggee) \
|
||||
_(CantInlineExceededDepth) \
|
||||
_(CantInlineExceededTotalBytecodeLength) \
|
||||
_(CantInlineBigCaller) \
|
||||
_(CantInlineBigCallee) \
|
||||
_(CantInlineBigCalleeInlinedBytecodeLength) \
|
||||
_(CantInlineCrossRealm) \
|
||||
_(CantInlineNotHot) \
|
||||
_(CantInlineNotInDispatch) \
|
||||
_(CantInlineUnreachable) \
|
||||
_(CantInlineNativeBadForm) \
|
||||
_(CantInlineNativeBadType) \
|
||||
_(CantInlineNativeNoTemplateObj) \
|
||||
_(CantInlineBound) \
|
||||
_(CantInlineNativeNoSpecialization) \
|
||||
_(CantInlineUnexpectedNewTarget) \
|
||||
_(HasCommonInliningPath) \
|
||||
\
|
||||
_(GenericSuccess) \
|
||||
_(Inlined) \
|
||||
_(DOM) \
|
||||
_(Monomorphic) \
|
||||
#define TRACKED_OUTCOME_LIST(_) \
|
||||
_(GenericFailure) \
|
||||
_(Disabled) \
|
||||
_(NoTypeInfo) \
|
||||
_(NoShapeInfo) \
|
||||
_(UnknownProperties) \
|
||||
_(Singleton) \
|
||||
_(NotSingleton) \
|
||||
_(NotFixedSlot) \
|
||||
_(InconsistentFixedSlot) \
|
||||
_(NotObject) \
|
||||
_(NotStruct) \
|
||||
_(NotUndefined) \
|
||||
_(StructNoField) \
|
||||
_(NeedsTypeBarrier) \
|
||||
_(InDictionaryMode) \
|
||||
_(MultiProtoPaths) \
|
||||
_(NonWritableProperty) \
|
||||
_(ProtoIndexedProps) \
|
||||
_(ArrayBadFlags) \
|
||||
_(ArrayDoubleConversion) \
|
||||
_(ArrayRange) \
|
||||
_(ArraySeenNegativeIndex) \
|
||||
_(ArraySeenNonIntegerIndex) \
|
||||
_(TypedObjectHasDetachedBuffer) \
|
||||
_(TypedObjectArrayRange) \
|
||||
_(AccessNotDense) \
|
||||
_(AccessNotTypedObject) \
|
||||
_(AccessNotTypedArray) \
|
||||
_(AccessNotString) \
|
||||
_(OperandNotString) \
|
||||
_(OperandNotNumber) \
|
||||
_(OperandNotSimpleArith) \
|
||||
_(OperandNotEasilyCoercibleToString) \
|
||||
_(OutOfBounds) \
|
||||
_(IndexType) \
|
||||
_(NotModuleNamespace) \
|
||||
_(UnknownProperty) \
|
||||
_(NoTemplateObject) \
|
||||
_(LengthTooBig) \
|
||||
_(SpeculationOnInputTypesFailed) \
|
||||
_(RelationalCompare) \
|
||||
_(OperandTypeNotBitwiseComparable) \
|
||||
_(OperandMaybeEmulatesUndefined) \
|
||||
_(LoosyUndefinedNullCompare) \
|
||||
_(LoosyInt32BooleanCompare) \
|
||||
_(CallsValueOf) \
|
||||
_(StrictCompare) \
|
||||
_(InitHole) \
|
||||
\
|
||||
_(CantInlineGeneric) \
|
||||
_(CantInlineNoTarget) \
|
||||
_(CantInlineNotInterpreted) \
|
||||
_(CantInlineNoBaseline) \
|
||||
_(CantInlineLazy) \
|
||||
_(CantInlineNotConstructor) \
|
||||
_(CantInlineClassConstructor) \
|
||||
_(CantInlineDisabledIon) \
|
||||
_(CantInlineTooManyArgs) \
|
||||
_(CantInlineNeedsArgsObj) \
|
||||
_(CantInlineDebuggee) \
|
||||
_(CantInlineExceededDepth) \
|
||||
_(CantInlineExceededTotalBytecodeLength) \
|
||||
_(CantInlineBigCaller) \
|
||||
_(CantInlineBigCallee) \
|
||||
_(CantInlineBigCalleeInlinedBytecodeLength) \
|
||||
_(CantInlineCrossRealm) \
|
||||
_(CantInlineNotHot) \
|
||||
_(CantInlineNotInDispatch) \
|
||||
_(CantInlineUnreachable) \
|
||||
_(CantInlineNativeBadForm) \
|
||||
_(CantInlineNativeBadType) \
|
||||
_(CantInlineNativeNoTemplateObj) \
|
||||
_(CantInlineBound) \
|
||||
_(CantInlineNativeNoSpecialization) \
|
||||
_(CantInlineUnexpectedNewTarget) \
|
||||
_(HasCommonInliningPath) \
|
||||
\
|
||||
_(GenericSuccess) \
|
||||
_(Inlined) \
|
||||
_(DOM) \
|
||||
_(Monomorphic) \
|
||||
_(Polymorphic)
|
||||
|
||||
#define TRACKED_TYPESITE_LIST(_) \
|
||||
|
@ -62,6 +62,7 @@
|
||||
#include "jit/InlinableNatives.h"
|
||||
#include "js/Class.h"
|
||||
#include "js/PropertySpec.h"
|
||||
#include "js/Result.h"
|
||||
#include "vm/GlobalObject.h"
|
||||
#include "vm/Time.h"
|
||||
#include "vm/TypedArrayObject.h"
|
||||
@ -116,68 +117,42 @@ static bool GetTypedArrayIndex(JSContext* cx, HandleValue v,
|
||||
return true;
|
||||
}
|
||||
|
||||
static int32_t CompareExchange(Scalar::Type viewType, int32_t oldCandidate,
|
||||
int32_t newCandidate, SharedMem<void*> viewData,
|
||||
uint32_t offset, bool* badArrayType = nullptr) {
|
||||
switch (viewType) {
|
||||
case Scalar::Int8: {
|
||||
int8_t oldval = (int8_t)oldCandidate;
|
||||
int8_t newval = (int8_t)newCandidate;
|
||||
oldval = jit::AtomicOperations::compareExchangeSeqCst(
|
||||
viewData.cast<int8_t*>() + offset, oldval, newval);
|
||||
return oldval;
|
||||
template <typename T>
|
||||
struct ArrayOps {
|
||||
static JS::Result<T> convertValue(JSContext* cx, HandleValue v) {
|
||||
int32_t n;
|
||||
if (!ToInt32(cx, v, &n)) {
|
||||
return cx->alreadyReportedError();
|
||||
}
|
||||
case Scalar::Uint8: {
|
||||
uint8_t oldval = (uint8_t)oldCandidate;
|
||||
uint8_t newval = (uint8_t)newCandidate;
|
||||
oldval = jit::AtomicOperations::compareExchangeSeqCst(
|
||||
viewData.cast<uint8_t*>() + offset, oldval, newval);
|
||||
return oldval;
|
||||
}
|
||||
case Scalar::Int16: {
|
||||
int16_t oldval = (int16_t)oldCandidate;
|
||||
int16_t newval = (int16_t)newCandidate;
|
||||
oldval = jit::AtomicOperations::compareExchangeSeqCst(
|
||||
viewData.cast<int16_t*>() + offset, oldval, newval);
|
||||
return oldval;
|
||||
}
|
||||
case Scalar::Uint16: {
|
||||
uint16_t oldval = (uint16_t)oldCandidate;
|
||||
uint16_t newval = (uint16_t)newCandidate;
|
||||
oldval = jit::AtomicOperations::compareExchangeSeqCst(
|
||||
viewData.cast<uint16_t*>() + offset, oldval, newval);
|
||||
return oldval;
|
||||
}
|
||||
case Scalar::Int32: {
|
||||
int32_t oldval = oldCandidate;
|
||||
int32_t newval = newCandidate;
|
||||
oldval = jit::AtomicOperations::compareExchangeSeqCst(
|
||||
viewData.cast<int32_t*>() + offset, oldval, newval);
|
||||
return oldval;
|
||||
}
|
||||
case Scalar::Uint32: {
|
||||
uint32_t oldval = (uint32_t)oldCandidate;
|
||||
uint32_t newval = (uint32_t)newCandidate;
|
||||
oldval = jit::AtomicOperations::compareExchangeSeqCst(
|
||||
viewData.cast<uint32_t*>() + offset, oldval, newval);
|
||||
return (int32_t)oldval;
|
||||
}
|
||||
default:
|
||||
if (badArrayType) {
|
||||
*badArrayType = true;
|
||||
}
|
||||
return 0;
|
||||
return (T)n;
|
||||
}
|
||||
|
||||
static JS::Result<T> convertValue(JSContext* cx, HandleValue v,
|
||||
MutableHandleValue result) {
|
||||
double d;
|
||||
if (!ToInteger(cx, v, &d)) {
|
||||
return cx->alreadyReportedError();
|
||||
}
|
||||
result.setNumber(d);
|
||||
return (T)JS::ToInt32(d);
|
||||
}
|
||||
|
||||
static JS::Result<> storeResult(JSContext* cx, T v,
|
||||
MutableHandleValue result) {
|
||||
result.setInt32(v);
|
||||
return Ok();
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
JS::Result<> ArrayOps<uint32_t>::storeResult(JSContext* cx, uint32_t v,
|
||||
MutableHandleValue result) {
|
||||
result.setNumber(v);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
bool js::atomics_compareExchange(JSContext* cx, unsigned argc, Value* vp) {
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
HandleValue objv = args.get(0);
|
||||
HandleValue idxv = args.get(1);
|
||||
HandleValue oldv = args.get(2);
|
||||
HandleValue newv = args.get(3);
|
||||
MutableHandleValue r = args.rval();
|
||||
|
||||
template <template <typename> class F, typename... Args>
|
||||
bool perform(JSContext* cx, HandleValue objv, HandleValue idxv, Args... args) {
|
||||
Rooted<TypedArrayObject*> view(cx, nullptr);
|
||||
if (!GetSharedTypedArray(cx, objv, &view)) {
|
||||
return false;
|
||||
@ -186,242 +161,130 @@ bool js::atomics_compareExchange(JSContext* cx, unsigned argc, Value* vp) {
|
||||
if (!GetTypedArrayIndex(cx, idxv, view, &offset)) {
|
||||
return false;
|
||||
}
|
||||
int32_t oldCandidate;
|
||||
if (!ToInt32(cx, oldv, &oldCandidate)) {
|
||||
return false;
|
||||
}
|
||||
int32_t newCandidate;
|
||||
if (!ToInt32(cx, newv, &newCandidate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool badType = false;
|
||||
int32_t result = CompareExchange(view->type(), oldCandidate, newCandidate,
|
||||
view->dataPointerShared(), offset, &badType);
|
||||
|
||||
if (badType) {
|
||||
return ReportBadArrayType(cx);
|
||||
}
|
||||
|
||||
if (view->type() == Scalar::Uint32) {
|
||||
r.setNumber((double)(uint32_t)result);
|
||||
} else {
|
||||
r.setInt32(result);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool js::atomics_load(JSContext* cx, unsigned argc, Value* vp) {
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
HandleValue objv = args.get(0);
|
||||
HandleValue idxv = args.get(1);
|
||||
MutableHandleValue r = args.rval();
|
||||
|
||||
Rooted<TypedArrayObject*> view(cx, nullptr);
|
||||
if (!GetSharedTypedArray(cx, objv, &view)) {
|
||||
return false;
|
||||
}
|
||||
uint32_t offset;
|
||||
if (!GetTypedArrayIndex(cx, idxv, view, &offset)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SharedMem<void*> viewData = view->dataPointerShared();
|
||||
switch (view->type()) {
|
||||
case Scalar::Uint8: {
|
||||
uint8_t v =
|
||||
jit::AtomicOperations::loadSeqCst(viewData.cast<uint8_t*>() + offset);
|
||||
r.setInt32(v);
|
||||
return true;
|
||||
}
|
||||
case Scalar::Int8: {
|
||||
int8_t v =
|
||||
jit::AtomicOperations::loadSeqCst(viewData.cast<uint8_t*>() + offset);
|
||||
r.setInt32(v);
|
||||
return true;
|
||||
}
|
||||
case Scalar::Int16: {
|
||||
int16_t v =
|
||||
jit::AtomicOperations::loadSeqCst(viewData.cast<int16_t*>() + offset);
|
||||
r.setInt32(v);
|
||||
return true;
|
||||
}
|
||||
case Scalar::Uint16: {
|
||||
uint16_t v = jit::AtomicOperations::loadSeqCst(
|
||||
viewData.cast<uint16_t*>() + offset);
|
||||
r.setInt32(v);
|
||||
return true;
|
||||
}
|
||||
case Scalar::Int32: {
|
||||
int32_t v =
|
||||
jit::AtomicOperations::loadSeqCst(viewData.cast<int32_t*>() + offset);
|
||||
r.setInt32(v);
|
||||
return true;
|
||||
}
|
||||
case Scalar::Uint32: {
|
||||
uint32_t v = jit::AtomicOperations::loadSeqCst(
|
||||
viewData.cast<uint32_t*>() + offset);
|
||||
r.setNumber(v);
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
case Scalar::Int8:
|
||||
return F<int8_t>::run(cx, viewData.cast<int8_t*>() + offset, args...);
|
||||
case Scalar::Uint8:
|
||||
return F<uint8_t>::run(cx, viewData.cast<uint8_t*>() + offset, args...);
|
||||
case Scalar::Int16:
|
||||
return F<int16_t>::run(cx, viewData.cast<int16_t*>() + offset, args...);
|
||||
case Scalar::Uint16:
|
||||
return F<uint16_t>::run(cx, viewData.cast<uint16_t*>() + offset, args...);
|
||||
case Scalar::Int32:
|
||||
return F<int32_t>::run(cx, viewData.cast<int32_t*>() + offset, args...);
|
||||
case Scalar::Uint32:
|
||||
return F<uint32_t>::run(cx, viewData.cast<uint32_t*>() + offset, args...);
|
||||
case Scalar::Float32:
|
||||
case Scalar::Float64:
|
||||
case Scalar::Uint8Clamped:
|
||||
case Scalar::BigInt64:
|
||||
case Scalar::BigUint64:
|
||||
return ReportBadArrayType(cx);
|
||||
case Scalar::MaxTypedArrayViewType:
|
||||
case Scalar::Int64:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
enum XchgStoreOp { DoExchange, DoStore };
|
||||
|
||||
template <XchgStoreOp op>
|
||||
static int32_t ExchangeOrStore(Scalar::Type viewType, int32_t numberValue,
|
||||
SharedMem<void*> viewData, uint32_t offset,
|
||||
bool* badArrayType = nullptr) {
|
||||
#define INT_OP(ptr, value) \
|
||||
JS_BEGIN_MACRO \
|
||||
if (op == DoStore) \
|
||||
jit::AtomicOperations::storeSeqCst(ptr, value); \
|
||||
else \
|
||||
value = jit::AtomicOperations::exchangeSeqCst(ptr, value); \
|
||||
JS_END_MACRO
|
||||
|
||||
switch (viewType) {
|
||||
case Scalar::Int8: {
|
||||
int8_t value = (int8_t)numberValue;
|
||||
INT_OP(viewData.cast<int8_t*>() + offset, value);
|
||||
return value;
|
||||
}
|
||||
case Scalar::Uint8: {
|
||||
uint8_t value = (uint8_t)numberValue;
|
||||
INT_OP(viewData.cast<uint8_t*>() + offset, value);
|
||||
return value;
|
||||
}
|
||||
case Scalar::Int16: {
|
||||
int16_t value = (int16_t)numberValue;
|
||||
INT_OP(viewData.cast<int16_t*>() + offset, value);
|
||||
return value;
|
||||
}
|
||||
case Scalar::Uint16: {
|
||||
uint16_t value = (uint16_t)numberValue;
|
||||
INT_OP(viewData.cast<uint16_t*>() + offset, value);
|
||||
return value;
|
||||
}
|
||||
case Scalar::Int32: {
|
||||
int32_t value = numberValue;
|
||||
INT_OP(viewData.cast<int32_t*>() + offset, value);
|
||||
return value;
|
||||
}
|
||||
case Scalar::Uint32: {
|
||||
uint32_t value = (uint32_t)numberValue;
|
||||
INT_OP(viewData.cast<uint32_t*>() + offset, value);
|
||||
return (int32_t)value;
|
||||
}
|
||||
default:
|
||||
if (badArrayType) {
|
||||
*badArrayType = true;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#undef INT_OP
|
||||
}
|
||||
|
||||
template <XchgStoreOp op>
|
||||
static bool ExchangeOrStore(JSContext* cx, unsigned argc, Value* vp) {
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
HandleValue objv = args.get(0);
|
||||
HandleValue idxv = args.get(1);
|
||||
HandleValue valv = args.get(2);
|
||||
MutableHandleValue r = args.rval();
|
||||
|
||||
Rooted<TypedArrayObject*> view(cx, nullptr);
|
||||
if (!GetSharedTypedArray(cx, objv, &view)) {
|
||||
return false;
|
||||
}
|
||||
uint32_t offset;
|
||||
if (!GetTypedArrayIndex(cx, idxv, view, &offset)) {
|
||||
return false;
|
||||
}
|
||||
double integerValue;
|
||||
if (!ToInteger(cx, valv, &integerValue)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool badType = false;
|
||||
int32_t result =
|
||||
ExchangeOrStore<op>(view->type(), JS::ToInt32(integerValue),
|
||||
view->dataPointerShared(), offset, &badType);
|
||||
|
||||
if (badType) {
|
||||
return ReportBadArrayType(cx);
|
||||
}
|
||||
|
||||
if (op == DoStore) {
|
||||
r.setNumber(integerValue);
|
||||
} else if (view->type() == Scalar::Uint32) {
|
||||
r.setNumber((double)(uint32_t)result);
|
||||
} else {
|
||||
r.setInt32(result);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool js::atomics_store(JSContext* cx, unsigned argc, Value* vp) {
|
||||
return ExchangeOrStore<DoStore>(cx, argc, vp);
|
||||
}
|
||||
|
||||
bool js::atomics_exchange(JSContext* cx, unsigned argc, Value* vp) {
|
||||
return ExchangeOrStore<DoExchange>(cx, argc, vp);
|
||||
MOZ_CRASH("Unsupported TypedArray type");
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct DoCompareExchange {
|
||||
static bool run(JSContext* cx, SharedMem<T*> addr, HandleValue oldv,
|
||||
HandleValue newv, MutableHandleValue result) {
|
||||
using Ops = ArrayOps<T>;
|
||||
T oldval;
|
||||
JS_TRY_VAR_OR_RETURN_FALSE(cx, oldval, Ops::convertValue(cx, oldv));
|
||||
T newval;
|
||||
JS_TRY_VAR_OR_RETURN_FALSE(cx, newval, Ops::convertValue(cx, newv));
|
||||
|
||||
oldval = jit::AtomicOperations::compareExchangeSeqCst(addr, oldval, newval);
|
||||
|
||||
JS_TRY_OR_RETURN_FALSE(cx, Ops::storeResult(cx, oldval, result));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool js::atomics_compareExchange(JSContext* cx, unsigned argc, Value* vp) {
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
return perform<DoCompareExchange>(cx, args.get(0), args.get(1), args.get(2),
|
||||
args.get(3), args.rval());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct DoLoad {
|
||||
static bool run(JSContext* cx, SharedMem<T*> addr,
|
||||
MutableHandleValue result) {
|
||||
using Ops = ArrayOps<T>;
|
||||
T v = jit::AtomicOperations::loadSeqCst(addr);
|
||||
JS_TRY_OR_RETURN_FALSE(cx, Ops::storeResult(cx, v, result));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool js::atomics_load(JSContext* cx, unsigned argc, Value* vp) {
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
return perform<DoLoad>(cx, args.get(0), args.get(1), args.rval());
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct DoExchange {
|
||||
static bool run(JSContext* cx, SharedMem<T*> addr, HandleValue valv,
|
||||
MutableHandleValue result) {
|
||||
using Ops = ArrayOps<T>;
|
||||
T value;
|
||||
JS_TRY_VAR_OR_RETURN_FALSE(cx, value, Ops::convertValue(cx, valv));
|
||||
value = jit::AtomicOperations::exchangeSeqCst(addr, value);
|
||||
JS_TRY_OR_RETURN_FALSE(cx, Ops::storeResult(cx, value, result));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct DoStore {
|
||||
static bool run(JSContext* cx, SharedMem<T*> addr, HandleValue valv,
|
||||
MutableHandleValue result) {
|
||||
using Ops = ArrayOps<T>;
|
||||
T value;
|
||||
JS_TRY_VAR_OR_RETURN_FALSE(cx, value, Ops::convertValue(cx, valv, result));
|
||||
jit::AtomicOperations::storeSeqCst(addr, value);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
bool js::atomics_store(JSContext* cx, unsigned argc, Value* vp) {
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
return perform<DoStore>(cx, args.get(0), args.get(1), args.get(2),
|
||||
args.rval());
|
||||
}
|
||||
|
||||
bool js::atomics_exchange(JSContext* cx, unsigned argc, Value* vp) {
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
return perform<DoExchange>(cx, args.get(0), args.get(1), args.get(2),
|
||||
args.rval());
|
||||
}
|
||||
|
||||
template <typename Operate>
|
||||
struct DoBinopWithOperation {
|
||||
template <typename T>
|
||||
struct DoBinop {
|
||||
static bool run(JSContext* cx, SharedMem<T*> addr, HandleValue valv,
|
||||
MutableHandleValue result) {
|
||||
using Ops = ArrayOps<T>;
|
||||
T v;
|
||||
JS_TRY_VAR_OR_RETURN_FALSE(cx, v, Ops::convertValue(cx, valv));
|
||||
v = Operate::operate(addr, v);
|
||||
JS_TRY_OR_RETURN_FALSE(cx, Ops::storeResult(cx, v, result));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template <typename Operate>
|
||||
static bool AtomicsBinop(JSContext* cx, HandleValue objv, HandleValue idxv,
|
||||
HandleValue valv, MutableHandleValue r) {
|
||||
Rooted<TypedArrayObject*> view(cx, nullptr);
|
||||
if (!GetSharedTypedArray(cx, objv, &view)) {
|
||||
return false;
|
||||
}
|
||||
uint32_t offset;
|
||||
if (!GetTypedArrayIndex(cx, idxv, view, &offset)) {
|
||||
return false;
|
||||
}
|
||||
int32_t numberValue;
|
||||
if (!ToInt32(cx, valv, &numberValue)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SharedMem<void*> viewData = view->dataPointerShared();
|
||||
switch (view->type()) {
|
||||
case Scalar::Int8: {
|
||||
int8_t v = (int8_t)numberValue;
|
||||
r.setInt32(T::operate(viewData.cast<int8_t*>() + offset, v));
|
||||
return true;
|
||||
}
|
||||
case Scalar::Uint8: {
|
||||
uint8_t v = (uint8_t)numberValue;
|
||||
r.setInt32(T::operate(viewData.cast<uint8_t*>() + offset, v));
|
||||
return true;
|
||||
}
|
||||
case Scalar::Int16: {
|
||||
int16_t v = (int16_t)numberValue;
|
||||
r.setInt32(T::operate(viewData.cast<int16_t*>() + offset, v));
|
||||
return true;
|
||||
}
|
||||
case Scalar::Uint16: {
|
||||
uint16_t v = (uint16_t)numberValue;
|
||||
r.setInt32(T::operate(viewData.cast<uint16_t*>() + offset, v));
|
||||
return true;
|
||||
}
|
||||
case Scalar::Int32: {
|
||||
int32_t v = numberValue;
|
||||
r.setInt32(T::operate(viewData.cast<int32_t*>() + offset, v));
|
||||
return true;
|
||||
}
|
||||
case Scalar::Uint32: {
|
||||
uint32_t v = (uint32_t)numberValue;
|
||||
r.setNumber((double)T::operate(viewData.cast<uint32_t*>() + offset, v));
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return ReportBadArrayType(cx);
|
||||
}
|
||||
return perform<DoBinopWithOperation<Operate>::template DoBinop>(
|
||||
cx, objv, idxv, valv, r);
|
||||
}
|
||||
|
||||
#define INTEGRAL_TYPES_FOR_EACH(NAME) \
|
||||
|
@ -925,10 +925,10 @@ namespace {
|
||||
|
||||
template <typename T>
|
||||
struct TraceKindCanBeGray {};
|
||||
#define EXPAND_TRACEKIND_DEF(_, type, canBeGray, _1) \
|
||||
template <> \
|
||||
struct TraceKindCanBeGray<type> { \
|
||||
static const bool value = canBeGray; \
|
||||
#define EXPAND_TRACEKIND_DEF(_, type, canBeGray, _1) \
|
||||
template <> \
|
||||
struct TraceKindCanBeGray<type> { \
|
||||
static const bool value = canBeGray; \
|
||||
};
|
||||
JS_FOR_EACH_TRACEKIND(EXPAND_TRACEKIND_DEF)
|
||||
#undef EXPAND_TRACEKIND_DEF
|
||||
@ -1260,9 +1260,7 @@ void WasmFunctionScope::Data::trace(JSTracer* trc) {
|
||||
void Scope::traceChildren(JSTracer* trc) {
|
||||
TraceNullableEdge(trc, &enclosing_, "scope enclosing");
|
||||
TraceNullableEdge(trc, &environmentShape_, "scope env shape");
|
||||
applyScopeDataTyped([trc](auto data) {
|
||||
data->trace(trc);
|
||||
});
|
||||
applyScopeDataTyped([trc](auto data) { data->trace(trc); });
|
||||
}
|
||||
inline void js::GCMarker::eagerlyMarkChildren(Scope* scope) {
|
||||
do {
|
||||
@ -3325,7 +3323,8 @@ FOR_EACH_PUBLIC_TAGGED_GC_POINTER_TYPE(
|
||||
template bool IsMarkedBlackInternal(JSRuntime* rt, type* thing); \
|
||||
template bool IsAboutToBeFinalizedInternal(type* thingp);
|
||||
|
||||
#define INSTANTIATE_INTERNAL_MARKING_FUNCTIONS_FROM_TRACEKIND(_1, type, _2, _3) \
|
||||
#define INSTANTIATE_INTERNAL_MARKING_FUNCTIONS_FROM_TRACEKIND(_1, type, _2, \
|
||||
_3) \
|
||||
INSTANTIATE_INTERNAL_MARKING_FUNCTIONS(type*)
|
||||
|
||||
JS_FOR_EACH_TRACEKIND(INSTANTIATE_INTERNAL_MARKING_FUNCTIONS_FROM_TRACEKIND)
|
||||
|
@ -73,7 +73,7 @@ static inline void TraceExactStackRootList(JSTracer* trc,
|
||||
|
||||
static inline void TraceStackRoots(JSTracer* trc,
|
||||
JS::RootedListHeads& stackRoots) {
|
||||
#define TRACE_ROOTS(name, type, _, _1) \
|
||||
#define TRACE_ROOTS(name, type, _, _1) \
|
||||
TraceExactStackRootList<type*>(trc, stackRoots[JS::RootKind::name], \
|
||||
"exact-" #name);
|
||||
JS_FOR_EACH_TRACEKIND(TRACE_ROOTS)
|
||||
@ -108,7 +108,7 @@ static inline void TracePersistentRootedList(
|
||||
}
|
||||
|
||||
void JSRuntime::tracePersistentRoots(JSTracer* trc) {
|
||||
#define TRACE_ROOTS(name, type, _, _1) \
|
||||
#define TRACE_ROOTS(name, type, _, _1) \
|
||||
TracePersistentRootedList<type*>(trc, heapRoots.ref()[JS::RootKind::name], \
|
||||
"persistent-" #name);
|
||||
JS_FOR_EACH_TRACEKIND(TRACE_ROOTS)
|
||||
|
@ -2321,7 +2321,8 @@ class AutoForbidPoolsAndNops : public AutoForbidNops {
|
||||
//
|
||||
// Allocation of pool entries is not supported within this content so the
|
||||
// code can not use large integers or float constants etc.
|
||||
AutoForbidPoolsAndNops(Assembler* masm, size_t maxInst) : AutoForbidNops(masm) {
|
||||
AutoForbidPoolsAndNops(Assembler* masm, size_t maxInst)
|
||||
: AutoForbidNops(masm) {
|
||||
masm_->enterNoPool(maxInst);
|
||||
}
|
||||
|
||||
|
@ -4292,7 +4292,8 @@ void MacroAssembler::patchFarJump(CodeOffset farJump, uint32_t targetOffset) {
|
||||
}
|
||||
|
||||
CodeOffset MacroAssembler::nopPatchableToCall(const wasm::CallSiteDesc& desc) {
|
||||
AutoForbidPoolsAndNops afp(this, /* max number of instructions in scope = */ 1);
|
||||
AutoForbidPoolsAndNops afp(this,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
CodeOffset offset(currentOffset());
|
||||
ma_nop();
|
||||
append(desc, CodeOffset(currentOffset()));
|
||||
|
@ -537,7 +537,8 @@ class AutoForbidNops {
|
||||
// Forbids pool generation during a specified interval. Not nestable.
|
||||
class AutoForbidPoolsAndNops : public AutoForbidNops {
|
||||
public:
|
||||
AutoForbidPoolsAndNops(Assembler* asm_, size_t maxInst) : AutoForbidNops(asm_) {
|
||||
AutoForbidPoolsAndNops(Assembler* asm_, size_t maxInst)
|
||||
: AutoForbidNops(asm_) {
|
||||
asm_->enterNoPool(maxInst);
|
||||
}
|
||||
~AutoForbidPoolsAndNops() { asm_->leaveNoPool(); }
|
||||
|
@ -276,7 +276,8 @@ void MacroAssembler::add64(Imm64 imm, Register64 dest) {
|
||||
CodeOffset MacroAssembler::sub32FromStackPtrWithPatch(Register dest) {
|
||||
vixl::UseScratchRegisterScope temps(this);
|
||||
const ARMRegister scratch = temps.AcquireX();
|
||||
AutoForbidPoolsAndNops afp(this, /* max number of instructions in scope = */ 3);
|
||||
AutoForbidPoolsAndNops afp(this,
|
||||
/* max number of instructions in scope = */ 3);
|
||||
CodeOffset offs = CodeOffset(currentOffset());
|
||||
movz(scratch, 0, 0);
|
||||
movk(scratch, 0, 16);
|
||||
|
@ -309,12 +309,13 @@ void MacroAssemblerCompat::wasmLoadImpl(const wasm::MemoryAccessDesc& access,
|
||||
asMasm().memoryBarrierBefore(access.sync());
|
||||
|
||||
// Reg+Reg addressing is directly encodable in one Load instruction, hence
|
||||
// the AutoForbidPoolsAndNops will ensure that the access metadata is emitted at
|
||||
// the address of the Load.
|
||||
// the AutoForbidPoolsAndNops will ensure that the access metadata is emitted
|
||||
// at the address of the Load.
|
||||
MemOperand srcAddr(memoryBase, ptr);
|
||||
|
||||
{
|
||||
AutoForbidPoolsAndNops afp(this, /* max number of instructions in scope = */ 1);
|
||||
AutoForbidPoolsAndNops afp(this,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
append(access, asMasm().currentOffset());
|
||||
switch (access.type()) {
|
||||
case Scalar::Int8:
|
||||
@ -377,12 +378,13 @@ void MacroAssemblerCompat::wasmStoreImpl(const wasm::MemoryAccessDesc& access,
|
||||
asMasm().memoryBarrierBefore(access.sync());
|
||||
|
||||
// Reg+Reg addressing is directly encodable in one Store instruction, hence
|
||||
// the AutoForbidPoolsAndNops will ensure that the access metadata is emitted at
|
||||
// the address of the Store.
|
||||
// the AutoForbidPoolsAndNops will ensure that the access metadata is emitted
|
||||
// at the address of the Store.
|
||||
MemOperand dstAddr(memoryBase, ptr);
|
||||
|
||||
{
|
||||
AutoForbidPoolsAndNops afp(this, /* max number of instructions in scope = */ 1);
|
||||
AutoForbidPoolsAndNops afp(this,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
append(access, asMasm().currentOffset());
|
||||
switch (access.type()) {
|
||||
case Scalar::Int8:
|
||||
@ -683,7 +685,8 @@ CodeOffset MacroAssembler::farJumpWithPatch() {
|
||||
const ARMRegister scratch = temps.AcquireX();
|
||||
const ARMRegister scratch2 = temps.AcquireX();
|
||||
|
||||
AutoForbidPoolsAndNops afp(this, /* max number of instructions in scope = */ 7);
|
||||
AutoForbidPoolsAndNops afp(this,
|
||||
/* max number of instructions in scope = */ 7);
|
||||
|
||||
mozilla::DebugOnly<uint32_t> before = currentOffset();
|
||||
|
||||
@ -720,7 +723,8 @@ void MacroAssembler::patchFarJump(CodeOffset farJump, uint32_t targetOffset) {
|
||||
}
|
||||
|
||||
CodeOffset MacroAssembler::nopPatchableToCall(const wasm::CallSiteDesc& desc) {
|
||||
AutoForbidPoolsAndNops afp(this, /* max number of instructions in scope = */ 1);
|
||||
AutoForbidPoolsAndNops afp(this,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
CodeOffset offset(currentOffset());
|
||||
Nop();
|
||||
append(desc, CodeOffset(currentOffset()));
|
||||
@ -1075,7 +1079,8 @@ void MacroAssembler::comment(const char* msg) { Assembler::comment(msg); }
|
||||
// wasm support
|
||||
|
||||
CodeOffset MacroAssembler::wasmTrapInstruction() {
|
||||
AutoForbidPoolsAndNops afp(this, /* max number of instructions in scope = */ 1);
|
||||
AutoForbidPoolsAndNops afp(this,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
CodeOffset offs(currentOffset());
|
||||
Unreachable();
|
||||
return offs;
|
||||
@ -1515,15 +1520,16 @@ static void LoadExclusive(MacroAssembler& masm,
|
||||
bool signExtend = Scalar::isSignedIntType(srcType);
|
||||
|
||||
// With this address form, a single native ldxr* will be emitted, and the
|
||||
// AutoForbidPoolsAndNops ensures that the metadata is emitted at the address of
|
||||
// the ldxr*.
|
||||
// AutoForbidPoolsAndNops ensures that the metadata is emitted at the address
|
||||
// of the ldxr*.
|
||||
MOZ_ASSERT(ptr.IsImmediateOffset() && ptr.offset() == 0);
|
||||
|
||||
switch (Scalar::byteSize(srcType)) {
|
||||
case 1: {
|
||||
{
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
AutoForbidPoolsAndNops afp(
|
||||
&masm,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
if (access) {
|
||||
masm.append(*access, masm.currentOffset());
|
||||
}
|
||||
@ -1536,8 +1542,9 @@ static void LoadExclusive(MacroAssembler& masm,
|
||||
}
|
||||
case 2: {
|
||||
{
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
AutoForbidPoolsAndNops afp(
|
||||
&masm,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
if (access) {
|
||||
masm.append(*access, masm.currentOffset());
|
||||
}
|
||||
@ -1550,8 +1557,9 @@ static void LoadExclusive(MacroAssembler& masm,
|
||||
}
|
||||
case 4: {
|
||||
{
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
AutoForbidPoolsAndNops afp(
|
||||
&masm,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
if (access) {
|
||||
masm.append(*access, masm.currentOffset());
|
||||
}
|
||||
@ -1564,8 +1572,9 @@ static void LoadExclusive(MacroAssembler& masm,
|
||||
}
|
||||
case 8: {
|
||||
{
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
AutoForbidPoolsAndNops afp(
|
||||
&masm,
|
||||
/* max number of instructions in scope = */ 1);
|
||||
if (access) {
|
||||
masm.append(*access, masm.currentOffset());
|
||||
}
|
||||
|
@ -5008,10 +5008,9 @@ JS_PUBLIC_API void JS_ClearPendingException(JSContext* cx) {
|
||||
cx->clearPendingException();
|
||||
}
|
||||
|
||||
JS_PUBLIC_API void
|
||||
JS::SetPendingExceptionAndStack(JSContext* cx, HandleValue value,
|
||||
HandleObject stack)
|
||||
{
|
||||
JS_PUBLIC_API void JS::SetPendingExceptionAndStack(JSContext* cx,
|
||||
HandleValue value,
|
||||
HandleObject stack) {
|
||||
AssertHeapIsIdle();
|
||||
CHECK_THREAD(cx);
|
||||
cx->releaseCheck(value);
|
||||
|
@ -453,9 +453,7 @@ Scope* Scope::clone(JSContext* cx, HandleScope scope, HandleScope enclosing) {
|
||||
|
||||
void Scope::finalize(FreeOp* fop) {
|
||||
MOZ_ASSERT(CurrentThreadIsGCSweeping());
|
||||
applyScopeDataTyped([fop](auto data) {
|
||||
fop->delete_(data);
|
||||
});
|
||||
applyScopeDataTyped([fop](auto data) { fop->delete_(data); });
|
||||
data_ = nullptr;
|
||||
}
|
||||
|
||||
|
@ -1024,39 +1024,39 @@ void Scope::applyScopeDataTyped(F&& f) {
|
||||
case ScopeKind::Function: {
|
||||
f(&as<FunctionScope>().data());
|
||||
break;
|
||||
case ScopeKind::FunctionBodyVar:
|
||||
case ScopeKind::ParameterExpressionVar:
|
||||
f(&as<VarScope>().data());
|
||||
break;
|
||||
case ScopeKind::Lexical:
|
||||
case ScopeKind::SimpleCatch:
|
||||
case ScopeKind::Catch:
|
||||
case ScopeKind::NamedLambda:
|
||||
case ScopeKind::StrictNamedLambda:
|
||||
f(&as<LexicalScope>().data());
|
||||
break;
|
||||
case ScopeKind::With:
|
||||
// With scopes do not have data.
|
||||
break;
|
||||
case ScopeKind::Eval:
|
||||
case ScopeKind::StrictEval:
|
||||
f(&as<EvalScope>().data());
|
||||
break;
|
||||
case ScopeKind::Global:
|
||||
case ScopeKind::NonSyntactic:
|
||||
f(&as<GlobalScope>().data());
|
||||
break;
|
||||
case ScopeKind::Module:
|
||||
f(&as<ModuleScope>().data());
|
||||
break;
|
||||
case ScopeKind::WasmInstance:
|
||||
f(&as<WasmInstanceScope>().data());
|
||||
break;
|
||||
case ScopeKind::WasmFunction:
|
||||
f(&as<WasmFunctionScope>().data());
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unexpected scope type in ApplyScopeDataTyped");
|
||||
case ScopeKind::FunctionBodyVar:
|
||||
case ScopeKind::ParameterExpressionVar:
|
||||
f(&as<VarScope>().data());
|
||||
break;
|
||||
case ScopeKind::Lexical:
|
||||
case ScopeKind::SimpleCatch:
|
||||
case ScopeKind::Catch:
|
||||
case ScopeKind::NamedLambda:
|
||||
case ScopeKind::StrictNamedLambda:
|
||||
f(&as<LexicalScope>().data());
|
||||
break;
|
||||
case ScopeKind::With:
|
||||
// With scopes do not have data.
|
||||
break;
|
||||
case ScopeKind::Eval:
|
||||
case ScopeKind::StrictEval:
|
||||
f(&as<EvalScope>().data());
|
||||
break;
|
||||
case ScopeKind::Global:
|
||||
case ScopeKind::NonSyntactic:
|
||||
f(&as<GlobalScope>().data());
|
||||
break;
|
||||
case ScopeKind::Module:
|
||||
f(&as<ModuleScope>().data());
|
||||
break;
|
||||
case ScopeKind::WasmInstance:
|
||||
f(&as<WasmInstanceScope>().data());
|
||||
break;
|
||||
case ScopeKind::WasmFunction:
|
||||
f(&as<WasmFunctionScope>().data());
|
||||
break;
|
||||
default:
|
||||
MOZ_CRASH("Unexpected scope type in ApplyScopeDataTyped");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -998,8 +998,8 @@ struct TypeHashSet {
|
||||
return bool(reinterpret_cast<uintptr_t>(elem) & U::TypeHashSetMarkBit);
|
||||
};
|
||||
auto toggleMarkBit = [](U* elem) -> U* {
|
||||
return reinterpret_cast<U*>(
|
||||
reinterpret_cast<uintptr_t>(elem) ^ U::TypeHashSetMarkBit);
|
||||
return reinterpret_cast<U*>(reinterpret_cast<uintptr_t>(elem) ^
|
||||
U::TypeHashSetMarkBit);
|
||||
};
|
||||
|
||||
// When we have a single element it is stored in-place of the function
|
||||
|
@ -4695,7 +4695,8 @@ class BaseCompiler final : public BaseCompilerInterface {
|
||||
// Flush constant pools: offset must reflect the distance from the MOV
|
||||
// to the start of the table; as the address of the MOV is given by the
|
||||
// label, nothing must come between the bind() and the ma_mov().
|
||||
AutoForbidPoolsAndNops afp(&masm, /* number of instructions in scope = */ 5);
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* number of instructions in scope = */ 5);
|
||||
|
||||
ScratchI32 scratch(*this);
|
||||
|
||||
@ -4728,7 +4729,8 @@ class BaseCompiler final : public BaseCompilerInterface {
|
||||
|
||||
masm.branchToComputedAddress(BaseIndex(scratch, switchValue, ScalePointer));
|
||||
#elif defined(JS_CODEGEN_ARM64)
|
||||
AutoForbidPoolsAndNops afp(&masm, /* number of instructions in scope = */ 4);
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* number of instructions in scope = */ 4);
|
||||
|
||||
ScratchI32 scratch(*this);
|
||||
|
||||
|
@ -439,7 +439,8 @@ static void GenerateCallablePrologue(MacroAssembler& masm, uint32_t* entry) {
|
||||
// We do not use the PseudoStackPointer.
|
||||
MOZ_ASSERT(masm.GetStackPointer64().code() == sp.code());
|
||||
|
||||
AutoForbidPoolsAndNops afp(&masm, /* number of instructions in scope = */ 5);
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* number of instructions in scope = */ 5);
|
||||
|
||||
*entry = masm.currentOffset();
|
||||
|
||||
@ -458,7 +459,8 @@ static void GenerateCallablePrologue(MacroAssembler& masm, uint32_t* entry) {
|
||||
#else
|
||||
{
|
||||
# if defined(JS_CODEGEN_ARM)
|
||||
AutoForbidPoolsAndNops afp(&masm, /* number of instructions in scope = */ 7);
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* number of instructions in scope = */ 7);
|
||||
|
||||
*entry = masm.currentOffset();
|
||||
|
||||
@ -697,7 +699,8 @@ void wasm::GenerateJitEntryPrologue(MacroAssembler& masm, Offsets* offsets) {
|
||||
|
||||
{
|
||||
#if defined(JS_CODEGEN_ARM)
|
||||
AutoForbidPoolsAndNops afp(&masm, /* number of instructions in scope = */ 2);
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* number of instructions in scope = */ 2);
|
||||
offsets->begin = masm.currentOffset();
|
||||
MOZ_ASSERT(BeforePushRetAddr == 0);
|
||||
masm.push(lr);
|
||||
@ -705,7 +708,8 @@ void wasm::GenerateJitEntryPrologue(MacroAssembler& masm, Offsets* offsets) {
|
||||
offsets->begin = masm.currentOffset();
|
||||
masm.push(ra);
|
||||
#elif defined(JS_CODEGEN_ARM64)
|
||||
AutoForbidPoolsAndNops afp(&masm, /* number of instructions in scope = */ 3);
|
||||
AutoForbidPoolsAndNops afp(&masm,
|
||||
/* number of instructions in scope = */ 3);
|
||||
offsets->begin = masm.currentOffset();
|
||||
MOZ_ASSERT(BeforePushRetAddr == 0);
|
||||
// Subtract from SP first as SP must be aligned before offsetting.
|
||||
|
@ -78,7 +78,7 @@
|
||||
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
# include "VRManager.h"
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
# include "nsXULPopupManager.h"
|
||||
@ -1763,7 +1763,7 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
|
||||
RunFrameRequestCallbacks(aNowTime);
|
||||
return;
|
||||
}
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
#endif // defined(MOZ_WIDGET_ANDROID)
|
||||
|
||||
AUTO_PROFILER_LABEL("nsRefreshDriver::Tick", LAYOUT);
|
||||
|
||||
@ -1816,13 +1816,13 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
|
||||
// before stopping the timer.
|
||||
// On top level content pages keep the timer running initially so that we
|
||||
// paint the page soon enough.
|
||||
if (!XRE_IsContentProcess() || !presShell || mTestControllingRefreshes ||
|
||||
!mPresContext->Document()->IsTopLevelContentDocument() || mThrottled ||
|
||||
gfxPlatform::IsInLayoutAsapMode()) {
|
||||
StopTimer();
|
||||
} else if (mPresContext->Document()->GetReadyStateEnum() <
|
||||
Document::READYSTATE_COMPLETE &&
|
||||
!mPresContext->HadContentfulPaint()) {
|
||||
if (presShell && !mThrottled && !mTestControllingRefreshes &&
|
||||
XRE_IsContentProcess() &&
|
||||
mPresContext->Document()->IsTopLevelContentDocument() &&
|
||||
!gfxPlatform::IsInLayoutAsapMode() &&
|
||||
!mPresContext->HadContentfulPaint() &&
|
||||
mPresContext->Document()->GetReadyStateEnum() <
|
||||
Document::READYSTATE_COMPLETE) {
|
||||
if (mInitialTimerRunningLimit.IsNull()) {
|
||||
mInitialTimerRunningLimit =
|
||||
TimeStamp::Now() + TimeDuration::FromSeconds(4.0f);
|
||||
@ -1830,6 +1830,8 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
|
||||
} else if (mInitialTimerRunningLimit < TimeStamp::Now()) {
|
||||
StopTimer();
|
||||
}
|
||||
} else {
|
||||
StopTimer();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1286,9 +1286,11 @@ void nsBlockFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
|
||||
const auto baselineGroup = BaselineSharingGroup::eFirst;
|
||||
nscoord markerBaseline;
|
||||
if (MOZ_UNLIKELY(wm.IsOrthogonalTo(marker->GetWritingMode()) ||
|
||||
!marker->GetNaturalBaselineBOffset(wm, baselineGroup, &markerBaseline))) {
|
||||
!marker->GetNaturalBaselineBOffset(wm, baselineGroup,
|
||||
&markerBaseline))) {
|
||||
// ::marker has no baseline in this axis: align with its margin-box end.
|
||||
markerBaseline = bbox.BSize(wm) + marker->GetLogicalUsedMargin(wm).BEnd(wm);
|
||||
markerBaseline =
|
||||
bbox.BSize(wm) + marker->GetLogicalUsedMargin(wm).BEnd(wm);
|
||||
}
|
||||
bbox.BStart(wm) = position.mBaseline - markerBaseline;
|
||||
marker->SetRect(wm, bbox, reflowOutput.PhysicalSize());
|
||||
|
@ -9411,7 +9411,7 @@ nsOverflowAreas nsTextFrame::RecomputeOverflow(nsIFrame* aBlockFrame,
|
||||
nsRect& vis = result.VisualOverflow();
|
||||
vis.UnionRect(vis, boundingBox);
|
||||
UnionAdditionalOverflow(PresContext(), aBlockFrame, provider, &vis, true,
|
||||
aIncludeShadows);
|
||||
aIncludeShadows);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1722,9 +1722,7 @@ class nsDisplayListBuilder {
|
||||
return false;
|
||||
}
|
||||
|
||||
void RebuildAllItemsInCurrentSubtree() {
|
||||
mDirtyRect = mVisibleRect;
|
||||
}
|
||||
void RebuildAllItemsInCurrentSubtree() { mDirtyRect = mVisibleRect; }
|
||||
|
||||
/**
|
||||
* This is a convenience function to ease the transition until AGRs and ASRs
|
||||
|
@ -18,7 +18,7 @@ struct RawServoFontFaceRule;
|
||||
namespace mozilla {
|
||||
enum class StyleOrigin : uint8_t;
|
||||
struct LangGroupFontPrefs;
|
||||
}
|
||||
} // namespace mozilla
|
||||
|
||||
// used for associating origin with specific @font-face rules
|
||||
struct nsFontFaceRuleContainer {
|
||||
|
@ -1831,9 +1831,7 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetHeight() {
|
||||
|
||||
const nsStyleDisplay* displayData = StyleDisplay();
|
||||
if (displayData->mDisplay == mozilla::StyleDisplay::Inline &&
|
||||
!(mInnerFrame->IsFrameOfType(nsIFrame::eReplaced)) &&
|
||||
// An outer SVG frame should behave the same as eReplaced in this case
|
||||
!mInnerFrame->IsSVGOuterSVGFrame()) {
|
||||
!mInnerFrame->IsFrameOfType(nsIFrame::eReplaced)) {
|
||||
calcHeight = false;
|
||||
}
|
||||
}
|
||||
@ -1870,9 +1868,7 @@ already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetWidth() {
|
||||
|
||||
const nsStyleDisplay* displayData = StyleDisplay();
|
||||
if (displayData->mDisplay == mozilla::StyleDisplay::Inline &&
|
||||
!(mInnerFrame->IsFrameOfType(nsIFrame::eReplaced)) &&
|
||||
// An outer SVG frame should behave the same as eReplaced in this case
|
||||
!mInnerFrame->IsSVGOuterSVGFrame()) {
|
||||
!mInnerFrame->IsFrameOfType(nsIFrame::eReplaced)) {
|
||||
calcWidth = false;
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,8 @@ class nsSVGOuterSVGFrame final : public nsSVGDisplayContainerFrame,
|
||||
|
||||
bool IsFrameOfType(uint32_t aFlags) const override {
|
||||
return nsSVGDisplayContainerFrame::IsFrameOfType(
|
||||
aFlags & ~eSupportsContainLayoutAndPaint);
|
||||
aFlags &
|
||||
~(eSupportsContainLayoutAndPaint | eReplaced | eReplacedSizing));
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
|
@ -361,7 +361,9 @@ already_AddRefed<SourceSurface> nsSVGPatternFrame::PaintPattern(
|
||||
nsSVGDisplayableFrame *SVGFrame = do_QueryFrame(kid);
|
||||
if (SVGFrame) {
|
||||
SVGFrame->NotifySVGChanged(nsSVGDisplayableFrame::TRANSFORM_CHANGED);
|
||||
tm = nsSVGUtils::GetTransformMatrixInUserSpace(kid, patternWithChildren) * tm;
|
||||
tm = nsSVGUtils::GetTransformMatrixInUserSpace(kid,
|
||||
patternWithChildren) *
|
||||
tm;
|
||||
}
|
||||
|
||||
nsSVGUtils::PaintFrameWithEffects(kid, *ctx, tm, aImgParams);
|
||||
@ -635,7 +637,7 @@ gfxMatrix nsSVGPatternFrame::ConstructCTM(const SVGAnimatedViewBox &aViewBox,
|
||||
if (!aViewBox.IsExplicitlySet()) {
|
||||
return gfxMatrix(scaleX, 0.0, 0.0, scaleY, 0.0, 0.0);
|
||||
}
|
||||
const SVGViewBox& viewBox = aViewBox.GetAnimValue();
|
||||
const SVGViewBox &viewBox = aViewBox.GetAnimValue();
|
||||
|
||||
if (viewBox.height <= 0.0f || viewBox.width <= 0.0f) {
|
||||
return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular
|
||||
|
@ -212,7 +212,7 @@ pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla
|
||||
/* preferences for the Get Add-ons pane */
|
||||
pref("extensions.getAddons.cache.enabled", true);
|
||||
pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/android/search?q=%TERMS%&platform=%OS%&appver=%VERSION%");
|
||||
pref("extensions.getAddons.browseAddons", "https://addons.mozilla.org/%LOCALE%/firefox/collections/4757633/mob/");
|
||||
pref("extensions.getAddons.browseAddons", "https://addons.mozilla.org/%LOCALE%/firefox/collections/4757633/mob/?page=1&collection_sort=-popularity");
|
||||
pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/api/v3/addons/search/?guid=%IDS%&lang=%LOCALE%");
|
||||
pref("extensions.getAddons.compatOverides.url", "https://services.addons.mozilla.org/api/v3/addons/compat-override/?guid=%IDS%&lang=%LOCALE%");
|
||||
pref("extensions.getAddons.langpacks.url", "https://services.addons.mozilla.org/api/v3/addons/language-tools/?app=android&type=language&appversion=%VERSION%");
|
||||
|
@ -8,7 +8,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="aboutCompat.css" />
|
||||
<link rel="stylesheet" media="screen and (min-device-width:481px), projection" type="text/css"
|
||||
<link rel="stylesheet" media="screen and (pointer:fine), projection" type="text/css"
|
||||
href="chrome://global/skin/in-content/common.css"/>
|
||||
<link rel="localization" href="toolkit/about/aboutCompat.ftl"/>
|
||||
<title data-l10n-id="text-title"></title>
|
||||
|
@ -6,9 +6,6 @@
|
||||
|
||||
/* global ExtensionAPI, Services, XPCOMUtils */
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "AppConstants",
|
||||
"resource://gre/modules/AppConstants.jsm");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "Services",
|
||||
"resource://gre/modules/Services.jsm");
|
||||
|
||||
@ -19,14 +16,8 @@ XPCOMUtils.defineLazyServiceGetter(this, "resProto",
|
||||
const ResourceSubstitution = "webcompat";
|
||||
const ProcessScriptURL = "resource://webcompat/aboutPageProcessScript.js";
|
||||
|
||||
const ShouldStart = ["default", "nightly", "nightly-try"].includes(AppConstants.MOZ_UPDATE_CHANNEL);
|
||||
|
||||
this.aboutPage = class extends ExtensionAPI {
|
||||
onStartup() {
|
||||
if (!ShouldStart) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {rootURI} = this.extension;
|
||||
|
||||
resProto.setSubstitution(ResourceSubstitution,
|
||||
@ -36,10 +27,6 @@ this.aboutPage = class extends ExtensionAPI {
|
||||
}
|
||||
|
||||
onShutdown() {
|
||||
if (!ShouldStart) {
|
||||
return;
|
||||
}
|
||||
|
||||
resProto.setSubstitution(ResourceSubstitution, null);
|
||||
|
||||
Services.ppmm.removeDelayedProcessScript(ProcessScriptURL);
|
||||
|
@ -6087,6 +6087,3 @@ pref("dom.datatransfer.mozAtAPIs", true);
|
||||
// External.AddSearchProvider is deprecated and it will be removed in the next
|
||||
// cycles.
|
||||
pref("dom.sidebar.enabled", true);
|
||||
|
||||
// Turn on fission frameloader swapping
|
||||
pref("fission.rebuild_frameloaders_on_remoteness_change", true);
|
||||
|
@ -16,7 +16,7 @@
|
||||
* @see nsIPrefBranch
|
||||
* @see nsISupportsString
|
||||
*/
|
||||
[scriptable, uuid(ae419e24-1dd1-11b2-b39a-d3e5e7073802)]
|
||||
[scriptable, builtinclass, uuid(ae419e24-1dd1-11b2-b39a-d3e5e7073802)]
|
||||
interface nsIPrefLocalizedString : nsISupportsString {};
|
||||
|
||||
%{C++
|
||||
|
@ -11,9 +11,8 @@
|
||||
namespace mozilla {
|
||||
namespace detail {
|
||||
|
||||
inline LauncherResult<nt::DataDirectoryEntry>
|
||||
GetImageDirectoryViaFileIo(const nsAutoHandle& aImageFile,
|
||||
const uint32_t aOurImportDirectoryRva) {
|
||||
inline LauncherResult<nt::DataDirectoryEntry> GetImageDirectoryViaFileIo(
|
||||
const nsAutoHandle& aImageFile, const uint32_t aOurImportDirectoryRva) {
|
||||
OVERLAPPED ov = {};
|
||||
ov.Offset = aOurImportDirectoryRva;
|
||||
|
||||
@ -51,21 +50,20 @@ GetImageDirectoryViaFileIo(const nsAutoHandle& aImageFile,
|
||||
* determine the base address of the binary within the
|
||||
* target process.
|
||||
*/
|
||||
inline LauncherVoidResult
|
||||
RestoreImportDirectory(const wchar_t* aFullImagePath,
|
||||
const nt::PEHeaders& aLocalExeImage,
|
||||
HANDLE aTargetProcess, HMODULE aRemoteExeImage) {
|
||||
inline LauncherVoidResult RestoreImportDirectory(
|
||||
const wchar_t* aFullImagePath, const nt::PEHeaders& aLocalExeImage,
|
||||
HANDLE aTargetProcess, HMODULE aRemoteExeImage) {
|
||||
uint32_t importDirEntryRva;
|
||||
PIMAGE_DATA_DIRECTORY importDirEntry =
|
||||
aLocalExeImage.GetImageDirectoryEntryPtr(IMAGE_DIRECTORY_ENTRY_IMPORT,
|
||||
&importDirEntryRva);
|
||||
aLocalExeImage.GetImageDirectoryEntryPtr(IMAGE_DIRECTORY_ENTRY_IMPORT,
|
||||
&importDirEntryRva);
|
||||
if (!importDirEntry) {
|
||||
return LAUNCHER_ERROR_FROM_WIN32(ERROR_BAD_EXE_FORMAT);
|
||||
}
|
||||
|
||||
nsAutoHandle file(::CreateFileW(aFullImagePath, GENERIC_READ,
|
||||
FILE_SHARE_READ, nullptr, OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL, nullptr));
|
||||
nsAutoHandle file(::CreateFileW(aFullImagePath, GENERIC_READ, FILE_SHARE_READ,
|
||||
nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
|
||||
nullptr));
|
||||
if (file.get() == INVALID_HANDLE_VALUE) {
|
||||
return LAUNCHER_ERROR_FROM_LAST();
|
||||
}
|
||||
@ -77,29 +75,27 @@ RestoreImportDirectory(const wchar_t* aFullImagePath,
|
||||
// flag, which may help to mitigate this, but we might as well just support
|
||||
// a single implementation that works everywhere.
|
||||
LauncherResult<nt::DataDirectoryEntry> realImportDirectory =
|
||||
detail::GetImageDirectoryViaFileIo(file, importDirEntryRva);
|
||||
detail::GetImageDirectoryViaFileIo(file, importDirEntryRva);
|
||||
if (realImportDirectory.isErr()) {
|
||||
return LAUNCHER_ERROR_FROM_RESULT(realImportDirectory);
|
||||
}
|
||||
|
||||
nt::DataDirectoryEntry toWrite = realImportDirectory.unwrap();
|
||||
|
||||
void* remoteAddress =
|
||||
reinterpret_cast<char*>(nt::PEHeaders::HModuleToBaseAddr(aRemoteExeImage)) +
|
||||
importDirEntryRva;
|
||||
void* remoteAddress = reinterpret_cast<char*>(
|
||||
nt::PEHeaders::HModuleToBaseAddr(aRemoteExeImage)) +
|
||||
importDirEntryRva;
|
||||
|
||||
{ // Scope for prot
|
||||
AutoVirtualProtect prot(remoteAddress,
|
||||
sizeof(IMAGE_DATA_DIRECTORY),
|
||||
{ // Scope for prot
|
||||
AutoVirtualProtect prot(remoteAddress, sizeof(IMAGE_DATA_DIRECTORY),
|
||||
PAGE_READWRITE, aTargetProcess);
|
||||
if (!prot) {
|
||||
return LAUNCHER_ERROR_FROM_MOZ_WINDOWS_ERROR(prot.GetError());
|
||||
}
|
||||
|
||||
SIZE_T bytesWritten;
|
||||
if (!::WriteProcessMemory(aTargetProcess, remoteAddress,
|
||||
&toWrite, sizeof(IMAGE_DATA_DIRECTORY),
|
||||
&bytesWritten) ||
|
||||
if (!::WriteProcessMemory(aTargetProcess, remoteAddress, &toWrite,
|
||||
sizeof(IMAGE_DATA_DIRECTORY), &bytesWritten) ||
|
||||
bytesWritten != sizeof(IMAGE_DATA_DIRECTORY)) {
|
||||
return LAUNCHER_ERROR_FROM_LAST();
|
||||
}
|
||||
|
@ -259,8 +259,7 @@ class MOZ_RAII PEHeaders final {
|
||||
explicit PEHeaders(void* aBaseAddress)
|
||||
: PEHeaders(reinterpret_cast<PIMAGE_DOS_HEADER>(aBaseAddress)) {}
|
||||
|
||||
explicit PEHeaders(HMODULE aModule)
|
||||
: PEHeaders(HModuleToBaseAddr(aModule)) {}
|
||||
explicit PEHeaders(HMODULE aModule) : PEHeaders(HModuleToBaseAddr(aModule)) {}
|
||||
|
||||
explicit PEHeaders(PIMAGE_DOS_HEADER aMzHeader)
|
||||
: mMzHeader(aMzHeader), mPeHeader(nullptr), mImageLimit(nullptr) {
|
||||
@ -330,8 +329,7 @@ class MOZ_RAII PEHeaders final {
|
||||
}
|
||||
|
||||
PIMAGE_DATA_DIRECTORY GetImageDirectoryEntryPtr(
|
||||
const uint32_t aDirectoryIndex,
|
||||
uint32_t* aOutRva = nullptr) const {
|
||||
const uint32_t aDirectoryIndex, uint32_t* aOutRva = nullptr) const {
|
||||
if (aOutRva) {
|
||||
*aOutRva = 0;
|
||||
}
|
||||
@ -345,7 +343,7 @@ class MOZ_RAII PEHeaders final {
|
||||
}
|
||||
|
||||
PIMAGE_DATA_DIRECTORY dirEntry =
|
||||
&optionalHeader.DataDirectory[aDirectoryIndex];
|
||||
&optionalHeader.DataDirectory[aDirectoryIndex];
|
||||
if (aOutRva) {
|
||||
*aOutRva = reinterpret_cast<char*>(dirEntry) -
|
||||
reinterpret_cast<char*>(mMzHeader);
|
||||
@ -404,7 +402,7 @@ class MOZ_RAII PEHeaders final {
|
||||
|
||||
struct IATThunks {
|
||||
IATThunks(PIMAGE_THUNK_DATA aFirstThunk, ptrdiff_t aNumThunks)
|
||||
: mFirstThunk(aFirstThunk), mNumThunks(aNumThunks) {}
|
||||
: mFirstThunk(aFirstThunk), mNumThunks(aNumThunks) {}
|
||||
|
||||
size_t Length() const {
|
||||
return size_t(mNumThunks) * sizeof(IMAGE_THUNK_DATA);
|
||||
@ -611,12 +609,10 @@ inline LauncherResult<DWORD> GetParentProcessId() {
|
||||
}
|
||||
|
||||
struct DataDirectoryEntry : public _IMAGE_DATA_DIRECTORY {
|
||||
DataDirectoryEntry() : _IMAGE_DATA_DIRECTORY() {
|
||||
}
|
||||
DataDirectoryEntry() : _IMAGE_DATA_DIRECTORY() {}
|
||||
|
||||
MOZ_IMPLICIT DataDirectoryEntry(const _IMAGE_DATA_DIRECTORY& aOther)
|
||||
: _IMAGE_DATA_DIRECTORY(aOther) {
|
||||
}
|
||||
: _IMAGE_DATA_DIRECTORY(aOther) {}
|
||||
|
||||
DataDirectoryEntry(const DataDirectoryEntry& aOther) = default;
|
||||
};
|
||||
@ -624,8 +620,8 @@ struct DataDirectoryEntry : public _IMAGE_DATA_DIRECTORY {
|
||||
inline LauncherResult<void*> GetProcessPebPtr(HANDLE aProcess) {
|
||||
ULONG returnLength;
|
||||
PROCESS_BASIC_INFORMATION pbi;
|
||||
NTSTATUS status = ::NtQueryInformationProcess(aProcess,
|
||||
ProcessBasicInformation, &pbi, sizeof(pbi), &returnLength);
|
||||
NTSTATUS status = ::NtQueryInformationProcess(
|
||||
aProcess, ProcessBasicInformation, &pbi, sizeof(pbi), &returnLength);
|
||||
if (!NT_SUCCESS(status)) {
|
||||
return LAUNCHER_ERROR_FROM_NTSTATUS(status);
|
||||
}
|
||||
@ -651,7 +647,8 @@ inline LauncherResult<HMODULE> GetProcessExeModule(HANDLE aProcess) {
|
||||
|
||||
#if defined(MOZILLA_INTERNAL_API)
|
||||
if (!::ReadProcessMemory(aProcess, ppeb.unwrap(), &peb, sizeof(peb),
|
||||
&bytesRead) || bytesRead != sizeof(peb)) {
|
||||
&bytesRead) ||
|
||||
bytesRead != sizeof(peb)) {
|
||||
return LAUNCHER_ERROR_FROM_LAST();
|
||||
}
|
||||
#else
|
||||
@ -668,7 +665,8 @@ inline LauncherResult<HMODULE> GetProcessExeModule(HANDLE aProcess) {
|
||||
char mzMagic[2];
|
||||
#if defined(MOZILLA_INTERNAL_API)
|
||||
if (!::ReadProcessMemory(aProcess, baseAddress, mzMagic, sizeof(mzMagic),
|
||||
&bytesRead) || bytesRead != sizeof(mzMagic)) {
|
||||
&bytesRead) ||
|
||||
bytesRead != sizeof(mzMagic)) {
|
||||
return LAUNCHER_ERROR_FROM_LAST();
|
||||
}
|
||||
#else
|
||||
|
@ -7940,9 +7940,6 @@ dodge
|
||||
// dog : 2014-12-04 Binky Moon, LLC
|
||||
dog
|
||||
|
||||
// doha : 2014-09-18 Communications Regulatory Authority (CRA)
|
||||
doha
|
||||
|
||||
// domains : 2013-10-17 Binky Moon, LLC
|
||||
domains
|
||||
|
||||
@ -10843,6 +10840,10 @@ myfritz.net
|
||||
// Submitted by Anthony Voutas <anthony@backplane.io>
|
||||
backplaneapp.io
|
||||
|
||||
// Banzai Cloud
|
||||
// Submitted by Gabor Kozma <info@banzaicloud.com>
|
||||
app.banzaicloud.io
|
||||
|
||||
// BetaInABox
|
||||
// Submitted by Adrian <adrian@betainabox.com>
|
||||
betainabox.com
|
||||
|
@ -3187,9 +3187,10 @@ already_AddRefed<nsILoadInfo> HttpBaseChannel::CloneLoadInfoForRedirect(
|
||||
MOZ_ASSERT(
|
||||
docShellAttrs.mPrivateBrowsingId == attrs.mPrivateBrowsingId,
|
||||
"docshell and necko should have the same privateBrowsingId attribute.");
|
||||
MOZ_ASSERT(
|
||||
docShellAttrs.mGeckoViewSessionContextId == attrs.mGeckoViewSessionContextId,
|
||||
"docshell and necko should have the same geckoViewSessionContextId attribute");
|
||||
MOZ_ASSERT(docShellAttrs.mGeckoViewSessionContextId ==
|
||||
attrs.mGeckoViewSessionContextId,
|
||||
"docshell and necko should have the same "
|
||||
"geckoViewSessionContextId attribute");
|
||||
|
||||
attrs = docShellAttrs;
|
||||
attrs.SetFirstPartyDomain(true, newURI);
|
||||
|
@ -6134,10 +6134,9 @@ nsHttpChannel::Cancel(nsresult status) {
|
||||
MOZ_ASSERT_IF(mPreflightChannel, !mCachePump);
|
||||
#ifdef DEBUG
|
||||
if (UrlClassifierFeatureFactory::IsClassifierBlockingErrorCode(status)) {
|
||||
MOZ_CRASH_UNSAFE_PRINTF(
|
||||
"Blocking classifier error %" PRIx32
|
||||
" need to be handled by CancelByURLClassifier()",
|
||||
static_cast<uint32_t>(status));
|
||||
MOZ_CRASH_UNSAFE_PRINTF("Blocking classifier error %" PRIx32
|
||||
" need to be handled by CancelByURLClassifier()",
|
||||
static_cast<uint32_t>(status));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -6219,8 +6218,7 @@ void nsHttpChannel::ContinueCancellingByURLClassifier(nsresult aErrorCode) {
|
||||
// We should never have a pump open while a CORS preflight is in progress.
|
||||
MOZ_ASSERT_IF(mPreflightChannel, !mCachePump);
|
||||
|
||||
LOG(("nsHttpChannel::ContinueCancellingByURLClassifier [this=%p]\n",
|
||||
this));
|
||||
LOG(("nsHttpChannel::ContinueCancellingByURLClassifier [this=%p]\n", this));
|
||||
if (mCanceled) {
|
||||
LOG((" ignoring; already canceled\n"));
|
||||
return;
|
||||
|
@ -121,7 +121,7 @@ nsHttpConnection::nsHttpConnection()
|
||||
? k5Sec
|
||||
: gHttpHandler->IdleTimeout();
|
||||
|
||||
mThroughCaptivePortal = gHttpHandler->GetThroughCaptivePortal();
|
||||
mThroughCaptivePortal = gHttpHandler->GetThroughCaptivePortal();
|
||||
}
|
||||
|
||||
nsHttpConnection::~nsHttpConnection() {
|
||||
@ -158,11 +158,12 @@ nsHttpConnection::~nsHttpConnection() {
|
||||
|
||||
if (mThroughCaptivePortal) {
|
||||
if (mTotalBytesRead || mTotalBytesWritten) {
|
||||
auto total = Clamp<uint32_t>(
|
||||
(mTotalBytesRead >> 10) + (mTotalBytesWritten >> 10), 0,
|
||||
std::numeric_limits<uint32_t>::max());
|
||||
auto total =
|
||||
Clamp<uint32_t>((mTotalBytesRead >> 10) + (mTotalBytesWritten >> 10),
|
||||
0, std::numeric_limits<uint32_t>::max());
|
||||
Telemetry::ScalarAdd(
|
||||
Telemetry::ScalarID::NETWORKING_DATA_TRANSFERRED_CAPTIVE_PORTAL, total);
|
||||
Telemetry::ScalarID::NETWORKING_DATA_TRANSFERRED_CAPTIVE_PORTAL,
|
||||
total);
|
||||
}
|
||||
|
||||
Telemetry::ScalarAdd(
|
||||
|
@ -418,6 +418,7 @@ class nsHttpHandler final : public nsIHttpProtocolHandler,
|
||||
HttpTrafficAnalyzer *GetHttpTrafficAnalyzer();
|
||||
|
||||
bool GetThroughCaptivePortal() { return mThroughCaptivePortal; }
|
||||
|
||||
private:
|
||||
nsHttpHandler();
|
||||
|
||||
|
@ -174,8 +174,7 @@ UrlClassifierFeatureFingerprintingProtection::ProcessChannel(
|
||||
nsCOMPtr<nsIHttpChannelInternal> httpChannel = do_QueryInterface(aChannel);
|
||||
|
||||
if (httpChannel) {
|
||||
Unused << httpChannel->CancelByURLClassifier(
|
||||
NS_ERROR_FINGERPRINTING_URI);
|
||||
Unused << httpChannel->CancelByURLClassifier(NS_ERROR_FINGERPRINTING_URI);
|
||||
} else {
|
||||
Unused << aChannel->Cancel(NS_ERROR_FINGERPRINTING_URI);
|
||||
}
|
||||
|
@ -597,6 +597,25 @@ class GTestCommands(MachCommandBase):
|
||||
@CommandArgument('--shuffle', '-s', action='store_true',
|
||||
help='Randomize the execution order of tests.')
|
||||
|
||||
@CommandArgument('--package',
|
||||
default='org.mozilla.geckoview.test',
|
||||
help='(Android only) Package name of test app.')
|
||||
@CommandArgument('--adbpath',
|
||||
dest='adb_path',
|
||||
help='(Android only) Path to adb binary.')
|
||||
@CommandArgument('--deviceSerial',
|
||||
dest='device_serial',
|
||||
help="(Android only) adb serial number of remote device. "
|
||||
"Required when more than one device is connected to the host. "
|
||||
"Use 'adb devices' to see connected devices.")
|
||||
@CommandArgument('--remoteTestRoot',
|
||||
dest='remote_test_root',
|
||||
help='(Android only) Remote directory to use as test root '
|
||||
'(eg. /mnt/sdcard/tests or /data/local/tests).')
|
||||
@CommandArgument('--libxul',
|
||||
dest='libxul_path',
|
||||
help='(Android only) Path to gtest libxul.so.')
|
||||
|
||||
@CommandArgumentGroup('debugging')
|
||||
@CommandArgument('--debug', action='store_true', group='debugging',
|
||||
help='Enable the debugger. Not specifying a --debugger option will result in the default debugger being used.')
|
||||
@ -606,8 +625,9 @@ class GTestCommands(MachCommandBase):
|
||||
group='debugging',
|
||||
help='Command-line arguments to pass to the debugger itself; split as the Bourne shell would.')
|
||||
|
||||
def gtest(self, shuffle, jobs, gtest_filter, tbpl_parser, debug, debugger,
|
||||
debugger_args):
|
||||
def gtest(self, shuffle, jobs, gtest_filter, tbpl_parser,
|
||||
package, adb_path, device_serial, remote_test_root, libxul_path,
|
||||
debug, debugger, debugger_args):
|
||||
|
||||
# We lazy build gtest because it's slow to link
|
||||
try:
|
||||
@ -632,6 +652,17 @@ class GTestCommands(MachCommandBase):
|
||||
self._run_make(directory='browser/app', target='repackage',
|
||||
ensure_exit_code=True)
|
||||
|
||||
if conditions.is_android(self):
|
||||
if jobs != 1:
|
||||
print("--jobs is not supported on Android and will be ignored")
|
||||
if debug or debugger or debugger_args:
|
||||
print("--debug options are not supported on Android and will be ignored")
|
||||
return self.android_gtest(shuffle, gtest_filter,
|
||||
package, adb_path, device_serial, remote_test_root, libxul_path)
|
||||
|
||||
if package or adb_path or device_serial or remote_test_root or libxul_path:
|
||||
print("One or more Android-only options will be ignored")
|
||||
|
||||
app_path = self.get_binary_path('app')
|
||||
args = [app_path, '-unittest', '--gtest_death_test_style=threadsafe'];
|
||||
|
||||
@ -708,6 +739,36 @@ class GTestCommands(MachCommandBase):
|
||||
|
||||
return exit_code
|
||||
|
||||
def android_gtest(self, shuffle, gtest_filter,
|
||||
package, adb_path, device_serial, remote_test_root, libxul_path):
|
||||
# setup logging for mozrunner
|
||||
from mozlog.commandline import setup_logging
|
||||
format_args = {'level': self._mach_context.settings['test']['level']}
|
||||
default_format = self._mach_context.settings['test']['format']
|
||||
log = setup_logging('mach-gtest', {}, {default_format: sys.stdout}, format_args)
|
||||
|
||||
# ensure that a device is available and test app is installed
|
||||
from mozrunner.devices.android_device import (verify_android_device, get_adb_path)
|
||||
verify_android_device(self, install=True, app=package, device_serial=device_serial)
|
||||
|
||||
if not adb_path:
|
||||
adb_path = get_adb_path(self)
|
||||
if not libxul_path:
|
||||
libxul_path = os.path.join(self.topobjdir, "dist", "bin", "gtest", "libxul.so")
|
||||
|
||||
# run gtest via remotegtests.py
|
||||
import imp
|
||||
path = os.path.join('testing', 'gtest', 'remotegtests.py')
|
||||
with open(path, 'r') as fh:
|
||||
imp.load_module('remotegtests', fh, path,
|
||||
('.py', 'r', imp.PY_SOURCE))
|
||||
import remotegtests
|
||||
tester = remotegtests.RemoteGTests()
|
||||
tester.run_gtest(shuffle, gtest_filter, package, adb_path, device_serial,
|
||||
remote_test_root, libxul_path, None)
|
||||
|
||||
return 0
|
||||
|
||||
def prepend_debugger_args(self, args, debugger, debugger_args):
|
||||
'''
|
||||
Given an array with program arguments, prepend arguments to run it under a
|
||||
|
@ -1152,4 +1152,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
|
||||
|
||||
static const int32_t kUnknownId = -1;
|
||||
|
||||
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1564057460770000);
|
||||
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1564403120415000);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -292,9 +292,10 @@ bool SandboxBroker::LaunchApp(const wchar_t* aPath, const wchar_t* aArguments,
|
||||
} else {
|
||||
// Load the child executable as a datafile so that we can examine its
|
||||
// headers without doing a full load with dependencies and such.
|
||||
moduleHandle.own(::LoadLibraryExW(aPath, nullptr, LOAD_LIBRARY_AS_DATAFILE));
|
||||
moduleHandle.own(
|
||||
::LoadLibraryExW(aPath, nullptr, LOAD_LIBRARY_AS_DATAFILE));
|
||||
LauncherResult<HMODULE> procExeModule =
|
||||
nt::GetProcessExeModule(targetInfo.hProcess);
|
||||
nt::GetProcessExeModule(targetInfo.hProcess);
|
||||
if (procExeModule.isOk()) {
|
||||
realBase = procExeModule.unwrap();
|
||||
} else {
|
||||
@ -306,8 +307,8 @@ bool SandboxBroker::LaunchApp(const wchar_t* aPath, const wchar_t* aArguments,
|
||||
if (moduleHandle && realBase) {
|
||||
nt::PEHeaders exeImage(moduleHandle.get());
|
||||
if (!!exeImage) {
|
||||
LauncherVoidResult importsRestored =
|
||||
RestoreImportDirectory(aPath, exeImage, targetInfo.hProcess, realBase);
|
||||
LauncherVoidResult importsRestored = RestoreImportDirectory(
|
||||
aPath, exeImage, targetInfo.hProcess, realBase);
|
||||
if (importsRestored.isErr()) {
|
||||
LOG_E("Failed to restore import directory with HRESULT 0x%08lX",
|
||||
importsRestored.unwrapErr().AsHResult());
|
||||
|
File diff suppressed because one or more lines are too long
@ -74,11 +74,11 @@
|
||||
},
|
||||
"awscli": {
|
||||
"hashes": [
|
||||
"sha256:00a438e74bfe7db2bfe4c0a7c91e87c2378133320e9f8b7ecd8f716557e74b0d",
|
||||
"sha256:7c19110758c5a8a549548ba471e76ed21e62d27f427047a34b334b0c83eeae7b"
|
||||
"sha256:2c7255fcda31b696b5501f28e68bd4db3c99ba5e73990a720c71f096f0a5f2e1",
|
||||
"sha256:40a876c1c6cc3f0d7bc37bf3011148242245c6ef6f1b7350bf7bbc210a71c9a4"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.16.140"
|
||||
"version": "==1.16.144"
|
||||
},
|
||||
"backports.lzma": {
|
||||
"hashes": [
|
||||
@ -88,10 +88,10 @@
|
||||
},
|
||||
"botocore": {
|
||||
"hashes": [
|
||||
"sha256:128130b12f8ba4bf07a673b119135264060eb98f6a4a7419cbd1f2c6dc926827",
|
||||
"sha256:59376112fdee707927b644dd44a1771861f8fe354a48d596131ced83d7a3c05b"
|
||||
"sha256:5c4d9ea1b0fbb1dc98b6a06ed8780096fca981a1c3599bf8f03f338e6aa389ae",
|
||||
"sha256:c59a74539eb081f4b3a307fc5c3d69d8459e30bfaf4b94aa78e74a9a05583764"
|
||||
],
|
||||
"version": "==1.12.130"
|
||||
"version": "==1.12.134"
|
||||
},
|
||||
"certifi": {
|
||||
"hashes": [
|
||||
@ -102,36 +102,36 @@
|
||||
},
|
||||
"cffi": {
|
||||
"hashes": [
|
||||
"sha256:00b97afa72c233495560a0793cdc86c2571721b4271c0667addc83c417f3d90f",
|
||||
"sha256:0ba1b0c90f2124459f6966a10c03794082a2f3985cd699d7d63c4a8dae113e11",
|
||||
"sha256:0bffb69da295a4fc3349f2ec7cbe16b8ba057b0a593a92cbe8396e535244ee9d",
|
||||
"sha256:21469a2b1082088d11ccd79dd84157ba42d940064abbfa59cf5f024c19cf4891",
|
||||
"sha256:2e4812f7fa984bf1ab253a40f1f4391b604f7fc424a3e21f7de542a7f8f7aedf",
|
||||
"sha256:2eac2cdd07b9049dd4e68449b90d3ef1adc7c759463af5beb53a84f1db62e36c",
|
||||
"sha256:2f9089979d7456c74d21303c7851f158833d48fb265876923edcb2d0194104ed",
|
||||
"sha256:3dd13feff00bddb0bd2d650cdb7338f815c1789a91a6f68fdc00e5c5ed40329b",
|
||||
"sha256:4065c32b52f4b142f417af6f33a5024edc1336aa845b9d5a8d86071f6fcaac5a",
|
||||
"sha256:51a4ba1256e9003a3acf508e3b4f4661bebd015b8180cc31849da222426ef585",
|
||||
"sha256:59888faac06403767c0cf8cfb3f4a777b2939b1fbd9f729299b5384f097f05ea",
|
||||
"sha256:59c87886640574d8b14910840327f5cd15954e26ed0bbd4e7cef95fa5aef218f",
|
||||
"sha256:610fc7d6db6c56a244c2701575f6851461753c60f73f2de89c79bbf1cc807f33",
|
||||
"sha256:70aeadeecb281ea901bf4230c6222af0248c41044d6f57401a614ea59d96d145",
|
||||
"sha256:71e1296d5e66c59cd2c0f2d72dc476d42afe02aeddc833d8e05630a0551dad7a",
|
||||
"sha256:8fc7a49b440ea752cfdf1d51a586fd08d395ff7a5d555dc69e84b1939f7ddee3",
|
||||
"sha256:9b5c2afd2d6e3771d516045a6cfa11a8da9a60e3d128746a7fe9ab36dfe7221f",
|
||||
"sha256:9c759051ebcb244d9d55ee791259ddd158188d15adee3c152502d3b69005e6bd",
|
||||
"sha256:b4d1011fec5ec12aa7cc10c05a2f2f12dfa0adfe958e56ae38dc140614035804",
|
||||
"sha256:b4f1d6332339ecc61275bebd1f7b674098a66fea11a00c84d1c58851e618dc0d",
|
||||
"sha256:c030cda3dc8e62b814831faa4eb93dd9a46498af8cd1d5c178c2de856972fd92",
|
||||
"sha256:c2e1f2012e56d61390c0e668c20c4fb0ae667c44d6f6a2eeea5d7148dcd3df9f",
|
||||
"sha256:c37c77d6562074452120fc6c02ad86ec928f5710fbc435a181d69334b4de1d84",
|
||||
"sha256:c8149780c60f8fd02752d0429246088c6c04e234b895c4a42e1ea9b4de8d27fb",
|
||||
"sha256:cbeeef1dc3c4299bd746b774f019de9e4672f7cc666c777cd5b409f0b746dac7",
|
||||
"sha256:e113878a446c6228669144ae8a56e268c91b7f1fafae927adc4879d9849e0ea7",
|
||||
"sha256:e21162bf941b85c0cda08224dade5def9360f53b09f9f259adb85fc7dd0e7b35",
|
||||
"sha256:fb6934ef4744becbda3143d30c6604718871495a5e36c408431bf33d9c146889"
|
||||
"sha256:041c81822e9f84b1d9c401182e174996f0bae9991f33725d059b771744290774",
|
||||
"sha256:046ef9a22f5d3eed06334d01b1e836977eeef500d9b78e9ef693f9380ad0b83d",
|
||||
"sha256:066bc4c7895c91812eff46f4b1c285220947d4aa46fa0a2651ff85f2afae9c90",
|
||||
"sha256:066c7ff148ae33040c01058662d6752fd73fbc8e64787229ea8498c7d7f4041b",
|
||||
"sha256:2444d0c61f03dcd26dbf7600cf64354376ee579acad77aef459e34efcb438c63",
|
||||
"sha256:300832850b8f7967e278870c5d51e3819b9aad8f0a2c8dbe39ab11f119237f45",
|
||||
"sha256:34c77afe85b6b9e967bd8154e3855e847b70ca42043db6ad17f26899a3df1b25",
|
||||
"sha256:46de5fa00f7ac09f020729148ff632819649b3e05a007d286242c4882f7b1dc3",
|
||||
"sha256:4aa8ee7ba27c472d429b980c51e714a24f47ca296d53f4d7868075b175866f4b",
|
||||
"sha256:4d0004eb4351e35ed950c14c11e734182591465a33e960a4ab5e8d4f04d72647",
|
||||
"sha256:4e3d3f31a1e202b0f5a35ba3bc4eb41e2fc2b11c1eff38b362de710bcffb5016",
|
||||
"sha256:50bec6d35e6b1aaeb17f7c4e2b9374ebf95a8975d57863546fa83e8d31bdb8c4",
|
||||
"sha256:55cad9a6df1e2a1d62063f79d0881a414a906a6962bc160ac968cc03ed3efcfb",
|
||||
"sha256:5662ad4e4e84f1eaa8efce5da695c5d2e229c563f9d5ce5b0113f71321bcf753",
|
||||
"sha256:59b4dc008f98fc6ee2bb4fd7fc786a8d70000d058c2bbe2698275bc53a8d3fa7",
|
||||
"sha256:73e1ffefe05e4ccd7bcea61af76f36077b914f92b76f95ccf00b0c1b9186f3f9",
|
||||
"sha256:a1f0fd46eba2d71ce1589f7e50a9e2ffaeb739fb2c11e8192aa2b45d5f6cc41f",
|
||||
"sha256:a2e85dc204556657661051ff4bab75a84e968669765c8a2cd425918699c3d0e8",
|
||||
"sha256:a5457d47dfff24882a21492e5815f891c0ca35fefae8aa742c6c263dac16ef1f",
|
||||
"sha256:a8dccd61d52a8dae4a825cdbb7735da530179fea472903eb871a5513b5abbfdc",
|
||||
"sha256:ae61af521ed676cf16ae94f30fe202781a38d7178b6b4ab622e4eec8cefaff42",
|
||||
"sha256:b012a5edb48288f77a63dba0840c92d0504aa215612da4541b7b42d849bc83a3",
|
||||
"sha256:d2c5cfa536227f57f97c92ac30c8109688ace8fa4ac086d19d0af47d134e2909",
|
||||
"sha256:d42b5796e20aacc9d15e66befb7a345454eef794fdb0737d1af593447c6c8f45",
|
||||
"sha256:dee54f5d30d775f525894d67b1495625dd9322945e7fee00731952e0368ff42d",
|
||||
"sha256:e070535507bd6aa07124258171be2ee8dfc19119c28ca94c9dfb7efd23564512",
|
||||
"sha256:e1ff2748c84d97b065cc95429814cdba39bcbd77c9c85c89344b317dc0d9cbff",
|
||||
"sha256:ed851c75d1e0e043cbf5ca9a8e1b13c4c90f3fbd863dacb01c0808e2b5204201"
|
||||
],
|
||||
"version": "==1.12.2"
|
||||
"version": "==1.12.3"
|
||||
},
|
||||
"chardet": {
|
||||
"hashes": [
|
||||
@ -392,11 +392,10 @@
|
||||
},
|
||||
"scriptworker": {
|
||||
"hashes": [
|
||||
"sha256:a6b093387dc35452421119b6313932025de2c6587603136442f36a7bec5d4bf2",
|
||||
"sha256:dfc14639559a07a2b0883193390e313187d1f9c5107cd102ccbf88806debcb80"
|
||||
"sha256:643ace350b233bbb77637763e770cac2f13f2a7fe871042390042bd9e5b10338"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==23.0.2"
|
||||
"version": "==23.0.3"
|
||||
},
|
||||
"sh": {
|
||||
"hashes": [
|
||||
@ -455,11 +454,11 @@
|
||||
},
|
||||
"urllib3": {
|
||||
"hashes": [
|
||||
"sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39",
|
||||
"sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22"
|
||||
"sha256:4c291ca23bbb55c76518905869ef34bdd5f0e46af7afe6861e8375643ffee1a0",
|
||||
"sha256:9a247273df709c4fedb38c711e44292304f73f39ab01beda9f6b9fc375669ac3"
|
||||
],
|
||||
"markers": "python_version >= '3.4'",
|
||||
"version": "==1.24.1"
|
||||
"version": "==1.24.2"
|
||||
},
|
||||
"yarl": {
|
||||
"hashes": [
|
||||
|
@ -30,7 +30,7 @@ class RemoteGTests(object):
|
||||
A test harness to run gtest on Android.
|
||||
"""
|
||||
|
||||
def build_environment(self, options, test_filter):
|
||||
def build_environment(self, shuffle, test_filter):
|
||||
"""
|
||||
Create and return a dictionary of all the appropriate env variables
|
||||
and values.
|
||||
@ -40,32 +40,35 @@ class RemoteGTests(object):
|
||||
env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
|
||||
env["MOZ_CRASHREPORTER"] = "1"
|
||||
env["MOZ_RUN_GTEST"] = "1"
|
||||
# custom output parser is mandatory on Android
|
||||
env["MOZ_TBPL_PARSER"] = "1"
|
||||
env["MOZ_GTEST_LOG_PATH"] = self.remote_log
|
||||
env["MOZ_GTEST_MINIDUMPS_PATH"] = self.remote_minidumps
|
||||
env["MOZ_IN_AUTOMATION"] = "1"
|
||||
if options.shuffle:
|
||||
if shuffle:
|
||||
env["GTEST_SHUFFLE"] = "True"
|
||||
if test_filter:
|
||||
env["GTEST_FILTER"] = test_filter
|
||||
|
||||
return env
|
||||
|
||||
def run_gtest(self, options, test_filter):
|
||||
def run_gtest(self, shuffle, test_filter, package, adb_path, device_serial,
|
||||
remote_test_root, libxul_path, symbols_path):
|
||||
"""
|
||||
Launch the test app, run gtest, collect test results and wait for completion.
|
||||
Return False if a crash or other failure is detected, else True.
|
||||
"""
|
||||
self.device = mozdevice.ADBDevice(adb=options.adb_path,
|
||||
device=options.device_serial,
|
||||
test_root=options.test_root,
|
||||
update_mozinfo()
|
||||
self.device = mozdevice.ADBDevice(adb=adb_path,
|
||||
device=device_serial,
|
||||
test_root=remote_test_root,
|
||||
logger_name=LOGGER_NAME,
|
||||
verbose=True)
|
||||
root = self.device.test_root
|
||||
self.remote_profile = posixpath.join(root, 'gtest-profile')
|
||||
self.remote_minidumps = posixpath.join(root, 'gtest-minidumps')
|
||||
self.remote_log = posixpath.join(root, 'gtest.log')
|
||||
self.package = options.package
|
||||
self.package = package
|
||||
self.cleanup()
|
||||
self.device.mkdir(self.remote_profile, parents=True)
|
||||
self.device.mkdir(self.remote_minidumps, parents=True)
|
||||
@ -78,9 +81,9 @@ class RemoteGTests(object):
|
||||
|
||||
# TODO -- consider packaging the gtest libxul.so in an apk
|
||||
remote = "/data/app/%s-1/lib/x86_64/" % self.package
|
||||
self.device.push(options.libxul_path, remote)
|
||||
self.device.push(libxul_path, remote)
|
||||
|
||||
env = self.build_environment(options, test_filter)
|
||||
env = self.build_environment(shuffle, test_filter)
|
||||
args = ["-unittest", "--gtest_death_test_style=threadsafe",
|
||||
"-profile %s" % self.remote_profile]
|
||||
if 'geckoview' in self.package:
|
||||
@ -93,7 +96,7 @@ class RemoteGTests(object):
|
||||
waiter = AppWaiter(self.device, self.remote_log)
|
||||
timed_out = waiter.wait(self.package)
|
||||
self.shutdown(use_kill=True if timed_out else False)
|
||||
if self.check_for_crashes(options.symbols_path):
|
||||
if self.check_for_crashes(symbols_path):
|
||||
return False
|
||||
return True
|
||||
|
||||
@ -313,7 +316,7 @@ class remoteGtestOptions(OptionParser):
|
||||
self.add_option("--remoteTestRoot",
|
||||
action="store",
|
||||
type=str,
|
||||
dest="test_root",
|
||||
dest="remote_test_root",
|
||||
help="Remote directory to use as test root "
|
||||
"(eg. /mnt/sdcard/tests or /data/local/tests).")
|
||||
self.add_option("--libxul",
|
||||
@ -357,12 +360,14 @@ def main():
|
||||
parser.error("only one test_filter is allowed")
|
||||
sys.exit(1)
|
||||
test_filter = args[0] if args else None
|
||||
update_mozinfo()
|
||||
tester = RemoteGTests()
|
||||
result = False
|
||||
try:
|
||||
device_exception = False
|
||||
result = tester.run_gtest(options, test_filter)
|
||||
result = tester.run_gtest(options.shuffle, test_filter, options.package,
|
||||
options.adb_path, options.device_serial,
|
||||
options.remote_test_root, options.libxul_path,
|
||||
options.symbols_path)
|
||||
except KeyboardInterrupt:
|
||||
log.info("gtest | Received keyboard interrupt")
|
||||
except Exception as e:
|
||||
|
@ -1088,7 +1088,8 @@ int processConfigLine(char* configLine) {
|
||||
|
||||
if (server_info_t* existingServer = findServerInfo(port)) {
|
||||
if (!hostportstring) {
|
||||
LOG_ERROR(("Null hostportstring specified for hostname %s\n", hostname));
|
||||
LOG_ERROR(
|
||||
("Null hostportstring specified for hostname %s\n", hostname));
|
||||
return 1;
|
||||
}
|
||||
char* certnick_copy = new char[strlen(certnick) + 1];
|
||||
|
@ -1818,7 +1818,7 @@ class ADBDevice(ADBCommand):
|
||||
# External storage on Android is case-insensitive and permissionless
|
||||
# therefore even with the proper privileges it is not possible
|
||||
# to change modes.
|
||||
self._logger.warning('Ignoring attempt to chmod external storage')
|
||||
self._logger.debug('Ignoring attempt to chmod external storage')
|
||||
return
|
||||
|
||||
# build up the command to be run based on capabilities.
|
||||
|
35
testing/web-platform/tests/css/cssom-view/outer-svg.html
Normal file
35
testing/web-platform/tests/css/cssom-view/outer-svg.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!doctype html>
|
||||
<title>CSS Tests: client* and scroll* APIs work as expected with outer SVG elements</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface">
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=874811">
|
||||
<link rel="author" title="violet" href="mailto:violet.bugreport@gmail.com">
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
<link rel="author" title="Mozilla" href="https://mozilla.org">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#u {
|
||||
padding: 30px;
|
||||
transform: translate(50px,60px) scale(2,3);
|
||||
border: 5px solid lime;
|
||||
width: 50px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
<div style="width: 100px; height: 2000px; border: 1px solid blue"></div>
|
||||
<svg id="u"></svg>
|
||||
<script>
|
||||
let u = document.getElementById("u");
|
||||
test(function() {
|
||||
assert_equals(u.clientTop, 5, "u.clientTop");
|
||||
assert_equals(u.clientLeft, 5, "u.clientLeft");
|
||||
assert_equals(u.clientWidth, 110, "u.clientWidth");
|
||||
assert_equals(u.clientHeight, 160, "u.clientHeight");
|
||||
}, "clientWidth, clientHeight, clientTop and clientLeft work on outer svg element");
|
||||
test(function() {
|
||||
assert_equals(u.scrollTop, 0, "u.scrollTop");
|
||||
assert_equals(u.scrollLeft, 0, "u.scrollLeft");
|
||||
assert_equals(u.scrollWidth, 110, "u.scrollWidth");
|
||||
assert_equals(u.scrollHeight, 160, "u.scrollHeight");
|
||||
}, "scrollWidth, scrollHeight, scrollTop and scrollLeft work on outer svg element");
|
||||
</script>
|
@ -94,6 +94,8 @@ pub enum StartJobFailure {
|
||||
ApplySettings(HResultMessage),
|
||||
#[fail(display = "Resume job: {}", _0)]
|
||||
Resume(HResultMessage),
|
||||
#[fail(display = "Connect to BackgroundCopyManager: {}", _0)]
|
||||
ConnectBcm(HResultMessage),
|
||||
#[fail(display = "BITS error: {}", _0)]
|
||||
OtherBITS(HResultMessage),
|
||||
#[fail(display = "Other failure: {}", _0)]
|
||||
@ -124,6 +126,8 @@ pub enum MonitorJobFailure {
|
||||
NotFound,
|
||||
#[fail(display = "Get job: {}", _0)]
|
||||
GetJob(HResultMessage),
|
||||
#[fail(display = "Connect to BackgroundCopyManager: {}", _0)]
|
||||
ConnectBcm(HResultMessage),
|
||||
#[fail(display = "BITS error: {}", _0)]
|
||||
OtherBITS(HResultMessage),
|
||||
#[fail(display = "Other failure: {}", _0)]
|
||||
@ -153,6 +157,8 @@ pub enum SuspendJobFailure {
|
||||
GetJob(HResultMessage),
|
||||
#[fail(display = "Suspend job: {}", _0)]
|
||||
SuspendJob(HResultMessage),
|
||||
#[fail(display = "Connect to BackgroundCopyManager: {}", _0)]
|
||||
ConnectBcm(HResultMessage),
|
||||
#[fail(display = "BITS error: {}", _0)]
|
||||
OtherBITS(HResultMessage),
|
||||
#[fail(display = "Other failure: {}", _0)]
|
||||
@ -182,6 +188,8 @@ pub enum ResumeJobFailure {
|
||||
GetJob(HResultMessage),
|
||||
#[fail(display = "Resume job: {}", _0)]
|
||||
ResumeJob(HResultMessage),
|
||||
#[fail(display = "Connect to BackgroundCopyManager: {}", _0)]
|
||||
ConnectBcm(HResultMessage),
|
||||
#[fail(display = "BITS error: {}", _0)]
|
||||
OtherBITS(HResultMessage),
|
||||
#[fail(display = "Other failure: {}", _0)]
|
||||
@ -212,6 +220,8 @@ pub enum SetJobPriorityFailure {
|
||||
GetJob(HResultMessage),
|
||||
#[fail(display = "Apply settings to job: {}", _0)]
|
||||
ApplySettings(HResultMessage),
|
||||
#[fail(display = "Connect to BackgroundCopyManager: {}", _0)]
|
||||
ConnectBcm(HResultMessage),
|
||||
#[fail(display = "BITS error: {}", _0)]
|
||||
OtherBITS(HResultMessage),
|
||||
#[fail(display = "Other failure: {}", _0)]
|
||||
@ -269,6 +279,8 @@ pub enum CompleteJobFailure {
|
||||
CompleteJob(HResultMessage),
|
||||
#[fail(display = "Job only partially completed")]
|
||||
PartialComplete,
|
||||
#[fail(display = "Connect to BackgroundCopyManager: {}", _0)]
|
||||
ConnectBcm(HResultMessage),
|
||||
#[fail(display = "BITS error: {}", _0)]
|
||||
OtherBITS(HResultMessage),
|
||||
#[fail(display = "Other failure: {}", _0)]
|
||||
@ -298,6 +310,8 @@ pub enum CancelJobFailure {
|
||||
GetJob(HResultMessage),
|
||||
#[fail(display = "Cancel job: {}", _0)]
|
||||
CancelJob(HResultMessage),
|
||||
#[fail(display = "Connect to BackgroundCopyManager: {}", _0)]
|
||||
ConnectBcm(HResultMessage),
|
||||
#[fail(display = "BITS error: {}", _0)]
|
||||
OtherBITS(HResultMessage),
|
||||
#[fail(display = "Other failure: {}", _0)]
|
||||
|
@ -21,7 +21,12 @@ use super::Error;
|
||||
// This is a macro in order to use the NotFound and GetJob variants from whatever enum is in scope.
|
||||
macro_rules! get_job {
|
||||
($bcm:ident, $guid:expr, $name:expr) => {{
|
||||
$bcm = BackgroundCopyManager::connect().map_err(|e| Other(e.to_string()))?;
|
||||
$bcm = BackgroundCopyManager::connect().map_err(|e| {
|
||||
ConnectBcm(HResultMessage {
|
||||
hr: e.code(),
|
||||
message: e.to_string(),
|
||||
})
|
||||
})?;
|
||||
$bcm.find_job_by_guid_and_name($guid, $name)
|
||||
.map_err(|e| GetJob($crate::in_process::format_error(&$bcm, e)))?
|
||||
.ok_or(NotFound)?
|
||||
@ -99,7 +104,12 @@ impl InProcessClient {
|
||||
// If the job is dropped before `AddFile` succeeds, I think it automatically gets
|
||||
// deleted from the queue. There is only one fallible call after that (`Resume`).
|
||||
|
||||
let bcm = BackgroundCopyManager::connect().map_err(|e| Other(e.to_string()))?;
|
||||
let bcm = BackgroundCopyManager::connect().map_err(|e| {
|
||||
ConnectBcm(HResultMessage {
|
||||
hr: e.code(),
|
||||
message: e.to_string(),
|
||||
})
|
||||
})?;
|
||||
let mut job = bcm
|
||||
.create_job(&self.job_name)
|
||||
.map_err(|e| Create(format_error(&bcm, e)))?;
|
||||
|
@ -88,6 +88,7 @@ interface nsIBits : nsISupports
|
||||
const long ERROR_TYPE_BITS_STATE_UNEXPECTED = 46;
|
||||
const long ERROR_TYPE_VERIFICATION_FAILURE = 47;
|
||||
const long ERROR_TYPE_ACCESS_DENIED_EXPECTED = 48;
|
||||
const long ERROR_TYPE_FAILED_TO_CONNECT_TO_BCM = 49;
|
||||
|
||||
/**
|
||||
* nsBitsErrorAction values
|
||||
|
@ -60,6 +60,7 @@ pub enum ErrorType {
|
||||
BitsStateTransientError,
|
||||
BitsStateCancelled,
|
||||
BitsStateUnexpected,
|
||||
FailedToConnectToBcm,
|
||||
}
|
||||
|
||||
impl ErrorType {
|
||||
@ -116,6 +117,7 @@ impl ErrorType {
|
||||
ErrorType::BitsStateTransientError => nsIBits::ERROR_TYPE_BITS_STATE_TRANSIENT_ERROR,
|
||||
ErrorType::BitsStateCancelled => nsIBits::ERROR_TYPE_BITS_STATE_CANCELLED,
|
||||
ErrorType::BitsStateUnexpected => nsIBits::ERROR_TYPE_BITS_STATE_UNEXPECTED,
|
||||
ErrorType::FailedToConnectToBcm => nsIBits::ERROR_TYPE_FAILED_TO_CONNECT_TO_BCM,
|
||||
};
|
||||
val as i32
|
||||
}
|
||||
@ -311,6 +313,12 @@ impl From<StartJobFailure> for BitsTaskError {
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
StartJobFailure::ConnectBcm(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::FailedToConnectToBcm,
|
||||
error_action,
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
StartJobFailure::OtherBITS(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::OtherBitsError,
|
||||
error_action,
|
||||
@ -350,6 +358,12 @@ impl From<MonitorJobFailure> for BitsTaskError {
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
MonitorJobFailure::ConnectBcm(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::FailedToConnectToBcm,
|
||||
error_action,
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
MonitorJobFailure::OtherBITS(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::OtherBitsError,
|
||||
error_action,
|
||||
@ -389,6 +403,12 @@ impl From<SuspendJobFailure> for BitsTaskError {
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
SuspendJobFailure::ConnectBcm(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::FailedToConnectToBcm,
|
||||
error_action,
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
SuspendJobFailure::OtherBITS(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::OtherBitsError,
|
||||
error_action,
|
||||
@ -428,6 +448,12 @@ impl From<ResumeJobFailure> for BitsTaskError {
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
ResumeJobFailure::ConnectBcm(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::FailedToConnectToBcm,
|
||||
error_action,
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
ResumeJobFailure::OtherBITS(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::OtherBitsError,
|
||||
error_action,
|
||||
@ -467,6 +493,12 @@ impl From<SetJobPriorityFailure> for BitsTaskError {
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
SetJobPriorityFailure::ConnectBcm(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::FailedToConnectToBcm,
|
||||
error_action,
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
SetJobPriorityFailure::OtherBITS(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::OtherBitsError,
|
||||
error_action,
|
||||
@ -539,6 +571,12 @@ impl From<CompleteJobFailure> for BitsTaskError {
|
||||
error_stage,
|
||||
error_code: ErrorCode::None,
|
||||
},
|
||||
CompleteJobFailure::ConnectBcm(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::FailedToConnectToBcm,
|
||||
error_action,
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
CompleteJobFailure::OtherBITS(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::OtherBitsError,
|
||||
error_action,
|
||||
@ -578,6 +616,12 @@ impl From<CancelJobFailure> for BitsTaskError {
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
CancelJobFailure::ConnectBcm(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::FailedToConnectToBcm,
|
||||
error_action,
|
||||
error_stage,
|
||||
error_code: error_code.into(),
|
||||
},
|
||||
CancelJobFailure::OtherBITS(error_code) => BitsTaskError {
|
||||
error_type: ErrorType::OtherBitsError,
|
||||
error_action,
|
||||
|
@ -311,6 +311,9 @@ MozElements.MozElementMixin = Base => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear out any existing cached elements:
|
||||
this._inheritedElements = null;
|
||||
|
||||
this.initializedAttributeInheritance = true;
|
||||
for (let attr in flippedInheritedAttributes) {
|
||||
if (this.hasAttribute(attr)) {
|
||||
|
@ -133,6 +133,7 @@
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
this.textContent = "";
|
||||
this.append(MozXULElement.parseXULToFragment(`<label />`));
|
||||
this.label = this.querySelector("label");
|
||||
this.initializeAttributeInheritance();
|
||||
@ -150,6 +151,10 @@
|
||||
customElements.define("inherited-element-derived", InheritsElementDerived);
|
||||
|
||||
class InheritsElementShadowDOMDeclarative extends MozXULElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.attachShadow({ mode: "open" });
|
||||
}
|
||||
static get inheritedAttributes() {
|
||||
return {
|
||||
"label": "text=label,foo,empty-string,bardo=bar",
|
||||
@ -158,7 +163,7 @@
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
this.attachShadow({ mode: "open" });
|
||||
this.shadowRoot.textContent = "";
|
||||
this.shadowRoot.append(MozXULElement.parseXULToFragment(`<label />`));
|
||||
this.label = this.shadowRoot.querySelector("label");
|
||||
this.initializeAttributeInheritance();
|
||||
@ -192,6 +197,10 @@
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
// Typically `initializeAttributeInheritance` handles this for us:
|
||||
this._inheritedElements = null;
|
||||
|
||||
this.textContent = "";
|
||||
this.append(MozXULElement.parseXULToFragment(`<label />`));
|
||||
this.label = this.querySelector("label");
|
||||
this.inherit();
|
||||
@ -202,8 +211,7 @@
|
||||
let imperativeEl = document.querySelector("inherited-element-imperative");
|
||||
ok(imperativeEl, "imperative inheritance element exists");
|
||||
|
||||
for (let el of [declarativeEl, shadowDOMDeclarativeEl, imperativeEl]) {
|
||||
info(`Running checks for ${el.tagName}`);
|
||||
function checkElement(el) {
|
||||
is(el.label.getAttribute("foo"), "fuagra", "predefined attribute @foo");
|
||||
ok(el.label.hasAttribute("empty-string"), "predefined attribute @empty-string");
|
||||
ok(!el.label.hasAttribute("bardo"), "predefined attribute @bardo");
|
||||
@ -240,6 +248,18 @@
|
||||
el.setAttribute("bar", "changed-from-host-2");
|
||||
is(el.label.getAttribute("bardo"), "changed-from-host-2",
|
||||
"attribute inheritance: does apply when host attr has changed after being removed");
|
||||
|
||||
// Restore to the original state so this can be ran again with the same element:
|
||||
el.removeAttribute("label");
|
||||
el.removeAttribute("bar");
|
||||
}
|
||||
|
||||
for (let el of [declarativeEl, shadowDOMDeclarativeEl, imperativeEl]) {
|
||||
info(`Running checks for ${el.tagName}`);
|
||||
checkElement(el);
|
||||
info(`Remove and re-add ${el.tagName} to make sure attribute inheritance still works`);
|
||||
el.replaceWith(el);
|
||||
checkElement(el);
|
||||
}
|
||||
|
||||
let derivedEl = document.querySelector("inherited-element-derived");
|
||||
|
@ -1,14 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="chrome://mozapps/content/extensions/aboutaddons.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
|
||||
<link rel="stylesheet" href="chrome://mozapps/content/extensions/aboutaddons.css">
|
||||
|
||||
<link rel="localization" href="branding/brand.ftl"/>
|
||||
<link rel="localization" href="toolkit/about/aboutAddons.ftl"/>
|
||||
<link rel="localization" href="branding/brand.ftl">
|
||||
<link rel="localization" href="toolkit/about/aboutAddons.ftl">
|
||||
|
||||
<script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"></script>
|
||||
<script type="application/javascript" src="chrome://mozapps/content/extensions/aboutaddons.js"></script>
|
||||
<script src="chrome://global/content/contentAreaUtils.js"></script>
|
||||
<script src="chrome://mozapps/content/extensions/aboutaddons.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
@ -16,9 +16,9 @@
|
||||
|
||||
<template name="card">
|
||||
<div class="card addon">
|
||||
<img class="card-heading-image"/>
|
||||
<img class="card-heading-image">
|
||||
<div class="addon-card-collapsed">
|
||||
<img class="card-heading-icon addon-icon"/>
|
||||
<img class="card-heading-icon addon-icon">
|
||||
<div class="card-contents">
|
||||
<span class="addon-name"></span>
|
||||
<span class="addon-description"></span>
|
||||
@ -74,17 +74,17 @@
|
||||
</template>
|
||||
|
||||
<template name="panel-list">
|
||||
<link rel="stylesheet" href="chrome://mozapps/content/extensions/panel-list.css"/>
|
||||
<link rel="stylesheet" href="chrome://mozapps/content/extensions/panel-list.css">
|
||||
<div class="arrow top"></div>
|
||||
<div class="list">
|
||||
<slot/>
|
||||
<slot></slot>
|
||||
</div>
|
||||
<div class="arrow bottom"></div>
|
||||
</template>
|
||||
|
||||
<template name="panel-item">
|
||||
<link rel="stylesheet" href="chrome://mozapps/content/extensions/panel-item.css"/>
|
||||
<button><slot/></button>
|
||||
<link rel="stylesheet" href="chrome://mozapps/content/extensions/panel-item.css">
|
||||
<button><slot></slot></button>
|
||||
</template>
|
||||
</body>
|
||||
</html>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user