merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2017-06-23 11:28:19 +02:00
commit 5f51e5596e
433 changed files with 18434 additions and 8183 deletions

View file

@ -754,17 +754,8 @@ AtkAttributeSet*
GetAttributeSet(Accessible* aAccessible) GetAttributeSet(Accessible* aAccessible)
{ {
nsCOMPtr<nsIPersistentProperties> attributes = aAccessible->Attributes(); nsCOMPtr<nsIPersistentProperties> attributes = aAccessible->Attributes();
if (attributes) { if (attributes)
// There is no ATK state for haspopup, must use object attribute to expose
// the same info.
if (aAccessible->State() & states::HASPOPUP) {
nsAutoString unused;
attributes->SetStringProperty(NS_LITERAL_CSTRING("haspopup"),
NS_LITERAL_STRING("true"), unused);
}
return ConvertToAtkAttributeSet(attributes); return ConvertToAtkAttributeSet(attributes);
}
return nullptr; return nullptr;
} }

View file

@ -92,11 +92,11 @@ DocManager::RemoveFromXPCDocumentCache(DocAccessible* aDocument)
if (xpcDoc) { if (xpcDoc) {
xpcDoc->Shutdown(); xpcDoc->Shutdown();
mXPCDocumentCache.Remove(aDocument); mXPCDocumentCache.Remove(aDocument);
}
if (!HasXPCDocuments()) { if (!HasXPCDocuments()) {
MaybeShutdownAccService(nsAccessibilityService::eXPCOM); MaybeShutdownAccService(nsAccessibilityService::eXPCOM);
} }
}
} }
void void

View file

@ -1026,7 +1026,7 @@ logging::IsEnabled(const nsAString& aModuleStr)
} }
void void
logging::Enable(const nsAFlatCString& aModules) logging::Enable(const nsCString& aModules)
{ {
EnableLogging(aModules.get()); EnableLogging(aModules.get());
} }

View file

@ -209,7 +209,7 @@ void Stack();
/** /**
* Enable logging of the specified modules, all other modules aren't logged. * Enable logging of the specified modules, all other modules aren't logged.
*/ */
void Enable(const nsAFlatCString& aModules); void Enable(const nsCString& aModules);
/** /**
* Enable logging of modules specified by A11YLOG environment variable, * Enable logging of modules specified by A11YLOG environment variable,

View file

@ -633,9 +633,9 @@ nsCoreUtils::ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
} }
bool bool
nsCoreUtils::IsWhitespaceString(const nsSubstring& aString) nsCoreUtils::IsWhitespaceString(const nsAString& aString)
{ {
nsSubstring::const_char_iterator iterBegin, iterEnd; nsAString::const_char_iterator iterBegin, iterEnd;
aString.BeginReading(iterBegin); aString.BeginReading(iterBegin);
aString.EndReading(iterEnd); aString.EndReading(iterEnd);

View file

@ -299,7 +299,7 @@ public:
* only. In contrast to nsWhitespaceTokenizer class it takes into account * only. In contrast to nsWhitespaceTokenizer class it takes into account
* non-breaking space (0xa0). * non-breaking space (0xa0).
*/ */
static bool IsWhitespaceString(const nsSubstring& aString); static bool IsWhitespaceString(const nsAString& aString);
/** /**
* Returns true if the given character is whitespace symbol. * Returns true if the given character is whitespace symbol.

View file

@ -945,6 +945,10 @@ Accessible::Attributes()
NS_LITERAL_STRING("true")); NS_LITERAL_STRING("true"));
} }
// XXX: In ARIA 1.1, the value of aria-haspopup became a token (bug 1355449).
if (aria::UniversalStatesFor(mContent->AsElement()) & states::HASPOPUP)
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::haspopup, NS_LITERAL_STRING("true"));
// If there is no aria-live attribute then expose default value of 'live' // If there is no aria-live attribute then expose default value of 'live'
// object attribute used for ARIA role of this accessible. // object attribute used for ARIA role of this accessible.
const nsRoleMapEntry* roleMapEntry = ARIARoleMap(); const nsRoleMapEntry* roleMapEntry = ARIARoleMap();

View file

@ -38,7 +38,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
testAttrs("checkedTreeitem", {"checkable" : "true"}, true); testAttrs("checkedTreeitem", {"checkable" : "true"}, true);
testAttrs("dropeffect", {"dropeffect" : "copy"}, true); testAttrs("dropeffect", {"dropeffect" : "copy"}, true);
testAttrs("grabbed", {"grabbed" : "true"}, true); testAttrs("grabbed", {"grabbed" : "true"}, true);
testAbsentAttrs("haspopup", { "haspopup": "false" }); testAttrs("haspopupTrue", { "haspopup": "true" }, true);
testAbsentAttrs("haspopupFalse", { "haspopup": "false" });
testAbsentAttrs("haspopupEmpty", { "haspopup": "" });
testAttrs("hidden", {"hidden" : "true"}, true); testAttrs("hidden", {"hidden" : "true"}, true);
testAbsentAttrs("hidden_false", { "hidden": "false" }); testAbsentAttrs("hidden_false", { "hidden": "false" });
testAbsentAttrs("modal", {"modal" : "true"}); testAbsentAttrs("modal", {"modal" : "true"});
@ -214,7 +216,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
<div id="checkedTreeitem" role="treeitem" aria-checked="true"></div> <div id="checkedTreeitem" role="treeitem" aria-checked="true"></div>
<div id="dropeffect" aria-dropeffect="copy"></div> <div id="dropeffect" aria-dropeffect="copy"></div>
<div id="grabbed" aria-grabbed="true"></div> <div id="grabbed" aria-grabbed="true"></div>
<div id="haspopup" aria-haspopup="true"></div> <div id="haspopupTrue" aria-haspopup="true"></div>
<div id="haspopupFalse" aria-haspopup="false"></div>
<div id="haspopupEmpty" aria-haspopup=""></div>
<div id="hidden" aria-hidden="true"></div> <div id="hidden" aria-hidden="true"></div>
<div id="hidden_false" aria-hidden="false"></div> <div id="hidden_false" aria-hidden="false"></div>
<div id="modal" aria-modal="true"></div> <div id="modal" aria-modal="true"></div>

View file

@ -92,10 +92,17 @@ LazyInstantiator::GetRootAccessible(HWND aHwnd)
// a11y is running, so we just resolve the real root accessible. // a11y is running, so we just resolve the real root accessible.
a11y::Accessible* rootAcc = widget::WinUtils::GetRootAccessibleForHWND(aHwnd); a11y::Accessible* rootAcc = widget::WinUtils::GetRootAccessibleForHWND(aHwnd);
if (!rootAcc || !rootAcc->IsRoot()) { if (!rootAcc) {
return nullptr; return nullptr;
} }
if (!rootAcc->IsRoot()) {
// rootAcc might represent a popup as opposed to a true root accessible.
// In that case we just use the regular Accessible::GetNativeInterface.
rootAcc->GetNativeInterface(getter_AddRefs(result));
return result.forget();
}
// Subtle: rootAcc might still be wrapped by a LazyInstantiator, but we // Subtle: rootAcc might still be wrapped by a LazyInstantiator, but we
// don't need LazyInstantiator's capabilities anymore (since a11y is already // don't need LazyInstantiator's capabilities anymore (since a11y is already
// running). We can bypass LazyInstantiator by retrieving the internal // running). We can bypass LazyInstantiator by retrieving the internal

View file

@ -1,5 +1,5 @@
This is the PDF.js project output, https://github.com/mozilla/pdf.js This is the PDF.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.8.467 Current extension version is: 1.8.480
Taken from upstream commit: 679ffc84 Taken from upstream commit: 2f2e539b

View file

@ -3656,8 +3656,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.467'; exports.version = version = '1.8.480';
exports.build = build = '679ffc84'; exports.build = build = '2f2e539b';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort; exports.LoopbackPort = LoopbackPort;
@ -4659,8 +4659,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.467'; PDFJS.version = '1.8.480';
PDFJS.build = '679ffc84'; PDFJS.build = '2f2e539b';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -10007,8 +10007,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.467'; var pdfjsVersion = '1.8.480';
var pdfjsBuild = '679ffc84'; var pdfjsBuild = '2f2e539b';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(8); var pdfjsDisplayGlobal = __w_pdfjs_require__(8);
var pdfjsDisplayAPI = __w_pdfjs_require__(3); var pdfjsDisplayAPI = __w_pdfjs_require__(3);

View file

@ -39776,8 +39776,8 @@ exports.Type1Parser = Type1Parser;
"use strict"; "use strict";
var pdfjsVersion = '1.8.467'; var pdfjsVersion = '1.8.480';
var pdfjsBuild = '679ffc84'; var pdfjsBuild = '2f2e539b';
var pdfjsCoreWorker = __w_pdfjs_require__(17); var pdfjsCoreWorker = __w_pdfjs_require__(17);
; ;
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

View file

@ -242,6 +242,10 @@
display: block; display: block;
} }
.pdfViewer .page canvas[hidden] {
display: none;
}
.pdfViewer .page .loadingIcon { .pdfViewer .page .loadingIcon {
position: absolute; position: absolute;
display: block; display: block;

View file

@ -874,7 +874,6 @@ var PDFViewerApplication = {
secondaryToolbar: null, secondaryToolbar: null,
eventBus: null, eventBus: null,
l10n: null, l10n: null,
pageRotation: 0,
isInitialViewSet: false, isInitialViewSet: false,
downloadComplete: false, downloadComplete: false,
viewerPrefs: { viewerPrefs: {
@ -1100,6 +1099,9 @@ var PDFViewerApplication = {
get pagesCount() { get pagesCount() {
return this.pdfDocument ? this.pdfDocument.numPages : 0; return this.pdfDocument ? this.pdfDocument.numPages : 0;
}, },
get pageRotation() {
return this.pdfViewer.pagesRotation;
},
set page(val) { set page(val) {
this.pdfViewer.currentPageNumber = val; this.pdfViewer.currentPageNumber = val;
}, },
@ -1206,7 +1208,6 @@ var PDFViewerApplication = {
this.pdfDocumentProperties.setDocument(null, null); this.pdfDocumentProperties.setDocument(null, null);
} }
this.store = null; this.store = null;
this.pageRotation = 0;
this.isInitialViewSet = false; this.isInitialViewSet = false;
this.downloadComplete = false; this.downloadComplete = false;
this.pdfSidebar.reset(); this.pdfSidebar.reset();
@ -1623,12 +1624,13 @@ var PDFViewerApplication = {
if (!this.pdfDocument) { if (!this.pdfDocument) {
return; return;
} }
let pageNumber = this.page; let { pdfViewer, pdfThumbnailViewer } = this;
this.pageRotation = (this.pageRotation + 360 + delta) % 360; let pageNumber = pdfViewer.currentPageNumber;
this.pdfViewer.pagesRotation = this.pageRotation; let newRotation = (pdfViewer.pagesRotation + 360 + delta) % 360;
this.pdfThumbnailViewer.pagesRotation = this.pageRotation; pdfViewer.pagesRotation = newRotation;
pdfThumbnailViewer.pagesRotation = newRotation;
this.forceRendering(); this.forceRendering();
this.pdfViewer.currentPageNumber = pageNumber; pdfViewer.currentPageNumber = pageNumber;
}, },
requestPresentationMode: function pdfViewRequestPresentationMode() { requestPresentationMode: function pdfViewRequestPresentationMode() {
if (!this.pdfPresentationMode) { if (!this.pdfPresentationMode) {
@ -5024,7 +5026,7 @@ class PDFPageView {
}); });
return; return;
} }
if (!this.zoomLayer) { if (!this.zoomLayer && !this.canvas.hasAttribute('hidden')) {
this.zoomLayer = this.canvas.parentNode; this.zoomLayer = this.canvas.parentNode;
this.zoomLayer.style.position = 'absolute'; this.zoomLayer.style.position = 'absolute';
} }
@ -7648,11 +7650,11 @@ exports.Toolbar = undefined;
var _ui_utils = __webpack_require__(0); var _ui_utils = __webpack_require__(0);
var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading'; const PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
var SCALE_SELECT_CONTAINER_PADDING = 8; const SCALE_SELECT_CONTAINER_PADDING = 8;
var SCALE_SELECT_PADDING = 22; const SCALE_SELECT_PADDING = 22;
var Toolbar = function ToolbarClosure() { class Toolbar {
function Toolbar(options, mainContainer, eventBus, l10n = _ui_utils.NullL10n) { constructor(options, mainContainer, eventBus, l10n = _ui_utils.NullL10n) {
this.toolbar = options.container; this.toolbar = options.container;
this.mainContainer = mainContainer; this.mainContainer = mainContainer;
this.eventBus = eventBus; this.eventBus = eventBus;
@ -7662,22 +7664,21 @@ var Toolbar = function ToolbarClosure() {
this.reset(); this.reset();
this._bindListeners(); this._bindListeners();
} }
Toolbar.prototype = {
setPageNumber(pageNumber, pageLabel) { setPageNumber(pageNumber, pageLabel) {
this.pageNumber = pageNumber; this.pageNumber = pageNumber;
this.pageLabel = pageLabel; this.pageLabel = pageLabel;
this._updateUIState(false); this._updateUIState(false);
}, }
setPagesCount(pagesCount, hasPageLabels) { setPagesCount(pagesCount, hasPageLabels) {
this.pagesCount = pagesCount; this.pagesCount = pagesCount;
this.hasPageLabels = hasPageLabels; this.hasPageLabels = hasPageLabels;
this._updateUIState(true); this._updateUIState(true);
}, }
setPageScale(pageScaleValue, pageScale) { setPageScale(pageScaleValue, pageScale) {
this.pageScaleValue = pageScaleValue; this.pageScaleValue = pageScaleValue;
this.pageScale = pageScale; this.pageScale = pageScale;
this._updateUIState(false); this._updateUIState(false);
}, }
reset() { reset() {
this.pageNumber = 0; this.pageNumber = 0;
this.pageLabel = null; this.pageLabel = null;
@ -7686,11 +7687,11 @@ var Toolbar = function ToolbarClosure() {
this.pageScaleValue = _ui_utils.DEFAULT_SCALE_VALUE; this.pageScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;
this.pageScale = _ui_utils.DEFAULT_SCALE; this.pageScale = _ui_utils.DEFAULT_SCALE;
this._updateUIState(true); this._updateUIState(true);
}, }
_bindListeners: function Toolbar_bindClickListeners() { _bindListeners() {
var eventBus = this.eventBus; let eventBus = this.eventBus;
var self = this; let self = this;
var items = this.items; let items = this.items;
items.previous.addEventListener('click', function () { items.previous.addEventListener('click', function () {
eventBus.dispatch('previouspage'); eventBus.dispatch('previouspage');
}); });
@ -7721,29 +7722,29 @@ var Toolbar = function ToolbarClosure() {
value: this.value value: this.value
}); });
}); });
items.presentationModeButton.addEventListener('click', function (e) { items.presentationModeButton.addEventListener('click', function () {
eventBus.dispatch('presentationmode'); eventBus.dispatch('presentationmode');
}); });
items.openFile.addEventListener('click', function (e) { items.openFile.addEventListener('click', function () {
eventBus.dispatch('openfile'); eventBus.dispatch('openfile');
}); });
items.print.addEventListener('click', function (e) { items.print.addEventListener('click', function () {
eventBus.dispatch('print'); eventBus.dispatch('print');
}); });
items.download.addEventListener('click', function (e) { items.download.addEventListener('click', function () {
eventBus.dispatch('download'); eventBus.dispatch('download');
}); });
items.scaleSelect.oncontextmenu = _ui_utils.noContextMenuHandler; items.scaleSelect.oncontextmenu = _ui_utils.noContextMenuHandler;
eventBus.on('localized', evt => { eventBus.on('localized', () => {
this._localized(); this._localized();
}); });
}, }
_localized: function Toolbar_localized() { _localized() {
this._wasLocalized = true; this._wasLocalized = true;
this._adjustScaleWidth(); this._adjustScaleWidth();
this._updateUIState(true); this._updateUIState(true);
}, }
_updateUIState: function Toolbar_updateUIState(resetNumPages) { _updateUIState(resetNumPages = false) {
if (!this._wasLocalized) { if (!this._wasLocalized) {
return; return;
} }
@ -7767,11 +7768,11 @@ var Toolbar = function ToolbarClosure() {
} }
}); });
}; };
var pageNumber = this.pageNumber; let pageNumber = this.pageNumber;
var scaleValue = (this.pageScaleValue || this.pageScale).toString(); let scaleValue = (this.pageScaleValue || this.pageScale).toString();
var scale = this.pageScale; let scale = this.pageScale;
var items = this.items; let items = this.items;
var pagesCount = this.pagesCount; let pagesCount = this.pagesCount;
if (resetNumPages) { if (resetNumPages) {
if (this.hasPageLabels) { if (this.hasPageLabels) {
items.pageNumber.type = 'text'; items.pageNumber.type = 'text';
@ -7799,33 +7800,31 @@ var Toolbar = function ToolbarClosure() {
items.zoomOut.disabled = scale <= _ui_utils.MIN_SCALE; items.zoomOut.disabled = scale <= _ui_utils.MIN_SCALE;
items.zoomIn.disabled = scale >= _ui_utils.MAX_SCALE; items.zoomIn.disabled = scale >= _ui_utils.MAX_SCALE;
selectScaleOption(scaleValue, scale); selectScaleOption(scaleValue, scale);
}, }
updateLoadingIndicatorState: function Toolbar_updateLoadingIndicatorState(loading) { updateLoadingIndicatorState(loading = false) {
var pageNumberInput = this.items.pageNumber; let pageNumberInput = this.items.pageNumber;
if (loading) { if (loading) {
pageNumberInput.classList.add(PAGE_NUMBER_LOADING_INDICATOR); pageNumberInput.classList.add(PAGE_NUMBER_LOADING_INDICATOR);
} else { } else {
pageNumberInput.classList.remove(PAGE_NUMBER_LOADING_INDICATOR); pageNumberInput.classList.remove(PAGE_NUMBER_LOADING_INDICATOR);
} }
}, }
_adjustScaleWidth: function Toolbar_adjustScaleWidth() { _adjustScaleWidth() {
var container = this.items.scaleSelectContainer; let container = this.items.scaleSelectContainer;
var select = this.items.scaleSelect; let select = this.items.scaleSelect;
_ui_utils.animationStarted.then(function () { _ui_utils.animationStarted.then(function () {
if (container.clientWidth === 0) { if (container.clientWidth === 0) {
container.setAttribute('style', 'display: inherit;'); container.setAttribute('style', 'display: inherit;');
} }
if (container.clientWidth > 0) { if (container.clientWidth > 0) {
select.setAttribute('style', 'min-width: inherit;'); select.setAttribute('style', 'min-width: inherit;');
var width = select.clientWidth + SCALE_SELECT_CONTAINER_PADDING; let width = select.clientWidth + SCALE_SELECT_CONTAINER_PADDING;
select.setAttribute('style', 'min-width: ' + (width + SCALE_SELECT_PADDING) + 'px;'); select.setAttribute('style', 'min-width: ' + (width + SCALE_SELECT_PADDING) + 'px;');
container.setAttribute('style', 'min-width: ' + width + 'px; ' + 'max-width: ' + width + 'px;'); container.setAttribute('style', 'min-width: ' + width + 'px; ' + 'max-width: ' + width + 'px;');
} }
}); });
} }
}; }
return Toolbar;
}();
exports.Toolbar = Toolbar; exports.Toolbar = Toolbar;
/***/ }), /***/ }),

