Merge inbound to mozilla-central. a=merge

This commit is contained in:
Gurzau Raul 2018-08-31 00:49:36 +03:00
Родитель 580f807a65 c85c47cc05
Коммит 09fe34b331
128 изменённых файлов: 1153 добавлений и 651 удалений

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

@ -7992,7 +7992,7 @@ var ToolbarIconColor = {
break;
}
let toolbarSelector = "#navigator-toolbox > toolbar:not([collapsed=true])";
let toolbarSelector = ".browser-toolbar:not([collapsed=true])";
if (AppConstants.platform == "macosx")
toolbarSelector += ":not([type=menubar])";

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

@ -672,7 +672,7 @@ xmlns="http://www.w3.org/1999/xhtml"
<toolbox id="navigator-toolbox">
<!-- Menu -->
<toolbar type="menubar" id="toolbar-menubar"
class="chromeclass-menubar titlebar-color"
class="browser-toolbar chromeclass-menubar titlebar-color"
customizable="true"
mode="icons"
#ifdef MENUBAR_CAN_AUTOHIDE
@ -694,7 +694,7 @@ xmlns="http://www.w3.org/1999/xhtml"
</toolbar>
<toolbar id="TabsToolbar"
class="titlebar-color"
class="browser-toolbar titlebar-color"
fullscreentoolbar="true"
customizable="true"
mode="icons"
@ -753,6 +753,7 @@ xmlns="http://www.w3.org/1999/xhtml"
</toolbar>
<toolbar id="nav-bar"
class="browser-toolbar"
aria-label="&navbarCmd.label;"
fullscreentoolbar="true" mode="icons" customizable="true"
customizationtarget="nav-bar-customization-target"
@ -1059,7 +1060,7 @@ xmlns="http://www.w3.org/1999/xhtml"
<toolbar id="PersonalToolbar"
mode="icons"
class="chromeclass-directories"
class="browser-toolbar chromeclass-directories"
context="toolbar-context-menu"
toolbarname="&personalbarCmd.label;" accesskey="&personalbarCmd.accesskey;"
collapsed="true"

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

@ -18,7 +18,7 @@ skip-if = asan || debug || (os == 'win' && bits == 32) # Bug 1382809, bug 136995
skip-if = !debug
[browser_startup.js]
[browser_startup_content.js]
skip-if = !e10s || verify
skip-if = !e10s
[browser_startup_flicker.js]
run-if = debug || devedition || nightly_build # Requires startupRecorder.js, which isn't shipped everywhere by default
[browser_tabclose_grow.js]

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

@ -49,11 +49,10 @@ support-files = file_new_tab_page.html
[browser_new_tab_in_privileged_process_pref.js]
skip-if = !e10s # Pref and test only relevant for e10s.
[browser_new_web_tab_in_file_process_pref.js]
skip-if = !e10s || (os == 'mac' && debug) # Pref and test only relevant for e10s. #Bug 1366137
skip-if = !e10s # Pref and test only relevant for e10s.
[browser_newwindow_tabstrip_overflow.js]
[browser_open_newtab_start_observer_notification.js]
[browser_opened_file_tab_navigated_to_web.js]
skip-if = (os == 'mac' && debug) || (os == 'linux' && debug) # Bug 1356347
[browser_overflowScroll.js]
[browser_pinnedTabs_clickOpen.js]
[browser_pinnedTabs_closeByKeyboard.js]

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

@ -54,14 +54,14 @@ add_task(async function() {
httpTab = await BrowserTestUtils.switchTab(gBrowser, httpTab);
httpBrowser = httpTab.linkedBrowser;
}
let promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser);
let promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser, false, TEST_HTTP);
document.getElementById("reload-button").doCommand();
await promiseLoad;
await CheckBrowserInPid(httpBrowser, filePid,
"Check that http tab still in file content process after reload.");
// Check that same-origin load doesn't break the affinity.
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser);
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser, false, TEST_HTTP + "foo");
httpBrowser.loadURI(TEST_HTTP + "foo");
await promiseLoad;
await CheckBrowserInPid(httpBrowser, filePid,
@ -78,7 +78,7 @@ add_task(async function() {
// Check that history forward doesn't break the affinity.
promiseLocation =
BrowserTestUtils.waitForLocationChange(gBrowser, TEST_HTTP + "foo");
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser);
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser, false, TEST_HTTP + "foo");
httpBrowser.goForward();
await promiseLocation;
await CheckBrowserInPid(httpBrowser, filePid,
@ -92,14 +92,14 @@ add_task(async function() {
"Check that http tab still in file content process after history gotoIndex.");
// Check that file:// URI load doesn't break the affinity.
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser);
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser, false, uriString);
httpBrowser.loadURI(uriString);
await promiseLoad;
await CheckBrowserInPid(httpBrowser, filePid,
"Check that http tab still in file content process after file:// load.");
// Check that location change doesn't break the affinity.
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser);
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser, false, TEST_HTTP);
await ContentTask.spawn(httpBrowser, TEST_HTTP, uri => {
content.location = uri;
});
@ -108,7 +108,7 @@ add_task(async function() {
"Check that http tab still in file content process after location change.");
// Check that cross-origin load does break the affinity.
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser);
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser, false, TEST_CROSS_ORIGIN);
httpBrowser.loadURI(TEST_CROSS_ORIGIN);
await promiseLoad;
await CheckBrowserNotInPid(httpBrowser, filePid,

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

@ -2,6 +2,7 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
const TEST_FILE = "dummy_page.html";
const WEB_ADDRESS = "http://example.org/";
// Test for bug 1321020.
add_task(async function() {
@ -35,8 +36,8 @@ add_task(async function() {
let openedBrowser = openedTab.linkedBrowser;
// Ensure that new file:// tab can be navigated to web content.
openedBrowser.loadURI("http://example.org/");
let href = await BrowserTestUtils.browserLoaded(openedBrowser);
is(href, "http://example.org/",
openedBrowser.loadURI(WEB_ADDRESS);
let href = await BrowserTestUtils.browserLoaded(openedBrowser, false, WEB_ADDRESS);
is(href, WEB_ADDRESS,
"Check that new file:// page has navigated successfully to web content");
});

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

@ -69,11 +69,11 @@
border-top: none;
}
#navigator-toolbox > toolbar {
.browser-toolbar {
padding: 0;
}
#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) {
.browser-toolbar:not(.titlebar-color) {
background-color: var(--toolbar-bgcolor);
background-image: var(--toolbar-bgimage);
color: var(--toolbar-color, inherit);

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

@ -142,7 +142,7 @@
border-top: 1px solid rgba(0,0,0,0.65);
}
#navigator-toolbox > toolbar:not(#TabsToolbar) {
.browser-toolbar:not(#TabsToolbar) {
-moz-appearance: none;
background: var(--toolbar-bgcolor);
color: var(--toolbar-color, inherit);

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

@ -47,32 +47,32 @@
/* Bookmark toolbar */
#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar) {
#PersonalToolbar {
overflow: -moz-hidden-unscrollable;
max-height: 4em;
padding: 0 6px 2px;
}
:root[sessionrestored] #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar) {
:root[sessionrestored] #PersonalToolbar {
transition: min-height 170ms ease-out, max-height 170ms ease-out, @themeTransition@;
}
#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar)[collapsed=true] {
#PersonalToolbar[collapsed=true] {
min-height: 0.1px;
max-height: 0;
}
:root[sessionrestored] #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar)[collapsed=true] {
:root[sessionrestored] #PersonalToolbar[collapsed=true] {
transition: min-height 170ms ease-out, max-height 170ms ease-out, visibility 170ms linear;
}
#navigator-toolbox > toolbar[customizing]:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar) {
#PersonalToolbar[customizing] {
outline: 1px dashed;
outline-offset: -3px;
-moz-outline-radius: 2px;
}
#navigator-toolbox > toolbar[customizing]:not(#toolbar-menubar):not(#TabsToolbar):not(#nav-bar):empty {
#PersonalToolbar[customizing]:empty {
/* Avoid the toolbar having no height when there's no items in it */
min-height: 22px;
}

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

@ -63,7 +63,7 @@ toolbar[brighttext] .toolbarbutton-1 {
color: var(--chrome-color);
}
#navigator-toolbox > toolbar:not(#TabsToolbar):not(#toolbar-menubar),
.browser-toolbar:not(.titlebar-color),
.browserContainer > findbar,
#browser-bottombox {
background-color: var(--chrome-secondary-background-color) !important;

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

