diff --git a/browser/components/extensions/test/browser/browser-common.ini b/browser/components/extensions/test/browser/browser-common.ini index 55e11d30d7af..25f80c3d9660 100644 --- a/browser/components/extensions/test/browser/browser-common.ini +++ b/browser/components/extensions/test/browser/browser-common.ini @@ -116,6 +116,7 @@ skip-if = (verify && (os == 'linux' || os == 'mac')) [browser_ext_menus_errors.js] [browser_ext_menus_event_order.js] [browser_ext_menus_events.js] +skip-if = os == 'linux' #Bug 1433892 [browser_ext_menus_refresh.js] [browser_ext_menus_replace_menu.js] [browser_ext_menus_replace_menu_context.js] diff --git a/browser/components/preferences/in-content/main.xul b/browser/components/preferences/in-content/main.xul index 98c1809b3752..94733777f104 100644 --- a/browser/components/preferences/in-content/main.xul +++ b/browser/components/preferences/in-content/main.xul @@ -393,17 +393,16 @@ data-l10n-id="applications-filter" aria-controls="handlersView"/> + + + + - - - - - + preference="pref.downloads.disable_button.edit_actions"/> diff --git a/browser/components/preferences/permissions.js b/browser/components/preferences/permissions.js index ba6413dac694..4a2672c3ef2d 100644 --- a/browser/components/preferences/permissions.js +++ b/browser/components/preferences/permissions.js @@ -430,7 +430,7 @@ var gPermissionManager = { // Re-append items in the correct order: items.forEach(item => frag.appendChild(item)); - let cols = list.querySelectorAll("treecol"); + let cols = list.previousElementSibling.querySelectorAll("treecol"); cols.forEach(c => { c.removeAttribute("data-isCurrentSortCol"); c.removeAttribute("sortDirection"); diff --git a/browser/components/preferences/permissions.xul b/browser/components/preferences/permissions.xul index ed0bcc4d2e4e..1208b8669f8b 100644 --- a/browser/components/preferences/permissions.xul +++ b/browser/components/preferences/permissions.xul @@ -48,17 +48,16 @@ oncommand="gPermissionManager.addPermission(Ci.nsIPermissionManager.ALLOW_ACTION);"/> + + + + - - - - - + onselect="gPermissionManager.onPermissionSelect();"/> diff --git a/browser/components/preferences/siteDataSettings.js b/browser/components/preferences/siteDataSettings.js index fafb60db4ca3..1285ce92d4ee 100644 --- a/browser/components/preferences/siteDataSettings.js +++ b/browser/components/preferences/siteDataSettings.js @@ -169,7 +169,7 @@ let gSiteDataSettings = { sites.sort(sortFunc); } - let cols = this._list.querySelectorAll("treecol"); + let cols = this._list.previousElementSibling.querySelectorAll("treecol"); cols.forEach(c => { c.removeAttribute("sortDirection"); c.removeAttribute("data-isCurrentSortCol"); diff --git a/browser/components/preferences/siteDataSettings.xul b/browser/components/preferences/siteDataSettings.xul index 9362f35b08a8..0cf3a2dd4bb1 100644 --- a/browser/components/preferences/siteDataSettings.xul +++ b/browser/components/preferences/siteDataSettings.xul @@ -35,15 +35,14 @@ - - - - - - - - - + + + + + + + + diff --git a/browser/components/preferences/sitePermissions.js b/browser/components/preferences/sitePermissions.js index a33aad1e8439..ac338ff59536 100644 --- a/browser/components/preferences/sitePermissions.js +++ b/browser/components/preferences/sitePermissions.js @@ -466,7 +466,7 @@ var gSitePermissionsManager = { // Re-append items in the correct order: items.forEach(item => frag.appendChild(item)); - let cols = list.querySelectorAll("treecol"); + let cols = list.previousElementSibling.querySelectorAll("treecol"); cols.forEach(c => { c.removeAttribute("data-isCurrentSortCol"); c.removeAttribute("sortDirection"); diff --git a/browser/components/preferences/sitePermissions.xul b/browser/components/preferences/sitePermissions.xul index 9dbadd8f1be6..b63fb9c9312f 100644 --- a/browser/components/preferences/sitePermissions.xul +++ b/browser/components/preferences/sitePermissions.xul @@ -38,17 +38,16 @@ type="search" oncommand="gSitePermissionsManager.buildPermissionsList();"/> + + + + - - - - - + onselect="gSitePermissionsManager.onPermissionSelect();"/> diff --git a/devtools/client/debugger/new/README.mozilla b/devtools/client/debugger/new/README.mozilla index b03baad76d74..bee3343cfda0 100644 --- a/devtools/client/debugger/new/README.mozilla +++ b/devtools/client/debugger/new/README.mozilla @@ -1,9 +1,9 @@ This is the debugger.html project output. See https://github.com/devtools-html/debugger.html -Version 111 +Version 112 -Comparison: https://github.com/devtools-html/debugger.html/compare/release-110...release-111 +Comparison: https://github.com/devtools-html/debugger.html/compare/release-111...release-112 Packages: - babel-plugin-transform-es2015-modules-commonjs @6.26.2 diff --git a/devtools/client/debugger/new/dist/debugger.css b/devtools/client/debugger/new/dist/debugger.css index a5c1ceff3a01..520d160d1597 100644 --- a/devtools/client/debugger/new/dist/debugger.css +++ b/devtools/client/debugger/new/dist/debugger.css @@ -1540,6 +1540,19 @@ html .toggle-button.end.vertical svg { .search-field .search-nav-buttons .nav-btn path { fill: var(--theme-comment); } + +.search-field i.loader svg { + animation: rotate 0.5s linear infinite; +} + +@keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} /* 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 . */ @@ -1663,6 +1676,10 @@ html .toggle-button.end.vertical svg { /* Focus values */ +.project-text-search .file-result.focused .img.file { + background-color: white; +} + .project-text-search .file-result.focused, .project-text-search .result.focused .line-value { background-color: var(--theme-selection-background); @@ -3071,6 +3088,10 @@ debug-expression-error { .visible { visibility: visible; } + +.download-anchor { + display: none; +} /* 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 . */ diff --git a/devtools/client/debugger/new/dist/parser-worker.js b/devtools/client/debugger/new/dist/parser-worker.js index 3ce59fbbb639..9347aadfa401 100644 --- a/devtools/client/debugger/new/dist/parser-worker.js +++ b/devtools/client/debugger/new/dist/parser-worker.js @@ -23142,6 +23142,7 @@ const getAllGeneratedLocations = dispatcher.task("getAllGeneratedLocations", { queue: true }); const getOriginalLocation = dispatcher.task("getOriginalLocation"); +const getFileGeneratedRange = dispatcher.task("getFileGeneratedRange"); const getLocationScopes = dispatcher.task("getLocationScopes"); const getOriginalSourceText = dispatcher.task("getOriginalSourceText"); const applySourceMap = dispatcher.task("applySourceMap"); @@ -23161,6 +23162,7 @@ module.exports = { getGeneratedLocation, getAllGeneratedLocations, getOriginalLocation, + getFileGeneratedRange, getLocationScopes, getOriginalSourceText, applySourceMap, @@ -23245,7 +23247,8 @@ const contentMap = { vue: "text/vue", coffee: "text/coffeescript", elm: "text/elm", - cljs: "text/x-clojure" + cljc: "text/x-clojure", + cljs: "text/x-clojurescript" }; /** diff --git a/devtools/client/debugger/new/dist/vendors.js b/devtools/client/debugger/new/dist/vendors.js index ce29b01a839a..68060354e0ad 100644 --- a/devtools/client/debugger/new/dist/vendors.js +++ b/devtools/client/debugger/new/dist/vendors.js @@ -3870,7 +3870,7 @@ module.exports = "" +module.exports = "" /***/ }), @@ -5043,6 +5043,10 @@ class Tree extends Component { // root item. autoExpandAll: _propTypes2.default.bool, + // Auto expand a node only if number of its children + // are less than autoExpandNodeChildrenLimit + autoExpandNodeChildrenLimit: _propTypes2.default.number, + // Note: the two properties below are mutually exclusive. Only one of the // label properties is necessary. // ID of an element whose textual content serves as an accessible label @@ -5134,7 +5138,8 @@ class Tree extends Component { } _autoExpand() { - if (!this.props.autoExpandDepth) { + const { autoExpandDepth, autoExpandNodeChildrenLimit } = this.props; + if (!autoExpandDepth) { return; } @@ -5142,14 +5147,18 @@ class Tree extends Component { // not use the usual DFS infrastructure because we don't want to ignore // collapsed nodes. const autoExpand = (item, currentDepth) => { - if (currentDepth >= this.props.autoExpandDepth || this.state.seen.has(item)) { + if (currentDepth >= autoExpandDepth || this.state.seen.has(item)) { + return; + } + + const children = this.props.getChildren(item); + if (autoExpandNodeChildrenLimit && children.length > autoExpandNodeChildrenLimit) { return; } this.props.onExpand(item); this.state.seen.add(item); - const children = this.props.getChildren(item); const length = children.length; for (let i = 0; i < length; i++) { autoExpand(children[i], currentDepth + 1); @@ -7058,7 +7067,7 @@ function formatKeyShortcut(shortcut) { /***/ 3789: /***/ (function(module, exports) { -module.exports = "" +module.exports = "" /***/ }), diff --git a/devtools/client/debugger/new/images/breakpoint.svg b/devtools/client/debugger/new/images/breakpoint.svg index f0e5de106bf3..6a68684d4d15 100644 --- a/devtools/client/debugger/new/images/breakpoint.svg +++ b/devtools/client/debugger/new/images/breakpoint.svg @@ -1,6 +1,6 @@ - - + + { - const source = getSource(state, frame.location.sourceId); - return source && !source.isBlackBoxed; - }); - + selectedFrame = frames.find(frame => !isFrameBlackboxed(state, frame)); return selectedFrame && selectedFrame.id; } diff --git a/devtools/client/debugger/new/src/actions/sources/blackbox.js b/devtools/client/debugger/new/src/actions/sources/blackbox.js index 5aac9e3800f4..ca1a99d8045b 100644 --- a/devtools/client/debugger/new/src/actions/sources/blackbox.js +++ b/devtools/client/debugger/new/src/actions/sources/blackbox.js @@ -9,27 +9,31 @@ * @module actions/sources */ -import { isOriginalId } from "devtools-source-map"; +import { isOriginalId, originalToGeneratedId } from "devtools-source-map"; import { recordEvent } from "../../utils/telemetry"; import { features } from "../../utils/prefs"; import { PROMISE } from "../utils/middleware/promise"; + import type { Source } from "../../types"; import type { ThunkArgs } from "../types"; export function toggleBlackBox(source: Source) { return async ({ dispatch, getState, client, sourceMaps }: ThunkArgs) => { - const { isBlackBoxed, id } = source; + const { isBlackBoxed } = source; if (!isBlackBoxed) { recordEvent("blackbox"); } let promise; - if (features.originalBlackbox && isOriginalId(id)) { - promise = Promise.resolve({ isBlackBoxed: !isBlackBoxed }); + + if (features.originalBlackbox && isOriginalId(source.id)) { + const range = await sourceMaps.getFileGeneratedRange(source); + const generatedId = originalToGeneratedId(source.id); + promise = client.blackBox(generatedId, isBlackBoxed, range); } else { - promise = client.blackBox(id, isBlackBoxed); + promise = client.blackBox(source.id, isBlackBoxed); } return dispatch({ diff --git a/devtools/client/debugger/new/src/client/chrome/create.js b/devtools/client/debugger/new/src/client/chrome/create.js index 14be379f5bfd..71b6caef4e34 100644 --- a/devtools/client/debugger/new/src/client/chrome/create.js +++ b/devtools/client/debugger/new/src/client/chrome/create.js @@ -4,7 +4,7 @@ // @flow -import type { SourceLocation, LoadedObject } from "../../types"; +import type { ChromeFrame, SourceLocation, LoadedObject } from "../../types"; import type { ServerLocation } from "./types"; export function fromServerLocation( @@ -27,7 +27,7 @@ export function toServerLocation(location: SourceLocation): ServerLocation { }; } -export function createFrame(frame: any) { +export function createFrame(frame: any): ChromeFrame { return { id: frame.callFrameId, displayName: frame.functionName, diff --git a/devtools/client/debugger/new/src/client/firefox/commands.js b/devtools/client/debugger/new/src/client/firefox/commands.js index 43e8510596d2..effdffc0e3ff 100644 --- a/devtools/client/debugger/new/src/client/firefox/commands.js +++ b/devtools/client/debugger/new/src/client/firefox/commands.js @@ -345,12 +345,16 @@ function prettyPrint(sourceId: SourceId, indentSize: number): Promise<*> { return sourceClient.prettyPrint(indentSize); } -async function blackBox(sourceId: SourceId, isBlackBoxed: boolean): Promise<*> { +async function blackBox( + sourceId: SourceId, + isBlackBoxed: boolean, + range?: Range +): Promise<*> { const sourceClient = threadClient.source({ actor: sourceId }); if (isBlackBoxed) { - await sourceClient.unblackBox(null); + await sourceClient.unblackBox(range); } else { - await sourceClient.blackBox(null); + await sourceClient.blackBox(range); } return { isBlackBoxed: !isBlackBoxed }; diff --git a/devtools/client/debugger/new/src/components/Editor/EditorMenu.js b/devtools/client/debugger/new/src/components/Editor/EditorMenu.js index a047c4364300..66e1862f9b3f 100644 --- a/devtools/client/debugger/new/src/components/Editor/EditorMenu.js +++ b/devtools/client/debugger/new/src/components/Editor/EditorMenu.js @@ -14,7 +14,13 @@ import { getSourceLocationFromMouseEvent, toSourceLine } from "../../utils/editor"; -import { isPretty, getRawSourceURL, shouldBlackbox } from "../../utils/source"; +import { + isPretty, + getRawSourceURL, + getFilename, + shouldBlackbox +} from "../../utils/source"; +import { downloadFile } from "../../utils/utils"; import { getContextMenu, getPrettySource, @@ -93,6 +99,8 @@ function getMenuItems( const revealInTreeLabel = L10N.getStr("sourceTabs.revealInTree"); const watchExpressionKey = L10N.getStr("expressions.accesskey"); const watchExpressionLabel = L10N.getStr("expressions.label"); + const downloadKey = L10N.getStr("downloadFile.accesskey"); + const downloadLabel = L10N.getStr("downloadFile.label"); // menu items @@ -179,6 +187,13 @@ function getMenuItems( click: () => evaluateInConsole(selectionText) }; + const downloadFileItem = { + id: "node-menu-download-file", + label: downloadLabel, + accesskey: downloadKey, + click: () => downloadFile(selectedSource.text, getFilename(selectedSource)) + }; + // construct menu const menuItems = [ copyToClipboardItem, @@ -197,6 +212,8 @@ function getMenuItems( menuItems.push(watchExpressionItem, evaluateInConsoleItem); } + menuItems.push(downloadFileItem); + return menuItems; } diff --git a/devtools/client/debugger/new/src/components/Editor/Footer.js b/devtools/client/debugger/new/src/components/Editor/Footer.js index 6c5dc0f81fd6..0fce7a446514 100644 --- a/devtools/client/debugger/new/src/components/Editor/Footer.js +++ b/devtools/client/debugger/new/src/components/Editor/Footer.js @@ -248,12 +248,14 @@ class SourceFooter extends PureComponent { const mapStateToProps = state => { const selectedSource = getSelectedSource(state); - const selectedId = selectedSource.id; return { selectedSource, mappedSource: getGeneratedSource(state, selectedSource), - prettySource: getPrettySource(state, selectedId), + prettySource: getPrettySource( + state, + selectedSource ? selectedSource.id : null + ), endPanelCollapsed: getPaneCollapse(state, "end") }; }; diff --git a/devtools/client/debugger/new/src/components/PrimaryPanes/Outline.js b/devtools/client/debugger/new/src/components/PrimaryPanes/Outline.js index 552b329d2870..2a2d4357ae68 100644 --- a/devtools/client/debugger/new/src/components/PrimaryPanes/Outline.js +++ b/devtools/client/debugger/new/src/components/PrimaryPanes/Outline.js @@ -261,12 +261,19 @@ export class Outline extends Component { const mapStateToProps = state => { const selectedSource = getSelectedSource(state); - const symbols = getSymbols(state, selectedSource); + const symbols = selectedSource ? getSymbols(state, selectedSource) : null; + return { symbols, selectedSource, selectedLocation: getSelectedLocation(state), - getFunctionText: line => findFunctionText(line, selectedSource, symbols) + getFunctionText: line => { + if (selectedSource) { + return findFunctionText(line, selectedSource, symbols); + } + + return null; + } }; }; diff --git a/devtools/client/debugger/new/src/components/SecondaryPanes/Breakpoints/Breakpoint.js b/devtools/client/debugger/new/src/components/SecondaryPanes/Breakpoints/Breakpoint.js index a2fd689b340a..c2bf71a5d84b 100644 --- a/devtools/client/debugger/new/src/components/SecondaryPanes/Breakpoints/Breakpoint.js +++ b/devtools/client/debugger/new/src/components/SecondaryPanes/Breakpoints/Breakpoint.js @@ -175,7 +175,7 @@ class Breakpoint extends PureComponent { const getFormattedFrame = createSelector( getSelectedSource, getSelectedFrame, - (selectedSource: Source, frame: Frame): ?FormattedFrame => { + (selectedSource: ?Source, frame: ?Frame): ?FormattedFrame => { if (!frame) { return null; } diff --git a/devtools/client/debugger/new/src/components/SecondaryPanes/CommandBar.js b/devtools/client/debugger/new/src/components/SecondaryPanes/CommandBar.js index 3c7207276c55..24d4c7853bb3 100644 --- a/devtools/client/debugger/new/src/components/SecondaryPanes/CommandBar.js +++ b/devtools/client/debugger/new/src/components/SecondaryPanes/CommandBar.js @@ -271,7 +271,7 @@ class CommandBar extends Component { active: skipPausing } )} - title={L10N.getStr("skipPausingTooltip")} + title={L10N.getStr("skipPausingTooltip.label")} onClick={toggleSkipPausing} > diff --git a/devtools/client/debugger/new/src/reducers/ast.js b/devtools/client/debugger/new/src/reducers/ast.js index 6f26ca7df2ae..43f550f4f237 100644 --- a/devtools/client/debugger/new/src/reducers/ast.js +++ b/devtools/client/debugger/new/src/reducers/ast.js @@ -159,7 +159,7 @@ function update( // https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185 type OuterState = { ast: Record }; -export function getSymbols(state: OuterState, source?: Source): ?Symbols { +export function getSymbols(state: OuterState, source: ?Source): ?Symbols { if (!source) { return null; } @@ -177,7 +177,7 @@ export function hasSymbols(state: OuterState, source: Source): boolean { return !symbols.loading; } -export function isSymbolsLoading(state: OuterState, source: Source): boolean { +export function isSymbolsLoading(state: OuterState, source: ?Source): boolean { const symbols = getSymbols(state, source); if (!symbols) { return false; diff --git a/devtools/client/debugger/new/src/reducers/expressions.js b/devtools/client/debugger/new/src/reducers/expressions.js index 4add413aab83..a791007c3efe 100644 --- a/devtools/client/debugger/new/src/reducers/expressions.js +++ b/devtools/client/debugger/new/src/reducers/expressions.js @@ -13,10 +13,11 @@ import makeRecord from "../utils/makeRecord"; import { List, Map } from "immutable"; import { omit, zip } from "lodash"; -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; import { prefs } from "../utils/prefs"; import type { Expression } from "../types"; +import type { Selector, State } from "../reducers/types"; import type { Action } from "../actions/types"; import type { Record } from "../utils/makeRecord"; @@ -158,38 +159,36 @@ function updateExpressionInList( } function deleteExpression(state: Record, input: string) { - const index = getExpressions({ expressions: state }).findIndex( - e => e.input == input - ); + const index = state.expressions.findIndex(e => e.input == input); const newState = state.deleteIn(["expressions", index]); storeExpressions(newState); return newState; } -type OuterState = { expressions: Record }; - const getExpressionsWrapper = state => state.expressions; -export const getExpressions = createSelector( +export const getExpressions: Selector> = createSelector( getExpressionsWrapper, expressions => expressions.expressions ); -export const getAutocompleteMatches = createSelector( +export const getAutocompleteMatches: Selector< + Map> +> = createSelector( getExpressionsWrapper, expressions => expressions.autocompleteMatches ); -export function getExpression(state: OuterState, input: string) { +export function getExpression(state: State, input: string) { return getExpressions(state).find(exp => exp.input == input); } -export function getAutocompleteMatchset(state: OuterState) { +export function getAutocompleteMatchset(state: State) { const input = state.expressions.get("currentAutocompleteInput"); return getAutocompleteMatches(state).get(input); } -export const getExpressionError = createSelector( +export const getExpressionError: Selector = createSelector( getExpressionsWrapper, expressions => expressions.expressionError ); diff --git a/devtools/client/debugger/new/src/reducers/pause.js b/devtools/client/debugger/new/src/reducers/pause.js index a8cf438f56ee..75127180c699 100644 --- a/devtools/client/debugger/new/src/reducers/pause.js +++ b/devtools/client/debugger/new/src/reducers/pause.js @@ -10,15 +10,23 @@ * @module reducers/pause */ -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; import { isGeneratedId } from "devtools-source-map"; import { prefs } from "../utils/prefs"; import { getSelectedSource } from "./sources"; import type { OriginalScope } from "../utils/pause/mapScopes"; import type { Action } from "../actions/types"; -import type { State } from "./types"; -import type { Why, Scope, SourceId, FrameId, MappedLocation } from "../types"; +import type { Selector, State } from "./types"; +import type { + Why, + Scope, + SourceId, + ChromeFrame, + Frame, + FrameId, + MappedLocation +} from "../types"; export type Command = | null @@ -340,7 +348,7 @@ function getCurrentPauseState(state: OuterState): ThreadPauseState { return getThreadPauseState(state.pause, state.pause.currentThread); } -export const getAllPopupObjectProperties = createSelector( +export const getAllPopupObjectProperties: Selector<{}> = createSelector( getCurrentPauseState, pauseWrapper => pauseWrapper.loadedObjects ); @@ -534,7 +542,7 @@ export function getTopFrame(state: OuterState) { return frames && frames[0]; } -export const getSelectedFrame = createSelector( +export const getSelectedFrame: Selector = createSelector( getSelectedFrameId, getFrames, (selectedFrameId, frames) => { @@ -556,7 +564,7 @@ export function getSkipPausing(state: OuterState) { // NOTE: currently only used for chrome export function getChromeScopes(state: OuterState) { - const frame = getSelectedFrame(state); + const frame: ?ChromeFrame = (getSelectedFrame(state): any); return frame ? frame.scopeChain : undefined; } diff --git a/devtools/client/debugger/new/src/reducers/sources.js b/devtools/client/debugger/new/src/reducers/sources.js index d6887dae9412..d1750e5019f1 100644 --- a/devtools/client/debugger/new/src/reducers/sources.js +++ b/devtools/client/debugger/new/src/reducers/sources.js @@ -9,7 +9,7 @@ * @module reducers/sources */ -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; import { getPrettySourceURL, underRoot, @@ -21,7 +21,7 @@ import { originalToGeneratedId } from "devtools-source-map"; import { prefs } from "../utils/prefs"; import type { Source, SourceId, SourceLocation } from "../types"; -import type { PendingSelectedLocation } from "./types"; +import type { PendingSelectedLocation, Selector } from "./types"; import type { Action, DonePromiseAction } from "../actions/types"; import type { LoadSourceAction } from "../actions/types/SourceAction"; @@ -345,7 +345,14 @@ export function getSourcesByURL(state: OuterState, url: string): Source[] { return getSourcesByUrlInSources(getSources(state), getUrls(state), url); } -export function getGeneratedSource(state: OuterState, source: Source): Source { +export function getGeneratedSource( + state: OuterState, + source: ?Source +): ?Source { + if (!source) { + return null; + } + if (isGenerated(source)) { return source; } @@ -357,7 +364,11 @@ export function getPendingSelectedLocation(state: OuterState) { return state.sources.pendingSelectedLocation; } -export function getPrettySource(state: OuterState, id: string) { +export function getPrettySource(state: OuterState, id: ?string) { + if (!id) { + return; + } + const source = getSource(state, id); if (!source) { return; @@ -470,17 +481,17 @@ export function getSourceList(state: OuterState): Source[] { return (Object.values(getSources(state)): any); } -export const getSourceCount = createSelector( +export const getSourceCount: Selector = createSelector( getSources, sources => Object.keys(sources).length ); -export const getSelectedLocation = createSelector( +export const getSelectedLocation: Selector = createSelector( getSourcesState, sources => sources.selectedLocation ); -export const getSelectedSource = createSelector( +export const getSelectedSource: Selector = createSelector( getSelectedLocation, getSources, (selectedLocation: ?SourceLocation, sources: SourcesMap): ?Source => { diff --git a/devtools/client/debugger/new/src/reducers/tabs.js b/devtools/client/debugger/new/src/reducers/tabs.js index b656b4d4fbd6..ab12ef94aaf4 100644 --- a/devtools/client/debugger/new/src/reducers/tabs.js +++ b/devtools/client/debugger/new/src/reducers/tabs.js @@ -9,7 +9,7 @@ * @module reducers/tabs */ -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; import { isOriginalId } from "devtools-source-map"; import move from "lodash-move"; @@ -25,6 +25,7 @@ import { import type { Action } from "../actions/types"; import type { SourcesState } from "./sources"; import type { Source } from "../types"; +import type { Selector } from "./types"; export type Tab = { url: string, @@ -194,7 +195,7 @@ type OuterState = { tabs: TabList, sources: SourcesState }; export const getTabs = (state: OuterState): TabList => state.tabs; -export const getSourceTabs = createSelector( +export const getSourceTabs: Selector = createSelector( getTabs, getSources, getUrls, @@ -202,7 +203,7 @@ export const getSourceTabs = createSelector( tabs.filter(tab => getTabWithOrWithoutUrl(tab, sources, urls)) ); -export const getSourcesForTabs = createSelector( +export const getSourcesForTabs: Selector = createSelector( getSourceTabs, getSources, getUrls, diff --git a/devtools/client/debugger/new/src/selectors/breakpointSources.js b/devtools/client/debugger/new/src/selectors/breakpointSources.js index 65384f0f40dc..12850285515a 100644 --- a/devtools/client/debugger/new/src/selectors/breakpointSources.js +++ b/devtools/client/debugger/new/src/selectors/breakpointSources.js @@ -5,7 +5,7 @@ // @flow import { sortBy, uniq } from "lodash"; -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; import { getSources, getBreakpointsList, @@ -20,7 +20,7 @@ import type { BreakpointId, SourceLocation } from "../types"; -import type { SourcesMap } from "../reducers/types"; +import type { Selector, SourcesMap } from "../reducers/types"; export type BreakpointSources = Array<{ source: Source, @@ -37,7 +37,7 @@ export type FormattedBreakpoint = {| function formatBreakpoint( breakpoint: Breakpoint, - selectedSource: Source + selectedSource: ?Source ): FormattedBreakpoint { const { id, condition, disabled } = breakpoint; @@ -55,7 +55,7 @@ function formatBreakpoint( function getBreakpointsForSource( source: Source, - selectedSource: Source, + selectedSource: ?Source, breakpoints: Breakpoint[] ) { return breakpoints @@ -72,7 +72,6 @@ function getBreakpointsForSource( function findBreakpointSources( sources: SourcesMap, - selectedSource: Source, breakpoints: Breakpoint[] ): Source[] { const sourceIds: string[] = uniq(breakpoints.map(bp => bp.location.sourceId)); @@ -84,12 +83,12 @@ function findBreakpointSources( return sortBy(breakpointSources, (source: Source) => getFilename(source)); } -export const getBreakpointSources = createSelector( +export const getBreakpointSources: Selector = createSelector( getBreakpointsList, getSources, getSelectedSource, - (breakpoints: Breakpoint[], sources: SourcesMap, selectedSource: Source) => - findBreakpointSources(sources, selectedSource, breakpoints) + (breakpoints: Breakpoint[], sources: SourcesMap, selectedSource: ?Source) => + findBreakpointSources(sources, breakpoints) .map(source => ({ source, breakpoints: getBreakpointsForSource( diff --git a/devtools/client/debugger/new/src/selectors/breakpoints.js b/devtools/client/debugger/new/src/selectors/breakpoints.js index 4b1b1d66d807..985e14d25278 100644 --- a/devtools/client/debugger/new/src/selectors/breakpoints.js +++ b/devtools/client/debugger/new/src/selectors/breakpoints.js @@ -4,12 +4,13 @@ // @flow -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; import type { BreakpointsState, XHRBreakpointsList } from "../reducers/breakpoints"; +import type { Selector } from "../reducers/types"; type OuterState = { breakpoints: BreakpointsState }; @@ -17,7 +18,7 @@ export function getXHRBreakpoints(state: OuterState): XHRBreakpointsList { return state.breakpoints.xhrBreakpoints; } -export const shouldPauseOnAnyXHR = createSelector( +export const shouldPauseOnAnyXHR: Selector = createSelector( getXHRBreakpoints, xhrBreakpoints => { const emptyBp = xhrBreakpoints.find(({ path }) => path.length === 0); diff --git a/devtools/client/debugger/new/src/selectors/getCallStackFrames.js b/devtools/client/debugger/new/src/selectors/getCallStackFrames.js index 776b51b0e447..0eb16506c161 100644 --- a/devtools/client/debugger/new/src/selectors/getCallStackFrames.js +++ b/devtools/client/debugger/new/src/selectors/getCallStackFrames.js @@ -13,7 +13,7 @@ import { isOriginal } from "../utils/source"; import { get } from "lodash"; import type { Frame, Source } from "../types"; import type { SourcesMap } from "../reducers/sources"; -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; function getLocation(frame, isGeneratedSource) { return isGeneratedSource diff --git a/devtools/client/debugger/new/src/selectors/visibleBreakpoints.js b/devtools/client/debugger/new/src/selectors/visibleBreakpoints.js index 35c1558c0bcd..c0c8bb161a5c 100644 --- a/devtools/client/debugger/new/src/selectors/visibleBreakpoints.js +++ b/devtools/client/debugger/new/src/selectors/visibleBreakpoints.js @@ -5,7 +5,7 @@ // @flow import { isGeneratedId } from "devtools-source-map"; -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; import { uniqBy } from "lodash"; import { getBreakpointsList } from "../reducers/breakpoints"; @@ -15,6 +15,7 @@ import memoize from "../utils/memoize"; import { sortBreakpoints } from "../utils/breakpoint"; import type { Breakpoint, Source } from "../types"; +import type { Selector } from "../reducers/types"; function getLocation(breakpoint, isGeneratedSource) { return isGeneratedSource @@ -36,7 +37,7 @@ const formatBreakpoint = memoize(function(breakpoint, selectedSource) { }; }); -function isVisible(breakpoint, selectedSource) { +function isVisible(breakpoint: Breakpoint, selectedSource: Source) { const sourceId = selectedSource.id; const isGeneratedSource = isGeneratedId(sourceId); @@ -47,16 +48,20 @@ function isVisible(breakpoint, selectedSource) { /* * Finds the breakpoints, which appear in the selected source. */ -export const getVisibleBreakpoints = createSelector( +export const getVisibleBreakpoints: Selector = createSelector( getSelectedSource, getBreakpointsList, - (selectedSource: Source, breakpoints: Breakpoint[]) => { - if (!selectedSource) { + (selectedSource: ?Source, breakpoints: Breakpoint[]) => { + if (selectedSource == null) { return null; } + // FIXME: Even though selectedSource is checked above, it fails type + // checking for isVisible + const source: Source = selectedSource; + return breakpoints - .filter(bp => isVisible(bp, selectedSource)) + .filter(bp => isVisible(bp, source)) .map(bp => formatBreakpoint(bp, selectedSource)); } ); @@ -64,13 +69,12 @@ export const getVisibleBreakpoints = createSelector( /* * Finds the first breakpoint per line, which appear in the selected source. */ -export const getFirstVisibleBreakpoints = createSelector( - getVisibleBreakpoints, - breakpoints => { - if (!breakpoints) { - return null; - } - - return uniqBy(sortBreakpoints(breakpoints), bp => bp.location.line); +export const getFirstVisibleBreakpoints: Selector< + Breakpoint[] +> = createSelector(getVisibleBreakpoints, breakpoints => { + if (!breakpoints) { + return []; } -); + + return (uniqBy(sortBreakpoints(breakpoints), bp => bp.location.line): any); +}); diff --git a/devtools/client/debugger/new/src/selectors/visibleColumnBreakpoints.js b/devtools/client/debugger/new/src/selectors/visibleColumnBreakpoints.js index 7561bb984429..0d2112919861 100644 --- a/devtools/client/debugger/new/src/selectors/visibleColumnBreakpoints.js +++ b/devtools/client/debugger/new/src/selectors/visibleColumnBreakpoints.js @@ -3,7 +3,7 @@ * file, You can obtain one at . */ import { groupBy, get, sortedUniqBy } from "lodash"; -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; import { getViewport } from "../selectors"; import { getVisibleBreakpoints } from "./visibleBreakpoints"; diff --git a/devtools/client/debugger/new/src/selectors/visibleSelectedFrame.js b/devtools/client/debugger/new/src/selectors/visibleSelectedFrame.js index a6e58c3eb01f..6848fab23cd1 100644 --- a/devtools/client/debugger/new/src/selectors/visibleSelectedFrame.js +++ b/devtools/client/debugger/new/src/selectors/visibleSelectedFrame.js @@ -7,11 +7,12 @@ import { getSelectedLocation } from "../reducers/sources"; import { getSelectedFrame } from "../reducers/pause"; import { isOriginalId } from "devtools-source-map"; -import { createSelector } from "../utils/createSelector"; +import { createSelector } from "reselect"; import type { Frame, SourceLocation } from "../types"; +import type { Selector } from "../reducers/types"; -function getLocation(frame: Frame, location?: SourceLocation) { +function getLocation(frame: Frame, location: ?SourceLocation) { if (!location) { return frame.location; } @@ -21,7 +22,10 @@ function getLocation(frame: Frame, location?: SourceLocation) { : frame.location; } -export const getVisibleSelectedFrame = createSelector( +export const getVisibleSelectedFrame: Selector = createSelector( getSelectedLocation, getSelectedFrame, (selectedLocation, selectedFrame) => { diff --git a/devtools/client/debugger/new/src/utils/moz.build b/devtools/client/debugger/new/src/utils/moz.build index 0e6fe6b09898..e8197d688e0f 100644 --- a/devtools/client/debugger/new/src/utils/moz.build +++ b/devtools/client/debugger/new/src/utils/moz.build @@ -18,7 +18,6 @@ DebuggerModules( 'build-query.js', 'clipboard.js', 'connect.js', - 'createSelector.js', 'dbg.js', 'defer.js', 'DevToolsUtils.js', diff --git a/devtools/client/debugger/new/src/utils/prefs.js b/devtools/client/debugger/new/src/utils/prefs.js index 0b78efebd358..66271eaff8b2 100644 --- a/devtools/client/debugger/new/src/utils/prefs.js +++ b/devtools/client/debugger/new/src/utils/prefs.js @@ -61,7 +61,7 @@ if (isDevelopment()) { pref("devtools.debugger.features.map-expression-bindings", true); pref("devtools.debugger.features.map-await-expression", true); pref("devtools.debugger.features.xhr-breakpoints", true); - pref("devtools.debugger.features.origial-blackbox", false); + pref("devtools.debugger.features.origial-blackbox", true); pref("devtools.debugger.features.windowless-workers", false); } diff --git a/devtools/client/debugger/new/src/utils/source.js b/devtools/client/debugger/new/src/utils/source.js index 327a5677a7eb..372699ded7f4 100644 --- a/devtools/client/debugger/new/src/utils/source.js +++ b/devtools/client/debugger/new/src/utils/source.js @@ -265,6 +265,7 @@ const contentTypeModeMap = { "text/jsx": { name: "jsx" }, "text/x-elm": { name: "elm" }, "text/x-clojure": { name: "clojure" }, + "text/x-clojurescript": { name: "clojure" }, "text/wasm": { name: "text" }, "text/html": { name: "htmlmixed" } }; diff --git a/devtools/client/debugger/new/src/utils/utils.js b/devtools/client/debugger/new/src/utils/utils.js index e8e96bce8901..427b76bce8d3 100644 --- a/devtools/client/debugger/new/src/utils/utils.js +++ b/devtools/client/debugger/new/src/utils/utils.js @@ -52,3 +52,20 @@ export function endTruncateStr(str: any, size: number) { export function waitForMs(ms: number): Promise { return new Promise(resolve => setTimeout(resolve, ms)); } + +export function downloadFile(data: string, fileName: string) { + const { body } = document; + if (!body) { + return; + } + + const a = document.createElement("a"); + body.appendChild(a); + a.className = "download-anchor"; + a.href = window.URL.createObjectURL( + new Blob([data], { type: "text/javascript" }) + ); + a.setAttribute("download", fileName); + a.click(); + body.removeChild(a); +} diff --git a/devtools/client/debugger/new/test/mochitest/browser.ini b/devtools/client/debugger/new/test/mochitest/browser.ini index 549ead677bfd..f555882593ca 100644 --- a/devtools/client/debugger/new/test/mochitest/browser.ini +++ b/devtools/client/debugger/new/test/mochitest/browser.ini @@ -740,6 +740,7 @@ skip-if = os == "win" # Bug 1393121 [browser_dbg-quick-open.js] skip-if = os == "win" [browser_dbg-search-project.js] +[browser_dbg-blackbox-original.js] [browser_dbg-sourcemaps.js] [browser_dbg-sourcemaps-disabled.js] [browser_dbg-sourcemaps-reload.js] diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-blackbox-original.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-blackbox-original.js new file mode 100644 index 000000000000..4fa83ee1ad24 --- /dev/null +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-blackbox-original.js @@ -0,0 +1,42 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +// This source map does not have source contents, so it's fetched separately +add_task(async function() { + // NOTE: the CORS call makes the test run times inconsistent + await pushPref("devtools.debugger.features.map-scopes", true); + + const dbg = await initDebugger("doc-sourcemaps3.html"); + const { + selectors: { getBreakpoint, getBreakpointCount }, + getState + } = dbg; + + await waitForSources(dbg, "bundle.js", "sorted.js", "test.js"); + + const sortedSrc = findSource(dbg, "sorted.js"); + + await selectSource(dbg, sortedSrc); + + await clickElement(dbg, "blackbox"); + await waitForDispatch(dbg, "BLACKBOX"); + + // breakpoint at line 38 in sorted + await addBreakpoint(dbg, sortedSrc, 38); + // invoke test + invokeInTab("test"); + // should not pause + is(isPaused(dbg), false); + + + // unblackbox + await clickElement(dbg, "blackbox"); + await waitForDispatch(dbg, "BLACKBOX"); + + // click on test + invokeInTab("test"); + // should pause + await waitForPaused(dbg); + + ok(true, "blackbox works") +}); diff --git a/devtools/client/debugger/new/test/mochitest/helpers.js b/devtools/client/debugger/new/test/mochitest/helpers.js index 242eef122303..bb824280190f 100644 --- a/devtools/client/debugger/new/test/mochitest/helpers.js +++ b/devtools/client/debugger/new/test/mochitest/helpers.js @@ -1136,7 +1136,8 @@ const selectors = { `.outline-list__element:nth-child(${i}) .function-signature`, outlineItems: ".outline-list__element", conditionalPanelInput: ".conditional-breakpoint-panel input", - searchField: ".search-field" + searchField: ".search-field", + blackbox: ".action.black-box" }; function getSelector(elementName, ...args) { diff --git a/devtools/client/locales/en-US/debugger.properties b/devtools/client/locales/en-US/debugger.properties index 04728136cbb3..dcb51e850e1e 100644 --- a/devtools/client/locales/en-US/debugger.properties +++ b/devtools/client/locales/en-US/debugger.properties @@ -82,9 +82,9 @@ stepInTooltip=Step in %S # button that steps out of a function call. stepOutTooltip=Step out %S -# LOCALIZATION NOTE (skipPausingTooltip): The tooltip text for disabling all +# LOCALIZATION NOTE (skipPausingTooltip.label): The tooltip text for disabling all # breakpoints and pausing triggers -skipPausingTooltip=Skip all pausing +skipPausingTooltip.label=Deactivate breakpoints # LOCALIZATION NOTE (pauseButtonItem): The label that is displayed for the dropdown pause # list item when the debugger is in a running state. @@ -510,6 +510,11 @@ editor.conditionalPanel.close=Cancel edit breakpoint and close editor.jumpToMappedLocation1=Jump to %S location editor.jumpToMappedLocation1.accesskey=m +# LOCALIZATION NOTE (downloadFile.label): Context menu item +# for downloading a source's content +downloadFile.label=Download file +downloadFile.accesskey=d + # LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the # context menu to disable framework grouping. framework.disableGrouping=Disable framework grouping diff --git a/devtools/client/preferences/debugger.js b/devtools/client/preferences/debugger.js index 00c4ffe14418..af6d7320f3d7 100644 --- a/devtools/client/preferences/debugger.js +++ b/devtools/client/preferences/debugger.js @@ -67,5 +67,5 @@ pref("devtools.debugger.features.skip-pausing", true); pref("devtools.debugger.features.autocomplete-expressions", false); pref("devtools.debugger.features.map-expression-bindings", true); pref("devtools.debugger.features.xhr-breakpoints", true); -pref("devtools.debugger.features.origial-blackbox", false); +pref("devtools.debugger.features.origial-blackbox", true); pref("devtools.debugger.features.windowless-workers", false); diff --git a/devtools/client/shared/components/reps/reps.js b/devtools/client/shared/components/reps/reps.js index 061f76830d80..7e524ef154a8 100644 --- a/devtools/client/shared/components/reps/reps.js +++ b/devtools/client/shared/components/reps/reps.js @@ -4103,6 +4103,10 @@ class Tree extends Component { // root item. autoExpandAll: _propTypes2.default.bool, + // Auto expand a node only if number of its children + // are less than autoExpandNodeChildrenLimit + autoExpandNodeChildrenLimit: _propTypes2.default.number, + // Note: the two properties below are mutually exclusive. Only one of the // label properties is necessary. // ID of an element whose textual content serves as an accessible label @@ -4194,7 +4198,8 @@ class Tree extends Component { } _autoExpand() { - if (!this.props.autoExpandDepth) { + const { autoExpandDepth, autoExpandNodeChildrenLimit } = this.props; + if (!autoExpandDepth) { return; } @@ -4202,14 +4207,18 @@ class Tree extends Component { // not use the usual DFS infrastructure because we don't want to ignore // collapsed nodes. const autoExpand = (item, currentDepth) => { - if (currentDepth >= this.props.autoExpandDepth || this.state.seen.has(item)) { + if (currentDepth >= autoExpandDepth || this.state.seen.has(item)) { + return; + } + + const children = this.props.getChildren(item); + if (autoExpandNodeChildrenLimit && children.length > autoExpandNodeChildrenLimit) { return; } this.props.onExpand(item); this.state.seen.add(item); - const children = this.props.getChildren(item); const length = children.length; for (let i = 0; i < length; i++) { autoExpand(children[i], currentDepth + 1); diff --git a/devtools/client/shared/source-map/index.js b/devtools/client/shared/source-map/index.js index 4b3c61df6e26..9786ab034b93 100644 --- a/devtools/client/shared/source-map/index.js +++ b/devtools/client/shared/source-map/index.js @@ -449,6 +449,7 @@ const getAllGeneratedLocations = dispatcher.task("getAllGeneratedLocations", { queue: true }); const getOriginalLocation = dispatcher.task("getOriginalLocation"); +const getFileGeneratedRange = dispatcher.task("getFileGeneratedRange"); const getLocationScopes = dispatcher.task("getLocationScopes"); const getOriginalSourceText = dispatcher.task("getOriginalSourceText"); const applySourceMap = dispatcher.task("applySourceMap"); @@ -468,6 +469,7 @@ module.exports = { getGeneratedLocation, getAllGeneratedLocations, getOriginalLocation, + getFileGeneratedRange, getLocationScopes, getOriginalSourceText, applySourceMap, @@ -552,7 +554,8 @@ const contentMap = { vue: "text/vue", coffee: "text/coffeescript", elm: "text/elm", - cljs: "text/x-clojure" + cljc: "text/x-clojure", + cljs: "text/x-clojurescript" }; /** diff --git a/devtools/client/shared/source-map/worker.js b/devtools/client/shared/source-map/worker.js index af833eaca9ca..fe31d9ce917d 100644 --- a/devtools/client/shared/source-map/worker.js +++ b/devtools/client/shared/source-map/worker.js @@ -483,7 +483,8 @@ const contentMap = { vue: "text/vue", coffee: "text/coffeescript", elm: "text/elm", - cljs: "text/x-clojure" + cljc: "text/x-clojure", + cljs: "text/x-clojurescript" }; /** @@ -1876,6 +1877,7 @@ const { getAllGeneratedLocations, getOriginalLocation, getOriginalSourceText, + getFileGeneratedRange, hasMappedSource, clearSourceMaps, applySourceMap @@ -1900,6 +1902,7 @@ self.onmessage = workerHandler({ getOriginalLocation, getOriginalSourceText, getOriginalStackFrames, + getFileGeneratedRange, hasMappedSource, applySourceMap, clearSourceMaps @@ -2187,6 +2190,34 @@ async function getOriginalSourceText(originalSource) { }; } +async function getFileGeneratedRange(originalSource) { + assert(isOriginalId(originalSource.id), "Source is not an original source"); + + const map = await getSourceMap(originalToGeneratedId(originalSource.id)); + if (!map) { + return; + } + + const start = map.generatedPositionFor({ + source: originalSource.url, + line: 1, + column: 0, + bias: SourceMapConsumer.LEAST_UPPER_BOUND + }); + + const end = map.generatedPositionFor({ + source: originalSource.url, + line: Number.MAX_SAFE_INTEGER, + column: Number.MAX_SAFE_INTEGER, + bias: SourceMapConsumer.GREATEST_LOWER_BOUND + }); + + return { + start, + end + }; +} + async function hasMappedSource(location) { if (isOriginalId(location.sourceId)) { return true; @@ -2218,6 +2249,7 @@ module.exports = { getAllGeneratedLocations, getOriginalLocation, getOriginalSourceText, + getFileGeneratedRange, applySourceMap, clearSourceMaps, hasMappedSource diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js index c9c87265863e..105a70bdbe09 100644 --- a/devtools/server/actors/thread.js +++ b/devtools/server/actors/thread.js @@ -1235,10 +1235,10 @@ const ThreadActor = ActorClassWithSpec(threadSpec, { return res ? res : {}; }, - onSources: function(request) { - for (const source of this.dbg.findSources()) { + onSources: async function(request) { + await Promise.all(this.dbg.findSources().map(source => { this.sources.createSourceActor(source); - } + })); // No need to flush the new source packets here, as we are sending the // list of sources out immediately and we don't need to invoke the diff --git a/dom/smil/SMILBoolType.cpp b/dom/smil/SMILBoolType.cpp index c18889a6be3c..ee0f83c8703e 100644 --- a/dom/smil/SMILBoolType.cpp +++ b/dom/smil/SMILBoolType.cpp @@ -20,7 +20,7 @@ void SMILBoolType::Init(nsSMILValue& aValue) const { void SMILBoolType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value"); aValue.mU.mBool = false; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SMILBoolType::Assign(nsSMILValue& aDest, diff --git a/dom/smil/nsSMILCSSValueType.cpp b/dom/smil/SMILCSSValueType.cpp similarity index 89% rename from dom/smil/nsSMILCSSValueType.cpp rename to dom/smil/SMILCSSValueType.cpp index c3b2d6f24a90..5a24be0055ac 100644 --- a/dom/smil/nsSMILCSSValueType.cpp +++ b/dom/smil/SMILCSSValueType.cpp @@ -6,7 +6,7 @@ /* representation of a value for a SMIL-animated CSS property */ -#include "nsSMILCSSValueType.h" +#include "SMILCSSValueType.h" #include "nsComputedDOMStyle.h" #include "nsString.h" @@ -27,12 +27,13 @@ #include "nsStyleUtil.h" #include "nsIDocument.h" -using namespace mozilla; using namespace mozilla::dom; +namespace mozilla { + typedef AutoTArray, 1> ServoAnimationValues; -/*static*/ nsSMILCSSValueType nsSMILCSSValueType::sSingleton; +/*static*/ SMILCSSValueType SMILCSSValueType::sSingleton; struct ValueWrapper { ValueWrapper(nsCSSPropertyID aPropID, const AnimationValue& aValue) @@ -118,21 +119,21 @@ static const ValueWrapper* ExtractValueWrapper(const nsSMILValue& aValue) { // Class methods // ------------- -void nsSMILCSSValueType::Init(nsSMILValue& aValue) const { +void SMILCSSValueType::Init(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.IsNull(), "Unexpected SMIL value type"); aValue.mU.mPtr = nullptr; aValue.mType = this; } -void nsSMILCSSValueType::Destroy(nsSMILValue& aValue) const { +void SMILCSSValueType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type"); delete static_cast(aValue.mU.mPtr); - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } -nsresult nsSMILCSSValueType::Assign(nsSMILValue& aDest, - const nsSMILValue& aSrc) const { +nsresult SMILCSSValueType::Assign(nsSMILValue& aDest, + const nsSMILValue& aSrc) const { MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types"); MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value type"); const ValueWrapper* srcWrapper = ExtractValueWrapper(aSrc); @@ -155,8 +156,8 @@ nsresult nsSMILCSSValueType::Assign(nsSMILValue& aDest, return NS_OK; } -bool nsSMILCSSValueType::IsEqual(const nsSMILValue& aLeft, - const nsSMILValue& aRight) const { +bool SMILCSSValueType::IsEqual(const nsSMILValue& aLeft, + const nsSMILValue& aRight) const { MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types"); MOZ_ASSERT(aLeft.mType == this, "Unexpected SMIL value"); const ValueWrapper* leftWrapper = ExtractValueWrapper(aLeft); @@ -238,7 +239,7 @@ static bool AddOrAccumulate(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, CompositeOperation aCompositeOp, uint64_t aCount) { MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add mismatching types"); - MOZ_ASSERT(aValueToAdd.mType == &nsSMILCSSValueType::sSingleton, + MOZ_ASSERT(aValueToAdd.mType == &SMILCSSValueType::sSingleton, "Unexpected SMIL value type"); MOZ_ASSERT(aCompositeOp == CompositeOperation::Add || aCompositeOp == CompositeOperation::Accumulate, @@ -275,16 +276,16 @@ static bool AddOrAccumulate(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, aCompositeOp, aCount); } -nsresult nsSMILCSSValueType::SandwichAdd(nsSMILValue& aDest, - const nsSMILValue& aValueToAdd) const { +nsresult SMILCSSValueType::SandwichAdd(nsSMILValue& aDest, + const nsSMILValue& aValueToAdd) const { return AddOrAccumulate(aDest, aValueToAdd, CompositeOperation::Add, 1) ? NS_OK : NS_ERROR_FAILURE; } -nsresult nsSMILCSSValueType::Add(nsSMILValue& aDest, - const nsSMILValue& aValueToAdd, - uint32_t aCount) const { +nsresult SMILCSSValueType::Add(nsSMILValue& aDest, + const nsSMILValue& aValueToAdd, + uint32_t aCount) const { return AddOrAccumulate(aDest, aValueToAdd, CompositeOperation::Accumulate, aCount) ? NS_OK @@ -328,9 +329,9 @@ static nsresult ComputeDistanceForServo(const ValueWrapper* aFromWrapper, return NS_OK; } -nsresult nsSMILCSSValueType::ComputeDistance(const nsSMILValue& aFrom, - const nsSMILValue& aTo, - double& aDistance) const { +nsresult SMILCSSValueType::ComputeDistance(const nsSMILValue& aFrom, + const nsSMILValue& aTo, + double& aDistance) const { MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types"); MOZ_ASSERT(aFrom.mType == this, "Unexpected source type"); @@ -388,10 +389,10 @@ static nsresult InterpolateForServo(const ValueWrapper* aStartWrapper, return NS_OK; } -nsresult nsSMILCSSValueType::Interpolate(const nsSMILValue& aStartVal, - const nsSMILValue& aEndVal, - double aUnitDistance, - nsSMILValue& aResult) const { +nsresult SMILCSSValueType::Interpolate(const nsSMILValue& aStartVal, + const nsSMILValue& aEndVal, + double aUnitDistance, + nsSMILValue& aResult) const { MOZ_ASSERT(aStartVal.mType == aEndVal.mType, "Trying to interpolate different types"); MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation"); @@ -437,11 +438,11 @@ static ServoAnimationValues ValueFromStringHelper(nsCSSPropertyID aPropID, } // static -void nsSMILCSSValueType::ValueFromString(nsCSSPropertyID aPropID, - Element* aTargetElement, - const nsAString& aString, - nsSMILValue& aValue, - bool* aIsContextSensitive) { +void SMILCSSValueType::ValueFromString(nsCSSPropertyID aPropID, + Element* aTargetElement, + const nsAString& aString, + nsSMILValue& aValue, + bool* aIsContextSensitive) { MOZ_ASSERT(aValue.IsNull(), "Outparam should be null-typed"); nsPresContext* presContext = nsContentUtils::GetContextForContent(aTargetElement); @@ -478,7 +479,7 @@ void nsSMILCSSValueType::ValueFromString(nsCSSPropertyID aPropID, } // static -nsSMILValue nsSMILCSSValueType::ValueFromAnimationValue( +nsSMILValue SMILCSSValueType::ValueFromAnimationValue( nsCSSPropertyID aPropID, Element* aTargetElement, const AnimationValue& aValue) { nsSMILValue result; @@ -503,9 +504,9 @@ nsSMILValue nsSMILCSSValueType::ValueFromAnimationValue( } // static -bool nsSMILCSSValueType::SetPropertyValues(const nsSMILValue& aValue, - DeclarationBlock& aDecl) { - MOZ_ASSERT(aValue.mType == &nsSMILCSSValueType::sSingleton, +bool SMILCSSValueType::SetPropertyValues(const nsSMILValue& aValue, + DeclarationBlock& aDecl) { + MOZ_ASSERT(aValue.mType == &SMILCSSValueType::sSingleton, "Unexpected SMIL value type"); const ValueWrapper* wrapper = ExtractValueWrapper(aValue); if (!wrapper) { @@ -522,9 +523,8 @@ bool nsSMILCSSValueType::SetPropertyValues(const nsSMILValue& aValue, } // static -nsCSSPropertyID nsSMILCSSValueType::PropertyFromValue( - const nsSMILValue& aValue) { - if (aValue.mType != &nsSMILCSSValueType::sSingleton) { +nsCSSPropertyID SMILCSSValueType::PropertyFromValue(const nsSMILValue& aValue) { + if (aValue.mType != &SMILCSSValueType::sSingleton) { return eCSSProperty_UNKNOWN; } @@ -537,10 +537,10 @@ nsCSSPropertyID nsSMILCSSValueType::PropertyFromValue( } // static -void nsSMILCSSValueType::FinalizeValue(nsSMILValue& aValue, - const nsSMILValue& aValueToMatch) { +void SMILCSSValueType::FinalizeValue(nsSMILValue& aValue, + const nsSMILValue& aValueToMatch) { MOZ_ASSERT(aValue.mType == aValueToMatch.mType, "Incompatible SMIL types"); - MOZ_ASSERT(aValue.mType == &nsSMILCSSValueType::sSingleton, + MOZ_ASSERT(aValue.mType == &SMILCSSValueType::sSingleton, "Unexpected SMIL value type"); ValueWrapper* valueWrapper = ExtractValueWrapper(aValue); @@ -569,3 +569,5 @@ void nsSMILCSSValueType::FinalizeValue(nsSMILValue& aValue, aValue.mU.mPtr = new ValueWrapper(valueToMatchWrapper->mPropID, std::move(zeroValues)); } + +} // namespace mozilla diff --git a/dom/smil/nsSMILCSSValueType.h b/dom/smil/SMILCSSValueType.h similarity index 90% rename from dom/smil/nsSMILCSSValueType.h rename to dom/smil/SMILCSSValueType.h index b194303211c7..db7794099b16 100644 --- a/dom/smil/nsSMILCSSValueType.h +++ b/dom/smil/SMILCSSValueType.h @@ -20,18 +20,17 @@ class DeclarationBlock; namespace dom { class Element; } // namespace dom -} // namespace mozilla /* - * nsSMILCSSValueType: Represents a SMIL-animated CSS value. + * SMILCSSValueType: Represents a SMIL-animated CSS value. */ -class nsSMILCSSValueType : public nsISMILType { +class SMILCSSValueType : public nsISMILType { public: typedef mozilla::dom::Element Element; typedef mozilla::AnimationValue AnimationValue; // Singleton for nsSMILValue objects to hold onto. - static nsSMILCSSValueType sSingleton; + static SMILCSSValueType sSingleton; protected: // nsISMILType Methods @@ -59,7 +58,7 @@ class nsSMILCSSValueType : public nsISMILType { * string is interpreted as a value for the given property on the given * element. * - * On failure, this method leaves aValue.mType == nsSMILNullType::sSingleton. + * On failure, this method leaves aValue.mType == SMILNullType::sSingleton. * Otherwise, this method leaves aValue.mType == this class's singleton. * * @param aPropID The property for which we're parsing a value. @@ -75,7 +74,7 @@ class nsSMILCSSValueType : public nsISMILType { * false otherwise. May be nullptr. * Not set if the method fails. * @pre aValue.IsNull() - * @post aValue.IsNull() || aValue.mType == nsSMILCSSValueType::sSingleton + * @post aValue.IsNull() || aValue.mType == SMILCSSValueType::sSingleton */ static void ValueFromString(nsCSSPropertyID aPropID, Element* aTargetElement, const nsAString& aString, nsSMILValue& aValue, @@ -109,7 +108,7 @@ class nsSMILCSSValueType : public nsISMILType { * @param aValue The nsSMILValue to examine. * @return The nsCSSPropertyID enum value of the property animated * by |aValue|, or eCSSProperty_UNKNOWN if the type of - * |aValue| is not nsSMILCSSValueType. + * |aValue| is not SMILCSSValueType. */ static nsCSSPropertyID PropertyFromValue(const nsSMILValue& aValue); @@ -120,9 +119,9 @@ class nsSMILCSSValueType : public nsISMILType { * There is no indication if this method fails. If a suitable zero value could * not be created, |aValue| is simply unmodified. * - * @param aValue The nsSMILValue (of type nsSMILCSSValueType) to + * @param aValue The nsSMILValue (of type SMILCSSValueType) to * possibly update. - * @param aValueToMatch A nsSMILValue (of type nsSMILCSSValueType) for which + * @param aValueToMatch A nsSMILValue (of type SMILCSSValueType) for which * a corresponding zero value will be created if |aValue| * is empty. */ @@ -131,7 +130,9 @@ class nsSMILCSSValueType : public nsISMILType { private: // Private constructor: prevent instances beyond my singleton. - constexpr nsSMILCSSValueType() {} + constexpr SMILCSSValueType() {} }; +} // namespace mozilla + #endif // NS_SMILCSSVALUETYPE_H_ diff --git a/dom/smil/SMILEnumType.cpp b/dom/smil/SMILEnumType.cpp index d1a5c8e5f741..e2dde03d2b1c 100644 --- a/dom/smil/SMILEnumType.cpp +++ b/dom/smil/SMILEnumType.cpp @@ -20,7 +20,7 @@ void SMILEnumType::Init(nsSMILValue& aValue) const { void SMILEnumType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value"); aValue.mU.mUint = 0; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SMILEnumType::Assign(nsSMILValue& aDest, diff --git a/dom/smil/SMILFloatType.cpp b/dom/smil/SMILFloatType.cpp index 46753d6acee4..21ad5d0f28bc 100644 --- a/dom/smil/SMILFloatType.cpp +++ b/dom/smil/SMILFloatType.cpp @@ -20,7 +20,7 @@ void SMILFloatType::Init(nsSMILValue& aValue) const { void SMILFloatType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value"); aValue.mU.mDouble = 0.0; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SMILFloatType::Assign(nsSMILValue& aDest, diff --git a/dom/smil/SMILIntegerType.cpp b/dom/smil/SMILIntegerType.cpp index 40e35772bb57..918ec1adba8f 100644 --- a/dom/smil/SMILIntegerType.cpp +++ b/dom/smil/SMILIntegerType.cpp @@ -20,7 +20,7 @@ void SMILIntegerType::Init(nsSMILValue& aValue) const { void SMILIntegerType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value"); aValue.mU.mInt = 0; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SMILIntegerType::Assign(nsSMILValue& aDest, diff --git a/dom/smil/nsSMILNullType.cpp b/dom/smil/SMILNullType.cpp similarity index 52% rename from dom/smil/nsSMILNullType.cpp rename to dom/smil/SMILNullType.cpp index 6382b5c226cc..6b43afe34ab6 100644 --- a/dom/smil/nsSMILNullType.cpp +++ b/dom/smil/SMILNullType.cpp @@ -4,17 +4,19 @@ * 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 "nsSMILNullType.h" +#include "SMILNullType.h" #include "nsSMILValue.h" #include "nsDebug.h" -/*static*/ nsSMILNullType* nsSMILNullType::Singleton() { - static nsSMILNullType sSingleton; +namespace mozilla { + +/*static*/ SMILNullType* SMILNullType::Singleton() { + static SMILNullType sSingleton; return &sSingleton; } -nsresult nsSMILNullType::Assign(nsSMILValue& aDest, - const nsSMILValue& aSrc) const { +nsresult SMILNullType::Assign(nsSMILValue& aDest, + const nsSMILValue& aSrc) const { MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types"); MOZ_ASSERT(aSrc.mType == this, "Unexpected source type"); aDest.mU = aSrc.mU; @@ -22,31 +24,33 @@ nsresult nsSMILNullType::Assign(nsSMILValue& aDest, return NS_OK; } -bool nsSMILNullType::IsEqual(const nsSMILValue& aLeft, - const nsSMILValue& aRight) const { +bool SMILNullType::IsEqual(const nsSMILValue& aLeft, + const nsSMILValue& aRight) const { MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types"); MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value"); return true; // All null-typed values are equivalent. } -nsresult nsSMILNullType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, - uint32_t aCount) const { +nsresult SMILNullType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd, + uint32_t aCount) const { MOZ_ASSERT_UNREACHABLE("Adding NULL type"); return NS_ERROR_FAILURE; } -nsresult nsSMILNullType::ComputeDistance(const nsSMILValue& aFrom, - const nsSMILValue& aTo, - double& aDistance) const { +nsresult SMILNullType::ComputeDistance(const nsSMILValue& aFrom, + const nsSMILValue& aTo, + double& aDistance) const { MOZ_ASSERT_UNREACHABLE("Computing distance for NULL type"); return NS_ERROR_FAILURE; } -nsresult nsSMILNullType::Interpolate(const nsSMILValue& aStartVal, - const nsSMILValue& aEndVal, - double aUnitDistance, - nsSMILValue& aResult) const { +nsresult SMILNullType::Interpolate(const nsSMILValue& aStartVal, + const nsSMILValue& aEndVal, + double aUnitDistance, + nsSMILValue& aResult) const { MOZ_ASSERT_UNREACHABLE("Interpolating NULL type"); return NS_ERROR_FAILURE; } + +} // namespace mozilla diff --git a/dom/smil/nsSMILNullType.h b/dom/smil/SMILNullType.h similarity index 91% rename from dom/smil/nsSMILNullType.h rename to dom/smil/SMILNullType.h index b389f50f7514..bbfa49dfb73b 100644 --- a/dom/smil/nsSMILNullType.h +++ b/dom/smil/SMILNullType.h @@ -10,10 +10,12 @@ #include "mozilla/Attributes.h" #include "nsISMILType.h" -class nsSMILNullType : public nsISMILType { +namespace mozilla { + +class SMILNullType : public nsISMILType { public: // Singleton for nsSMILValue objects to hold onto. - static nsSMILNullType* Singleton(); + static SMILNullType* Singleton(); protected: // nsISMILType Methods @@ -38,7 +40,9 @@ class nsSMILNullType : public nsISMILType { private: // Private constructor: prevent instances beyond my singleton. - constexpr nsSMILNullType() {} + constexpr SMILNullType() {} }; +} // namespace mozilla + #endif // NS_SMILNULLTYPE_H_ diff --git a/dom/smil/SMILStringType.cpp b/dom/smil/SMILStringType.cpp index bc0f075719c1..f7cebe5447a3 100644 --- a/dom/smil/SMILStringType.cpp +++ b/dom/smil/SMILStringType.cpp @@ -21,7 +21,7 @@ void SMILStringType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value"); delete static_cast(aValue.mU.mPtr); aValue.mU.mPtr = nullptr; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SMILStringType::Assign(nsSMILValue& aDest, diff --git a/dom/smil/moz.build b/dom/smil/moz.build index 27848682ccf0..c766a1c56779 100644 --- a/dom/smil/moz.build +++ b/dom/smil/moz.build @@ -16,12 +16,10 @@ EXPORTS += [ 'nsSMILAnimationFunction.h', 'nsSMILCompositorTable.h', 'nsSMILCSSProperty.h', - 'nsSMILCSSValueType.h', 'nsSMILInstanceTime.h', 'nsSMILInterval.h', 'nsSMILKeySpline.h', 'nsSMILMilestone.h', - 'nsSMILNullType.h', 'nsSMILRepeatCount.h', 'nsSMILSetAnimationFunction.h', 'nsSMILTargetIdentifier.h', @@ -32,6 +30,8 @@ EXPORTS += [ 'nsSMILTimeValueSpecParams.h', 'nsSMILTypes.h', 'nsSMILValue.h', + 'SMILCSSValueType.h', + 'SMILNullType.h', ] EXPORTS.mozilla.dom += [ @@ -43,11 +43,9 @@ UNIFIED_SOURCES += [ 'nsSMILAnimationFunction.cpp', 'nsSMILCompositor.cpp', 'nsSMILCSSProperty.cpp', - 'nsSMILCSSValueType.cpp', 'nsSMILInstanceTime.cpp', 'nsSMILInterval.cpp', 'nsSMILKeySpline.cpp', - 'nsSMILNullType.cpp', 'nsSMILParserUtils.cpp', 'nsSMILRepeatCount.cpp', 'nsSMILSetAnimationFunction.cpp', @@ -57,9 +55,11 @@ UNIFIED_SOURCES += [ 'nsSMILTimeValueSpec.cpp', 'nsSMILValue.cpp', 'SMILBoolType.cpp', + 'SMILCSSValueType.cpp', 'SMILEnumType.cpp', 'SMILFloatType.cpp', 'SMILIntegerType.cpp', + 'SMILNullType.cpp', 'SMILStringType.cpp', 'TimeEvent.cpp', ] diff --git a/dom/smil/nsSMILAnimationFunction.cpp b/dom/smil/nsSMILAnimationFunction.cpp index e9250d9d7d22..0d7085f0c0e5 100644 --- a/dom/smil/nsSMILAnimationFunction.cpp +++ b/dom/smil/nsSMILAnimationFunction.cpp @@ -9,9 +9,9 @@ #include "mozilla/dom/SVGAnimationElement.h" #include "mozilla/Move.h" #include "nsISMILAttr.h" -#include "nsSMILCSSValueType.h" +#include "SMILCSSValueType.h" #include "nsSMILParserUtils.h" -#include "nsSMILNullType.h" +#include "SMILNullType.h" #include "nsSMILTimedElement.h" #include "nsAttrValueInlines.h" #include "nsGkAtoms.h" @@ -341,7 +341,7 @@ nsresult nsSMILAnimationFunction::InterpolateResult( // Force discrete calcMode for visibility since StyleAnimationValue will // try to interpolate it using the special clamping behavior defined for // CSS. - if (nsSMILCSSValueType::PropertyFromValue(aValues[0]) == + if (SMILCSSValueType::PropertyFromValue(aValues[0]) == eCSSProperty_visibility) { calcMode = CALC_DISCRETE; } @@ -425,7 +425,7 @@ nsresult nsSMILAnimationFunction::InterpolateResult( // For animation of CSS properties, normally when interpolating we perform // a zero-value fixup which means that empty values (values with type - // nsSMILCSSValueType but a null pointer value) are converted into + // SMILCSSValueType but a null pointer value) are converted into // a suitable zero value based on whatever they're being interpolated // with. For discrete animation, however, since we don't interpolate, // that never happens. In some rare cases, such as discrete non-additive @@ -433,8 +433,8 @@ nsresult nsSMILAnimationFunction::InterpolateResult( // value so we need to manually perform the fixup. // // We could define a generic method for this on nsSMILValue but its faster - // and simpler to just special case nsSMILCSSValueType. - if (aResult.mType == &nsSMILCSSValueType::sSingleton) { + // and simpler to just special case SMILCSSValueType. + if (aResult.mType == &SMILCSSValueType::sSingleton) { // We have currently only ever encountered this case for the first // value of a by-animation (which has two values) and since we have no // way of testing other cases we just skip them (but assert if we @@ -443,7 +443,7 @@ nsresult nsSMILAnimationFunction::InterpolateResult( MOZ_ASSERT(aResult.mU.mPtr, "The last value should not be empty"); } else { // Base the type of the zero value on the next element in the series. - nsSMILCSSValueType::FinalizeValue(aResult, aValues[index + 1]); + SMILCSSValueType::FinalizeValue(aResult, aValues[index + 1]); } } } diff --git a/dom/smil/nsSMILCSSProperty.cpp b/dom/smil/nsSMILCSSProperty.cpp index 83202bba6ca3..20c325c2c675 100644 --- a/dom/smil/nsSMILCSSProperty.cpp +++ b/dom/smil/nsSMILCSSProperty.cpp @@ -13,7 +13,7 @@ #include "mozilla/ServoBindings.h" #include "mozilla/StyleAnimationValue.h" #include "nsDOMCSSAttrDeclaration.h" -#include "nsSMILCSSValueType.h" +#include "SMILCSSValueType.h" #include "nsSMILValue.h" #include "nsCSSProps.h" @@ -55,7 +55,7 @@ nsSMILValue nsSMILCSSProperty::GetBaseValue() const { // // In any case, just return a dummy value (initialized with the right // type, so as not to indicate failure). - nsSMILValue tmpVal(&nsSMILCSSValueType::sSingleton); + nsSMILValue tmpVal(&SMILCSSValueType::sSingleton); Swap(baseValue, tmpVal); return baseValue; } @@ -68,8 +68,8 @@ nsSMILValue nsSMILCSSProperty::GetBaseValue() const { return baseValue; } - baseValue = nsSMILCSSValueType::ValueFromAnimationValue(mPropID, mElement, - computedValue); + baseValue = SMILCSSValueType::ValueFromAnimationValue(mPropID, mElement, + computedValue); return baseValue; } @@ -78,8 +78,8 @@ nsresult nsSMILCSSProperty::ValueFromString( nsSMILValue& aValue, bool& aPreventCachingOfSandwich) const { NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE); - nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue, - &aPreventCachingOfSandwich); + SMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue, + &aPreventCachingOfSandwich); if (aValue.IsNull()) { return NS_ERROR_FAILURE; diff --git a/dom/smil/nsSMILCSSProperty.h b/dom/smil/nsSMILCSSProperty.h index 7b2665366af6..c021ac3f7c96 100644 --- a/dom/smil/nsSMILCSSProperty.h +++ b/dom/smil/nsSMILCSSProperty.h @@ -36,7 +36,7 @@ class nsSMILCSSProperty : public nsISMILAttr { * @param aBaseComputedStyle The ComputedStyle to use when getting the base * value. If this is nullptr and GetBaseValue is * called, an empty nsSMILValue initialized with - * the nsSMILCSSValueType will be returned. + * the SMILCSSValueType will be returned. */ nsSMILCSSProperty(nsCSSPropertyID aPropID, mozilla::dom::Element* aElement, mozilla::ComputedStyle* aBaseComputedStyle); diff --git a/dom/smil/nsSMILValue.cpp b/dom/smil/nsSMILValue.cpp index d10acc75e619..e257297846bb 100644 --- a/dom/smil/nsSMILValue.cpp +++ b/dom/smil/nsSMILValue.cpp @@ -12,7 +12,7 @@ // Public methods nsSMILValue::nsSMILValue(const nsISMILType* aType) - : mType(nsSMILNullType::Singleton()) { + : mType(SMILNullType::Singleton()) { mU.mBool = false; if (!aType) { NS_ERROR("Trying to construct nsSMILValue with null mType pointer"); @@ -23,7 +23,7 @@ nsSMILValue::nsSMILValue(const nsISMILType* aType) } nsSMILValue::nsSMILValue(const nsSMILValue& aVal) - : mType(nsSMILNullType::Singleton()) { + : mType(SMILNullType::Singleton()) { InitAndCheckPostcondition(aVal.mType); mType->Assign(*this, aVal); } @@ -47,7 +47,7 @@ nsSMILValue::nsSMILValue(nsSMILValue&& aVal) mType(aVal.mType) { // Leave aVal with a null type, so that it's safely destructible (and won't // mess with anything referenced by its union, which we've copied). - aVal.mType = nsSMILNullType::Singleton(); + aVal.mType = SMILNullType::Singleton(); } nsSMILValue& nsSMILValue::operator=(nsSMILValue&& aVal) { @@ -62,7 +62,7 @@ nsSMILValue& nsSMILValue::operator=(nsSMILValue&& aVal) { // Leave aVal with a null type, so that it's safely destructible (and won't // mess with anything referenced by its union, which we've now copied). - aVal.mType = nsSMILNullType::Singleton(); + aVal.mType = SMILNullType::Singleton(); return *this; } diff --git a/dom/smil/nsSMILValue.h b/dom/smil/nsSMILValue.h index 208dfa6861d0..05a61a857fb9 100644 --- a/dom/smil/nsSMILValue.h +++ b/dom/smil/nsSMILValue.h @@ -8,7 +8,7 @@ #define NS_SMILVALUE_H_ #include "nsISMILType.h" -#include "nsSMILNullType.h" +#include "SMILNullType.h" /** * Although objects of this type are generally only created on the stack and @@ -21,7 +21,9 @@ */ class nsSMILValue { public: - nsSMILValue() : mU(), mType(nsSMILNullType::Singleton()) {} + typedef mozilla::SMILNullType SMILNullType; + + nsSMILValue() : mU(), mType(SMILNullType::Singleton()) {} explicit nsSMILValue(const nsISMILType* aType); nsSMILValue(const nsSMILValue& aVal); @@ -38,7 +40,7 @@ class nsSMILValue { bool operator==(const nsSMILValue& aVal) const; bool operator!=(const nsSMILValue& aVal) const { return !(*this == aVal); } - bool IsNull() const { return (mType == nsSMILNullType::Singleton()); } + bool IsNull() const { return (mType == SMILNullType::Singleton()); } nsresult Add(const nsSMILValue& aValueToAdd, uint32_t aCount = 1); nsresult SandwichAdd(const nsSMILValue& aValueToAdd); diff --git a/dom/svg/DOMSVGTransformList.cpp b/dom/svg/DOMSVGTransformList.cpp index 0ba1b77a78c7..847be954eb9e 100644 --- a/dom/svg/DOMSVGTransformList.cpp +++ b/dom/svg/DOMSVGTransformList.cpp @@ -5,11 +5,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "DOMSVGTransformList.h" + +#include "mozilla/dom/SVGElement.h" #include "mozilla/dom/SVGTransform.h" #include "mozilla/dom/SVGMatrix.h" -#include "SVGAnimatedTransformList.h" -#include "SVGElement.h" #include "mozilla/dom/SVGTransformListBinding.h" +#include "SVGAnimatedTransformList.h" #include "nsError.h" #include diff --git a/dom/svg/DOMSVGTransformList.h b/dom/svg/DOMSVGTransformList.h index eb813d6c2903..8275a806fde8 100644 --- a/dom/svg/DOMSVGTransformList.h +++ b/dom/svg/DOMSVGTransformList.h @@ -10,8 +10,8 @@ #include "DOMSVGAnimatedTransformList.h" #include "nsCycleCollectionParticipant.h" #include "nsDebug.h" -#include "nsTArray.h" #include "SVGTransformList.h" +#include "nsTArray.h" #include "mozilla/Attributes.h" #include "mozilla/ErrorResult.h" diff --git a/dom/svg/SVGAnimatedTransformList.cpp b/dom/svg/SVGAnimatedTransformList.cpp index 0be642ff06d2..1b860af36433 100644 --- a/dom/svg/SVGAnimatedTransformList.cpp +++ b/dom/svg/SVGAnimatedTransformList.cpp @@ -7,13 +7,13 @@ #include "SVGAnimatedTransformList.h" #include "mozilla/dom/MutationEventBinding.h" -#include "DOMSVGAnimatedTransformList.h" #include "mozilla/dom/SVGAnimationElement.h" #include "mozilla/Move.h" #include "nsCharSeparatedTokenizer.h" -#include "nsSVGTransform.h" -#include "nsSMILValue.h" +#include "DOMSVGAnimatedTransformList.h" #include "SVGContentUtils.h" +#include "nsSMILValue.h" +#include "nsSVGTransform.h" #include "SVGTransformListSMILType.h" using namespace mozilla::dom; diff --git a/dom/svg/SVGElement.cpp b/dom/svg/SVGElement.cpp index e20cfaef129e..e21e51099281 100644 --- a/dom/svg/SVGElement.cpp +++ b/dom/svg/SVGElement.cpp @@ -10,51 +10,51 @@ #include "SVGElement.h" +#include "mozilla/dom/MutationEventBinding.h" +#include "mozilla/dom/SVGAnimatedEnumeration.h" +#include "mozilla/dom/SVGElementBinding.h" #include "mozilla/dom/SVGLengthBinding.h" #include "mozilla/dom/SVGSVGElement.h" #include "mozilla/dom/SVGTests.h" #include "mozilla/dom/SVGUnitTypesBinding.h" +#include "mozilla/DeclarationBlock.h" +#include "mozilla/EventListenerManager.h" +#include "mozilla/InternalMutationEvent.h" +#include "mozilla/RestyleManager.h" +#include "mozilla/Unused.h" +#include "mozAutoDocUpdate.h" +#include "nsAttrValueOrString.h" +#include "nsCSSProps.h" #include "nsContentUtils.h" #include "nsICSSDeclaration.h" #include "nsIContentInlines.h" #include "nsIDocument.h" -#include "mozilla/InternalMutationEvent.h" -#include "mozAutoDocUpdate.h" #include "nsError.h" -#include "nsIPresShell.h" #include "nsGkAtoms.h" -#include "nsCSSProps.h" -#include "mozilla/EventListenerManager.h" +#include "nsIPresShell.h" +#include "nsIFrame.h" #include "nsLayoutUtils.h" -#include "SVGAnimatedTransformList.h" -#include "nsSVGLength2.h" -#include "nsSVGNumber2.h" -#include "nsSVGNumberPair.h" -#include "nsSVGInteger.h" -#include "nsSVGIntegerPair.h" +#include "nsSMILAnimationController.h" #include "nsSVGAngle.h" #include "nsSVGBoolean.h" #include "nsSVGEnum.h" -#include "nsSVGViewBox.h" +#include "nsSVGInteger.h" +#include "nsSVGIntegerPair.h" +#include "nsSVGLength2.h" +#include "nsSVGNumber2.h" +#include "nsSVGNumberPair.h" #include "nsSVGString.h" -#include "mozilla/dom/SVGAnimatedEnumeration.h" +#include "nsSVGViewBox.h" #include "SVGAnimatedNumberList.h" #include "SVGAnimatedLengthList.h" #include "SVGAnimatedPointList.h" #include "SVGAnimatedPathSegList.h" +#include "SVGAnimatedTransformList.h" #include "SVGContentUtils.h" #include "SVGGeometryElement.h" -#include "nsIFrame.h" +#include "SVGMotionSMILAttr.h" #include "nsQueryObject.h" #include -#include "SVGMotionSMILAttr.h" -#include "nsAttrValueOrString.h" -#include "nsSMILAnimationController.h" -#include "mozilla/dom/MutationEventBinding.h" -#include "mozilla/dom/SVGElementBinding.h" -#include "mozilla/DeclarationBlock.h" -#include "mozilla/Unused.h" -#include "mozilla/RestyleManager.h" // This is needed to ensure correct handling of calls to the // vararg-list methods in this file: diff --git a/dom/svg/SVGElement.h b/dom/svg/SVGElement.h index 9236a92c0217..d4b4c44d1840 100644 --- a/dom/svg/SVGElement.h +++ b/dom/svg/SVGElement.h @@ -13,18 +13,18 @@ */ #include "mozilla/Attributes.h" +#include "mozilla/dom/DOMRect.h" +#include "mozilla/dom/Element.h" +#include "mozilla/gfx/MatrixFwd.h" #include "nsAutoPtr.h" #include "nsChangeHint.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsError.h" -#include "mozilla/dom/DOMRect.h" -#include "mozilla/dom/Element.h" -#include "mozilla/gfx/MatrixFwd.h" #include "nsISupportsImpl.h" #include "nsStyledElement.h" -#include "nsSVGClass.h" #include "SVGContentUtils.h" +#include "nsSVGClass.h" #include "gfxMatrix.h" class nsSVGAngle; diff --git a/dom/svg/SVGFragmentIdentifier.cpp b/dom/svg/SVGFragmentIdentifier.cpp index 54b47a26ca66..4e4da5f21d56 100644 --- a/dom/svg/SVGFragmentIdentifier.cpp +++ b/dom/svg/SVGFragmentIdentifier.cpp @@ -8,9 +8,9 @@ #include "mozilla/dom/SVGSVGElement.h" #include "mozilla/dom/SVGViewElement.h" +#include "nsCharSeparatedTokenizer.h" #include "nsContentUtils.h" // for nsCharSeparatedTokenizerTemplate #include "SVGAnimatedTransformList.h" -#include "nsCharSeparatedTokenizer.h" namespace mozilla { diff --git a/dom/svg/SVGGradientElement.cpp b/dom/svg/SVGGradientElement.cpp index e8bc3a5ebbcd..8776266aa2b6 100644 --- a/dom/svg/SVGGradientElement.cpp +++ b/dom/svg/SVGGradientElement.cpp @@ -7,15 +7,15 @@ #include "mozilla/dom/SVGGradientElement.h" #include "mozilla/ArrayUtils.h" -#include "DOMSVGAnimatedTransformList.h" +#include "mozilla/dom/SVGElement.h" #include "mozilla/dom/SVGGradientElementBinding.h" -#include "mozilla/dom/SVGRadialGradientElementBinding.h" #include "mozilla/dom/SVGLengthBinding.h" #include "mozilla/dom/SVGLinearGradientElementBinding.h" +#include "mozilla/dom/SVGRadialGradientElementBinding.h" #include "mozilla/dom/SVGUnitTypesBinding.h" +#include "DOMSVGAnimatedTransformList.h" #include "nsCOMPtr.h" #include "nsGkAtoms.h" -#include "SVGElement.h" NS_IMPL_NS_NEW_SVG_ELEMENT(LinearGradient) NS_IMPL_NS_NEW_SVG_ELEMENT(RadialGradient) diff --git a/dom/svg/SVGGradientElement.h b/dom/svg/SVGGradientElement.h index f41c8f90348e..4f42fd35f86b 100644 --- a/dom/svg/SVGGradientElement.h +++ b/dom/svg/SVGGradientElement.h @@ -10,8 +10,8 @@ #include "nsAutoPtr.h" #include "SVGAnimatedTransformList.h" #include "SVGElement.h" -#include "nsSVGLength2.h" #include "nsSVGEnum.h" +#include "nsSVGLength2.h" #include "nsSVGString.h" class nsSVGGradientFrame; diff --git a/dom/svg/SVGIntegerPairSMILType.cpp b/dom/svg/SVGIntegerPairSMILType.cpp index abebffecfc80..dcffdc8dd981 100644 --- a/dom/svg/SVGIntegerPairSMILType.cpp +++ b/dom/svg/SVGIntegerPairSMILType.cpp @@ -23,7 +23,7 @@ void SVGIntegerPairSMILType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value"); aValue.mU.mIntPair[0] = 0; aValue.mU.mIntPair[1] = 0; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGIntegerPairSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGLengthListSMILType.cpp b/dom/svg/SVGLengthListSMILType.cpp index 7b23a3f1a791..3adb5dbc269f 100644 --- a/dom/svg/SVGLengthListSMILType.cpp +++ b/dom/svg/SVGLengthListSMILType.cpp @@ -35,7 +35,7 @@ void SVGLengthListSMILType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type"); delete static_cast(aValue.mU.mPtr); aValue.mU.mPtr = nullptr; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGLengthListSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGMotionSMILType.cpp b/dom/svg/SVGMotionSMILType.cpp index 8d9c32edbc1b..6354e9209698 100644 --- a/dom/svg/SVGMotionSMILType.cpp +++ b/dom/svg/SVGMotionSMILType.cpp @@ -173,7 +173,7 @@ void SVGMotionSMILType::Destroy(nsSMILValue& aValue) const { delete arr; aValue.mU.mPtr = nullptr; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGMotionSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGNumberListSMILType.cpp b/dom/svg/SVGNumberListSMILType.cpp index 9f8f315f5493..46cdad57f288 100644 --- a/dom/svg/SVGNumberListSMILType.cpp +++ b/dom/svg/SVGNumberListSMILType.cpp @@ -50,7 +50,7 @@ void SVGNumberListSMILType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type"); delete static_cast(aValue.mU.mPtr); aValue.mU.mPtr = nullptr; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGNumberListSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGNumberPairSMILType.cpp b/dom/svg/SVGNumberPairSMILType.cpp index 61cd7375d03e..bf195d0a3775 100644 --- a/dom/svg/SVGNumberPairSMILType.cpp +++ b/dom/svg/SVGNumberPairSMILType.cpp @@ -25,7 +25,7 @@ void SVGNumberPairSMILType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value"); aValue.mU.mNumberPair[0] = 0; aValue.mU.mNumberPair[1] = 0; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGNumberPairSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGOrientSMILType.cpp b/dom/svg/SVGOrientSMILType.cpp index 8c91ee155a48..98b818a31b62 100644 --- a/dom/svg/SVGOrientSMILType.cpp +++ b/dom/svg/SVGOrientSMILType.cpp @@ -30,7 +30,7 @@ void SVGOrientSMILType::Init(nsSMILValue& aValue) const { void SVGOrientSMILType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value."); aValue.mU.mPtr = nullptr; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGOrientSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGPathSegListSMILType.cpp b/dom/svg/SVGPathSegListSMILType.cpp index 0d40f15e9d11..fc1db670c7c8 100644 --- a/dom/svg/SVGPathSegListSMILType.cpp +++ b/dom/svg/SVGPathSegListSMILType.cpp @@ -33,7 +33,7 @@ void SVGPathSegListSMILType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type"); delete static_cast(aValue.mU.mPtr); aValue.mU.mPtr = nullptr; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGPathSegListSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGPatternElement.cpp b/dom/svg/SVGPatternElement.cpp index 5344196b1aaf..24d9d2097d91 100644 --- a/dom/svg/SVGPatternElement.cpp +++ b/dom/svg/SVGPatternElement.cpp @@ -4,15 +4,15 @@ * 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 "mozilla/ArrayUtils.h" - -#include "nsCOMPtr.h" -#include "nsGkAtoms.h" -#include "DOMSVGAnimatedTransformList.h" -#include "mozilla/dom/SVGLengthBinding.h" #include "mozilla/dom/SVGPatternElement.h" + +#include "mozilla/ArrayUtils.h" +#include "mozilla/dom/SVGLengthBinding.h" #include "mozilla/dom/SVGPatternElementBinding.h" #include "mozilla/dom/SVGUnitTypesBinding.h" +#include "DOMSVGAnimatedTransformList.h" +#include "nsCOMPtr.h" +#include "nsGkAtoms.h" NS_IMPL_NS_NEW_SVG_ELEMENT(Pattern) diff --git a/dom/svg/SVGPatternElement.h b/dom/svg/SVGPatternElement.h index bb0fa1550a78..4a6d4761d227 100644 --- a/dom/svg/SVGPatternElement.h +++ b/dom/svg/SVGPatternElement.h @@ -8,13 +8,13 @@ #define mozilla_dom_SVGPatternElement_h #include "nsAutoPtr.h" +#include "mozilla/dom/SVGElement.h" +#include "SVGAnimatedPreserveAspectRatio.h" +#include "SVGAnimatedTransformList.h" #include "nsSVGEnum.h" #include "nsSVGLength2.h" #include "nsSVGString.h" -#include "SVGElement.h" #include "nsSVGViewBox.h" -#include "SVGAnimatedPreserveAspectRatio.h" -#include "SVGAnimatedTransformList.h" class nsSVGPatternFrame; diff --git a/dom/svg/SVGPointListSMILType.cpp b/dom/svg/SVGPointListSMILType.cpp index 9252d79286c4..758448678a31 100644 --- a/dom/svg/SVGPointListSMILType.cpp +++ b/dom/svg/SVGPointListSMILType.cpp @@ -31,7 +31,7 @@ void SVGPointListSMILType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value type"); delete static_cast(aValue.mU.mPtr); aValue.mU.mPtr = nullptr; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGPointListSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGSVGElement.cpp b/dom/svg/SVGSVGElement.cpp index f32f26e8a34d..ad009e8ad91f 100644 --- a/dom/svg/SVGSVGElement.cpp +++ b/dom/svg/SVGSVGElement.cpp @@ -15,16 +15,16 @@ #include "DOMSVGLength.h" #include "DOMSVGNumber.h" #include "DOMSVGPoint.h" -#include "nsLayoutStylesheetCache.h" -#include "nsSVGAngle.h" #include "nsFrameSelection.h" +#include "nsLayoutStylesheetCache.h" #include "nsIFrame.h" #include "nsISVGSVGFrame.h" #include "nsSMILAnimationController.h" #include "nsSMILTimeContainer.h" +#include "nsSVGAngle.h" +#include "SVGAngle.h" #include "nsSVGDisplayableFrame.h" #include "nsSVGUtils.h" -#include "SVGAngle.h" NS_IMPL_NS_NEW_SVG_ELEMENT_CHECK_PARSER(SVG) diff --git a/dom/svg/SVGTransform.cpp b/dom/svg/SVGTransform.cpp index 7e4504ba956c..72ab71ac0bd0 100644 --- a/dom/svg/SVGTransform.cpp +++ b/dom/svg/SVGTransform.cpp @@ -9,11 +9,11 @@ #include "mozilla/dom/SVGTransform.h" #include "mozilla/dom/SVGMatrix.h" #include "mozilla/dom/SVGTransformBinding.h" +#include "mozilla/DebugOnly.h" +#include "mozilla/FloatingPoint.h" #include "nsError.h" #include "SVGAnimatedTransformList.h" #include "nsSVGAttrTearoffTable.h" -#include "mozilla/DebugOnly.h" -#include "mozilla/FloatingPoint.h" namespace { const double kRadPerDegree = 2.0 * M_PI / 360.0; diff --git a/dom/svg/SVGTransformList.h b/dom/svg/SVGTransformList.h index 72ed259e2e9e..8f0c55dfb81b 100644 --- a/dom/svg/SVGTransformList.h +++ b/dom/svg/SVGTransformList.h @@ -8,9 +8,8 @@ #define MOZILLA_SVGTRANSFORMLIST_H__ #include "gfxMatrix.h" -#include "nsDebug.h" -#include "nsTArray.h" #include "nsSVGTransform.h" +#include "nsTArray.h" namespace mozilla { diff --git a/dom/svg/SVGTransformListSMILType.cpp b/dom/svg/SVGTransformListSMILType.cpp index 05ccfe54337b..4d4fec2999e3 100644 --- a/dom/svg/SVGTransformListSMILType.cpp +++ b/dom/svg/SVGTransformListSMILType.cpp @@ -32,7 +32,7 @@ void SVGTransformListSMILType::Destroy(nsSMILValue& aValue) const { TransformArray* params = static_cast(aValue.mU.mPtr); delete params; aValue.mU.mPtr = nullptr; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGTransformListSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGTransformableElement.cpp b/dom/svg/SVGTransformableElement.cpp index 57401c07da09..783148282519 100644 --- a/dom/svg/SVGTransformableElement.cpp +++ b/dom/svg/SVGTransformableElement.cpp @@ -4,19 +4,20 @@ * 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 "SVGTransformableElement.h" + +#include "DOMSVGAnimatedTransformList.h" #include "gfx2DGlue.h" #include "mozilla/dom/MutationEventBinding.h" -#include "DOMSVGAnimatedTransformList.h" #include "mozilla/dom/SVGGraphicsElementBinding.h" -#include "mozilla/dom/SVGTransformableElement.h" #include "mozilla/dom/SVGMatrix.h" +#include "mozilla/dom/SVGRect.h" #include "mozilla/dom/SVGSVGElement.h" #include "nsContentUtils.h" #include "nsIFrame.h" -#include "nsSVGDisplayableFrame.h" -#include "mozilla/dom/SVGRect.h" -#include "nsSVGUtils.h" #include "SVGContentUtils.h" +#include "nsSVGDisplayableFrame.h" +#include "nsSVGUtils.h" using namespace mozilla::gfx; diff --git a/dom/svg/SVGTransformableElement.h b/dom/svg/SVGTransformableElement.h index 6b457f3e11c9..204e807ab8bf 100644 --- a/dom/svg/SVGTransformableElement.h +++ b/dom/svg/SVGTransformableElement.h @@ -7,11 +7,11 @@ #ifndef SVGTransformableElement_h #define SVGTransformableElement_h -#include "mozilla/Attributes.h" #include "nsAutoPtr.h" #include "SVGAnimatedTransformList.h" -#include "SVGElement.h" #include "gfxMatrix.h" +#include "mozilla/Attributes.h" +#include "mozilla/dom/SVGElement.h" #include "mozilla/gfx/Matrix.h" namespace mozilla { diff --git a/dom/svg/SVGViewBoxSMILType.cpp b/dom/svg/SVGViewBoxSMILType.cpp index 097b255767d0..8b4dcc75e54a 100644 --- a/dom/svg/SVGViewBoxSMILType.cpp +++ b/dom/svg/SVGViewBoxSMILType.cpp @@ -25,7 +25,7 @@ void SVGViewBoxSMILType::Destroy(nsSMILValue& aValue) const { MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value"); delete static_cast(aValue.mU.mPtr); aValue.mU.mPtr = nullptr; - aValue.mType = nsSMILNullType::Singleton(); + aValue.mType = SMILNullType::Singleton(); } nsresult SVGViewBoxSMILType::Assign(nsSMILValue& aDest, diff --git a/dom/svg/SVGViewportElement.h b/dom/svg/SVGViewportElement.h index 4e63689a8709..8e92cd673efb 100644 --- a/dom/svg/SVGViewportElement.h +++ b/dom/svg/SVGViewportElement.h @@ -7,18 +7,18 @@ #ifndef mozilla_dom_SVGViewportElement_h #define mozilla_dom_SVGViewportElement_h +#include "mozilla/Attributes.h" #include "mozilla/dom/FromParser.h" #include "nsAutoPtr.h" #include "nsIContentInlines.h" #include "nsISVGPoint.h" +#include "SVGAnimatedPreserveAspectRatio.h" #include "nsSVGEnum.h" -#include "nsSVGLength2.h" #include "SVGGraphicsElement.h" #include "SVGImageContext.h" -#include "nsSVGViewBox.h" #include "SVGPreserveAspectRatio.h" -#include "SVGAnimatedPreserveAspectRatio.h" -#include "mozilla/Attributes.h" +#include "nsSVGLength2.h" +#include "nsSVGViewBox.h" class nsSVGOuterSVGFrame; class nsSVGViewportFrame; diff --git a/gfx/gl/SharedSurfaceANGLE.cpp b/gfx/gl/SharedSurfaceANGLE.cpp index c3a861b99e51..c1bc1379c6b1 100644 --- a/gfx/gl/SharedSurfaceANGLE.cpp +++ b/gfx/gl/SharedSurfaceANGLE.cpp @@ -98,6 +98,9 @@ SharedSurface_ANGLEShareHandle::SharedSurface_ANGLEShareHandle( mKeyedMutex(keyedMutex) {} SharedSurface_ANGLEShareHandle::~SharedSurface_ANGLEShareHandle() { + if (GLContextEGL::Cast(mGL)->GetEGLSurfaceOverride() == mPBuffer) { + GLContextEGL::Cast(mGL)->SetEGLSurfaceOverride(EGL_NO_SURFACE); + } mEGL->fDestroySurface(Display(), mPBuffer); } diff --git a/gfx/skia/skia/src/core/SkGlyphRunPainter.cpp b/gfx/skia/skia/src/core/SkGlyphRunPainter.cpp index 90a8c3d88c7f..3e673a94fcf3 100644 --- a/gfx/skia/skia/src/core/SkGlyphRunPainter.cpp +++ b/gfx/skia/skia/src/core/SkGlyphRunPainter.cpp @@ -69,6 +69,11 @@ bool SkGlyphRunListPainter::ShouldDrawAsPath(const SkPaint& paint, const SkMatri return true; } + // Glyphs like Emojis can't be rendered as a path. + if (paint.getTypeface() && paint.getTypeface()->hasColorGlyphs()) { + return false; + } + SkMatrix textM; SkPaintPriv::MakeTextMatrix(&textM, paint); return SkPaint::TooBigToUseCache(matrix, textM, 1024); diff --git a/js/src/jit/arm64/Assembler-arm64.h b/js/src/jit/arm64/Assembler-arm64.h index e058decb113b..1d42317411b5 100644 --- a/js/src/jit/arm64/Assembler-arm64.h +++ b/js/src/jit/arm64/Assembler-arm64.h @@ -37,15 +37,23 @@ static constexpr ARMRegister ScratchReg64 = {ScratchReg, 64}; static constexpr Register ScratchReg2{Registers::ip1}; static constexpr ARMRegister ScratchReg2_64 = {ScratchReg2, 64}; -static constexpr FloatRegister ScratchDoubleReg = {FloatRegisters::d31, - FloatRegisters::Double}; static constexpr FloatRegister ReturnDoubleReg = {FloatRegisters::d0, FloatRegisters::Double}; +static constexpr FloatRegister ScratchDoubleReg = {FloatRegisters::d31, + FloatRegisters::Double}; +struct ScratchDoubleScope : public AutoFloatRegisterScope { + explicit ScratchDoubleScope(MacroAssembler& masm) + : AutoFloatRegisterScope(masm, ScratchDoubleReg) {} +}; static constexpr FloatRegister ReturnFloat32Reg = {FloatRegisters::s0, FloatRegisters::Single}; static constexpr FloatRegister ScratchFloat32Reg = {FloatRegisters::s31, FloatRegisters::Single}; +struct ScratchFloat32Scope : public AutoFloatRegisterScope { + explicit ScratchFloat32Scope(MacroAssembler& masm) + : AutoFloatRegisterScope(masm, ScratchFloat32Reg) {} +}; static constexpr Register InvalidReg{Registers::invalid_reg}; static constexpr FloatRegister InvalidFloatReg = {FloatRegisters::invalid_fpreg, diff --git a/js/src/jit/arm64/CodeGenerator-arm64.cpp b/js/src/jit/arm64/CodeGenerator-arm64.cpp index 289f291c7238..85358a6e1950 100644 --- a/js/src/jit/arm64/CodeGenerator-arm64.cpp +++ b/js/src/jit/arm64/CodeGenerator-arm64.cpp @@ -744,7 +744,42 @@ void CodeGenerator::visitUrshD(LUrshD* ins) { } void CodeGenerator::visitPowHalfD(LPowHalfD* ins) { - MOZ_CRASH("visitPowHalfD"); + FloatRegister input = ToFloatRegister(ins->input()); + FloatRegister output = ToFloatRegister(ins->output()); + + ScratchDoubleScope scratch(masm); + + Label done, sqrt; + + if (!ins->mir()->operandIsNeverNegativeInfinity()) { + // Branch if not -Infinity. + masm.loadConstantDouble(NegativeInfinity(), scratch); + + Assembler::DoubleCondition cond = Assembler::DoubleNotEqualOrUnordered; + if (ins->mir()->operandIsNeverNaN()) { + cond = Assembler::DoubleNotEqual; + } + masm.branchDouble(cond, input, scratch, &sqrt); + + // Math.pow(-Infinity, 0.5) == Infinity. + masm.zeroDouble(output); + masm.subDouble(scratch, output); + masm.jump(&done); + + masm.bind(&sqrt); + } + + if (!ins->mir()->operandIsNeverNegativeZero()) { + // Math.pow(-0, 0.5) == 0 == Math.pow(0, 0.5). + // Adding 0 converts any -0 to 0. + masm.zeroDouble(scratch); + masm.addDouble(input, scratch); + masm.sqrtDouble(scratch, output); + } else { + masm.sqrtDouble(input, output); + } + + masm.bind(&done); } MoveOperand CodeGeneratorARM64::toMoveOperand(const LAllocation a) const { diff --git a/js/src/jit/arm64/vixl/Disasm-vixl.cpp b/js/src/jit/arm64/vixl/Disasm-vixl.cpp index 78ee385b17cd..1ea7289b8f18 100644 --- a/js/src/jit/arm64/vixl/Disasm-vixl.cpp +++ b/js/src/jit/arm64/vixl/Disasm-vixl.cpp @@ -3503,4 +3503,11 @@ void DisassembleInstruction(char* buffer, size_t bufsize, const Instruction* ins buffer[bufsize-1] = 0; // Just to be safe } +char* GdbDisassembleInstruction(const Instruction* instr) +{ + static char buffer[1024]; + DisassembleInstruction(buffer, sizeof(buffer), instr); + return buffer; +} + } // namespace vixl diff --git a/js/src/jit/arm64/vixl/Disasm-vixl.h b/js/src/jit/arm64/vixl/Disasm-vixl.h index da279e27ce2b..e04730da838a 100644 --- a/js/src/jit/arm64/vixl/Disasm-vixl.h +++ b/js/src/jit/arm64/vixl/Disasm-vixl.h @@ -174,6 +174,7 @@ class PrintDisassembler: public Disassembler { }; void DisassembleInstruction(char* buffer, size_t bufsize, const Instruction* instr); +char* GdbDisassembleInstruction(const Instruction* instr); } // namespace vixl diff --git a/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp b/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp index 4c88ace43128..9b9cc75e8c4d 100644 --- a/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp +++ b/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp @@ -755,8 +755,8 @@ void CodeGenerator::visitPowHalfD(LPowHalfD* ins) { } if (!ins->mir()->operandIsNeverNegativeZero()) { - // Math.pow(-0, 0.5) == 0 == Math.pow(0, 0.5). Adding 0 converts any -0 to - // 0. + // Math.pow(-0, 0.5) == 0 == Math.pow(0, 0.5). + // Adding 0 converts any -0 to 0. masm.zeroDouble(scratch); masm.addDouble(input, scratch); masm.vsqrtsd(scratch, output, output); diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index 2fe291a09959..8e546a5839d8 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -16,7 +16,7 @@ #include "nsIDocument.h" #include "nsIURI.h" #include "nsNodeUtils.h" -#include "nsSMILCSSValueType.h" +#include "SMILCSSValueType.h" #include "nsWrapperCacheInlines.h" #include "nsIFrame.h" #include "ActiveLayerTracker.h" @@ -146,7 +146,7 @@ nsresult nsDOMCSSAttributeDeclaration::SetSMILValue( } mozAutoDocUpdate autoUpdate(DocToUpdate(), true); RefPtr decl = olddecl->EnsureMutable(); - bool changed = nsSMILCSSValueType::SetPropertyValues(aValue, *decl); + bool changed = SMILCSSValueType::SetPropertyValues(aValue, *decl); if (changed) { // We can pass nullptr as the latter param, since this is // mIsSMILOverride == true case. diff --git a/toolkit/content/widgets/richlistbox.xml b/toolkit/content/widgets/richlistbox.xml index 9040f8e91e47..3db3c9e5f581 100644 --- a/toolkit/content/widgets/richlistbox.xml +++ b/toolkit/content/widgets/richlistbox.xml @@ -15,7 +15,6 @@ - diff --git a/toolkit/themes/shared/in-content/common.inc.css b/toolkit/themes/shared/in-content/common.inc.css index 6cdb8a7d8f3e..6c7673e5f615 100644 --- a/toolkit/themes/shared/in-content/common.inc.css +++ b/toolkit/themes/shared/in-content/common.inc.css @@ -714,15 +714,32 @@ xul|*.radio-label-box { /* List boxes */ html|select[size][multiple], +xul|listheader, xul|richlistbox { -moz-appearance: none; - margin-inline-start: 0; + margin-left: 0; + margin-right: 0; background-color: var(--in-content-box-background); border: 1px solid var(--in-content-box-border-color); border-radius: 2px; color: var(--in-content-text-color); } +xul|listheader { + border-bottom: none; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + padding-bottom: 1px; + box-shadow: inset 0 -1px var(--in-content-border-color); +} + +xul|listheader + xul|richlistbox { + margin-top: 0; + border-top: none; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + html|select[size][multiple] > html|option, xul|treechildren::-moz-tree-row { padding: 0.3em; @@ -761,7 +778,6 @@ xul|richlistbox:-moz-focusring { border: 1px dotted var(--in-content-border-focus); } -xul|listheader, xul|treecols { -moz-appearance: none; border: none;