View file

@ -1,7 +1,9 @@
[DEFAULT] [DEFAULT]
skip-if = os == 'android' skip-if = os == 'android'
support-files = support-files =
file_data.txt
file_disableScript.html file_disableScript.html
!/caps/tests/mochitest/file_data.txt
!/caps/tests/mochitest/file_disableScript.html !/caps/tests/mochitest/file_disableScript.html
[test_bug995943.xul] [test_bug995943.xul]

View file

@ -356,13 +356,11 @@ body {
:root.theme-dark .CodeMirror-scrollbar-filler { :root.theme-dark .CodeMirror-scrollbar-filler {
background: transparent; background: transparent;
} }
:root.theme-light, :root.theme-light, :root .theme-light {
:root .theme-light {
--search-overlays-semitransparent: rgba(221, 225, 228, 0.66); --search-overlays-semitransparent: rgba(221, 225, 228, 0.66);
} }
:root.theme-dark, :root.theme-dark, :root .theme-dark {
:root .theme-dark {
--search-overlays-semitransparent: rgba(42, 46, 56, 0.66); --search-overlays-semitransparent: rgba(42, 46, 56, 0.66);
} }
.debugger { .debugger {
@ -463,8 +461,7 @@ menuseparator {
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
.theme-dark, .theme-dark, .theme-light {
.theme-light {
--number-color: var(--theme-highlight-green); --number-color: var(--theme-highlight-green);
--string-color: var(--theme-highlight-orange); --string-color: var(--theme-highlight-orange);
--null-color: var(--theme-comment); --null-color: var(--theme-comment);
@ -506,10 +503,7 @@ menuseparator {
white-space: pre-wrap; white-space: pre-wrap;
} }
.objectBox-string, .objectBox-string, .objectBox-text, .objectLink-textNode, .objectBox-table {
.objectBox-text,
.objectLink-textNode,
.objectBox-table {
white-space: pre-wrap; white-space: pre-wrap;
} }
@ -525,9 +519,7 @@ menuseparator {
color: var(--string-color); color: var(--string-color);
} }
.objectLink-function, .objectLink-function, .objectBox-stackTrace, .objectLink-profile {
.objectBox-stackTrace,
.objectLink-profile {
color: var(--object-color); color: var(--object-color);
} }
@ -536,10 +528,7 @@ menuseparator {
color: var(--location-color); color: var(--location-color);
} }
.objectBox-null, .objectBox-null, .objectBox-undefined, .objectBox-hint, .logRowHint {
.objectBox-undefined,
.objectBox-hint,
.logRowHint {
font-style: italic; font-style: italic;
color: var(--null-color); color: var(--null-color);
} }
@ -583,21 +572,16 @@ menuseparator {
/******************************************************************************/ /******************************************************************************/
.objectLeftBrace, .objectLeftBrace, .objectRightBrace, .arrayLeftBracket, .arrayRightBracket {
.objectRightBrace,
.arrayLeftBracket,
.arrayRightBracket {
cursor: pointer; cursor: pointer;
font-weight: bold; font-weight: bold;
} }
.objectLeftBrace, .objectLeftBrace, .arrayLeftBracket {
.arrayLeftBracket {
margin-right: 4px; margin-right: 4px;
} }
.objectRightBrace, .objectRightBrace, .arrayRightBracket {
.arrayRightBracket {
margin-left: 4px; margin-left: 4px;
} }
@ -629,14 +613,12 @@ menuseparator {
font-style: normal; font-style: normal;
} }
.theme-dark .objectBox-object, .theme-dark .objectBox-object, .theme-light .objectBox-object {
.theme-light .objectBox-object {
font-weight: normal; font-weight: normal;
white-space: pre-wrap; white-space: pre-wrap;
} }
.theme-dark .caption, .theme-dark .caption, .theme-light .caption {
.theme-light .caption {
font-weight: normal; font-weight: normal;
} }
/* vim:set ts=2 sw=2 sts=2 et: */ /* vim:set ts=2 sw=2 sts=2 et: */
@ -727,7 +709,6 @@ menuseparator {
.split-box.dragging > .uncontrolled { .split-box.dragging > .uncontrolled {
pointer-events: none; pointer-events: none;
} }
.search-container { .search-container {
position: absolute; position: absolute;
top: 30px; top: 30px;
@ -747,37 +728,21 @@ menuseparator {
.theme-dark .result-list li .subtitle { .theme-dark .result-list li .subtitle {
color: var(--theme-comment-alt); color: var(--theme-comment-alt);
} }
.arrow, .folder, .domain, .file, .worker, .refresh, .add-button {
.arrow,
.folder,
.domain,
.file,
.worker,
.refresh,
.add-button {
fill: var(--theme-splitter-color); fill: var(--theme-splitter-color);
} }
.worker, .worker, .folder {
.folder {
position: relative; position: relative;
top: 2px; top: 2px;
} }
.domain, .domain, .file, .worker, .refresh, .add-button {
.file,
.worker,
.refresh,
.add-button {
position: relative; position: relative;
top: 1px; top: 1px;
} }
.domain svg, .domain svg, .folder svg, .worker svg, .refresh svg, .add-button svg {
.folder svg,
.worker svg,
.refresh svg,
.add-button svg {
width: 15px; width: 15px;
} }
@ -785,11 +750,7 @@ menuseparator {
width: 13px; width: 13px;
} }
.file svg, .file svg, .domain svg, .folder svg, .refresh svg, .worker svg {
.domain svg,
.folder svg,
.refresh svg,
.worker svg {
margin-inline-end: 5px; margin-inline-end: 5px;
} }
@ -818,7 +779,6 @@ html .arrow.expanded svg {
.arrow.hidden { .arrow.hidden {
visibility: hidden; visibility: hidden;
} }
.autocomplete { .autocomplete {
flex: 1; flex: 1;
width: 100%; width: 100%;
@ -894,7 +854,6 @@ html .arrow.expanded svg {
.close-btn.big .close svg { .close-btn.big .close svg {
width: 9px; width: 9px;
} }
.search-field { .search-field {
width: calc(100% - 1px); width: calc(100% - 1px);
height: 27px; height: 27px;
@ -936,20 +895,17 @@ html .arrow.expanded svg {
color: var(--theme-body-color-inactive); color: var(--theme-body-color-inactive);
} }
.search-field i.magnifying-glass, .search-field i.magnifying-glass, .search-field i.sad-face {
.search-field i.sad-face {
padding: 6px; padding: 6px;
width: 24px; width: 24px;
} }
.search-field.big i.magnifying-glass, .search-field.big i.magnifying-glass, .search-field.big i.sad-face {
.search-field.big i.sad-face {
padding: 14px; padding: 14px;
width: 40px; width: 40px;
} }
.search-field .magnifying-glass path, .search-field .magnifying-glass path, .search-field .magnifying-glass ellipse {
.search-field .magnifying-glass ellipse {
stroke: var(--theme-splitter-color); stroke: var(--theme-splitter-color);
} }
@ -1132,6 +1088,10 @@ html[dir="rtl"] .tree .node > div {
.tree-node button { .tree-node button {
position: fixed; position: fixed;
} }
.project-text-search {
flex-grow: 1;
}
.project-text-search .result { .project-text-search .result {
display: flex; display: flex;
margin-left: 20px; margin-left: 20px;
@ -1152,6 +1112,12 @@ html[dir="rtl"] .tree .node > div {
.project-text-search .result .line-number { .project-text-search .result .line-number {
padding-right: 5px; padding-right: 5px;
} }
.project-text-search .search-field {
display: flex;
align-self: stretch;
flex-grow: 1;
}
.sources-panel { .sources-panel {
flex: 1; flex: 1;
display: flex; display: flex;
@ -1267,19 +1233,25 @@ html[dir="rtl"] .tree .node > div {
border-top-color: transparent; border-top-color: transparent;
} }
.source-footer .tab.active path, .source-footer .tab.active path, .source-footer .tab:hover path {
.source-footer .tab:hover path {
fill: var(--theme-body-color); fill: var(--theme-body-color);
} }
.outline-list { .outline-list {
list-style-type: "-"; list-style-type: none;
padding-left: 0px;
width: 100%;
} }
.outline-list__element { .outline-list__element {
color: blue; color: blue;
padding-left: 0.5rem; padding-left: 1rem;
padding-right: 0.5rem;
cursor: pointer;
} }
.outline-list__element:hover {
background: var(--theme-toolbar-background-hover);
}
.function-signature { .function-signature {
line-height: 20px; line-height: 20px;
align-self: center; align-self: center;
@ -1334,27 +1306,23 @@ html[dir="rtl"] .tree .node > div {
.conditional-breakpoint-panel input:focus { .conditional-breakpoint-panel input:focus {
outline-width: 0; outline-width: 0;
} }
.toggle-button-start, .toggle-button-start, .toggle-button-end {
.toggle-button-end {
transform: translate(0, 2px); transform: translate(0, 2px);
transition: transform 0.25s ease-in-out; transition: transform 0.25s ease-in-out;
cursor: pointer; cursor: pointer;
padding: 5px 2px; padding: 5px 2px;
} }
.toggle-button-start.vertical, .toggle-button-start.vertical, .toggle-button-end.vertical {
.toggle-button-end.vertical {
padding: 4px 2px; padding: 4px 2px;
} }
.toggle-button-start svg, .toggle-button-start svg, .toggle-button-end svg {
.toggle-button-end svg {
width: 16px; width: 16px;
fill: var(--theme-comment); fill: var(--theme-comment);
} }
.theme-dark .toggle-button-start svg, .theme-dark .toggle-button-start svg, .theme-dark .toggle-button-end svg {
.theme-dark .toggle-button-end svg {
fill: var(--theme-comment-alt); fill: var(--theme-comment-alt);
} }
@ -1376,8 +1344,7 @@ html .toggle-button-end.vertical svg {
transform: rotate(-90deg); transform: rotate(-90deg);
} }
.toggle-button-start.collapsed, .toggle-button-start.collapsed, .toggle-button-end.collapsed {
.toggle-button-end.collapsed {
transform: rotate(180deg); transform: rotate(180deg);
} }
.source-footer { .source-footer {
@ -1590,8 +1557,7 @@ html .toggle-button-end.vertical svg {
position: absolute; position: absolute;
} }
.bracket-arrow::before, .bracket-arrow::before, .bracket-arrow::after {
.bracket-arrow::after {
content: ''; content: '';
height: 0; height: 0;
width: 0; width: 0;
@ -1749,7 +1715,6 @@ html .toggle-button-end.vertical svg {
--debug-line-border: rgb(145, 188, 219); --debug-line-border: rgb(145, 188, 219);
--editor-searchbar-height: 27px; --editor-searchbar-height: 27px;
--editor-second-searchbar-height: 27px; --editor-second-searchbar-height: 27px;
} }
.theme-dark .editor-wrapper { .theme-dark .editor-wrapper {
@ -1769,9 +1734,12 @@ html .toggle-button-end.vertical svg {
--theme-conditional-breakpoint-color: #ccd1d5; --theme-conditional-breakpoint-color: #ccd1d5;
} }
.out-of-scope .CodeMirror-line, .paused .in-scope .CodeMirror-line, .paused .in-scope .CodeMirror-linenumber {
.out-of-scope .CodeMirror-linenumber { opacity: 1;
opacity: 0.8; }
.paused .CodeMirror-line, .paused .CodeMirror-linenumber {
opacity: 0.7;
} }
/** /**
@ -1924,8 +1892,12 @@ html[dir="rtl"] .editor-mount {
} }
@keyframes fade-highlight-out { @keyframes fade-highlight-out {
0% { background-color: var(--theme-highlight-gray); } 0% {
100% { background-color: transparent; } background-color: var(--theme-highlight-gray);
}
100% {
background-color: transparent;
}
} }
.theme-dark .highlight-line .CodeMirror-line { .theme-dark .highlight-line .CodeMirror-line {
@ -1933,8 +1905,12 @@ html[dir="rtl"] .editor-mount {
} }
@keyframes fade-highlight-out-dark { @keyframes fade-highlight-out-dark {
0% { background-color: var(--theme-content-color3); } 0% {
100% { background-color: transparent; } background-color: var(--theme-content-color3);
}
100% {
background-color: transparent;
}
} }
.welcomebox { .welcomebox {
@ -2077,8 +2053,7 @@ html .breakpoints-list .breakpoint.paused {
order: 3; order: 3;
} }
:root.theme-light .breakpoint-snippet, :root.theme-light .breakpoint-snippet, :root.theme-firebug .breakpoint-snippet {
:root.theme-firebug .breakpoint-snippet {
color: var(--theme-comment); color: var(--theme-comment);
} }
@ -2191,8 +2166,7 @@ html .breakpoints-list .breakpoint.paused {
.expression-error { .expression-error {
color: var(--theme-highlight-red); color: var(--theme-highlight-red);
} }
.frames ul .frames-group .group, .frames ul .frames-group .group, .frames ul .frames-group .group .location {
.frames ul .frames-group .group .location {
font-weight: 500; font-weight: 500;
} }
@ -2213,7 +2187,6 @@ html .breakpoints-list .breakpoint.paused {
border-top: 1px solid var(--theme-splitter-color); border-top: 1px solid var(--theme-splitter-color);
border-bottom: 1px solid var(--theme-splitter-color); border-bottom: 1px solid var(--theme-splitter-color);
} }
.why-paused { .why-paused {
background-color: var(--theme-body-background); background-color: var(--theme-body-background);
color: var(--theme-body-color); color: var(--theme-body-color);
@ -2279,8 +2252,7 @@ html .breakpoints-list .breakpoint.paused {
margin: 0; margin: 0;
} }
:root.theme-light .frames .location, :root.theme-light .frames .location, :root.theme-firebug .frames .location {
:root.theme-firebug .frames .location {
color: var(--theme-comment); color: var(--theme-comment);
} }
@ -2295,14 +2267,12 @@ html .breakpoints-list .breakpoint.paused {
margin-right: 1em; margin-right: 1em;
} }
.frames ul li:hover, .frames ul li:hover, .frames ul li:focus {
.frames ul li:focus {
background-color: var(--theme-toolbar-background-alt); background-color: var(--theme-toolbar-background-alt);
outline: none; outline: none;
} }
.theme-dark .frames ul li:hover, .theme-dark .frames ul li:hover, .theme-dark .frames ul li:focus {
.theme-dark .frames ul li:focus {
background-color: var(--theme-tab-toolbar-background); background-color: var(--theme-tab-toolbar-background);
} }
@ -2424,8 +2394,7 @@ html .breakpoints-list .breakpoint.paused {
background-color: var(--theme-toolbar-background-hover); background-color: var(--theme-toolbar-background-hover);
} }
.accordion ._header button svg, .accordion ._header button svg, .accordion ._header:hover button svg {
.accordion ._header:hover button svg {
fill: currentColor; fill: currentColor;
height: 16px; height: 16px;
} }
@ -2489,7 +2458,6 @@ html[dir="rtl"] .command-bar {
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
text-align: center; text-align: center;
transition: all 0.25s ease;
padding: 8px 5px; padding: 8px 5px;
position: relative; position: relative;
fill: currentColor; fill: currentColor;
@ -2507,8 +2475,12 @@ html[dir="rtl"] .command-bar {
margin-inline-end: 0.7em; margin-inline-end: 0.7em;
} }
.command-bar > button:focus {
outline: none;
}
html .command-bar > button:disabled { html .command-bar > button:disabled {
opacity: 0.3; opacity: 0.8;
cursor: default; cursor: default;
} }
@ -2538,7 +2510,6 @@ html .command-bar > button:disabled {
.command-bar button.pause-exceptions.all { .command-bar button.pause-exceptions.all {
color: var(--theme-highlight-blue); color: var(--theme-highlight-blue);
} }
.object-node.default-property { .object-node.default-property {
opacity: 0.6; opacity: 0.6;
} }
@ -2689,8 +2660,7 @@ html .welcomebox .toggle-button-end.collapsed {
border-bottom-color: transparent; border-bottom-color: transparent;
} }
.source-tab.active path, .source-tab.active path, .source-tab:hover path {
.source-tab:hover path {
fill: var(--theme-body-color); fill: var(--theme-body-color);
} }
@ -2707,8 +2677,7 @@ html .welcomebox .toggle-button-end.collapsed {
fill: var(--theme-textbox-box-shadow); fill: var(--theme-textbox-box-shadow);
} }
.source-tab .blackBox, .source-tab .blackBox, .source-tab .prettyPrint {
.source-tab .prettyPrint {
line-height: 0; line-height: 0;
align-self: center; align-self: center;
} }

File diff suppressed because it is too large Load diff

View file

@ -55,7 +55,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ 0: /***/ 0:
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(1122); module.exports = __webpack_require__(1123);
/***/ }, /***/ },
@ -675,7 +675,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ }, /***/ },
/***/ 1122: /***/ 1123:
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
"use strict"; "use strict";

View file

@ -7,7 +7,10 @@
* Tests that a chrome debugger can be created in a new process. * Tests that a chrome debugger can be created in a new process.
*/ */
const { BrowserToolboxProcess } = Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", {}); const { BrowserToolboxProcess } = Cu.import(
"resource://devtools/client/framework/ToolboxProcess.jsm",
{}
);
let gProcess = undefined; let gProcess = undefined;
function initChromeDebugger() { function initChromeDebugger() {
@ -21,8 +24,11 @@ function initChromeDebugger() {
} }
function onClose() { function onClose() {
is(gProcess._dbgProcess.exitCode, (Services.appinfo.OS == "WINNT" ? -9 : -15), is(
"The remote debugger process didn't die cleanly."); gProcess._dbgProcess.exitCode,
Services.appinfo.OS == "WINNT" ? -9 : -15,
"The remote debugger process didn't die cleanly."
);
info("process exit value: " + gProcess._dbgProcess.exitCode); info("process exit value: " + gProcess._dbgProcess.exitCode);
@ -36,27 +42,36 @@ registerCleanupFunction(function() {
gProcess = null; gProcess = null;
}); });
add_task(function* () { add_task(function*() {
// Windows XP and 8.1 test slaves are terribly slow at this test. // Windows XP and 8.1 test slaves are terribly slow at this test.
requestLongerTimeout(5); requestLongerTimeout(5);
Services.prefs.setBoolPref("devtools.debugger.remote-enabled", true); Services.prefs.setBoolPref("devtools.debugger.remote-enabled", true);
gProcess = yield initChromeDebugger(); gProcess = yield initChromeDebugger();
ok(gProcess._dbgProcess, ok(
"The remote debugger process wasn't created properly!"); gProcess._dbgProcess,
ok(gProcess._dbgProcess.exitCode == null, "The remote debugger process wasn't created properly!"
"The remote debugger process isn't running!"); );
is(typeof gProcess._dbgProcess.pid, "number", ok(
"The remote debugger process doesn't have a pid (?!)"); gProcess._dbgProcess.exitCode == null,
"The remote debugger process isn't running!"
);
is(
typeof gProcess._dbgProcess.pid,
"number",
"The remote debugger process doesn't have a pid (?!)"
);
info("process location: " + gProcess._dbgProcess.location); info("process location: " + gProcess._dbgProcess.location);
info("process pid: " + gProcess._dbgProcess.pid); info("process pid: " + gProcess._dbgProcess.pid);
info("process name: " + gProcess._dbgProcess.processName); info("process name: " + gProcess._dbgProcess.processName);
info("process sig: " + gProcess._dbgProcess.processSignature); info("process sig: " + gProcess._dbgProcess.processSignature);
ok(gProcess._dbgProfilePath, ok(
"The remote debugger profile wasn't created properly!"); gProcess._dbgProfilePath,
"The remote debugger profile wasn't created properly!"
);
is( is(
gProcess._dbgProfilePath, gProcess._dbgProfilePath,

View file

@ -5,9 +5,9 @@
// matter if the source text doesn't exist yet or even if the source // matter if the source text doesn't exist yet or even if the source
// doesn't exist. // doesn't exist.
add_task(function* () { add_task(function*() {
const dbg = yield initDebugger("doc-scripts.html"); const dbg = yield initDebugger("doc-scripts.html");
const { selectors: { getSourceText }, getState } = dbg; const { selectors: { getSource }, getState } = dbg;
const sourceUrl = EXAMPLE_URL + "long.js"; const sourceUrl = EXAMPLE_URL + "long.js";
// The source itself doesn't even exist yet, and using // The source itself doesn't even exist yet, and using
@ -31,8 +31,11 @@ add_task(function* () {
yield selectSource(dbg, "long.js", 17); yield selectSource(dbg, "long.js", 17);
yield selectSource(dbg, "long.js", 18); yield selectSource(dbg, "long.js", 18);
assertHighlightLocation(dbg, "long.js", 18); assertHighlightLocation(dbg, "long.js", 18);
is(findAllElements(dbg, "highlightLine").length, 1, is(
"Only 1 line is highlighted"); findAllElements(dbg, "highlightLine").length,
1,
"Only 1 line is highlighted"
);
// Test jumping to a line in a source that exists but hasn't been // Test jumping to a line in a source that exists but hasn't been
// loaded yet. // loaded yet.
@ -41,8 +44,8 @@ add_task(function* () {
// Make sure the source is in the loading state, wait for it to be // Make sure the source is in the loading state, wait for it to be
// fully loaded, and check the highlighted line. // fully loaded, and check the highlighted line.
const simple1 = findSource(dbg, "simple1.js"); const simple1 = findSource(dbg, "simple1.js");
ok(getSourceText(getState(), simple1.id).get("loading")); ok(getSource(getState(), simple1.id).get("loading"));
yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT"); yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
ok(getSourceText(getState(), simple1.id).get("text")); ok(getSource(getState(), simple1.id).get("text"));
assertHighlightLocation(dbg, "simple1.js", 6); assertHighlightLocation(dbg, "simple1.js", 6);
}); });

View file

@ -58,13 +58,32 @@ add_task(function*() {
); );
// Make sure named eval sources appear in the list. // Make sure named eval sources appear in the list.
});
add_task(function*() {
const dbg = yield initDebugger("doc-sources.html");
const { selectors: { getSelectedSource }, getState } = dbg;
yield waitForSources(dbg, "simple1", "simple2", "nested-source", "long.js");
ContentTask.spawn(gBrowser.selectedBrowser, null, function() { ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
content.eval("window.evaledFunc = function() {} //# sourceURL=evaled.js"); content.eval("window.evaledFunc = function() {} //# sourceURL=evaled.js");
}); });
yield waitForSourceCount(dbg, 11); yield waitForSourceCount(dbg, 3);
is( is(
findElement(dbg, "sourceNode", 2).textContent, findElement(dbg, "sourceNode", 3).textContent,
"(no domain)",
"the folder exists"
);
// work around: the folder is rendered at the bottom, so we close the
// root folder and open the (no domain) folder
clickElement(dbg, "sourceArrow", 3);
yield waitForSourceCount(dbg, 4);
is(
findElement(dbg, "sourceNode", 4).textContent,
"evaled.js", "evaled.js",
"The eval script exists" "the eval script exists"
); );
}); });

View file

@ -283,8 +283,8 @@ function waitForPaused(dbg) {
// Make sure the source text is completely loaded for the // Make sure the source text is completely loaded for the
// source we are paused in. // source we are paused in.
const sourceId = pause && pause.frame && pause.frame.location.sourceId; const sourceId = pause && pause.frame && pause.frame.location.sourceId;
const sourceText = dbg.selectors.getSourceText(dbg.getState(), sourceId); const source = dbg.selectors.getSource(dbg.getState(), sourceId);
return sourceText && !sourceText.get("loading"); return source && source.has("loading") && !source.get("loading");
}); });
}); });
} }
@ -381,7 +381,7 @@ function findSource(dbg, url) {
function selectSource(dbg, url, line) { function selectSource(dbg, url, line) {
info("Selecting source: " + url); info("Selecting source: " + url);
const source = findSource(dbg, url); const source = findSource(dbg, url);
const hasText = !!dbg.selectors.getSourceText(dbg.getState(), source.id); const hasText = !!source.text && !source.loading;
dbg.actions.selectSource(source.id, { line }); dbg.actions.selectSource(source.id, { line });
if (!hasText) { if (!hasText) {

View file

@ -38,8 +38,8 @@ pref("devtools.debugger.start-panel-collapsed", false);
pref("devtools.debugger.end-panel-collapsed", false); pref("devtools.debugger.end-panel-collapsed", false);
pref("devtools.debugger.tabs", "[]"); pref("devtools.debugger.tabs", "[]");
pref("devtools.debugger.pending-selected-location", "{}"); pref("devtools.debugger.pending-selected-location", "{}");
pref("devtools.debugger.pending-breakpoints", "[]"); pref("devtools.debugger.pending-breakpoints", "{}");
pref("devtools.debugger.expressions", "[]"); pref("devtools.debugger.expressions", "[]");
pref("devtools.debugger.file-search-case-sensitive", true); pref("devtools.debugger.file-search-case-sensitive", false);
pref("devtools.debugger.file-search-whole-word", false ); pref("devtools.debugger.file-search-whole-word", false );
pref("devtools.debugger.file-search-regex-match", false); pref("devtools.debugger.file-search-regex-match", false);

View file

@ -11427,7 +11427,7 @@ nsDocShell::AddHeadersToChannel(nsIInputStream* aHeadersData,
return NS_OK; return NS_OK;
} }
const nsCSubstring& oneHeader = StringHead(headersString, crlf); const nsACString& oneHeader = StringHead(headersString, crlf);
colon = oneHeader.FindChar(':'); colon = oneHeader.FindChar(':');
if (colon == kNotFound) { if (colon == kNotFound) {

View file

@ -98,7 +98,7 @@ DOMImplementation::CreateDocument(const nsAString& aNamespaceURI,
nsresult rv; nsresult rv;
if (!aQualifiedName.IsEmpty()) { if (!aQualifiedName.IsEmpty()) {
const nsAFlatString& qName = PromiseFlatString(aQualifiedName); const nsString& qName = PromiseFlatString(aQualifiedName);
const char16_t *colon; const char16_t *colon;
rv = nsContentUtils::CheckQName(qName, true, &colon); rv = nsContentUtils::CheckQName(qName, true, &colon);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);

View file

@ -401,7 +401,7 @@ Navigator::GetAcceptLanguages(nsTArray<nsString>& aLanguages)
int32_t pos = 0; int32_t pos = 0;
bool first = true; bool first = true;
while (localeTokenizer.hasMoreTokens()) { while (localeTokenizer.hasMoreTokens()) {
const nsSubstring& code = localeTokenizer.nextToken(); const nsAString& code = localeTokenizer.nextToken();
if (code.Length() == 2 && !first) { if (code.Length() == 2 && !first) {
nsAutoString upper(code); nsAutoString upper(code);

View file

@ -109,6 +109,13 @@ SelectionChangeListener::NotifySelectionChanged(nsIDOMDocument* aDoc,
mOldRanges.AppendElement(RawRangeData(sel->GetRangeAt(i))); mOldRanges.AppendElement(RawRangeData(sel->GetRangeAt(i)));
} }
if (doc) {
nsPIDOMWindowInner* inner = doc->GetInnerWindow();
if (inner && !inner->HasSelectionChangeEventListeners()) {
return NS_OK;
}
}
// If we are hiding changes, then don't do anything else. We do this after we // If we are hiding changes, then don't do anything else. We do this after we
// update mOldRanges so that changes after the changes stop being hidden don't // update mOldRanges so that changes after the changes stop being hidden don't
// incorrectly trigger a change, even though they didn't change anything // incorrectly trigger a change, even though they didn't change anything

View file

@ -0,0 +1,95 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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 "TimeoutBudgetManager.h"
#include "mozilla/dom/Timeout.h"
namespace mozilla {
namespace dom {
// Time between sampling timeout execution time.
const uint32_t kTelemetryPeriodMS = 1000;
/* static */ TimeoutBudgetManager&
TimeoutBudgetManager::Get()
{
static TimeoutBudgetManager gTimeoutBudgetManager;
return gTimeoutBudgetManager;
}
void
TimeoutBudgetManager::StartRecording(const TimeStamp& aNow)
{
mStart = aNow;
}
void
TimeoutBudgetManager::StopRecording()
{
mStart = TimeStamp();
}
void
TimeoutBudgetManager::RecordExecution(const TimeStamp& aNow,
const Timeout* aTimeout,
bool aIsBackground)
{
if (!mStart) {
// If we've started a sync operation mStart might be null, in
// which case we should not record this piece of execution.
return;
}
TimeDuration duration = aNow - mStart;
if (aIsBackground) {
if (aTimeout->mIsTracking) {
mTelemetryData.mBackgroundTracking += duration;
} else {
mTelemetryData.mBackgroundNonTracking += duration;
}
} else {
if (aTimeout->mIsTracking) {
mTelemetryData.mForegroundTracking += duration;
} else {
mTelemetryData.mForegroundNonTracking += duration;
}
}
}
void
TimeoutBudgetManager::Accumulate(Telemetry::HistogramID aId,
const TimeDuration& aSample)
{
uint32_t sample = std::round(aSample.ToMilliseconds());
if (sample) {
Telemetry::Accumulate(aId, sample);
}
}
void
TimeoutBudgetManager::MaybeCollectTelemetry(const TimeStamp& aNow)
{
if ((aNow - mLastCollection).ToMilliseconds() < kTelemetryPeriodMS) {
return;
}
Accumulate(Telemetry::TIMEOUT_EXECUTION_FG_TRACKING_MS,
mTelemetryData.mForegroundTracking);
Accumulate(Telemetry::TIMEOUT_EXECUTION_FG_MS,
mTelemetryData.mForegroundNonTracking);
Accumulate(Telemetry::TIMEOUT_EXECUTION_BG_TRACKING_MS,
mTelemetryData.mBackgroundTracking);
Accumulate(Telemetry::TIMEOUT_EXECUTION_BG_MS,
mTelemetryData.mBackgroundNonTracking);
mTelemetryData = TelemetryData();
mLastCollection = aNow;
}
} // namespace dom
} // namespace mozilla

View file

@ -0,0 +1,48 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_timeoutbudgetmanager_h
#define mozilla_dom_timeoutbudgetmanager_h
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
namespace mozilla {
namespace dom {
class Timeout;
class TimeoutBudgetManager
{
public:
static TimeoutBudgetManager& Get();
void StartRecording(const TimeStamp& aNow);
void StopRecording();
void RecordExecution(const TimeStamp& aNow,
const Timeout* aTimeout,
bool aIsBackground);
void MaybeCollectTelemetry(const TimeStamp& aNow);
private:
TimeoutBudgetManager() : mLastCollection(TimeStamp::Now()) {}
struct TelemetryData
{
TimeDuration mForegroundTracking;
TimeDuration mForegroundNonTracking;
TimeDuration mBackgroundTracking;
TimeDuration mBackgroundNonTracking;
};
void Accumulate(Telemetry::HistogramID aId, const TimeDuration& aSample);
TelemetryData mTelemetryData;
TimeStamp mStart;
TimeStamp mLastCollection;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_timeoutbudgetmanager_h

View file

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "TimeoutHandler.h" #include "TimeoutHandler.h"
#include "nsJSUtils.h"
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {

View file

@ -10,6 +10,8 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsISupports.h" #include "nsISupports.h"
#include "nsITimeoutHandler.h" #include "nsITimeoutHandler.h"
#include "nsCycleCollectionParticipant.h"
#include "nsString.h"
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {

View file

@ -14,118 +14,13 @@
#include "mozilla/dom/TabGroup.h" #include "mozilla/dom/TabGroup.h"
#include "OrderedTimeoutIterator.h" #include "OrderedTimeoutIterator.h"
#include "TimeoutExecutor.h" #include "TimeoutExecutor.h"
#include "TimeoutBudgetManager.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
static LazyLogModule gLog("Timeout"); static LazyLogModule gLog("Timeout");
// Time between sampling timeout execution time.
const uint32_t kTelemetryPeriodMS = 1000;
class TimeoutTelemetry
{
public:
static TimeoutTelemetry& Get();
TimeoutTelemetry() : mLastCollection(TimeStamp::Now()) {}
void StartRecording(TimeStamp aNow);
void StopRecording();
void RecordExecution(TimeStamp aNow, Timeout* aTimeout, bool aIsBackground);
void MaybeCollectTelemetry(TimeStamp aNow);
private:
struct TelemetryData
{
TimeDuration mForegroundTracking;
TimeDuration mForegroundNonTracking;
TimeDuration mBackgroundTracking;
TimeDuration mBackgroundNonTracking;
};
void Accumulate(Telemetry::HistogramID aId, TimeDuration aSample);
TelemetryData mTelemetryData;
TimeStamp mStart;
TimeStamp mLastCollection;
};
static TimeoutTelemetry gTimeoutTelemetry;
/* static */ TimeoutTelemetry&
TimeoutTelemetry::Get()
{
return gTimeoutTelemetry;
}
void
TimeoutTelemetry::StartRecording(TimeStamp aNow)
{
mStart = aNow;
}
void
TimeoutTelemetry::StopRecording()
{
mStart = TimeStamp();
}
void
TimeoutTelemetry::RecordExecution(TimeStamp aNow,
Timeout* aTimeout,
bool aIsBackground)
{
if (!mStart) {
// If we've started a sync operation mStart might be null, in
// which case we should not record this piece of execution.
return;
}
TimeDuration duration = aNow - mStart;
if (aIsBackground) {
if (aTimeout->mIsTracking) {
mTelemetryData.mBackgroundTracking += duration;
} else {
mTelemetryData.mBackgroundNonTracking += duration;
}
} else {
if (aTimeout->mIsTracking) {
mTelemetryData.mForegroundTracking += duration;
} else {
mTelemetryData.mForegroundNonTracking += duration;
}
}
}
void
TimeoutTelemetry::Accumulate(Telemetry::HistogramID aId, TimeDuration aSample)
{
uint32_t sample = std::round(aSample.ToMilliseconds());
if (sample) {
Telemetry::Accumulate(aId, sample);
}
}
void
TimeoutTelemetry::MaybeCollectTelemetry(TimeStamp aNow)
{
if ((aNow - mLastCollection).ToMilliseconds() < kTelemetryPeriodMS) {
return;
}
Accumulate(Telemetry::TIMEOUT_EXECUTION_FG_TRACKING_MS,
mTelemetryData.mForegroundTracking);
Accumulate(Telemetry::TIMEOUT_EXECUTION_FG_MS,
mTelemetryData.mForegroundNonTracking);
Accumulate(Telemetry::TIMEOUT_EXECUTION_BG_TRACKING_MS,
mTelemetryData.mBackgroundTracking);
Accumulate(Telemetry::TIMEOUT_EXECUTION_BG_MS,
mTelemetryData.mBackgroundNonTracking);
mTelemetryData = TelemetryData();
mLastCollection = aNow;
}
static int32_t gRunningTimeoutDepth = 0; static int32_t gRunningTimeoutDepth = 0;
// The default shortest interval/timeout we permit // The default shortest interval/timeout we permit
@ -251,6 +146,34 @@ TimeoutManager::CalculateDelay(Timeout* aTimeout) const {
return result; return result;
} }
void
TimeoutManager::RecordExecution(Timeout* aRunningTimeout,
Timeout* aTimeout)
{
if (mWindow.IsChromeWindow()) {
return;
}
TimeoutBudgetManager& budgetManager = TimeoutBudgetManager::Get();
TimeStamp now = TimeStamp::Now();
if (aRunningTimeout) {
// If we're running a timeout callback, record any execution until
// now.
budgetManager.RecordExecution(
now, aRunningTimeout, mWindow.IsBackgroundInternal());
budgetManager.MaybeCollectTelemetry(now);
}
if (aTimeout) {
// If we're starting a new timeout callback, start recording.
budgetManager.StartRecording(now);
} else {
// Else stop by clearing the start timestamp.
budgetManager.StopRecording();
}
}
#define TRACKING_SEPARATE_TIMEOUT_BUCKETING_STRATEGY 0 // Consider all timeouts coming from tracking scripts as tracking #define TRACKING_SEPARATE_TIMEOUT_BUCKETING_STRATEGY 0 // Consider all timeouts coming from tracking scripts as tracking
// These strategies are useful for testing. // These strategies are useful for testing.
#define ALL_NORMAL_TIMEOUT_BUCKETING_STRATEGY 1 // Consider all timeouts as normal #define ALL_NORMAL_TIMEOUT_BUCKETING_STRATEGY 1 // Consider all timeouts as normal
@ -904,22 +827,9 @@ TimeoutManager::BeginRunningTimeout(Timeout* aTimeout)
{ {
Timeout* currentTimeout = mRunningTimeout; Timeout* currentTimeout = mRunningTimeout;
mRunningTimeout = aTimeout; mRunningTimeout = aTimeout;
++gRunningTimeoutDepth; ++gRunningTimeoutDepth;
if (!mWindow.IsChromeWindow()) { RecordExecution(currentTimeout, aTimeout);
TimeStamp now = TimeStamp::Now();
if (currentTimeout) {
// If we're already running a timeout and start running another
// one, record the fragment duration already collected.
TimeoutTelemetry::Get().RecordExecution(
now, currentTimeout, IsBackground());
}
TimeoutTelemetry::Get().MaybeCollectTelemetry(now);
TimeoutTelemetry::Get().StartRecording(now);
}
return currentTimeout; return currentTimeout;
} }
@ -928,17 +838,7 @@ TimeoutManager::EndRunningTimeout(Timeout* aTimeout)
{ {
--gRunningTimeoutDepth; --gRunningTimeoutDepth;
if (!mWindow.IsChromeWindow()) { RecordExecution(mRunningTimeout, aTimeout);
TimeStamp now = TimeStamp::Now();
TimeoutTelemetry::Get().RecordExecution(now, mRunningTimeout, IsBackground());
if (aTimeout) {
// If we were running a nested timeout, restart the measurement
// from here.
TimeoutTelemetry::Get().StartRecording(now);
}
}
mRunningTimeout = aTimeout; mRunningTimeout = aTimeout;
} }
@ -1146,22 +1046,14 @@ TimeoutManager::BeginSyncOperation()
// equivalent to the period of us spinning up a new event loop, // equivalent to the period of us spinning up a new event loop,
// record what we have and stop recording until we reach // record what we have and stop recording until we reach
// EndSyncOperation. // EndSyncOperation.
if (!mWindow.IsChromeWindow()) { RecordExecution(mRunningTimeout, nullptr);
if (mRunningTimeout) {
TimeoutTelemetry::Get().RecordExecution(
TimeStamp::Now(), mRunningTimeout, IsBackground());
}
TimeoutTelemetry::Get().StopRecording();
}
} }
void void
TimeoutManager::EndSyncOperation() TimeoutManager::EndSyncOperation()
{ {
// If we're running a timeout, restart the measurement from here. // If we're running a timeout, restart the measurement from here.
if (!mWindow.IsChromeWindow() && mRunningTimeout) { RecordExecution(nullptr, mRunningTimeout);
TimeoutTelemetry::Get().StartRecording(TimeStamp::Now());
}
} }
nsIEventTarget* nsIEventTarget*

View file

@ -134,6 +134,9 @@ private:
TimeDuration TimeDuration
MinSchedulingDelay() const; MinSchedulingDelay() const;
void RecordExecution(mozilla::dom::Timeout* aRunningTimeout,
mozilla::dom::Timeout* aTimeout);
private: private:
struct Timeouts { struct Timeouts {
explicit Timeouts(const TimeoutManager& aManager) explicit Timeouts(const TimeoutManager& aManager)

View file

@ -353,6 +353,7 @@ UNIFIED_SOURCES += [
'TextInputProcessor.cpp', 'TextInputProcessor.cpp',
'ThirdPartyUtil.cpp', 'ThirdPartyUtil.cpp',
'Timeout.cpp', 'Timeout.cpp',
'TimeoutBudgetManager.cpp',
'TimeoutExecutor.cpp', 'TimeoutExecutor.cpp',
'TimeoutHandler.cpp', 'TimeoutHandler.cpp',
'TimeoutManager.cpp', 'TimeoutManager.cpp',

View file

@ -28,6 +28,7 @@
#include "mozilla/dom/nsMixedContentBlocker.h" #include "mozilla/dom/nsMixedContentBlocker.h"
#include "nsIContentSecurityPolicy.h" #include "nsIContentSecurityPolicy.h"
#include "mozilla/dom/TabGroup.h" #include "mozilla/dom/TabGroup.h"
#include "mozilla/TaskCategory.h"
using mozilla::LogLevel; using mozilla::LogLevel;
@ -139,7 +140,7 @@ nsContentPolicy::CheckPolicy(CPMethod policyMethod,
nsCOMPtr<nsIContentSecurityPolicy> csp; nsCOMPtr<nsIContentSecurityPolicy> csp;
requestPrincipal->GetCsp(getter_AddRefs(csp)); requestPrincipal->GetCsp(getter_AddRefs(csp));
if (csp && window) { if (csp && window) {
csp->EnsureEventTarget(window->EventTargetFor(TaskCategory::Other)); csp->EnsureEventTarget(window->EventTargetFor(mozilla::TaskCategory::Other));
} }
} }

View file

@ -356,7 +356,7 @@ nsContentSink::DoProcessLinkHeader()
// see <http://tools.ietf.org/html/rfc5988#section-5.2> // see <http://tools.ietf.org/html/rfc5988#section-5.2>
bool bool
nsContentSink::LinkContextIsOurDocument(const nsSubstring& aAnchor) nsContentSink::LinkContextIsOurDocument(const nsAString& aAnchor)
{ {
if (aAnchor.IsEmpty()) { if (aAnchor.IsEmpty()) {
// anchor parameter not present or empty -> same document reference // anchor parameter not present or empty -> same document reference
@ -680,10 +680,10 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
nsresult nsresult
nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref, nsContentSink::ProcessLink(const nsAString& aAnchor, const nsAString& aHref,
const nsSubstring& aRel, const nsSubstring& aTitle, const nsAString& aRel, const nsAString& aTitle,
const nsSubstring& aType, const nsSubstring& aMedia, const nsAString& aType, const nsAString& aMedia,
const nsSubstring& aCrossOrigin) const nsAString& aCrossOrigin)
{ {
uint32_t linkTypes = uint32_t linkTypes =
nsStyleLinkElement::ParseLinkTypes(aRel); nsStyleLinkElement::ParseLinkTypes(aRel);
@ -734,11 +734,11 @@ nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref,
nsresult nsresult
nsContentSink::ProcessStyleLink(nsIContent* aElement, nsContentSink::ProcessStyleLink(nsIContent* aElement,
const nsSubstring& aHref, const nsAString& aHref,
bool aAlternate, bool aAlternate,
const nsSubstring& aTitle, const nsAString& aTitle,
const nsSubstring& aType, const nsAString& aType,
const nsSubstring& aMedia) const nsAString& aMedia)
{ {
if (aAlternate && aTitle.IsEmpty()) { if (aAlternate && aTitle.IsEmpty()) {
// alternates must have title return without error, for now // alternates must have title return without error, for now

View file

@ -113,7 +113,7 @@ class nsContentSink : public nsICSSLoaderObserver,
virtual void UpdateChildCounts() = 0; virtual void UpdateChildCounts() = 0;
bool IsTimeToNotify(); bool IsTimeToNotify();
bool LinkContextIsOurDocument(const nsSubstring& aAnchor); bool LinkContextIsOurDocument(const nsAString& aAnchor);
bool Decode5987Format(nsAString& aEncoded); bool Decode5987Format(nsAString& aEncoded);
static void InitializeStatics(); static void InitializeStatics();
@ -151,17 +151,17 @@ protected:
nsresult ProcessHeaderData(nsIAtom* aHeader, const nsAString& aValue, nsresult ProcessHeaderData(nsIAtom* aHeader, const nsAString& aValue,
nsIContent* aContent = nullptr); nsIContent* aContent = nullptr);
nsresult ProcessLinkHeader(const nsAString& aLinkData); nsresult ProcessLinkHeader(const nsAString& aLinkData);
nsresult ProcessLink(const nsSubstring& aAnchor, nsresult ProcessLink(const nsAString& aAnchor,
const nsSubstring& aHref, const nsSubstring& aRel, const nsAString& aHref, const nsAString& aRel,
const nsSubstring& aTitle, const nsSubstring& aType, const nsAString& aTitle, const nsAString& aType,
const nsSubstring& aMedia, const nsSubstring& aCrossOrigin); const nsAString& aMedia, const nsAString& aCrossOrigin);
virtual nsresult ProcessStyleLink(nsIContent* aElement, virtual nsresult ProcessStyleLink(nsIContent* aElement,
const nsSubstring& aHref, const nsAString& aHref,
bool aAlternate, bool aAlternate,
const nsSubstring& aTitle, const nsAString& aTitle,
const nsSubstring& aType, const nsAString& aType,
const nsSubstring& aMedia); const nsAString& aMedia);
void PrefetchHref(const nsAString &aHref, nsINode *aSource, void PrefetchHref(const nsAString &aHref, nsINode *aSource,
bool aExplicit); bool aExplicit);

View file

@ -3263,7 +3263,7 @@ nsContentUtils::CheckQName(const nsAString& aQualifiedName,
//static //static
nsresult nsresult
nsContentUtils::SplitQName(const nsIContent* aNamespaceResolver, nsContentUtils::SplitQName(const nsIContent* aNamespaceResolver,
const nsAFlatString& aQName, const nsString& aQName,
int32_t *aNamespace, nsIAtom **aLocalName) int32_t *aNamespace, nsIAtom **aLocalName)
{ {
const char16_t* colon; const char16_t* colon;
@ -3302,7 +3302,7 @@ nsContentUtils::GetNodeInfoFromQName(const nsAString& aNamespaceURI,
uint16_t aNodeType, uint16_t aNodeType,
mozilla::dom::NodeInfo** aNodeInfo) mozilla::dom::NodeInfo** aNodeInfo)
{ {
const nsAFlatString& qName = PromiseFlatString(aQualifiedName); const nsString& qName = PromiseFlatString(aQualifiedName);
const char16_t* colon; const char16_t* colon;
nsresult rv = nsContentUtils::CheckQName(qName, true, &colon); nsresult rv = nsContentUtils::CheckQName(qName, true, &colon);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
@ -3955,7 +3955,7 @@ nsContentUtils::ReportToConsole(uint32_t aErrorFlags,
const char16_t **aParams, const char16_t **aParams,
uint32_t aParamsLength, uint32_t aParamsLength,
nsIURI* aURI, nsIURI* aURI,
const nsAFlatString& aSourceLine, const nsString& aSourceLine,
uint32_t aLineNumber, uint32_t aLineNumber,
uint32_t aColumnNumber) uint32_t aColumnNumber)
{ {
@ -3986,7 +3986,7 @@ nsContentUtils::ReportToConsoleNonLocalized(const nsAString& aErrorText,
const nsACString& aCategory, const nsACString& aCategory,
const nsIDocument* aDocument, const nsIDocument* aDocument,
nsIURI* aURI, nsIURI* aURI,
const nsAFlatString& aSourceLine, const nsString& aSourceLine,
uint32_t aLineNumber, uint32_t aLineNumber,
uint32_t aColumnNumber, uint32_t aColumnNumber,
MissingErrorLocationMode aLocationMode) MissingErrorLocationMode aLocationMode)
@ -4010,7 +4010,7 @@ nsContentUtils::ReportToConsoleByWindowID(const nsAString& aErrorText,
const nsACString& aCategory, const nsACString& aCategory,
uint64_t aInnerWindowID, uint64_t aInnerWindowID,
nsIURI* aURI, nsIURI* aURI,
const nsAFlatString& aSourceLine, const nsString& aSourceLine,
uint32_t aLineNumber, uint32_t aLineNumber,
uint32_t aColumnNumber, uint32_t aColumnNumber,
MissingErrorLocationMode aLocationMode) MissingErrorLocationMode aLocationMode)

View file

@ -163,8 +163,8 @@ extern const char kLoadAsData[];
// Stolen from nsReadableUtils, but that's OK, since we can declare the same // Stolen from nsReadableUtils, but that's OK, since we can declare the same
// name multiple times. // name multiple times.
const nsAFlatString& EmptyString(); const nsString& EmptyString();
const nsAFlatCString& EmptyCString(); const nsCString& EmptyCString();
enum EventNameType { enum EventNameType {
EventNameType_None = 0x0000, EventNameType_None = 0x0000,
@ -630,7 +630,7 @@ public:
const char16_t** aColon = nullptr); const char16_t** aColon = nullptr);
static nsresult SplitQName(const nsIContent* aNamespaceResolver, static nsresult SplitQName(const nsIContent* aNamespaceResolver,
const nsAFlatString& aQName, const nsString& aQName,
int32_t *aNamespace, nsIAtom **aLocalName); int32_t *aNamespace, nsIAtom **aLocalName);
static nsresult GetNodeInfoFromQName(const nsAString& aNamespaceURI, static nsresult GetNodeInfoFromQName(const nsAString& aNamespaceURI,
@ -922,7 +922,7 @@ public:
const nsACString& aCategory, const nsACString& aCategory,
const nsIDocument* aDocument, const nsIDocument* aDocument,
nsIURI* aURI = nullptr, nsIURI* aURI = nullptr,
const nsAFlatString& aSourceLine const nsString& aSourceLine
= EmptyString(), = EmptyString(),
uint32_t aLineNumber = 0, uint32_t aLineNumber = 0,
uint32_t aColumnNumber = 0, uint32_t aColumnNumber = 0,
@ -953,7 +953,7 @@ public:
const nsACString& aCategory, const nsACString& aCategory,
uint64_t aInnerWindowID, uint64_t aInnerWindowID,
nsIURI* aURI = nullptr, nsIURI* aURI = nullptr,
const nsAFlatString& aSourceLine const nsString& aSourceLine
= EmptyString(), = EmptyString(),
uint32_t aLineNumber = 0, uint32_t aLineNumber = 0,
uint32_t aColumnNumber = 0, uint32_t aColumnNumber = 0,
@ -1004,7 +1004,7 @@ public:
const char16_t **aParams = nullptr, const char16_t **aParams = nullptr,
uint32_t aParamsLength = 0, uint32_t aParamsLength = 0,
nsIURI* aURI = nullptr, nsIURI* aURI = nullptr,
const nsAFlatString& aSourceLine const nsString& aSourceLine
= EmptyString(), = EmptyString(),
uint32_t aLineNumber = 0, uint32_t aLineNumber = 0,
uint32_t aColumnNumber = 0); uint32_t aColumnNumber = 0);

View file

@ -80,7 +80,7 @@ nsDOMNavigationTiming::NotifyNavigationStart(DocShellState aDocShellState)
mNavigationStartHighRes = (double)PR_Now() / PR_USEC_PER_MSEC; mNavigationStartHighRes = (double)PR_Now() / PR_USEC_PER_MSEC;
mNavigationStartTimeStamp = TimeStamp::Now(); mNavigationStartTimeStamp = TimeStamp::Now();
mDocShellHasBeenActiveSinceNavigationStart = (aDocShellState == DocShellState::eActive); mDocShellHasBeenActiveSinceNavigationStart = (aDocShellState == DocShellState::eActive);
PROFILER_MARKER("Navigation::Start"); profiler_add_marker("Navigation::Start");
} }
void void
@ -169,7 +169,7 @@ nsDOMNavigationTiming::NotifyDOMLoading(nsIURI* aURI)
mDOMLoading = DurationFromStart(); mDOMLoading = DurationFromStart();
mDOMLoadingSet = true; mDOMLoadingSet = true;
PROFILER_MARKER("Navigation::DOMLoading"); profiler_add_marker("Navigation::DOMLoading");
if (IsTopLevelContentDocument()) { if (IsTopLevelContentDocument()) {
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_LOADING_MS, Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_LOADING_MS,
@ -186,7 +186,7 @@ nsDOMNavigationTiming::NotifyDOMInteractive(nsIURI* aURI)
mDOMInteractive = DurationFromStart(); mDOMInteractive = DurationFromStart();
mDOMInteractiveSet = true; mDOMInteractiveSet = true;
PROFILER_MARKER("Navigation::DOMInteractive"); profiler_add_marker("Navigation::DOMInteractive");
if (IsTopLevelContentDocument()) { if (IsTopLevelContentDocument()) {
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_INTERACTIVE_MS, Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_INTERACTIVE_MS,
@ -203,7 +203,7 @@ nsDOMNavigationTiming::NotifyDOMComplete(nsIURI* aURI)
mDOMComplete = DurationFromStart(); mDOMComplete = DurationFromStart();
mDOMCompleteSet = true; mDOMCompleteSet = true;
PROFILER_MARKER("Navigation::DOMComplete"); profiler_add_marker("Navigation::DOMComplete");
if (IsTopLevelContentDocument()) { if (IsTopLevelContentDocument()) {
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_COMPLETE_MS, Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_COMPLETE_MS,
@ -267,7 +267,7 @@ nsDOMNavigationTiming::NotifyNonBlankPaintForRootContentDocument()
nsPrintfCString marker("Non-blank paint after %dms for URL %s, %s", nsPrintfCString marker("Non-blank paint after %dms for URL %s, %s",
int(elapsed.ToMilliseconds()), spec.get(), int(elapsed.ToMilliseconds()), spec.get(),
mDocShellHasBeenActiveSinceNavigationStart ? "foreground tab" : "this tab was inactive some of the time between navigation start and first non-blank paint"); mDocShellHasBeenActiveSinceNavigationStart ? "foreground tab" : "this tab was inactive some of the time between navigation start and first non-blank paint");
PROFILER_MARKER(marker.get()); profiler_add_marker(marker.get());
} }
if (mDocShellHasBeenActiveSinceNavigationStart) { if (mDocShellHasBeenActiveSinceNavigationStart) {

View file

@ -2330,6 +2330,26 @@ nsDOMWindowUtils::GetLayerManagerRemote(bool* retval)
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP
nsDOMWindowUtils::GetUsingAdvancedLayers(bool* retval)
{
nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget) {
return NS_ERROR_FAILURE;
}
LayerManager *mgr = widget->GetLayerManager();
if (!mgr) {
return NS_ERROR_FAILURE;
}
*retval = false;
if (KnowsCompositor* fwd = mgr->AsKnowsCompositor()) {
*retval = fwd->GetTextureFactoryIdentifier().mUsingAdvancedLayers;
}
return NS_OK;
}
NS_IMETHODIMP NS_IMETHODIMP
nsDOMWindowUtils::GetSupportsHardwareH264Decoding(JS::MutableHandle<JS::Value> aPromise) nsDOMWindowUtils::GetSupportsHardwareH264Decoding(JS::MutableHandle<JS::Value> aPromise)
{ {
@ -3394,7 +3414,7 @@ PrepareForFullscreenChange(nsIPresShell* aPresShell, const nsSize& aSize,
NS_IMETHODIMP NS_IMETHODIMP
nsDOMWindowUtils::HandleFullscreenRequests(bool* aRetVal) nsDOMWindowUtils::HandleFullscreenRequests(bool* aRetVal)
{ {
PROFILER_MARKER("Enter fullscreen"); profiler_add_marker("Enter fullscreen");
nsCOMPtr<nsIDocument> doc = GetDocument(); nsCOMPtr<nsIDocument> doc = GetDocument();
NS_ENSURE_STATE(doc); NS_ENSURE_STATE(doc);
@ -3417,7 +3437,7 @@ nsDOMWindowUtils::HandleFullscreenRequests(bool* aRetVal)
nsresult nsresult
nsDOMWindowUtils::ExitFullscreen() nsDOMWindowUtils::ExitFullscreen()
{ {
PROFILER_MARKER("Exit fullscreen"); profiler_add_marker("Exit fullscreen");
nsCOMPtr<nsIDocument> doc = GetDocument(); nsCOMPtr<nsIDocument> doc = GetDocument();
NS_ENSURE_STATE(doc); NS_ENSURE_STATE(doc);

View file

@ -100,6 +100,8 @@
#include "mozilla/dom/Promise.h" #include "mozilla/dom/Promise.h"
#include "mozilla/dom/PromiseNativeHandler.h" #include "mozilla/dom/PromiseNativeHandler.h"
#include "mozilla/dom/HTMLBodyElement.h"
#include "ContentPrincipal.h" #include "ContentPrincipal.h"
#ifdef XP_WIN #ifdef XP_WIN
@ -270,7 +272,7 @@ nsFrameLoader::LoadFrame()
} }
nsCOMPtr<nsIURI> base_uri = mOwnerContent->GetBaseURI(); nsCOMPtr<nsIURI> base_uri = mOwnerContent->GetBaseURI();
const nsAFlatCString &doc_charset = doc->GetDocumentCharacterSet(); const nsCString& doc_charset = doc->GetDocumentCharacterSet();
const char *charset = doc_charset.IsEmpty() ? nullptr : doc_charset.get(); const char *charset = doc_charset.IsEmpty() ? nullptr : doc_charset.get();
nsCOMPtr<nsIURI> uri; nsCOMPtr<nsIURI> uri;

View file

@ -1521,12 +1521,13 @@ void
nsMessageManagerScriptExecutor::LoadScriptInternal(const nsAString& aURL, nsMessageManagerScriptExecutor::LoadScriptInternal(const nsAString& aURL,
bool aRunInGlobalScope) bool aRunInGlobalScope)
{ {
#ifdef MOZ_GECKO_PROFILER if (profiler_is_active()) {
NS_LossyConvertUTF16toASCII urlCStr(aURL); NS_LossyConvertUTF16toASCII urlCStr(aURL);
PROFILER_LABEL_DYNAMIC("nsMessageManagerScriptExecutor", "LoadScriptInternal", PROFILER_LABEL_DYNAMIC("nsMessageManagerScriptExecutor",
"LoadScriptInternal",
js::ProfileEntry::Category::OTHER, js::ProfileEntry::Category::OTHER,
urlCStr.get()); urlCStr.get());
#endif }
if (!mGlobal || !sCachedScripts) { if (!mGlobal || !sCachedScripts) {
return; return;

View file

@ -514,6 +514,7 @@ GK_ATOM(handheldFriendly, "HandheldFriendly")
GK_ATOM(handler, "handler") GK_ATOM(handler, "handler")
GK_ATOM(handlers, "handlers") GK_ATOM(handlers, "handlers")
GK_ATOM(HARD, "HARD") GK_ATOM(HARD, "HARD")
GK_ATOM(haspopup, "haspopup")
GK_ATOM(hasSameNode, "has-same-node") GK_ATOM(hasSameNode, "has-same-node")
GK_ATOM(hbox, "hbox") GK_ATOM(hbox, "hbox")
GK_ATOM(head, "head") GK_ATOM(head, "head")

View file

@ -998,6 +998,7 @@ nsPIDOMWindow<T>::nsPIDOMWindow(nsPIDOMWindowOuter *aOuterWindow)
mMutationBits(0), mIsDocumentLoaded(false), mMutationBits(0), mIsDocumentLoaded(false),
mIsHandlingResizeEvent(false), mIsInnerWindow(aOuterWindow != nullptr), mIsHandlingResizeEvent(false), mIsInnerWindow(aOuterWindow != nullptr),
mMayHavePaintEventListener(false), mMayHaveTouchEventListener(false), mMayHavePaintEventListener(false), mMayHaveTouchEventListener(false),
mMayHaveSelectionChangeEventListener(false),
mMayHaveMouseEnterLeaveEventListener(false), mMayHaveMouseEnterLeaveEventListener(false),
mMayHavePointerEnterLeaveEventListener(false), mMayHavePointerEnterLeaveEventListener(false),
mInnerObjectsFreed(false), mInnerObjectsFreed(false),
@ -6971,12 +6972,12 @@ FullscreenTransitionTask::Run()
return NS_OK; return NS_OK;
} }
if (stage == eBeforeToggle) { if (stage == eBeforeToggle) {
PROFILER_MARKER("Fullscreen transition start"); profiler_add_marker("Fullscreen transition start");
mWidget->PerformFullscreenTransition(nsIWidget::eBeforeFullscreenToggle, mWidget->PerformFullscreenTransition(nsIWidget::eBeforeFullscreenToggle,
mDuration.mFadeIn, mTransitionData, mDuration.mFadeIn, mTransitionData,
this); this);
} else if (stage == eToggleFullscreen) { } else if (stage == eToggleFullscreen) {
PROFILER_MARKER("Fullscreen toggle start"); profiler_add_marker("Fullscreen toggle start");
mFullscreenChangeStartTime = TimeStamp::Now(); mFullscreenChangeStartTime = TimeStamp::Now();
if (MOZ_UNLIKELY(mWindow->mFullScreen != mFullscreen)) { if (MOZ_UNLIKELY(mWindow->mFullScreen != mFullscreen)) {
// This could happen in theory if several fullscreen requests in // This could happen in theory if several fullscreen requests in
@ -7020,7 +7021,7 @@ FullscreenTransitionTask::Run()
mDuration.mFadeOut, mTransitionData, mDuration.mFadeOut, mTransitionData,
this); this);
} else if (stage == eEnd) { } else if (stage == eEnd) {
PROFILER_MARKER("Fullscreen transition end"); profiler_add_marker("Fullscreen transition end");
} }
return NS_OK; return NS_OK;
} }
@ -7041,7 +7042,7 @@ FullscreenTransitionTask::Observer::Observe(nsISupports* aSubject,
// The paint notification arrives first. Cancel the timer. // The paint notification arrives first. Cancel the timer.
mTask->mTimer->Cancel(); mTask->mTimer->Cancel();
shouldContinue = true; shouldContinue = true;
PROFILER_MARKER("Fullscreen toggle end"); profiler_add_marker("Fullscreen toggle end");
} }
} else { } else {
#ifdef DEBUG #ifdef DEBUG
@ -7052,7 +7053,7 @@ FullscreenTransitionTask::Observer::Observe(nsISupports* aSubject,
"Should only trigger this with the timer the task created"); "Should only trigger this with the timer the task created");
#endif #endif
shouldContinue = true; shouldContinue = true;
PROFILER_MARKER("Fullscreen toggle timeout"); profiler_add_marker("Fullscreen toggle timeout");
} }
if (shouldContinue) { if (shouldContinue) {
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService(); nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();

View file

@ -1128,7 +1128,7 @@ nsImageLoadingContent::StringToURI(const nsAString& aSpec,
nsCOMPtr<nsIURI> baseURL = thisContent->GetBaseURI(); nsCOMPtr<nsIURI> baseURL = thisContent->GetBaseURI();
// (2) Get the charset // (2) Get the charset
const nsAFlatCString &charset = aDocument->GetDocumentCharacterSet(); const nsCString& charset = aDocument->GetDocumentCharacterSet();
// (3) Construct the silly thing // (3) Construct the silly thing
return NS_NewURI(aURI, return NS_NewURI(aURI,

View file

@ -135,10 +135,8 @@ EvaluationExceptionToNSResult(JSContext* aCx)
nsJSUtils::ExecutionContext::ExecutionContext(JSContext* aCx, nsJSUtils::ExecutionContext::ExecutionContext(JSContext* aCx,
JS::Handle<JSObject*> aGlobal) JS::Handle<JSObject*> aGlobal)
: :
#ifdef MOZ_GECKO_PROFILER
mAutoProfilerLabel("nsJSUtils::ExecutionContext", /* dynamicStr */ nullptr, mAutoProfilerLabel("nsJSUtils::ExecutionContext", /* dynamicStr */ nullptr,
__LINE__, js::ProfileEntry::Category::JS), __LINE__, js::ProfileEntry::Category::JS),
#endif
mCx(aCx) mCx(aCx)
, mCompartment(aCx, aGlobal) , mCompartment(aCx, aGlobal)
, mRetValue(aCx) , mRetValue(aCx)

View file

@ -68,10 +68,8 @@ public:
// ExecutionContext is used to switch compartment. // ExecutionContext is used to switch compartment.
class MOZ_STACK_CLASS ExecutionContext { class MOZ_STACK_CLASS ExecutionContext {
#ifdef MOZ_GECKO_PROFILER
// Register stack annotations for the Gecko profiler. // Register stack annotations for the Gecko profiler.
mozilla::AutoProfilerLabel mAutoProfilerLabel; mozilla::AutoProfilerLabel mAutoProfilerLabel;
#endif
JSContext* mCx; JSContext* mCx;

View file

@ -543,6 +543,9 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
if (elm->MayHavePointerEnterLeaveEventListener()) { if (elm->MayHavePointerEnterLeaveEventListener()) {
window->SetHasPointerEnterLeaveEventListeners(); window->SetHasPointerEnterLeaveEventListeners();
} }
if (elm->MayHaveSelectionChangeEventListener()) {
window->SetHasSelectionChangeEventListeners();
}
} }
} }
} }

View file

@ -365,6 +365,24 @@ public:
} }
} }
/**
* Call this to indicate that some node (this window, its document,
* or content in that document) has a selectionchange event listener.
*/
void SetHasSelectionChangeEventListeners()
{
mMayHaveSelectionChangeEventListener = true;
}
/**
* Call this to check whether some node (this window, its document,
* or content in that document) has a selectionchange event listener.
*/
bool HasSelectionChangeEventListeners()
{
return mMayHaveSelectionChangeEventListener;
}
/** /**
* Moves the top-level window into fullscreen mode if aIsFullScreen is true, * Moves the top-level window into fullscreen mode if aIsFullScreen is true,
* otherwise exits fullscreen. * otherwise exits fullscreen.
@ -667,6 +685,7 @@ protected:
bool mIsInnerWindow; bool mIsInnerWindow;
bool mMayHavePaintEventListener; bool mMayHavePaintEventListener;
bool mMayHaveTouchEventListener; bool mMayHaveTouchEventListener;
bool mMayHaveSelectionChangeEventListener;
bool mMayHaveMouseEnterLeaveEventListener; bool mMayHaveMouseEnterLeaveEventListener;
bool mMayHavePointerEnterLeaveEventListener; bool mMayHavePointerEnterLeaveEventListener;

View file

@ -254,7 +254,6 @@ nsRange::nsRange(nsINode* aNode)
, mIsGenerated(false) , mIsGenerated(false)
, mStartOffsetWasIncremented(false) , mStartOffsetWasIncremented(false)
, mEndOffsetWasIncremented(false) , mEndOffsetWasIncremented(false)
, mEnableGravitationOnElementRemoval(true)
, mCalledByJS(false) , mCalledByJS(false)
#ifdef DEBUG #ifdef DEBUG
, mAssertNextInsertOrAppendIndex(-1) , mAssertNextInsertOrAppendIndex(-1)
@ -704,11 +703,6 @@ nsRange::ContentRemoved(nsIDocument* aDocument,
gravitateEnd = nsContentUtils::ContentIsDescendantOf(mEndParent, aChild); gravitateEnd = nsContentUtils::ContentIsDescendantOf(mEndParent, aChild);
} }
if (!mEnableGravitationOnElementRemoval) {
// Do not gravitate.
return;
}
if (gravitateStart || gravitateEnd) { if (gravitateStart || gravitateEnd) {
DoSetRange(gravitateStart ? container : mStartParent.get(), DoSetRange(gravitateStart ? container : mStartParent.get(),
gravitateStart ? aIndexInContainer : mStartOffset, gravitateStart ? aIndexInContainer : mStartOffset,

View file

@ -65,20 +65,6 @@ public:
return mRefCnt; return mRefCnt;
} }
/**
* The DOM Range spec requires that when a node is removed from its parent,
* and the node's subtree contains the start or end point of a range, that
* start or end point is moved up to where the node was removed from its
* parent.
* For some internal uses of Ranges it's useful to disable that behavior,
* so that a range of children within a single parent is preserved even if
* that parent is removed from the document tree.
*/
void SetEnableGravitationOnElementRemoval(bool aEnable)
{
mEnableGravitationOnElementRemoval = aEnable;
}
// nsIDOMRange interface // nsIDOMRange interface
NS_DECL_NSIDOMRANGE NS_DECL_NSIDOMRANGE
@ -449,7 +435,6 @@ protected:
bool mIsGenerated : 1; bool mIsGenerated : 1;
bool mStartOffsetWasIncremented : 1; bool mStartOffsetWasIncremented : 1;
bool mEndOffsetWasIncremented : 1; bool mEndOffsetWasIncremented : 1;
bool mEnableGravitationOnElementRemoval : 1;
bool mCalledByJS : 1; bool mCalledByJS : 1;
#ifdef DEBUG #ifdef DEBUG
int32_t mAssertNextInsertOrAppendIndex; int32_t mAssertNextInsertOrAppendIndex;

View file

@ -1437,9 +1437,9 @@ nsXMLContentSerializer::AppendToStringConvertLF(const nsAString& aStr,
bool bool
nsXMLContentSerializer::AppendFormatedWrapped_WhitespaceSequence( nsXMLContentSerializer::AppendFormatedWrapped_WhitespaceSequence(
nsASingleFragmentString::const_char_iterator &aPos, nsAString::const_char_iterator &aPos,
const nsASingleFragmentString::const_char_iterator aEnd, const nsAString::const_char_iterator aEnd,
const nsASingleFragmentString::const_char_iterator aSequenceStart, const nsAString::const_char_iterator aSequenceStart,
bool &aMayIgnoreStartOfLineWhitespaceSequence, bool &aMayIgnoreStartOfLineWhitespaceSequence,
nsAString &aOutputStr) nsAString &aOutputStr)
{ {
@ -1515,9 +1515,9 @@ nsXMLContentSerializer::AppendFormatedWrapped_WhitespaceSequence(
bool bool
nsXMLContentSerializer::AppendWrapped_NonWhitespaceSequence( nsXMLContentSerializer::AppendWrapped_NonWhitespaceSequence(
nsASingleFragmentString::const_char_iterator &aPos, nsAString::const_char_iterator &aPos,
const nsASingleFragmentString::const_char_iterator aEnd, const nsAString::const_char_iterator aEnd,
const nsASingleFragmentString::const_char_iterator aSequenceStart, const nsAString::const_char_iterator aSequenceStart,
bool &aMayIgnoreStartOfLineWhitespaceSequence, bool &aMayIgnoreStartOfLineWhitespaceSequence,
bool &aSequenceStartAfterAWhiteSpace, bool &aSequenceStartAfterAWhiteSpace,
nsAString& aOutputStr) nsAString& aOutputStr)
@ -1680,14 +1680,14 @@ nsXMLContentSerializer::AppendWrapped_NonWhitespaceSequence(
} }
bool bool
nsXMLContentSerializer::AppendToStringFormatedWrapped(const nsASingleFragmentString& aStr, nsXMLContentSerializer::AppendToStringFormatedWrapped(const nsAString& aStr,
nsAString& aOutputStr) nsAString& aOutputStr)
{ {
if (mBodyOnly && !mInBody) { if (mBodyOnly && !mInBody) {
return true; return true;
} }
nsASingleFragmentString::const_char_iterator pos, end, sequenceStart; nsAString::const_char_iterator pos, end, sequenceStart;
aStr.BeginReading(pos); aStr.BeginReading(pos);
aStr.EndReading(end); aStr.EndReading(end);
@ -1729,9 +1729,9 @@ nsXMLContentSerializer::AppendToStringFormatedWrapped(const nsASingleFragmentStr
bool bool
nsXMLContentSerializer::AppendWrapped_WhitespaceSequence( nsXMLContentSerializer::AppendWrapped_WhitespaceSequence(
nsASingleFragmentString::const_char_iterator &aPos, nsAString::const_char_iterator &aPos,
const nsASingleFragmentString::const_char_iterator aEnd, const nsAString::const_char_iterator aEnd,
const nsASingleFragmentString::const_char_iterator aSequenceStart, const nsAString::const_char_iterator aSequenceStart,
nsAString &aOutputStr) nsAString &aOutputStr)
{ {
// Handle the complete sequence of whitespace. // Handle the complete sequence of whitespace.
@ -1741,7 +1741,7 @@ nsXMLContentSerializer::AppendWrapped_WhitespaceSequence(
mIsIndentationAddedOnCurrentLine = false; mIsIndentationAddedOnCurrentLine = false;
bool leaveLoop = false; bool leaveLoop = false;
nsASingleFragmentString::const_char_iterator lastPos = aPos; nsAString::const_char_iterator lastPos = aPos;
do { do {
switch (*aPos) { switch (*aPos) {
@ -1783,14 +1783,14 @@ nsXMLContentSerializer::AppendWrapped_WhitespaceSequence(
} }
bool bool
nsXMLContentSerializer::AppendToStringWrapped(const nsASingleFragmentString& aStr, nsXMLContentSerializer::AppendToStringWrapped(const nsAString& aStr,
nsAString& aOutputStr) nsAString& aOutputStr)
{ {
if (mBodyOnly && !mInBody) { if (mBodyOnly && !mInBody) {
return true; return true;
} }
nsASingleFragmentString::const_char_iterator pos, end, sequenceStart; nsAString::const_char_iterator pos, end, sequenceStart;
aStr.BeginReading(pos); aStr.BeginReading(pos);
aStr.EndReading(end); aStr.EndReading(end);

View file

@ -113,7 +113,7 @@ class nsXMLContentSerializer : public nsIContentSerializer {
* It updates the column position. * It updates the column position.
*/ */
MOZ_MUST_USE MOZ_MUST_USE
bool AppendToStringWrapped(const nsASingleFragmentString& aStr, bool AppendToStringWrapped(const nsAString& aStr,
nsAString& aOutputStr); nsAString& aOutputStr);
/** /**
@ -121,32 +121,32 @@ class nsXMLContentSerializer : public nsIContentSerializer {
* It updates the column position. * It updates the column position.
*/ */
MOZ_MUST_USE MOZ_MUST_USE
bool AppendToStringFormatedWrapped(const nsASingleFragmentString& aStr, bool AppendToStringFormatedWrapped(const nsAString& aStr,
nsAString& aOutputStr); nsAString& aOutputStr);
// used by AppendToStringWrapped // used by AppendToStringWrapped
MOZ_MUST_USE MOZ_MUST_USE
bool AppendWrapped_WhitespaceSequence( bool AppendWrapped_WhitespaceSequence(
nsASingleFragmentString::const_char_iterator &aPos, nsAString::const_char_iterator &aPos,
const nsASingleFragmentString::const_char_iterator aEnd, const nsAString::const_char_iterator aEnd,
const nsASingleFragmentString::const_char_iterator aSequenceStart, const nsAString::const_char_iterator aSequenceStart,
nsAString &aOutputStr); nsAString &aOutputStr);
// used by AppendToStringFormatedWrapped // used by AppendToStringFormatedWrapped
MOZ_MUST_USE MOZ_MUST_USE
bool AppendFormatedWrapped_WhitespaceSequence( bool AppendFormatedWrapped_WhitespaceSequence(
nsASingleFragmentString::const_char_iterator &aPos, nsAString::const_char_iterator &aPos,
const nsASingleFragmentString::const_char_iterator aEnd, const nsAString::const_char_iterator aEnd,
const nsASingleFragmentString::const_char_iterator aSequenceStart, const nsAString::const_char_iterator aSequenceStart,
bool &aMayIgnoreStartOfLineWhitespaceSequence, bool &aMayIgnoreStartOfLineWhitespaceSequence,
nsAString &aOutputStr); nsAString &aOutputStr);
// used by AppendToStringWrapped and AppendToStringFormatedWrapped // used by AppendToStringWrapped and AppendToStringFormatedWrapped
MOZ_MUST_USE MOZ_MUST_USE
bool AppendWrapped_NonWhitespaceSequence( bool AppendWrapped_NonWhitespaceSequence(
nsASingleFragmentString::const_char_iterator &aPos, nsAString::const_char_iterator &aPos,
const nsASingleFragmentString::const_char_iterator aEnd, const nsAString::const_char_iterator aEnd,
const nsASingleFragmentString::const_char_iterator aSequenceStart, const nsAString::const_char_iterator aSequenceStart,
bool &aMayIgnoreStartOfLineWhitespaceSequence, bool &aMayIgnoreStartOfLineWhitespaceSequence,
bool &aSequenceStartAfterAWhiteSpace, bool &aSequenceStartAfterAWhiteSpace,
nsAString &aOutputStr); nsAString &aOutputStr);

View file

@ -373,7 +373,7 @@ TypeUtils::ProcessURL(nsACString& aUrl, bool* aSchemeValidOut,
nsACString* aUrlWithoutQueryOut,nsACString* aUrlQueryOut, nsACString* aUrlWithoutQueryOut,nsACString* aUrlQueryOut,
ErrorResult& aRv) ErrorResult& aRv)
{ {
const nsAFlatCString& flatURL = PromiseFlatCString(aUrl); const nsCString& flatURL = PromiseFlatCString(aUrl);
const char* url = flatURL.get(); const char* url = flatURL.get();
// off the main thread URL parsing using nsStdURLParser. // off the main thread URL parsing using nsStdURLParser.

View file

@ -44,8 +44,8 @@ ChooseValidatorCompileOptions(const ShBuiltInResources& resources,
options |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS; options |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS;
#endif #endif
#ifdef XP_MACOSX
if (gl->WorkAroundDriverBugs()) { if (gl->WorkAroundDriverBugs()) {
#ifdef XP_MACOSX
// Work around https://bugs.webkit.org/show_bug.cgi?id=124684, // Work around https://bugs.webkit.org/show_bug.cgi?id=124684,
// https://chromium.googlesource.com/angle/angle/+/5e70cf9d0b1bb // https://chromium.googlesource.com/angle/angle/+/5e70cf9d0b1bb
options |= SH_UNFOLD_SHORT_CIRCUIT; options |= SH_UNFOLD_SHORT_CIRCUIT;
@ -57,10 +57,15 @@ ChooseValidatorCompileOptions(const ShBuiltInResources& resources,
// Work around that Intel drivers on Mac OSX handle for-loop incorrectly. // Work around that Intel drivers on Mac OSX handle for-loop incorrectly.
if (gl->Vendor() == gl::GLVendor::Intel) { if (gl->Vendor() == gl::GLVendor::Intel) {
options |= SH_ADD_AND_TRUE_TO_LOOP_CONDITION; options |= SH_ADD_AND_TRUE_TO_LOOP_CONDITION;
}
}
#endif #endif
if (!gl->IsANGLE() && gl->Vendor() == gl::GLVendor::Intel) {
// Failures on at least Windows+Intel+OGL on:
// conformance/glsl/constructors/glsl-construct-mat2.html
options |= SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS;
}
}
if (gfxPrefs::WebGLAllANGLEOptions()) { if (gfxPrefs::WebGLAllANGLEOptions()) {
options = -1; options = -1;

View file

@ -424,7 +424,7 @@ static bool IsMozBR(nsIContent* aContent)
return aContent->IsHTMLElement(nsGkAtoms::br) && !IsContentBR(aContent); return aContent->IsHTMLElement(nsGkAtoms::br) && !IsContentBR(aContent);
} }
static void ConvertToNativeNewlines(nsAFlatString& aString) static void ConvertToNativeNewlines(nsString& aString)
{ {
#if defined(XP_WIN) #if defined(XP_WIN)
aString.ReplaceSubstring(NS_LITERAL_STRING("\n"), NS_LITERAL_STRING("\r\n")); aString.ReplaceSubstring(NS_LITERAL_STRING("\n"), NS_LITERAL_STRING("\r\n"));
@ -664,7 +664,7 @@ ContentEventHandler::ShouldBreakLineBefore(nsIContent* aContent,
nsresult nsresult
ContentEventHandler::GenerateFlatTextContent(nsIContent* aContent, ContentEventHandler::GenerateFlatTextContent(nsIContent* aContent,
nsAFlatString& aString, nsString& aString,
LineBreakType aLineBreakType) LineBreakType aLineBreakType)
{ {
MOZ_ASSERT(aString.IsEmpty()); MOZ_ASSERT(aString.IsEmpty());
@ -680,7 +680,7 @@ ContentEventHandler::GenerateFlatTextContent(nsIContent* aContent,
nsresult nsresult
ContentEventHandler::GenerateFlatTextContent(nsRange* aRange, ContentEventHandler::GenerateFlatTextContent(nsRange* aRange,
nsAFlatString& aString, nsString& aString,
LineBreakType aLineBreakType) LineBreakType aLineBreakType)
{ {
MOZ_ASSERT(aString.IsEmpty()); MOZ_ASSERT(aString.IsEmpty());

View file

@ -246,11 +246,11 @@ protected:
// optimized for native IMEs. For example, <br> element and some block // optimized for native IMEs. For example, <br> element and some block
// elements causes "\n" (or "\r\n"), see also ShouldBreakLineBefore(). // elements causes "\n" (or "\r\n"), see also ShouldBreakLineBefore().
nsresult GenerateFlatTextContent(nsIContent* aContent, nsresult GenerateFlatTextContent(nsIContent* aContent,
nsAFlatString& aString, nsString& aString,
LineBreakType aLineBreakType); LineBreakType aLineBreakType);
// Get the contents of aRange as plain text. // Get the contents of aRange as plain text.
nsresult GenerateFlatTextContent(nsRange* aRange, nsresult GenerateFlatTextContent(nsRange* aRange,
nsAFlatString& aString, nsString& aString,
LineBreakType aLineBreakType); LineBreakType aLineBreakType);
// Get offset of start of aRange. Note that the result includes the length // Get offset of start of aRange. Note that the result includes the length
// of line breaker caused by the start of aContent because aRange never // of line breaker caused by the start of aContent because aRange never

View file

@ -666,12 +666,12 @@ PopupAllowedForEvent(const char *eventName)
nsDependentCString events(sPopupAllowedEvents); nsDependentCString events(sPopupAllowedEvents);
nsAFlatCString::const_iterator start, end; nsCString::const_iterator start, end;
nsAFlatCString::const_iterator startiter(events.BeginReading(start)); nsCString::const_iterator startiter(events.BeginReading(start));
events.EndReading(end); events.EndReading(end);
while (startiter != end) { while (startiter != end) {
nsAFlatCString::const_iterator enditer(end); nsCString::const_iterator enditer(end);
if (!FindInReadable(nsDependentCString(eventName), startiter, enditer)) if (!FindInReadable(nsDependentCString(eventName), startiter, enditer))
return false; return false;

View file

@ -130,6 +130,7 @@ EventListenerManagerBase::EventListenerManagerBase()
, mMayHavePointerEnterLeaveEventListener(false) , mMayHavePointerEnterLeaveEventListener(false)
, mMayHaveKeyEventListener(false) , mMayHaveKeyEventListener(false)
, mMayHaveInputOrCompositionEventListener(false) , mMayHaveInputOrCompositionEventListener(false)
, mMayHaveSelectionChangeEventListener(false)
, mClearingListeners(false) , mClearingListeners(false)
, mIsMainThreadELM(NS_IsMainThread()) , mIsMainThreadELM(NS_IsMainThread())
{ {
@ -417,6 +418,11 @@ EventListenerManager::AddEventListenerInternal(
if (!aFlags.mInSystemGroup) { if (!aFlags.mInSystemGroup) {
mMayHaveInputOrCompositionEventListener = true; mMayHaveInputOrCompositionEventListener = true;
} }
} else if (aEventMessage == eSelectionChange) {
mMayHaveSelectionChangeEventListener = true;
if (nsPIDOMWindowInner* window = GetInnerWindowForTarget()) {
window->SetHasSelectionChangeEventListeners();
}
} }
if (IsApzAwareListener(listener)) { if (IsApzAwareListener(listener)) {
@ -1299,12 +1305,10 @@ EventListenerManager::HandleEventInternal(nsPresContext* aPresContext,
TimeStamp endTime = TimeStamp::Now(); TimeStamp endTime = TimeStamp::Now();
uint16_t phase; uint16_t phase;
(*aDOMEvent)->GetEventPhase(&phase); (*aDOMEvent)->GetEventPhase(&phase);
PROFILER_MARKER_PAYLOAD( profiler_add_marker(
"DOMEvent", "DOMEvent",
MakeUnique<DOMEventMarkerPayload>(typeStr, phase, MakeUnique<DOMEventMarkerPayload>(typeStr, phase,
startTime, endTime)); startTime, endTime));
#else
MOZ_CRASH("Gecko Profiler is N/A but profiler_is_active() returned true");
#endif #endif
} else { } else {
rv = HandleEventSubType(listener, *aDOMEvent, aCurrentTarget); rv = HandleEventSubType(listener, *aDOMEvent, aCurrentTarget);

View file

@ -165,9 +165,10 @@ protected:
uint16_t mMayHavePointerEnterLeaveEventListener : 1; uint16_t mMayHavePointerEnterLeaveEventListener : 1;
uint16_t mMayHaveKeyEventListener : 1; uint16_t mMayHaveKeyEventListener : 1;
uint16_t mMayHaveInputOrCompositionEventListener : 1; uint16_t mMayHaveInputOrCompositionEventListener : 1;
uint16_t mMayHaveSelectionChangeEventListener : 1;
uint16_t mClearingListeners : 1; uint16_t mClearingListeners : 1;
uint16_t mIsMainThreadELM : 1; uint16_t mIsMainThreadELM : 1;
// uint16_t mUnused : 5; // uint16_t mUnused : 4;
}; };
/* /*
@ -441,6 +442,7 @@ public:
bool MayHaveMouseEnterLeaveEventListener() { return mMayHaveMouseEnterLeaveEventListener; } bool MayHaveMouseEnterLeaveEventListener() { return mMayHaveMouseEnterLeaveEventListener; }
bool MayHavePointerEnterLeaveEventListener() { return mMayHavePointerEnterLeaveEventListener; } bool MayHavePointerEnterLeaveEventListener() { return mMayHavePointerEnterLeaveEventListener; }
bool MayHaveSelectionChangeEventListener() { return mMayHaveSelectionChangeEventListener; }
/** /**
* Returns true if there may be a key event listener (keydown, keypress, * Returns true if there may be a key event listener (keydown, keypress,

View file

@ -1403,7 +1403,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTM
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcMediaSource) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcMediaSource)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcStream) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcStream)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcAttrStream) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcAttrStream)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourcePointer)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLoadBlockedDoc) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLoadBlockedDoc)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceLoadCandidate) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceLoadCandidate)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAudioChannelWrapper) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAudioChannelWrapper)
@ -1422,6 +1421,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTM
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLElement) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLElement)
tmp->RemoveMutationObserver(tmp);
if (tmp->mSrcStream) { if (tmp->mSrcStream) {
// Need to EndMediaStreamPlayback to clear mSrcStream and make sure everything // Need to EndMediaStreamPlayback to clear mSrcStream and make sure everything
// gets unhooked correctly. // gets unhooked correctly.
@ -1430,7 +1430,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLE
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSrcAttrStream) NS_IMPL_CYCLE_COLLECTION_UNLINK(mSrcAttrStream)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMediaSource) NS_IMPL_CYCLE_COLLECTION_UNLINK(mMediaSource)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSrcMediaSource) NS_IMPL_CYCLE_COLLECTION_UNLINK(mSrcMediaSource)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSourcePointer)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mLoadBlockedDoc) NS_IMPL_CYCLE_COLLECTION_UNLINK(mLoadBlockedDoc)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSourceLoadCandidate) NS_IMPL_CYCLE_COLLECTION_UNLINK(mSourceLoadCandidate)
if (tmp->mAudioChannelWrapper) { if (tmp->mAudioChannelWrapper) {
@ -1463,6 +1462,35 @@ NS_IMPL_BOOL_ATTR(HTMLMediaElement, Loop, loop)
NS_IMPL_BOOL_ATTR(HTMLMediaElement, DefaultMuted, muted) NS_IMPL_BOOL_ATTR(HTMLMediaElement, DefaultMuted, muted)
NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLMediaElement, Preload, preload, nullptr) NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(HTMLMediaElement, Preload, preload, nullptr)
void
HTMLMediaElement::ContentInserted(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aChild,
int32_t aIndexInContainer)
{
if (aContainer != this ||
aIndexInContainer >= int32_t(mSourcePointer) ||
aIndexInContainer < 0) {
return;
}
++mSourcePointer;
}
void
HTMLMediaElement::ContentRemoved(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aChild,
int32_t aIndexInContainer,
nsIContent* aPreviousSibling)
{
if (aContainer != this ||
aIndexInContainer >= int32_t(mSourcePointer) ||
aIndexInContainer < 0) {
return;
}
--mSourcePointer;
}
NS_IMETHODIMP_(bool) NS_IMETHODIMP_(bool)
HTMLMediaElement::IsVideo() HTMLMediaElement::IsVideo()
{ {
@ -1741,7 +1769,7 @@ void HTMLMediaElement::AbortExistingLoads()
mIsEncrypted = false; mIsEncrypted = false;
mPendingEncryptedInitData.Reset(); mPendingEncryptedInitData.Reset();
mWaitingForKey = NOT_WAITING_FOR_KEY; mWaitingForKey = NOT_WAITING_FOR_KEY;
mSourcePointer = nullptr; mSourcePointer = 0;
mTags = nullptr; mTags = nullptr;
@ -2244,10 +2272,7 @@ void HTMLMediaElement::LoadFromSourceChildren()
NS_ASSERTION(mIsLoadingFromSourceChildren, NS_ASSERTION(mIsLoadingFromSourceChildren,
"Must remember we're loading from source children"); "Must remember we're loading from source children");
nsIDocument* parentDoc = OwnerDoc()->GetParentDocument(); AddMutationObserverUnlessExists(this);
if (parentDoc) {
parentDoc->FlushPendingNotifications(FlushType::Layout);
}
while (true) { while (true) {
nsIContent* child = GetNextSource(); nsIContent* child = GetNextSource();
@ -3708,6 +3733,7 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
mSrcStreamPausedCurrentTime(-1), mSrcStreamPausedCurrentTime(-1),
mShutdownObserver(new ShutdownObserver), mShutdownObserver(new ShutdownObserver),
mCurrentLoadID(0), mCurrentLoadID(0),
mSourcePointer(0),
mNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY), mNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY),
mReadyState(nsIDOMHTMLMediaElement::HAVE_NOTHING, "HTMLMediaElement::mReadyState"), mReadyState(nsIDOMHTMLMediaElement::HAVE_NOTHING, "HTMLMediaElement::mReadyState"),
mLoadWaitStatus(NOT_WAITING), mLoadWaitStatus(NOT_WAITING),
@ -6356,46 +6382,16 @@ void HTMLMediaElement::NotifyAddedSource()
nsIContent* HTMLMediaElement::GetNextSource() nsIContent* HTMLMediaElement::GetNextSource()
{ {
nsCOMPtr<nsIDOMNode> thisDomNode = do_QueryObject(this);
mSourceLoadCandidate = nullptr; mSourceLoadCandidate = nullptr;
nsresult rv = NS_OK;
if (!mSourcePointer) {
// First time this has been run, create a selection to cover children.
mSourcePointer = new nsRange(this);
// If this media element is removed from the DOM, don't gravitate the
// range up to its ancestor, leave it attached to the media element.
mSourcePointer->SetEnableGravitationOnElementRemoval(false);
rv = mSourcePointer->SelectNodeContents(thisDomNode);
if (NS_FAILED(rv)) return nullptr;
rv = mSourcePointer->Collapse(true);
if (NS_FAILED(rv)) return nullptr;
}
while (true) { while (true) {
#ifdef DEBUG if (mSourcePointer >= GetChildCount())
nsCOMPtr<nsIDOMNode> startContainer;
rv = mSourcePointer->GetStartContainer(getter_AddRefs(startContainer));
if (NS_FAILED(rv)) return nullptr;
NS_ASSERTION(startContainer == thisDomNode,
"Should only iterate over direct children");
#endif
int32_t startOffset = 0;
rv = mSourcePointer->GetStartOffset(&startOffset);
NS_ENSURE_SUCCESS(rv, nullptr);
if (uint32_t(startOffset) == GetChildCount())
return nullptr; // No more children. return nullptr; // No more children.
// Advance the range to the next child. nsIContent* child = GetChildAt(mSourcePointer);
rv = mSourcePointer->SetStart(thisDomNode, startOffset + 1);
NS_ENSURE_SUCCESS(rv, nullptr);
nsIContent* child = GetChildAt(startOffset); // Advance to the next child.
++mSourcePointer;
// If child is a <source> element, it is the next candidate. // If child is a <source> element, it is the next candidate.
if (child && child->IsHTMLElement(nsGkAtoms::source)) { if (child && child->IsHTMLElement(nsGkAtoms::source)) {

View file

@ -23,6 +23,7 @@
#include "mozilla/StateWatching.h" #include "mozilla/StateWatching.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "PrincipalChangeObserver.h" #include "PrincipalChangeObserver.h"
#include "nsStubMutationObserver.h"
// X.h on Linux #defines CurrentTime as 0L, so we have to #undef it here. // X.h on Linux #defines CurrentTime as 0L, so we have to #undef it here.
#ifdef CurrentTime #ifdef CurrentTime
@ -84,7 +85,8 @@ class HTMLMediaElement : public nsGenericHTMLElement,
public nsIDOMHTMLMediaElement, public nsIDOMHTMLMediaElement,
public MediaDecoderOwner, public MediaDecoderOwner,
public PrincipalChangeObserver<DOMMediaStream>, public PrincipalChangeObserver<DOMMediaStream>,
public SupportsWeakPtr<HTMLMediaElement> public SupportsWeakPtr<HTMLMediaElement>,
public nsStubMutationObserver
{ {
public: public:
typedef mozilla::TimeStamp TimeStamp; typedef mozilla::TimeStamp TimeStamp;
@ -96,6 +98,8 @@ public:
typedef mozilla::MetadataTags MetadataTags; typedef mozilla::MetadataTags MetadataTags;
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(HTMLMediaElement) MOZ_DECLARE_WEAKREFERENCE_TYPENAME(HTMLMediaElement)
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
CORSMode GetCORSMode() { CORSMode GetCORSMode() {
return mCORSMode; return mCORSMode;
@ -1378,8 +1382,10 @@ protected:
uint32_t mCurrentLoadID; uint32_t mCurrentLoadID;
// Points to the child source elements, used to iterate through the children // Points to the child source elements, used to iterate through the children
// when selecting a resource to load. // when selecting a resource to load. This is the index of the child element
RefPtr<nsRange> mSourcePointer; // that is the current 'candidate' in:
// https://html.spec.whatwg.org/multipage/media.html#concept-media-load-algorithm
uint32_t mSourcePointer;
// Points to the document whose load we're blocking. This is the document // Points to the document whose load we're blocking. This is the document
// we're bound to when loading starts. // we're bound to when loading starts.

View file

@ -305,7 +305,7 @@ LoggingHelper(bool aUseProfiler, const char* aFmt, ...)
MOZ_LOG(logModule, logLevel, ("%s", message.get())); MOZ_LOG(logModule, logLevel, ("%s", message.get()));
if (aUseProfiler) { if (aUseProfiler) {
PROFILER_MARKER(message.get()); profiler_add_marker(message.get());
} }
} }
} }

View file

@ -1416,6 +1416,11 @@ interface nsIDOMWindowUtils : nsISupports {
*/ */
readonly attribute boolean layerManagerRemote; readonly attribute boolean layerManagerRemote;
/**
* True if advanced layers is enabled on this window, false otherwise.
*/
readonly attribute boolean usingAdvancedLayers;
/** /**
* Returns a Promise that will be resolved with a string once the capabilities * Returns a Promise that will be resolved with a string once the capabilities
* of the h264 decoder have been determined. * of the h264 decoder have been determined.

View file

@ -1519,7 +1519,7 @@ ContentChild::RecvSetProcessSandbox(const MaybeFileDesc& aBroker)
nsAdoptingCString extraSyscalls = nsAdoptingCString extraSyscalls =
Preferences::GetCString("security.sandbox.content.syscall_whitelist"); Preferences::GetCString("security.sandbox.content.syscall_whitelist");
if (extraSyscalls) { if (extraSyscalls) {
for (const nsCSubstring& callNrString : extraSyscalls.Split(',')) { for (const nsACString& callNrString : extraSyscalls.Split(',')) {
nsresult rv; nsresult rv;
int callNr = PromiseFlatCString(callNrString).ToInteger(&rv); int callNr = PromiseFlatCString(callNrString).ToInteger(&rv);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {

View file

@ -1142,7 +1142,7 @@ nsJSProtocolHandler::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
} }
nsresult nsresult
nsJSProtocolHandler::EnsureUTF8Spec(const nsAFlatCString &aSpec, const char *aCharset, nsJSProtocolHandler::EnsureUTF8Spec(const nsCString& aSpec, const char *aCharset,
nsACString &aUTF8Spec) nsACString &aUTF8Spec)
{ {
aUTF8Spec.Truncate(); aUTF8Spec.Truncate();

View file

@ -54,7 +54,7 @@ public:
protected: protected:
virtual ~nsJSProtocolHandler(); virtual ~nsJSProtocolHandler();
nsresult EnsureUTF8Spec(const nsAFlatCString &aSpec, const char *aCharset, nsresult EnsureUTF8Spec(const nsCString& aSpec, const char *aCharset,
nsACString &aUTF8Spec); nsACString &aUTF8Spec);
nsCOMPtr<nsITextToSubURI> mTextToSubURI; nsCOMPtr<nsITextToSubURI> mTextToSubURI;

View file

@ -417,7 +417,7 @@ ParseCodecsString(const nsAString& aCodecs, nsTArray<nsString>& aOutCodecs)
bool expectMoreTokens = false; bool expectMoreTokens = false;
nsCharSeparatedTokenizer tokenizer(aCodecs, ','); nsCharSeparatedTokenizer tokenizer(aCodecs, ',');
while (tokenizer.hasMoreTokens()) { while (tokenizer.hasMoreTokens()) {
const nsSubstring& token = tokenizer.nextToken(); const nsAString& token = tokenizer.nextToken();
expectMoreTokens = tokenizer.separatorAfterCurrentToken(); expectMoreTokens = tokenizer.separatorAfterCurrentToken();
aOutCodecs.AppendElement(token); aOutCodecs.AppendElement(token);
} }

View file

@ -299,7 +299,7 @@ Performance::Mark(const nsAString& aName, ErrorResult& aRv)
#ifdef MOZ_GECKO_PROFILER #ifdef MOZ_GECKO_PROFILER
if (profiler_is_active()) { if (profiler_is_active()) {
PROFILER_MARKER_PAYLOAD( profiler_add_marker(
"UserTiming", "UserTiming",
MakeUnique<UserTimingMarkerPayload>(aName, TimeStamp::Now())); MakeUnique<UserTimingMarkerPayload>(aName, TimeStamp::Now()));
} }
@ -397,7 +397,7 @@ Performance::Measure(const nsAString& aName,
TimeDuration::FromMilliseconds(startTime); TimeDuration::FromMilliseconds(startTime);
TimeStamp endTimeStamp = CreationTimeStamp() + TimeStamp endTimeStamp = CreationTimeStamp() +
TimeDuration::FromMilliseconds(endTime); TimeDuration::FromMilliseconds(endTime);
PROFILER_MARKER_PAYLOAD( profiler_add_marker(
"UserTiming", "UserTiming",
MakeUnique<UserTimingMarkerPayload>(aName, startTimeStamp, endTimeStamp)); MakeUnique<UserTimingMarkerPayload>(aName, startTimeStamp, endTimeStamp));
} }

View file

@ -43,7 +43,7 @@ static bool ExtensionInList(const nsCString& aExtensionList,
{ {
nsCCharSeparatedTokenizer extensions(aExtensionList, ','); nsCCharSeparatedTokenizer extensions(aExtensionList, ',');
while (extensions.hasMoreTokens()) { while (extensions.hasMoreTokens()) {
const nsCSubstring& extension = extensions.nextToken(); const nsACString& extension = extensions.nextToken();
if (extension.Equals(aExtension, nsCaseInsensitiveCStringComparator())) { if (extension.Equals(aExtension, nsCaseInsensitiveCStringComparator())) {
return true; return true;
} }
@ -444,7 +444,7 @@ nsPluginTag::InitSandboxLevel()
#if !defined(XP_WIN) && !defined(XP_MACOSX) #if !defined(XP_WIN) && !defined(XP_MACOSX)
static void static void
ConvertToUTF8(nsAFlatCString& aString) ConvertToUTF8(nsCString& aString)
{ {
Unused << UTF_8_ENCODING->DecodeWithoutBOMHandling(aString, aString); Unused << UTF_8_ENCODING->DecodeWithoutBOMHandling(aString, aString);
} }

View file

@ -239,7 +239,7 @@ FramingChecker::CheckFrameOptions(nsIChannel* aChannel,
// be many. If any want to deny the load, deny the load. // be many. If any want to deny the load, deny the load.
nsCharSeparatedTokenizer tokenizer(xfoHeaderValue, ','); nsCharSeparatedTokenizer tokenizer(xfoHeaderValue, ',');
while (tokenizer.hasMoreTokens()) { while (tokenizer.hasMoreTokens()) {
const nsSubstring& tok = tokenizer.nextToken(); const nsAString& tok = tokenizer.nextToken();
if (!CheckOneFrameOptionsPolicy(httpChannel, tok, aDocShell)) { if (!CheckOneFrameOptionsPolicy(httpChannel, tok, aDocShell)) {
// cancel the load and display about:blank // cancel the load and display about:blank
httpChannel->Cancel(NS_BINDING_ABORTED); httpChannel->Cancel(NS_BINDING_ABORTED);

View file

@ -428,7 +428,7 @@ CSP_AppendCSPFromHeader(nsIContentSecurityPolicy* aCsp,
nsresult rv = NS_OK; nsresult rv = NS_OK;
nsCharSeparatedTokenizer tokenizer(aHeaderValue, ','); nsCharSeparatedTokenizer tokenizer(aHeaderValue, ',');
while (tokenizer.hasMoreTokens()) { while (tokenizer.hasMoreTokens()) {
const nsSubstring& policy = tokenizer.nextToken(); const nsAString& policy = tokenizer.nextToken();
rv = aCsp->AppendPolicy(policy, aReportOnly, false); rv = aCsp->AppendPolicy(policy, aReportOnly, false);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
{ {

View file

@ -726,7 +726,7 @@ nsContentSecurityManager::IsOriginPotentiallyTrustworthy(nsIPrincipal* aPrincipa
if (whitelist) { if (whitelist) {
nsCCharSeparatedTokenizer tokenizer(whitelist, ','); nsCCharSeparatedTokenizer tokenizer(whitelist, ',');
while (tokenizer.hasMoreTokens()) { while (tokenizer.hasMoreTokens()) {
const nsCSubstring& allowedHost = tokenizer.nextToken(); const nsACString& allowedHost = tokenizer.nextToken();
if (host.Equals(allowedHost)) { if (host.Equals(allowedHost)) {
*aIsTrustWorthy = true; *aIsTrustWorthy = true;
return NS_OK; return NS_OK;

View file

@ -17,8 +17,8 @@
#define nsReadableUtils_h___ #define nsReadableUtils_h___
class nsACString; class nsACString;
class nsAString; class nsAString;
class nsAFlatString; class nsString;
class nsAFlatCString; class nsCString;
class nsAdoptingString; class nsAdoptingString;
class nsAdoptingCString; class nsAdoptingCString;
class nsXPIDLString; class nsXPIDLString;

View file

@ -175,9 +175,9 @@ LocalStorage::Clear(nsIPrincipal& aSubjectPrincipal, ErrorResult& aRv)
} }
void void
LocalStorage::BroadcastChangeNotification(const nsSubstring& aKey, LocalStorage::BroadcastChangeNotification(const nsAString& aKey,
const nsSubstring& aOldValue, const nsAString& aOldValue,
const nsSubstring& aNewValue) const nsAString& aNewValue)
{ {
if (!XRE_IsParentProcess() && Principal()) { if (!XRE_IsParentProcess() && Principal()) {
// If we are in a child process, we want to send a message to the parent in // If we are in a child process, we want to send a message to the parent in

View file

@ -115,9 +115,9 @@ private:
// Whether this storage is running in private-browsing window. // Whether this storage is running in private-browsing window.
bool mIsPrivate : 1; bool mIsPrivate : 1;
void BroadcastChangeNotification(const nsSubstring& aKey, void BroadcastChangeNotification(const nsAString& aKey,
const nsSubstring& aOldValue, const nsAString& aOldValue,
const nsSubstring& aNewValue); const nsAString& aNewValue);
}; };
} // namespace dom } // namespace dom

View file

@ -84,7 +84,7 @@ PrincipalsEqual(nsIPrincipal* aObjectPrincipal,
} }
void void
ReverseString(const nsCSubstring& aSource, nsCSubstring& aResult) ReverseString(const nsACString& aSource, nsACString& aResult)
{ {
nsACString::const_iterator sourceBegin, sourceEnd; nsACString::const_iterator sourceBegin, sourceEnd;
aSource.BeginReading(sourceBegin); aSource.BeginReading(sourceBegin);

View file

@ -22,7 +22,7 @@ PrincipalsEqual(nsIPrincipal* aObjectPrincipal,
nsIPrincipal* aSubjectPrincipal); nsIPrincipal* aSubjectPrincipal);
void void
ReverseString(const nsCSubstring& aSource, nsCSubstring& aResult); ReverseString(const nsACString& aSource, nsACString& aResult);
nsresult nsresult
CreateReversedDomain(const nsACString& aAsciiDomain, CreateReversedDomain(const nsACString& aAsciiDomain,

View file

@ -72,7 +72,7 @@ SVGTests::IsConditionalProcessingAttribute(const nsIAtom* aAttribute) const
} }
int32_t int32_t
SVGTests::GetBestLanguagePreferenceRank(const nsSubstring& aAcceptLangs) const SVGTests::GetBestLanguagePreferenceRank(const nsAString& aAcceptLangs) const
{ {
const nsDefaultStringComparator defaultComparator; const nsDefaultStringComparator defaultComparator;
@ -86,7 +86,7 @@ SVGTests::GetBestLanguagePreferenceRank(const nsSubstring& aAcceptLangs) const
nsCharSeparatedTokenizer languageTokenizer(aAcceptLangs, ','); nsCharSeparatedTokenizer languageTokenizer(aAcceptLangs, ',');
int32_t index = 0; int32_t index = 0;
while (languageTokenizer.hasMoreTokens()) { while (languageTokenizer.hasMoreTokens()) {
const nsSubstring &languageToken = languageTokenizer.nextToken(); const nsAString& languageToken = languageTokenizer.nextToken();
bool exactMatch = (languageToken == mStringListAttributes[LANGUAGE][i]); bool exactMatch = (languageToken == mStringListAttributes[LANGUAGE][i]);
bool prefixOnlyMatch = bool prefixOnlyMatch =
!exactMatch && !exactMatch &&

View file

@ -46,7 +46,7 @@ public:
* or -1 if no indices match. * or -1 if no indices match.
* XXX This algorithm is O(M*N). * XXX This algorithm is O(M*N).
*/ */
int32_t GetBestLanguagePreferenceRank(const nsSubstring& aAcceptLangs) const; int32_t GetBestLanguagePreferenceRank(const nsAString& aAcceptLangs) const;
/** /**
* Special value to pass to PassesConditionalProcessingTests to ignore systemLanguage * Special value to pass to PassesConditionalProcessingTests to ignore systemLanguage

View file

@ -2494,7 +2494,7 @@ nsSVGElement::ReportAttributeParseFailure(nsIDocument* aDocument,
nsIAtom* aAttribute, nsIAtom* aAttribute,
const nsAString& aValue) const nsAString& aValue)
{ {
const nsAFlatString& attributeValue = PromiseFlatString(aValue); const nsString& attributeValue = PromiseFlatString(aValue);
const char16_t *strings[] = { aAttribute->GetUTF16String(), const char16_t *strings[] = { aAttribute->GetUTF16String(),
attributeValue.get() }; attributeValue.get() };
return SVGContentUtils::ReportToConsole(aDocument, return SVGContentUtils::ReportToConsole(aDocument,

View file

@ -633,7 +633,8 @@ U2FSoftTokenManager::IsRegistered(const nsTArray<uint8_t>& aKeyHandle,
// * attestation signature // * attestation signature
// //
nsresult nsresult
U2FSoftTokenManager::Register(const nsTArray<uint8_t>& aApplication, U2FSoftTokenManager::Register(const nsTArray<WebAuthnScopedCredentialDescriptor>& aDescriptors,
const nsTArray<uint8_t>& aApplication,
const nsTArray<uint8_t>& aChallenge, const nsTArray<uint8_t>& aChallenge,
/* out */ nsTArray<uint8_t>& aRegistration, /* out */ nsTArray<uint8_t>& aRegistration,
/* out */ nsTArray<uint8_t>& aSignature) /* out */ nsTArray<uint8_t>& aSignature)
@ -650,6 +651,18 @@ U2FSoftTokenManager::Register(const nsTArray<uint8_t>& aApplication,
} }
} }
// Optional exclusion list.
for (auto desc: aDescriptors) {
bool isRegistered = false;
nsresult rv = IsRegistered(desc.id(), aApplication, isRegistered);
if (NS_FAILED(rv)) {
return rv;
}
if (isRegistered) {
return NS_ERROR_DOM_NOT_ALLOWED_ERR;
}
}
// We should already have a wrapping key // We should already have a wrapping key
MOZ_ASSERT(mWrappingKey); MOZ_ASSERT(mWrappingKey);
@ -745,9 +758,10 @@ U2FSoftTokenManager::Register(const nsTArray<uint8_t>& aApplication,
// * Signature // * Signature
// //
nsresult nsresult
U2FSoftTokenManager::Sign(const nsTArray<uint8_t>& aApplication, U2FSoftTokenManager::Sign(const nsTArray<WebAuthnScopedCredentialDescriptor>& aDescriptors,
const nsTArray<uint8_t>& aApplication,
const nsTArray<uint8_t>& aChallenge, const nsTArray<uint8_t>& aChallenge,
const nsTArray<uint8_t>& aKeyHandle, nsTArray<uint8_t>& aKeyHandle,
nsTArray<uint8_t>& aSignature) nsTArray<uint8_t>& aSignature)
{ {
nsNSSShutDownPreventionLock locker; nsNSSShutDownPreventionLock locker;
@ -755,14 +769,20 @@ U2FSoftTokenManager::Sign(const nsTArray<uint8_t>& aApplication,
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
} }
MOZ_ASSERT(mInitialized); for (auto desc: aDescriptors) {
if (NS_WARN_IF(!mInitialized)) { bool isRegistered = false;
nsresult rv = Init(); nsresult rv = IsRegistered(desc.id(), aApplication, isRegistered);
if (NS_WARN_IF(NS_FAILED(rv))) { if (NS_SUCCEEDED(rv) && isRegistered) {
return rv; aKeyHandle.Assign(desc.id());
break;
} }
} }
// Fail if we didn't recognize a key id.
if (aKeyHandle.IsEmpty()) {
return NS_ERROR_DOM_NOT_ALLOWED_ERR;
}
MOZ_ASSERT(mWrappingKey); MOZ_ASSERT(mWrappingKey);
UniquePK11SlotInfo slot(PK11_GetInternalSlot()); UniquePK11SlotInfo slot(PK11_GetInternalSlot());

View file

@ -24,17 +24,18 @@ class U2FSoftTokenManager final : public U2FTokenTransport,
{ {
public: public:
explicit U2FSoftTokenManager(uint32_t aCounter); explicit U2FSoftTokenManager(uint32_t aCounter);
virtual nsresult Register(const nsTArray<uint8_t>& aApplication,
virtual nsresult Register(const nsTArray<WebAuthnScopedCredentialDescriptor>& aDescriptors,
const nsTArray<uint8_t>& aApplication,
const nsTArray<uint8_t>& aChallenge, const nsTArray<uint8_t>& aChallenge,
/* out */ nsTArray<uint8_t>& aRegistration, /* out */ nsTArray<uint8_t>& aRegistration,
/* out */ nsTArray<uint8_t>& aSignature) override; /* out */ nsTArray<uint8_t>& aSignature) override;
virtual nsresult Sign(const nsTArray<uint8_t>& aApplication,
virtual nsresult Sign(const nsTArray<WebAuthnScopedCredentialDescriptor>& aDescriptors,
const nsTArray<uint8_t>& aApplication,
const nsTArray<uint8_t>& aChallenge, const nsTArray<uint8_t>& aChallenge,
const nsTArray<uint8_t>& aKeyHandle, /* out */ nsTArray<uint8_t>& aKeyHandle,
/* out */ nsTArray<uint8_t>& aSignature) override; /* out */ nsTArray<uint8_t>& aSignature) override;
nsresult IsRegistered(const nsTArray<uint8_t>& aKeyHandle,
const nsTArray<uint8_t>& aAppParam,
bool& aResult);
// For nsNSSShutDownObject // For nsNSSShutDownObject
virtual void virtualDestroyNSSReference() override; virtual void virtualDestroyNSSReference() override;
@ -45,6 +46,10 @@ private:
nsresult Init(); nsresult Init();
bool IsCompatibleVersion(const nsAString& aVersion); bool IsCompatibleVersion(const nsAString& aVersion);
nsresult IsRegistered(const nsTArray<uint8_t>& aKeyHandle,
const nsTArray<uint8_t>& aAppParam,
bool& aResult);
bool mInitialized; bool mInitialized;
mozilla::UniquePK11SymKey mWrappingKey; mozilla::UniquePK11SymKey mWrappingKey;

View file

@ -154,7 +154,7 @@ U2FTokenManager::MaybeClearTransaction(WebAuthnTransactionParent* aParent)
} }
mTransactionParent = nullptr; mTransactionParent = nullptr;
// Drop managers at the end of all transactions // Drop managers at the end of all transactions
mSoftTokenManager = nullptr; mTokenManagerImpl = nullptr;
} }
void void
@ -179,9 +179,13 @@ U2FTokenManager::Register(WebAuthnTransactionParent* aTransactionParent,
// //
// TODO Check all transports and use WebAuthnRequest to aggregate // TODO Check all transports and use WebAuthnRequest to aggregate
// replies // replies
if (U2FPrefManager::Get()->GetSoftTokenEnabled()) { if (!U2FPrefManager::Get()->GetSoftTokenEnabled()) {
if (!mSoftTokenManager) { Cancel(NS_ERROR_DOM_NOT_ALLOWED_ERR);
mSoftTokenManager = new U2FSoftTokenManager(U2FPrefManager::Get()->GetSoftTokenCounter()); return;
}
if (!mTokenManagerImpl) {
mTokenManagerImpl = new U2FSoftTokenManager(U2FPrefManager::Get()->GetSoftTokenCounter());
} }
// Check if all the supplied parameters are syntactically well-formed and // Check if all the supplied parameters are syntactically well-formed and
@ -194,24 +198,10 @@ U2FTokenManager::Register(WebAuthnTransactionParent* aTransactionParent,
return; return;
} }
nsresult rv;
for (auto desc: aTransactionInfo.Descriptors()) {
bool isRegistered = false;
rv = mSoftTokenManager->IsRegistered(desc.id(), aTransactionInfo.RpIdHash(), isRegistered);
if (NS_FAILED(rv)) {
Cancel(rv);
return;
}
if (isRegistered) {
Cancel(NS_ERROR_DOM_NOT_ALLOWED_ERR);
return;
}
}
nsTArray<uint8_t> reg; nsTArray<uint8_t> reg;
nsTArray<uint8_t> sig; nsTArray<uint8_t> sig;
rv = mSoftTokenManager->Register(aTransactionInfo.RpIdHash(), nsresult rv = mTokenManagerImpl->Register(aTransactionInfo.Descriptors(),
aTransactionInfo.RpIdHash(),
aTransactionInfo.ClientDataHash(), aTransactionInfo.ClientDataHash(),
reg, reg,
sig); sig);
@ -219,12 +209,9 @@ U2FTokenManager::Register(WebAuthnTransactionParent* aTransactionParent,
Cancel(rv); Cancel(rv);
return; return;
} }
Unused << mTransactionParent->SendConfirmRegister(reg,
sig); Unused << mTransactionParent->SendConfirmRegister(reg, sig);
MaybeClearTransaction(mTransactionParent); MaybeClearTransaction(mTransactionParent);
return;
}
Cancel(NS_ERROR_DOM_NOT_ALLOWED_ERR);
} }
void void
@ -240,9 +227,13 @@ U2FTokenManager::Sign(WebAuthnTransactionParent* aTransactionParent,
// //
// TODO Check all transports and use WebAuthnRequest to aggregate // TODO Check all transports and use WebAuthnRequest to aggregate
// replies // replies
if (U2FPrefManager::Get()->GetSoftTokenEnabled()) { if (!U2FPrefManager::Get()->GetSoftTokenEnabled()) {
if (!mSoftTokenManager) { Cancel(NS_ERROR_DOM_NOT_ALLOWED_ERR);
mSoftTokenManager = new U2FSoftTokenManager(U2FPrefManager::Get()->GetSoftTokenCounter()); return;
}
if (!mTokenManagerImpl) {
mTokenManagerImpl = new U2FSoftTokenManager(U2FPrefManager::Get()->GetSoftTokenCounter());
} }
if ((aTransactionInfo.RpIdHash().Length() != SHA256_LENGTH) || if ((aTransactionInfo.RpIdHash().Length() != SHA256_LENGTH) ||
@ -251,28 +242,20 @@ U2FTokenManager::Sign(WebAuthnTransactionParent* aTransactionParent,
return; return;
} }
for (auto desc: aTransactionInfo.Descriptors()) { nsTArray<uint8_t> id;
bool reg;
nsresult rv = mSoftTokenManager->IsRegistered(desc.id(), aTransactionInfo.RpIdHash(), reg);
if (!reg) {
continue;
}
nsTArray<uint8_t> sig; nsTArray<uint8_t> sig;
rv = mSoftTokenManager->Sign(aTransactionInfo.RpIdHash(), nsresult rv = mTokenManagerImpl->Sign(aTransactionInfo.Descriptors(),
aTransactionInfo.RpIdHash(),
aTransactionInfo.ClientDataHash(), aTransactionInfo.ClientDataHash(),
desc.id(), id,
sig); sig);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
Cancel(rv); Cancel(rv);
return; return;
} }
Unused << mTransactionParent->SendConfirmSign(desc.id(), sig);
Unused << mTransactionParent->SendConfirmSign(id, sig);
MaybeClearTransaction(mTransactionParent); MaybeClearTransaction(mTransactionParent);
return;
}
}
// If we come out of the loop, we aren't registered
Cancel(NS_ERROR_DOM_NOT_ALLOWED_ERR);
} }
} }

View file

@ -34,7 +34,6 @@ class U2FTokenManager final
bool softTokenEnabled; bool softTokenEnabled;
uint32_t softTokenCounter; uint32_t softTokenCounter;
}; };
typedef MozPromise<bool, nsresult, false> PrefPromise;
public: public:
enum TransactionType enum TransactionType
{ {
@ -58,7 +57,7 @@ private:
// the PBackground protocol code. This means we cannot be left holding an // the PBackground protocol code. This means we cannot be left holding an
// invalid IPC protocol object after the transaction is finished. // invalid IPC protocol object after the transaction is finished.
WebAuthnTransactionParent* mTransactionParent; WebAuthnTransactionParent* mTransactionParent;
RefPtr<U2FSoftTokenManager> mSoftTokenManager; RefPtr<U2FTokenTransport> mTokenManagerImpl;
}; };
} // namespace dom } // namespace dom

View file

@ -7,6 +7,8 @@
#ifndef mozilla_dom_U2FTokenTransport_h #ifndef mozilla_dom_U2FTokenTransport_h
#define mozilla_dom_U2FTokenTransport_h #define mozilla_dom_U2FTokenTransport_h
#include "mozilla/dom/PWebAuthnTransaction.h"
/* /*
* Abstract class representing a transport manager for U2F Keys (software, * Abstract class representing a transport manager for U2F Keys (software,
* bluetooth, usb, etc.). Hides the implementation details for specific key * bluetooth, usb, etc.). Hides the implementation details for specific key
@ -21,14 +23,19 @@ class U2FTokenTransport
public: public:
NS_INLINE_DECL_REFCOUNTING(U2FTokenTransport); NS_INLINE_DECL_REFCOUNTING(U2FTokenTransport);
U2FTokenTransport() {} U2FTokenTransport() {}
virtual nsresult Register(const nsTArray<uint8_t>& aApplication,
virtual nsresult Register(const nsTArray<WebAuthnScopedCredentialDescriptor>& aDescriptors,
const nsTArray<uint8_t>& aApplication,
const nsTArray<uint8_t>& aChallenge, const nsTArray<uint8_t>& aChallenge,
/* out */ nsTArray<uint8_t>& aRegistration, /* out */ nsTArray<uint8_t>& aRegistration,
/* out */ nsTArray<uint8_t>& aSignature) = 0; /* out */ nsTArray<uint8_t>& aSignature) = 0;
virtual nsresult Sign(const nsTArray<uint8_t>& aApplication,
virtual nsresult Sign(const nsTArray<WebAuthnScopedCredentialDescriptor>& aDescriptors,
const nsTArray<uint8_t>& aApplication,
const nsTArray<uint8_t>& aChallenge, const nsTArray<uint8_t>& aChallenge,
const nsTArray<uint8_t>& aKeyHandle, /* out */ nsTArray<uint8_t>& aKeyHandle,
/* out */ nsTArray<uint8_t>& aSignature) = 0; /* out */ nsTArray<uint8_t>& aSignature) = 0;
protected: protected:
virtual ~U2FTokenTransport() = default; virtual ~U2FTokenTransport() = default;
}; };

View file

@ -2906,9 +2906,7 @@ WorkerThreadPrimaryRunnable::Run()
} }
{ {
#ifdef MOZ_GECKO_PROFILER
profiler_set_js_context(cx); profiler_set_js_context(cx);
#endif
{ {
JSAutoRequest ar(cx); JSAutoRequest ar(cx);
@ -2922,9 +2920,7 @@ WorkerThreadPrimaryRunnable::Run()
BackgroundChild::CloseForCurrentThread(); BackgroundChild::CloseForCurrentThread();
#ifdef MOZ_GECKO_PROFILER
profiler_clear_js_context(); profiler_clear_js_context();
#endif
} }
// There may still be runnables on the debugger event queue that hold a // There may still be runnables on the debugger event queue that hold a

View file

@ -988,7 +988,7 @@ GetProtoBindingFromClassObject(JSObject* obj)
nsresult nsresult
nsXBLBinding::DoInitJSClass(JSContext *cx, nsXBLBinding::DoInitJSClass(JSContext *cx,
JS::Handle<JSObject*> obj, JS::Handle<JSObject*> obj,
const nsAFlatString& aClassName, const nsString& aClassName,
nsXBLPrototypeBinding* aProtoBinding, nsXBLPrototypeBinding* aProtoBinding,
JS::MutableHandle<JSObject*> aClassObject, JS::MutableHandle<JSObject*> aClassObject,
bool* aNew) bool* aNew)

View file

@ -133,7 +133,7 @@ public:
const mozilla::ServoStyleSet* GetServoStyleSet() const; const mozilla::ServoStyleSet* GetServoStyleSet() const;
static nsresult DoInitJSClass(JSContext *cx, JS::Handle<JSObject*> obj, static nsresult DoInitJSClass(JSContext *cx, JS::Handle<JSObject*> obj,
const nsAFlatString& aClassName, const nsString& aClassName,
nsXBLPrototypeBinding* aProtoBinding, nsXBLPrototypeBinding* aProtoBinding,
JS::MutableHandle<JSObject*> aClassObject, JS::MutableHandle<JSObject*> aClassObject,
bool* aNew); bool* aNew);

View file

@ -89,7 +89,7 @@ nsresult
nsXBLContentSink::FlushText(bool aReleaseTextNode) nsXBLContentSink::FlushText(bool aReleaseTextNode)
{ {
if (mTextLength != 0) { if (mTextLength != 0) {
const nsASingleFragmentString& text = Substring(mText, mText+mTextLength); const nsAString& text = Substring(mText, mText+mTextLength);
if (mState == eXBL_InHandlers) { if (mState == eXBL_InHandlers) {
NS_ASSERTION(mBinding, "Must have binding here"); NS_ASSERTION(mBinding, "Must have binding here");
// Get the text and add it to the event handler. // Get the text and add it to the event handler.

View file

@ -660,11 +660,11 @@ nsXMLContentSink::LoadXSLStyleSheet(nsIURI* aUrl)
nsresult nsresult
nsXMLContentSink::ProcessStyleLink(nsIContent* aElement, nsXMLContentSink::ProcessStyleLink(nsIContent* aElement,
const nsSubstring& aHref, const nsAString& aHref,
bool aAlternate, bool aAlternate,
const nsSubstring& aTitle, const nsAString& aTitle,
const nsSubstring& aType, const nsAString& aType,
const nsSubstring& aMedia) const nsAString& aMedia)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
mPrettyPrintXML = false; mPrettyPrintXML = false;

View file

@ -146,11 +146,11 @@ protected:
// nsContentSink override // nsContentSink override
virtual nsresult ProcessStyleLink(nsIContent* aElement, virtual nsresult ProcessStyleLink(nsIContent* aElement,
const nsSubstring& aHref, const nsAString& aHref,
bool aAlternate, bool aAlternate,
const nsSubstring& aTitle, const nsAString& aTitle,
const nsSubstring& aType, const nsAString& aType,
const nsSubstring& aMedia) override; const nsAString& aMedia) override;
nsresult LoadXSLStyleSheet(nsIURI* aUrl); nsresult LoadXSLStyleSheet(nsIURI* aUrl);

View file

@ -92,11 +92,11 @@ protected:
// nsContentSink overrides // nsContentSink overrides
virtual nsresult ProcessStyleLink(nsIContent* aElement, virtual nsresult ProcessStyleLink(nsIContent* aElement,
const nsSubstring& aHref, const nsAString& aHref,
bool aAlternate, bool aAlternate,
const nsSubstring& aTitle, const nsAString& aTitle,
const nsSubstring& aType, const nsAString& aType,
const nsSubstring& aMedia) override; const nsAString& aMedia) override;
nsresult LoadXSLStyleSheet(nsIURI* aUrl); nsresult LoadXSLStyleSheet(nsIURI* aUrl);
void StartLayout(); void StartLayout();
@ -328,11 +328,11 @@ nsXMLFragmentContentSink::ReportError(const char16_t* aErrorText,
nsresult nsresult
nsXMLFragmentContentSink::ProcessStyleLink(nsIContent* aElement, nsXMLFragmentContentSink::ProcessStyleLink(nsIContent* aElement,
const nsSubstring& aHref, const nsAString& aHref,
bool aAlternate, bool aAlternate,
const nsSubstring& aTitle, const nsAString& aTitle,
const nsSubstring& aType, const nsAString& aType,
const nsSubstring& aMedia) const nsAString& aMedia)
{ {
// don't process until moved to document // don't process until moved to document
return NS_OK; return NS_OK;

View file

@ -14,7 +14,7 @@ nsresult
txExpandedName::init(const nsAString& aQName, txNamespaceMap* aResolver, txExpandedName::init(const nsAString& aQName, txNamespaceMap* aResolver,
bool aUseDefault) bool aUseDefault)
{ {
const nsAFlatString& qName = PromiseFlatString(aQName); const nsString& qName = PromiseFlatString(aQName);
const char16_t* colon; const char16_t* colon;
bool valid = XMLUtils::isValidQName(qName, &colon); bool valid = XMLUtils::isValidQName(qName, &colon);
if (!valid) { if (!valid) {

View file

@ -17,7 +17,7 @@ typedef nsCaseInsensitiveStringComparator txCaseInsensitiveStringComparator;
* Check equality between a string and an atom containing ASCII. * Check equality between a string and an atom containing ASCII.
*/ */
inline bool inline bool
TX_StringEqualsAtom(const nsASingleFragmentString& aString, nsIAtom* aAtom) TX_StringEqualsAtom(const nsAString& aString, nsIAtom* aAtom)
{ {
return aAtom->Equals(aString); return aAtom->Equals(aString);
} }

View file

@ -84,7 +84,7 @@ nsresult
XMLUtils::splitQName(const nsAString& aName, nsIAtom** aPrefix, XMLUtils::splitQName(const nsAString& aName, nsIAtom** aPrefix,
nsIAtom** aLocalName) nsIAtom** aLocalName)
{ {
const nsAFlatString& qName = PromiseFlatString(aName); const nsString& qName = PromiseFlatString(aName);
const char16_t* colon; const char16_t* colon;
bool valid = XMLUtils::isValidQName(qName, &colon); bool valid = XMLUtils::isValidQName(qName, &colon);
if (!valid) { if (!valid) {
@ -109,9 +109,9 @@ XMLUtils::splitQName(const nsAString& aName, nsIAtom** aPrefix,
/** /**
* Returns true if the given string has only whitespace characters * Returns true if the given string has only whitespace characters
*/ */
bool XMLUtils::isWhitespace(const nsAFlatString& aText) bool XMLUtils::isWhitespace(const nsString& aText)
{ {
nsAFlatString::const_char_iterator start, end; nsString::const_char_iterator start, end;
aText.BeginReading(start); aText.BeginReading(start);
aText.EndReading(end); aText.EndReading(end);
for ( ; start != end; ++start) { for ( ; start != end; ++start) {
@ -155,8 +155,7 @@ void XMLUtils::normalizePIValue(nsAString& piValue)
} }
//static //static
bool XMLUtils::isValidQName(const nsAFlatString& aQName, bool XMLUtils::isValidQName(const nsString& aQName, const char16_t** aColon)
const char16_t** aColon)
{ {
return NS_SUCCEEDED(nsContentUtils::CheckQName(aQName, true, aColon)); return NS_SUCCEEDED(nsContentUtils::CheckQName(aQName, true, aColon));
} }

View file

@ -43,7 +43,7 @@ public:
/** /**
* Returns true if the given string has only whitespace characters * Returns true if the given string has only whitespace characters
*/ */
static bool isWhitespace(const nsAFlatString& aText); static bool isWhitespace(const nsString& aText);
/** /**
* Normalizes the value of a XML processingInstruction * Normalizes the value of a XML processingInstruction
@ -53,8 +53,7 @@ public:
/** /**
* Returns true if the given string is a valid XML QName * Returns true if the given string is a valid XML QName
*/ */
static bool isValidQName(const nsAFlatString& aQName, static bool isValidQName(const nsString& aQName, const char16_t** aColon);
const char16_t** aColon);
/** /**
* Returns true if the given character represents an Alpha letter * Returns true if the given character represents an Alpha letter

View file

@ -430,7 +430,7 @@ txCoreFunctionCall::evaluate(txIEvalContext* aContext, txAExprResult** aResult)
return NS_OK; return NS_OK;
} }
const nsSubstring& result = Substring(arg1, idx + arg2.Length()); const nsAString& result = Substring(arg1, idx + arg2.Length());
return aContext->recycler()->getStringResult(result, aResult); return aContext->recycler()->getStringResult(result, aResult);
} }
case SUBSTRING_BEFORE: case SUBSTRING_BEFORE:

View file

@ -92,7 +92,7 @@ txExprLexer::nextIsOperatorToken(Token* aToken)
* Parses the given string into a sequence of Tokens * Parses the given string into a sequence of Tokens
*/ */
nsresult nsresult
txExprLexer::parse(const nsASingleFragmentString& aPattern) txExprLexer::parse(const nsAString& aPattern)
{ {
iterator start, end; iterator start, end;
start = aPattern.BeginReading(mPosition); start = aPattern.BeginReading(mPosition);

Some files were not shown because too many files have changed in this diff Show more