author | Tiberius Oros <toros@mozilla.com> |
Thu, 28 Jun 2018 01:15:41 +0300 | |
changeset 424039 | 7516754db9e9f1d528b5d9c6c5544dfb8011c5a1 |
parent 424038 | c50141d4c2cdf1e244c2718773580fe62bf53c5a (current diff) |
parent 423949 | f8acdf0185d786809bfbe8cabab081400dc47c68 (diff) |
child 424040 | 5d8c20358cac8a734a88c83474c70aa057edba19 |
push id | 34198 |
push user | csabou@mozilla.com |
push date | Thu, 28 Jun 2018 10:05:18 +0000 |
treeherder | mozilla-central@b429b9fb68f1 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | merge |
milestone | 63.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
devtools/client/accessibility/accessibility-panel.js | file | annotate | diff | comparison | revisions | |
devtools/client/dom/dom-panel.js | file | annotate | diff | comparison | revisions | |
devtools/client/scratchpad/scratchpad-panel.js | file | annotate | diff | comparison | revisions | |
devtools/client/styleeditor/styleeditor-panel.js | file | annotate | diff | comparison | revisions |
--- a/Cargo.lock +++ b/Cargo.lock @@ -625,31 +625,31 @@ name = "ena" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "encoding_c" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "encoding_rs 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "encoding_glue" version = "0.1.0" dependencies = [ - "encoding_rs 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", "nserror 0.1.0", "nsstring 0.1.0", ] [[package]] name = "encoding_rs" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "simd 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "env_logger" @@ -2581,17 +2581,17 @@ dependencies = [ "checksum diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3c2b69f912779fbb121ceb775d74d51e915af17aaebc38d28a592843a2dd0a3a" "checksum docopt 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d8acd393692c503b168471874953a2531df0e9ab77d0b6bbc582395743300a4a" "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" "checksum dtoa-short 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "068d4026697c1a18f0b0bb8cfcad1b0c151b90d8edb9bf4c235ad68128920d1d" "checksum dwrote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b26e30aaa6bf31ec830db15fec14ed04f0f2ecfcc486ecfce88c55d3389b237f" "checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" "checksum ena 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cabe5a5078ac8c506d3e4430763b1ba9b609b1286913e7d08e581d1c2de9b7e5" "checksum encoding_c 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "769ecb8b33323998e482b218c0d13cd64c267609023b4b7ec3ee740714c318ee" -"checksum encoding_rs 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "22b758dc5e2c2b9e1dc3aa7a8be71035eed9742c907b7567627527af4c03324e" +"checksum encoding_rs 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0122c98564237c64fc6cace6abdfdb2438e0082aa7456ee86ccc04f7c3be1d5e" "checksum env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0561146661ae44c579e993456bc76d11ce1e0c7d745e57b2fa7146b6e49fa2ad" "checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" "checksum euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c95fd0d455f114291a3109286bd387bd423770058474a2d3f38b712cd661df60" "checksum fixedbitset 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "85cb8fec437468d86dc7c83ca7cfc933341d561873275f22dd5eedefa63a6478" "checksum flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fac2277e84e5e858483756647a9d0aa8d9a2b7cba517fd84325a0aaa69a0909" "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" "checksum foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ebc04f19019fff1f2d627b5581574ead502f80c48c88900575a46e0840fe5d0" "checksum freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b659e75b7a7338fe75afd7f909fc2b71937845cffb6ebe54ba2e50f13d8e903d"
--- a/devtools/client/aboutdebugging/aboutdebugging.xhtml +++ b/devtools/client/aboutdebugging/aboutdebugging.xhtml @@ -9,13 +9,13 @@ <!ENTITY % aboutdebuggingDTD SYSTEM "chrome://devtools/locale/aboutdebugging.dtd"> %aboutdebuggingDTD; ]> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>&aboutDebugging.fullTitle;</title> <link rel="stylesheet" href="chrome://global/skin/in-content/common.css" type="text/css"/> <link rel="stylesheet" href="chrome://devtools/content/aboutdebugging/aboutdebugging.css" type="text/css"/> - <script type="application/javascript" src="chrome://devtools/content/aboutdebugging/initializer.js"></script> + <script type="application/javascript" src="resource://devtools/client/aboutdebugging/initializer.js"></script> </head> <body id="body" dir="&locale.dir;"> </body> </html>
--- a/devtools/client/aboutdebugging/moz.build +++ b/devtools/client/aboutdebugging/moz.build @@ -4,15 +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/. DIRS += [ 'components', 'modules', ] +DevToolsModules( + 'initializer.js' +) + BROWSER_CHROME_MANIFESTS += [ 'test/browser.ini' ] XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell.ini'] with Files('**'): BUG_COMPONENT = ('DevTools', 'about:debugging')
--- a/devtools/client/accessibility/moz.build +++ b/devtools/client/accessibility/moz.build @@ -8,19 +8,19 @@ BROWSER_CHROME_MANIFESTS += ['test/brows DIRS += [ 'actions', 'components', 'reducers', 'utils' ] DevToolsModules( - 'accessibility-panel.js', 'accessibility-startup.js', 'accessibility-view.js', 'accessibility.css', 'constants.js', + 'panel.js', 'picker.js', 'provider.js', ) with Files('**'): BUG_COMPONENT = ('DevTools', 'Accessibility Tools')
rename from devtools/client/accessibility/accessibility-panel.js rename to devtools/client/accessibility/panel.js
--- a/devtools/client/application/index.html +++ b/devtools/client/application/index.html @@ -4,11 +4,11 @@ <!DOCTYPE html> <html dir=""> <head> <link rel="stylesheet" type="text/css" href="resource://devtools/client/application/application.css" /> </head> <body class="theme-body" role="application"> <div id="mount"></div> <script src="chrome://devtools/content/shared/theme-switching.js"></script> - <script src="initializer.js"></script> + <script src="resource://devtools/client/application/initializer.js"></script> </body> </html>
--- a/devtools/client/application/moz.build +++ b/devtools/client/application/moz.build @@ -3,12 +3,13 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. DIRS += [ 'src', ] DevToolsModules( 'application.css', + 'initializer.js', 'panel.js' ) BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
--- a/devtools/client/definitions.js +++ b/devtools/client/definitions.js @@ -9,27 +9,27 @@ const osString = Services.appinfo.OS; const { Cu } = require("chrome"); // Panels loader.lazyGetter(this, "OptionsPanel", () => require("devtools/client/framework/toolbox-options").OptionsPanel); loader.lazyGetter(this, "InspectorPanel", () => require("devtools/client/inspector/panel").InspectorPanel); loader.lazyGetter(this, "WebConsolePanel", () => require("devtools/client/webconsole/panel").WebConsolePanel); loader.lazyGetter(this, "DebuggerPanel", () => require("devtools/client/debugger/panel").DebuggerPanel); loader.lazyGetter(this, "NewDebuggerPanel", () => require("devtools/client/debugger/new/panel").DebuggerPanel); -loader.lazyGetter(this, "StyleEditorPanel", () => require("devtools/client/styleeditor/styleeditor-panel").StyleEditorPanel); +loader.lazyGetter(this, "StyleEditorPanel", () => require("devtools/client/styleeditor/panel").StyleEditorPanel); loader.lazyGetter(this, "CanvasDebuggerPanel", () => require("devtools/client/canvasdebugger/panel").CanvasDebuggerPanel); loader.lazyGetter(this, "WebAudioEditorPanel", () => require("devtools/client/webaudioeditor/panel").WebAudioEditorPanel); loader.lazyGetter(this, "MemoryPanel", () => require("devtools/client/memory/panel").MemoryPanel); loader.lazyGetter(this, "PerformancePanel", () => require("devtools/client/performance/panel").PerformancePanel); loader.lazyGetter(this, "NewPerformancePanel", () => require("devtools/client/performance-new/panel").PerformancePanel); loader.lazyGetter(this, "NetMonitorPanel", () => require("devtools/client/netmonitor/panel").NetMonitorPanel); loader.lazyGetter(this, "StoragePanel", () => require("devtools/client/storage/panel").StoragePanel); -loader.lazyGetter(this, "ScratchpadPanel", () => require("devtools/client/scratchpad/scratchpad-panel").ScratchpadPanel); -loader.lazyGetter(this, "DomPanel", () => require("devtools/client/dom/dom-panel").DomPanel); -loader.lazyGetter(this, "AccessibilityPanel", () => require("devtools/client/accessibility/accessibility-panel").AccessibilityPanel); +loader.lazyGetter(this, "ScratchpadPanel", () => require("devtools/client/scratchpad/panel").ScratchpadPanel); +loader.lazyGetter(this, "DomPanel", () => require("devtools/client/dom/panel").DomPanel); +loader.lazyGetter(this, "AccessibilityPanel", () => require("devtools/client/accessibility/panel").AccessibilityPanel); loader.lazyGetter(this, "ApplicationPanel", () => require("devtools/client/application/panel").ApplicationPanel); // Other dependencies loader.lazyRequireGetter(this, "AccessibilityStartup", "devtools/client/accessibility/accessibility-startup", true); loader.lazyRequireGetter(this, "CommandUtils", "devtools/client/shared/developer-toolbar", true); loader.lazyRequireGetter(this, "CommandState", "devtools/shared/gcli/command-state", true); loader.lazyRequireGetter(this, "ResponsiveUIManager", "devtools/client/responsive.html/manager", true); loader.lazyImporter(this, "ScratchpadManager", "resource://devtools/client/scratchpad/scratchpad-manager.jsm");
--- a/devtools/client/dom/moz.build +++ b/devtools/client/dom/moz.build @@ -5,13 +5,13 @@ BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] DIRS += [ 'content', ] DevToolsModules( - 'dom-panel.js', + 'panel.js', ) with Files('**'): BUG_COMPONENT = ('DevTools', 'DOM')
--- a/devtools/client/inspector/animation/test/browser_animation_pseudo-element.js +++ b/devtools/client/inspector/animation/test/browser_animation_pseudo-element.js @@ -4,20 +4,28 @@ http://creativecommons.org/publicdomain/ "use strict"; // Test for pseudo element. const TEST_DATA = [ { expectedTargetLabel: "::before", expectedAnimationNameLabel: "body", + expectedKeyframsGraphPathSegments: [ + { x: 0, y: 0 }, + { x: 1000, y: 100 }, + ], }, { expectedTargetLabel: "::before", expectedAnimationNameLabel: "div-before", + expectedKeyframsGraphPathSegments: [ + { x: 0, y: 100 }, + { x: 1000, y: 0 }, + ], }, { expectedTargetLabel: "::after", expectedAnimationNameLabel: "div-after", }, ]; add_task(async function() { @@ -46,34 +54,41 @@ add_task(async function() { const animationNameEl = animationItemEl.querySelector(".animation-name"); is(animationNameEl.textContent, testData.expectedAnimationNameLabel, `The animation name should be ${ testData.expectedAnimationNameLabel }`); } info("Checking whether node is selected correctly " + "when click on the first inspector icon on Reps component"); await clickOnTargetNode(animationInspector, panel, 0); - - info("Checking count of animation item"); - is(panel.querySelectorAll(".animation-list .animation-item").length, 1, - "Count of animation item should be 1"); - - info("Checking content of animation item"); - is(panel.querySelector(".animation-list .animation-item .animation-name").textContent, - TEST_DATA[0].expectedAnimationNameLabel, - `The animation name should be ${ TEST_DATA[0].expectedAnimationNameLabel }`); + assertAnimationCount(panel, 1); + assertAnimationNameLabel(panel, TEST_DATA[0].expectedAnimationNameLabel); + assertKeyframesGraphPathSegments(panel, TEST_DATA[0].expectedKeyframsGraphPathSegments); info("Select <body> again to reset the animation list"); await selectNodeAndWaitForAnimations("body", inspector); info("Checking whether node is selected correctly " + "when click on the second inspector icon on Reps component"); await clickOnTargetNode(animationInspector, panel, 1); + assertAnimationCount(panel, 1); + assertAnimationNameLabel(panel, TEST_DATA[1].expectedAnimationNameLabel); + assertKeyframesGraphPathSegments(panel, TEST_DATA[1].expectedKeyframsGraphPathSegments); +}); +function assertAnimationCount(panel, expectedCount) { info("Checking count of animation item"); - is(panel.querySelectorAll(".animation-list .animation-item").length, 1, - "Count of animation item should be 1"); + is(panel.querySelectorAll(".animation-list .animation-item").length, expectedCount, + `Count of animation item should be ${ expectedCount }`); +} - info("Checking content of animation item"); +function assertAnimationNameLabel(panel, expectedAnimationNameLabel) { + info("Checking the animation name label"); is(panel.querySelector(".animation-list .animation-item .animation-name").textContent, - TEST_DATA[1].expectedAnimationNameLabel, - `The animation name should be ${ TEST_DATA[1].expectedAnimationNameLabel }`); -}); + expectedAnimationNameLabel, + `The animation name should be ${ expectedAnimationNameLabel }`); +} + +function assertKeyframesGraphPathSegments(panel, expectedPathSegments) { + info("Checking the keyframes graph path segments"); + const pathEl = panel.querySelector(".keyframes-graph-path path"); + assertPathSegments(pathEl, true, expectedPathSegments); +}
--- a/devtools/client/inspector/animation/test/head.js +++ b/devtools/client/inspector/animation/test/head.js @@ -272,18 +272,20 @@ const clickOnSummaryGraph = async functi * @param {Number} index * The index of the AnimationTargetComponent to click on. */ const clickOnTargetNode = async function(animationInspector, panel, index) { info(`Click on a target node in animation target component[${ index }]`); const targetEl = panel.querySelectorAll(".animation-target .objectBox")[index]; targetEl.scrollIntoView(false); const onHighlight = animationInspector.inspector.toolbox.once("node-highlight"); + const onAnimationTargetUpdated = animationInspector.once("animation-target-rendered"); EventUtils.synthesizeMouseAtCenter(targetEl, {}, targetEl.ownerGlobal); - await waitForRendering(animationInspector); + await onAnimationTargetUpdated; + await waitForSummaryAndDetail(animationInspector); await onHighlight; }; /** * Drag on the scrubber to update the animation current time. * * @param {DOMElement} panel * #animation-container element.
--- a/devtools/client/inspector/fonts/components/FontEditor.js +++ b/devtools/client/inspector/fonts/components/FontEditor.js @@ -1,16 +1,17 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react"); const dom = require("devtools/client/shared/vendor/react-dom-factories"); +const { PluralForm } = require("devtools/shared/plural-form"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const FontMeta = createFactory(require("./FontMeta")); const FontPropertyValue = createFactory(require("./FontPropertyValue")); const FontSize = createFactory(require("./FontSize")); const FontStyle = createFactory(require("./FontStyle")); const FontWeight = createFactory(require("./FontWeight")); @@ -74,26 +75,59 @@ class FontEditor extends PureComponent { step: this.getAxisStep(axis.minValue, axis.maxValue), label: axis.name, name: axis.tag, onChange: this.props.onPropertyChange, unit: null }); }); } + + renderFamilesNotUsed(familiesNotUsed = []) { + if (!familiesNotUsed.length) { + return null; + } + + const familiesNotUsedLabel = PluralForm + .get(familiesNotUsed.length, getStr("fontinspector.familiesNotUsedLabel")) + .replace("#1", familiesNotUsed.length); + + const familiesList = familiesNotUsed.map(family => { + return dom.div( + { + className: "font-family-unused", + }, + family + ); + }); + + return dom.details( + {}, + dom.summary( + { + className: "font-family-unused-header", + }, + familiesNotUsedLabel + ), + familiesList + ); + } + /** * Render font family, font name, and metadata for all fonts used on selected node. * * @param {Array} fonts * Fonts used on selected node. + * @param {Array} families + * Font familes declared on selected node. * @param {Function} onToggleFontHighlight * Callback to trigger in-context highlighting of text that uses a font. * @return {DOMNode} */ - renderFontFamily(fonts, onToggleFontHighlight) { + renderFontFamily(fonts, families, onToggleFontHighlight) { if (!fonts.length) { return null; } const fontList = dom.ul( { className: "fonts-list" }, @@ -114,17 +148,18 @@ class FontEditor extends PureComponent { className: "font-control-label", }, getStr("fontinspector.fontFamilyLabel") ), dom.div( { className: "font-control-box", }, - fontList + fontList, + this.renderFamilesNotUsed(families.notUsed) ) ); } renderFontSize(value) { return value && FontSize({ onChange: this.props.onPropertyChange, value, @@ -210,17 +245,17 @@ class FontEditor extends PureComponent { className: "devtools-sidepanel-no-result" }, getStr("fontinspector.noFontsOnSelectedElement") ); } render() { const { fontEditor, onToggleFontHighlight } = this.props; - const { fonts, axes, instance, properties } = fontEditor; + const { fonts, families, axes, instance, properties } = fontEditor; // Pick the first font to show editor controls regardless of how many fonts are used. const font = fonts[0]; const hasFontAxes = font && font.variationAxes; const hasFontInstances = font && font.variationInstances && font.variationInstances.length > 0; const hasSlantOrItalicAxis = hasFontAxes && font.variationAxes.find(axis => { return axis.tag === "slnt" || axis.tag === "ital"; }); @@ -232,17 +267,17 @@ class FontEditor extends PureComponent { return dom.div( { id: "font-editor" }, // Render empty state message for nodes that don't have font properties. !hasWeight && this.renderWarning(), // Always render UI for font family, format and font file URL. - this.renderFontFamily(fonts, onToggleFontHighlight), + this.renderFontFamily(fonts, families, onToggleFontHighlight), // Render UI for font variation instances if they are defined. hasFontInstances && this.renderInstances(font.variationInstances, instance), // Always render UI for font size. this.renderFontSize(properties["font-size"]), // Render UI for font weight if no "wght" registered axis is defined. !hasWeightAxis && this.renderFontWeight(properties["font-weight"]), // Render UI for font style if no "slnt" or "ital" registered axis is defined. !hasSlantOrItalicAxis && this.renderFontStyle(properties["font-style"]),
--- a/devtools/client/inspector/fonts/fonts.js +++ b/devtools/client/inspector/fonts/fonts.js @@ -5,16 +5,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; const Services = require("Services"); const { gDevTools } = require("devtools/client/framework/devtools"); const { getColor } = require("devtools/client/shared/theme"); const { createFactory, createElement } = require("devtools/client/shared/vendor/react"); +const { getCssProperties } = require("devtools/shared/fronts/css-properties"); const { Provider } = require("devtools/client/shared/vendor/react-redux"); const { debounce } = require("devtools/shared/debounce"); const { ELEMENT_STYLE } = require("devtools/shared/specs/styles"); const FontsApp = createFactory(require("./components/FontsApp")); const { LocalizationHelper } = require("devtools/shared/l10n"); const INSPECTOR_L10N = @@ -50,18 +51,21 @@ const REGISTERED_AXES_TO_FONT_PROPERTIES "slnt": "font-style", "wdth": "font-stretch", "wght": "font-weight", }; const REGISTERED_AXES = Object.keys(REGISTERED_AXES_TO_FONT_PROPERTIES); class FontInspector { constructor(inspector, window) { + this.cssProperties = getCssProperties(inspector.toolbox); this.document = window.document; this.inspector = inspector; + // Set of unique keyword values supported by designated font properties. + this.keywordValues = new Set(this.getFontPropertyValueKeywords()); this.nodeComputedStyle = {}; this.pageStyle = this.inspector.pageStyle; this.ruleView = this.inspector.getPanel("ruleview").view; this.selectedRule = null; this.store = this.inspector.store; // Map CSS property names and variable font axis names to methods that write their // corresponding values to the appropriate TextProperty from the Rule view. // Values of variable font registered axes may be written to CSS font properties under @@ -193,22 +197,21 @@ class FontInspector { } return acc; }, []); } /** * Get all expected CSS font properties and values from the node's matching rules and - * fallback to computed style. + * fallback to computed style. Skip CSS Custom Properties, `calc()` and keyword values. * * @return {Object} */ getFontProperties() { - const KEYWORD_VALUES = ["initial", "inherit", "unset", "none"]; const properties = {}; // First, get all expected font properties from computed styles, if available. for (const prop of FONT_PROPERTIES) { properties[prop] = (this.nodeComputedStyle[prop] && this.nodeComputedStyle[prop].value) ? this.nodeComputedStyle[prop].value : ""; @@ -217,29 +220,46 @@ class FontInspector { // Then, replace with enabled font properties found on any of the rules that apply. for (const rule of this.ruleView.rules) { if (rule.inherited) { continue; } for (const textProp of rule.textProps) { if (FONT_PROPERTIES.includes(textProp.name) && - !KEYWORD_VALUES.includes(textProp.value) && + !this.keywordValues.has(textProp.value) && !textProp.value.includes("calc(") && !textProp.value.includes("var(") && !textProp.overridden && textProp.enabled) { properties[textProp.name] = textProp.value; } } } return properties; } + /** + * Get an array of keyword values supported by the following CSS properties: + * - font-size + * - font-weight + * - font-stretch + * + * This list is used to filter out values when reading CSS font properties from rules. + * Computed styles will be used instead of any of these values. + * + * @return {Array} + */ + getFontPropertyValueKeywords() { + return ["font-size", "font-weight", "font-stretch"].reduce((acc, property) => { + return acc.concat(this.cssProperties.getValues(property)); + }, []); + } + async getFontsForNode(node, options) { // In case we've been destroyed in the meantime if (!this.document) { return []; } const fonts = await this.pageStyle.getUsedFontFaces(node, options).catch(console.error); @@ -410,18 +430,17 @@ class FontInspector { const families = {}; // Font family names declared and used. families.used = fontsUsed.map(font => font.CSSGeneric ? font.CSSGeneric : font.CSSFamilyName ); const familiesUsedLowercase = families.used.map(family => family.toLowerCase()); // Font family names declared but not used. families.notUsed = fontFamilies - .map(family => family.toLowerCase()) - .filter(family => !familiesUsedLowercase.includes(family)); + .filter(family => !familiesUsedLowercase.includes(family.toLowerCase())); return families; } /** * Check if the font inspector panel is visible. * * @return {Boolean}
--- a/devtools/client/inspector/fonts/test/browser.ini +++ b/devtools/client/inspector/fonts/test/browser.ini @@ -16,12 +16,14 @@ support-files = !/devtools/client/shared/test/test-actor-registry.js [browser_fontinspector.js] [browser_fontinspector_copy-URL.js] skip-if = !e10s # too slow on !e10s, logging fully serialized actors (Bug 1446595) subsuite = clipboard [browser_fontinspector_edit-previews.js] [browser_fontinspector_editor-values.js] +[browser_fontinspector_editor-keywords.js] [browser_fontinspector_expand-css-code.js] +[browser_fontinspector_family-unused.js] [browser_fontinspector_other-fonts.js] [browser_fontinspector_reveal-in-page.js] [browser_fontinspector_theme-change.js]
--- a/devtools/client/inspector/fonts/test/browser_fontinspector.html +++ b/devtools/client/inspector/fonts/test/browser_fontinspector.html @@ -21,27 +21,27 @@ src: url(ostrich-black.ttf); } body{ /* Arial doesn't exist on Linux. Liberation Sans is the default sans-serif there. */ font-family:Arial, "Liberation Sans"; font-size: 36px; } div { - font-family:Arial; - font-family:bar; font-size: 1em; + font-family:bar, "Missing Family", sans-serif; } .normal-text { font-family: barnormal; font-weight: normal; } .bold-text { font-family: bar; font-weight: bold; + font-size: inherit; } .black-text { font-family: bar; font-weight: 800; } </style> <body>
new file mode 100644 --- /dev/null +++ b/devtools/client/inspector/fonts/test/browser_fontinspector_editor-keywords.js @@ -0,0 +1,43 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test that keyword values for font properties don't show up in the font editor, +// but their computed style values show up instead. + +const TEST_URI = URL_ROOT + "browser_fontinspector.html"; + +add_task(async function() { + await pushPref("devtools.inspector.fonteditor.enabled", true); + const { inspector, view } = await openFontInspectorForURL(TEST_URI); + const viewDoc = view.document; + + await testKeywordValues(inspector, viewDoc); +}); + +function getPropertyValue(viewDoc, name) { + const selector = `#font-editor .font-value-slider[name=${name}]`; + return { + value: viewDoc.querySelector(selector).value, + // Ensure unit dropdown exists before querying its value + unit: viewDoc.querySelector(selector + ` ~ .font-unit-select`) && + viewDoc.querySelector(selector + ` ~ .font-unit-select`).value + }; +} + +async function testKeywordValues(inspector, viewDoc) { + await selectNode(".bold-text", inspector); + + info("Check font-weight shows its computed style instead of the bold keyword value."); + const fontWeight = getPropertyValue(viewDoc, "font-weight"); + isnot(fontWeight.value, "bold", "Font weight is not shown as keyword"); + is(fontWeight.value, "700", "Font weight is shown as computed style"); + + info("Check font-size shows its computed style instead of the inherit keyword value."); + const fontSize = getPropertyValue(viewDoc, "font-size"); + isnot(fontSize.unit, "inherit", "Font size unit is not shown as keyword"); + is(fontSize.unit, "px", "Font size unit is shown as computed style"); + is(fontSize.value + fontSize.unit, "36px", "Font size is read as computed style"); +}
new file mode 100644 --- /dev/null +++ b/devtools/client/inspector/fonts/test/browser_fontinspector_family-unused.js @@ -0,0 +1,39 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +const TEST_URI = URL_ROOT + "browser_fontinspector.html"; + +// Test that unused font families show up in the font editor. +add_task(async function() { + await pushPref("devtools.inspector.fonteditor.enabled", true); + const { inspector, view } = await openFontInspectorForURL(TEST_URI); + const viewDoc = view.document; + + await testFamiliesUnused(inspector, viewDoc); + await testZeroFamiliesUnused(inspector, viewDoc); +}); + +function getUnusedFontFamilies(viewDoc) { + return [...viewDoc.querySelectorAll("#font-editor .font-family-unused")] + .map(el => el.textContent); +} + +async function testFamiliesUnused(inspector, viewDoc) { + await selectNode("div", inspector); + + const unused = getUnusedFontFamilies(viewDoc); + is(unused.length, 2, "Two font families were not used"); + is(unused[0], "Missing Family", "First unused family is correct"); + is(unused[1], "sans-serif", "Second unused family is correct"); +} + +async function testZeroFamiliesUnused(inspector, viewDoc) { + await selectNode(".normal-text", inspector); + + const unused = getUnusedFontFamilies(viewDoc); + const header = viewDoc.querySelector("#font-editor .font-family-unused-header"); + is(unused.length, 0, "All font families were used"); + is(header, null, "Container for unused font families was not rendered"); +}
--- a/devtools/client/inspector/index.xhtml +++ b/devtools/client/inspector/index.xhtml @@ -32,18 +32,17 @@ var isInChrome = window.location.href.includes("chrome:"); if (isInChrome) { var exports = {}; var { require, loader } = Cu.import("resource://devtools/shared/Loader.jsm", {}); var { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {}); } </script> - <!-- In content, inspector.js is mapped to the dynamically generated webpack bundle --> - <script type="application/javascript" src="inspector.js" defer="true"></script> + <script type="application/javascript" src="resource://devtools/client/inspector/inspector.js" defer="true"></script> </head> <body class="theme-body" role="application"> <div class="inspector-responsive-container theme-body inspector" data-localization-bundle="devtools/client/locales/inspector.properties"> <!-- Main Panel Content --> <div id="inspector-main-content" class="devtools-main-content" style="visibility: hidden;"> <!-- Toolbar -->
--- a/devtools/client/inspector/markup/test/browser.ini +++ b/devtools/client/inspector/markup/test/browser.ini @@ -161,16 +161,17 @@ skip-if = verify [browser_markup_node_not_displayed_02.js] [browser_markup_pagesize_01.js] [browser_markup_pagesize_02.js] [browser_markup_remove_xul_attributes.js] skip-if = e10s # Bug 1036409 - The last selected node isn't reselected [browser_markup_search_01.js] [browser_markup_shadowdom.js] [browser_markup_shadowdom_clickreveal.js] +[browser_markup_shadowdom_clickreveal_scroll.js] [browser_markup_shadowdom_delete.js] [browser_markup_shadowdom_maxchildren.js] [browser_markup_shadowdom_mutations_shadow.js] [browser_markup_shadowdom_navigation.js] [browser_markup_shadowdom_noslot.js] [browser_markup_shadowdom_slotupdate.js] [browser_markup_tag_delete_whitespace_node.js] [browser_markup_tag_edit_01.js]
--- a/devtools/client/inspector/markup/test/browser_markup_shadowdom_clickreveal.js +++ b/devtools/client/inspector/markup/test/browser_markup_shadowdom_clickreveal.js @@ -66,21 +66,8 @@ async function checkRevealLink(inspector info("Click on the reveal link and wait for the new node to be selected"); await clickOnRevealLink(inspector, slottedContainer); const selectedFront = inspector.selection.nodeFront; is(selectedFront, node, "The same node front is still selected"); ok(!inspector.selection.isSlotted(), "The selection is not the slotted version"); ok(!inspector.markup.getSelectedContainer().isSlotted(), "The selected container is not slotted"); } - -async function clickOnRevealLink(inspector, container) { - const onSelection = inspector.selection.once("new-node-front"); - const revealLink = container.elt.querySelector(".reveal-link"); - const tagline = revealLink.closest(".tag-line"); - const win = inspector.markup.doc.defaultView; - - // First send a mouseover on the tagline to force the link to be displayed. - EventUtils.synthesizeMouseAtCenter(tagline, {type: "mouseover"}, win); - EventUtils.synthesizeMouseAtCenter(revealLink, {}, win); - - await onSelection; -}
new file mode 100644 --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_shadowdom_clickreveal_scroll.js @@ -0,0 +1,85 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test that clicking on "reveal" always scrolls the view to show the real container, even +// if the node is already selected. + +const TEST_URL = `data:text/html;charset=utf-8, + <test-component> + <div slot="slot1" id="el1">slot1 content</div> + </test-component> + + <script> + 'use strict'; + customElements.define('test-component', class extends HTMLElement { + constructor() { + super(); + let shadowRoot = this.attachShadow({mode: 'open'}); + shadowRoot.innerHTML = \` + <slot name="slot1"></slot> + <div></div><div></div><div></div><div></div><div></div><div></div> + <div></div><div></div><div></div><div></div><div></div><div></div> + <div></div><div></div><div></div><div></div><div></div><div></div> + <div></div><div></div><div></div><div></div><div></div><div></div> + <!-- adding some nodes to make sure the slotted container and the real container + require scrolling --> + \`; + } + }); + </script>`; + +add_task(async function() { + await enableWebComponents(); + + const {inspector} = await openInspectorForURL(TEST_URL); + const {markup} = inspector; + + info("Find and expand the test-component shadow DOM host."); + const hostFront = await getNodeFront("test-component", inspector); + const hostContainer = markup.getContainer(hostFront); + await expandContainer(inspector, hostContainer); + + info("Expand the shadow root"); + const shadowRootContainer = hostContainer.getChildContainers()[0]; + await expandContainer(inspector, shadowRootContainer); + + info("Expand the slot"); + const slotContainer = shadowRootContainer.getChildContainers()[0]; + await expandContainer(inspector, slotContainer); + + const slotChildContainers = slotContainer.getChildContainers(); + is(slotChildContainers.length, 1, "Expecting 1 slotted child"); + + const slottedContainer = slotChildContainers[0]; + const realContainer = inspector.markup.getContainer(slottedContainer.node); + const slottedElement = slottedContainer.elt; + const realElement = realContainer.elt; + + info("Click on the reveal link"); + await clickOnRevealLink(inspector, slottedContainer); + // "new-node-front" will also trigger the scroll, so make sure we are testing after + // the scroll was performed. + await waitUntil(() => isScrolledOut(slottedElement)); + is(isScrolledOut(slottedElement), true, "slotted element is scrolled out"); + is(isScrolledOut(realElement), false, "real element is not scrolled out"); + + info("Scroll back to see the slotted element"); + slottedElement.scrollIntoView(); + is(isScrolledOut(slottedElement), false, "slotted element is not scrolled out"); + is(isScrolledOut(realElement), true, "real element is scrolled out"); + + info("Click on the reveal link again"); + await clickOnRevealLink(inspector, slottedContainer); + await waitUntil(() => isScrolledOut(slottedElement)); + is(isScrolledOut(slottedElement), true, "slotted element is scrolled out"); + is(isScrolledOut(realElement), false, "real element is not scrolled out"); +}); + +function isScrolledOut(element) { + const win = element.ownerGlobal; + const rect = element.getBoundingClientRect(); + return rect.top < 0 || (rect.top + rect.height) > win.innerHeight; +}
--- a/devtools/client/inspector/markup/test/head.js +++ b/devtools/client/inspector/markup/test/head.js @@ -710,8 +710,24 @@ function waitForNMutations(inspector, ty if (receivedMutations == count) { inspector.off("markupmutation", onMutation); resolve(); } }); }); } +/** + * Click on the reveal link the provided slotted container. + * Will resolve when selection emits "new-node-front". + */ +async function clickOnRevealLink(inspector, container) { + const onSelection = inspector.selection.once("new-node-front"); + const revealLink = container.elt.querySelector(".reveal-link"); + const tagline = revealLink.closest(".tag-line"); + const win = inspector.markup.doc.defaultView; + + // First send a mouseover on the tagline to force the link to be displayed. + EventUtils.synthesizeMouseAtCenter(tagline, {type: "mouseover"}, win); + EventUtils.synthesizeMouseAtCenter(revealLink, {}, win); + + await onSelection; +}
--- a/devtools/client/inspector/markup/views/slotted-node-container.js +++ b/devtools/client/inspector/markup/views/slotted-node-container.js @@ -34,21 +34,19 @@ SlottedNodeContainer.prototype = extend( event.stopPropagation(); }, onContainerClick: async function(event) { if (!event.target.classList.contains("reveal-link")) { return; } - const selection = this.markup.inspector.selection; - if (selection.nodeFront != this.node || selection.isSlotted()) { - const reason = "reveal-from-slot"; - this.markup.inspector.selection.setNodeFront(this.node, { reason }); - } + this.markup.inspector.selection.setNodeFront(this.node, { + reason: "reveal-from-slot" + }); }, isDraggable: function() { return false; }, isSlotted: function() { return true;
--- a/devtools/client/inspector/moz.build +++ b/devtools/client/inspector/moz.build @@ -17,16 +17,17 @@ DIRS += [ 'rules', 'shared' ] DevToolsModules( 'breadcrumbs.js', 'inspector-commands.js', 'inspector-search.js', + 'inspector.js', 'panel.js', 'reducers.js', 'store.js', 'toolsidebar.js', ) BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
--- a/devtools/client/jar.mn +++ b/devtools/client/jar.mn @@ -6,22 +6,20 @@ devtools.jar: % content devtools %content/ content/shared/vendor/d3.js (shared/vendor/d3.js) content/shared/vendor/dagre-d3.js (shared/vendor/dagre-d3.js) content/shared/widgets/widgets.css (shared/widgets/widgets.css) content/shared/widgets/VariablesView.xul (shared/widgets/VariablesView.xul) content/webconsole/index.html (webconsole/index.html) content/webconsole/browserconsole.xul (webconsole/browserconsole.xul) * content/scratchpad/index.xul (scratchpad/index.xul) - content/scratchpad/scratchpad.js (scratchpad/scratchpad.js) content/shared/splitview.css (shared/splitview.css) content/shared/theme-switching.js (shared/theme-switching.js) * content/styleeditor/index.xul (styleeditor/index.xul) * content/storage/index.xul (storage/index.xul) - content/inspector/inspector.js (inspector/inspector.js) content/inspector/markup/markup.xhtml (inspector/markup/markup.xhtml) content/inspector/animation-old/animation-controller.js (inspector/animation-old/animation-controller.js) content/inspector/animation-old/animation-panel.js (inspector/animation-old/animation-panel.js) content/inspector/animation-old/animation-inspector.xhtml (inspector/animation-old/animation-inspector.xhtml) content/sourceeditor/codemirror/addon/dialog/dialog.css (sourceeditor/codemirror/addon/dialog/dialog.css) content/sourceeditor/codemirror/addon/hint/show-hint.js (sourceeditor/codemirror/addon/hint/show-hint.js) content/sourceeditor/codemirror/addon/tern/tern.js (sourceeditor/codemirror/addon/tern/tern.js) content/sourceeditor/codemirror/codemirror.bundle.js (sourceeditor/codemirror/codemirror.bundle.js) @@ -58,17 +56,16 @@ devtools.jar: content/webaudioeditor/views/inspector.js (webaudioeditor/views/inspector.js) content/webaudioeditor/views/properties.js (webaudioeditor/views/properties.js) content/webaudioeditor/views/automation.js (webaudioeditor/views/automation.js) content/performance/index.xul (performance/index.xul) content/performance/performance-controller.js (performance/performance-controller.js) content/performance/performance-view.js (performance/performance-view.js) content/performance-new/index.xhtml (performance-new/index.xhtml) content/performance-new/frame-script.js (performance-new/frame-script.js) - content/performance-new/initializer.js (performance-new/initializer.js) content/performance/views/overview.js (performance/views/overview.js) content/performance/views/toolbar.js (performance/views/toolbar.js) content/performance/views/details.js (performance/views/details.js) content/performance/views/details-abstract-subview.js (performance/views/details-abstract-subview.js) content/performance/views/details-waterfall.js (performance/views/details-waterfall.js) content/performance/views/details-js-call-tree.js (performance/views/details-js-call-tree.js) content/performance/views/details-js-flamegraph.js (performance/views/details-js-flamegraph.js) content/performance/views/details-memory-call-tree.js (performance/views/details-memory-call-tree.js) @@ -87,19 +84,17 @@ devtools.jar: content/framework/connect/connect.css (framework/connect/connect.css) content/framework/connect/connect.js (framework/connect/connect.js) content/shared/widgets/graphs-frame.xhtml (shared/widgets/graphs-frame.xhtml) content/shared/widgets/cubic-bezier.css (shared/widgets/cubic-bezier.css) content/shared/widgets/filter-widget.css (shared/widgets/filter-widget.css) content/shared/widgets/spectrum.css (shared/widgets/spectrum.css) content/aboutdebugging/aboutdebugging.xhtml (aboutdebugging/aboutdebugging.xhtml) content/aboutdebugging/aboutdebugging.css (aboutdebugging/aboutdebugging.css) - content/aboutdebugging/initializer.js (aboutdebugging/initializer.js) content/responsive.html/index.xhtml (responsive.html/index.xhtml) - content/responsive.html/index.js (responsive.html/index.js) content/dom/index.html (dom/index.html) content/dom/main.js (dom/main.js) content/accessibility/index.html (accessibility/index.html) content/accessibility/main.js (accessibility/main.js) % skin devtools classic/1.0 %skin/ skin/devtools-browser.css (themes/devtools-browser.css) skin/dark-theme.css (themes/dark-theme.css) skin/light-theme.css (themes/light-theme.css) @@ -287,20 +282,18 @@ devtools.jar: content/netmonitor/src/assets/styles/RequestList.css (netmonitor/src/assets/styles/RequestList.css) content/netmonitor/src/assets/styles/StatisticsPanel.css (netmonitor/src/assets/styles/StatisticsPanel.css) content/netmonitor/src/assets/styles/StatusBar.css (netmonitor/src/assets/styles/StatusBar.css) content/netmonitor/src/assets/styles/Toolbar.css (netmonitor/src/assets/styles/Toolbar.css) content/netmonitor/src/assets/styles/variables.css (netmonitor/src/assets/styles/variables.css) content/netmonitor/src/assets/icons/play.svg (netmonitor/src/assets/icons/play.svg) content/netmonitor/src/assets/icons/drop-down.svg (netmonitor/src/assets/icons/drop-down.svg) content/netmonitor/index.html (netmonitor/index.html) - content/netmonitor/initializer.js (netmonitor/initializer.js) # Application panel content/application/index.html (application/index.html) - content/application/initializer.js (application/initializer.js) # Devtools-components skin/images/devtools-components/arrow.svg (themes/images/devtools-components/arrow.svg) # Devtools-reps skin/images/devtools-reps/jump-definition.svg (themes/images/devtools-reps/jump-definition.svg) skin/images/devtools-reps/open-inspector.svg (themes/images/devtools-reps/open-inspector.svg)
--- a/devtools/client/locales/en-US/font-inspector.properties +++ b/devtools/client/locales/en-US/font-inspector.properties @@ -50,8 +50,14 @@ fontinspector.fontSizeLabel=Size # LOCALIZATION NOTE (fontinspector.fontWeightLabel): This label is shown next to the UI # in the font editor which allows the user to change the font weight. fontinspector.fontWeightLabel=Weight # LOCALIZATION NOTE (fontinspector.fontItalicLabel): This label is shown next to the UI # in the font editor which allows the user to change the style of the font to italic. fontinspector.fontItalicLabel=Italic + +# # LOCALIZATION NOTE (fontinspector.familiesNotUsedLabel): Semi-colon list of +# plural forms. +# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals +# #1 is the number of unused font families +fontinspector.familiesNotUsedLabel=1 not used;#1 not used
--- a/devtools/client/netmonitor/index.html +++ b/devtools/client/netmonitor/index.html @@ -4,11 +4,11 @@ <!DOCTYPE html> <html dir=""> <head> <link rel="stylesheet" href="chrome://devtools/content/netmonitor/src/assets/styles/netmonitor.css"/> <script src="chrome://devtools/content/shared/theme-switching.js"></script> </head> <body class="theme-body" role="application"> <div id="mount"></div> - <script src="initializer.js"></script> + <script src="resource://devtools/client/netmonitor/initializer.js"></script> </body> </html>
--- a/devtools/client/netmonitor/moz.build +++ b/devtools/client/netmonitor/moz.build @@ -2,16 +2,17 @@ # 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/. DIRS += [ 'src' ] DevToolsModules( + 'initializer.js', 'panel.js' ) XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini'] BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] with Files('**'):
--- a/devtools/client/performance-new/index.xhtml +++ b/devtools/client/performance-new/index.xhtml @@ -11,15 +11,15 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <html xmlns="http://www.w3.org/1999/xhtml" dir=""> <head> <link rel="stylesheet" href="chrome://devtools/skin/widgets.css" type="text/css"/> <link rel="stylesheet" href="chrome://devtools/skin/perf.css" type="text/css"/> </head> <body class="theme-body"> <div id="root"></div> - <script type="application/javascript" src="initializer.js"></script> + <script type="application/javascript" src="resource://devtools/client/performance-new/initializer.js"></script> <script type="application/javascript" src="chrome://devtools/content/shared/theme-switching.js" defer="true"> </script> </body> </html>
--- a/devtools/client/performance-new/moz.build +++ b/devtools/client/performance-new/moz.build @@ -5,16 +5,17 @@ DIRS += [ 'components', 'store', ] DevToolsModules( 'browser.js', + 'initializer.js', 'panel.js', 'utils.js', ) MOCHITEST_CHROME_MANIFESTS += ['test/chrome/chrome.ini'] with Files('**'): BUG_COMPONENT = ('DevTools', 'Performance Tools (Profiler/Timeline)')
--- a/devtools/client/preferences/devtools-client.js +++ b/devtools/client/preferences/devtools-client.js @@ -56,22 +56,18 @@ pref("devtools.inspector.showUserAgentSt // Show all native anonymous content (like controls in <video> tags) pref("devtools.inspector.showAllAnonymousContent", false); // Enable the Flexbox highlighter pref("devtools.inspector.flexboxHighlighter.enabled", false); // Enable the CSS shapes highlighter pref("devtools.inspector.shapesHighlighter.enabled", true); // Enable the Flexbox Inspector panel pref("devtools.flexboxinspector.enabled", false); -// Enable the new Animation Inspector in Nightly only -#if defined(NIGHTLY_BUILD) +// Enable the new Animation Inspector pref("devtools.new-animationinspector.enabled", true); -#else -pref("devtools.new-animationinspector.enabled", false); -#endif // Enable the Variable Fonts editor pref("devtools.inspector.fonteditor.enabled", false); // Enable the font highlight-on-hover feature pref("devtools.inspector.fonthighlighter.enabled", false); // Grid highlighter preferences pref("devtools.gridinspector.gridOutlineMaxColumns", 50); pref("devtools.gridinspector.gridOutlineMaxRows", 50);
--- a/devtools/client/responsive.html/index.xhtml +++ b/devtools/client/responsive.html/index.xhtml @@ -6,14 +6,14 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" type="text/css" href="resource://devtools/client/responsive.html/index.css"/> <script type="application/javascript" src="chrome://devtools/content/shared/theme-switching.js"></script> <script type="application/javascript" - src="./index.js"></script> + src="resource://devtools/client/responsive.html/index.js"></script> </head> <body class="theme-body" role="application"> <div id="root"/> </body> </html>
--- a/devtools/client/responsive.html/moz.build +++ b/devtools/client/responsive.html/moz.build @@ -13,16 +13,17 @@ DIRS += [ 'utils', ] DevToolsModules( 'app.js', 'commands.js', 'constants.js', 'index.css', + 'index.js', 'manager.js', 'reducers.js', 'responsive-ua.css', 'store.js', 'types.js', ) XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
--- a/devtools/client/scratchpad/index.xul +++ b/devtools/client/scratchpad/index.xul @@ -24,17 +24,17 @@ fullscreenbutton="true" screenX="4" screenY="4" width="640" height="480" persist="screenX screenY width height sizemode"> <script type="application/javascript" src="chrome://devtools/content/shared/theme-switching.js"/> <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/> -<script type="application/javascript" src="chrome://devtools/content/scratchpad/scratchpad.js"/> +<script type="application/javascript" src="resource://devtools/client/scratchpad/scratchpad.js"/> #include ../../../toolkit/content/editMenuCommands.inc.xul <commandset id="sourceEditorCommands"> <command id="cmd_find" oncommand=";"/> <command id="cmd_findAgain" oncommand=";"/> <command id="cmd_gotoLine" oncommand=";"/> </commandset>
--- a/devtools/client/scratchpad/moz.build +++ b/devtools/client/scratchpad/moz.build @@ -1,16 +1,17 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- # vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. DevToolsModules( + 'panel.js', 'scratchpad-commands.js', 'scratchpad-manager.jsm', - 'scratchpad-panel.js', + 'scratchpad.js', ) BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] with Files('**'): BUG_COMPONENT = ('DevTools', 'Scratchpad')
rename from devtools/client/scratchpad/scratchpad-panel.js rename to devtools/client/scratchpad/panel.js
--- a/devtools/client/shared/theme-switching.js +++ b/devtools/client/shared/theme-switching.js @@ -84,32 +84,34 @@ const loadEvents = []; for (const url of newThemeDef.stylesheets) { const {styleSheet, loadPromise} = appendStyleSheet(document, url); devtoolsStyleSheets.get(newThemeDef).push(styleSheet); loadEvents.push(loadPromise); } - try { - const StylesheetUtils = require("devtools/shared/layout/utils"); - const SCROLLBARS_URL = "chrome://devtools/skin/floating-scrollbars-dark-theme.css"; - - // TODO: extensions might want to customize scrollbar styles too. - if (!Services.appShell.hiddenDOMWindow - .matchMedia("(-moz-overlay-scrollbars)").matches) { - if (newTheme == "dark") { - StylesheetUtils.loadSheet(window, SCROLLBARS_URL, "agent"); - } else if (oldTheme == "dark") { - StylesheetUtils.removeSheet(window, SCROLLBARS_URL, "agent"); + if (os !== "win") { + // Windows always uses native scrollbars, other platforms still use custom floating + // scrollbar implementation. + try { + const StylesheetUtils = require("devtools/shared/layout/utils"); + const SCROLLBARS_URL = "chrome://devtools/skin/floating-scrollbars-dark-theme.css"; + if (!Services.appShell.hiddenDOMWindow + .matchMedia("(-moz-overlay-scrollbars)").matches) { + if (newTheme == "dark") { + StylesheetUtils.loadSheet(window, SCROLLBARS_URL, "agent"); + } else if (oldTheme == "dark") { + StylesheetUtils.removeSheet(window, SCROLLBARS_URL, "agent"); + } + forceStyle(); } - forceStyle(); + } catch (e) { + console.warn("customize scrollbar styles is only supported in firefox"); } - } catch (e) { - console.warn("customize scrollbar styles is only supported in firefox"); } Promise.all(loadEvents).then(() => { // Unload all stylesheets and classes from the old theme. if (oldThemeDef) { for (const name of oldThemeDef.classList) { documentElement.classList.remove(name); }
--- a/devtools/client/styleeditor/moz.build +++ b/devtools/client/styleeditor/moz.build @@ -3,17 +3,17 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] DevToolsModules( 'original-source.js', + 'panel.js', 'styleeditor-commands.js', - 'styleeditor-panel.js', 'StyleEditorUI.jsm', 'StyleEditorUtil.jsm', 'StyleSheetEditor.jsm', ) with Files('**'): BUG_COMPONENT = ('DevTools', 'Style Editor')
rename from devtools/client/styleeditor/styleeditor-panel.js rename to devtools/client/styleeditor/panel.js
--- a/devtools/client/themes/dark-theme.css +++ b/devtools/client/themes/dark-theme.css @@ -22,16 +22,23 @@ body { color: var(--theme-toolbar-color); } ::-moz-selection { background-color: var(--theme-selection-background); color: var(--theme-selection-color); } +:root[platform="win"] { + /* Set colors for native scrollbars on Windows dark theme */ + /* Other platforms support for scrollbar theming is Bug 1460109 */ + scrollbar-face-color: var(--theme-body-color-inactive); + scrollbar-track-color: var(--theme-splitter-color); +} + .theme-selected, .CodeMirror-hint-active { background-color: var(--theme-selection-background); color: var(--theme-selection-color); } .theme-bg-contrast, .variable-or-property:not([overridden])[changed] {
--- a/devtools/client/themes/floating-scrollbars-dark-theme.css +++ b/devtools/client/themes/floating-scrollbars-dark-theme.css @@ -42,18 +42,14 @@ border-radius: 3px !important; } *|*:root[platform="mac"] > scrollbar slider, *|*:root[platform="mac"] *|*:not(html|select) > scrollbar slider { -moz-appearance: none !important; } -*|*:root[platform="win"] > scrollbar scrollbarbutton, *|*:root[platform="linux"] > scrollbar scrollbarbutton, -*|*:root[platform="win"] > scrollbar gripper, *|*:root[platform="linux"] > scrollbar gripper, -*|*:root[platform="win"] *|*:not(html|select) > scrollbar scrollbarbutton, *|*:root[platform="linux"] *|*:not(html|select) > scrollbar scrollbarbutton, -*|*:root[platform="win"] *|*:not(html|select) > scrollbar gripper, *|*:root[platform="linux"] *|*:not(html|select) > scrollbar gripper { display: none; }
--- a/devtools/client/themes/fonts.css +++ b/devtools/client/themes/fonts.css @@ -151,16 +151,27 @@ display: inline-block; flex: 1; font-size: 12px; min-width: 80px; margin-right: 10px; -moz-user-select: none; } +.font-family-unused-header { + -moz-user-select: none; + margin-bottom: .7em; + cursor: pointer; +} + +.font-family-unused { + margin-bottom: .3em; + color: var(--grey-50); +} + .font-instance-select:active{ outline: none; } .font-value-input { margin-left: 10px; width: 60px; }
--- a/devtools/server/actors/animation.js +++ b/devtools/server/actors/animation.js @@ -525,18 +525,18 @@ var AnimationPlayerActor = protocol.Acto // Calculate the distance. for (const property of properties) { const propertyName = property.name; const maxObject = { distance: -1 }; for (let i = 0; i < property.values.length - 1; i++) { const value1 = property.values[i].value; for (let j = i + 1; j < property.values.length; j++) { const value2 = property.values[j].value; - const distance = this.getDistance(this.player.effect.target, propertyName, - value1, value2, DOMWindowUtils); + const distance = + this.getDistance(this.node, propertyName, value1, value2, DOMWindowUtils); if (maxObject.distance >= distance) { continue; } maxObject.distance = distance; maxObject.value1 = value1; maxObject.value2 = value2; } } @@ -550,18 +550,18 @@ var AnimationPlayerActor = protocol.Acto return current; }, property.values[0]); continue; } const baseValue = maxObject.value1 < maxObject.value2 ? maxObject.value1 : maxObject.value2; for (const values of property.values) { const value = values.value; - const distance = this.getDistance(this.player.effect.target, propertyName, - baseValue, value, DOMWindowUtils); + const distance = + this.getDistance(this.node, propertyName, baseValue, value, DOMWindowUtils); values.distance = distance / maxObject.distance; } } return properties; }, /** * Get the animation types for a given list of CSS property names.
--- a/dom/payments/PaymentRequestManager.cpp +++ b/dom/payments/PaymentRequestManager.cpp @@ -473,23 +473,28 @@ PaymentRequestManager::AbortPayment(Paym // If aDeferredShow is true, then show was called with a promise that was // rejected. In that case, we need to remember that we called show earlier. return SendRequestPayment(aRequest, action, aDeferredShow); } nsresult PaymentRequestManager::CompletePayment(PaymentRequest* aRequest, - const PaymentComplete& aComplete) + const PaymentComplete& aComplete, + bool aTimedOut) { nsString completeStatusString(NS_LITERAL_STRING("unknown")); - uint8_t completeIndex = static_cast<uint8_t>(aComplete); - if (completeIndex < ArrayLength(PaymentCompleteValues::strings)) { - completeStatusString.AssignASCII( - PaymentCompleteValues::strings[completeIndex].value); + if (aTimedOut) { + completeStatusString.AssignLiteral("timeout"); + } else { + uint8_t completeIndex = static_cast<uint8_t>(aComplete); + if (completeIndex < ArrayLength(PaymentCompleteValues::strings)) { + completeStatusString.AssignASCII( + PaymentCompleteValues::strings[completeIndex].value); + } } nsAutoString requestId; aRequest->GetInternalId(requestId); IPCPaymentCompleteActionRequest action(requestId, completeStatusString); return SendRequestPayment(aRequest, action, false); }
--- a/dom/payments/PaymentRequestManager.h +++ b/dom/payments/PaymentRequestManager.h @@ -45,17 +45,18 @@ public: const PaymentDetailsInit& aDetails, const PaymentOptions& aOptions, PaymentRequest** aRequest); nsresult CanMakePayment(PaymentRequest* aRequest); nsresult ShowPayment(PaymentRequest* aRequest); nsresult AbortPayment(PaymentRequest* aRequest, bool aDeferredShow); nsresult CompletePayment(PaymentRequest* aRequest, - const PaymentComplete& aComplete); + const PaymentComplete& aComplete, + bool aTimedOut = false); nsresult UpdatePayment(JSContext* aCx, PaymentRequest* aRequest, const PaymentDetailsUpdate& aDetails, bool aRequestShipping, bool aDeferredShow); nsresult RespondPayment(PaymentRequest* aRequest, const IPCPaymentActionResponse& aResponse);
--- a/dom/payments/PaymentResponse.cpp +++ b/dom/payments/PaymentResponse.cpp @@ -1,14 +1,15 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "mozilla/StaticPrefs.h" #include "mozilla/dom/PaymentResponse.h" #include "mozilla/dom/BasicCardPaymentBinding.h" #include "BasicCardPayment.h" #include "PaymentAddress.h" #include "PaymentRequestUtils.h" namespace mozilla { namespace dom { @@ -17,16 +18,17 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Pa mShippingAddress, mPromise) NS_IMPL_CYCLE_COLLECTING_ADDREF(PaymentResponse) NS_IMPL_CYCLE_COLLECTING_RELEASE(PaymentResponse) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PaymentResponse) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRY(nsISupports) + NS_INTERFACE_MAP_ENTRY(nsITimerCallback) NS_INTERFACE_MAP_END PaymentResponse::PaymentResponse(nsPIDOMWindowInner* aWindow, PaymentRequest* aRequest, const nsAString& aRequestId, const nsAString& aMethodName, const nsAString& aShippingOption, RefPtr<PaymentAddress> aShippingAddress, @@ -44,16 +46,21 @@ PaymentResponse::PaymentResponse(nsPIDOM , mPayerName(aPayerName) , mPayerEmail(aPayerEmail) , mPayerPhone(aPayerPhone) , mShippingAddress(aShippingAddress) { // TODO: from https://github.com/w3c/browser-payment-api/issues/480 // Add payerGivenName + payerFamilyName to PaymentAddress + NS_NewTimerWithCallback(getter_AddRefs(mTimer), + this, + StaticPrefs::dom_payments_response_timeout(), + nsITimer::TYPE_ONE_SHOT, + aWindow->EventTargetFor(TaskCategory::Other)); } PaymentResponse::~PaymentResponse() { } JSObject* PaymentResponse::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) @@ -131,44 +138,68 @@ PaymentResponse::GetShippingAddress() co already_AddRefed<Promise> PaymentResponse::Complete(PaymentComplete result, ErrorResult& aRv) { if (mCompleteCalled) { aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return nullptr; } - nsIGlobalObject* global = mOwner->AsGlobal(); - ErrorResult errResult; - RefPtr<Promise> promise = Promise::Create(global, errResult); - if (errResult.Failed()) { - aRv.Throw(NS_ERROR_FAILURE); - return nullptr; + mCompleteCalled = true; + + if (mTimer) { + mTimer->Cancel(); + mTimer = nullptr; } - mCompleteCalled = true; - RefPtr<PaymentRequestManager> manager = PaymentRequestManager::GetSingleton(); if (NS_WARN_IF(!manager)) { aRv.Throw(NS_ERROR_FAILURE); return nullptr; } nsresult rv = manager->CompletePayment(mRequest, result); if (NS_WARN_IF(NS_FAILED(rv))) { - promise->MaybeReject(NS_ERROR_FAILURE); - return promise.forget(); + aRv.Throw(NS_ERROR_FAILURE); + return nullptr; + } + + nsIGlobalObject* global = mOwner->AsGlobal(); + ErrorResult errResult; + RefPtr<Promise> promise = Promise::Create(global, errResult); + if (errResult.Failed()) { + aRv.Throw(NS_ERROR_FAILURE); + return nullptr; } mPromise = promise; return promise.forget(); } void PaymentResponse::RespondComplete() { - MOZ_ASSERT(mPromise); + // mPromise may be null when timing out + if (mPromise) { + mPromise->MaybeResolve(JS::UndefinedHandleValue); + mPromise = nullptr; + } +} - mPromise->MaybeResolve(JS::UndefinedHandleValue); - mPromise = nullptr; +NS_IMETHODIMP +PaymentResponse::Notify(nsITimer *timer) +{ + mTimer = nullptr; + if (mCompleteCalled) { + return NS_OK; + } + + mCompleteCalled = true; + + RefPtr<PaymentRequestManager> manager = PaymentRequestManager::GetSingleton(); + if (NS_WARN_IF(!manager)) { + return NS_ERROR_FAILURE; + } + + return manager->CompletePayment(mRequest, PaymentComplete::Unknown, true); } } // namespace dom } // namespace mozilla
--- a/dom/payments/PaymentResponse.h +++ b/dom/payments/PaymentResponse.h @@ -5,31 +5,34 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef mozilla_dom_PaymentResponse_h #define mozilla_dom_PaymentResponse_h #include "mozilla/dom/PaymentResponseBinding.h" // PaymentComplete #include "nsPIDOMWindow.h" #include "nsWrapperCache.h" +#include "nsITimer.h" namespace mozilla { namespace dom { class PaymentAddress; class PaymentRequest; class Promise; -class PaymentResponse final : public nsISupports, +class PaymentResponse final : public nsITimerCallback, public nsWrapperCache { public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaymentResponse) + NS_IMETHOD Notify(nsITimer* aTimer) override; + PaymentResponse(nsPIDOMWindowInner* aWindow, PaymentRequest* aRequest, const nsAString& aRequestId, const nsAString& aMethodName, const nsAString& aShippingOption, RefPtr<PaymentAddress> aShippingAddress, const nsAString& aDetails, const nsAString& aPayerName, @@ -78,14 +81,17 @@ private: nsString mDetails; nsString mShippingOption; nsString mPayerName; nsString mPayerEmail; nsString mPayerPhone; RefPtr<PaymentAddress> mShippingAddress; // Promise for "PaymentResponse::Complete" RefPtr<Promise> mPromise; + // Timer for timing out if the page doesn't call + // complete() + nsCOMPtr<nsITimer> mTimer; }; } // namespace dom } // namespace mozilla #endif // mozilla_dom_PaymentResponse_h
--- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -379,35 +379,32 @@ nsImageFrame::GetSourceToDestTransform(n nsRect destRect = nsLayoutUtils::ComputeObjectDestRect(constraintRect, mIntrinsicSize, mIntrinsicRatio, StylePosition()); // Set the translation components, based on destRect // XXXbz does this introduce rounding errors because of the cast to // float? Should we just manually add that stuff in every time // instead? - aTransform.SetToTranslate(float(destRect.x), - float(destRect.y)); + aTransform.SetToTranslate(float(destRect.x), float(destRect.y)); + - // Set the scale factors, based on destRect and intrinsic size. - if (mIntrinsicSize.width.GetUnit() == eStyleUnit_Coord && - mIntrinsicSize.width.GetCoordValue() != 0 && - mIntrinsicSize.height.GetUnit() == eStyleUnit_Coord && - mIntrinsicSize.height.GetCoordValue() != 0 && - mIntrinsicSize.width.GetCoordValue() != destRect.width && - mIntrinsicSize.height.GetCoordValue() != destRect.height) { - - aTransform.SetScale(float(destRect.width) / - float(mIntrinsicSize.width.GetCoordValue()), - float(destRect.height) / - float(mIntrinsicSize.height.GetCoordValue())); - return true; + // NOTE(emilio): This intrinsicSize is not the same as the layout intrinsic + // size (mIntrinsicSize), which can be scaled due to ResponsiveImageSelector, + // see ScaleIntrinsicSizeForDensity. + nsSize intrinsicSize; + if (!mImage || + !NS_SUCCEEDED(mImage->GetIntrinsicSize(&intrinsicSize)) || + intrinsicSize.IsEmpty()) { + return false; } - return false; + aTransform.SetScale(float(destRect.width) / float(intrinsicSize.width), + float(destRect.height) / float(intrinsicSize.height)); + return true; } // This function checks whether the given request is the current request for our // mContent. bool nsImageFrame::IsPendingLoad(imgIRequest* aRequest) const { // Default to pending load in case of errors
--- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -340,17 +340,17 @@ enum class StyleBorderImageRepeat : uint enum class StyleContent : uint8_t { OpenQuote, CloseQuote, NoOpenQuote, NoCloseQuote, AltContent }; -// See nsStyleColor +// See nsStyleUserInterface #define NS_STYLE_CURSOR_AUTO 1 #define NS_STYLE_CURSOR_CROSSHAIR 2 #define NS_STYLE_CURSOR_DEFAULT 3 // ie: an arrow #define NS_STYLE_CURSOR_POINTER 4 // for links #define NS_STYLE_CURSOR_MOVE 5 #define NS_STYLE_CURSOR_E_RESIZE 6 #define NS_STYLE_CURSOR_NE_RESIZE 7 #define NS_STYLE_CURSOR_NW_RESIZE 8 @@ -686,17 +686,17 @@ enum class StyleGridTrackBreadth : uint8 #define NS_STYLE_FRAME_0 2 #define NS_STYLE_FRAME_1 3 #define NS_STYLE_FRAME_ON 4 #define NS_STYLE_FRAME_OFF 5 #define NS_STYLE_FRAME_AUTO 6 #define NS_STYLE_FRAME_SCROLL 7 #define NS_STYLE_FRAME_NOSCROLL 8 -// See nsStyleDisplay.mOverflow +// See nsStyleDisplay.mOverflow{X,Y} #define NS_STYLE_OVERFLOW_VISIBLE 0 #define NS_STYLE_OVERFLOW_HIDDEN 1 #define NS_STYLE_OVERFLOW_SCROLL 2 #define NS_STYLE_OVERFLOW_AUTO 3 #define NS_STYLE_OVERFLOW_CLIP 4 #define NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL 5 #define NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL 6 @@ -1095,17 +1095,17 @@ enum class StyleWhiteSpace : uint8_t { #define NS_STYLE_TEXT_EMPHASIS_STYLE_STRING 255 // text-rendering #define NS_STYLE_TEXT_RENDERING_AUTO 0 #define NS_STYLE_TEXT_RENDERING_OPTIMIZESPEED 1 #define NS_STYLE_TEXT_RENDERING_OPTIMIZELEGIBILITY 2 #define NS_STYLE_TEXT_RENDERING_GEOMETRICPRECISION 3 -// adjust-color +// color-adjust #define NS_STYLE_COLOR_ADJUST_ECONOMY 0 #define NS_STYLE_COLOR_ADJUST_EXACT 1 // color-interpolation and color-interpolation-filters #define NS_STYLE_COLOR_INTERPOLATION_AUTO 0 #define NS_STYLE_COLOR_INTERPOLATION_SRGB 1 #define NS_STYLE_COLOR_INTERPOLATION_LINEARRGB 2
--- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -111,56 +111,56 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt * aSize is allowed to be negative, but the caller is expected to deal with * negative results. The result is clamped to nscoord_MIN .. nscoord_MAX. */ static nscoord UnZoomText(nsPresContext* aPresContext, nscoord aSize); static already_AddRefed<nsAtom> GetLanguage(const nsPresContext* aPresContext); void EnableZoom(nsPresContext* aContext, bool aEnable); - nsFont mFont; // [inherited] - nscoord mSize; // [inherited] Our "computed size". Can be different + nsFont mFont; + nscoord mSize; // Our "computed size". Can be different // from mFont.size which is our "actual size" and is // enforced to be >= the user's preferred min-size. // mFont.size should be used for display purposes // while mSize is the value to return in // getComputedStyle() for example. // In stylo these three track whether the size is keyword-derived // and if so if it has been modified by a factor/offset float mFontSizeFactor; nscoord mFontSizeOffset; uint8_t mFontSizeKeyword; // NS_STYLE_FONT_SIZE_*, is NS_STYLE_FONT_SIZE_NO_KEYWORD // when not keyword-derived - uint8_t mGenericID; // [inherited] generic CSS font family, if any; + uint8_t mGenericID; // generic CSS font family, if any; // value is a kGenericFont_* constant, see nsFont.h. // MathML scriptlevel support - int8_t mScriptLevel; // [inherited] + int8_t mScriptLevel; // MathML mathvariant support - uint8_t mMathVariant; // [inherited] + uint8_t mMathVariant; // MathML displaystyle support - uint8_t mMathDisplay; // [inherited] + uint8_t mMathDisplay; // allow different min font-size for certain cases - uint8_t mMinFontSizeRatio; // [inherited] percent * 100 + uint8_t mMinFontSizeRatio; // percent * 100 // was mLanguage set based on a lang attribute in the document? - bool mExplicitLanguage; // [inherited] + bool mExplicitLanguage; // should calls to ZoomText() and UnZoomText() be made to the font // size on this nsStyleFont? - bool mAllowZoom; // [inherited] + bool mAllowZoom; // The value mSize would have had if scriptminsize had never been applied nscoord mScriptUnconstrainedSize; - nscoord mScriptMinSize; // [inherited] length - float mScriptSizeMultiplier; // [inherited] - RefPtr<nsAtom> mLanguage; // [inherited] + nscoord mScriptMinSize; // length + float mScriptSizeMultiplier; + RefPtr<nsAtom> mLanguage; }; struct nsStyleGradientStop { nsStyleCoord mLocation; // percent, coord, calc, none mozilla::StyleComplexColor mColor; bool mIsInterpolationHint; @@ -503,17 +503,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt } void FinishStyle(nsPresContext*, const nsStyleColor*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleColor& aNewData) const; // Don't add ANY members to this struct! We can achieve caching in the rule // tree (rather than the style tree) by letting color stay by itself! -dwh - nscolor mColor; // [inherited] + nscolor mColor; }; struct nsStyleImageLayers { // Indices into kBackgroundLayerTable and kMaskLayerTable enum { shorthand = 0, color, image, @@ -632,48 +632,46 @@ struct nsStyleImageLayers { return !(*this == aOther); } }; struct Layer { typedef mozilla::StyleGeometryBox StyleGeometryBox; typedef mozilla::StyleImageLayerAttachment StyleImageLayerAttachment; - nsStyleImage mImage; // [reset] - mozilla::Position mPosition; // [reset] - Size mSize; // [reset] - StyleGeometryBox mClip; // [reset] See nsStyleConsts.h - MOZ_INIT_OUTSIDE_CTOR - StyleGeometryBox mOrigin; // [reset] See nsStyleConsts.h + nsStyleImage mImage; + mozilla::Position mPosition; + Size mSize; + StyleGeometryBox mClip; + MOZ_INIT_OUTSIDE_CTOR StyleGeometryBox mOrigin; StyleImageLayerAttachment mAttachment; - // [reset] See nsStyleConsts.h // background-only property // This property is used for background layer // only. For a mask layer, it should always // be the initial value, which is // StyleImageLayerAttachment::Scroll. - uint8_t mBlendMode; // [reset] See nsStyleConsts.h + uint8_t mBlendMode; // NS_STYLE_BLEND_* // background-only property // This property is used for background layer // only. For a mask layer, it should always // be the initial value, which is // NS_STYLE_BLEND_NORMAL. - uint8_t mComposite; // [reset] See nsStyleConsts.h + uint8_t mComposite; // NS_STYLE_MASK_COMPOSITE_* // mask-only property // This property is used for mask layer only. // For a background layer, it should always // be the initial value, which is // NS_STYLE_COMPOSITE_MODE_ADD. - uint8_t mMaskMode; // [reset] See nsStyleConsts.h + uint8_t mMaskMode; // NS_STYLE_MASK_MODE_* // mask-only property // This property is used for mask layer only. // For a background layer, it should always // be the initial value, which is // NS_STYLE_MASK_MODE_MATCH_SOURCE. - Repeat mRepeat; // [reset] See nsStyleConsts.h + Repeat mRepeat; // This constructor does not initialize mRepeat or mOrigin and Initialize() // must be called to do that. Layer(); ~Layer(); // Initialize mRepeat and mOrigin by specified layer type void Initialize(LayerType aType); @@ -789,17 +787,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt // Checks to see if this has a non-empty image with "local" attachment. // This is defined in nsStyleStructInlines.h. inline bool HasLocalBackground() const; const nsStyleImageLayers::Layer& BottomLayer() const { return mImage.BottomLayer(); } nsStyleImageLayers mImage; - mozilla::StyleComplexColor mBackgroundColor; // [reset] + mozilla::StyleComplexColor mBackgroundColor; }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleMargin { explicit nsStyleMargin(const nsPresContext* aContext); nsStyleMargin(const nsStyleMargin& aMargin); ~nsStyleMargin() { MOZ_COUNT_DTOR(nsStyleMargin); @@ -821,32 +819,32 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt return true; } // Return true if either the start or end side in the axis is 'auto'. // (defined in WritingModes.h since we need the full WritingMode type) inline bool HasBlockAxisAuto(mozilla::WritingMode aWM) const; inline bool HasInlineAxisAuto(mozilla::WritingMode aWM) const; - nsStyleSides mMargin; // [reset] coord, percent, calc, auto + nsStyleSides mMargin; // coord, percent, calc, auto }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePadding { explicit nsStylePadding(const nsPresContext* aContext); nsStylePadding(const nsStylePadding& aPadding); ~nsStylePadding() { MOZ_COUNT_DTOR(nsStylePadding); } void FinishStyle(nsPresContext*, const nsStylePadding*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStylePadding& aNewData) const; - nsStyleSides mPadding; // [reset] coord, percent, calc + nsStyleSides mPadding; // coord, percent, calc bool IsWidthDependent() const { return !mPadding.ConvertsToLength(); } bool GetPadding(nsMargin& aPadding) const { if (!mPadding.ConvertsToLength()) { @@ -1074,33 +1072,33 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt { if (mBorderImageSource.GetType() == eStyleImageType_Image) { return mBorderImageSource.GetImageData(); } return nullptr; } public: - nsStyleCorners mBorderRadius; // [reset] coord, percent - nsStyleImage mBorderImageSource; // [reset] - nsStyleSides mBorderImageSlice; // [reset] factor, percent - nsStyleSides mBorderImageWidth; // [reset] length, factor, percent, auto - nsStyleSides mBorderImageOutset; // [reset] length, factor - - uint8_t mBorderImageFill; // [reset] - mozilla::StyleBorderImageRepeat mBorderImageRepeatH; // [reset] - mozilla::StyleBorderImageRepeat mBorderImageRepeatV; // [reset] - mozilla::StyleFloatEdge mFloatEdge; // [reset] - mozilla::StyleBoxDecorationBreak mBoxDecorationBreak; // [reset] + nsStyleCorners mBorderRadius; // coord, percent + nsStyleImage mBorderImageSource; + nsStyleSides mBorderImageSlice; // factor, percent + nsStyleSides mBorderImageWidth; // length, factor, percent, auto + nsStyleSides mBorderImageOutset; // length, factor + + uint8_t mBorderImageFill; + mozilla::StyleBorderImageRepeat mBorderImageRepeatH; + mozilla::StyleBorderImageRepeat mBorderImageRepeatV; + mozilla::StyleFloatEdge mFloatEdge; + mozilla::StyleBoxDecorationBreak mBoxDecorationBreak; protected: - uint8_t mBorderStyle[4]; // [reset] See nsStyleConsts.h + uint8_t mBorderStyle[4]; // NS_STYLE_BORDER_STYLE_* public: - // [reset] the colors to use for a simple border. + // the colors to use for a simple border. // not used for -moz-border-colors mozilla::StyleComplexColor mBorderTopColor; mozilla::StyleComplexColor mBorderRightColor; mozilla::StyleComplexColor mBorderBottomColor; mozilla::StyleComplexColor mBorderLeftColor; mozilla::StyleComplexColor& BorderColorFor(mozilla::Side aSide) { @@ -1178,27 +1176,27 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt MOZ_COUNT_DTOR(nsStyleOutline); } void FinishStyle(nsPresContext*, const nsStyleOutline*) {} const static bool kHasFinishStyle = false; void RecalcData(); nsChangeHint CalcDifference(const nsStyleOutline& aNewData) const; - nsStyleCorners mOutlineRadius; // [reset] coord, percent, calc + nsStyleCorners mOutlineRadius; // coord, percent, calc // This is the specified value of outline-width, but with length values // computed to absolute. mActualOutlineWidth stores the outline-width // value used by layout. (We must store mOutlineWidth for the same // style struct resolution reasons that we do nsStyleBorder::mBorder; // see that field's comment.) - nscoord mOutlineWidth; // [reset] coord, enum (see nsStyleConsts.h) - nscoord mOutlineOffset; // [reset] - mozilla::StyleComplexColor mOutlineColor; // [reset] - uint8_t mOutlineStyle; // [reset] See nsStyleConsts.h + nscoord mOutlineWidth; + nscoord mOutlineOffset; + mozilla::StyleComplexColor mOutlineColor; + uint8_t mOutlineStyle; // NS_STYLE_BORDER_STYLE_* nscoord GetOutlineWidth() const { return mActualOutlineWidth; } bool ShouldPaintOutline() const { @@ -1258,26 +1256,26 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt const nsStyleQuoteValues::QuotePairArray& GetQuotePairs() const; void SetQuotesInherit(const nsStyleList* aOther); void SetQuotesInitial(); void SetQuotesNone(); void SetQuotes(nsStyleQuoteValues::QuotePairArray&& aValues); - uint8_t mListStylePosition; // [inherited] - RefPtr<nsStyleImageRequest> mListStyleImage; // [inherited] - - mozilla::CounterStylePtr mCounterStyle; // [inherited] + uint8_t mListStylePosition; + RefPtr<nsStyleImageRequest> mListStyleImage; + + mozilla::CounterStylePtr mCounterStyle; private: - RefPtr<nsStyleQuoteValues> mQuotes; // [inherited] + RefPtr<nsStyleQuoteValues> mQuotes; nsStyleList& operator=(const nsStyleList& aOther) = delete; public: - nsRect mImageRegion; // [inherited] the rect to use within an image + nsRect mImageRegion; // the rect to use within an image private: // nsStyleQuoteValues objects representing two common values, for sharing. static mozilla::StaticRefPtr<nsStyleQuoteValues> sInitialQuotes; static mozilla::StaticRefPtr<nsStyleQuoteValues> sNoneQuotes; }; struct nsStyleGridLine @@ -1442,67 +1440,68 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt uint8_t UsedAlignSelf(mozilla::ComputedStyle* aParent) const; /** * Return the used value for 'justify-self' given our parent ComputedStyle * aParent (or null for the root). */ uint8_t UsedJustifySelf(mozilla::ComputedStyle* aParent) const; - mozilla::Position mObjectPosition; // [reset] - nsStyleSides mOffset; // [reset] coord, percent, calc, auto - nsStyleCoord mWidth; // [reset] coord, percent, enum, calc, auto - nsStyleCoord mMinWidth; // [reset] coord, percent, enum, calc - nsStyleCoord mMaxWidth; // [reset] coord, percent, enum, calc, none - nsStyleCoord mHeight; // [reset] coord, percent, calc, auto - nsStyleCoord mMinHeight; // [reset] coord, percent, calc - nsStyleCoord mMaxHeight; // [reset] coord, percent, calc, none - nsStyleCoord mFlexBasis; // [reset] coord, percent, enum, calc, auto - nsStyleCoord mGridAutoColumnsMin; // [reset] coord, percent, enum, calc, flex - nsStyleCoord mGridAutoColumnsMax; // [reset] coord, percent, enum, calc, flex - nsStyleCoord mGridAutoRowsMin; // [reset] coord, percent, enum, calc, flex - nsStyleCoord mGridAutoRowsMax; // [reset] coord, percent, enum, calc, flex - uint8_t mGridAutoFlow; // [reset] enumerated. See nsStyleConsts.h - mozilla::StyleBoxSizing mBoxSizing; // [reset] see nsStyleConsts.h - - uint16_t mAlignContent; // [reset] fallback value in the high byte - uint8_t mAlignItems; // [reset] see nsStyleConsts.h - uint8_t mAlignSelf; // [reset] see nsStyleConsts.h - uint16_t mJustifyContent; // [reset] fallback value in the high byte + mozilla::Position mObjectPosition; + nsStyleSides mOffset; // coord, percent, calc, auto + nsStyleCoord mWidth; // coord, percent, enum, calc, auto + nsStyleCoord mMinWidth; // coord, percent, enum, calc + nsStyleCoord mMaxWidth; // coord, percent, enum, calc, none + nsStyleCoord mHeight; // coord, percent, calc, auto + nsStyleCoord mMinHeight; // coord, percent, calc + nsStyleCoord mMaxHeight; // coord, percent, calc, none + nsStyleCoord mFlexBasis; // coord, percent, enum, calc, auto + nsStyleCoord mGridAutoColumnsMin; // coord, percent, enum, calc, flex + nsStyleCoord mGridAutoColumnsMax; // coord, percent, enum, calc, flex + nsStyleCoord mGridAutoRowsMin; // coord, percent, enum, calc, flex + nsStyleCoord mGridAutoRowsMax; // coord, percent, enum, calc, flex + uint8_t mGridAutoFlow; // NS_STYLE_GRID_AUTO_FLOW_* + mozilla::StyleBoxSizing mBoxSizing; + + // All align/justify properties here take NS_STYLE_ALIGN_* values. + uint16_t mAlignContent; // fallback value in the high byte + uint8_t mAlignItems; + uint8_t mAlignSelf; + uint16_t mJustifyContent; // fallback value in the high byte // We cascade mSpecifiedJustifyItems, to handle the auto value, but store the // computed value in mJustifyItems. // // They're effectively only different in this regard: mJustifyItems is set to // mSpecifiedJustifyItems, except when the latter is AUTO -- in that case, // mJustifyItems is set to NORMAL, or to the parent ComputedStyle's // mJustifyItems if it has the legacy flag. // // This last part happens in ComputedStyle::ApplyStyleFixups. - uint8_t mSpecifiedJustifyItems; // [reset] see nsStyleConsts.h - uint8_t mJustifyItems; // [reset] see nsStyleConsts.h - uint8_t mJustifySelf; // [reset] see nsStyleConsts.h - uint8_t mFlexDirection; // [reset] see nsStyleConsts.h - uint8_t mFlexWrap; // [reset] see nsStyleConsts.h - uint8_t mObjectFit; // [reset] see nsStyleConsts.h - int32_t mOrder; // [reset] integer - float mFlexGrow; // [reset] float - float mFlexShrink; // [reset] float - nsStyleCoord mZIndex; // [reset] integer, auto + uint8_t mSpecifiedJustifyItems; + uint8_t mJustifyItems; + uint8_t mJustifySelf; + uint8_t mFlexDirection; // NS_STYLE_FLEX_DIRECTION_* + uint8_t mFlexWrap; // NS_STYLE_FLEX_WRAP_* + uint8_t mObjectFit; // NS_STYLE_OBJECT_FIT_* + int32_t mOrder; + float mFlexGrow; + float mFlexShrink; + nsStyleCoord mZIndex; // integer, auto mozilla::UniquePtr<nsStyleGridTemplate> mGridTemplateColumns; mozilla::UniquePtr<nsStyleGridTemplate> mGridTemplateRows; // nullptr for 'none' RefPtr<mozilla::css::GridTemplateAreasValue> mGridTemplateAreas; nsStyleGridLine mGridColumnStart; nsStyleGridLine mGridColumnEnd; nsStyleGridLine mGridRowStart; nsStyleGridLine mGridRowEnd; - nsStyleCoord mColumnGap; // [reset] normal, coord, percent, calc - nsStyleCoord mRowGap; // [reset] normal, coord, percent, calc + nsStyleCoord mColumnGap; // normal, coord, percent, calc + nsStyleCoord mRowGap; // normal, coord, percent, calc // FIXME: Logical-coordinate equivalents to these WidthDepends... and // HeightDepends... methods have been introduced (see below); we probably // want to work towards removing the physical methods, and using the logical // ones in all cases. bool WidthDependsOnContainer() const { @@ -1650,68 +1649,68 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt // ComputedStyle::HasTextDecorationLines. bool HasTextDecorationLines() const { return mTextDecorationLine != NS_STYLE_TEXT_DECORATION_LINE_NONE && mTextDecorationLine != NS_STYLE_TEXT_DECORATION_LINE_OVERRIDE_ALL; } nsChangeHint CalcDifference(const nsStyleTextReset& aNewData) const; - nsStyleTextOverflow mTextOverflow; // [reset] enum, string - - uint8_t mTextDecorationLine; // [reset] see nsStyleConsts.h - uint8_t mTextDecorationStyle; // [reset] see nsStyleConsts.h - uint8_t mUnicodeBidi; // [reset] see nsStyleConsts.h - nscoord mInitialLetterSink; // [reset] 0 means normal - float mInitialLetterSize; // [reset] 0.0f means normal - mozilla::StyleComplexColor mTextDecorationColor; // [reset] + nsStyleTextOverflow mTextOverflow; // enum, string + + uint8_t mTextDecorationLine; // NS_STYLE_TEXT_DECORATION_LINE_* + uint8_t mTextDecorationStyle; // NS_STYLE_TEXT_DECORATION_STYLE_* + uint8_t mUnicodeBidi; // NS_STYLE_UNICODE_BIDI_* + nscoord mInitialLetterSink; // 0 means normal + float mInitialLetterSize; // 0.0f means normal + mozilla::StyleComplexColor mTextDecorationColor; }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText { explicit nsStyleText(const nsPresContext* aContext); nsStyleText(const nsStyleText& aOther); ~nsStyleText(); void FinishStyle(nsPresContext*, const nsStyleText*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleText& aNewData) const; - uint8_t mTextAlign; // [inherited] see nsStyleConsts.h - uint8_t mTextAlignLast; // [inherited] see nsStyleConsts.h - bool mTextAlignTrue : 1; // [inherited] see nsStyleConsts.h - bool mTextAlignLastTrue : 1; // [inherited] see nsStyleConsts.h - mozilla::StyleTextJustify mTextJustify; // [inherited] - uint8_t mTextTransform; // [inherited] see nsStyleConsts.h - mozilla::StyleWhiteSpace mWhiteSpace; // [inherited] see nsStyleConsts.h - uint8_t mWordBreak; // [inherited] see nsStyleConsts.h - uint8_t mOverflowWrap; // [inherited] see nsStyleConsts.h - mozilla::StyleHyphens mHyphens; // [inherited] see nsStyleConsts.h - uint8_t mRubyAlign; // [inherited] see nsStyleConsts.h - uint8_t mRubyPosition; // [inherited] see nsStyleConsts.h - uint8_t mTextSizeAdjust; // [inherited] see nsStyleConsts.h - uint8_t mTextCombineUpright; // [inherited] see nsStyleConsts.h - uint8_t mControlCharacterVisibility; // [inherited] see nsStyleConsts.h - uint8_t mTextEmphasisPosition; // [inherited] see nsStyleConsts.h - uint8_t mTextEmphasisStyle; // [inherited] see nsStyleConsts.h - uint8_t mTextRendering; // [inherited] see nsStyleConsts.h - mozilla::StyleComplexColor mTextEmphasisColor; // [inherited] - mozilla::StyleComplexColor mWebkitTextFillColor; // [inherited] - mozilla::StyleComplexColor mWebkitTextStrokeColor; // [inherited] - - nsStyleCoord mTabSize; // [inherited] coord, factor, calc - nsStyleCoord mWordSpacing; // [inherited] coord, percent, calc - nsStyleCoord mLetterSpacing; // [inherited] coord, normal - nsStyleCoord mLineHeight; // [inherited] coord, factor, normal - nsStyleCoord mTextIndent; // [inherited] coord, percent, calc - nscoord mWebkitTextStrokeWidth; // [inherited] coord - - RefPtr<nsCSSShadowArray> mTextShadow; // [inherited] nullptr in case of a zero-length - - nsString mTextEmphasisStyleString; // [inherited] + uint8_t mTextAlign; // NS_STYLE_TEXT_ALIGN_* + uint8_t mTextAlignLast; // NS_STYLE_TEXT_ALIGN_* + bool mTextAlignTrue : 1; + bool mTextAlignLastTrue : 1; + mozilla::StyleTextJustify mTextJustify; + uint8_t mTextTransform; // NS_STYLE_TEXT_TRANSFORM_* + mozilla::StyleWhiteSpace mWhiteSpace; + uint8_t mWordBreak; // NS_STYLE_WORDBREAK_* + uint8_t mOverflowWrap; // NS_STYLE_OVERFLOWWRAP_* + mozilla::StyleHyphens mHyphens; + uint8_t mRubyAlign; // NS_STYLE_RUBY_ALIGN_* + uint8_t mRubyPosition; // NS_STYLE_RUBY_POSITION_* + uint8_t mTextSizeAdjust; // NS_STYLE_TEXT_SIZE_ADJUST_* + uint8_t mTextCombineUpright; // NS_STYLE_TEXT_COMBINE_UPRIGHT_* + uint8_t mControlCharacterVisibility; // NS_STYLE_CONTROL_CHARACTER_VISIBILITY_* + uint8_t mTextEmphasisPosition; // NS_STYLE_TEXT_EMPHASIS_POSITION_* + uint8_t mTextEmphasisStyle; // NS_STYLE_TEXT_EMPHASIS_STYLE_* + uint8_t mTextRendering; // NS_STYLE_TEXT_RENDERING_* + mozilla::StyleComplexColor mTextEmphasisColor; + mozilla::StyleComplexColor mWebkitTextFillColor; + mozilla::StyleComplexColor mWebkitTextStrokeColor; + + nsStyleCoord mTabSize; // coord, factor, calc + nsStyleCoord mWordSpacing; // coord, percent, calc + nsStyleCoord mLetterSpacing; // coord, normal + nsStyleCoord mLineHeight; // coord, factor, normal + nsStyleCoord mTextIndent; // coord, percent, calc + nscoord mWebkitTextStrokeWidth; // coord + + RefPtr<nsCSSShadowArray> mTextShadow; // nullptr in case of a zero-length + + nsString mTextEmphasisStyleString; bool WhiteSpaceIsSignificant() const { return mWhiteSpace == mozilla::StyleWhiteSpace::Pre || mWhiteSpace == mozilla::StyleWhiteSpace::PreWrap || mWhiteSpace == mozilla::StyleWhiteSpace::PreSpace; } bool NewlineIsSignificantStyle() const { @@ -1879,23 +1878,23 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt ~nsStyleVisibility() { MOZ_COUNT_DTOR(nsStyleVisibility); } void FinishStyle(nsPresContext*, const nsStyleVisibility*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleVisibility& aNewData) const; - nsStyleImageOrientation mImageOrientation; // [inherited] - uint8_t mDirection; // [inherited] see nsStyleConsts.h NS_STYLE_DIRECTION_* - uint8_t mVisible; // [inherited] - uint8_t mImageRendering; // [inherited] see nsStyleConsts.h - uint8_t mWritingMode; // [inherited] see nsStyleConsts.h - uint8_t mTextOrientation; // [inherited] see nsStyleConsts.h - uint8_t mColorAdjust; // [inherited] see nsStyleConsts.h + nsStyleImageOrientation mImageOrientation; + uint8_t mDirection; // NS_STYLE_DIRECTION_* + uint8_t mVisible; // NS_STYLE_VISIBILITY_VISIBLE_* + uint8_t mImageRendering; // NS_STYLE_IMAGE_RENDERING_* + uint8_t mWritingMode; // NS_STYLE_WRITING_MODE_* + uint8_t mTextOrientation; // NS_STYLE_TEXT_ORIENTATION_MIXED_* + uint8_t mColorAdjust; // NS_STYLE_COLOR_ADJUST_ECONOMY_* bool IsVisible() const { return (mVisible == NS_STYLE_VISIBILITY_VISIBLE); } bool IsVisibleOrCollapsed() const { return ((mVisible == NS_STYLE_VISIBILITY_VISIBLE) || (mVisible == NS_STYLE_VISIBILITY_COLLAPSE)); @@ -2167,88 +2166,87 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt void FinishStyle(nsPresContext*, const nsStyleDisplay*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleDisplay& aNewData) const; // We guarantee that if mBinding is non-null, so are mBinding->GetURI() and // mBinding->mOriginPrincipal. - RefPtr<mozilla::css::URLValue> mBinding; // [reset] - mozilla::StyleDisplay mDisplay; // [reset] see nsStyleConsts.h StyleDisplay - mozilla::StyleDisplay mOriginalDisplay; // [reset] saved mDisplay for + RefPtr<mozilla::css::URLValue> mBinding; + mozilla::StyleDisplay mDisplay; + mozilla::StyleDisplay mOriginalDisplay; // saved mDisplay for // position:absolute/fixed // and float:left/right; // otherwise equal to // mDisplay - uint8_t mContain; // [reset] see nsStyleConsts.h NS_STYLE_CONTAIN_* - uint8_t mAppearance; // [reset] - uint8_t mPosition; // [reset] see nsStyleConsts.h - - // [reset] See StyleFloat in nsStyleConsts.h. + uint8_t mContain; // NS_STYLE_CONTAIN_* + uint8_t mAppearance; // NS_THEME_* + uint8_t mPosition; // NS_STYLE_POSITION_* + mozilla::StyleFloat mFloat; - // [reset] Save mFloat for position:absolute/fixed; otherwise equal to mFloat. + // Save mFloat for position:absolute/fixed; otherwise equal to mFloat. mozilla::StyleFloat mOriginalFloat; - mozilla::StyleClear mBreakType; // [reset] - uint8_t mBreakInside; // [reset] NS_STYLE_PAGE_BREAK_AUTO/AVOID - bool mBreakBefore; // [reset] - bool mBreakAfter; // [reset] - uint8_t mOverflowX; // [reset] see nsStyleConsts.h - uint8_t mOverflowY; // [reset] see nsStyleConsts.h - uint8_t mOverflowClipBoxBlock; // [reset] see nsStyleConsts.h - uint8_t mOverflowClipBoxInline; // [reset] see nsStyleConsts.h - uint8_t mResize; // [reset] see nsStyleConsts.h - mozilla::StyleOrient mOrient; // [reset] see nsStyleConsts.h - uint8_t mIsolation; // [reset] see nsStyleConsts.h - uint8_t mTopLayer; // [reset] see nsStyleConsts.h - uint8_t mWillChangeBitField; // [reset] see nsStyleConsts.h. Stores a - // bitfield representation of the properties - // that are frequently queried. This should - // match mWillChange. Also tracks if any of the - // properties in the will-change list require - // a stacking context. + mozilla::StyleClear mBreakType; + uint8_t mBreakInside; // NS_STYLE_PAGE_BREAK_AUTO/AVOID + bool mBreakBefore; + bool mBreakAfter; + uint8_t mOverflowX; // NS_STYLE_OVERFLOW_* + uint8_t mOverflowY; // NS_STYLE_OVERFLOW_* + uint8_t mOverflowClipBoxBlock; // NS_STYLE_OVERFLOW_CLIP_BOX_* + uint8_t mOverflowClipBoxInline; // NS_STYLE_OVERFLOW_CLIP_BOX_* + uint8_t mResize; // NS_STYLE_RESIZE_* + mozilla::StyleOrient mOrient; + uint8_t mIsolation; // NS_STYLE_ISOLATION_* + uint8_t mTopLayer; // NS_STYLE_TOP_LAYER_* + uint8_t mWillChangeBitField; // NS_STYLE_WILL_CHANGE_* + // Stores a bitfield representation of the + // properties that are frequently queried. This + // should match mWillChange. Also tracks if any + // of the properties in the will-change list + // require a stacking context. nsTArray<RefPtr<nsAtom>> mWillChange; - uint8_t mTouchAction; // [reset] see nsStyleConsts.h - uint8_t mScrollBehavior; // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_BEHAVIOR_* - mozilla::StyleOverscrollBehavior mOverscrollBehaviorX; // [reset] see nsStyleConsts.h - mozilla::StyleOverscrollBehavior mOverscrollBehaviorY; // [reset] see nsStyleConsts.h - uint8_t mScrollSnapTypeX; // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_SNAP_TYPE_* - uint8_t mScrollSnapTypeY; // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_SNAP_TYPE_* - nsStyleCoord mScrollSnapPointsX; // [reset] - nsStyleCoord mScrollSnapPointsY; // [reset] - mozilla::Position mScrollSnapDestination; // [reset] - nsTArray<mozilla::Position> mScrollSnapCoordinate; // [reset] + uint8_t mTouchAction; // NS_STYLE_TOUCH_ACTION_* + uint8_t mScrollBehavior; // NS_STYLE_SCROLL_BEHAVIOR_* + mozilla::StyleOverscrollBehavior mOverscrollBehaviorX; + mozilla::StyleOverscrollBehavior mOverscrollBehaviorY; + uint8_t mScrollSnapTypeX; // NS_STYLE_SCROLL_SNAP_TYPE_* + uint8_t mScrollSnapTypeY; // NS_STYLE_SCROLL_SNAP_TYPE_* + nsStyleCoord mScrollSnapPointsX; + nsStyleCoord mScrollSnapPointsY; + mozilla::Position mScrollSnapDestination; + nsTArray<mozilla::Position> mScrollSnapCoordinate; // mSpecifiedTransform is the list of transform functions as // specified, or null to indicate there is no transform. (inherit or // initial are replaced by an actual list of transform functions, or // null, as appropriate.) uint8_t mBackfaceVisibility; uint8_t mTransformStyle; - StyleGeometryBox mTransformBox; // [reset] see nsStyleConsts.h - RefPtr<nsCSSValueSharedList> mSpecifiedTransform; // [reset] - RefPtr<nsCSSValueSharedList> mSpecifiedRotate; // [reset] - RefPtr<nsCSSValueSharedList> mSpecifiedTranslate; // [reset] - RefPtr<nsCSSValueSharedList> mSpecifiedScale; // [reset] + StyleGeometryBox mTransformBox; + RefPtr<nsCSSValueSharedList> mSpecifiedTransform; + RefPtr<nsCSSValueSharedList> mSpecifiedRotate; + RefPtr<nsCSSValueSharedList> mSpecifiedTranslate; + RefPtr<nsCSSValueSharedList> mSpecifiedScale; // Used to store the final combination of mSpecifiedTranslate, // mSpecifiedRotate, mSpecifiedScale and mSpecifiedTransform. // Use GetCombinedTransform() to get the final transform, instead of // accessing mCombinedTransform directly. RefPtr<nsCSSValueSharedList> mCombinedTransform; - nsStyleCoord mTransformOrigin[3]; // [reset] percent, coord, calc, 3rd param is coord, calc only - nsStyleCoord mChildPerspective; // [reset] none, coord - nsStyleCoord mPerspectiveOrigin[2]; // [reset] percent, coord, calc - - nsStyleCoord mVerticalAlign; // [reset] coord, percent, calc, enum (see nsStyleConsts.h) - - nsStyleAutoArray<mozilla::StyleTransition> mTransitions; // [reset] + nsStyleCoord mTransformOrigin[3]; // percent, coord, calc, 3rd param is coord, calc only + nsStyleCoord mChildPerspective; // none, coord + nsStyleCoord mPerspectiveOrigin[2]; // percent, coord, calc + + nsStyleCoord mVerticalAlign; // coord, percent, calc, enum (NS_STYLE_VERTICAL_ALIGN_*) + + nsStyleAutoArray<mozilla::StyleTransition> mTransitions; // The number of elements in mTransitions that are not from repeating // a list due to another property being longer. uint32_t mTransitionTimingFunctionCount, mTransitionDurationCount, mTransitionDelayCount, mTransitionPropertyCount; @@ -2272,17 +2270,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt { // https://drafts.csswg.org/css-transitions/#transition-combined-duration return std::max(mTransitions[aIndex % mTransitionDurationCount].GetDuration(), 0.0f) + mTransitions[aIndex % mTransitionDelayCount].GetDelay(); } - nsStyleAutoArray<mozilla::StyleAnimation> mAnimations; // [reset] + nsStyleAutoArray<mozilla::StyleAnimation> mAnimations; // The number of elements in mAnimations that are not from repeating // a list due to another property being longer. uint32_t mAnimationTimingFunctionCount, mAnimationDurationCount, mAnimationDelayCount, mAnimationNameCount, mAnimationDirectionCount, @@ -2319,22 +2317,22 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt return mAnimations[aIndex % mAnimationIterationCountCount].GetIterationCount(); } const nsTimingFunction& GetAnimationTimingFunction(uint32_t aIndex) const { return mAnimations[aIndex % mAnimationTimingFunctionCount].GetTimingFunction(); } // The threshold used for extracting a shape from shape-outside: <image>. - float mShapeImageThreshold = 0.0f; // [reset] + float mShapeImageThreshold = 0.0f; // The margin around a shape-outside: <image>. nsStyleCoord mShapeMargin; - mozilla::StyleShapeSource mShapeOutside; // [reset] + mozilla::StyleShapeSource mShapeOutside; bool IsBlockInsideStyle() const { return mozilla::StyleDisplay::Block == mDisplay || mozilla::StyleDisplay::ListItem == mDisplay || mozilla::StyleDisplay::InlineBlock == mDisplay || mozilla::StyleDisplay::TableCaption == mDisplay || mozilla::StyleDisplay::FlowRoot == mDisplay; // Should TABLE_CELL be included here? They have @@ -2576,35 +2574,35 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt explicit nsStyleTable(const nsPresContext* aContext); nsStyleTable(const nsStyleTable& aOther); ~nsStyleTable(); void FinishStyle(nsPresContext*, const nsStyleTable*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleTable& aNewData) const; - uint8_t mLayoutStrategy;// [reset] see nsStyleConsts.h NS_STYLE_TABLE_LAYOUT_* - int32_t mSpan; // [reset] the number of columns spanned by a colgroup or col + uint8_t mLayoutStrategy; // NS_STYLE_TABLE_LAYOUT_* + int32_t mSpan; // -x-span; the number of columns spanned by a colgroup or col }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTableBorder { explicit nsStyleTableBorder(const nsPresContext* aContext); nsStyleTableBorder(const nsStyleTableBorder& aOther); ~nsStyleTableBorder(); void FinishStyle(nsPresContext*, const nsStyleTableBorder*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleTableBorder& aNewData) const; - nscoord mBorderSpacingCol;// [inherited] - nscoord mBorderSpacingRow;// [inherited] - uint8_t mBorderCollapse;// [inherited] - uint8_t mCaptionSide; // [inherited] - uint8_t mEmptyCells; // [inherited] + nscoord mBorderSpacingCol; + nscoord mBorderSpacingRow; + uint8_t mBorderCollapse; + uint8_t mCaptionSide; + uint8_t mEmptyCells; }; enum nsStyleContentType { eStyleContentType_String = 1, eStyleContentType_Image = 10, eStyleContentType_Attr = 20, eStyleContentType_Counter = 30, eStyleContentType_Counters = 31, @@ -2771,17 +2769,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt explicit nsStyleContent(const nsPresContext* aContext); nsStyleContent(const nsStyleContent& aContent); ~nsStyleContent(); void FinishStyle(nsPresContext*, const nsStyleContent*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleContent& aNewData) const; - uint32_t ContentCount() const { return mContents.Length(); } // [reset] + uint32_t ContentCount() const { return mContents.Length(); } const nsStyleContentData& ContentAt(uint32_t aIndex) const { return mContents[aIndex]; } nsStyleContentData& ContentAt(uint32_t aIndex) { return mContents[aIndex]; } void AllocateContents(uint32_t aCount) { @@ -2789,32 +2787,32 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt // delete and reallocate even if aCount == mContentCount. (If // nsStyleContentData had its members private and managed their // ownership on setting, we wouldn't need this, but that seems // unnecessary at this point.) mContents.Clear(); mContents.SetLength(aCount); } - uint32_t CounterIncrementCount() const { return mIncrements.Length(); } // [reset] + uint32_t CounterIncrementCount() const { return mIncrements.Length(); } const nsStyleCounterData& CounterIncrementAt(uint32_t aIndex) const { return mIncrements[aIndex]; } void AllocateCounterIncrements(uint32_t aCount) { mIncrements.Clear(); mIncrements.SetLength(aCount); } void SetCounterIncrementAt(uint32_t aIndex, const nsString& aCounter, int32_t aIncrement) { mIncrements[aIndex].mCounter = aCounter; mIncrements[aIndex].mValue = aIncrement; } - uint32_t CounterResetCount() const { return mResets.Length(); } // [reset] + uint32_t CounterResetCount() const { return mResets.Length(); } const nsStyleCounterData& CounterResetAt(uint32_t aIndex) const { return mResets[aIndex]; } void AllocateCounterResets(uint32_t aCount) { mResets.Clear(); mResets.SetLength(aCount); } @@ -2836,23 +2834,23 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt nsStyleUIReset(const nsStyleUIReset& aOther); ~nsStyleUIReset(); void FinishStyle(nsPresContext*, const nsStyleUIReset*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const; mozilla::StyleUserSelect mUserSelect; // [reset](selection-style) - uint8_t mForceBrokenImageIcon; // [reset] (0 if not forcing, otherwise forcing) - uint8_t mIMEMode; // [reset] - mozilla::StyleWindowDragging mWindowDragging; // [reset] - uint8_t mWindowShadow; // [reset] - float mWindowOpacity; // [reset] - RefPtr<nsCSSValueSharedList> mSpecifiedWindowTransform; // [reset] - nsStyleCoord mWindowTransformOrigin[2]; // [reset] percent, coord, calc + uint8_t mForceBrokenImageIcon; // (0 if not forcing, otherwise forcing) + uint8_t mIMEMode; + mozilla::StyleWindowDragging mWindowDragging; + uint8_t mWindowShadow; + float mWindowOpacity; + RefPtr<nsCSSValueSharedList> mSpecifiedWindowTransform; + nsStyleCoord mWindowTransformOrigin[2]; // percent, coord, calc }; struct nsCursorImage { bool mHaveHotspot; float mHotspotX, mHotspotY; RefPtr<nsStyleImageRequest> mImage; @@ -2878,27 +2876,27 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt nsStyleUserInterface(const nsStyleUserInterface& aOther); ~nsStyleUserInterface(); void FinishStyle(nsPresContext*, const nsStyleUserInterface*); const static bool kHasFinishStyle = true; nsChangeHint CalcDifference(const nsStyleUserInterface& aNewData) const; - mozilla::StyleUserInput mUserInput; // [inherited] - mozilla::StyleUserModify mUserModify; // [inherited] (modify-content) - mozilla::StyleUserFocus mUserFocus; // [inherited] (auto-select) - uint8_t mPointerEvents; // [inherited] see nsStyleConsts.h - - uint8_t mCursor; // [inherited] See nsStyleConsts.h - nsTArray<nsCursorImage> mCursorImages; // [inherited] images and coords - mozilla::StyleComplexColor mCaretColor; // [inherited] - - mozilla::StyleComplexColor mScrollbarFaceColor; // [inherited] - mozilla::StyleComplexColor mScrollbarTrackColor; // [inherited] + mozilla::StyleUserInput mUserInput; + mozilla::StyleUserModify mUserModify; // (modify-content) + mozilla::StyleUserFocus mUserFocus; // (auto-select) + uint8_t mPointerEvents; // NS_STYLE_POINTER_EVENTS_* + + uint8_t mCursor; // NS_STYLE_CURSOR_* + nsTArray<nsCursorImage> mCursorImages; // images and coords + mozilla::StyleComplexColor mCaretColor; + + mozilla::StyleComplexColor mScrollbarFaceColor; + mozilla::StyleComplexColor mScrollbarTrackColor; inline uint8_t GetEffectivePointerEvents(nsIFrame* aFrame) const; bool HasCustomScrollbars() const { return !mScrollbarFaceColor.IsAuto() || !mScrollbarTrackColor.IsAuto(); } }; @@ -2908,23 +2906,23 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt explicit nsStyleXUL(const nsPresContext* aContext); nsStyleXUL(const nsStyleXUL& aSource); ~nsStyleXUL(); void FinishStyle(nsPresContext*, const nsStyleXUL*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleXUL& aNewData) const; - float mBoxFlex; // [reset] see nsStyleConsts.h - uint32_t mBoxOrdinal; // [reset] see nsStyleConsts.h - mozilla::StyleBoxAlign mBoxAlign; // [reset] - mozilla::StyleBoxDirection mBoxDirection; // [reset] - mozilla::StyleBoxOrient mBoxOrient; // [reset] - mozilla::StyleBoxPack mBoxPack; // [reset] - mozilla::StyleStackSizing mStackSizing; // [reset] see nsStyleConsts.h + float mBoxFlex; + uint32_t mBoxOrdinal; + mozilla::StyleBoxAlign mBoxAlign; + mozilla::StyleBoxDirection mBoxDirection; + mozilla::StyleBoxOrient mBoxOrient; + mozilla::StyleBoxPack mBoxPack; + mozilla::StyleStackSizing mStackSizing; }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColumn { explicit nsStyleColumn(const nsPresContext* aContext); nsStyleColumn(const nsStyleColumn& aSource); ~nsStyleColumn(); void FinishStyle(nsPresContext*, const nsStyleColumn*) {} @@ -2933,34 +2931,34 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt nsChangeHint CalcDifference(const nsStyleColumn& aNewData) const; /** * This is the maximum number of columns we can process. It's used in both * nsColumnSetFrame and nsRuleNode. */ static const uint32_t kMaxColumnCount = 1000; - uint32_t mColumnCount; // [reset] see nsStyleConsts.h - nsStyleCoord mColumnWidth; // [reset] coord, auto - - mozilla::StyleComplexColor mColumnRuleColor; // [reset] - uint8_t mColumnRuleStyle; // [reset] - uint8_t mColumnFill; // [reset] see nsStyleConsts.h - uint8_t mColumnSpan; // [reset] see nsStyleConsts.h + uint32_t mColumnCount; // NS_STYLE_COLUMN_COUNT_* or another integer + nsStyleCoord mColumnWidth; // coord, auto + + mozilla::StyleComplexColor mColumnRuleColor; + uint8_t mColumnRuleStyle; // NS_STYLE_BORDER_STYLE_* + uint8_t mColumnFill; // NS_STYLE_COLUMN_FILL_* + uint8_t mColumnSpan; // NS_STYLE_COLUMN_SPAN_* void SetColumnRuleWidth(nscoord aWidth) { mColumnRuleWidth = NS_ROUND_BORDER_TO_PIXELS(aWidth, mTwipsPerPixel); } nscoord GetComputedColumnRuleWidth() const { return (IsVisibleBorderStyle(mColumnRuleStyle) ? mColumnRuleWidth : 0); } protected: - nscoord mColumnRuleWidth; // [reset] coord + nscoord mColumnRuleWidth; // coord nscoord mTwipsPerPixel; }; enum nsStyleSVGPaintType : uint8_t { eStyleSVGPaintType_None = 1, eStyleSVGPaintType_Color, eStyleSVGPaintType_Server, eStyleSVGPaintType_ContextFill, @@ -3050,43 +3048,42 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt explicit nsStyleSVG(const nsPresContext* aContext); nsStyleSVG(const nsStyleSVG& aSource); ~nsStyleSVG(); void FinishStyle(nsPresContext*, const nsStyleSVG*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleSVG& aNewData) const; - nsStyleSVGPaint mFill; // [inherited] - nsStyleSVGPaint mStroke; // [inherited] - RefPtr<mozilla::css::URLValue> mMarkerEnd; // [inherited] - RefPtr<mozilla::css::URLValue> mMarkerMid; // [inherited] - RefPtr<mozilla::css::URLValue> mMarkerStart; // [inherited] - nsTArray<nsStyleCoord> mStrokeDasharray; // [inherited] coord, percent, factor + nsStyleSVGPaint mFill; + nsStyleSVGPaint mStroke; + RefPtr<mozilla::css::URLValue> mMarkerEnd; + RefPtr<mozilla::css::URLValue> mMarkerMid; + RefPtr<mozilla::css::URLValue> mMarkerStart; + nsTArray<nsStyleCoord> mStrokeDasharray; // coord, percent, factor nsTArray<RefPtr<nsAtom>> mContextProps; - nsStyleCoord mStrokeDashoffset; // [inherited] coord, percent, factor - nsStyleCoord mStrokeWidth; // [inherited] coord, percent, factor - - float mFillOpacity; // [inherited] - float mStrokeMiterlimit; // [inherited] - float mStrokeOpacity; // [inherited] - - mozilla::StyleFillRule mClipRule; // [inherited] - uint8_t mColorInterpolation; // [inherited] see nsStyleConsts.h - uint8_t mColorInterpolationFilters; // [inherited] see nsStyleConsts.h - mozilla::StyleFillRule mFillRule; // [inherited] see nsStyleConsts.h - uint8_t mPaintOrder; // [inherited] see nsStyleConsts.h - uint8_t mShapeRendering; // [inherited] see nsStyleConsts.h - uint8_t mStrokeLinecap; // [inherited] see nsStyleConsts.h - uint8_t mStrokeLinejoin; // [inherited] see nsStyleConsts.h - uint8_t mTextAnchor; // [inherited] see nsStyleConsts.h - uint8_t mContextPropsBits; // [inherited] see nsStyleConsts.h. - // Stores a bitfield representation of - // the specified properties. + nsStyleCoord mStrokeDashoffset; // coord, percent, factor + nsStyleCoord mStrokeWidth; // coord, percent, factor + + float mFillOpacity; + float mStrokeMiterlimit; + float mStrokeOpacity; + + mozilla::StyleFillRule mClipRule; + uint8_t mColorInterpolation; // NS_STYLE_COLOR_INTERPOLATION_* + uint8_t mColorInterpolationFilters; // NS_STYLE_COLOR_INTERPOLATION_* + mozilla::StyleFillRule mFillRule; + uint8_t mPaintOrder; // bitfield of NS_STYLE_PAINT_ORDER_* values + uint8_t mShapeRendering; // NS_STYLE_SHAPE_RENDERING_* + uint8_t mStrokeLinecap; // NS_STYLE_STROKE_LINECAP_* + uint8_t mStrokeLinejoin; // NS_STYLE_STROKE_LINEJOIN_* + uint8_t mTextAnchor; // NS_STYLE_TEXT_ANCHOR_* + uint8_t mContextPropsBits; // bitfield of + // NS_STYLE_CONTEXT_PROPERTY_FILL_* values /// Returns true if style has been set to expose the computed values of /// certain properties (such as 'fill') to the contents of any linked images. bool ExposesContextProperties() const { return bool(mContextPropsBits); } nsStyleSVGOpacitySource FillOpacitySource() const { @@ -3163,17 +3160,17 @@ private: static const uint8_t STROKE_DASHARRAY_CONTEXT = 0x10; // stroke-dashoffset: context-value static const uint8_t STROKE_DASHOFFSET_CONTEXT = 0x20; // stroke-width: context-value static const uint8_t STROKE_WIDTH_CONTEXT = 0x40; static const uint8_t FILL_OPACITY_SOURCE_SHIFT = 0; static const uint8_t STROKE_OPACITY_SOURCE_SHIFT = 2; - uint8_t mContextFlags; // [inherited] + uint8_t mContextFlags; }; struct nsStyleFilter { nsStyleFilter(); nsStyleFilter(const nsStyleFilter& aSource); ~nsStyleFilter(); void FinishStyle(nsPresContext*, const nsStyleFilter*) {} @@ -3210,17 +3207,17 @@ struct nsStyleFilter NS_ASSERTION(mType == NS_STYLE_FILTER_DROP_SHADOW, "wrong filter type"); return mDropShadow; } void SetDropShadow(nsCSSShadowArray* aDropShadow); private: void ReleaseRef(); - uint32_t mType; // see NS_STYLE_FILTER_* constants in nsStyleConsts.h + uint32_t mType; // NS_STYLE_FILTER_* nsStyleCoord mFilterParameter; // coord, percent, factor, angle union { mozilla::css::URLValue* mURL; nsCSSShadowArray* mDropShadow; }; }; template<> @@ -3249,49 +3246,49 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt bool HasMask() const; bool HasNonScalingStroke() const { return mVectorEffect == NS_STYLE_VECTOR_EFFECT_NON_SCALING_STROKE; } nsStyleImageLayers mMask; - mozilla::StyleShapeSource mClipPath;// [reset] - mozilla::StyleComplexColor mStopColor; // [reset] - mozilla::StyleComplexColor mFloodColor; // [reset] - mozilla::StyleComplexColor mLightingColor; // [reset] - - float mStopOpacity; // [reset] - float mFloodOpacity; // [reset] - - uint8_t mDominantBaseline; // [reset] see nsStyleConsts.h - uint8_t mVectorEffect; // [reset] see nsStyleConsts.h - uint8_t mMaskType; // [reset] see nsStyleConsts.h + mozilla::StyleShapeSource mClipPath; + mozilla::StyleComplexColor mStopColor; + mozilla::StyleComplexColor mFloodColor; + mozilla::StyleComplexColor mLightingColor; + + float mStopOpacity; + float mFloodOpacity; + + uint8_t mDominantBaseline; // NS_STYLE_DOMINANT_BASELINE_* + uint8_t mVectorEffect; // NS_STYLE_VECTOR_EFFECT_* + uint8_t mMaskType; // NS_STYLE_MASK_TYPE_* }; struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleEffects { explicit nsStyleEffects(const nsPresContext* aContext); nsStyleEffects(const nsStyleEffects& aSource); ~nsStyleEffects(); void FinishStyle(nsPresContext*, const nsStyleEffects*) {} const static bool kHasFinishStyle = false; nsChangeHint CalcDifference(const nsStyleEffects& aNewData) const; bool HasFilters() const { return !mFilters.IsEmpty(); } - nsTArray<nsStyleFilter> mFilters; // [reset] - RefPtr<nsCSSShadowArray> mBoxShadow; // [reset] nullptr for 'none' - nsRect mClip; // [reset] offsets from UL border edge - float mOpacity; // [reset] - uint8_t mClipFlags; // [reset] see nsStyleConsts.h - uint8_t mMixBlendMode; // [reset] see nsStyleConsts.h + nsTArray<nsStyleFilter> mFilters; + RefPtr<nsCSSShadowArray> mBoxShadow; // nullptr for 'none' + nsRect mClip; // offsets from UL border edge + float mOpacity; + uint8_t mClipFlags; // bitfield of NS_STYLE_CLIP_* values + uint8_t mMixBlendMode; // NS_STYLE_BLEND_* }; #define STATIC_ASSERT_TYPE_LAYOUTS_MATCH(T1, T2) \ static_assert(sizeof(T1) == sizeof(T2), \ "Size mismatch between " #T1 " and " #T2); \ static_assert(alignof(T1) == alignof(T2), \ "Align mismatch between " #T1 " and " #T2); \
--- a/modules/libpref/init/StaticPrefList.h +++ b/modules/libpref/init/StaticPrefList.h @@ -111,16 +111,24 @@ VARCACHE_PREF( RelaxedAtomicBool, false ) // If true. then the service worker interception and the ServiceWorkerManager // will live in the parent process. This only takes effect on browser start. // Note, this is not currently safe to use for normal browsing yet. PREF("dom.serviceWorkers.parent_intercept", bool, false) +// Time in milliseconds for PaymentResponse to wait for +// the Web page to call complete(). +VARCACHE_PREF( + "dom.payments.response.timeout", + dom_payments_response_timeout, + uint32_t, 5000 +) + //--------------------------------------------------------------------------- // Clear-Site-Data prefs //--------------------------------------------------------------------------- #ifdef NIGHTLY # define PREF_VALUE true #else # define PREF_VALUE false
--- a/netwerk/cache/nsDiskCacheDeviceSQL.cpp +++ b/netwerk/cache/nsDiskCacheDeviceSQL.cpp @@ -43,17 +43,16 @@ #include "mozIStorageFunction.h" #include "mozStorageHelper.h" #include "nsICacheVisitor.h" #include "nsISeekableStream.h" #include "mozilla/Telemetry.h" -#include "sqlite3.h" #include "mozilla/storage.h" #include "nsVariant.h" #include "mozilla/BasePrincipal.h" using namespace mozilla; using namespace mozilla::storage; using mozilla::OriginAttributes; @@ -213,17 +212,19 @@ nsOfflineCacheEvictionFunction::OnFuncti const char *key = values->AsSharedUTF8String(1, &valueLen); nsAutoCString fullKey(clientID); fullKey.Append(':'); fullKey.Append(key); int generation = values->AsInt32(2); // If the key is currently locked, refuse to delete this row. if (mDevice->IsLocked(fullKey)) { - NS_ADDREF(*_retval = new IntegerVariant(SQLITE_IGNORE)); + // This code thought it was performing the equivalent of invoking the SQL + // "RAISE(IGNORE)" function. It was not. Please see bug 1470961 and any + // follow-ups to understand the plan for correcting this bug. return NS_OK; } nsCOMPtr<nsIFile> file; rv = GetCacheDataFile(mDevice->CacheDirectory(), key, generation, file); if (NS_FAILED(rv)) {
--- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -255,19 +255,17 @@ basicFunctionHelper(sqlite3_context *aCt NS_WARNING(errorMessage.get()); ::sqlite3_result_error(aCtx, errorMessage.get(), -1); ::sqlite3_result_error_code(aCtx, nsresultToSQLiteResult(rv)); return; } int retcode = variantToSQLiteT(aCtx, result); - if (retcode == SQLITE_IGNORE) { - ::sqlite3_result_int(aCtx, SQLITE_IGNORE); - } else if (retcode != SQLITE_OK) { + if (retcode != SQLITE_OK) { NS_WARNING("User function returned invalid data type!"); ::sqlite3_result_error(aCtx, "User function returned invalid data type", -1); } } void
--- a/third_party/rust/encoding_rs/.cargo-checksum.json +++ b/third_party/rust/encoding_rs/.cargo-checksum.json @@ -1,1 +1,1 @@ -{"files":{".travis.yml":"262b9925451db996c31e4bb8bb6bbdb36c3f6009f407db5ed4b0ed25cd72d8c8","CONTRIBUTING.md":"0d4bfb1068c2b2f32b7bc7833662dfff628d86b0f31068266027c719fb727360","COPYRIGHT":"20d4fff11cca11529df3f02096fbe8ffe350219cdb07cdedea34e6a762866da5","Cargo.toml":"2e1a7590a783bfc137d626f1e9b9611aa90dbc130fcf8608a1c40d25a2e40685","Ideas.md":"7fbeddb0f8ba7b233673ee705997adc2fddb1636a17fe662532b35ef2810a51d","LICENSE-APACHE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","LICENSE-MIT":"74aa8b6d04c36bb640ee81187a3f24a2fa94e36d4c1d4f2ca164c3784ae87a83","README.md":"51ae50670105f27828c80f413c18b15604df98f25642fca93f4a6d489768c908","doc/Big5.txt":"f73a2edc5cb6c2d140ba6e07f4542e1c4a234950378acde1df93480f0ca0be0b","doc/EUC-JP.txt":"ee2818b907d0137f40a9ab9fd525fc700a44dbdddb6cf0c157a656566bae4bf1","doc/EUC-KR.txt":"71d9e2ccf3b124e8bdfb433c8cf2773fd878077038d0cec3c7237a50f4a78a30","doc/GBK.txt":"c1b522b5a799884e5001da661f42c5a8f4d0acb9ef1d74b206f22b5f65365606","doc/IBM866.txt":"a5a433e804d0f83af785015179fbc1d9b0eaf1f7960efcd04093e136b51fbd0e","doc/ISO-2022-JP.txt":"af86684f5a8f0e2868d7b2c292860140c3d2e5527530ca091f1b28198e8e2fe6","doc/ISO-8859-10.txt":"6d3949ad7c81ca176895101ed81a1db7df1060d64e262880b94bd31bb344ab4d","doc/ISO-8859-13.txt":"3951dd89cf93f7729148091683cf8511f4529388b7dc8dcd0d62eaed55be93fa","doc/ISO-8859-14.txt":"3d330784a0374fd255a38b47949675cc7168c800530534b0a01cac6edc623adc","doc/ISO-8859-15.txt":"24b1084aab5127a85aab99153f86e24694d0a3615f53b5ce23683f97cf66c47a","doc/ISO-8859-16.txt":"ce0272559b92ba76d7a7e476f6424ae4a5cc72e75b183611b08392e44add4d25","doc/ISO-8859-2.txt":"18ceff88c13d1b5ba455a3919b1e3de489045c4c3d2dd7e8527c125c75d54aad","doc/ISO-8859-3.txt":"21798404c68f4f5db59223362f24999da96968c0628427321fccce7d2849a130","doc/ISO-8859-4.txt":"d27f6520c6c5bfbcc19176b71d081cdb3bccde1622bb3e420d5680e812632d53","doc/ISO-8859-5.txt":"a10ec8d6ea7a78ad15da7275f6cb1a3365118527e28f9af6d0d5830501303f3a","doc/ISO-8859-6.txt":"ccda8a2efc96115336bdd77776637b9712425e44fbcf745353b9057fbef144e7","doc/ISO-8859-7.txt":"17900fa1f27a445958f0a77d7d9056be375a6bd7ee4492aa680c7c1500bab85e","doc/ISO-8859-8-I.txt":"8357555646d54265a9b9ffa3e68b08d132312f1561c60108ff9b8b1167b6ecf2","doc/ISO-8859-8.txt":"72cd6f3afb7b4a9c16a66a362473315770b7755d72c86c870e52fc3eba86c8af","doc/KOI8-R.txt":"839cf19a38da994488004ed7814b1f6151640156a9a2af02bf2efca745fb5966","doc/KOI8-U.txt":"0cc76624ed1f024183e2298b7e019957da2c70c8ca06e0fc4e6f353f50a5054f","doc/Shift_JIS.txt":"34c49141818cb9ddbcf59cc858f78a79be8ad148d563f26415108ae1f148443f","doc/UTF-16BE.txt":"e2e280d8acbaa6d2a6b3569d60e17500a285f2baa0df3363dd85537cd5a1ef8f","doc/UTF-16LE.txt":"70bdc170e3fc5298ba68f10125fb5eeb8b077036cc96bb4416c4de396f6d76c1","doc/UTF-8.txt":"ea7bae742e613010ced002cf4b601a737d2203fad65e115611451bc4428f548a","doc/gb18030.txt":"dc71378a8f07a2d8659f69ee81fb8791fef56ba86f124b429978285237bb4a7b","doc/macintosh.txt":"57491e53866711b4672d9b9ff35380b9dac9e0d8e3d6c20bdd6140603687c023","doc/replacement.txt":"4b6c3bbd7999d9d4108a281594bd02d13607e334a95465afff8c2c08d395f0e4","doc/windows-1250.txt":"61296bb6a21cdab602300d32ecfba434cb82de5ac3bc88d58710d2f125e28d39","doc/windows-1251.txt":"7deea1c61dea1485c8ff02db2c7d578db7a9aab63ab1cfd02ec04b515864689e","doc/windows-1252.txt":"933ef3bdddfce5ee132b9f1a1aa8b47423d2587bbe475b19028d0a6d38e180b6","doc/windows-1253.txt":"1a38748b88e99071a5c7b3d5456ead4caedeabab50d50d658be105bc113714de","doc/windows-1254.txt":"f8372f86c6f8d642563cd6ddc025260553292a39423df1683a98670bd7bf2b47","doc/windows-1255.txt":"4e5852494730054e2da258a74e1b9d780abbcdd8ce22ebc218ca2efe9e90493d","doc/windows-1256.txt":"c0879c5172abedead302a406e8f60d9cd9598694a0ffa4fd288ffe4fef7b8ea1","doc/windows-1257.txt":"c28a0c9f964fcb2b46d21f537c402446501a2800670481d6abf9fd9e9018d523","doc/windows-1258.txt":"5019ae4d61805c79aacbf17c93793342dbb098d65a1837783bc3e2c6d6a23602","doc/windows-874.txt":"4ef0e4501c5feba8b17aee1818602ed44b36ca8475db771ce2fc16d392cabecc","doc/x-mac-cyrillic.txt":"58be154d8a888ca3d484b83b44f749823ef339ab27f14d90ca9a856f5050a8bd","doc/x-user-defined.txt":"f9cd07c4321bf5cfb0be4bdddd251072999b04a6cf7a6f5bc63709a84e2c1ffc","generate-encoding-data.py":"bbe134cc013a17c32bd51e868a2ee4f2c3e2205e40afb9fc60f98fa9758961b8","rustfmt.toml":"85c1a3b4382fd89e991cbb81b70fb52780472edc064c963943cdaaa56e0a2030","src/ascii.rs":"616bed165d244096d944e2d746405ec9fa671ba5fff1528a89172ea52f3a2975","src/big5.rs":"659ddb66f82142468774715cd9ecdc8356005fec9d91e46d54ae2280a88adb4b","src/data.rs":"18793e23f98d9aba1ed2858c43b2103c9c05a8571429b2128510c68d05ba8cb6","src/euc_jp.rs":"b178172274af1a6be38d388e5a2468e7140e9facf63d2f679f4ed77c3fc20a92","src/euc_kr.rs":"e27bd9c4e2172bb02004dd2a1fcbe02118415a1aec6a90b5632c9eac6f12ba7d","src/gb18030.rs":"752869f47ad0cad02ad3ccb6fde3eb277fa528e10e3d9432a90563db610d9dc2","src/handles.rs":"0598439bf66bd26699cba7e9e2fec001f8c57f3a510578fc3cc118ddc36d6831","src/iso_2022_jp.rs":"d904a92d49fc5878e6cb82a21185051c801489cf2800db8f37269965ca7974cc","src/lib.rs":"c8b973a715f5131830bfa7d88380fcec03cab1b302d22d72149e8284ba924df0","src/macros.rs":"04b3d81f1701b746dcce466ad2c3202a0a3e9c00f1d8db336276660640a12d7b","src/mem.rs":"b408367cef7ba93e9e90ec16cc62f763da58bcdbdb1ec0a856c6651e059ffead","src/replacement.rs":"61e0ae52664b3856f1ed202af6266b441ffcf5e2c9b22976047540e4a3252b41","src/shift_jis.rs":"7106d0a9785425b5af2323f3046e6130bd5125effa4ab484d84b529914855d67","src/simd_funcs.rs":"6139e2c7eebd8f3f35b8ce70891c6731595e5d18fa48b11f04f88c6342335935","src/single_byte.rs":"986571bb52f2cf7779c1dc8bdd8058c3183524a512bc2fcca6637eeee394b573","src/test_data/big5_in.txt":"4c5a8691f8dc717311889c63894026d2fb62725a86c4208ca274a9cc8d42a503","src/test_data/big5_in_ref.txt":"99d399e17750cf9c7cf30bb253dbfe35b81c4fcbdead93cfa48b1429213473c7","src/test_data/big5_out.txt":"6193ca97c297aa20e09396038d18e938bb7ea331c26f0f2454097296723a0b13","src/test_data/big5_out_ref.txt":"36567691f557df144f6cc520015a87038dfa156f296fcf103b56ae9a718be1fc","src/test_data/euc_kr_in.txt":"c86a7224f3215fa0d04e685622a752fdc72763e8ae076230c7fd62de57ec4074","src/test_data/euc_kr_in_ref.txt":"1f419f4ca47d708b54c73c461545a022ae2e20498fdbf8005a483d752a204883","src/test_data/euc_kr_out.txt":"e7f32e026f70be1e1b58e0047baf7d3d2c520269c4f9b9992e158b4decb0a1a3","src/test_data/euc_kr_out_ref.txt":"c9907857980b20b8e9e3b584482ed6567a2be6185d72237b6322f0404944924e","src/test_data/gb18030_in.txt":"ab7231b2d3e9afacdbd7d7f3b9e5361a7ff9f7e1cfdb4f3bd905b9362b309e53","src/test_data/gb18030_in_ref.txt":"dc5069421adca2043c55f5012b55a76fdff651d22e6e699fd0978f8d5706815c","src/test_data/gb18030_out.txt":"f0208d527f5ca63de7d9a0323be8d5cf12d8a104b2943d92c2701f0c3364dac1","src/test_data/gb18030_out_ref.txt":"6819fe47627e4ea01027003fc514b9f21a1322e732d7f1fb92cc6c5455bc6c07","src/test_data/iso_2022_jp_in.txt":"cd24bbdcb1834e25db54646fbf4c41560a13dc7540f6be3dba4f5d97d44513af","src/test_data/iso_2022_jp_in_ref.txt":"3dc4e6a5e06471942d086b16c9440945e78415f6f3f47e43717e4bc2eac2cdf5","src/test_data/iso_2022_jp_out.txt":"9b6f015329dda6c3f9ee5ce6dbd6fa9c89acc21283e886836c78b8d833480c21","src/test_data/iso_2022_jp_out_ref.txt":"78cb260093a20116ad9a42f43b05d1848c5ab100b6b9a850749809e943884b35","src/test_data/jis0208_in.txt":"6df3030553ffb0a6615bb33dc8ea9dca6d9623a9028e2ffec754ce3c3da824cc","src/test_data/jis0208_in_ref.txt":"3dc4e6a5e06471942d086b16c9440945e78415f6f3f47e43717e4bc2eac2cdf5","src/test_data/jis0208_out.txt":"4ec24477e1675ce750733bdc3c5add1cd27b6bd4ce1f09289564646e9654e857","src/test_data/jis0208_out_ref.txt":"c3e1cef5032b2b1d93a406f31ff940c4e2dfe8859b8b17ca2761fee7a75a0e48","src/test_data/jis0212_in.txt":"c011f0dd72bd7c8cd922df9374ef8d2769a77190514c77f6c62b415852eeb9fe","src/test_data/jis0212_in_ref.txt":"7d9458b3d2f73e7092a7f505c08ce1d233dde18aa679fbcf9889256239cc9e06","src/test_data/shift_jis_in.txt":"02e389ccef0dd2122e63f503899402cb7f797912c2444cc80ab93131116c5524","src/test_data/shift_jis_in_ref.txt":"512f985950ca902e643c88682dba9708b7c38d3c5ec2925168ab00ac94ab19f9","src/test_data/shift_jis_out.txt":"5fbc44da7bf639bf6cfe0fa1fd3eba7102b88f81919c9ea991302712f69426fb","src/test_data/shift_jis_out_ref.txt":"466322c6fed8286c64582731755290c2296508efdd258826e6279686649b481f","src/test_labels_names.rs":"c962c7aeac3d9ef2aca70c9e21983b231d4cf998cb06879374b0401e5149d1da","src/testing.rs":"b299d27055f3b068de66cc10a75c024b881c48bc093627c01e0b1f8bd7d94666","src/utf_16.rs":"32b6ecc3696542fb269a93c915e7402dde545e793f9599cf7dc63688fa226e0d","src/utf_8.rs":"249ec511970051d71fa863e659ab0b46ce9283d5a628b9b437619b41d4334459","src/utf_8_core.rs":"fe218284dbb9111a2336ff1684d7f58b55d9c4fe7363089a29e57f52901f0707","src/variant.rs":"e2c988a645429fd7457d7fbc487b838ab7ec7bfb8943d192992f18bbac8973f0","src/x_user_defined.rs":"1d25920ec5d005cbd623f34473d68991521aa3a83e52d4eb9b645711f10cd484"},"package":"22b758dc5e2c2b9e1dc3aa7a8be71035eed9742c907b7567627527af4c03324e"} \ No newline at end of file +{"files":{".travis.yml":"262b9925451db996c31e4bb8bb6bbdb36c3f6009f407db5ed4b0ed25cd72d8c8","CONTRIBUTING.md":"0d4bfb1068c2b2f32b7bc7833662dfff628d86b0f31068266027c719fb727360","COPYRIGHT":"20d4fff11cca11529df3f02096fbe8ffe350219cdb07cdedea34e6a762866da5","Cargo.toml":"347a2dc529b825a051409302e0d2ba0b5e8459b04acf617de174879bd45aee6d","Ideas.md":"7fbeddb0f8ba7b233673ee705997adc2fddb1636a17fe662532b35ef2810a51d","LICENSE-APACHE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","LICENSE-MIT":"74aa8b6d04c36bb640ee81187a3f24a2fa94e36d4c1d4f2ca164c3784ae87a83","README.md":"d2ffca39923686197cce258c81a27e7e0cda0930022a6c46cd654585c67c8735","doc/Big5.txt":"f73a2edc5cb6c2d140ba6e07f4542e1c4a234950378acde1df93480f0ca0be0b","doc/EUC-JP.txt":"ee2818b907d0137f40a9ab9fd525fc700a44dbdddb6cf0c157a656566bae4bf1","doc/EUC-KR.txt":"71d9e2ccf3b124e8bdfb433c8cf2773fd878077038d0cec3c7237a50f4a78a30","doc/GBK.txt":"c1b522b5a799884e5001da661f42c5a8f4d0acb9ef1d74b206f22b5f65365606","doc/IBM866.txt":"a5a433e804d0f83af785015179fbc1d9b0eaf1f7960efcd04093e136b51fbd0e","doc/ISO-2022-JP.txt":"af86684f5a8f0e2868d7b2c292860140c3d2e5527530ca091f1b28198e8e2fe6","doc/ISO-8859-10.txt":"6d3949ad7c81ca176895101ed81a1db7df1060d64e262880b94bd31bb344ab4d","doc/ISO-8859-13.txt":"3951dd89cf93f7729148091683cf8511f4529388b7dc8dcd0d62eaed55be93fa","doc/ISO-8859-14.txt":"3d330784a0374fd255a38b47949675cc7168c800530534b0a01cac6edc623adc","doc/ISO-8859-15.txt":"24b1084aab5127a85aab99153f86e24694d0a3615f53b5ce23683f97cf66c47a","doc/ISO-8859-16.txt":"ce0272559b92ba76d7a7e476f6424ae4a5cc72e75b183611b08392e44add4d25","doc/ISO-8859-2.txt":"18ceff88c13d1b5ba455a3919b1e3de489045c4c3d2dd7e8527c125c75d54aad","doc/ISO-8859-3.txt":"21798404c68f4f5db59223362f24999da96968c0628427321fccce7d2849a130","doc/ISO-8859-4.txt":"d27f6520c6c5bfbcc19176b71d081cdb3bccde1622bb3e420d5680e812632d53","doc/ISO-8859-5.txt":"a10ec8d6ea7a78ad15da7275f6cb1a3365118527e28f9af6d0d5830501303f3a","doc/ISO-8859-6.txt":"ccda8a2efc96115336bdd77776637b9712425e44fbcf745353b9057fbef144e7","doc/ISO-8859-7.txt":"17900fa1f27a445958f0a77d7d9056be375a6bd7ee4492aa680c7c1500bab85e","doc/ISO-8859-8-I.txt":"8357555646d54265a9b9ffa3e68b08d132312f1561c60108ff9b8b1167b6ecf2","doc/ISO-8859-8.txt":"72cd6f3afb7b4a9c16a66a362473315770b7755d72c86c870e52fc3eba86c8af","doc/KOI8-R.txt":"839cf19a38da994488004ed7814b1f6151640156a9a2af02bf2efca745fb5966","doc/KOI8-U.txt":"0cc76624ed1f024183e2298b7e019957da2c70c8ca06e0fc4e6f353f50a5054f","doc/Shift_JIS.txt":"34c49141818cb9ddbcf59cc858f78a79be8ad148d563f26415108ae1f148443f","doc/UTF-16BE.txt":"e2e280d8acbaa6d2a6b3569d60e17500a285f2baa0df3363dd85537cd5a1ef8f","doc/UTF-16LE.txt":"70bdc170e3fc5298ba68f10125fb5eeb8b077036cc96bb4416c4de396f6d76c1","doc/UTF-8.txt":"ea7bae742e613010ced002cf4b601a737d2203fad65e115611451bc4428f548a","doc/gb18030.txt":"dc71378a8f07a2d8659f69ee81fb8791fef56ba86f124b429978285237bb4a7b","doc/macintosh.txt":"57491e53866711b4672d9b9ff35380b9dac9e0d8e3d6c20bdd6140603687c023","doc/replacement.txt":"4b6c3bbd7999d9d4108a281594bd02d13607e334a95465afff8c2c08d395f0e4","doc/windows-1250.txt":"61296bb6a21cdab602300d32ecfba434cb82de5ac3bc88d58710d2f125e28d39","doc/windows-1251.txt":"7deea1c61dea1485c8ff02db2c7d578db7a9aab63ab1cfd02ec04b515864689e","doc/windows-1252.txt":"933ef3bdddfce5ee132b9f1a1aa8b47423d2587bbe475b19028d0a6d38e180b6","doc/windows-1253.txt":"1a38748b88e99071a5c7b3d5456ead4caedeabab50d50d658be105bc113714de","doc/windows-1254.txt":"f8372f86c6f8d642563cd6ddc025260553292a39423df1683a98670bd7bf2b47","doc/windows-1255.txt":"4e5852494730054e2da258a74e1b9d780abbcdd8ce22ebc218ca2efe9e90493d","doc/windows-1256.txt":"c0879c5172abedead302a406e8f60d9cd9598694a0ffa4fd288ffe4fef7b8ea1","doc/windows-1257.txt":"c28a0c9f964fcb2b46d21f537c402446501a2800670481d6abf9fd9e9018d523","doc/windows-1258.txt":"5019ae4d61805c79aacbf17c93793342dbb098d65a1837783bc3e2c6d6a23602","doc/windows-874.txt":"4ef0e4501c5feba8b17aee1818602ed44b36ca8475db771ce2fc16d392cabecc","doc/x-mac-cyrillic.txt":"58be154d8a888ca3d484b83b44f749823ef339ab27f14d90ca9a856f5050a8bd","doc/x-user-defined.txt":"f9cd07c4321bf5cfb0be4bdddd251072999b04a6cf7a6f5bc63709a84e2c1ffc","generate-encoding-data.py":"bbe134cc013a17c32bd51e868a2ee4f2c3e2205e40afb9fc60f98fa9758961b8","rustfmt.toml":"85c1a3b4382fd89e991cbb81b70fb52780472edc064c963943cdaaa56e0a2030","src/ascii.rs":"616bed165d244096d944e2d746405ec9fa671ba5fff1528a89172ea52f3a2975","src/big5.rs":"659ddb66f82142468774715cd9ecdc8356005fec9d91e46d54ae2280a88adb4b","src/data.rs":"18793e23f98d9aba1ed2858c43b2103c9c05a8571429b2128510c68d05ba8cb6","src/euc_jp.rs":"b178172274af1a6be38d388e5a2468e7140e9facf63d2f679f4ed77c3fc20a92","src/euc_kr.rs":"e27bd9c4e2172bb02004dd2a1fcbe02118415a1aec6a90b5632c9eac6f12ba7d","src/gb18030.rs":"752869f47ad0cad02ad3ccb6fde3eb277fa528e10e3d9432a90563db610d9dc2","src/handles.rs":"0598439bf66bd26699cba7e9e2fec001f8c57f3a510578fc3cc118ddc36d6831","src/iso_2022_jp.rs":"d904a92d49fc5878e6cb82a21185051c801489cf2800db8f37269965ca7974cc","src/lib.rs":"501277045b1b01298d35aaa08b78f87a80ae3e688f30b00cd65f2d693cc01c82","src/macros.rs":"04b3d81f1701b746dcce466ad2c3202a0a3e9c00f1d8db336276660640a12d7b","src/mem.rs":"b408367cef7ba93e9e90ec16cc62f763da58bcdbdb1ec0a856c6651e059ffead","src/replacement.rs":"61e0ae52664b3856f1ed202af6266b441ffcf5e2c9b22976047540e4a3252b41","src/shift_jis.rs":"7106d0a9785425b5af2323f3046e6130bd5125effa4ab484d84b529914855d67","src/simd_funcs.rs":"6139e2c7eebd8f3f35b8ce70891c6731595e5d18fa48b11f04f88c6342335935","src/single_byte.rs":"986571bb52f2cf7779c1dc8bdd8058c3183524a512bc2fcca6637eeee394b573","src/test_data/big5_in.txt":"4c5a8691f8dc717311889c63894026d2fb62725a86c4208ca274a9cc8d42a503","src/test_data/big5_in_ref.txt":"99d399e17750cf9c7cf30bb253dbfe35b81c4fcbdead93cfa48b1429213473c7","src/test_data/big5_out.txt":"6193ca97c297aa20e09396038d18e938bb7ea331c26f0f2454097296723a0b13","src/test_data/big5_out_ref.txt":"36567691f557df144f6cc520015a87038dfa156f296fcf103b56ae9a718be1fc","src/test_data/euc_kr_in.txt":"c86a7224f3215fa0d04e685622a752fdc72763e8ae076230c7fd62de57ec4074","src/test_data/euc_kr_in_ref.txt":"1f419f4ca47d708b54c73c461545a022ae2e20498fdbf8005a483d752a204883","src/test_data/euc_kr_out.txt":"e7f32e026f70be1e1b58e0047baf7d3d2c520269c4f9b9992e158b4decb0a1a3","src/test_data/euc_kr_out_ref.txt":"c9907857980b20b8e9e3b584482ed6567a2be6185d72237b6322f0404944924e","src/test_data/gb18030_in.txt":"ab7231b2d3e9afacdbd7d7f3b9e5361a7ff9f7e1cfdb4f3bd905b9362b309e53","src/test_data/gb18030_in_ref.txt":"dc5069421adca2043c55f5012b55a76fdff651d22e6e699fd0978f8d5706815c","src/test_data/gb18030_out.txt":"f0208d527f5ca63de7d9a0323be8d5cf12d8a104b2943d92c2701f0c3364dac1","src/test_data/gb18030_out_ref.txt":"6819fe47627e4ea01027003fc514b9f21a1322e732d7f1fb92cc6c5455bc6c07","src/test_data/iso_2022_jp_in.txt":"cd24bbdcb1834e25db54646fbf4c41560a13dc7540f6be3dba4f5d97d44513af","src/test_data/iso_2022_jp_in_ref.txt":"3dc4e6a5e06471942d086b16c9440945e78415f6f3f47e43717e4bc2eac2cdf5","src/test_data/iso_2022_jp_out.txt":"9b6f015329dda6c3f9ee5ce6dbd6fa9c89acc21283e886836c78b8d833480c21","src/test_data/iso_2022_jp_out_ref.txt":"78cb260093a20116ad9a42f43b05d1848c5ab100b6b9a850749809e943884b35","src/test_data/jis0208_in.txt":"6df3030553ffb0a6615bb33dc8ea9dca6d9623a9028e2ffec754ce3c3da824cc","src/test_data/jis0208_in_ref.txt":"3dc4e6a5e06471942d086b16c9440945e78415f6f3f47e43717e4bc2eac2cdf5","src/test_data/jis0208_out.txt":"4ec24477e1675ce750733bdc3c5add1cd27b6bd4ce1f09289564646e9654e857","src/test_data/jis0208_out_ref.txt":"c3e1cef5032b2b1d93a406f31ff940c4e2dfe8859b8b17ca2761fee7a75a0e48","src/test_data/jis0212_in.txt":"c011f0dd72bd7c8cd922df9374ef8d2769a77190514c77f6c62b415852eeb9fe","src/test_data/jis0212_in_ref.txt":"7d9458b3d2f73e7092a7f505c08ce1d233dde18aa679fbcf9889256239cc9e06","src/test_data/shift_jis_in.txt":"02e389ccef0dd2122e63f503899402cb7f797912c2444cc80ab93131116c5524","src/test_data/shift_jis_in_ref.txt":"512f985950ca902e643c88682dba9708b7c38d3c5ec2925168ab00ac94ab19f9","src/test_data/shift_jis_out.txt":"5fbc44da7bf639bf6cfe0fa1fd3eba7102b88f81919c9ea991302712f69426fb","src/test_data/shift_jis_out_ref.txt":"466322c6fed8286c64582731755290c2296508efdd258826e6279686649b481f","src/test_labels_names.rs":"c962c7aeac3d9ef2aca70c9e21983b231d4cf998cb06879374b0401e5149d1da","src/testing.rs":"b299d27055f3b068de66cc10a75c024b881c48bc093627c01e0b1f8bd7d94666","src/utf_16.rs":"32b6ecc3696542fb269a93c915e7402dde545e793f9599cf7dc63688fa226e0d","src/utf_8.rs":"5d16295faf1707b2058629eb2467200b86b02acfceda27433ac1d05ac385f9f3","src/utf_8_core.rs":"fe218284dbb9111a2336ff1684d7f58b55d9c4fe7363089a29e57f52901f0707","src/variant.rs":"e2c988a645429fd7457d7fbc487b838ab7ec7bfb8943d192992f18bbac8973f0","src/x_user_defined.rs":"1d25920ec5d005cbd623f34473d68991521aa3a83e52d4eb9b645711f10cd484"},"package":"0122c98564237c64fc6cace6abdfdb2438e0082aa7456ee86ccc04f7c3be1d5e"} \ No newline at end of file
--- a/third_party/rust/encoding_rs/Cargo.toml +++ b/third_party/rust/encoding_rs/Cargo.toml @@ -7,17 +7,17 @@ # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "encoding_rs" -version = "0.8.1" +version = "0.8.3" authors = ["Henri Sivonen <hsivonen@hsivonen.fi>"] description = "A Gecko-oriented implementation of the Encoding Standard" homepage = "https://docs.rs/encoding_rs/" documentation = "https://docs.rs/encoding_rs/" readme = "README.md" keywords = ["encoding", "web", "unicode", "charset"] categories = ["text-processing", "encoding", "web-programming", "email"] license = "MIT/Apache-2.0"
--- a/third_party/rust/encoding_rs/README.md +++ b/third_party/rust/encoding_rs/README.md @@ -232,16 +232,25 @@ used in Firefox. - [x] Add SIMD acceleration for Aarch64. - [x] Investigate the use of NEON on 32-bit ARM. - [ ] Investigate Björn Höhrmann's lookup table acceleration for UTF-8 as adapted to Rust in rust-encoding. - [ ] Add actually fast CJK encode options. ## Release Notes +### 0.8.3 + +* Removed an `#[inline(never)]` annotation that was not meant for release. + +### 0.8.2 + +* Made non-ASCII UTF-16 to UTF-8 encode faster by manually omitting bound + checks and manually adding branch prediction annotations. + ### 0.8.1 * Tweaked loop unrolling and memory alignment for SSE2 conversions between UTF-16 and Latin1 in the `mem` module to increase the performance when converting long buffers. ### 0.8.0
--- a/third_party/rust/encoding_rs/src/lib.rs +++ b/third_party/rust/encoding_rs/src/lib.rs @@ -3,17 +3,17 @@ // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![cfg_attr(feature = "cargo-clippy", allow(doc_markdown, inline_always, new_ret_no_self))] -#![doc(html_root_url = "https://docs.rs/encoding_rs/0.8.1")] +#![doc(html_root_url = "https://docs.rs/encoding_rs/0.8.3")] //! encoding_rs is a Gecko-oriented Free Software / Open Source implementation //! of the [Encoding Standard](https://encoding.spec.whatwg.org/) in Rust. //! Gecko-oriented means that converting to and from UTF-16 is supported in //! addition to converting to and from UTF-8, that the performance and //! streamability goals are browser-oriented, and that FFI-friendliness is a //! goal. //!
--- a/third_party/rust/encoding_rs/src/utf_8.rs +++ b/third_party/rust/encoding_rs/src/utf_8.rs @@ -11,16 +11,34 @@ extern crate rayon; use super::*; use ascii::ascii_to_basic_latin; use ascii::basic_latin_to_ascii; use handles::*; use variant::*; +cfg_if!{ + if #[cfg(feature = "simd-accel")] { + use ::std::intrinsics::unlikely; + use ::std::intrinsics::likely; + } else { + #[inline(always)] + // Unsafe to match the intrinsic, which is needlessly unsafe. + unsafe fn unlikely(b: bool) -> bool { + b + } + #[inline(always)] + // Unsafe to match the intrinsic, which is needlessly unsafe. + unsafe fn likely(b: bool) -> bool { + b + } + } +} + // Keep this cfg_if in sync with whether the utf_8_core module is defined in lib.rs. cfg_if! { // When running 32-bit ARM code on Raspberry Pi 3, which has a 64-bit CPU, // this is a pessimization for non-Latin, non-CJK scripts. However, this // optimization seems to work across scripts when running 32-bit ARM code // on a 32-bit ARM CPU (particularly good on Exynos 5) and when running // 64-bit ARM code on a 64-bit ARM CPU. if #[cfg(any(all(feature = "simd-accel", target_feature = "sse2"), all(target_endian = "little", target_arch = "aarch64"), all(target_endian = "little", target_arch = "arm")))] { @@ -639,86 +657,108 @@ impl Utf8Encoder { written += consumed; non_ascii } } }; 'inner: loop { // The following loop is only broken out of as a goto forward. loop { - if written + 4 > dst.len() { + // Unfortunately, this check isn't enough for the compiler to elide + // the bound checks on writes to dst, which is why they are manually + // elided, which makes a measurable difference. + if written.checked_add(4).unwrap() > dst.len() { return (EncoderResult::OutputFull, read, written); } read += 1; if unit < 0x800 { - dst[written] = (unit >> 6) as u8 | 0xC0u8; - written += 1; - dst[written] = (unit & 0x3F) as u8 | 0x80u8; - written += 1; + unsafe { + *(dst.get_unchecked_mut(written)) = (unit >> 6) as u8 | 0xC0u8; + written += 1; + *(dst.get_unchecked_mut(written)) = (unit & 0x3F) as u8 | 0x80u8; + written += 1; + } break; } let unit_minus_surrogate_start = unit.wrapping_sub(0xD800); - if unit_minus_surrogate_start > (0xDFFF - 0xD800) { - dst[written] = (unit >> 12) as u8 | 0xE0u8; - written += 1; - dst[written] = ((unit & 0xFC0) >> 6) as u8 | 0x80u8; - written += 1; - dst[written] = (unit & 0x3F) as u8 | 0x80u8; - written += 1; + if unsafe { likely(unit_minus_surrogate_start > (0xDFFF - 0xD800)) } { + unsafe { + *(dst.get_unchecked_mut(written)) = (unit >> 12) as u8 | 0xE0u8; + written += 1; + *(dst.get_unchecked_mut(written)) = ((unit & 0xFC0) >> 6) as u8 | 0x80u8; + written += 1; + *(dst.get_unchecked_mut(written)) = (unit & 0x3F) as u8 | 0x80u8; + written += 1; + } break; } - if unit_minus_surrogate_start <= (0xDBFF - 0xD800) { + if unsafe { likely(unit_minus_surrogate_start <= (0xDBFF - 0xD800)) } { // high surrogate - if read == src.len() { + // read > src.len() is impossible, but using + // >= instead of == allows the compiler to elide a bound check. + if read >= src.len() { + debug_assert_eq!(read, src.len()); // Unpaired surrogate at the end of the buffer. - dst[written] = 0xEFu8; - written += 1; - dst[written] = 0xBFu8; - written += 1; - dst[written] = 0xBDu8; - written += 1; + unsafe { + *(dst.get_unchecked_mut(written)) = 0xEFu8; + written += 1; + *(dst.get_unchecked_mut(written)) = 0xBFu8; + written += 1; + *(dst.get_unchecked_mut(written)) = 0xBDu8; + written += 1; + } return (EncoderResult::InputEmpty, read, written); } let second = src[read]; let second_minus_low_surrogate_start = second.wrapping_sub(0xDC00); - if second_minus_low_surrogate_start <= (0xDFFF - 0xDC00) { + if unsafe { likely(second_minus_low_surrogate_start <= (0xDFFF - 0xDC00)) } { // The next code unit is a low surrogate. Advance position. read += 1; let astral = ((unit as u32) << 10) + second as u32 - (((0xD800u32 << 10) - 0x10000u32) + 0xDC00u32); - dst[written] = (astral >> 18) as u8 | 0xF0u8; - written += 1; - dst[written] = ((astral & 0x3F000u32) >> 12) as u8 | 0x80u8; - written += 1; - dst[written] = ((astral & 0xFC0u32) >> 6) as u8 | 0x80u8; - written += 1; - dst[written] = (astral & 0x3Fu32) as u8 | 0x80u8; - written += 1; + unsafe { + *(dst.get_unchecked_mut(written)) = (astral >> 18) as u8 | 0xF0u8; + written += 1; + *(dst.get_unchecked_mut(written)) = ((astral & 0x3F000u32) >> 12) as u8 | 0x80u8; + written += 1; + *(dst.get_unchecked_mut(written)) = ((astral & 0xFC0u32) >> 6) as u8 | 0x80u8; + written += 1; + *(dst.get_unchecked_mut(written)) = (astral & 0x3Fu32) as u8 | 0x80u8; + written += 1; + } break; } // The next code unit is not a low surrogate. Don't advance // position and treat the high surrogate as unpaired. // Fall through } // Unpaired low surrogate - dst[written] = 0xEFu8; - written += 1; - dst[written] = 0xBFu8; - written += 1; - dst[written] = 0xBDu8; - written += 1; + unsafe { + *(dst.get_unchecked_mut(written)) = 0xEFu8; + written += 1; + *(dst.get_unchecked_mut(written)) = 0xBFu8; + written += 1; + *(dst.get_unchecked_mut(written)) = 0xBDu8; + written += 1; + } break; } // Now see if the next unit is Basic Latin - if read == src.len() { + // read > src.len() is impossible, but using + // >= instead of == allows the compiler to elide a bound check. + if read >= src.len() { + debug_assert_eq!(read, src.len()); return (EncoderResult::InputEmpty, read, written); } unit = src[read]; - if unit < 0x80 { - if written == dst.len() { + if unsafe { unlikely(unit < 0x80) } { + // written > dst.len() is impossible, but using + // >= instead of == allows the compiler to elide a bound check. + if written >= dst.len() { + debug_assert_eq!(written, dst.len()); return (EncoderResult::OutputFull, read, written); } dst[written] = unit as u8; read += 1; written += 1; // Mysteriously, adding a punctuation check here makes // the expected benificiary cases *slower*! continue 'outer;
--- a/toolkit/library/dependentlibs.py +++ b/toolkit/library/dependentlibs.py @@ -36,20 +36,24 @@ def dependentlibs_dumpbin(lib): # There may be several groups of library names, but only the # first one is interesting. The second one is for delayload-ed # libraries. break proc.wait() return deps def dependentlibs_mingw_objdump(lib): - proc = subprocess.Popen(['objdump', '-x', lib], stdout = subprocess.PIPE) + try: + proc = subprocess.Popen(['objdump', '-x', lib], stdout = subprocess.PIPE) + except OSError: + # objdump is missing, try using llvm-objdump. + proc = subprocess.Popen(['llvm-objdump', '-private-headers', lib], stdout = subprocess.PIPE) deps = [] for line in proc.stdout: - match = re.match('\tDLL Name: (\S+)', line) + match = re.match('\s+DLL Name: (\S+)', line) if match: deps.append(match.group(1)) proc.wait() return deps def dependentlibs_readelf(lib): '''Returns the list of dependencies declared in the given ELF .so''' proc = subprocess.Popen([substs.get('TOOLCHAIN_PREFIX', '') + 'readelf', '-d', lib], stdout = subprocess.PIPE)