Merge autoland to mozilla-central. a=merge

This commit is contained in:
Ciure Andrei 2019-05-24 00:51:34 +03:00
Родитель 48cbbb3137 a875b0a496
Коммит 90fa4c6afd
343 изменённых файлов: 4460 добавлений и 2481 удалений

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

@ -537,7 +537,22 @@ Accessible* Accessible::ChildAtPoint(int32_t aX, int32_t aY,
// This happens in mobile platforms with async pinch zooming.
offset = offset.RemoveResolution(presContext->PresShell()->GetResolution());
nsIFrame* foundFrame = nsLayoutUtils::GetFrameForPoint(startFrame, offset);
// We need to translate with the offset of the edge of the visual
// viewport from top edge of the layout viewport.
offset += presContext->PresShell()->GetVisualViewportOffset() -
presContext->PresShell()->GetLayoutViewportOffset();
EnumSet<nsLayoutUtils::FrameForPointOption> options = {
#ifdef MOZ_WIDGET_ANDROID
// This is needed in Android to ignore the clipping of the scroll frame
// when zoomed in. May regress something on other platforms, so
// keeping it Android-exclusive for now.
nsLayoutUtils::FrameForPointOption::IgnoreRootScrollFrame
#endif
};
nsIFrame* foundFrame =
nsLayoutUtils::GetFrameForPoint(startFrame, offset, options);
nsIContent* content = nullptr;
if (!foundFrame || !(content = foundFrame->GetContent()))
@ -645,11 +660,18 @@ nsRect Accessible::BoundsInAppUnits() const {
return nsRect();
}
PresShell* presShell = mDoc->PresContext()->PresShell();
// We need to inverse translate with the offset of the edge of the visual
// viewport from top edge of the layout viewport.
nsPoint viewportOffset = presShell->GetVisualViewportOffset() -
presShell->GetLayoutViewportOffset();
unionRectTwips.MoveBy(-viewportOffset);
// We need to take into account a non-1 resolution set on the presshell.
// This happens in mobile platforms with async pinch zooming. Here we
// scale the bounds before adding the screen-relative offset.
unionRectTwips.ScaleRoundOut(
mDoc->PresContext()->PresShell()->GetResolution());
unionRectTwips.ScaleRoundOut(presShell->GetResolution());
// We have the union of the rectangle, now we need to put it in absolute
// screen coords.
nsRect orgRectPixels = boundingFrame->GetScreenRectInAppUnits();

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

@ -304,7 +304,7 @@ bool HTMLComboboxAccessible::RemoveChild(Accessible* aChild) {
}
void HTMLComboboxAccessible::Shutdown() {
MOZ_ASSERT(mDoc->IsDefunct() || !mListAccessible);
MOZ_ASSERT(!mDoc || mDoc->IsDefunct() || !mListAccessible);
if (mListAccessible) {
mListAccessible->Shutdown();
mListAccessible = nullptr;

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

@ -13,7 +13,7 @@ cpp_quote("// get_nodeInfo(")
cpp_quote("// /* [out] */ BSTR *nodeName, // For elements, this is the tag name")
cpp_quote("// /* [out] */ short *nameSpaceID,")
cpp_quote("// /* [out] */ BSTR *nodeValue, ")
cpp_quote("// /* [out] */ unsigned int *numChildren); ")
cpp_quote("// /* [out] */ unsigned int *numChildren); ")
cpp_quote("// /* [out] */ unsigned int *uniqueID; // In Win32 accessible events we generate, the target's childID matches to this")
cpp_quote("// /* [out] */ unsigned short *nodeType,")
cpp_quote("// ---------------------------------------------------------------------------------------------------=")
@ -124,33 +124,33 @@ interface ISimpleDOMNode : IUnknown
[out, retval] unsigned short *nodeType
);
[propget] HRESULT attributes(
[propget] HRESULT attributes(
[in] unsigned short maxAttribs,
[out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribNames,
[out, size_is(maxAttribs), length_is(*numAttribs)] short *nameSpaceID,
[out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribNames,
[out, size_is(maxAttribs), length_is(*numAttribs)] short *nameSpaceID,
[out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribValues,
[out, retval] unsigned short *numAttribs
);
[propget] HRESULT attributesForNames(
[propget] HRESULT attributesForNames(
[in] unsigned short numAttribs,
[in, size_is(numAttribs), length_is(numAttribs)] BSTR *attribNames,
[in, size_is(numAttribs), length_is(numAttribs)] short *nameSpaceID,
[in, size_is(numAttribs), length_is(numAttribs)] BSTR *attribNames,
[in, size_is(numAttribs), length_is(numAttribs)] short *nameSpaceID,
[out, retval, size_is(numAttribs), length_is(numAttribs)] BSTR *attribValues
);
[propget] HRESULT computedStyle(
[propget] HRESULT computedStyle(
[in] unsigned short maxStyleProperties,
[in] boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes
[out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleProperties,
[out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleProperties,
[out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleValues,
[out, retval] unsigned short *numStyleProperties
);
[propget] HRESULT computedStyleForProperties(
[in] unsigned short numStyleProperties,
[propget] HRESULT computedStyleForProperties(
[in] unsigned short numStyleProperties,
[in] boolean useAlternateView, // If TRUE, returns properites for media as set in Document's set_alternateViewMediaTypes
[in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleProperties,
[in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleProperties,
[out, retval, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleValues
);
@ -161,7 +161,7 @@ interface ISimpleDOMNode : IUnknown
[propget] HRESULT lastChild([out, retval] ISimpleDOMNode **node);
[propget] HRESULT previousSibling([out, retval] ISimpleDOMNode **node);
[propget] HRESULT nextSibling([out, retval] ISimpleDOMNode **node);
[propget] HRESULT childAt([in] unsigned childIndex,
[propget] HRESULT childAt([in] unsigned childIndex,
[out, retval] ISimpleDOMNode **node);
[propget] HRESULT innerHTML([out, retval] BSTR *innerHTML);

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

@ -6,7 +6,7 @@
import "objidl.idl";
import "oaidl.idl";
cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////")
cpp_quote("//")
cpp_quote("// ISimpleDOMText")
@ -57,21 +57,21 @@ interface ISimpleDOMText: IUnknown
// Includes whitespace in DOM
[propget] HRESULT domText([out, retval] BSTR *domText);
HRESULT get_clippedSubstringBounds([in] unsigned int startIndex,
[in] unsigned int endIndex,
HRESULT get_clippedSubstringBounds([in] unsigned int startIndex,
[in] unsigned int endIndex,
[out] int *x,
[out] int *y,
[out] int *width,
[out] int *height);
HRESULT get_unclippedSubstringBounds([in] unsigned int startIndex,
[in] unsigned int endIndex,
HRESULT get_unclippedSubstringBounds([in] unsigned int startIndex,
[in] unsigned int endIndex,
[out] int *x,
[out] int *y,
[out] int *width,
[out] int *height);
HRESULT scrollToSubstring([in] unsigned int startIndex,
HRESULT scrollToSubstring([in] unsigned int startIndex,
[in] unsigned int endIndex);
[propget] HRESULT fontFamily([out, retval] BSTR *fontFamily);

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

@ -19,11 +19,11 @@ webidl Node;
* by in-process accessibility clients, which can be used
* to find out how to get accessibility and DOM interfaces for
* the event and its target. To listen to in-process accessibility invents,
* make your object an nsIObserver, and listen for accessible-event by
* make your object an nsIObserver, and listen for accessible-event by
* using code something like this:
* nsCOMPtr<nsIObserverService> observerService =
* nsCOMPtr<nsIObserverService> observerService =
* do_GetService("@mozilla.org/observer-service;1", &rv);
* if (NS_SUCCEEDED(rv))
* if (NS_SUCCEEDED(rv))
* rv = observerService->AddObserver(this, "accessible-event", PR_TRUE);
*/
[scriptable, builtinclass, uuid(20c69a40-6c2c-42a3-a578-6f4473aab9dd)]
@ -190,7 +190,7 @@ interface nsIAccessibleEvent : nsISupports
* An application is about to exit drag-and-drop mode
*/
const unsigned long EVENT_DRAGDROP_END = 0x0020;
/**
* A dialog box has been displayed
*/
@ -438,13 +438,13 @@ interface nsIAccessibleEvent : nsISupports
* defined in this interface.
*/
readonly attribute unsigned long eventType;
/**
* The nsIAccessible associated with the event.
* May return null if no accessible is available
*/
readonly attribute nsIAccessible accessible;
/**
* The nsIAccessibleDocument that the event target nsIAccessible
* resides in. This can be used to get the DOM window,

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

@ -123,7 +123,7 @@ interface nsIAccessibleRole : nsISupports
const unsigned long ROLE_CHART = 17;
/**
* Represents a dialog box or message box. It is used for xul:dialog,
* Represents a dialog box or message box. It is used for xul:dialog,
* role="dialog".
*/
const unsigned long ROLE_DIALOG = 18;
@ -709,17 +709,17 @@ interface nsIAccessibleRole : nsISupports
* An image map -- has child links representing the areas
*/
const unsigned long ROLE_IMAGE_MAP = 116;
/**
* An option in a listbox
*/
const unsigned long ROLE_OPTION = 117;
/**
* A rich option in a listbox, it can have other widgets as children
*/
const unsigned long ROLE_RICH_OPTION = 118;
/**
* A list of options
*/
@ -729,7 +729,7 @@ interface nsIAccessibleRole : nsISupports
* Represents a mathematical equation in the accessible name
*/
const unsigned long ROLE_FLAT_EQUATION = 120;
/**
* Represents a cell within a grid. It is used for role="gridcell". Unlike
* ROLE_CELL, it allows the calculation of the accessible name from subtree.

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

@ -59,14 +59,14 @@ interface nsIAccessibleStates : nsISupports
const unsigned long EXT_STATE_DEFUNCT = 0x00000002; // Object no longer exists
const unsigned long EXT_STATE_SELECTABLE_TEXT = 0x00000004; // For text which is selectable, object must implement nsIAccessibleText
const unsigned long EXT_STATE_EDITABLE = 0x00000008; // Implements nsIAccessibleEditableText
const unsigned long EXT_STATE_ACTIVE = 0x00000010; // This window is currently the active window
const unsigned long EXT_STATE_MODAL = 0x00000020; // Must do something with control before leaving it
const unsigned long EXT_STATE_MULTI_LINE = 0x00000040; // Edit control that can take multiple lines
const unsigned long EXT_STATE_ACTIVE = 0x00000010; // This window is currently the active window
const unsigned long EXT_STATE_MODAL = 0x00000020; // Must do something with control before leaving it
const unsigned long EXT_STATE_MULTI_LINE = 0x00000040; // Edit control that can take multiple lines
const unsigned long EXT_STATE_HORIZONTAL = 0x00000080; // Uses horizontal layout
const unsigned long EXT_STATE_OPAQUE = 0x00000100; // Indicates this object paints every pixel within its rectangular region.
const unsigned long EXT_STATE_SINGLE_LINE = 0x00000200; // This text object can only contain 1 line of text
const unsigned long EXT_STATE_TRANSIENT = 0x00000400; //
const unsigned long EXT_STATE_VERTICAL = 0x00000800; // Especially used for sliders and scrollbars
const unsigned long EXT_STATE_SINGLE_LINE = 0x00000200; // This text object can only contain 1 line of text
const unsigned long EXT_STATE_TRANSIENT = 0x00000400; //
const unsigned long EXT_STATE_VERTICAL = 0x00000800; // Especially used for sliders and scrollbars
const unsigned long EXT_STATE_STALE = 0x00001000; // Object not dead, but not up-to-date either
const unsigned long EXT_STATE_ENABLED = 0x00002000; // A widget that is not unavailable
const unsigned long EXT_STATE_SENSITIVE = 0x00004000; // Same as ENABLED for now

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

@ -143,7 +143,7 @@ interface IHandlerControl : IUnknown
[in] IA2TextSegment* aText);
}
typedef struct _IARelationData
typedef struct _IARelationData
{
BSTR mType;
long mNTargets;

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

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<blocklist lastupdate="1558349549359" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<blocklist lastupdate="1558536765550" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<emItems>
<emItem blockID="i334" id="{0F827075-B026-42F3-885D-98981EE7B1AE}">
<prefs/>
@ -2997,6 +2997,38 @@
<prefs/>
<versionRange minVersion="0" maxVersion="2.9.1.0" severity="3"/>
</emItem>
<emItem blockID="0225ae55-626d-42b2-8f48-46ec95ec89f8" id="/^((\{2b3eed60-8f6e-4afc-99f1-38d12f4253da\})|(\{3a6f9dac-3a93-4f6f-8b74-9ebc0f501306\})|(\{46bba8e9-7a75-4dd6-932e-bdd74141cb87\})|(\{4b480ab6-b63a-43f8-b4f4-d312972ab086\})|(\{6106687e-ca0c-4d7e-93bc-115929e4d299\})|(\{717ce133-3c0a-448e-b6ed-fc7d22b76534\})|(\{7224f1ae-c342-4bb5-8441-d324a8951624\})|(\{768e9638-2eba-42e4-a13a-4f3f1df391a2\})|(\{7b655f43-c871-46d2-8f6d-31989e8ee939\})|(\{7e46c692-9488-4671-8c39-7830f92628b0\})|(\{83bc6b56-545f-4ba1-a80b-f82d55cc0f68\})|(\{970a774e-b7a7-498f-b3f2-d88b14b4dab1\})|(\{9d2e8731-3287-46eb-9c19-ece63fe693c7\})|(\{a37ccd20-e04f-4949-b055-98ca58639606\})|(\{af85f82c-3e8f-4ee5-ab53-b8d3aaac34ec\})|(\{b35c6d47-8b07-4d49-89a9-dfe8c10f58f6\})|(\{c2485579-368c-4593-a1cd-985b2fa0b990\})|(\{c85c16ba-78b4-41b3-9201-f80fa662c52f\})|(\{c97e5535-6f2e-4d34-a5a3-0e6e07f7fd13\})|(\{ce7db166-9564-482f-91d9-3a450ec3216d\})|(\{d64a2c73-ff21-4e3e-998f-ec2dc42ad725\})|(\{db6d93c3-67a0-410c-b7bd-f72f267f0cec\})|(\{e513775f-359f-47aa-a3d9-eddc946aabe0\})|(\{f70258e4-643b-4ec2-9c84-de89009eec61\})|(\{f8794e87-82b2-4df4-bce6-db207f62c165\}))$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="2212748f-ad60-497f-af7b-50d20b326e40" id="{da993d54-9605-42f7-a32f-9f565245070c}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="41137e55-8a11-4259-a009-42c29daadf17" id="{ac4be7d1-4db6-4b4c-bf48-e345350bcb59}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="a5fa8f77-7761-4996-a11d-d8cf723103da" id="{dc6176c4-a192-4a92-849f-ad13abe889ad}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="efecef61-549b-4c13-8a52-394c636dd24b" id="/^((\{ec19994c-c5a5-46d9-bd4d-0fc417c6f4b8\})|(\{a0be7e8d-b0a3-460b-8a52-429c79e49ee2\})|(\{1814dd58-4147-4cca-a0a3-c5aa35966d9c\}))$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="9c5f5681-8547-4e65-9c05-5796e483b8e1" id="/^((\{3e20d1e2-a7ee-4ce2-ab9c-51c8300a8ff6\})|(\{30906bbc-0942-445b-89c8-f74dac0edb8f\}))$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="7e86024e-5621-4ded-bc16-184f94fa2e29" id="{a37a7625-b64e-45f3-8b79-f71634f14438}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="43966df2-e95c-415b-bffc-13814e1d2b11" id="{3fc1db2b-e7db-4512-b24e-1faf4d3a1b4d}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
</emItems>
<pluginItems>
<pluginItem blockID="p332">

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

@ -1,3 +1,5 @@
[DEFAULT]
[browser_file_menu_import_wizard.js]
[browser_window_menu_list.js]
skip-if = os != "mac" # Mac only feature

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

@ -0,0 +1,38 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function test_window_menu_list() {
// This title is different depending on the build. For example, it's "Nightly"
// for a local build, "Mozilla Firefox" for an official release build.
const windowTitle = window.document.title;
await checkWindowMenu([windowTitle, "Browser chrome tests"]);
let newWindow = await BrowserTestUtils.openNewBrowserWindow();
await checkWindowMenu([windowTitle, "Browser chrome tests", windowTitle]);
await BrowserTestUtils.closeWindow(newWindow);
});
async function checkWindowMenu(labels) {
let menu = document.querySelector("#windowMenu");
// We can't toggle menubar items on OSX, so mocking instead.
await new Promise(resolve => {
menu.addEventListener("popupshown", resolve, { once: true });
menu.dispatchEvent(new MouseEvent("popupshowing"));
menu.dispatchEvent(new MouseEvent("popupshown"));
});
let menuitems = [...menu.querySelectorAll("menuseparator ~ menuitem")];
is(menuitems.length, labels.length, "Correct number of windows in the menu");
is(menuitems.map(item => item.label).join(","), labels.join(","), "Correct labels on menuitems");
for (let menuitem of menuitems) {
ok(menuitem instanceof customElements.get("menuitem"), "sibling is menuitem");
}
// We can't toggle menubar items on OSX, so mocking instead.
await new Promise(resolve => {
menu.addEventListener("popuphidden", resolve, { once: true });
menu.dispatchEvent(new MouseEvent("popuphiding"));
menu.dispatchEvent(new MouseEvent("popuphidden"));
});
}

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

@ -289,16 +289,6 @@ const startupPhases = {
read: 3,
close: 3,
},
{
path: "UChrm:userChrome.css",
condition: WIN,
stat: 1,
},
{ // bug 1541233
path: "UChrm:userContent.css",
condition: WIN,
stat: 1,
},
{ // bug 1541246
path: "XREUSysExt:",
condition: WIN,

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

@ -27,14 +27,14 @@ interface nsIBrowserProfileMigrator : nsISupports
/**
* Copy user profile information to the current active profile.
* @param aItems list of data items to migrate. see above for values.
* @param aStartup helper interface which is non-null if called during startup.
* @param aStartup helper interface which is non-null if called during startup.
* @param aProfile profile to migrate from, if there is more than one.
*/
void migrate(in unsigned short aItems, in nsIProfileStartup aStartup, in jsval aProfile);
/**
* A bit field containing profile items that this migrator
* offers for import.
* offers for import.
* @param aProfile the profile that we are looking for available data
* to import
* @param aDoingStartup "true" if the profile is not currently being used.

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

@ -26,16 +26,16 @@ interface nsIShellService : nsISupports
/**
* Registers Firefox as the "Default Browser."
*
* @param aClaimAllTypes Register Firefox as the handler for
* @param aClaimAllTypes Register Firefox as the handler for
* additional protocols (ftp, chrome etc)
* and web documents (.html, .xhtml etc).
* @param aForAllUsers Whether or not Firefox should attempt
* to become the default browser for all
* users on a multi-user system.
* users on a multi-user system.
*/
void setDefaultBrowser(in boolean aClaimAllTypes, in boolean aForAllUsers);
/**
/**
* Flags for positioning/sizing of the Desktop Background image.
*/
const long BACKGROUND_TILE = 1;
@ -46,12 +46,12 @@ interface nsIShellService : nsISupports
const long BACKGROUND_SPAN = 6;
/**
* Sets the desktop background image using either the HTML <IMG>
* Sets the desktop background image using either the HTML <IMG>
* element supplied or the background image of the element supplied.
*
* @param aImageElement Either a HTML <IMG> element or an element with
* a background image from which to source the
* background image.
* background image.
* @param aPosition How to place the image on the desktop
* @param aImageName The image name. Equivalent to the leaf name of the
* location.href.
@ -70,13 +70,13 @@ interface nsIShellService : nsISupports
/**
* Opens the application specified. If more than one application of the
* given type is available on the system, the default or "preferred"
* application is used.
* application is used.
*/
void openApplication(in long aApplication);
/**
* The desktop background color, visible when no background image is
* used, or if the background image is centered and does not fill the
/**
* The desktop background color, visible when no background image is
* used, or if the background image is centered and does not fill the
* entire screen. A rgb value, where (r << 16 | g << 8 | b)
*/
attribute unsigned long desktopBackgroundColor;

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

@ -22,3 +22,9 @@ export MOZ_PACKAGE_JSSHELL=1
if test -n "$MOZ_ARTIFACT_TASK_WIN32_OPT"; then
ac_add_options --enable-eme=widevine
fi
# Temporary signal to toolchain.configure that our compiler is patched to
# support CFG, until such support can be assumed.
if test -z "$USE_ARTIFACT"; then
ac_add_options --enable-hardening
fi

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

@ -1,9 +1,3 @@
# This file is used by all AArch64 Win64 builds
ac_add_options --target=aarch64-windows-mingw32
# Temporary signal to toolchain.configure that our compiler is patched to
# support CFG, until such support can be assumed.
if test -z "$USE_ARTIFACT"; then
ac_add_options --enable-hardening
fi

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

@ -288,6 +288,7 @@
@RESPATH@/greprefs.js
@RESPATH@/defaults/autoconfig/prefcalls.js
@RESPATH@/browser/defaults/permissions
; Remote Settings JSON dumps
@RESPATH@/browser/defaults/settings/blocklists
@RESPATH@/browser/defaults/settings/pinning
@RESPATH@/browser/defaults/settings/main

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

@ -11,7 +11,10 @@ import platform
import subprocess
import sys
import uuid
import __builtin__
if sys.version_info[0] < 3:
import __builtin__ as builtins
else:
import builtins
from types import ModuleType
@ -434,4 +437,4 @@ class ImportHook(object):
# Install our hook
__builtin__.__import__ = ImportHook(__builtin__.__import__)
builtins.__import__ = ImportHook(builtins.__import__)

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

@ -49,7 +49,7 @@ interface nsIXULChromeRegistry : nsIChromeRegistry
// passed to ECMA402 Intl API methods without throwing a RangeError.
ACString getSelectedLocale(in ACString packageName,
[optional] in boolean asBCP47);
// Get whether the default writing direction of the locale is RTL
// (or may be overridden by intl.uidirection pref)
boolean isLocaleRTL(in ACString package);

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

@ -714,11 +714,8 @@ $(foreach f,$(HOST_CSRCS) $(HOST_CPPSRCS) $(HOST_CMSRCS) $(HOST_CMMSRCS),$(eval
# The Rust compiler only outputs library objects, and so we need different
# mangling to generate dependency rules for it.
mk_libname = $(basename lib$(notdir $1)).rlib
src_libdep = $(call mk_libname,$1): $1 $$(call mkdir_deps,$$(MDDEPDIR))
mk_global_crate_libname = $(basename lib$(notdir $1)).$(LIB_SUFFIX)
crate_src_libdep = $(call mk_global_crate_libname,$1): $1 $$(call mkdir_deps,$$(MDDEPDIR))
$(foreach f,$(RSSRCS),$(eval $(call src_libdep,$(f))))
$(foreach f,$(RS_STATICLIB_CRATE_SRC),$(eval $(call crate_src_libdep,$(f))))
$(OBJS) $(HOST_OBJS) $(PROGOBJS) $(HOST_PROGOBJS): $(GLOBAL_DEPS)

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

@ -101,7 +101,6 @@ devtools.jar:
skin/breadcrumbs.css (themes/breadcrumbs.css)
skin/chart.css (themes/chart.css)
skin/widgets.css (themes/widgets.css)
skin/images/alerticon-unused.svg (themes/images/alerticon-unused.svg)
skin/rules.css (themes/rules.css)
skin/images/command-paintflashing.svg (themes/images/command-paintflashing.svg)
skin/images/command-screenshot.svg (themes/images/command-screenshot.svg)

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

@ -552,6 +552,10 @@ netmonitor.toolbar.method=Method
# in the network table toolbar, above the "file" column.
netmonitor.toolbar.file=File
# LOCALIZATION NOTE (netmonitor.toolbar.url): This is the label displayed
# in the network table toolbar, above the "url" column.
netmonitor.toolbar.url=URL
# LOCALIZATION NOTE (netmonitor.toolbar.protocol): This is the label displayed
# in the network table toolbar, above the "protocol" column.
netmonitor.toolbar.protocol=Protocol

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

@ -4,14 +4,12 @@
"use strict";
const { Component } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const { Component, createFactory } = require("devtools/client/shared/vendor/react");
const { td } = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { getFormattedIPAndPort } = require("../utils/format-utils");
const { L10N } = require("../utils/l10n");
const { propertiesEqual } = require("../utils/request-utils");
const { div } = dom;
const SecurityState = createFactory(require("./SecurityState"));
const UPDATED_DOMAIN_PROPS = [
"remoteAddress",
@ -32,38 +30,26 @@ class RequestListColumnDomain extends Component {
}
render() {
const { item, onSecurityIconMouseDown } = this.props;
const { remoteAddress, remotePort, securityState,
urlDetails: { host, isLocal } } = item;
const iconClassList = ["requests-security-state-icon"];
let iconTitle;
const {
item,
onSecurityIconMouseDown,
} = this.props;
const {
remoteAddress,
remotePort,
urlDetails: {
host,
isLocal,
},
} = item;
const title = host + (remoteAddress ?
` (${getFormattedIPAndPort(remoteAddress, remotePort)})` : "");
let realSecurityState = securityState;
// Locally delivered files such as http://localhost and file:// paths
// are considered to have been delivered securely.
if (isLocal) {
realSecurityState = "secure";
}
if (realSecurityState) {
iconClassList.push(`security-state-${realSecurityState}`);
iconTitle = L10N.getStr(`netmonitor.security.state.${realSecurityState}`);
}
return (
dom.td({ className: "requests-list-column requests-list-domain", title },
div({
className: iconClassList.join(" "),
onMouseDown: onSecurityIconMouseDown,
title: iconTitle,
}),
item.isThirdPartyTrackingResource && div({
className: "tracking-resource",
title: L10N.getStr("netmonitor.trackingResource.tooltip"),
}),
td({ className: "requests-list-column requests-list-domain", title },
SecurityState({item, onSecurityIconMouseDown, isLocal}),
host,
)
);

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

@ -0,0 +1,75 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Component, createFactory } = require("devtools/client/shared/vendor/react");
const { td } = require("devtools/client/shared/vendor/react-dom-factories");
const { L10N } = require("../utils/l10n");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { getFormattedIPAndPort } = require("../utils/format-utils");
const { propertiesEqual } = require("../utils/request-utils");
const SecurityState = createFactory(require("./SecurityState"));
const UPDATED_FILE_PROPS = [
"remoteAddress",
"securityState",
"urlDetails",
];
class RequestListColumnUrl extends Component {
static get propTypes() {
return {
item: PropTypes.object.isRequired,
onSecurityIconMouseDown: PropTypes.func.isRequired,
};
}
shouldComponentUpdate(nextProps) {
return !propertiesEqual(UPDATED_FILE_PROPS, this.props.item, nextProps.item);
}
render() {
const {
item: { urlDetails },
} = this.props;
const {
item,
onSecurityIconMouseDown,
} = this.props;
const {
remoteAddress,
remotePort,
urlDetails: {
isLocal,
},
} = item;
const title = (remoteAddress ?
` (${getFormattedIPAndPort(remoteAddress, remotePort)})` : "");
// deals with returning whole url
const originalURL = urlDetails.url;
const decodedFileURL = urlDetails.unicodeUrl;
const ORIGINAL_FILE_URL = L10N.getFormatStr("netRequest.originalFileURL.tooltip",
originalURL);
const DECODED_FILE_URL = L10N.getFormatStr("netRequest.decodedFileURL.tooltip",
decodedFileURL);
const urlToolTip = originalURL === decodedFileURL ?
originalURL : ORIGINAL_FILE_URL + "\n\n" + DECODED_FILE_URL;
return (
td({
className: "requests-list-column requests-list-url",
title: urlToolTip + title,
},
SecurityState({item, onSecurityIconMouseDown, isLocal}),
originalURL
)
);
}
}
module.exports = RequestListColumnUrl;

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

@ -30,6 +30,7 @@ const { RESPONSE_HEADERS } = require("../constants");
RequestListColumnTime,
RequestListColumnTransferredSize,
RequestListColumnType,
RequestListColumnUrl,
RequestListColumnWaterfall
*/
@ -48,6 +49,9 @@ loader.lazyGetter(this, "RequestListColumnDomain", function() {
loader.lazyGetter(this, "RequestListColumnFile", function() {
return createFactory(require("./RequestListColumnFile"));
});
loader.lazyGetter(this, "RequestListColumnUrl", function() {
return createFactory(require("./RequestListColumnUrl"));
});
loader.lazyGetter(this, "RequestListColumnMethod", function() {
return createFactory(require("./RequestListColumnMethod"));
});
@ -223,10 +227,14 @@ class RequestListItem extends Component {
columns.status && RequestListColumnStatus({ item }),
columns.method && RequestListColumnMethod({ item }),
columns.domain && RequestListColumnDomain({
item,
onSecurityIconMouseDown,
item,
onSecurityIconMouseDown,
}),
columns.file && RequestListColumnFile({ item }),
columns.url && RequestListColumnUrl({
item,
onSecurityIconMouseDown,
}),
columns.protocol && RequestListColumnProtocol({ item }),
columns.scheme && RequestListColumnScheme({ item }),
columns.remoteip && RequestListColumnRemoteIP({ item }),

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

@ -0,0 +1,75 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Component } = require("devtools/client/shared/vendor/react");
const { div } = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { L10N } = require("../utils/l10n");
const { propertiesEqual } = require("../utils/request-utils");
const UPDATED_DOMAIN_PROPS = [
"remoteAddress",
"securityState",
"urlDetails",
];
class SecurityState extends Component {
static get propTypes() {
return {
item: PropTypes.object.isRequired,
onSecurityIconMouseDown: PropTypes.func.isRequired,
};
}
shouldComponentUpdate(nextProps) {
return !propertiesEqual(UPDATED_DOMAIN_PROPS, this.props.item, nextProps.item);
}
render() {
const {
item,
onSecurityIconMouseDown,
} = this.props;
const {
securityState,
urlDetails: {
isLocal,
},
} = item;
const iconClassList = ["requests-security-state-icon"];
let iconTitle;
let realSecurityState = securityState;
// Locally delivered files such as http://localhost and file:// paths
// are considered to have been delivered securely.
if (isLocal) {
realSecurityState = "secure";
}
if (realSecurityState) {
iconClassList.push(`security-state-${realSecurityState}`);
iconTitle = L10N.getStr(`netmonitor.security.state.${realSecurityState}`);
}
return (
div({},
div({
className: iconClassList.join(" "),
onMouseDown: onSecurityIconMouseDown,
title: iconTitle,
}),
item.isThirdPartyTrackingResource && div({
className: "tracking-resource",
title: L10N.getStr("netmonitor.trackingResource.tooltip"),
}),
)
);
}
}
module.exports = SecurityState;

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

@ -30,6 +30,7 @@ DevToolsModules(
'RequestListColumnTime.js',
'RequestListColumnTransferredSize.js',
'RequestListColumnType.js',
'RequestListColumnUrl.js',
'RequestListColumnWaterfall.js',
'RequestListContent.js',
'RequestListEmptyNotice.js',
@ -37,6 +38,7 @@ DevToolsModules(
'RequestListItem.js',
'ResponsePanel.js',
'SecurityPanel.js',
'SecurityState.js',
'SourceEditor.js',
'StackTracePanel.js',
'StatisticsPanel.js',

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

@ -191,13 +191,17 @@ const HEADERS = [
canFilter: true,
},
{
name: "domain",
canFilter: true,
name: "domain",
canFilter: true,
},
{
name: "file",
canFilter: false,
},
{
name: "url",
canFilter: true,
},
{
name: "protocol",
canFilter: true,

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

@ -30,6 +30,7 @@ const cols = {
method: true,
domain: true,
file: true,
url: false,
protocol: false,
scheme: false,
remoteip: false,

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

@ -25,15 +25,23 @@ add_task(async function() {
"There were two requests due to redirect.");
const [
initialSecurityIcon,
redirectSecurityIcon,
initialDomainSecurityIcon,
initialUrlSecurityIcon,
redirectDomainSecurityIcon,
redirectUrlSecurityIcon,
] = document.querySelectorAll(".requests-security-state-icon");
ok(initialSecurityIcon.classList.contains("security-state-insecure"),
"Initial request was marked insecure.");
ok(initialDomainSecurityIcon.classList.contains("security-state-insecure"),
"Initial request was marked insecure for domain column.");
ok(redirectSecurityIcon.classList.contains("security-state-secure"),
"Redirected request was marked secure.");
ok(redirectDomainSecurityIcon.classList.contains("security-state-secure"),
"Redirected request was marked secure for domain column.");
ok(initialUrlSecurityIcon.classList.contains("security-state-insecure"),
"Initial request was marked insecure for URL column.");
ok(redirectUrlSecurityIcon.classList.contains("security-state-secure"),
"Redirected request was marked secure for URL column.");
await teardown(monitor);
});

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

@ -30,8 +30,12 @@ add_task(async function() {
// Execute request with third party tracking protection flag.
await performRequests(monitor, tab, 1);
const requests = document.querySelectorAll(".request-list-item .tracking-resource");
is(requests.length, 1, "There should be one tracking request");
const domainRequests =
document.querySelectorAll(".requests-list-domain .tracking-resource");
const UrlRequests = document.querySelectorAll(".requests-list-url .tracking-resource");
is(domainRequests.length, 1, "There should be one domain column tracking request");
is(UrlRequests.length, 1, "There should be one URL column tracking request");
await teardown(monitor);
});

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

@ -118,7 +118,7 @@ const gDefaultFilters = Services.prefs.getCharPref("devtools.netmonitor.filters"
Services.prefs.setCharPref(
"devtools.netmonitor.visibleColumns",
"[\"cause\",\"contentSize\",\"cookies\",\"domain\",\"duration\"," +
"\"endTime\",\"file\",\"latency\",\"method\",\"protocol\"," +
"\"endTime\",\"file\",\"url\",\"latency\",\"method\",\"protocol\"," +
"\"remoteip\",\"responseTime\",\"scheme\",\"setCookies\"," +
"\"startTime\",\"status\",\"transferred\",\"type\",\"waterfall\"]"
);
@ -128,6 +128,7 @@ Services.prefs.setCharPref("devtools.netmonitor.columnsData",
'{"name":"method","minWidth":30,"width":5},' +
'{"name":"domain","minWidth":30,"width":10},' +
'{"name":"file","minWidth":30,"width":25},' +
'{"name":"url","minWidth":30,"width":25},' +
'{"name":"cause","minWidth":30,"width":10},' +
'{"name":"type","minWidth":30,"width":5},' +
'{"name":"transferred","minWidth":30,"width":10},' +

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

@ -168,7 +168,7 @@ pref("devtools.netmonitor.visibleColumns",
"[\"status\",\"method\",\"domain\",\"file\",\"cause\",\"type\",\"transferred\",\"contentSize\",\"waterfall\"]"
);
pref("devtools.netmonitor.columnsData",
'[{"name":"status","minWidth":30,"width":5}, {"name":"method","minWidth":30,"width":5}, {"name":"domain","minWidth":30,"width":10}, {"name":"file","minWidth":30,"width":25}, {"name":"cause","minWidth":30,"width":10},{"name":"type","minWidth":30,"width":5},{"name":"transferred","minWidth":30,"width":10},{"name":"contentSize","minWidth":30,"width":5},{"name":"waterfall","minWidth":150,"width":25}]');
'[{"name":"status","minWidth":30,"width":5}, {"name":"method","minWidth":30,"width":5}, {"name":"domain","minWidth":30,"width":10}, {"name":"file","minWidth":30,"width":25}, {"name":"url","minWidth":30,"width":25}, {"name":"cause","minWidth":30,"width":10},{"name":"type","minWidth":30,"width":5},{"name":"transferred","minWidth":30,"width":10},{"name":"contentSize","minWidth":30,"width":5},{"name":"waterfall","minWidth":150,"width":25}]');
// Support for columns resizing pref is now enabled (after merge date 03/18/19).
pref("devtools.netmonitor.features.resizeColumns", true);

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

@ -32,7 +32,7 @@ class SearchBox extends PureComponent {
onFocus: PropTypes.func,
onKeyDown: PropTypes.func,
placeholder: PropTypes.string.isRequired,
type: PropTypes.string.isRequired,
type: PropTypes.string,
};
}

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

@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13.5 12.7" width="12" height="12">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" width="12" height="12">
<path fill="context-fill" d="M6 0a1 1 0 0 1 .89.54l5 9.6A1 1 0 0 1 11 11.6H1a1 1 0 0 1-.89-1.46l5-9.6A1 1 0 0 1 6 0zm-.25 8a.75.75 0 0 0-.75.75v.5c0 .41.34.75.75.75h.5c.41 0 .75-.34.75-.75v-.5A.75.75 0 0 0 6.25 8h-.5zM7 3.7a1 1 0 1 0-2 0v2.6a1 1 0 1 0 2 0V3.7z" />
</svg>

До

Ширина:  |  Высота:  |  Размер: 574 B

После

Ширина:  |  Высота:  |  Размер: 570 B

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

@ -1,8 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 14 14">
<path stroke="context-stroke" fill="none" d="M13 7C13 10.31 10.31 13 7 13C3.69 13 1 10.31 1 7C1 3.69 3.69 1 7 1C10.31 1 13 3.69 13 7Z"/>
<path fill="context-fill" d="M7.54 5.88C8.02 5.88 8.41 6.26 8.41 6.74C8.41 7.6 8.41 9.29 8.41 10.15C8.41 10.63 8.02 11.02 7.54 11.02C7.2 11.02 7.05 11.02 6.71 11.02C6.23 11.02 5.84 10.63 5.84 10.15C5.84 9.29 5.84 7.6 5.84 6.74C5.84 6.26 6.23 5.88 6.71 5.88C7.05 5.88 7.2 5.88 7.54 5.88Z"/>
<path fill="context-fill" d="M8.41 4.11C8.41 4.82 7.83 5.4 7.12 5.4C6.42 5.4 5.84 4.82 5.84 4.11C5.84 3.4 6.42 2.83 7.12 2.83C7.83 2.83 8.41 3.4 8.41 4.11Z"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 895 B

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

@ -365,22 +365,20 @@
display: inline-block;
width: 12px;
height: 12px;
background-size: cover;
background-size: 12px;
background-repeat: no-repeat;
-moz-context-properties: fill;
}
.ruleview-warning {
background-image: url(chrome://devtools/skin/images/alert.svg);
background-position: 0.73px 0.4px;
-moz-context-properties: fill;
fill: var(--yellow-60);
}
.ruleview-unused-warning {
background-image: url(chrome://devtools/skin/images/alerticon-unused.svg);
background-image: url(chrome://devtools/skin/images/webconsole/info.svg);
background-color: var(--theme-sidebar-background);
-moz-context-properties: fill, stroke;
fill: var(--theme-icon-dimmed-color);
stroke: var(--theme-icon-dimmed-color);
fill: var(--theme-icon-dimmed-color);
}
.ruleview-unused-warning:hover {

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

@ -28,7 +28,6 @@ class FilterBar extends Component {
return {
dispatch: PropTypes.func.isRequired,
filter: PropTypes.object.isRequired,
attachRefToWebConsoleUI: PropTypes.func.isRequired,
persistLogs: PropTypes.bool.isRequired,
hidePersistLogsCheckbox: PropTypes.bool.isRequired,
showContentMessages: PropTypes.bool.isRequired,

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

@ -1664,14 +1664,15 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
sourceActor = this.sources.createSourceActor(source);
}
if (this._onLoadBreakpointURLs.has(source.url)) {
this.setBreakpoint({ sourceUrl: source.url, line: 1 }, {});
const sourceUrl = sourceActor.url;
if (this._onLoadBreakpointURLs.has(sourceUrl)) {
this.setBreakpoint({ sourceUrl, line: 1 }, {});
}
const bpActors = this.breakpointActorMap.findActors()
.filter((actor) => {
return actor.location.sourceUrl && actor.location.sourceUrl == source.url;
});
.filter((actor) =>
actor.location.sourceUrl && actor.location.sourceUrl == sourceUrl
);
for (const actor of bpActors) {
sourceActor.applyBreakpoint(actor);

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

@ -0,0 +1,29 @@
/* eslint-disable max-nested-callbacks */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Bug 1552453 - Verify that breakpoints are hit for evaluated
* scripts that contain a source url pragma.
*/
add_task(threadClientTest(async ({ threadClient, targetFront }) => {
await threadClient.setBreakpoint(
{ sourceUrl: "http://example.com/code.js", line: 2, column: 1 },
{}
);
info("Create a new script with the displayUrl code.js");
const consoleFront = await targetFront.getFront("console");
consoleFront.evaluateJSAsync("function f() {\n return 5; \n}\n//# sourceURL=http://example.com/code.js");
const sourcePacket = await waitForEvent(threadClient, "newSource");
equal(sourcePacket.source.url, "http://example.com/code.js");
info("Evaluate f() and pause at line 2");
consoleFront.evaluateJSAsync("f()");
const pausedPacket = await waitForPause(threadClient);
equal(pausedPacket.why.type, "breakpoint");
equal(pausedPacket.frame.where.line, 2);
}));

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

@ -132,6 +132,7 @@ reason = bug 1104838
[test_breakpoint-21.js]
[test_breakpoint-22.js]
skip-if = true # breakpoint sliding is not supported bug 1525685
[test_breakpoint-23.js]
[test_conditional_breakpoint-01.js]
[test_conditional_breakpoint-02.js]
[test_conditional_breakpoint-03.js]

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

@ -5,12 +5,24 @@
"use strict";
const {arg, DebuggerClient} = require("devtools/shared/client/debugger-client");
const {
arg,
DebuggerClient,
} = require("devtools/shared/client/debugger-client");
const eventSource = require("devtools/shared/client/event-source");
const {ThreadStateTypes} = require("devtools/shared/client/constants");
const { ThreadStateTypes } = require("devtools/shared/client/constants");
loader.lazyRequireGetter(this, "ObjectClient", "devtools/shared/client/object-client");
loader.lazyRequireGetter(this, "SourceFront", "devtools/shared/fronts/source", true);
loader.lazyRequireGetter(
this,
"ObjectClient",
"devtools/shared/client/object-client"
);
loader.lazyRequireGetter(
this,
"SourceFront",
"devtools/shared/fronts/source",
true
);
/**
* Creates a thread client for the remote debugging protocol server. This client
@ -50,7 +62,9 @@ ThreadClient.prototype = {
_assertPaused: function(command) {
if (!this.paused) {
throw Error(command + " command sent while not paused. Currently " + this._state);
throw Error(
command + " command sent while not paused. Currently " + this._state
);
}
},
@ -67,36 +81,39 @@ ThreadClient.prototype = {
* than proceeding forwards. This parameter has no effect if the
* server does not support rewinding.
*/
_doResume: DebuggerClient.requester({
type: "resume",
resumeLimit: arg(0),
rewind: arg(1),
}, {
before: function(packet) {
this._assertPaused("resume");
// Put the client in a tentative "resuming" state so we can prevent
// further requests that should only be sent in the paused state.
this._previousState = this._state;
this._state = "resuming";
return packet;
_doResume: DebuggerClient.requester(
{
type: "resume",
resumeLimit: arg(0),
rewind: arg(1),
},
after: function(response) {
if (response.error && this._state == "resuming") {
// There was an error resuming, update the state to the new one
// reported by the server, if given (only on wrongState), otherwise
// reset back to the previous state.
if (response.state) {
this._state = ThreadStateTypes[response.state];
} else {
this._state = this._previousState;
{
before: function(packet) {
this._assertPaused("resume");
// Put the client in a tentative "resuming" state so we can prevent
// further requests that should only be sent in the paused state.
this._previousState = this._state;
this._state = "resuming";
return packet;
},
after: function(response) {
if (response.error && this._state == "resuming") {
// There was an error resuming, update the state to the new one
// reported by the server, if given (only on wrongState), otherwise
// reset back to the previous state.
if (response.state) {
this._state = ThreadStateTypes[response.state];
} else {
this._state = this._previousState;
}
}
}
delete this._previousState;
return response;
},
}),
delete this._previousState;
return response;
},
}
),
/**
* Reconfigure the thread actor.
@ -214,14 +231,17 @@ ThreadClient.prototype = {
/**
* Detach from the thread actor.
*/
detach: DebuggerClient.requester({
type: "detach",
}, {
after: function(response) {
this.client.unregisterClient(this);
return response;
detach: DebuggerClient.requester(
{
type: "detach",
},
}),
{
after: function(response) {
this.client.unregisterClient(this);
return response;
},
}
),
/**
* Promote multiple pause-lifetime object actors to thread-lifetime ones.

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

@ -100,7 +100,7 @@ interface nsIContentViewer : nsISupports
/**
* All users of a content viewer are responsible for calling both
* close() and destroy(), in that order.
* close() and destroy(), in that order.
*
* close() should be called when the load of a new page for the next
* content viewer begins, and destroy() should be called when the next

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

@ -15,7 +15,7 @@ webidl Document;
/**
* The nsIDocShellTreeItem supplies the methods that are required of any item
* that wishes to be able to live within the docshell tree either as a middle
* node or a leaf.
* node or a leaf.
*/
[scriptable, builtinclass, uuid(9b7c586f-9214-480c-a2c4-49b526fff1a6)]
@ -46,7 +46,7 @@ interface nsIDocShellTreeItem : nsISupports
const long typeAll=0x7FFFFFFF;
/*
The type this item is.
The type this item is.
*/
readonly attribute long itemType;
[noscript,notxpcom,nostdcall] long ItemType();
@ -65,20 +65,20 @@ interface nsIDocShellTreeItem : nsISupports
readonly attribute nsIDocShellTreeItem sameTypeParent;
/*
Returns the root DocShellTreeItem. This is a convience equivalent to
Returns the root DocShellTreeItem. This is a convience equivalent to
getting the parent and its parent until there isn't a parent.
*/
readonly attribute nsIDocShellTreeItem rootTreeItem;
/*
Returns the root DocShellTreeItem of the same type. This is a convience
equivalent to getting the parent of the same type and its parent until
Returns the root DocShellTreeItem of the same type. This is a convience
equivalent to getting the parent of the same type and its parent until
there isn't a parent.
*/
readonly attribute nsIDocShellTreeItem sameTypeRootTreeItem;
/*
Returns the docShellTreeItem with the specified name. Search order is as
Returns the docShellTreeItem with the specified name. Search order is as
follows...
1.) Check name of self, if it matches return it.
2.) For each immediate child.
@ -114,25 +114,25 @@ interface nsIDocShellTreeItem : nsISupports
The owner of the DocShell Tree. This interface will be called upon when
the docshell has things it needs to tell to the owner of the docshell.
Note that docShell tree ownership does not cross tree types. Meaning
setting ownership on a chrome tree does not set ownership on the content
setting ownership on a chrome tree does not set ownership on the content
sub-trees. A given tree's boundaries are identified by the type changes.
Trees of different types may be connected, but should not be traversed
for things such as ownership.
Note implementers of this interface should NOT effect the lifetime of the
Note implementers of this interface should NOT effect the lifetime of the
parent DocShell by holding this reference as it creates a cycle. Owners
when releasing this interface should set the treeOwner to nullptr.
Implementers of this interface are guaranteed that when treeOwner is
set that the poitner is valid without having to addref.
Further note however when others try to get the interface it should be
addref'd before handing it to them.
Further note however when others try to get the interface it should be
addref'd before handing it to them.
*/
readonly attribute nsIDocShellTreeOwner treeOwner;
[noscript] void setTreeOwner(in nsIDocShellTreeOwner treeOwner);
/*
The current number of DocShells which are immediate children of the
The current number of DocShells which are immediate children of the
this object.
*/
readonly attribute long childCount;

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

@ -28,7 +28,7 @@ interface nsIDocumentLoaderFactory : nsISupports {
nsIContentViewer createInstance(in string aCommand,
in nsIChannel aChannel,
in nsILoadGroup aLoadGroup,
in ACString aContentType,
in ACString aContentType,
in nsIDocShell aContainer,
in nsISupports aExtraInfo,
out nsIStreamListener aDocListenerResult);

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

@ -15,14 +15,14 @@ interface nsIRefreshURI : nsISupports {
/**
* Load a uri after waiting for aMillis milliseconds. If the docshell
* is busy loading a page currently, the refresh request will be
* queued and executed when the current load finishes.
* queued and executed when the current load finishes.
*
* @param aUri The uri to refresh.
* @param aPrincipal The triggeringPrincipal for the refresh load
* May be null, in which case the principal of current document will be
* applied.
* @param aMillis The number of milliseconds to wait.
* @param aRepeat Flag to indicate if the uri is to be
* @param aRepeat Flag to indicate if the uri is to be
* repeatedly refreshed every aMillis milliseconds.
* @param aMetaRefresh Flag to indicate if this is a Meta refresh.
*/
@ -45,24 +45,24 @@ interface nsIRefreshURI : nsISupports {
in long aMillis, in boolean aMetaRefresh);
/**
* Checks the passed in channel to see if there is a refresh header,
* Checks the passed in channel to see if there is a refresh header,
* if there is, will setup a timer to refresh the uri found
* in the header. If docshell is busy loading a page currently, the
* request will be queued and executed when the current page
* finishes loading.
* request will be queued and executed when the current page
* finishes loading.
*
* Returns the NS_REFRESHURI_HEADER_FOUND success code if a refresh
* header was found and successfully setup.
*
* @param aChannel The channel to be parsed.
* @param aChannel The channel to be parsed.
*/
void setupRefreshURI(in nsIChannel aChannel);
void setupRefreshURI(in nsIChannel aChannel);
/**
* Parses the passed in header string and sets up a refreshURI if
* a "refresh" header is found. If docshell is busy loading a page
* currently, the request will be queued and executed when
* the current page finishes loading.
* a "refresh" header is found. If docshell is busy loading a page
* currently, the request will be queued and executed when
* the current page finishes loading.
*
* @param aBaseURI base URI to resolve refresh uri with.
* @param aPrincipal The triggeringPrincipal for the refresh load

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

@ -9,7 +9,7 @@
/**
* The nsIScrollable is an interface that can be implemented by a control that
* supports scrolling. This is a generic interface without concern for the
* supports scrolling. This is a generic interface without concern for the
* type of content that may be inside.
*/
[scriptable, uuid(3507fc93-313e-4a4c-8ca8-4d0ea0f97315)]

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

@ -2,7 +2,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
/**
@ -35,7 +35,7 @@ interface nsITooltipListener : nsISupports
*/
void onShowTooltip(in long aXCoords, in long aYCoords, in AString aTipText,
in AString aTipDir);
/**
* Called when the tooltip should be hidden, either because the pointer
* has moved or the tooltip has timed out.

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

@ -1,8 +1,8 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
webidl Node;
@ -13,7 +13,7 @@ webidl Node;
* with the node that the pointer is positioned over.
*
* Embedders may implement and register their own tooltip text provider
* service if they wish to provide different tooltip text.
* service if they wish to provide different tooltip text.
*
* The default service returns the text stored in the TITLE
* attribute of the node or a containing parent.

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

@ -145,7 +145,7 @@ interface nsIWebNavigation : nsISupports
* document.
*/
const unsigned long LOAD_FLAGS_CHARSET_CHANGE = 0x0400;
/**
* If this flag is set, Stop() will be called before the load starts
* and will stop both content and network activity (the default is to
@ -168,7 +168,7 @@ interface nsIWebNavigation : nsISupports
/**
* This flag specifies that this is the first load in this object.
* Set with care, since setting incorrectly can cause us to assume that
* nothing was actually loaded in this object if the load ends up being
* nothing was actually loaded in this object if the load ends up being
* handled by an external application. This flag must not be passed to
* Reload.
*/

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

@ -39,7 +39,7 @@ interface nsIWebNavigationInfo : nsISupports
* @note Other return types may be added here in the future as they become
* relevant.
*/
/**
* Returned by isTypeSupported to indicate that a type is supported via some
* other means.

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

@ -18,7 +18,7 @@ interface nsIWebPageDescriptor : nsISupports
/**
* Tells the object to load the page specified by the page descriptor
*
* @throws NS_ERROR_FAILURE -
* @throws NS_ERROR_FAILURE -
*/
void loadPage(in nsISupports aPageDescriptor, in unsigned long aDisplayType);

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

@ -3291,11 +3291,7 @@ CORSMode Element::AttrValueToCORSMode(const nsAttrValue* aValue) {
}
static const char* GetFullscreenError(CallerType aCallerType) {
if (!nsContentUtils::IsRequestFullscreenAllowed(aCallerType)) {
return "FullscreenDeniedNotInputDriven";
}
return nullptr;
return nsContentUtils::CheckRequestFullscreenAllowed(aCallerType);
}
already_AddRefed<Promise> Element::RequestFullscreen(CallerType aCallerType,

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

@ -6581,24 +6581,36 @@ bool nsContentUtils::ChannelShouldInheritPrincipal(
}
/* static */
bool nsContentUtils::IsRequestFullscreenAllowed(CallerType aCallerType) {
// If more time has elapsed since the user input than is specified by the
// dom.event.handling-user-input-time-limit pref (default 1 second), this
// function also returns false.
const char* nsContentUtils::CheckRequestFullscreenAllowed(
CallerType aCallerType) {
if (!StaticPrefs::full_screen_api_allow_trusted_requests_only() ||
aCallerType == CallerType::System) {
return true;
return nullptr;
}
if (EventStateManager::IsHandlingUserInput()) {
TimeDuration timeout = HandlingUserInputTimeout();
return timeout <= TimeDuration(nullptr) ||
(TimeStamp::Now() - EventStateManager::GetHandlingInputStart()) <=
timeout;
if (!EventStateManager::IsHandlingUserInput()) {
return "FullscreenDeniedNotInputDriven";
}
return false;
// If more time has elapsed since the user input than is specified by the
// dom.event.handling-user-input-time-limit pref (default 1 second),
// disallow fullscreen
TimeDuration timeout = HandlingUserInputTimeout();
if (timeout > TimeDuration(nullptr) &&
(TimeStamp::Now() - EventStateManager::GetHandlingInputStart()) >
timeout) {
return "FullscreenDeniedNotInputDriven";
}
// Entering full-screen on mouse mouse event is only allowed with left mouse
// button
if (StaticPrefs::full_screen_api_mouse_event_allow_left_button_only() &&
(EventStateManager::sCurrentMouseBtn == MouseButton::eMiddle ||
EventStateManager::sCurrentMouseBtn == MouseButton::eRight)) {
return "FullscreenDeniedMouseEventOnlyLeftBtn";
}
return nullptr;
}
/* static */

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

@ -2332,12 +2332,14 @@ class nsContentUtils {
static bool IsFocusedContent(const nsIContent* aContent);
/**
* Returns true if requests for fullscreen are allowed in the current
* Returns nullptr if requests for fullscreen are allowed in the current
* context. Requests are only allowed if the user initiated them (like with
* a mouse-click or key press), unless this check has been disabled by
* setting the pref "full-screen-api.allow-trusted-requests-only" to false.
* If fullscreen is not allowed, a key for the error message is returned.
*/
static bool IsRequestFullscreenAllowed(mozilla::dom::CallerType aCallerType);
static const char* CheckRequestFullscreenAllowed(
mozilla::dom::CallerType aCallerType);
/**
* Returns true if calling execCommand with 'cut' or 'copy' arguments is

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

@ -179,6 +179,25 @@ class EncodingScope {
bool EncodingScope::IsLimited() const { return mSelection || mRange || mNode; }
struct RangeBoundaryPathsAndOffsets {
using ContainerPath = AutoTArray<nsIContent*, 8>;
using ContainerOffsets = AutoTArray<int32_t, 8>;
// The first node is the range's boundary node, the following ones the
// ancestors.
ContainerPath mStartContainerPath;
// The first offset represents where at the boundary node the range starts.
// Each other offset is the index of the child relative to its parent.
ContainerOffsets mStartContainerOffsets;
// The first node is the range's boundary node, the following one the
// ancestors.
ContainerPath mEndContainerPath;
// The first offset represents where at the boundary node the range ends.
// Each other offset is the index of the child relative to its parent.
ContainerOffsets mEndContainerOffsets;
};
class nsDocumentEncoder : public nsIDocumentEncoder {
public:
nsDocumentEncoder();
@ -263,7 +282,7 @@ class nsDocumentEncoder : public nsIDocumentEncoder {
virtual bool IncludeInContext(nsINode* aNode);
void Clear();
void ReleaseDocumentReferenceAndInitialize(bool aClearCachedSerializer);
class MOZ_STACK_CLASS AutoReleaseDocumentIfNeeded final {
public:
@ -272,7 +291,8 @@ class nsDocumentEncoder : public nsIDocumentEncoder {
~AutoReleaseDocumentIfNeeded() {
if (mEncoder->mFlags & RequiresReinitAfterOutput) {
mEncoder->Clear();
const bool clearCachedSerializer = false;
mEncoder->ReleaseDocumentReferenceAndInitialize(clearCachedSerializer);
}
}
@ -296,10 +316,7 @@ class nsDocumentEncoder : public nsIDocumentEncoder {
int32_t mStartRootIndex;
int32_t mEndRootIndex;
AutoTArray<nsINode*, 8> mCommonAncestors;
AutoTArray<nsIContent*, 8> mStartNodes;
AutoTArray<int32_t, 8> mStartOffsets;
AutoTArray<nsIContent*, 8> mEndNodes;
AutoTArray<int32_t, 8> mEndOffsets;
RangeBoundaryPathsAndOffsets mRangeBoundaryPathsAndOffsets;
AutoTArray<AutoTArray<nsINode*, 8>, 8> mRangeContexts;
// Whether the serializer cares about being notified to scan elements to
// keep track of whether they are preformatted. This stores the out
@ -314,7 +331,8 @@ class nsDocumentEncoder : public nsIDocumentEncoder {
};
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDocumentEncoder)
NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(nsDocumentEncoder, Clear())
NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(
nsDocumentEncoder, ReleaseDocumentReferenceAndInitialize(true))
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDocumentEncoder)
NS_INTERFACE_MAP_ENTRY(nsIDocumentEncoder)
@ -342,6 +360,9 @@ void nsDocumentEncoder::Initialize(bool aClearCachedSerializer) {
mHaltRangeHint = false;
mDisableContextSerialize = false;
mEncodingScope = {};
mCommonParent = nullptr;
mNodeFixup = nullptr;
mRangeBoundaryPathsAndOffsets = {};
if (aClearCachedSerializer) {
mSerializer = nullptr;
}
@ -771,13 +792,18 @@ nsresult nsDocumentEncoder::SerializeRangeNodes(nsRange* const aRange,
// get start and end nodes for this recursion level
nsCOMPtr<nsIContent> startNode, endNode;
{
auto& startContainerPath =
mRangeBoundaryPathsAndOffsets.mStartContainerPath;
auto& endContainerPath = mRangeBoundaryPathsAndOffsets.mEndContainerPath;
int32_t start = mStartRootIndex - aDepth;
if (start >= 0 && (uint32_t)start <= mStartNodes.Length())
startNode = mStartNodes[start];
if (start >= 0 && (uint32_t)start <= startContainerPath.Length()) {
startNode = startContainerPath[start];
}
int32_t end = mEndRootIndex - aDepth;
if (end >= 0 && (uint32_t)end <= mEndNodes.Length())
endNode = mEndNodes[end];
if (end >= 0 && (uint32_t)end <= endContainerPath.Length()) {
endNode = endContainerPath[end];
}
}
if (startNode != content && endNode != content) {
@ -816,13 +842,19 @@ nsresult nsDocumentEncoder::SerializeRangeNodes(nsRange* const aRange,
NS_ENSURE_SUCCESS(rv, rv);
}
const auto& startContainerOffsets =
mRangeBoundaryPathsAndOffsets.mStartContainerOffsets;
const auto& endContainerOffsets =
mRangeBoundaryPathsAndOffsets.mEndContainerOffsets;
// do some calculations that will tell us which children of this
// node are in the range.
int32_t startOffset = 0, endOffset = -1;
if (startNode == content && mStartRootIndex >= aDepth)
startOffset = mStartOffsets[mStartRootIndex - aDepth];
if (endNode == content && mEndRootIndex >= aDepth)
endOffset = mEndOffsets[mEndRootIndex - aDepth];
if (startNode == content && mStartRootIndex >= aDepth) {
startOffset = startContainerOffsets[mStartRootIndex - aDepth];
}
if (endNode == content && mEndRootIndex >= aDepth) {
endOffset = endContainerOffsets[mEndRootIndex - aDepth];
}
// generated content will cause offset values of -1 to be returned.
uint32_t childCount = content->GetChildCount();
@ -944,20 +976,24 @@ nsresult nsDocumentEncoder::SerializeRangeToString(nsRange* aRange,
mStartDepth = mEndDepth = 0;
mCommonAncestors.Clear();
mStartNodes.Clear();
mStartOffsets.Clear();
mEndNodes.Clear();
mEndOffsets.Clear();
mRangeBoundaryPathsAndOffsets = {};
auto& startContainerPath = mRangeBoundaryPathsAndOffsets.mStartContainerPath;
auto& startContainerOffsets =
mRangeBoundaryPathsAndOffsets.mStartContainerOffsets;
auto& endContainerPath = mRangeBoundaryPathsAndOffsets.mEndContainerPath;
auto& endContainerOffsets =
mRangeBoundaryPathsAndOffsets.mEndContainerOffsets;
nsContentUtils::GetAncestors(mCommonParent, mCommonAncestors);
nsContentUtils::GetAncestorsAndOffsets(startContainer, startOffset,
&mStartNodes, &mStartOffsets);
nsContentUtils::GetAncestorsAndOffsets(endContainer, endOffset, &mEndNodes,
&mEndOffsets);
nsContentUtils::GetAncestorsAndOffsets(
startContainer, startOffset, &startContainerPath, &startContainerOffsets);
nsContentUtils::GetAncestorsAndOffsets(
endContainer, endOffset, &endContainerPath, &endContainerOffsets);
nsCOMPtr<nsIContent> commonContent = do_QueryInterface(mCommonParent);
mStartRootIndex = mStartNodes.IndexOf(commonContent);
mEndRootIndex = mEndNodes.IndexOf(commonContent);
mStartRootIndex = startContainerPath.IndexOf(commonContent);
mEndRootIndex = endContainerPath.IndexOf(commonContent);
nsresult rv = NS_OK;
@ -991,12 +1027,11 @@ nsresult nsDocumentEncoder::SerializeRangeToString(nsRange* aRange,
return rv;
}
void nsDocumentEncoder::Clear() {
void nsDocumentEncoder::ReleaseDocumentReferenceAndInitialize(
bool aClearCachedSerializer) {
mDocument = nullptr;
mCommonParent = nullptr;
mNodeFixup = nullptr;
Initialize(false);
Initialize(aClearCachedSerializer);
}
NS_IMETHODIMP

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

@ -231,6 +231,7 @@ interface nsIDocumentEncoder : nsISupports
/**
* Initialize with a pointer to the document and the mime type.
* Resets wrap column to 72 and resets node fixup.
* @param aDocument Document to encode.
* @param aMimeType MimeType to use. May also be set by SetMimeType.
* @param aFlags Flags to use while encoding. May also be set by SetFlags.

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

@ -17,10 +17,10 @@ interface nsISelectionDisplay : nsISupports
/*
SetSelectionFlags used to set whether you want to see HRULES/IMAGES with border.
also used to tell if the presshell is an editor right now. this should change
@param aToggle -either DISPLAY_(TEXT,IMAGES,FRAMES,ALL)
This will tell the rendering engine to draw the different
selection types.
selection types.
*/
void setSelectionFlags(in short toggle);
@ -28,8 +28,8 @@ interface nsISelectionDisplay : nsISupports
/*
GetSelectionFlags used to get whether you want to see HRULES/IMAGES with border.
also used to tell if the presshell is an editor right now. this should change
@param short *aReturn - This will be filled with DISPLAY_(TEXT,IMAGE,FRAMES,ALL)
@param short *aReturn - This will be filled with DISPLAY_(TEXT,IMAGE,FRAMES,ALL)
bit flags.
*/
short getSelectionFlags();

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

@ -396,7 +396,7 @@ partial namespace ChromeUtils {
void resetLastExternalProtocolIframeAllowed();
[ChromeOnly, Throws]
void registerWindowActor(DOMString aName, WindowActorOptions aOptions);
void registerWindowActor(DOMString aName, optional WindowActorOptions aOptions);
[ChromeOnly]
void unregisterWindowActor(DOMString aName);
@ -621,13 +621,13 @@ dictionary WindowActorOptions {
sequence<DOMString> remoteTypes;
/** This fields are used for configuring individual sides of the actor. */
required WindowActorSidedOptions parent;
required WindowActorChildOptions child;
WindowActorSidedOptions parent = null;
WindowActorChildOptions child = null;
};
dictionary WindowActorSidedOptions {
/** The module path which should be loaded for the actor on this side. */
required ByteString moduleURI;
ByteString moduleURI;
};
dictionary WindowActorChildOptions : WindowActorSidedOptions {

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

@ -74,7 +74,7 @@ interface nsICommandManager : nsISupports
* (equivalent to calling isCommandEnabled).
*
* aCommandName is the name of the command that needs the state
* aTargetWindow is the source of command controller
* aTargetWindow is the source of command controller
* (null means use focus controller)
* On output: aCommandParams: values set by the caller filled in with
* state from the command.

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

@ -33,12 +33,12 @@ interface nsIControllerCommand : nsISupports
boolean isCommandEnabled(in string aCommandName, in nsISupports aCommandContext);
void getCommandStateParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext);
/**
* Execute the name command.
*
* @param aCommandName the name of the command to execute.
*
*
* @param aCommandContext a cookie held by the nsIControllerCommandTable,
* allowing the command to get some context information.
* The contents of this cookie are implementation-defined.
@ -48,6 +48,6 @@ interface nsIControllerCommand : nsISupports
[can_run_script]
void doCommandParams(in string aCommandName, in nsICommandParams aParams, in nsISupports aCommandContext);
};

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

@ -12,14 +12,14 @@ class nsControllerCommandTable;
/**
* nsIControllerCommandTable
*
*
* An interface via which a controller can maintain a series of commands,
* and efficiently dispatch commands to their respective handlers.
*
* Controllers that use an nsIControllerCommandTable should support
* nsIInterfaceRequestor, and be able to return an interface to their
* controller command table via getInterface().
*
*
*/
[scriptable, builtinclass, uuid(c847f90e-b8f3-49db-a4df-8867831f2800)]
@ -28,11 +28,11 @@ interface nsIControllerCommandTable : nsISupports
/**
* Make this command table immutable, so that commands cannot
* be registered or unregistered. Some command tables are made
* mutable after command registration so that they can be
* mutable after command registration so that they can be
* used as singletons.
*/
void makeImmutable();
/**
* Register and unregister commands with the command table.
*
@ -43,7 +43,7 @@ interface nsIControllerCommandTable : nsISupports
*/
void registerCommand(in string aCommandName, in nsIControllerCommand aCommand);
void unregisterCommand(in string aCommandName, in nsIControllerCommand aCommand);
/**
* Find the command handler which has been registered to handle the named command.
*

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

@ -2,7 +2,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
#include "nsIControllerCommandTable.idl"

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

@ -197,6 +197,7 @@ static uint32_t sESMInstanceCount = 0;
int32_t EventStateManager::sUserInputEventDepth = 0;
int32_t EventStateManager::sUserKeyboardEventDepth = 0;
bool EventStateManager::sNormalLMouseEventInProcess = false;
int16_t EventStateManager::sCurrentMouseBtn = MouseButton::eNotPressed;
EventStateManager* EventStateManager::sActiveESM = nullptr;
Document* EventStateManager::sMouseOverDocument = nullptr;
AutoWeakFrame EventStateManager::sLastDragOverFrame = nullptr;
@ -6280,6 +6281,12 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
mMouseButtonEventHandlingDocument =
fm->SetMouseButtonHandlingDocument(aDocument);
}
if (NeedsToUpdateCurrentMouseBtnState()) {
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (mouseEvent) {
EventStateManager::sCurrentMouseBtn = mouseEvent->mButton;
}
}
}
AutoHandlingUserInputStatePusher::~AutoHandlingUserInputStatePusher() {
@ -6296,6 +6303,9 @@ AutoHandlingUserInputStatePusher::~AutoHandlingUserInputStatePusher() {
nsCOMPtr<Document> handlingDocument =
fm->SetMouseButtonHandlingDocument(mMouseButtonEventHandlingDocument);
}
if (NeedsToUpdateCurrentMouseBtnState()) {
EventStateManager::sCurrentMouseBtn = MouseButton::eNotPressed;
}
}
} // namespace mozilla

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

@ -1262,6 +1262,7 @@ class EventStateManager : public nsSupportsWeakReference, public nsIObserver {
static int32_t sUserKeyboardEventDepth;
static bool sNormalLMouseEventInProcess;
static int16_t sCurrentMouseBtn;
static EventStateManager* sActiveESM;
@ -1298,6 +1299,11 @@ class MOZ_RAII AutoHandlingUserInputStatePusher final {
bool NeedsToResetFocusManagerMouseButtonHandlingState() const {
return mMessage == eMouseDown || mMessage == eMouseUp;
}
bool NeedsToUpdateCurrentMouseBtnState() const {
return mMessage == eMouseDown || mMessage == eMouseUp ||
mMessage == ePointerDown || mMessage == ePointerUp;
}
};
} // namespace mozilla

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

@ -44,4 +44,4 @@ interface nsIImageDocument : nsISupports {
*/
[binaryname(DOMToggleImageSize)]
void toggleImageSize();
};
};

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

@ -111,15 +111,50 @@ function testLongRunningEventHandler() {
}
addFullscreenErrorContinuation(() => {
ok(!document.fullscreenElement,
"Should not grant request in long-running event handler.");
// Restore the pref environment we changed before
// entering testNonTrustContext.
SpecialPowers.popPrefEnv(finish);
"Should not grant request in long-running event handler.");
SimpleTest.executeSoon(testFullscreenMouseBtn);
});
window.addEventListener("keypress", longRunningHandler);
sendString("a");
}
function requestFullscreenMouseBtn(event, button) {
let clickEl = document.createElement("p");
clickEl.innerText = "Click Me";
function eventHandler(event) {
document.body.requestFullscreen();
event.target.removeEventListener(event, this);
}
clickEl.addEventListener(event, eventHandler);
document.body.appendChild(clickEl);
synthesizeMouseAtCenter(clickEl, { button });
}
async function testFullscreenMouseBtn(event, button, next) {
await SpecialPowers.pushPrefEnv({
"set": [["full-screen-api.mouse-event-allow-left-button-only", true]]
});
let fsRequestEvents = ["mousedown", "mouseup", "pointerdown", "pointerup"];
let mouseButtons = [1, 2];
for (let i = 0; i < fsRequestEvents.length; i++) {
let event = fsRequestEvents[i];
for (let j = 0; j < mouseButtons.length; j++) {
let mouseButton = mouseButtons[j];
let fsDenied = addFullscreenErrorContinuation();
requestFullscreenMouseBtn(event, mouseButton);
await fsDenied;
ok(!document.fullscreenElement, `Should not grant request on '${event}' triggered by mouse button ${mouseButton}`);
}
}
// Restore the pref environment we changed before
// entering testNonTrustContext.
await SpecialPowers.popPrefEnv();
finish();
}
function finish() {
opener.nextTest();
}

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

@ -72,12 +72,19 @@ function addFullscreenChangeContinuation(type, callback, inDoc) {
// Calls |callback| when the next fullscreenerror is dispatched to inDoc||document.
function addFullscreenErrorContinuation(callback, inDoc) {
var doc = inDoc || document;
var listener = function(event) {
doc.removeEventListener("fullscreenerror", listener);
setTimeout(function(){callback(event);}, 0);
};
doc.addEventListener("fullscreenerror", listener);
return new Promise((resolve) => {
let doc = inDoc || document;
let listener = function(event) {
doc.removeEventListener("fullscreenerror", listener);
setTimeout(function(){
if(callback) {
callback(event);
}
resolve();
}, 0);
};
doc.addEventListener("fullscreenerror", listener);
})
}
// Waits until the window has both the load event and a MozAfterPaint called on

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

@ -209,9 +209,9 @@ interface nsIDOMWindowUtils : nsISupports {
* The effect of this API is for gfx code to allocate more or fewer
* pixels for rescalable content by a factor of |resolution| in
* both dimensions.
*
*
* In addition, the content is scaled by the amount of the resolution,
* so that it is displayed at a correspondingly larger or smaller size,
* so that it is displayed at a correspondingly larger or smaller size,
* without the need for the caller to set an additional transform.
*
* This can be used to implement a non-reflowing scale-zoom, e.g.

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

@ -96,7 +96,7 @@ interface nsIRemoteTab : nsISupports
/**
* Notify APZ to start autoscrolling.
* (aAnchorX, aAnchorY) are the coordinates of the autoscroll anchor,
* in CSS coordinates relative to the screen. aScrollId and
* in CSS coordinates relative to the screen. aScrollId and
* aPresShellId identify the scroll frame that content chose to scroll.
* Returns whether we were successfully able to notify APZ.
* If this function returns true, APZ (which may live in another process)

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

@ -11,7 +11,7 @@ webidl Event;
* The nsIDOMEventListener interface is a callback interface for
* listening to events in the Document Object Model.
*
* For more information on this interface please see
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Events/
*/
@ -19,12 +19,12 @@ webidl Event;
interface nsIDOMEventListener : nsISupports
{
/**
* This method is called whenever an event occurs of the type for which
* This method is called whenever an event occurs of the type for which
* the EventListener interface was registered.
*
* @param evt The Event contains contextual information about the
* event. It also contains the stopPropagation and
* preventDefault methods which are used in determining the
* @param evt The Event contains contextual information about the
* event. It also contains the stopPropagation and
* preventDefault methods which are used in determining the
* event's flow and default action.
*/
[can_run_script]

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

@ -242,7 +242,7 @@ interface nsIContentSecurityPolicy : nsISerializable
*/
[noscript] void ensureEventTarget(in nsIEventTarget aEventTarget);
/**
* Verifies ancestry as permitted by the policy.
*

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

@ -10,13 +10,13 @@ interface nsIURI;
/**
* nsIWebProtocolHandlerRegistrar
*
*
* Applications wishing to use web protocol handlers need to implement this
* interface. Typically they will prompt the user to confirm adding an entry
* to the local list.
* to the local list.
*
* The component must have the contract id defined below so that the Navigator
* implementation can invoke it.
* implementation can invoke it.
*/
[scriptable, uuid(1ce9ef8d-f462-49ca-b8e9-c946c4f37d6e)]

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

@ -12,7 +12,7 @@ interface nsIDOMXULButtonElement : nsIDOMXULControlElement {
// For buttons of type="menu" only.
attribute boolean open;
// For buttons of type="checkbox" only.
attribute boolean checked;

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

@ -10,10 +10,10 @@ interface nsIControllers;
[scriptable, uuid(bdc1d047-6d22-4813-bc50-638ccb349c7d)]
interface nsIDOMXULControlElement : nsISupports {
attribute boolean disabled;
// XXX defined in XULElement, but should be defined here
// readonly attribute nsIControllers controllers;
// void focus();
// void blur();
};

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

@ -11,13 +11,13 @@ webidl Element;
interface nsIDOMXULMenuListElement : nsIDOMXULSelectControlElement {
attribute boolean editable;
attribute boolean open;
// label of selected option or value of textfield for editable menu lists
readonly attribute AString label;
attribute AString crop;
attribute AString image;
// For editable menu lists only.
readonly attribute Element inputField;
};

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

@ -17,7 +17,7 @@ interface nsIDOMXULMultiSelectControlElement : nsIDOMXULSelectControlElement
attribute long currentIndex;
readonly attribute NodeList selectedItems;
void addItemToSelection(in nsIDOMXULSelectControlItemElement item);
void removeItemFromSelection(in nsIDOMXULSelectControlItemElement item);
void toggleItemSelection(in nsIDOMXULSelectControlItemElement item);
@ -29,7 +29,7 @@ interface nsIDOMXULMultiSelectControlElement : nsIDOMXULSelectControlElement
void invertSelection();
void clearSelection();
// XXX - temporary, pending implementation of scriptable,
// XXX - temporary, pending implementation of scriptable,
// mutable NodeList for selectedItems
readonly attribute long selectedCount;
[binaryname(MultiGetSelectedItem)]

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

@ -16,13 +16,13 @@ interface nsIDOMXULSelectControlItemElement : nsISupports {
attribute AString label;
attribute AString accessKey;
attribute AString command;
attribute AString value;
readonly attribute boolean selected;
readonly attribute Element control;
// XXX defined in XULElement, but should be defined here
// void doCommand();
};

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

@ -47,7 +47,7 @@ JSWindowActorProtocol::FromIPC(const JSWindowActorInfo& aInfo) {
proto->mAllFrames = aInfo.allFrames();
proto->mMatches = aInfo.matches();
proto->mRemoteTypes = aInfo.remoteTypes();
proto->mChild.mModuleURI.Assign(aInfo.url());
proto->mChild.mModuleURI = aInfo.url();
proto->mChild.mEvents.SetCapacity(aInfo.events().Length());
for (auto& ipc : aInfo.events()) {
@ -111,8 +111,13 @@ JSWindowActorProtocol::FromWebIDLOptions(const nsAString& aName,
proto->mRemoteTypes = aOptions.mRemoteTypes.Value();
}
proto->mParent.mModuleURI = aOptions.mParent.mModuleURI;
proto->mChild.mModuleURI = aOptions.mChild.mModuleURI;
if (aOptions.mParent.mModuleURI.WasPassed()) {
proto->mParent.mModuleURI.emplace(aOptions.mParent.mModuleURI.Value());
}
if (aOptions.mChild.mModuleURI.WasPassed()) {
proto->mChild.mModuleURI.emplace(aOptions.mChild.mModuleURI.Value());
}
// For each event declared in the source dictionary, initialize the
// corresponding envent declaration entry in the JSWindowActorProtocol.

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

@ -51,7 +51,7 @@ class JSWindowActorProtocol final : public nsIObserver,
ErrorResult& aRv);
struct Sided {
nsCString mModuleURI;
Maybe<nsCString> mModuleURI;
};
struct ParentSide : public Sided {};

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

@ -227,7 +227,7 @@ struct JSWindowActorInfo
{
nsString name;
bool allFrames;
nsCString url;
nsCString? url;
JSWindowActorEventDecl[] events;
nsCString[] observers;

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

@ -9,6 +9,8 @@
#include "mozJSComponentLoader.h"
#include "mozilla/Logging.h"
#include "mozilla/dom/JSWindowActorService.h"
#include "mozilla/dom/JSWindowActorParent.h"
#include "mozilla/dom/JSWindowActorChild.h"
namespace mozilla {
namespace dom {
@ -57,7 +59,28 @@ void WindowGlobalActor::ConstructActor(const nsAString& aName,
side = &proto->Child();
}
aRv = loader->Import(cx, side->mModuleURI, &global, &exports);
// Support basic functionally such as SendAsyncMessage and SendQuery for
// unspecified moduleURI.
if (!side->mModuleURI) {
RefPtr<JSWindowActor> actor;
if (actorType == JSWindowActor::Type::Parent) {
actor = new JSWindowActorParent();
} else {
actor = new JSWindowActorChild();
}
JS::Rooted<JS::Value> wrapper(cx);
if (!ToJSValue(cx, actor, &wrapper)) {
aRv.NoteJSContextException(cx);
return;
}
MOZ_ASSERT(wrapper.isObject());
aActor.set(&wrapper.toObject());
return;
}
aRv = loader->Import(cx, side->mModuleURI.ref(), &global, &exports);
if (aRv.Failed()) {
return;
}

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

@ -63,6 +63,7 @@ FullscreenDeniedFocusedPlugin=Request for fullscreen was denied because a window
FullscreenDeniedHidden=Request for fullscreen was denied because the document is no longer visible.
FullscreenDeniedContainerNotAllowed=Request for fullscreen was denied because at least one of the documents containing elements is not an iframe or does not have an “allowfullscreen” attribute.
FullscreenDeniedNotInputDriven=Request for fullscreen was denied because Element.requestFullscreen() was not called from inside a short running user-generated event handler.
FullscreenDeniedMouseEventOnlyLeftBtn=Request for fullscreen was denied because Element.requestFullscreen() was called from inside a mouse event handler not triggered by left mouse button.
FullscreenDeniedNotHTMLSVGOrMathML=Request for fullscreen was denied because requesting element is not <svg>, <math>, or an HTML element.
FullscreenDeniedNotInDocument=Request for fullscreen was denied because requesting element is no longer in its document.
FullscreenDeniedMovedDocument=Request for fullscreen was denied because requesting element has moved document.

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

@ -758,7 +758,8 @@ void DecodedStream::SendVideo(bool aIsSameOrigin,
for (uint32_t i = 0; i < video.Length(); ++i) {
VideoData* v = video[i];
TimeUnit lastStart = mData->mLastVideoStartTime.valueOr(mStartTime.ref());
TimeUnit lastStart = mData->mLastVideoStartTime.valueOr(
mStartTime.ref() - TimeUnit::FromMicroseconds(1));
TimeUnit lastEnd = mData->mLastVideoEndTime.valueOr(mStartTime.ref());
if (lastEnd < v->mTime) {
@ -777,7 +778,10 @@ void DecodedStream::SendVideo(bool aIsSameOrigin,
mData->WriteVideoToSegment(mData->mLastVideoImage, lastEnd, v->mTime,
mData->mLastVideoImageDisplaySize, t, &output,
aPrincipalHandle);
} else if (lastStart < v->mTime) {
lastEnd = v->mTime;
}
if (lastStart < v->mTime) {
// This frame starts after the last frame's start. Note that this could be
// before the last frame's end time for some videos. This only matters for
// the track's lifetime in the MSG, as rendering is based on timestamps,

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

@ -278,7 +278,7 @@ var gPlayTests = [
{ name:"test-7-6.1.opus", type:"audio/ogg; codecs=opus", duration:11.690 },
{ name:"test-8-7.1.opus", type:"audio/ogg; codecs=opus", duration:13.478 },
{ name:"gizmo-short.mp4", type:"video/mp4", duration:0.27 },
{ name:"gizmo-short.mp4", type:"video/mp4", duration:0.27, contentDuration:0.267 },
// Test playback of a MP4 file with a non-zero start time (and audio starting
// a second later).
{ name:"bipbop-lateaudio.mp4", type:"video/mp4" },

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

@ -78,6 +78,14 @@ already_AddRefed<MessageChannel> MessageChannel::Constructor(
channel->mPort1->UnshippedEntangle(channel->mPort2);
channel->mPort2->UnshippedEntangle(channel->mPort1);
// MessagePorts should not work if created from a disconnected window.
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal);
if (window && !window->GetDocShell()) {
// The 2 ports are entangled. We can close one of them to close the other
// too.
channel->mPort1->CloseForced();
}
return channel.forget();
}

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

@ -29,3 +29,4 @@ skip-if = (os == "win" && processor == "aarch64") #bug 1535784
[test_messageChannel_bug1178076.html]
[test_messageChannel_bug1224825.html]
[test_messageChannel_worker_forceClose.html]
[test_removedWindow.html]

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

@ -0,0 +1,55 @@
<!DOCTYPE html>
<title>MessagePort should not work when created from a disconnected window</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<body>
<script>
"use strict";
SimpleTest.waitForExplicitFinish();
runTest();
async function runTest() {
let ifr = document.createElement('iframe');
await new Promise(resolve => {
ifr.onload = resolve;
ifr.src = 'support/empty.html';
document.body.appendChild(ifr);
});
let w = ifr.contentWindow;
let pre = new w.MessageChannel();
ok(!!pre, "We have a channel");
ifr.remove();
let post = new w.MessageChannel();
ok(!!post, "We have a channel");
// This should silently fail.
pre.port1.postMessage(42);
pre.port2.onmessage = e => {
ok(false, "No messages should be received!");
}
// This should silently fail.
post.port1.postMessage(42);
post.port2.onmessage = e => {
ok(false, "No messages should be received!");
}
// Let's use another MessagePort just to be sure no messages are received by
// port2.
let mc = new MessageChannel();
mc.port1.postMessage(42);
mc.port2.onmessage = e => {
ok(true, "Ready to complete the test");
SimpleTest.finish();
}
}
</script>
</body>

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

@ -16,7 +16,7 @@ interface nsIHTTPHeaderListener : nsISupports
{
/**
* Called for each HTTP Response header.
* NOTE: You must copy the values of the params.
* NOTE: You must copy the values of the params.
*/
void newResponseHeader(in string headerName, in string headerValue);

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

@ -63,7 +63,7 @@ interface nsIPluginInstanceOwner : nsISupports
* with nullptr aTarget.
*/
NS_IMETHOD
GetURL(const char *aURL, const char *aTarget,
GetURL(const char *aURL, const char *aTarget,
nsIInputStream *aPostStream,
void *aHeadersData, uint32_t aHeadersDataLen,
bool aDoCheckLoadURIChecks) = 0;

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

@ -21,7 +21,7 @@ interface nsIController : nsISupports {
Enhanced controller interface that allows for passing of parameters
to commands.
*/
interface nsICommandParams;
@ -29,9 +29,9 @@ interface nsICommandParams;
[scriptable, uuid(EEC0B435-7F53-44FE-B00A-CF3EED65C01A)]
interface nsICommandController : nsISupports
{
void getCommandStateWithParams( in string command, in nsICommandParams aCommandParams);
[can_run_script]
void doCommandWithParams(in string command, in nsICommandParams aCommandParams);

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

@ -29,6 +29,6 @@ interface nsIControllers : nsISupports
Get the controller specified by the given ID.
*/
nsIController getControllerById(in unsigned long controllerID);
unsigned long getControllerCount();
};

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

@ -31,10 +31,10 @@ interface nsICollation : nsISupports {
// use the primary comparison for the given locale - no flags
const long kCollationStrengthDefault = 0;
// do not consider case differences when doing the comparison i.e. A=a)
// do not consider case differences when doing the comparison i.e. A=a)
const long kCollationCaseInsensitiveAscii = 1;
// do not consider accent differences when doing the comparison a=á)
// do not consider accent differences when doing the comparison a=á)
const long kCollationAccentInsenstive = 2;
// case sensitive collation (default)
@ -52,7 +52,7 @@ interface nsICollation : nsISupports {
// allocate sort key from input string
// returns newly allocated key, and its band its byte length
[noscript] void allocateRawSortKey(in long strength,
[noscript] void allocateRawSortKey(in long strength,
in AString stringIn,
[array,size_is(outLen)] out octet key,
out unsigned long outLen);

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

@ -771,7 +771,7 @@ struct RealmStats {
MACRO(Other, MallocHeap, baselineData) \
MACRO(Other, MallocHeap, baselineStubsFallback) \
MACRO(Other, MallocHeap, ionData) \
MACRO(Other, MallocHeap, typeInferenceTypeScripts) \
MACRO(Other, MallocHeap, jitScripts) \
MACRO(Other, MallocHeap, typeInferenceAllocationSiteTables) \
MACRO(Other, MallocHeap, typeInferenceArrayTypeTables) \
MACRO(Other, MallocHeap, typeInferenceObjectTypeTables) \

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

@ -2531,7 +2531,7 @@ void GCRuntime::sweepTypesAfterCompacting(Zone* zone) {
for (auto script = zone->cellIterUnsafe<JSScript>(); !script.done();
script.next()) {
AutoSweepTypeScript sweep(script);
AutoSweepJitScript sweep(script);
}
for (auto group = zone->cellIterUnsafe<ObjectGroup>(); !group.done();
group.next()) {
@ -5916,7 +5916,7 @@ static void SweepThing(Shape* shape) {
}
}
static void SweepThing(JSScript* script) { AutoSweepTypeScript sweep(script); }
static void SweepThing(JSScript* script) { AutoSweepJitScript sweep(script); }
static void SweepThing(ObjectGroup* group) {
AutoSweepObjectGroup sweep(group);
@ -8102,7 +8102,7 @@ void GCRuntime::mergeRealms(Realm* source, Realm* target) {
script.next()) {
MOZ_ASSERT(script->realm() == source);
script->realm_ = target;
MOZ_ASSERT(!script->types());
MOZ_ASSERT(!script->jitScript());
}
GlobalObject* global = target->maybeGlobal();

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

@ -16,8 +16,9 @@
namespace js {
namespace gc {
// Mark colors to pass to markIfUnmarked.
enum class MarkColor : uint32_t { Black = 0, Gray };
// Mark colors. Order is important here: the greater value the 'more marked' a
// cell is.
enum class MarkColor : uint8_t { Gray = 1, Black = 2 };
// The phases of an incremental GC.
#define GCSTATES(D) \

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

@ -17,9 +17,12 @@ namespace js {
namespace gc {
// Like gc::MarkColor but allows the possibility of the cell being
// unmarked. Order is important here, with white being 'least marked'
// and black being 'most marked'.
enum class CellColor : uint8_t { White = 0, Gray = 1, Black = 2 };
// unmarked.
enum class CellColor : uint8_t {
White = 0,
Gray = uint8_t(MarkColor::Gray),
Black = uint8_t(MarkColor::Black)
};
static constexpr CellColor AllCellColors[] = {
CellColor::White, CellColor::Gray, CellColor::Black

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

@ -207,16 +207,16 @@ void Zone::discardJitCode(FreeOp* fop,
if (discardBaselineCode || releaseTypes) {
#ifdef DEBUG
// Assert no TypeScripts are marked as active.
// Assert no JitScripts are marked as active.
for (auto script = cellIter<JSScript>(); !script.done(); script.next()) {
if (TypeScript* types = script.unbarrieredGet()->types()) {
MOZ_ASSERT(!types->active());
if (JitScript* jitScript = script.unbarrieredGet()->jitScript()) {
MOZ_ASSERT(!jitScript->active());
}
}
#endif
// Mark TypeScripts on the stack as active.
jit::MarkActiveTypeScripts(this);
// Mark JitScripts on the stack as active.
jit::MarkActiveJitScripts(this);
}
// Invalidate all Ion code in this zone.
@ -228,7 +228,7 @@ void Zone::discardJitCode(FreeOp* fop,
// Discard baseline script if it's not marked as active.
if (discardBaselineCode && script->hasBaselineScript()) {
if (script->types()->active()) {
if (script->jitScript()->active()) {
// ICs will be purged so the script will need to warm back up before it
// can be inlined during Ion compilation.
script->baselineScript()->clearIonCompiledOrInlined();
@ -248,24 +248,22 @@ void Zone::discardJitCode(FreeOp* fop,
script->baselineScript()->setControlFlowGraph(nullptr);
}
// Try to release the script's TypeScript. This should happen after
// Try to release the script's JitScript. This should happen after
// releasing JIT code because we can't do this when the script still has
// JIT code.
if (releaseTypes) {
script->maybeReleaseTypes();
script->maybeReleaseJitScript();
}
// The optimizedStubSpace will be purged below so make sure ICScript
// doesn't point into it. We do this after (potentially) releasing types
// because TypeScript contains the ICScript* and there's no need to
// purge stubs if we just destroyed the Typescript.
if (discardBaselineCode && script->hasICScript()) {
script->icScript()->purgeOptimizedStubs(script);
}
if (JitScript* jitScript = script->jitScript()) {
// If we did not release the JitScript, we need to purge optimized IC
// stubs because the optimizedStubSpace will be purged below.
if (discardBaselineCode) {
jitScript->purgeOptimizedStubs(script);
}
// Finally, reset the active flag.
if (TypeScript* types = script->types()) {
types->resetActive();
// Finally, reset the active flag.
jitScript->resetActive();
}
}
@ -527,10 +525,11 @@ void MemoryTracker::adopt(MemoryTracker& other) {
static const char* MemoryUseName(MemoryUse use) {
switch (use) {
#define DEFINE_CASE(Name) \
case MemoryUse::Name: return #Name;
JS_FOR_EACH_MEMORY_USE(DEFINE_CASE)
#undef DEFINE_CASE
# define DEFINE_CASE(Name) \
case MemoryUse::Name: \
return #Name;
JS_FOR_EACH_MEMORY_USE(DEFINE_CASE)
# undef DEFINE_CASE
}
MOZ_CRASH("Unknown memory use");
@ -551,8 +550,7 @@ MemoryTracker::~MemoryTracker() {
fprintf(stderr, "Missing calls to JS::RemoveAssociatedMemory:\n");
for (auto r = map.all(); !r.empty(); r.popFront()) {
fprintf(stderr, " %p 0x%zx %s\n", r.front().key().cell,
r.front().value(),
fprintf(stderr, " %p 0x%zx %s\n", r.front().key().cell, r.front().value(),
MemoryUseName(r.front().key().use));
}

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

@ -1073,7 +1073,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
const uint32_t pcOff = script->pcToOffset(pc);
BaselineScript* baselineScript = script->baselineScript();
ICScript* icScript = script->icScript();
JitScript* jitScript = script->jitScript();
#ifdef DEBUG
uint32_t expectedDepth;
@ -1136,7 +1136,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
// Not every monitored op has a monitored fallback stub, e.g.
// JSOP_NEWOBJECT, which always returns the same type for a
// particular script/pc location.
ICEntry& icEntry = icScript->icEntryFromPCOffset(pcOff);
ICEntry& icEntry = jitScript->icEntryFromPCOffset(pcOff);
ICFallbackStub* fallbackStub = icEntry.firstStub()->getChainFallback();
if (fallbackStub->isMonitoredFallback()) {
enterMonitorChain = true;
@ -1153,7 +1153,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
builder.setResumeFramePtr(prevFramePtr);
if (enterMonitorChain) {
ICEntry& icEntry = icScript->icEntryFromPCOffset(pcOff);
ICEntry& icEntry = jitScript->icEntryFromPCOffset(pcOff);
ICFallbackStub* fallbackStub = icEntry.firstStub()->getChainFallback();
MOZ_ASSERT(fallbackStub->isMonitoredFallback());
JitSpew(JitSpew_BaselineBailouts, " [TYPE-MONITOR CHAIN]");
@ -1337,7 +1337,7 @@ static bool InitFromBailout(JSContext* cx, size_t frameNo, HandleFunction fun,
// Calculate and write out return address.
// The icEntry in question MUST have an inlinable fallback stub.
ICEntry& icEntry = icScript->icEntryFromPCOffset(pcOff);
ICEntry& icEntry = jitScript->icEntryFromPCOffset(pcOff);
MOZ_ASSERT(IsInlinableFallback(icEntry.firstStub()->getChainFallback()));
RetAddrEntry& retAddrEntry =

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

@ -162,8 +162,8 @@ MethodStatus BaselineCompiler::compile() {
AutoTraceLog logScript(logger, scriptEvent);
AutoTraceLog logCompile(logger, TraceLogger_BaselineCompilation);
AutoKeepTypeScripts keepTypes(cx);
if (!script->ensureHasTypes(cx, keepTypes)) {
AutoKeepJitScripts keepJitScript(cx);
if (!script->ensureHasJitScript(cx, keepJitScript)) {
return Method_Error;
}
@ -542,8 +542,8 @@ bool BaselineCodeGen<Handler>::emitOutOfLinePostBarrierSlot() {
template <>
bool BaselineCompilerCodeGen::emitNextIC() {
// Emit a call to an IC stored in ICScript. Calls to this must match the
// ICEntry order in ICScript: first the non-op IC entries for |this| and
// Emit a call to an IC stored in JitScript. Calls to this must match the
// ICEntry order in JitScript: first the non-op IC entries for |this| and
// formal arguments, then the for-op IC entries for JOF_IC ops.
JSScript* script = handler.script();
@ -553,7 +553,7 @@ bool BaselineCompilerCodeGen::emitNextIC() {
// to loop until we find an ICEntry for the current pc.
const ICEntry* entry;
do {
entry = &script->icScript()->icEntry(handler.icEntryIndex());
entry = &script->jitScript()->icEntry(handler.icEntryIndex());
handler.moveToNextICEntry();
} while (entry->pcOffset() < pcOffset);
@ -1111,10 +1111,9 @@ void BaselineInterpreterCodeGen::emitInitFrameFields() {
masm.storePtr(scratch1, frame.addressOfInterpreterScript());
// Initialize interpreterICEntry.
masm.loadPtr(Address(scratch1, JSScript::offsetOfTypes()), scratch2);
masm.loadPtr(Address(scratch2, TypeScript::offsetOfICScript()), scratch2);
masm.computeEffectiveAddress(Address(scratch2, ICScript::offsetOfICEntries()),
scratch2);
masm.loadPtr(Address(scratch1, JSScript::offsetOfJitScript()), scratch2);
masm.computeEffectiveAddress(
Address(scratch2, JitScript::offsetOfICEntries()), scratch2);
masm.storePtr(scratch2, frame.addressOfInterpreterICEntry());
// Initialize interpreterPC.
@ -5897,7 +5896,7 @@ bool BaselineCodeGen<Handler>::emitGeneratorResume(
ValueOperand retVal = regs.takeAnyValue();
masm.loadValue(frame.addressOfStackValue(-1), retVal);
// Branch to interpret if the script does not have a TypeScript or
// Branch to interpret if the script does not have a JitScript or
// BaselineScript (depending on whether the Baseline Interpreter is enabled).
// Note that we don't relazify generator scripts, so the function is
// guaranteed to be non-lazy.
@ -5906,8 +5905,9 @@ bool BaselineCodeGen<Handler>::emitGeneratorResume(
masm.loadPtr(Address(callee, JSFunction::offsetOfScript()), scratch1);
Address baselineAddr(scratch1, JSScript::offsetOfBaselineScript());
if (JitOptions.baselineInterpreter) {
Address typesAddr(scratch1, JSScript::offsetOfTypes());
masm.branchPtr(Assembler::Equal, typesAddr, ImmPtr(nullptr), &interpret);
Address jitScriptAddr(scratch1, JSScript::offsetOfJitScript());
masm.branchPtr(Assembler::Equal, jitScriptAddr, ImmPtr(nullptr),
&interpret);
} else {
masm.branchPtr(Assembler::BelowOrEqual, baselineAddr,
ImmPtr(BASELINE_DISABLED_SCRIPT), &interpret);
@ -6126,7 +6126,7 @@ bool BaselineCodeGen<Handler>::emitGeneratorResume(
masm.implicitPop((fun.explicitStackSlots() + 1) * sizeof(void*));
}
// Call into the VM to run in the C++ interpreter if there's no TypeScript or
// Call into the VM to run in the C++ interpreter if there's no JitScript or
// BaselineScript.
masm.bind(&interpret);
@ -6264,10 +6264,9 @@ bool BaselineInterpreterCodeGen::emit_JSOP_JUMPTARGET() {
// Compute ICEntry* and store to frame->interpreterICEntry.
loadScript(scratch2);
masm.loadPtr(Address(scratch2, JSScript::offsetOfTypes()), scratch2);
masm.loadPtr(Address(scratch2, TypeScript::offsetOfICScript()), scratch2);
masm.loadPtr(Address(scratch2, JSScript::offsetOfJitScript()), scratch2);
masm.computeEffectiveAddress(
BaseIndex(scratch2, scratch1, TimesOne, ICScript::offsetOfICEntries()),
BaseIndex(scratch2, scratch1, TimesOne, JitScript::offsetOfICEntries()),
scratch2);
masm.storePtr(scratch2, frame.addressOfInterpreterICEntry());
return true;

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