@ -275,8 +275,8 @@
@media (-moz-os-version: windows-win7),
(-moz-os-version: windows-win8) {
/* Vertical toolbar border */
#main-window[sizemode=normal] #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):not(:-moz-lwtheme),
#main-window[sizemode=normal] #navigator-toolbox > toolbar:-moz-lwtheme {
#main-window[sizemode=normal] .browser-toolbar:not(.titlebar-color):not(:-moz-lwtheme),
#main-window[sizemode=normal] .browser-toolbar:-moz-lwtheme {
border-left: 1px solid @glassShadowColor@;
border-right: 1px solid @glassShadowColor@;
background-clip: padding-box;

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

@ -131,11 +131,11 @@
}
#navigator-toolbox,
#navigator-toolbox > toolbar {
.browser-toolbar {
-moz-appearance: none;
}
#navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) {
.browser-toolbar:not(.titlebar-color) {
background-color: var(--toolbar-bgcolor);
background-image: var(--toolbar-bgimage);
background-clip: padding-box;

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

@ -462,6 +462,9 @@ set_config('MSMANIFEST_TOOL', depends(valid_mt)(lambda x: bool(x)))
link = check_prog('LINKER', ('lld-link.exe', 'link.exe'),
paths=toolchain_search_path)
host_link = check_prog('HOST_LINKER', ('lld-link.exe', 'link.exe'),
paths=toolchain_search_path)
add_old_configure_assignment('LINKER', link)

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

@ -592,7 +592,7 @@ endif
$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS) $(call mkdir_deps,$(DEPTH)/dist/host/bin)
$(REPORT_BUILD)
ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
$(LINKER) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(HOST_LINKER) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
if test -f '$(srcdir)/$(notdir $@).manifest'; then \
@ -653,7 +653,7 @@ endif
$(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS) $(HOST_EXTRA_DEPS) $(GLOBAL_DEPS)
$(REPORT_BUILD)
ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
$(LINKER) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(HOST_LINKER) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXX_LDFLAGS) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
@ -690,8 +690,7 @@ $(HOST_SHARED_LIBRARY): $(HOST_OBJS) Makefile
$(REPORT_BUILD)
$(RM) $@
ifdef _MSC_VER
# /!\ We assume host and target are using the same compiler
$(LINKER) -NOLOGO -DLL -OUT:$@ $(HOST_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
$(HOST_LINKER) -NOLOGO -DLL -OUT:$@ $(HOST_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
else
$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_OBJS) $(HOST_CXX_LDFLAGS) $(HOST_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif

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

@ -18,8 +18,7 @@ class Font extends PureComponent {
static get propTypes() {
return {
font: PropTypes.shape(Types.font).isRequired,
fontOptions: PropTypes.shape(Types.fontOptions).isRequired,
onPreviewFonts: PropTypes.func.isRequired,
onPreviewClick: PropTypes.func,
onToggleFontHighlight: PropTypes.func.isRequired,
};
}
@ -108,13 +107,10 @@ class Font extends PureComponent {
render() {
const {
font,
fontOptions,
onPreviewFonts,
onPreviewClick,
onToggleFontHighlight,
} = this.props;
const { previewText } = fontOptions;
const {
CSSFamilyName,
previewUrl,
@ -132,7 +128,7 @@ class Font extends PureComponent {
FontName({ font, onToggleFontHighlight })
),
FontOrigin({ font }),
FontPreview({ previewText, previewUrl, onPreviewFonts }),
FontPreview({ onPreviewClick, previewUrl }),
this.renderFontCSSCode(rule, ruleText)
);
}

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

@ -4,44 +4,83 @@
"use strict";
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
const Services = require("Services");
const {
createElement,
createFactory,
createRef,
Fragment,
PureComponent,
} = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const Font = createFactory(require("./Font"));
const FontPreviewInput = createFactory(require("./FontPreviewInput"));
const Types = require("../types");
const PREF_FONT_EDITOR = "devtools.inspector.fonteditor.enabled";
class FontList extends PureComponent {
static get propTypes() {
return {
fontOptions: PropTypes.shape(Types.fontOptions).isRequired,
fonts: PropTypes.arrayOf(PropTypes.shape(Types.font)).isRequired,
onPreviewFonts: PropTypes.func.isRequired,
onPreviewTextChange: PropTypes.func.isRequired,
onToggleFontHighlight: PropTypes.func.isRequired,
};
}
constructor(props) {
super(props);
this.onPreviewClick = this.onPreviewClick.bind(this);
this.previewInputRef = createRef();
}
/**
* Handler for clicks on the font preview image.
* Requests the FontPreviewInput component, if one exists, to focus its input field.
*/
onPreviewClick() {
this.previewInputRef.current && this.previewInputRef.current.focus();
}
render() {
const {
fonts,
fontOptions,
onPreviewFonts,
onPreviewTextChange,
onToggleFontHighlight
} = this.props;
return dom.ul(
const { previewText } = fontOptions;
const { onPreviewClick } = this;
const list = dom.ul(
{
className: "fonts-list"
},
fonts.map((font, i) => Font({
key: i,
font,
fontOptions,
onPreviewFonts,
onPreviewClick,
onToggleFontHighlight,
}))
);
// Show the font preview input only when the font editor is enabled.
const previewInput = Services.prefs.getBoolPref(PREF_FONT_EDITOR) ?
FontPreviewInput({
ref: this.previewInputRef,
onPreviewTextChange,
previewText,
})
:
null;
return createElement(Fragment, null, previewInput, list);
}
}

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

@ -22,7 +22,7 @@ class FontOverview extends PureComponent {
return {
fontData: PropTypes.shape(Types.fontData).isRequired,
fontOptions: PropTypes.shape(Types.fontOptions).isRequired,
onPreviewFonts: PropTypes.func.isRequired,
onPreviewTextChange: PropTypes.func.isRequired,
onToggleFontHighlight: PropTypes.func.isRequired,
};
}
@ -38,7 +38,7 @@ class FontOverview extends PureComponent {
const {
fontData,
fontOptions,
onPreviewFonts,
onPreviewTextChange,
onToggleFontHighlight,
} = this.props;
const { fonts } = fontData;
@ -47,7 +47,7 @@ class FontOverview extends PureComponent {
FontList({
fonts,
fontOptions,
onPreviewFonts,
onPreviewTextChange,
onToggleFontHighlight,
})
:
@ -63,7 +63,7 @@ class FontOverview extends PureComponent {
const {
fontData,
fontOptions,
onPreviewFonts,
onPreviewTextChange,
} = this.props;
const header = Services.prefs.getBoolPref(PREF_FONT_EDITOR)
@ -86,7 +86,7 @@ class FontOverview extends PureComponent {
componentProps: {
fontOptions,
fonts,
onPreviewFonts,
onPreviewTextChange,
onToggleFontHighlight: this.onToggleFontHighlightGlobal
},
opened: false

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

@ -9,86 +9,33 @@ const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const Types = require("../types");
const { getStr } = require("../utils/l10n");
class FontPreview extends PureComponent {
static get propTypes() {
return {
previewText: Types.fontOptions.previewText.isRequired,
onPreviewClick: PropTypes.func,
previewUrl: Types.font.previewUrl.isRequired,
onPreviewFonts: PropTypes.func.isRequired,
};
}
constructor(props) {
super(props);
this.state = {
// Is the text preview input field currently focused?
isFocused: false,
static get defaultProps() {
return {
onPreviewClick: () => {},
};
this.onBlur = this.onBlur.bind(this);
this.onClick = this.onClick.bind(this);
this.onChange = this.onChange.bind(this);
}
componentDidUpdate() {
if (this.state.isFocused) {
const input = this.fontPreviewInput;
input.focus();
input.selectionStart = input.selectionEnd = input.value.length;
}
}
onBlur() {
this.setState({ isFocused: false });
}
onClick(event) {
this.setState({ isFocused: true });
event.stopPropagation();
}
onChange(event) {
this.props.onPreviewFonts(event.target.value);
}
render() {
const {
previewText,
onPreviewClick,
previewUrl,
} = this.props;
const { isFocused } = this.state;
return dom.div(
return dom.img(
{
className: "font-preview-container",
},
isFocused ?
dom.input(
{
type: "search",
className: "font-preview-input devtools-searchinput",
value: previewText,
onBlur: this.onBlur,
onChange: this.onChange,
ref: input => {
this.fontPreviewInput = input;
}
}
)
:
null,
dom.img(
{
className: "font-preview",
src: previewUrl,
onClick: this.onClick,
title: !isFocused ? getStr("fontinspector.editPreview") : "",
}
)
className: "font-preview",
onClick: onPreviewClick,
src: previewUrl,
}
);
}
}

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

@ -0,0 +1,72 @@
/* 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 { createRef, PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const Types = require("../types");
const { getStr } = require("../utils/l10n");
const PREVIEW_TEXT_MAX_LENGTH = 30;
class FontPreviewInput extends PureComponent {
static get propTypes() {
return {
onPreviewTextChange: PropTypes.func.isRequired,
previewText: Types.fontOptions.previewText.isRequired,
};
}
constructor(props) {
super(props);
this.onChange = this.onChange.bind(this);
this.onFocus = this.onFocus.bind(this);
this.inputRef = createRef();
this.state = {
value: this.props.previewText
};
}
onChange(e) {
const value = e.target.value;
this.props.onPreviewTextChange(value);
this.setState((prevState) => {
return { ...prevState, value };
});
}
onFocus(e) {
e.target.select();
}
focus() {
this.inputRef.current.focus();
}
render() {
return dom.div(
{
id: "font-preview-input-container",
},
dom.input({
className: "devtools-searchinput",
onChange: this.onChange,
onFocus: this.onFocus,
maxlength: PREVIEW_TEXT_MAX_LENGTH,
placeholder: getStr("fontinspector.previewTextPlaceholder"),
ref: this.inputRef,
type: "text",
value: this.state.value,
})
);
}
}
module.exports = FontPreviewInput;

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

@ -22,7 +22,7 @@ class FontsApp extends PureComponent {
fontEditorEnabled: PropTypes.bool.isRequired,
fontOptions: PropTypes.shape(Types.fontOptions).isRequired,
onInstanceChange: PropTypes.func.isRequired,
onPreviewFonts: PropTypes.func.isRequired,
onPreviewTextChange: PropTypes.func.isRequired,
onPropertyChange: PropTypes.func.isRequired,
onToggleFontHighlight: PropTypes.func.isRequired,
};
@ -35,7 +35,7 @@ class FontsApp extends PureComponent {
fontEditorEnabled,
fontOptions,
onInstanceChange,
onPreviewFonts,
onPreviewTextChange,
onPropertyChange,
onToggleFontHighlight,
} = this.props;
@ -54,7 +54,7 @@ class FontsApp extends PureComponent {
FontOverview({
fontData,
fontOptions,
onPreviewFonts,
onPreviewTextChange,
onToggleFontHighlight,
})
);

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

@ -12,6 +12,7 @@ DevToolsModules(
'FontOrigin.js',
'FontOverview.js',
'FontPreview.js',
'FontPreviewInput.js',
'FontPropertyValue.js',
'FontsApp.js',
'FontSize.js',

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

@ -83,7 +83,7 @@ class FontInspector {
this.syncChanges = debounce(this.syncChanges, 100, this);
this.onInstanceChange = this.onInstanceChange.bind(this);
this.onNewNode = this.onNewNode.bind(this);
this.onPreviewFonts = this.onPreviewFonts.bind(this);
this.onPreviewTextChange = debounce(this.onPreviewTextChange, 100, this);
this.onPropertyChange = this.onPropertyChange.bind(this);
this.onRulePropertyUpdated = debounce(this.onRulePropertyUpdated, 100, this);
this.onToggleFontHighlight = this.onToggleFontHighlight.bind(this);
@ -103,7 +103,7 @@ class FontInspector {
fontEditorEnabled: Services.prefs.getBoolPref(PREF_FONT_EDITOR),
onInstanceChange: this.onInstanceChange,
onToggleFontHighlight: this.onToggleFontHighlight,
onPreviewFonts: this.onPreviewFonts,
onPreviewTextChange: this.onPreviewTextChange,
onPropertyChange: this.onPropertyChange,
});
@ -683,7 +683,7 @@ class FontInspector {
/**
* Handler for change in preview input.
*/
onPreviewFonts(value) {
onPreviewTextChange(value) {
this.store.dispatch(updatePreviewText(value));
this.update();
}

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

@ -9,7 +9,7 @@ const {
} = require("../actions/index");
const INITIAL_FONT_OPTIONS = {
previewText: "Abc",
previewText: "",
};
const reducers = {

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

@ -61,7 +61,7 @@ var openFontInspectorForURL = async function(url) {
};
/**
* Focus one of the preview inputs, clear it, type new text into it and wait for the
* Focus the preview input, clear it, type new text into it and wait for the
* preview images to be updated.
*
* @param {FontInspector} view - The FontInspector instance.
@ -71,15 +71,8 @@ async function updatePreviewText(view, text) {
info(`Changing the preview text to '${text}'`);
const doc = view.document;
const previewImg = doc.querySelector("#sidebar-panel-fontinspector .font-preview");
info("Clicking the font preview element to turn it to edit mode");
const onClick = once(doc, "click");
previewImg.click();
await onClick;
const input = previewImg.parentNode.querySelector("input");
is(doc.activeElement, input, "The input was focused.");
const input = doc.querySelector("#font-preview-input-container input");
input.focus();
info("Blanking the input field.");
while (input.value.length) {
@ -89,13 +82,13 @@ async function updatePreviewText(view, text) {
}
if (text) {
info("Typing the specified text to the input field.");
const update = waitForNEvents(view.inspector, "fontinspector-updated", text.length);
info(`Typing "${text}" into the input field.`);
const update = view.inspector.once("fontinspector-updated");
EventUtils.sendString(text, doc.defaultView);
await update;
}
is(input.value, text, "The input now contains the correct text.");
is(input.value, text, `The input now contains "${text}".`);
}
/**

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

@ -17,11 +17,6 @@ fontinspector.noFontsOnSelectedElement=No fonts were found for the current eleme
# header of a collapsible section containing other fonts used in the page.
fontinspector.otherFontsInPageHeader=Other fonts in page
# LOCALIZATION NOTE (fontinspector.editPreview): This is the text that appears in a
# tooltip on hover of a font preview string. Clicking on the string opens a text input
# where users can type to change the preview text.
fontinspector.editPreview=Click to edit preview
# LOCALIZATION NOTE (fontinspector.copyURL): This is the text that appears in a tooltip
# displayed when the user hovers over the copy icon next to the font URL.
# Clicking the copy icon copies the full font URL to the user's clipboard
@ -72,3 +67,7 @@ fontinspector.allFontsOnPageHeader=All fonts on page
# LOCALIZATION NOTE (fontinspector.usedFontsLabel): Label for the Font Editor section
# which shows the fonts used on the selected element.
fontinspector.usedFontsLabel=Fonts used
# LOCALIZATION NOTE (fontinspector.previewTextPlaceholder): Placeholder for the input
# where the user can type text to get a preview of it using a font.
fontinspector.previewTextPlaceholder=Font preview text

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

@ -9,6 +9,7 @@
--input-background-color: white;
--input-border-color: var(--grey-30);
--input-text-color: var(--grey-90);
--preview-input-background: var(--theme-toolbar-background);
}
:root.theme-dark {
@ -17,6 +18,7 @@
--input-background-color: var(--grey-70);
--input-border-color: var(--grey-70);
--input-text-color: var(--grey-40);
--preview-input-background: #222225;
}
#sidebar-panel-fontinspector {
@ -82,44 +84,25 @@
vertical-align: bottom;
}
.font-preview-container {
grid-column: 2;
grid-row: 1 / span 2;
overflow: hidden;
display: grid;
place-items: center end;
position: relative;
#font-preview-input-container {
background: var(--preview-input-background);
border-bottom: 1px solid var(--theme-splitter-color);
display: flex;
height: 23px;
}
#font-preview-input-container input {
background-image: none;
flex: 1;
padding-left: 14px;
}
.font-preview {
grid-column: 2;
grid-row: 1 / span 2;
object-fit: contain;
height: 50px;
display: block;
}
.font-preview:hover {
cursor: text;
background-image: linear-gradient(to right,
var(--grey-40) 3px, transparent 3px, transparent);
background-size: 6px 1px;
background-repeat: repeat-x;
background-position-y: 45px;
}
#font-container .font-preview-input {
position: absolute;
top: 5px;
left: 0;
width: calc(100% - 5px);
height: calc(100% - 10px);
background: transparent;
color: transparent;
border-radius: 0;
padding: 0;
}
.font-preview-input::-moz-selection {
background: transparent;
color: transparent;
width: 100%;
}
.font-name,

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

@ -1,12 +1,4 @@
<!-- 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 16 16"
fill="context-fill #0b0b0b">
<path d="M3.5 8h9v1h-9z"/>
<path d="M4 2v12h8v-12h-8
m-1 0c0-.55 .45-1 1-1h8c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1
h-8c-.55 0-1-.45-1-1z"/>
<circle cx="8" cy="11.5" r="1" fill="none" stroke="context-fill"
stroke-width="1"/>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="context-fill #0b0b0b">
<path d="M1,4H6A1,1,0,0,1,7,5V15a1,1,0,0,1-1,1H1a1,1,0,0,1-1-1V5A1,1,0,0,1,1,4ZM1,6v8H6V6Z"/>
<path d="M10,16H9a1,1,0,0,1,0-2h4V2H5V3H3V1A1,1,0,0,1,4,0H14a1,1,0,0,1,1,1V15a1,1,0,0,1-1,1Z"/>
</svg>

До

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

После

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

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

@ -283,6 +283,8 @@
#command-button-responsive::before {
background-image: var(--command-responsive-image);
fill: var(--theme-toolbar-photon-icon-color);
-moz-context-properties: fill;
}
#command-button-scratchpad::before {

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

@ -542,8 +542,13 @@ Navigator::CookieEnabled()
return cookieEnabled;
}
return AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(mWindow,
codebaseURI);
if (AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(mWindow,
codebaseURI)) {
return true;
}
AntiTrackingCommon::NotifyRejection(mWindow);
return false;
}
bool

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

@ -8917,28 +8917,10 @@ nsContentUtils::StorageDisabledByAntiTracking(nsPIDOMWindowInner* aWindow,
bool disabled =
StorageDisabledByAntiTrackingInternal(aWindow, aChannel, aPrincipal, aURI);
if (disabled && sAntiTrackingControlCenterUIEnabled) {
nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil = services::GetThirdPartyUtil();
if (!thirdPartyUtil) {
return false;
}
nsCOMPtr<nsPIDOMWindowOuter> pwin;
if (aWindow) {
auto* outer = nsGlobalWindowOuter::Cast(aWindow->GetOuterWindow());
if (outer) {
pwin = outer->GetTopOuter();
}
AntiTrackingCommon::NotifyRejection(aWindow);
} else if (aChannel) {
nsCOMPtr<mozIDOMWindowProxy> win;
nsresult rv = thirdPartyUtil->GetTopWindowForChannel(aChannel,
getter_AddRefs(win));
NS_ENSURE_SUCCESS(rv, false);
pwin = nsPIDOMWindowOuter::From(win);
}
if (pwin && aChannel) {
pwin->NotifyContentBlockingState(
nsIWebProgressListener::STATE_BLOCKED_TRACKING_COOKIES, aChannel);
AntiTrackingCommon::NotifyRejection(aChannel);
}
}
return disabled;

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

@ -101,7 +101,7 @@ NS_IMETHODIMP nsReadConfig::Observe(nsISupports *aSubject, const char *aTopic, c
if (NS_FAILED(rv)) {
if (sandboxEnabled) {
nsContentUtils::ReportToConsoleNonLocalized(
NS_LITERAL_STRING("Autoconfig is sandboxed by default. See https://www.mozilla.org/firefox/enterprise/releasenotes/ for more information."),
NS_LITERAL_STRING("Autoconfig is sandboxed by default. See https://support.mozilla.org/products/firefox-enterprise for more information."),
nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("autoconfig"),
nullptr);

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

@ -32,7 +32,10 @@ void brush_vs(
vec2 uv = snap_device_pos(vi) +
src_task.common_data.task_rect.p0 -
src_task.content_origin;
vUv = vec3(uv / texture_size, src_task.common_data.texture_layer_index);
vUv = vec3(
uv * gl_Position.w / texture_size, // multiply by W to compensate for perspective interpolation
src_task.common_data.texture_layer_index
);
vec2 uv0 = src_task.common_data.task_rect.p0;
vec2 uv1 = uv0 + src_task.common_data.task_rect.size;
@ -124,7 +127,8 @@ vec3 Brightness(vec3 Cs, float amount) {
}
Fragment brush_fs() {
vec4 Cs = texture(sColor0, vUv);
vec2 base_uv = vUv.xy * gl_FragCoord.w;
vec4 Cs = texture(sColor0, vec3(base_uv, vUv.z));
if (Cs.a == 0.0) {
return Fragment(vec4(0.0)); // could also `discard`
@ -155,7 +159,7 @@ Fragment brush_fs() {
// Fail-safe to ensure that we don't sample outside the rendered
// portion of a blend source.
alpha *= point_inside_rect(vUv.xy, vUvClipBounds.xy, vUvClipBounds.zw);
alpha *= point_inside_rect(base_uv, vUvClipBounds.xy, vUvClipBounds.zw);
// Pre-multiply the alpha into the output value.
return Fragment(alpha * vec4(color, 1.0));

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

@ -829,6 +829,7 @@ impl AlphaBatchBuilder {
);
let filter_mode = match filter {
FilterOp::Identity => 1, // matches `Contrast(1)`
FilterOp::Blur(..) => 0,
FilterOp::Contrast(..) => 1,
FilterOp::Grayscale(..) => 2,
@ -843,6 +844,7 @@ impl AlphaBatchBuilder {
};
let user_data = match filter {
FilterOp::Identity => 0x10000i32, // matches `Contrast(1)`
FilterOp::Contrast(amount) |
FilterOp::Grayscale(amount) |
FilterOp::Invert(amount) |

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

@ -324,6 +324,7 @@ pub struct ClipChainInstance {
pub clips_range: ClipNodeRange,
pub local_clip_rect: LayoutRect,
pub has_non_root_coord_system: bool,
pub has_non_local_clips: bool,
pub world_clip_rect: WorldRect,
}
@ -531,6 +532,7 @@ impl ClipStore {
let first_clip_node_index = self.clip_node_indices.len() as u32;
let mut has_non_root_coord_system = false;
let mut has_non_local_clips = false;
// For each potential clip node
for node_info in self.clip_node_info.drain(..) {
@ -542,9 +544,11 @@ impl ClipStore {
node.item.get_clip_result(&local_bounding_rect)
}
ClipSpaceConversion::Offset(offset) => {
has_non_local_clips = true;
node.item.get_clip_result(&local_bounding_rect.translate(&-offset))
}
ClipSpaceConversion::Transform(ref transform) => {
has_non_local_clips = true;
node.item.get_clip_result_complex(
transform,
&world_bounding_rect,
@ -603,6 +607,7 @@ impl ClipStore {
Some(ClipChainInstance {
clips_range,
has_non_root_coord_system,
has_non_local_clips,
local_clip_rect,
world_clip_rect,
})

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

@ -2211,7 +2211,8 @@ impl Primitive {
match segment_clip_chain {
Some(segment_clip_chain) => {
if segment_clip_chain.clips_range.count == 0 {
if segment_clip_chain.clips_range.count == 0 ||
(!segment.may_need_clip_mask && !segment_clip_chain.has_non_local_clips) {
segment.clip_task_id = BrushSegmentTaskId::Opaque;
continue;
}

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

@ -201,6 +201,7 @@ pub trait FilterOpHelpers {
impl FilterOpHelpers for FilterOp {
fn is_visible(&self) -> bool {
match *self {
FilterOp::Identity |
FilterOp::Blur(..) |
FilterOp::Brightness(..) |
FilterOp::Contrast(..) |
@ -219,6 +220,7 @@ impl FilterOpHelpers for FilterOp {
fn is_noop(&self) -> bool {
match *self {
FilterOp::Identity => false, // this is intentional
FilterOp::Blur(length) => length == 0.0,
FilterOp::Brightness(amount) => amount == 1.0,
FilterOp::Contrast(amount) => amount == 1.0,

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

@ -543,6 +543,9 @@ pub enum MixBlendMode {
#[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize)]
pub enum FilterOp {
/// Filter that does no transformation of the colors, needed for
/// debug purposes only.
Identity,
Blur(f32),
Brightness(f32),
Contrast(f32),

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

@ -16,7 +16,7 @@ use time::precise_time_ns;
use {AlphaType, BorderDetails, BorderDisplayItem, BorderRadius, BorderWidths, BoxShadowClipMode};
use {BoxShadowDisplayItem, ClipAndScrollInfo, ClipChainId, ClipChainItem, ClipDisplayItem, ClipId};
use {ColorF, ComplexClipRegion, DisplayItem, ExtendMode, ExternalScrollId, FilterOp};
use {FontInstanceKey, GlyphInstance, GlyphOptions, GlyphRasterSpace, Gradient};
use {FontInstanceKey, GlyphInstance, GlyphOptions, GlyphRasterSpace, Gradient, GradientBuilder};
use {GradientDisplayItem, GradientStop, IframeDisplayItem, ImageDisplayItem, ImageKey, ImageMask};
use {ImageRendering, LayoutPoint, LayoutPrimitiveInfo, LayoutRect, LayoutSize, LayoutTransform};
use {LayoutVector2D, LineDisplayItem, LineOrientation, LineStyle, MixBlendMode, PipelineId};
@ -947,7 +947,12 @@ impl DisplayListBuilder {
index
}
fn push_item(&mut self, item: SpecificDisplayItem, info: &LayoutPrimitiveInfo) {
/// Add an item to the display list.
///
/// NOTE: It is usually preferable to use the specialized methods to push
/// display items. Pushing unexpected or invalid items here may
/// result in WebRender panicking or behaving in unexpected ways.
pub fn push_item(&mut self, item: SpecificDisplayItem, info: &LayoutPrimitiveInfo) {
serialize_fast(
&mut self.data,
&DisplayItem {
@ -1018,7 +1023,11 @@ impl DisplayListBuilder {
debug_assert_eq!(len, count);
}
fn push_iter<I>(&mut self, iter: I)
/// Push items from an iterator to the display list.
///
/// NOTE: Pushing unexpected or invalid items to the display list
/// may result in panic and confusion.
pub fn push_iter<I>(&mut self, iter: I)
where
I: IntoIterator,
I::IntoIter: ExactSizeIterator + Clone,
@ -1112,129 +1121,34 @@ impl DisplayListBuilder {
}
}
// Gradients can be defined with stops outside the range of [0, 1]
// when this happens the gradient needs to be normalized by adjusting
// the gradient stops and gradient line into an equivalent gradient
// with stops in the range [0, 1]. this is done by moving the beginning
// of the gradient line to where stop[0] and the end of the gradient line
// to stop[n-1]. this function adjusts the stops in place, and returns
// the amount to adjust the gradient line start and stop
fn normalize_stops(stops: &mut Vec<GradientStop>, extend_mode: ExtendMode) -> (f32, f32) {
assert!(stops.len() >= 2);
let first = *stops.first().unwrap();
let last = *stops.last().unwrap();
assert!(first.offset <= last.offset);
let stops_delta = last.offset - first.offset;
if stops_delta > 0.000001 {
for stop in stops {
stop.offset = (stop.offset - first.offset) / stops_delta;
}
(first.offset, last.offset)
} else {
// We have a degenerate gradient and can't accurately transform the stops
// what happens here depends on the repeat behavior, but in any case
// we reconstruct the gradient stops to something simpler and equivalent
stops.clear();
match extend_mode {
ExtendMode::Clamp => {
// This gradient is two colors split at the offset of the stops,
// so create a gradient with two colors split at 0.5 and adjust
// the gradient line so 0.5 is at the offset of the stops
stops.push(GradientStop { color: first.color, offset: 0.0, });
stops.push(GradientStop { color: first.color, offset: 0.5, });
stops.push(GradientStop { color: last.color, offset: 0.5, });
stops.push(GradientStop { color: last.color, offset: 1.0, });
let offset = last.offset;
(offset - 0.5, offset + 0.5)
}
ExtendMode::Repeat => {
// A repeating gradient with stops that are all in the same
// position should just display the last color. I believe the
// spec says that it should be the average color of the gradient,
// but this matches what Gecko and Blink does
stops.push(GradientStop { color: last.color, offset: 0.0, });
stops.push(GradientStop { color: last.color, offset: 1.0, });
(0.0, 1.0)
}
}
}
}
// NOTE: gradients must be pushed in the order they're created
// because create_gradient stores the stops in anticipation
/// NOTE: gradients must be pushed in the order they're created
/// because create_gradient stores the stops in anticipation.
pub fn create_gradient(
&mut self,
start_point: LayoutPoint,
end_point: LayoutPoint,
mut stops: Vec<GradientStop>,
stops: Vec<GradientStop>,
extend_mode: ExtendMode,
) -> Gradient {
let (start_offset, end_offset) =
DisplayListBuilder::normalize_stops(&mut stops, extend_mode);
let start_to_end = end_point - start_point;
self.push_stops(&stops);
Gradient {
start_point: start_point + start_to_end * start_offset,
end_point: start_point + start_to_end * end_offset,
extend_mode,
}
let mut builder = GradientBuilder::with_stops(stops);
let gradient = builder.gradient(start_point, end_point, extend_mode);
self.push_stops(builder.stops());
gradient
}
// NOTE: gradients must be pushed in the order they're created
// because create_gradient stores the stops in anticipation
/// NOTE: gradients must be pushed in the order they're created
/// because create_gradient stores the stops in anticipation.
pub fn create_radial_gradient(
&mut self,
center: LayoutPoint,
radius: LayoutSize,
mut stops: Vec<GradientStop>,
stops: Vec<GradientStop>,
extend_mode: ExtendMode,
) -> RadialGradient {
if radius.width <= 0.0 || radius.height <= 0.0 {
// The shader cannot handle a non positive radius. So
// reuse the stops vector and construct an equivalent
// gradient.
let last_color = stops.last().unwrap().color;
let stops = [
GradientStop { offset: 0.0, color: last_color, },
GradientStop { offset: 1.0, color: last_color, },
];
self.push_stops(&stops);
return RadialGradient {
center,
radius: LayoutSize::new(1.0, 1.0),
start_offset: 0.0,
end_offset: 1.0,
extend_mode,
};
}
let (start_offset, end_offset) =
DisplayListBuilder::normalize_stops(&mut stops, extend_mode);
self.push_stops(&stops);
RadialGradient {
center,
radius,
start_offset,
end_offset,
extend_mode,
}
let mut builder = GradientBuilder::with_stops(stops);
let gradient = builder.radial_gradient(center, radius, extend_mode);
self.push_stops(builder.stops());
gradient
}
pub fn push_border(

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

@ -0,0 +1,153 @@
/* 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 {ExtendMode, Gradient, GradientStop, LayoutPoint, LayoutSize, RadialGradient};
/// Construct a gradient to be used in display lists.
///
/// Each gradient needs at least two stops.
pub struct GradientBuilder {
stops: Vec<GradientStop>,
}
impl GradientBuilder {
/// Create a new gradient builder.
pub fn new() -> GradientBuilder {
GradientBuilder {
stops: Vec::new(),
}
}
/// Create a gradient builder with a list of stops.
pub fn with_stops(stops: Vec<GradientStop>) -> GradientBuilder {
GradientBuilder { stops }
}
/// Push an additional stop for the gradient.
pub fn push(&mut self, stop: GradientStop) {
self.stops.push(stop);
}
/// Get a reference to the list of stops.
pub fn stops(&self) -> &[GradientStop] {
self.stops.as_ref()
}
/// Produce a linear gradient, normalize the stops.
pub fn gradient(
&mut self,
start_point: LayoutPoint,
end_point: LayoutPoint,
extend_mode: ExtendMode,
) -> Gradient {
let (start_offset, end_offset) = self.normalize(extend_mode);
let start_to_end = end_point - start_point;
Gradient {
start_point: start_point + start_to_end * start_offset,
end_point: start_point + start_to_end * end_offset,
extend_mode,
}
}
/// Produce a radial gradient, normalize the stops.
///
/// Will replace the gradient with a single color
/// if the radius negative.
pub fn radial_gradient(
&mut self,
center: LayoutPoint,
radius: LayoutSize,
extend_mode: ExtendMode,
) -> RadialGradient {
if radius.width <= 0.0 || radius.height <= 0.0 {
// The shader cannot handle a non positive radius. So
// reuse the stops vector and construct an equivalent
// gradient.
let last_color = self.stops.last().unwrap().color;
self.stops.clear();
self.stops.push(GradientStop { offset: 0.0, color: last_color, });
self.stops.push(GradientStop { offset: 1.0, color: last_color, });
return RadialGradient {
center,
radius: LayoutSize::new(1.0, 1.0),
start_offset: 0.0,
end_offset: 1.0,
extend_mode,
};
}
let (start_offset, end_offset) =
self.normalize(extend_mode);
RadialGradient {
center,
radius,
start_offset,
end_offset,
extend_mode,
}
}
/// Gradients can be defined with stops outside the range of [0, 1]
/// when this happens the gradient needs to be normalized by adjusting
/// the gradient stops and gradient line into an equivalent gradient
/// with stops in the range [0, 1]. this is done by moving the beginning
/// of the gradient line to where stop[0] and the end of the gradient line
/// to stop[n-1]. this function adjusts the stops in place, and returns
/// the amount to adjust the gradient line start and stop.
fn normalize(&mut self, extend_mode: ExtendMode) -> (f32, f32) {
let stops = &mut self.stops;
assert!(stops.len() >= 2);
let first = *stops.first().unwrap();
let last = *stops.last().unwrap();
assert!(first.offset <= last.offset);
let stops_delta = last.offset - first.offset;
if stops_delta > 0.000001 {
for stop in stops {
stop.offset = (stop.offset - first.offset) / stops_delta;
}
(first.offset, last.offset)
} else {
// We have a degenerate gradient and can't accurately transform the stops
// what happens here depends on the repeat behavior, but in any case
// we reconstruct the gradient stops to something simpler and equivalent
stops.clear();
match extend_mode {
ExtendMode::Clamp => {
// This gradient is two colors split at the offset of the stops,
// so create a gradient with two colors split at 0.5 and adjust
// the gradient line so 0.5 is at the offset of the stops
stops.push(GradientStop { color: first.color, offset: 0.0, });
stops.push(GradientStop { color: first.color, offset: 0.5, });
stops.push(GradientStop { color: last.color, offset: 0.5, });
stops.push(GradientStop { color: last.color, offset: 1.0, });
let offset = last.offset;
(offset - 0.5, offset + 0.5)
}
ExtendMode::Repeat => {
// A repeating gradient with stops that are all in the same
// position should just display the last color. I believe the
// spec says that it should be the average color of the gradient,
// but this matches what Gecko and Blink does
stops.push(GradientStop { color: last.color, offset: 0.0, });
stops.push(GradientStop { color: last.color, offset: 1.0, });
(0.0, 1.0)
}
}
}
}
}

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

@ -33,6 +33,7 @@ mod color;
mod display_item;
mod display_list;
mod font;
mod gradient_builder;
mod image;
mod units;
@ -41,5 +42,6 @@ pub use color::*;
pub use display_item::*;
pub use display_list::*;
pub use font::*;
pub use gradient_builder::*;
pub use image::*;
pub use units::*;

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

@ -1 +1 @@
816ff14c1805c145ccd60d0227d82b1541fc24eb
5fa5c46e167ca834d8fec3bf662bf420418698f4

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

@ -228,6 +228,7 @@ fn write_stacking_context(
let mut filters = vec![];
for filter in filter_iter {
match filter {
FilterOp::Identity => { filters.push(Yaml::String("identity".into())) }
FilterOp::Blur(x) => { filters.push(Yaml::String(format!("blur({})", x))) }
FilterOp::Brightness(x) => { filters.push(Yaml::String(format!("brightness({})", x))) }
FilterOp::Contrast(x) => { filters.push(Yaml::String(format!("contrast({})", x))) }

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

@ -544,6 +544,9 @@ impl YamlHelper for Yaml {
fn as_filter_op(&self) -> Option<FilterOp> {
if let Some(s) = self.as_str() {
match parse_function(s) {
("identity", _, _) => {
Some(FilterOp::Identity)
}
("blur", ref args, _) if args.len() == 1 => {
Some(FilterOp::Blur(args[0].parse().unwrap()))
}

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

@ -38,7 +38,6 @@
#include "ctypes/Library.h"
#include "gc/FreeOp.h"
#include "gc/Policy.h"
#include "gc/Zone.h"
#include "jit/AtomicOperations.h"
#include "js/AutoByteString.h"
#include "js/StableStringChars.h"

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

@ -7,6 +7,7 @@
#ifndef frontend_BinSource_macros_h
#define frontend_BinSource_macros_h
#include "vm/JSContext.h"
// Evaluate an expression EXPR, checking that the result is not falsy.
//
@ -17,7 +18,6 @@
return cx_->alreadyReportedError(); \
} while(false)
// Evaluate an expression EXPR, checking that the result is not falsy.
// In case of success, assign the result to VAR.
//

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

@ -75,16 +75,15 @@ class BinASTParserBase: private JS::AutoGCRooter
LifoAlloc::Mark tempPoolMark_;
ParseNodeAllocator nodeAlloc_;
// ---- Parsing-related stuff
protected:
// Root atoms and objects allocated for the parse tree.
AutoKeepAtoms keepAtoms_;
// ---- Parsing-related stuff
protected:
ParseContext* parseContext_;
FullParseHandler factory_;
friend class BinParseContext;
};
/**

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

@ -8,12 +8,10 @@
#define frontend_BinSourceSupport_h
#include "mozilla/HashFunctions.h"
#include "mozilla/Maybe.h"
#include "jsapi.h"
#include "frontend/BinToken.h"
#include "js/AllocPolicy.h"
#include "js/HashTable.h"
#include "js/Result.h"
@ -21,9 +19,9 @@ namespace js {
// Support for parsing JS Binary ASTs.
struct BinaryASTSupport {
using BinVariant = js::frontend::BinVariant;
using BinVariant = js::frontend::BinVariant;
using BinField = js::frontend::BinField;
using BinKind = js::frontend::BinKind;
using BinKind = js::frontend::BinKind;
// A structure designed to perform fast char* + length lookup
// without copies.

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

@ -10,12 +10,10 @@
#include <sys/types.h>
#include "jsapi.h"
#include "frontend/BinSourceRuntimeSupport.h"
#include "frontend/TokenStream.h"
#include "gc/Zone.h"
#include "js/Result.h"
#include "vm/Runtime.h"
namespace js {
namespace frontend {

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

@ -7,7 +7,6 @@
#include "frontend/BinTokenReaderBase.h"
#include "frontend/BinSource-macros.h"
#include "gc/Zone.h"
#include "js/Result.h"
namespace js {
@ -64,6 +63,13 @@ BinTokenReaderBase::raiseInvalidField(const char* kind, const BinField field)
return raiseError(out.string());
}
#ifdef DEBUG
bool
BinTokenReaderBase::hasRaisedError() const
{
return cx_->isExceptionPending();
}
#endif
size_t
BinTokenReaderBase::offset() const

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

@ -124,7 +124,7 @@ class MOZ_STACK_CLASS BinTokenReaderBase
MOZ_MUST_USE bool matchConst(const char (&value)[N], bool expectNul) {
MOZ_ASSERT(N > 0);
MOZ_ASSERT(value[N - 1] == 0);
MOZ_ASSERT(!cx_->isExceptionPending());
MOZ_ASSERT(!hasRaisedError());
if (current_ + N - 1 > stop_)
return false;
@ -141,6 +141,10 @@ class MOZ_STACK_CLASS BinTokenReaderBase
void updateLatestKnownGood();
#ifdef DEBUG
bool hasRaisedError() const;
#endif
JSContext* cx_;
// `true` if we have encountered an error. Errors are non recoverable.

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

@ -16,7 +16,6 @@
#include "frontend/BinSource-macros.h"
#include "frontend/BinSourceRuntimeSupport.h"
#include "gc/Zone.h"
#include "js/Result.h"
namespace js {

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

@ -9,6 +9,7 @@
#include "mozilla/Maybe.h"
#include "frontend/BinSourceRuntimeSupport.h"
#include "frontend/BinToken.h"
#include "frontend/BinTokenReaderBase.h"

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

@ -13,7 +13,6 @@
#include "mozilla/PodOperations.h"
#include "frontend/BinSource-macros.h"
#include "gc/Zone.h"
#include "js/Result.h"
namespace js {

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

@ -26,8 +26,7 @@
#include "vm/EnvironmentObject-inl.h"
#include "vm/GeckoProfiler-inl.h"
#include "vm/JSObject-inl.h"
#include "vm/JSScript-inl.h"
#include "vm/JSContext-inl.h"
using namespace js;
using namespace js::frontend;

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

@ -13,7 +13,6 @@
#include "js/CompileOptions.h"
#include "vm/Scope.h"
#include "vm/StringType.h"
#include "vm/TraceLogging.h"
class JSLinearString;

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

@ -19,7 +19,6 @@
#include "frontend/TDZCheckCache.h"
#include "gc/Rooting.h"
#include "vm/BytecodeUtil.h"
#include "vm/StringType.h"
namespace js {
namespace frontend {

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

@ -18,7 +18,6 @@
#include <string.h>
#include "jsapi.h"
#include "jsnum.h"
#include "jstypes.h"
#include "jsutil.h"
@ -49,10 +48,7 @@
#include "wasm/AsmJS.h"
#include "frontend/ParseNode-inl.h"
#include "vm/EnvironmentObject-inl.h"
#include "vm/JSAtom-inl.h"
#include "vm/JSScript-inl.h"
#include "vm/NativeObject-inl.h"
#include "vm/JSObject-inl.h"
using namespace js;
using namespace js::gc;

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

@ -21,8 +21,6 @@
#include "vm/BytecodeUtil.h"
#include "vm/Interpreter.h"
#include "vm/Iteration.h"
#include "vm/JSContext.h"
#include "vm/JSScript.h"
namespace js {
namespace frontend {

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

@ -10,6 +10,8 @@
#include "frontend/TDZCheckCache.h"
#include "js/AutoByteString.h"
#include "vm/GlobalObject.h"
using namespace js;
using namespace js::frontend;

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

@ -18,9 +18,11 @@
#include "frontend/ParseContext.h"
#include "frontend/SharedContext.h"
#include "js/TypeDecls.h"
#include "vm/Scope.h"
namespace js {
class Scope;
namespace frontend {
// A scope that introduces bindings.

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

@ -11,7 +11,10 @@
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t
#include "jsapi.h" // for JS::ReadOnlyCompileOptions
#include "js/CompileOptions.h"
#include "js/UniquePtr.h"
class JSErrorNotes;
namespace js {
namespace frontend {

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

@ -9,15 +9,13 @@
#include "mozilla/FloatingPoint.h"
#include "jslibmath.h"
#include "jsnum.h"
#include "frontend/ParseNode.h"
#include "frontend/Parser.h"
#include "js/Conversions.h"
#include "vm/StringType.h"
#include "vm/JSContext-inl.h"
#include "vm/JSObject-inl.h"
using namespace js;
using namespace js::frontend;

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

@ -12,8 +12,6 @@
#include <stdint.h>
#include "jsapi.h"
#include "frontend/BytecodeControlStructures.h"
#include "frontend/TryEmitter.h"
#include "vm/Iteration.h"

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

@ -14,6 +14,7 @@
#include "frontend/ParseNode.h"
#include "frontend/SharedContext.h"
#include "vm/JSContext.h"
namespace js {

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

@ -10,11 +10,12 @@
#include "ds/InlineTable.h"
#include "frontend/NameAnalysisTypes.h"
#include "js/Vector.h"
#include "vm/Stack.h"
namespace js {
namespace frontend {
class FunctionBox;
// A pool of recyclable containers for use in the frontend. The Parser and
// BytecodeEmitter create many maps for name analysis that are short-lived
// (i.e., for the duration of parsing or emitting a lexical scope). Making
@ -162,7 +163,6 @@ using RecyclableNameMap = InlineMap<JSAtom*,
SystemAllocPolicy>;
using DeclaredNameMap = RecyclableNameMap<DeclaredNameInfo>;
using CheckTDZMap = RecyclableNameMap<MaybeCheckTDZ>;
using NameLocationMap = RecyclableNameMap<NameLocation>;
using AtomIndexMap = RecyclableNameMap<uint32_t>;
@ -335,9 +335,6 @@ class PooledVectorPtr
namespace mozilla {
template <>
struct IsPod<js::MaybeCheckTDZ> : TrueType {};
template <typename T>
struct IsPod<js::frontend::RecyclableAtomMapValueWrapper<T>> : IsPod<T> {};

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

@ -1,3 +1,9 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* 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/. */
#ifndef frontend_ParseContext_inl_h
#define frontend_ParseContext_inl_h
@ -20,7 +26,6 @@ ParseContext::Statement::is<ParseContext::ClassStatement>() const
return kind_ == StatementKind::Class;
}
inline JS::Result<Ok, ParseContext::BreakStatementError>
ParseContext::checkBreakStatement(PropertyName* label)
{

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

@ -486,35 +486,9 @@ class ParseContext : public Nestable<ParseContext>
bool superScopeNeedsHomeObject_;
public:
inline ParseContext(JSContext* cx, ParseContext*& parent, SharedContext* sc, ErrorReporter& errorReporter,
class UsedNameTracker& usedNames, Directives* newDirectives, bool isFull)
: Nestable<ParseContext>(&parent),
traceLog_(sc->context,
isFull
? TraceLogger_ParsingFull
: TraceLogger_ParsingSyntax,
errorReporter),
sc_(sc),
errorReporter_(errorReporter),
innermostStatement_(nullptr),
innermostScope_(nullptr),
varScope_(nullptr),
positionalFormalParameterNames_(cx->frontendCollectionPool()),
closedOverBindingsForLazy_(cx->frontendCollectionPool()),
innerFunctionsForLazy(cx, GCVector<JSFunction*, 8>(cx)),
newDirectives(newDirectives),
lastYieldOffset(NoYieldOffset),
lastAwaitOffset(NoAwaitOffset),
scriptId_(usedNames.nextScriptId()),
isStandaloneFunctionBody_(false),
superScopeNeedsHomeObject_(false)
{
if (isFunctionBox()) {
if (functionBox()->function()->isNamedLambda())
namedLambdaScope_.emplace(cx, parent, usedNames);
functionScope_.emplace(cx, parent, usedNames);
}
}
ParseContext(JSContext* cx, ParseContext*& parent, SharedContext* sc,
ErrorReporter& errorReporter, UsedNameTracker& usedNames,
Directives* newDirectives, bool isFull);
MOZ_MUST_USE bool init();

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

@ -8,6 +8,8 @@
#include "mozilla/FloatingPoint.h"
#include "jsnum.h"
#include "frontend/Parser.h"
#include "vm/JSContext-inl.h"

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

@ -9,9 +9,10 @@
#include "mozilla/Attributes.h"
#include "builtin/ModuleObject.h"
#include "frontend/TokenStream.h"
#include "vm/BytecodeUtil.h"
#include "vm/Printer.h"
#include "vm/Scope.h"
// A few notes on lifetime of ParseNode trees:
//

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

@ -28,7 +28,7 @@
#include <memory>
#include <new>
#include "jsapi.h"
#include "jsnum.h"
#include "jstypes.h"
#include "builtin/ModuleObject.h"
@ -50,8 +50,6 @@
#include "frontend/ParseContext-inl.h"
#include "frontend/ParseNode-inl.h"
#include "vm/EnvironmentObject-inl.h"
#include "vm/JSAtom-inl.h"
#include "vm/JSScript-inl.h"
using namespace js;
using namespace js::gc;
@ -380,6 +378,37 @@ EvalSharedContext::EvalSharedContext(JSContext* cx, JSObject* enclosingEnv,
}
}
ParseContext::ParseContext(JSContext* cx, ParseContext*& parent, SharedContext* sc,
ErrorReporter& errorReporter, class UsedNameTracker& usedNames,
Directives* newDirectives, bool isFull)
: Nestable<ParseContext>(&parent),
traceLog_(sc->context,
isFull
? TraceLogger_ParsingFull
: TraceLogger_ParsingSyntax,
errorReporter),
sc_(sc),
errorReporter_(errorReporter),
innermostStatement_(nullptr),
innermostScope_(nullptr),
varScope_(nullptr),
positionalFormalParameterNames_(cx->frontendCollectionPool()),
closedOverBindingsForLazy_(cx->frontendCollectionPool()),
innerFunctionsForLazy(cx, GCVector<JSFunction*, 8>(cx)),
newDirectives(newDirectives),
lastYieldOffset(NoYieldOffset),
lastAwaitOffset(NoAwaitOffset),
scriptId_(usedNames.nextScriptId()),
isStandaloneFunctionBody_(false),
superScopeNeedsHomeObject_(false)
{
if (isFunctionBox()) {
if (functionBox()->function()->isNamedLambda())
namedLambdaScope_.emplace(cx, parent, usedNames);
functionScope_.emplace(cx, parent, usedNames);
}
}
bool
ParseContext::init()
{
@ -462,6 +491,14 @@ UsedNameTracker::rewind(RewindToken token)
r.front().value().resetToScope(token.scriptId, token.scopeId);
}
#ifdef DEBUG
bool
FunctionBox::atomsAreKept()
{
return context->zone()->hasKeptAtoms();
}
#endif
FunctionBox::FunctionBox(JSContext* cx, ObjectBox* traceListHead,
JSFunction* fun, uint32_t toStringStart,
Directives directives, bool extraWarnings,

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

@ -181,8 +181,6 @@
#include "frontend/SharedContext.h"
#include "frontend/SyntaxParseHandler.h"
#include "frontend/TokenStream.h"
#include "js/CompileOptions.h"
#include "vm/Iteration.h"
namespace js {

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

@ -14,10 +14,8 @@
#include "ds/InlineTable.h"
#include "frontend/ParseNode.h"
#include "frontend/TokenStream.h"
#include "gc/Zone.h"
#include "vm/BytecodeUtil.h"
#include "vm/EnvironmentObject.h"
#include "vm/JSAtom.h"
#include "vm/JSFunction.h"
#include "vm/JSScript.h"
namespace js {
@ -410,18 +408,22 @@ class FunctionBox : public ObjectBox, public SharedContext
uint32_t toStringStart, Directives directives, bool extraWarnings,
GeneratorKind generatorKind, FunctionAsyncKind asyncKind);
#ifdef DEBUG
bool atomsAreKept();
#endif
MutableHandle<LexicalScope::Data*> namedLambdaBindings() {
MOZ_ASSERT(context->zone()->hasKeptAtoms());
MOZ_ASSERT(atomsAreKept());
return MutableHandle<LexicalScope::Data*>::fromMarkedLocation(&namedLambdaBindings_);
}
MutableHandle<FunctionScope::Data*> functionScopeBindings() {
MOZ_ASSERT(context->zone()->hasKeptAtoms());
MOZ_ASSERT(atomsAreKept());
return MutableHandle<FunctionScope::Data*>::fromMarkedLocation(&functionScopeBindings_);
}
MutableHandle<VarScope::Data*> extraVarScopeBindings() {
MOZ_ASSERT(context->zone()->hasKeptAtoms());
MOZ_ASSERT(atomsAreKept());
return MutableHandle<VarScope::Data*>::fromMarkedLocation(&extraVarScopeBindings_);
}

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

@ -20,6 +20,8 @@ namespace frontend {
struct BytecodeEmitter;
using CheckTDZMap = RecyclableNameMap<MaybeCheckTDZ>;
// A cache that tracks Temporal Dead Zone (TDZ) checks, so that any use of a
// lexical variable that's dominated by an earlier use, or by evaluation of its
// declaration (which will initialize it, perhaps to |undefined|), doesn't have

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

@ -210,13 +210,17 @@
#include "util/Text.h"
#include "util/Unicode.h"
#include "vm/ErrorReporting.h"
#include "vm/JSContext.h"
#include "vm/RegExpShared.h"
#include "vm/JSAtom.h"
#include "vm/RegExpConstants.h"
#include "vm/StringType.h"
struct JSContext;
struct KeywordInfo;
namespace js {
class AutoKeepAtoms;
namespace frontend {
struct TokenPos {

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

@ -2532,7 +2532,7 @@ Zone::prepareForCompacting()
void
GCRuntime::sweepTypesAfterCompacting(Zone* zone)
{
zone->beginSweepTypes(rt->gc.releaseObservedTypes && !zone->isPreservingCode());
zone->beginSweepTypes(releaseObservedTypes && !zone->isPreservingCode());
AutoClearTypeInferenceStateOnOOM oom(zone);
@ -2948,7 +2948,7 @@ GCRuntime::updateZonePointersToRelocatedCells(Zone* zone)
}
// Sweep everything to fix up weak pointers.
rt->gc.sweepZoneAfterCompacting(zone);
sweepZoneAfterCompacting(zone);
// Call callbacks to get the rest of the system to fixup other untraced pointers.
for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next())
@ -3642,7 +3642,7 @@ GCRuntime::sweepBackgroundThings(ZoneList& zones, LifoAlloc& freeBlocks)
// sweeping finished. Now we must update this value.
arena->zone->threshold.updateForRemovedArena(tunables);
rt->gc.releaseArena(arena, lock);
releaseArena(arena, lock);
releaseCount++;
if (releaseCount % LockReleasePeriod == 0) {
lock.unlock();
@ -3763,33 +3763,39 @@ BackgroundSweepTask::run()
MOZ_ASSERT(!done);
JSRuntime* rt = runtime();
// The main thread may call queueZonesForBackgroundSweep() while this is
// running so we must check there is no more work after releasing the lock.
do {
ZoneList zones;
zones.transferFrom(rt->gc.backgroundSweepZones.ref());
LifoAlloc freeLifoAlloc(JSContext::TEMP_LIFO_ALLOC_PRIMARY_CHUNK_SIZE);
freeLifoAlloc.transferFrom(&rt->gc.blocksToFreeAfterSweeping.ref());
AutoUnlockHelperThreadState unlock(lock);
rt->gc.sweepBackgroundThings(zones, freeLifoAlloc);
} while (!rt->gc.backgroundSweepZones.ref().isEmpty());
runtime()->gc.sweepFromBackgroundThread(lock);
// Signal to the main thread that we're finished, because we release the
// lock again before GCParallelTask's state is changed to finished.
done = true;
}
void
GCRuntime::sweepFromBackgroundThread(AutoLockHelperThreadState& lock)
{
do {
ZoneList zones;
zones.transferFrom(backgroundSweepZones.ref());
LifoAlloc freeLifoAlloc(JSContext::TEMP_LIFO_ALLOC_PRIMARY_CHUNK_SIZE);
freeLifoAlloc.transferFrom(&blocksToFreeAfterSweeping.ref());
AutoUnlockHelperThreadState unlock(lock);
sweepBackgroundThings(zones, freeLifoAlloc);
// The main thread may call queueZonesForBackgroundSweep() while this is
// running so we must check there is no more work after releasing the
// lock.
} while (!backgroundSweepZones.ref().isEmpty());
}
void
GCRuntime::waitBackgroundSweepEnd()
{
sweepTask.join();
// TODO: Improve assertion to work in incremental GC?
if (!rt->gc.isIncrementalGCInProgress())
rt->gc.assertBackgroundSweepingFinished();
if (!isIncrementalGCInProgress())
assertBackgroundSweepingFinished();
}
bool
@ -3954,7 +3960,7 @@ GCRuntime::sweepZones(FreeOp* fop, bool destroyingRuntime)
MOZ_ASSERT_IF(destroyingRuntime, numActiveZoneIters == 0);
MOZ_ASSERT_IF(destroyingRuntime, arenasEmptyAtShutdown);
if (rt->gc.numActiveZoneIters)
if (numActiveZoneIters)
return;
assertBackgroundSweepingFinished();
@ -5162,7 +5168,7 @@ GCRuntime::getNextSweepGroup()
* push the referring object onto the list.
*
* The list is traversed and then unlinked in
* MarkIncomingCrossCompartmentPointers.
* GCRuntime::markIncomingCrossCompartmentPointers.
*/
static bool
@ -5256,8 +5262,8 @@ js::gc::DelayCrossCompartmentGrayMarking(JSObject* src)
#endif
}
static void
MarkIncomingCrossCompartmentPointers(JSRuntime* rt, MarkColor color)
void
GCRuntime::markIncomingCrossCompartmentPointers(MarkColor color)
{
MOZ_ASSERT(color == MarkColor::Black || color == MarkColor::Gray);
@ -5265,7 +5271,7 @@ MarkIncomingCrossCompartmentPointers(JSRuntime* rt, MarkColor color)
gcstats::PhaseKind::SWEEP_MARK_INCOMING_BLACK,
gcstats::PhaseKind::SWEEP_MARK_INCOMING_GRAY
};
gcstats::AutoPhase ap1(rt->gc.stats(), statsPhases[unsigned(color)]);
gcstats::AutoPhase ap1(stats(), statsPhases[unsigned(color)]);
bool unlinkList = color == MarkColor::Gray;
@ -5283,11 +5289,11 @@ MarkIncomingCrossCompartmentPointers(JSRuntime* rt, MarkColor color)
if (color == MarkColor::Gray) {
if (IsMarkedUnbarriered(rt, &src) && src->asTenured().isMarkedGray())
TraceManuallyBarrieredEdge(&rt->gc.marker, &dst,
TraceManuallyBarrieredEdge(&marker, &dst,
"cross-compartment gray pointer");
} else {
if (IsMarkedUnbarriered(rt, &src) && !src->asTenured().isMarkedGray())
TraceManuallyBarrieredEdge(&rt->gc.marker, &dst,
TraceManuallyBarrieredEdge(&marker, &dst,
"cross-compartment black pointer");
}
}
@ -5297,7 +5303,7 @@ MarkIncomingCrossCompartmentPointers(JSRuntime* rt, MarkColor color)
}
auto unlimited = SliceBudget::unlimited();
MOZ_RELEASE_ASSERT(rt->gc.marker.drainMarkStack(unlimited));
MOZ_RELEASE_ASSERT(marker.drainMarkStack(unlimited));
}
static bool
@ -5394,7 +5400,7 @@ GCRuntime::endMarkingSweepGroup(FreeOp* fop, SliceBudget& budget)
* whose referents are not marked. This can occur when gray cells become
* black by the action of UnmarkGray.
*/
MarkIncomingCrossCompartmentPointers(rt, MarkColor::Black);
markIncomingCrossCompartmentPointers(MarkColor::Black);
markWeakReferencesInCurrentGroup(gcstats::PhaseKind::SWEEP_MARK_WEAK);
/*
@ -5408,7 +5414,7 @@ GCRuntime::endMarkingSweepGroup(FreeOp* fop, SliceBudget& budget)
marker.setMarkColorGray();
/* Mark incoming gray pointers from previously swept compartments. */
MarkIncomingCrossCompartmentPointers(rt, MarkColor::Gray);
markIncomingCrossCompartmentPointers(MarkColor::Gray);
/* Mark gray roots and mark transitively inside the current compartment group. */
markGrayReferencesInCurrentGroup(gcstats::PhaseKind::SWEEP_MARK_GRAY);
@ -6960,7 +6966,7 @@ GCRuntime::resetIncrementalGC(gc::AbortReason reason, AutoGCSession& session)
{
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::WAIT_BACKGROUND_THREAD);
rt->gc.waitBackgroundSweepOrAllocEnd();
waitBackgroundSweepOrAllocEnd();
}
break;
}
@ -6968,7 +6974,7 @@ GCRuntime::resetIncrementalGC(gc::AbortReason reason, AutoGCSession& session)
case State::Finalize: {
{
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::WAIT_BACKGROUND_THREAD);
rt->gc.waitBackgroundSweepOrAllocEnd();
waitBackgroundSweepOrAllocEnd();
}
bool wasCompacting = isCompacting;
@ -7432,21 +7438,21 @@ class AutoScheduleZonesForGC
JSRuntime* rt_;
public:
explicit AutoScheduleZonesForGC(JSRuntime* rt) : rt_(rt) {
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
explicit AutoScheduleZonesForGC(GCRuntime* gc) : rt_(gc->rt) {
for (ZonesIter zone(rt_, WithAtoms); !zone.done(); zone.next()) {
if (!zone->canCollect())
continue;
if (rt->gc.gcMode() == JSGC_MODE_GLOBAL)
if (gc->gcMode() == JSGC_MODE_GLOBAL)
zone->scheduleGC();
// To avoid resets, continue to collect any zones that were being
// collected in a previous slice.
if (rt->gc.isIncrementalGCInProgress() && zone->wasGCStarted())
if (gc->isIncrementalGCInProgress() && zone->wasGCStarted())
zone->scheduleGC();
// This is a heuristic to reduce the total number of collections.
bool inHighFrequencyMode = rt->gc.schedulingState.inHighFrequencyGCMode();
bool inHighFrequencyMode = gc->schedulingState.inHighFrequencyGCMode();
if (zone->usage.gcBytes() >= zone->threshold.eagerAllocTrigger(inHighFrequencyMode))
zone->scheduleGC();
@ -7739,7 +7745,7 @@ GCRuntime::collect(bool nonincrementalByAPI, SliceBudget budget, JS::gcreason::R
AutoTraceLog logGC(TraceLoggerForCurrentThread(), TraceLogger_GC);
AutoStopVerifyingBarriers av(rt, IsShutdownGC(reason));
AutoEnqueuePendingParseTasksAfterGC aept(*this);
AutoScheduleZonesForGC asz(rt);
AutoScheduleZonesForGC asz(this);
bool repeat;
do {
@ -7782,11 +7788,11 @@ GCRuntime::collect(bool nonincrementalByAPI, SliceBudget budget, JS::gcreason::R
maybeDoCycleCollection();
#ifdef JS_GC_ZEAL
if (rt->hasZealMode(ZealMode::CheckHeapAfterGC)) {
gcstats::AutoPhase ap(rt->gc.stats(), gcstats::PhaseKind::TRACE_HEAP);
if (hasZealMode(ZealMode::CheckHeapAfterGC)) {
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::TRACE_HEAP);
CheckHeapAfterGC(rt);
}
if (rt->hasZealMode(ZealMode::CheckGrayMarking) && !isIncrementalGCInProgress()) {
if (hasZealMode(ZealMode::CheckGrayMarking) && !isIncrementalGCInProgress()) {
MOZ_RELEASE_ASSERT(CheckGrayMarkingState(rt));
}
#endif
@ -7959,9 +7965,9 @@ GCRuntime::minorGC(JS::gcreason::Reason reason, gcstats::PhaseKind phase)
uint32_t numAllocs = rt->mainContextFromOwnThread()->getAndResetAllocsThisZoneSinceMinorGC();
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next())
numAllocs += zone->getAndResetTenuredAllocsSinceMinorGC();
rt->gc.stats().setAllocsSinceMinorGCTenured(numAllocs);
stats().setAllocsSinceMinorGCTenured(numAllocs);
gcstats::AutoPhase ap(rt->gc.stats(), phase);
gcstats::AutoPhase ap(stats(), phase);
nursery().clearMinorGCRequest();
TraceLoggerThread* logger = TraceLoggerForCurrentThread();
@ -7972,7 +7978,7 @@ GCRuntime::minorGC(JS::gcreason::Reason reason, gcstats::PhaseKind phase)
blocksToFreeAfterMinorGC.ref().freeAll();
#ifdef JS_GC_ZEAL
if (rt->hasZealMode(ZealMode::CheckHeapAfterGC))
if (hasZealMode(ZealMode::CheckHeapAfterGC))
CheckHeapAfterGC(rt);
#endif

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

@ -16,7 +16,6 @@
#include "gc/GC.h"
#include "gc/RelocationOverlay.h"
#include "gc/Zone.h"
#include "vm/HelperThreads.h"
#include "vm/Runtime.h"
@ -321,7 +320,7 @@ IsOOMReason(JS::gcreason::Reason reason)
}
TenuredCell*
AllocateCellInGC(Zone* zone, AllocKind thingKind);
AllocateCellInGC(JS::Zone* zone, AllocKind thingKind);
} /* namespace gc */
} /* namespace js */

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

@ -624,6 +624,7 @@ class GCRuntime
MOZ_MUST_USE bool findInterZoneEdges();
void getNextSweepGroup();
IncrementalProgress endMarkingSweepGroup(FreeOp* fop, SliceBudget& budget);
void markIncomingCrossCompartmentPointers(MarkColor color);
IncrementalProgress beginSweepingSweepGroup(FreeOp* fop, SliceBudget& budget);
#ifdef JS_GC_ZEAL
IncrementalProgress maybeYieldForSweepingZeal(FreeOp* fop, SliceBudget& budget);
@ -648,6 +649,7 @@ class GCRuntime
void startDecommit();
void queueZonesForBackgroundSweep(ZoneList& zones);
void maybeStartBackgroundSweep(AutoLockHelperThreadState& lock);
void sweepFromBackgroundThread(AutoLockHelperThreadState& lock);
void sweepBackgroundThings(ZoneList& zones, LifoAlloc& freeBlocks);
void assertBackgroundSweepingFinished();
bool shouldCompact();

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

@ -30,6 +30,7 @@ class DebuggerEnvironment;
class DebuggerFrame;
class DebuggerObject;
class Scope;
class ModuleObject;
// These are internal counterparts to the public types such as HandleObject.
@ -48,6 +49,7 @@ typedef JS::Handle<DebuggerEnvironment*> HandleDebuggerEnvironment;
typedef JS::Handle<DebuggerFrame*> HandleDebuggerFrame;
typedef JS::Handle<DebuggerObject*> HandleDebuggerObject;
typedef JS::Handle<Scope*> HandleScope;
typedef JS::Handle<ModuleObject*> HandleModuleObject;
typedef JS::MutableHandle<Shape*> MutableHandleShape;
typedef JS::MutableHandle<JSAtom*> MutableHandleAtom;
@ -59,6 +61,7 @@ typedef JS::MutableHandle<DebuggerEnvironment*> MutableHandleDebuggerEnvironment
typedef JS::MutableHandle<DebuggerFrame*> MutableHandleDebuggerFrame;
typedef JS::MutableHandle<DebuggerObject*> MutableHandleDebuggerObject;
typedef JS::MutableHandle<Scope*> MutableHandleScope;
typedef JS::MutableHandle<ModuleObject*> MutableHandleModuleObject;
typedef JS::Rooted<NativeObject*> RootedNativeObject;
typedef JS::Rooted<Shape*> RootedShape;
@ -76,6 +79,7 @@ typedef JS::Rooted<DebuggerEnvironment*> RootedDebuggerEnvironment;
typedef JS::Rooted<DebuggerFrame*> RootedDebuggerFrame;
typedef JS::Rooted<DebuggerObject*> RootedDebuggerObject;
typedef JS::Rooted<Scope*> RootedScope;
typedef JS::Rooted<ModuleObject*> RootedModuleObject;
typedef JS::GCVector<JSFunction*> FunctionVector;
typedef JS::GCVector<PropertyName*> PropertyNameVector;

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

@ -9,7 +9,6 @@
#include "gc/WeakMap.h"
#include "gc/Zone.h"
#include "vm/JSContext.h"
namespace js {

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

@ -0,0 +1,9 @@
let m = parseModule(`
function f(x,y,z) {
delete arguments[2];
import.meta[2]
}
f(1,2,3)
`);
instantiateModule(m);
evaluateModule(m);

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

@ -13169,10 +13169,20 @@ IonBuilder::jsop_implicitthis(PropertyName* name)
AbortReasonOr<Ok>
IonBuilder::jsop_importmeta()
{
if (info().analysisMode() == Analysis_ArgumentsUsage) {
// The meta object may not have been created yet. Just push a dummy
// value, it does not affect the arguments analysis.
MUnknownValue* unknown = MUnknownValue::New(alloc());
current->add(unknown);
current->push(unknown);
return Ok();
}
ModuleObject* module = GetModuleObjectForScript(script());
MOZ_ASSERT(module);
// The object must have been created already when we compiled for baseline.
// If we get there then the meta object must already have been created, at
// the latest when we compiled for baseline.
JSObject* metaObject = module->metaObject();
MOZ_ASSERT(metaObject);

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

@ -27,7 +27,6 @@
#include "frontend/FullParseHandler.h"
#include "frontend/ParseContext.h"
#include "frontend/Parser.h"
#include "gc/Zone.h"
#include "js/Vector.h"
#include "jsapi-tests/tests.h"

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

@ -18,7 +18,6 @@
#include "mozilla/Maybe.h"
#include "frontend/BinTokenReaderTester.h"
#include "gc/Zone.h"
#include "js/Vector.h"

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

@ -8,8 +8,6 @@
namespace {
const double EXN_VALUE = 3.14;
static JS::PersistentRootedString gLatestMessage;
// An interceptor that stores the error in `gLatestMessage`.

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

@ -6,7 +6,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gc/GCInternals.h"
#include "gc/Zone.h"
#include "js/GCVector.h"
#include "jsapi-tests/tests.h"

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

@ -6,7 +6,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gc/Barrier.h"
#include "gc/Zone.h"
#include "js/RootingAPI.h"
#include "jsapi-tests/tests.h"

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

@ -5,7 +5,6 @@
* 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 "gc/Zone.h"
#include "jsapi-tests/tests.h"
#include "vm/JSContext-inl.h"

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

@ -219,7 +219,7 @@ JS_ScriptHasMutedErrors(JSScript* script)
}
JS_FRIEND_API(bool)
JS_WrapPropertyDescriptor(JSContext* cx, JS::MutableHandle<js::PropertyDescriptor> desc)
JS_WrapPropertyDescriptor(JSContext* cx, JS::MutableHandle<JS::PropertyDescriptor> desc)
{
return cx->compartment()->wrap(cx, desc);
}

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

@ -71,7 +71,6 @@
#endif // defined(JS_BUILD_BINAST)
#include "frontend/Parser.h"
#include "gc/PublicIterators.h"
#include "gc/Zone.h"
#include "jit/arm/Simulator-arm.h"
#include "jit/InlinableNatives.h"
#include "jit/Ion.h"
@ -719,7 +718,7 @@ GetLine(FILE* file, const char * prompt)
if (*t == '\n') {
/* Line was read. We remove '\n' and exit. */
*t = '\0';
return buffer;
break;
}
if (len + 1 == size) {
@ -733,7 +732,7 @@ GetLine(FILE* file, const char * prompt)
}
current = buffer + len;
} while (true);
return nullptr;
return buffer;
}
static bool
@ -4310,7 +4309,7 @@ EnsureModuleLoaderScriptObjectMap(JSContext* cx)
if (priv->moduleLoaderScriptObjectMap)
return priv->moduleLoaderScriptObjectMap.get();
Zone* zone = cx->zone();
JS::Zone* zone = cx->zone();
auto* map = cx->new_<ScriptObjectMap>(zone);
if (!map)
return nullptr;
@ -7222,7 +7221,9 @@ WasmLoop(JSContext* cx, unsigned argc, Value* vp)
}
}
#ifdef __AFL_HAVE_MANUAL_CONTROL // to silence unreachable code warning
return true;
#endif
}
static const JSFunctionSpecWithHelp shell_functions[] = {

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

@ -348,7 +348,7 @@ Compartment::rewrap(JSContext* cx, MutableHandleObject obj, HandleObject existin
}
bool
Compartment::wrap(JSContext* cx, MutableHandle<PropertyDescriptor> desc)
Compartment::wrap(JSContext* cx, MutableHandle<JS::PropertyDescriptor> desc)
{
if (!wrap(cx, desc.object()))
return false;

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

@ -17,13 +17,14 @@
#include "gc/Barrier.h"
#include "gc/NurseryAwareHashMap.h"
#include "gc/Zone.h"
#include "js/UniquePtr.h"
#include "vm/JSObject.h"
#include "vm/JSScript.h"
namespace js {
namespace gc {
template <typename Node, typename Derived> class ComponentFinder;
struct ZoneComponentFinder;
} // namespace gc
class CrossCompartmentKey
@ -446,7 +447,7 @@ class JS::Compartment
MOZ_MUST_USE bool wrap(JSContext* cx, js::MutableHandle<JS::BigInt*> bi);
#endif
MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandleObject obj);
MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandle<js::PropertyDescriptor> desc);
MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandle<JS::PropertyDescriptor> desc);
MOZ_MUST_USE bool wrap(JSContext* cx, JS::MutableHandle<JS::GCVector<JS::Value>> vec);
MOZ_MUST_USE bool rewrap(JSContext* cx, JS::MutableHandleObject obj, JS::HandleObject existing);

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

@ -17,7 +17,6 @@
#include "vm/ErrorObject.h"
#include "vm/JSFunction.h"
#include "vm/Realm.h"
#include "vm/RegExpStatics.h"
#include "vm/Runtime.h"
namespace js {
@ -25,6 +24,7 @@ namespace js {
class Debugger;
class TypedObjectModuleObject;
class LexicalEnvironmentObject;
class RegExpStatics;
/*
* Global object slots are reserved as follows:

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

@ -15,7 +15,6 @@
#include "mozilla/MemoryReporting.h"
#include "gc/Barrier.h"
#include "vm/JSContext.h"
#include "vm/ReceiverGuard.h"
#include "vm/Stack.h"

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

@ -16,7 +16,6 @@
#include "gc/HashUtil.h"
#include "gc/Policy.h"
#include "gc/StoreBuffer.h"
#include "gc/Zone.h"
#include "js/CharacterEncoding.h"
#include "js/UniquePtr.h"
#include "vm/ArrayObject.h"

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

@ -20,7 +20,6 @@
#include "builtin/Array.h"
#include "gc/Barrier.h"
#include "gc/Zone.h"
#include "js/UniquePtr.h"
#include "vm/ArrayBufferObject.h"
#include "vm/Compartment.h"

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

@ -0,0 +1,42 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* 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/. */
#ifndef vm_RegExpConstants_h
#define vm_RegExpConstants_h
#include "builtin/SelfHostingDefines.h"
namespace js {
enum RegExpFlag : uint8_t
{
IgnoreCaseFlag = 0x01,
GlobalFlag = 0x02,
MultilineFlag = 0x04,
StickyFlag = 0x08,
UnicodeFlag = 0x10,
NoFlags = 0x00,
AllFlags = 0x1f
};
static_assert(IgnoreCaseFlag == REGEXP_IGNORECASE_FLAG &&
GlobalFlag == REGEXP_GLOBAL_FLAG &&
MultilineFlag == REGEXP_MULTILINE_FLAG &&
StickyFlag == REGEXP_STICKY_FLAG &&
UnicodeFlag == REGEXP_UNICODE_FLAG,
"Flag values should be in sync with self-hosted JS");
enum RegExpRunStatus
{
RegExpRunStatus_Error,
RegExpRunStatus_Success,
RegExpRunStatus_Success_NotFound
};
} /* namespace js */
#endif /* vm_RegExpConstants_h */

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

@ -15,7 +15,6 @@
#include "mozilla/Assertions.h"
#include "mozilla/MemoryReporting.h"
#include "builtin/SelfHostingDefines.h"
#include "gc/Barrier.h"
#include "gc/Heap.h"
#include "gc/Marking.h"
@ -25,6 +24,7 @@
#include "js/Vector.h"
#include "vm/ArrayObject.h"
#include "vm/JSAtom.h"
#include "vm/RegExpConstants.h"
namespace js {
@ -38,32 +38,6 @@ using RootedRegExpShared = JS::Rooted<RegExpShared*>;
using HandleRegExpShared = JS::Handle<RegExpShared*>;
using MutableHandleRegExpShared = JS::MutableHandle<RegExpShared*>;
enum RegExpFlag : uint8_t
{
IgnoreCaseFlag = 0x01,
GlobalFlag = 0x02,
MultilineFlag = 0x04,
StickyFlag = 0x08,
UnicodeFlag = 0x10,
NoFlags = 0x00,
AllFlags = 0x1f
};
static_assert(IgnoreCaseFlag == REGEXP_IGNORECASE_FLAG &&
GlobalFlag == REGEXP_GLOBAL_FLAG &&
MultilineFlag == REGEXP_MULTILINE_FLAG &&
StickyFlag == REGEXP_STICKY_FLAG &&
UnicodeFlag == REGEXP_UNICODE_FLAG,
"Flag values should be in sync with self-hosted JS");
enum RegExpRunStatus
{
RegExpRunStatus_Error,
RegExpRunStatus_Success,
RegExpRunStatus_Success_NotFound
};
/*
* A RegExpShared is the compiled representation of a regexp. A RegExpShared is
* potentially pointed to by multiple RegExpObjects. Additionally, C++ code may

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

@ -103,8 +103,17 @@ class Instance;
enum MaybeCheckAliasing { CHECK_ALIASING = true, DONT_CHECK_ALIASING = false };
enum MaybeCheckTDZ { CheckTDZ = true, DontCheckTDZ = false };
} // namespace js
namespace mozilla {
template <>
struct IsPod<js::MaybeCheckTDZ> : TrueType {};
} // namespace mozilla
/*****************************************************************************/
namespace js {
namespace jit {
class BaselineFrame;
class RematerializedFrame;
@ -2429,4 +2438,5 @@ FrameIter::physicalJitFrame() const
}
} /* namespace js */
#endif /* vm_Stack_h */

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

@ -8,7 +8,6 @@
#define vm_UnboxedObject_h
#include "gc/DeletePolicy.h"
#include "gc/Zone.h"
#include "vm/JSObject.h"
#include "vm/Runtime.h"
#include "vm/TypeInference.h"
@ -59,7 +58,7 @@ class UnboxedLayout : public mozilla::LinkedListElement<UnboxedLayout>
typedef Vector<Property, 0, SystemAllocPolicy> PropertyVector;
private:
Zone* zone_;
JS::Zone* zone_;
// If objects in this group have ever been converted to native objects,
// these store the corresponding native group and initial shape for such
@ -99,13 +98,13 @@ class UnboxedLayout : public mozilla::LinkedListElement<UnboxedLayout>
GCPtrJitCode constructorCode_;
public:
explicit UnboxedLayout(Zone* zone)
explicit UnboxedLayout(JS::Zone* zone)
: zone_(zone), nativeGroup_(nullptr), nativeShape_(nullptr),
allocationScript_(nullptr), allocationPc_(nullptr), replacementGroup_(nullptr),
size_(0), newScript_(nullptr), traceList_(nullptr), constructorCode_(nullptr)
{}
Zone* zone() const { return zone_; }
JS::Zone* zone() const { return zone_; }
bool initProperties(const PropertyVector& properties, size_t size) {
size_ = size;

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

@ -766,8 +766,8 @@ void
nsImageFrame::InvalidateSelf(const nsIntRect* aLayerInvalidRect,
const nsRect* aFrameInvalidRect)
{
// XXX: Do we really want to check whether we have a
// WebRenderUserDataProperty?
// Check if WebRender has interacted with this frame. If it has
// we need to let it know that things have changed.
if (HasProperty(WebRenderUserDataProperty::Key())) {
RefPtr<WebRenderFallbackData> data = GetWebRenderUserData<WebRenderFallbackData>(this, static_cast<uint32_t>(DisplayItemType::TYPE_IMAGE));
if (data) {

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