merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2017-06-23 11:28:19 +02:00
Родитель 3d1a5848a6 a53a350cd6
Коммит 5f51e5596e
433 изменённых файлов: 18434 добавлений и 8183 удалений

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

@ -754,17 +754,8 @@ AtkAttributeSet*
GetAttributeSet(Accessible* aAccessible)
{
nsCOMPtr<nsIPersistentProperties> attributes = aAccessible->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);
}
if (attributes)
return ConvertToAtkAttributeSet(attributes);
}
return nullptr;
}

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

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

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

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

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

@ -209,7 +209,7 @@ void Stack();
/**
* 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,

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

@ -633,9 +633,9 @@ nsCoreUtils::ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
}
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.EndReading(iterEnd);

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

@ -299,7 +299,7 @@ public:
* only. In contrast to nsWhitespaceTokenizer class it takes into account
* 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.

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

@ -945,6 +945,10 @@ Accessible::Attributes()
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'
// object attribute used for ARIA role of this accessible.
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();

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

@ -38,7 +38,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
testAttrs("checkedTreeitem", {"checkable" : "true"}, true);
testAttrs("dropeffect", {"dropeffect" : "copy"}, 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);
testAbsentAttrs("hidden_false", { "hidden": "false" });
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="dropeffect" aria-dropeffect="copy"></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_false" aria-hidden="false"></div>
<div id="modal" aria-modal="true"></div>

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

@ -92,10 +92,17 @@ LazyInstantiator::GetRootAccessible(HWND aHwnd)
// a11y is running, so we just resolve the real root accessible.
a11y::Accessible* rootAcc = widget::WinUtils::GetRootAccessibleForHWND(aHwnd);
if (!rootAcc || !rootAcc->IsRoot()) {
if (!rootAcc) {
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
// don't need LazyInstantiator's capabilities anymore (since a11y is already
// running). We can bypass LazyInstantiator by retrieving the internal

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

@ -1,5 +1,5 @@
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

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

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

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

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

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

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

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

@ -874,7 +874,6 @@ var PDFViewerApplication = {
secondaryToolbar: null,
eventBus: null,
l10n: null,
pageRotation: 0,
isInitialViewSet: false,
downloadComplete: false,
viewerPrefs: {
@ -1100,6 +1099,9 @@ var PDFViewerApplication = {
get pagesCount() {
return this.pdfDocument ? this.pdfDocument.numPages : 0;
},
get pageRotation() {
return this.pdfViewer.pagesRotation;
},
set page(val) {
this.pdfViewer.currentPageNumber = val;
},
@ -1206,7 +1208,6 @@ var PDFViewerApplication = {
this.pdfDocumentProperties.setDocument(null, null);
}
this.store = null;
this.pageRotation = 0;
this.isInitialViewSet = false;
this.downloadComplete = false;
this.pdfSidebar.reset();
@ -1623,12 +1624,13 @@ var PDFViewerApplication = {
if (!this.pdfDocument) {
return;
}
let pageNumber = this.page;
this.pageRotation = (this.pageRotation + 360 + delta) % 360;
this.pdfViewer.pagesRotation = this.pageRotation;
this.pdfThumbnailViewer.pagesRotation = this.pageRotation;
let { pdfViewer, pdfThumbnailViewer } = this;
let pageNumber = pdfViewer.currentPageNumber;
let newRotation = (pdfViewer.pagesRotation + 360 + delta) % 360;
pdfViewer.pagesRotation = newRotation;
pdfThumbnailViewer.pagesRotation = newRotation;
this.forceRendering();
this.pdfViewer.currentPageNumber = pageNumber;
pdfViewer.currentPageNumber = pageNumber;
},
requestPresentationMode: function pdfViewRequestPresentationMode() {
if (!this.pdfPresentationMode) {
@ -5024,7 +5026,7 @@ class PDFPageView {
});
return;
}
if (!this.zoomLayer) {
if (!this.zoomLayer && !this.canvas.hasAttribute('hidden')) {
this.zoomLayer = this.canvas.parentNode;
this.zoomLayer.style.position = 'absolute';
}
@ -7648,11 +7650,11 @@ exports.Toolbar = undefined;
var _ui_utils = __webpack_require__(0);
var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
var SCALE_SELECT_CONTAINER_PADDING = 8;
var SCALE_SELECT_PADDING = 22;
var Toolbar = function ToolbarClosure() {
function Toolbar(options, mainContainer, eventBus, l10n = _ui_utils.NullL10n) {
const PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
const SCALE_SELECT_CONTAINER_PADDING = 8;
const SCALE_SELECT_PADDING = 22;
class Toolbar {
constructor(options, mainContainer, eventBus, l10n = _ui_utils.NullL10n) {
this.toolbar = options.container;
this.mainContainer = mainContainer;
this.eventBus = eventBus;
@ -7662,170 +7664,167 @@ var Toolbar = function ToolbarClosure() {
this.reset();
this._bindListeners();
}
Toolbar.prototype = {
setPageNumber(pageNumber, pageLabel) {
this.pageNumber = pageNumber;
this.pageLabel = pageLabel;
this._updateUIState(false);
},
setPagesCount(pagesCount, hasPageLabels) {
this.pagesCount = pagesCount;
this.hasPageLabels = hasPageLabels;
this._updateUIState(true);
},
setPageScale(pageScaleValue, pageScale) {
this.pageScaleValue = pageScaleValue;
this.pageScale = pageScale;
this._updateUIState(false);
},
reset() {
this.pageNumber = 0;
this.pageLabel = null;
this.hasPageLabels = false;
this.pagesCount = 0;
this.pageScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;
this.pageScale = _ui_utils.DEFAULT_SCALE;
this._updateUIState(true);
},
_bindListeners: function Toolbar_bindClickListeners() {
var eventBus = this.eventBus;
var self = this;
var items = this.items;
items.previous.addEventListener('click', function () {
eventBus.dispatch('previouspage');
setPageNumber(pageNumber, pageLabel) {
this.pageNumber = pageNumber;
this.pageLabel = pageLabel;
this._updateUIState(false);
}
setPagesCount(pagesCount, hasPageLabels) {
this.pagesCount = pagesCount;
this.hasPageLabels = hasPageLabels;
this._updateUIState(true);
}
setPageScale(pageScaleValue, pageScale) {
this.pageScaleValue = pageScaleValue;
this.pageScale = pageScale;
this._updateUIState(false);
}
reset() {
this.pageNumber = 0;
this.pageLabel = null;
this.hasPageLabels = false;
this.pagesCount = 0;
this.pageScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;
this.pageScale = _ui_utils.DEFAULT_SCALE;
this._updateUIState(true);
}
_bindListeners() {
let eventBus = this.eventBus;
let self = this;
let items = this.items;
items.previous.addEventListener('click', function () {
eventBus.dispatch('previouspage');
});
items.next.addEventListener('click', function () {
eventBus.dispatch('nextpage');
});
items.zoomIn.addEventListener('click', function () {
eventBus.dispatch('zoomin');
});
items.zoomOut.addEventListener('click', function () {
eventBus.dispatch('zoomout');
});
items.pageNumber.addEventListener('click', function () {
this.select();
});
items.pageNumber.addEventListener('change', function () {
eventBus.dispatch('pagenumberchanged', {
source: self,
value: this.value
});
items.next.addEventListener('click', function () {
eventBus.dispatch('nextpage');
});
items.zoomIn.addEventListener('click', function () {
eventBus.dispatch('zoomin');
});
items.zoomOut.addEventListener('click', function () {
eventBus.dispatch('zoomout');
});
items.pageNumber.addEventListener('click', function () {
this.select();
});
items.pageNumber.addEventListener('change', function () {
eventBus.dispatch('pagenumberchanged', {
source: self,
value: this.value
});
});
items.scaleSelect.addEventListener('change', function () {
if (this.value === 'custom') {
return;
}
eventBus.dispatch('scalechanged', {
source: self,
value: this.value
});
});
items.presentationModeButton.addEventListener('click', function (e) {
eventBus.dispatch('presentationmode');
});
items.openFile.addEventListener('click', function (e) {
eventBus.dispatch('openfile');
});
items.print.addEventListener('click', function (e) {
eventBus.dispatch('print');
});
items.download.addEventListener('click', function (e) {
eventBus.dispatch('download');
});
items.scaleSelect.oncontextmenu = _ui_utils.noContextMenuHandler;
eventBus.on('localized', evt => {
this._localized();
});
},
_localized: function Toolbar_localized() {
this._wasLocalized = true;
this._adjustScaleWidth();
this._updateUIState(true);
},
_updateUIState: function Toolbar_updateUIState(resetNumPages) {
if (!this._wasLocalized) {
});
items.scaleSelect.addEventListener('change', function () {
if (this.value === 'custom') {
return;
}
let selectScaleOption = (value, scale) => {
let customScale = Math.round(scale * 10000) / 100;
this.l10n.get('page_scale_percent', { scale: customScale }, '{{scale}}%').then(msg => {
let options = items.scaleSelect.options;
let predefinedValueFound = false;
for (let i = 0, ii = options.length; i < ii; i++) {
let option = options[i];
if (option.value !== value) {
option.selected = false;
continue;
}
option.selected = true;
predefinedValueFound = true;
eventBus.dispatch('scalechanged', {
source: self,
value: this.value
});
});
items.presentationModeButton.addEventListener('click', function () {
eventBus.dispatch('presentationmode');
});
items.openFile.addEventListener('click', function () {
eventBus.dispatch('openfile');
});
items.print.addEventListener('click', function () {
eventBus.dispatch('print');
});
items.download.addEventListener('click', function () {
eventBus.dispatch('download');
});
items.scaleSelect.oncontextmenu = _ui_utils.noContextMenuHandler;
eventBus.on('localized', () => {
this._localized();
});
}
_localized() {
this._wasLocalized = true;
this._adjustScaleWidth();
this._updateUIState(true);
}
_updateUIState(resetNumPages = false) {
if (!this._wasLocalized) {
return;
}
let selectScaleOption = (value, scale) => {
let customScale = Math.round(scale * 10000) / 100;
this.l10n.get('page_scale_percent', { scale: customScale }, '{{scale}}%').then(msg => {
let options = items.scaleSelect.options;
let predefinedValueFound = false;
for (let i = 0, ii = options.length; i < ii; i++) {
let option = options[i];
if (option.value !== value) {
option.selected = false;
continue;
}
if (!predefinedValueFound) {
items.customScaleOption.textContent = msg;
items.customScaleOption.selected = true;
}
});
};
var pageNumber = this.pageNumber;
var scaleValue = (this.pageScaleValue || this.pageScale).toString();
var scale = this.pageScale;
var items = this.items;
var pagesCount = this.pagesCount;
if (resetNumPages) {
if (this.hasPageLabels) {
items.pageNumber.type = 'text';
} else {
items.pageNumber.type = 'number';
this.l10n.get('of_pages', { pagesCount }, 'of {{pagesCount}}').then(msg => {
items.numPages.textContent = msg;
});
option.selected = true;
predefinedValueFound = true;
}
items.pageNumber.max = pagesCount;
}
if (this.hasPageLabels) {
items.pageNumber.value = this.pageLabel;
this.l10n.get('page_of_pages', {
pageNumber,
pagesCount
}, '({{pageNumber}} of {{pagesCount}})').then(msg => {
items.numPages.textContent = msg;
});
} else {
items.pageNumber.value = pageNumber;
}
items.previous.disabled = pageNumber <= 1;
items.next.disabled = pageNumber >= pagesCount;
items.zoomOut.disabled = scale <= _ui_utils.MIN_SCALE;
items.zoomIn.disabled = scale >= _ui_utils.MAX_SCALE;
selectScaleOption(scaleValue, scale);
},
updateLoadingIndicatorState: function Toolbar_updateLoadingIndicatorState(loading) {
var pageNumberInput = this.items.pageNumber;
if (loading) {
pageNumberInput.classList.add(PAGE_NUMBER_LOADING_INDICATOR);
} else {
pageNumberInput.classList.remove(PAGE_NUMBER_LOADING_INDICATOR);
}
},
_adjustScaleWidth: function Toolbar_adjustScaleWidth() {
var container = this.items.scaleSelectContainer;
var select = this.items.scaleSelect;
_ui_utils.animationStarted.then(function () {
if (container.clientWidth === 0) {
container.setAttribute('style', 'display: inherit;');
}
if (container.clientWidth > 0) {
select.setAttribute('style', 'min-width: inherit;');
var width = select.clientWidth + SCALE_SELECT_CONTAINER_PADDING;
select.setAttribute('style', 'min-width: ' + (width + SCALE_SELECT_PADDING) + 'px;');
container.setAttribute('style', 'min-width: ' + width + 'px; ' + 'max-width: ' + width + 'px;');
if (!predefinedValueFound) {
items.customScaleOption.textContent = msg;
items.customScaleOption.selected = true;
}
});
};
let pageNumber = this.pageNumber;
let scaleValue = (this.pageScaleValue || this.pageScale).toString();
let scale = this.pageScale;
let items = this.items;
let pagesCount = this.pagesCount;
if (resetNumPages) {
if (this.hasPageLabels) {
items.pageNumber.type = 'text';
} else {
items.pageNumber.type = 'number';
this.l10n.get('of_pages', { pagesCount }, 'of {{pagesCount}}').then(msg => {
items.numPages.textContent = msg;
});
}
items.pageNumber.max = pagesCount;
}
};
return Toolbar;
}();
if (this.hasPageLabels) {
items.pageNumber.value = this.pageLabel;
this.l10n.get('page_of_pages', {
pageNumber,
pagesCount
}, '({{pageNumber}} of {{pagesCount}})').then(msg => {
items.numPages.textContent = msg;
});
} else {
items.pageNumber.value = pageNumber;
}
items.previous.disabled = pageNumber <= 1;
items.next.disabled = pageNumber >= pagesCount;
items.zoomOut.disabled = scale <= _ui_utils.MIN_SCALE;
items.zoomIn.disabled = scale >= _ui_utils.MAX_SCALE;
selectScaleOption(scaleValue, scale);
}
updateLoadingIndicatorState(loading = false) {
let pageNumberInput = this.items.pageNumber;
if (loading) {
pageNumberInput.classList.add(PAGE_NUMBER_LOADING_INDICATOR);
} else {
pageNumberInput.classList.remove(PAGE_NUMBER_LOADING_INDICATOR);
}
}
_adjustScaleWidth() {
let container = this.items.scaleSelectContainer;
let select = this.items.scaleSelect;
_ui_utils.animationStarted.then(function () {
if (container.clientWidth === 0) {
container.setAttribute('style', 'display: inherit;');
}
if (container.clientWidth > 0) {
select.setAttribute('style', 'min-width: inherit;');
let width = select.clientWidth + SCALE_SELECT_CONTAINER_PADDING;
select.setAttribute('style', 'min-width: ' + (width + SCALE_SELECT_PADDING) + 'px;');
container.setAttribute('style', 'min-width: ' + width + 'px; ' + 'max-width: ' + width + 'px;');
}
});
}
}
exports.Toolbar = Toolbar;
/***/ }),

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

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

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

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

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -55,7 +55,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ 0:
/***/ 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__) {
"use strict";

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

@ -7,7 +7,10 @@
* 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;
function initChromeDebugger() {
@ -21,8 +24,11 @@ function initChromeDebugger() {
}
function onClose() {
is(gProcess._dbgProcess.exitCode, (Services.appinfo.OS == "WINNT" ? -9 : -15),
"The remote debugger process didn't die cleanly.");
is(
gProcess._dbgProcess.exitCode,
Services.appinfo.OS == "WINNT" ? -9 : -15,
"The remote debugger process didn't die cleanly."
);
info("process exit value: " + gProcess._dbgProcess.exitCode);
@ -36,33 +42,42 @@ registerCleanupFunction(function() {
gProcess = null;
});
add_task(function* () {
add_task(function*() {
// Windows XP and 8.1 test slaves are terribly slow at this test.
requestLongerTimeout(5);
Services.prefs.setBoolPref("devtools.debugger.remote-enabled", true);
gProcess = yield initChromeDebugger();
ok(gProcess._dbgProcess,
"The remote debugger process wasn't created properly!");
ok(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 (?!)");
ok(
gProcess._dbgProcess,
"The remote debugger process wasn't created properly!"
);
ok(
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 pid: " + gProcess._dbgProcess.pid);
info("process name: " + gProcess._dbgProcess.processName);
info("process sig: " + gProcess._dbgProcess.processSignature);
ok(gProcess._dbgProfilePath,
"The remote debugger profile wasn't created properly!");
ok(
gProcess._dbgProfilePath,
"The remote debugger profile wasn't created properly!"
);
is(
gProcess._dbgProfilePath,
OS.Path.join(OS.Constants.Path.profileDir, "chrome_debugger_profile"),
"The remote debugger profile isn't where we expect it!"
);
"The remote debugger profile isn't where we expect it!"
);
info("profile path: " + gProcess._dbgProfilePath);

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

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

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

@ -58,13 +58,32 @@ add_task(function*() {
);
// 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() {
content.eval("window.evaledFunc = function() {} //# sourceURL=evaled.js");
});
yield waitForSourceCount(dbg, 11);
yield waitForSourceCount(dbg, 3);
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",
"The eval script exists"
"the eval script exists"
);
});

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

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

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

@ -38,8 +38,8 @@ pref("devtools.debugger.start-panel-collapsed", false);
pref("devtools.debugger.end-panel-collapsed", false);
pref("devtools.debugger.tabs", "[]");
pref("devtools.debugger.pending-selected-location", "{}");
pref("devtools.debugger.pending-breakpoints", "[]");
pref("devtools.debugger.pending-breakpoints", "{}");
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-regex-match", false);

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

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

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

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

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

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

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

@ -109,6 +109,13 @@ SelectionChangeListener::NotifySelectionChanged(nsIDOMDocument* aDoc,
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
// update mOldRanges so that changes after the changes stop being hidden don't
// incorrectly trigger a change, even though they didn't change anything

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

@ -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

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

@ -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

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

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

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

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

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

@ -14,118 +14,13 @@
#include "mozilla/dom/TabGroup.h"
#include "OrderedTimeoutIterator.h"
#include "TimeoutExecutor.h"
#include "TimeoutBudgetManager.h"
using namespace mozilla;
using namespace mozilla::dom;
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;
// The default shortest interval/timeout we permit
@ -251,6 +146,34 @@ TimeoutManager::CalculateDelay(Timeout* aTimeout) const {
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
// These strategies are useful for testing.
#define ALL_NORMAL_TIMEOUT_BUCKETING_STRATEGY 1 // Consider all timeouts as normal
@ -904,22 +827,9 @@ TimeoutManager::BeginRunningTimeout(Timeout* aTimeout)
{
Timeout* currentTimeout = mRunningTimeout;
mRunningTimeout = aTimeout;
++gRunningTimeoutDepth;
if (!mWindow.IsChromeWindow()) {
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);
}
RecordExecution(currentTimeout, aTimeout);
return currentTimeout;
}
@ -928,17 +838,7 @@ TimeoutManager::EndRunningTimeout(Timeout* aTimeout)
{
--gRunningTimeoutDepth;
if (!mWindow.IsChromeWindow()) {
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);
}
}
RecordExecution(mRunningTimeout, aTimeout);
mRunningTimeout = aTimeout;
}
@ -1146,22 +1046,14 @@ TimeoutManager::BeginSyncOperation()
// equivalent to the period of us spinning up a new event loop,
// record what we have and stop recording until we reach
// EndSyncOperation.
if (!mWindow.IsChromeWindow()) {
if (mRunningTimeout) {
TimeoutTelemetry::Get().RecordExecution(
TimeStamp::Now(), mRunningTimeout, IsBackground());
}
TimeoutTelemetry::Get().StopRecording();
}
RecordExecution(mRunningTimeout, nullptr);
}
void
TimeoutManager::EndSyncOperation()
{
// If we're running a timeout, restart the measurement from here.
if (!mWindow.IsChromeWindow() && mRunningTimeout) {
TimeoutTelemetry::Get().StartRecording(TimeStamp::Now());
}
RecordExecution(nullptr, mRunningTimeout);
}
nsIEventTarget*

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -80,7 +80,7 @@ nsDOMNavigationTiming::NotifyNavigationStart(DocShellState aDocShellState)
mNavigationStartHighRes = (double)PR_Now() / PR_USEC_PER_MSEC;
mNavigationStartTimeStamp = TimeStamp::Now();
mDocShellHasBeenActiveSinceNavigationStart = (aDocShellState == DocShellState::eActive);
PROFILER_MARKER("Navigation::Start");
profiler_add_marker("Navigation::Start");
}
void
@ -169,7 +169,7 @@ nsDOMNavigationTiming::NotifyDOMLoading(nsIURI* aURI)
mDOMLoading = DurationFromStart();
mDOMLoadingSet = true;
PROFILER_MARKER("Navigation::DOMLoading");
profiler_add_marker("Navigation::DOMLoading");
if (IsTopLevelContentDocument()) {
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_LOADING_MS,
@ -186,7 +186,7 @@ nsDOMNavigationTiming::NotifyDOMInteractive(nsIURI* aURI)
mDOMInteractive = DurationFromStart();
mDOMInteractiveSet = true;
PROFILER_MARKER("Navigation::DOMInteractive");
profiler_add_marker("Navigation::DOMInteractive");
if (IsTopLevelContentDocument()) {
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_INTERACTIVE_MS,
@ -203,7 +203,7 @@ nsDOMNavigationTiming::NotifyDOMComplete(nsIURI* aURI)
mDOMComplete = DurationFromStart();
mDOMCompleteSet = true;
PROFILER_MARKER("Navigation::DOMComplete");
profiler_add_marker("Navigation::DOMComplete");
if (IsTopLevelContentDocument()) {
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",
int(elapsed.ToMilliseconds()), spec.get(),
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) {

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

@ -2330,6 +2330,26 @@ nsDOMWindowUtils::GetLayerManagerRemote(bool* retval)
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
nsDOMWindowUtils::GetSupportsHardwareH264Decoding(JS::MutableHandle<JS::Value> aPromise)
{
@ -3394,7 +3414,7 @@ PrepareForFullscreenChange(nsIPresShell* aPresShell, const nsSize& aSize,
NS_IMETHODIMP
nsDOMWindowUtils::HandleFullscreenRequests(bool* aRetVal)
{
PROFILER_MARKER("Enter fullscreen");
profiler_add_marker("Enter fullscreen");
nsCOMPtr<nsIDocument> doc = GetDocument();
NS_ENSURE_STATE(doc);
@ -3417,7 +3437,7 @@ nsDOMWindowUtils::HandleFullscreenRequests(bool* aRetVal)
nsresult
nsDOMWindowUtils::ExitFullscreen()
{
PROFILER_MARKER("Exit fullscreen");
profiler_add_marker("Exit fullscreen");
nsCOMPtr<nsIDocument> doc = GetDocument();
NS_ENSURE_STATE(doc);

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

@ -100,6 +100,8 @@
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/PromiseNativeHandler.h"
#include "mozilla/dom/HTMLBodyElement.h"
#include "ContentPrincipal.h"
#ifdef XP_WIN
@ -270,7 +272,7 @@ nsFrameLoader::LoadFrame()
}
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();
nsCOMPtr<nsIURI> uri;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -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,
* otherwise exits fullscreen.
@ -667,6 +685,7 @@ protected:
bool mIsInnerWindow;
bool mMayHavePaintEventListener;
bool mMayHaveTouchEventListener;
bool mMayHaveSelectionChangeEventListener;
bool mMayHaveMouseEnterLeaveEventListener;
bool mMayHavePointerEnterLeaveEventListener;

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

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

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

@ -65,20 +65,6 @@ public:
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
NS_DECL_NSIDOMRANGE
@ -449,7 +435,6 @@ protected:
bool mIsGenerated : 1;
bool mStartOffsetWasIncremented : 1;
bool mEndOffsetWasIncremented : 1;
bool mEnableGravitationOnElementRemoval : 1;
bool mCalledByJS : 1;
#ifdef DEBUG
int32_t mAssertNextInsertOrAppendIndex;

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

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

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

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

2
dom/cache/TypeUtils.cpp поставляемый
Просмотреть файл

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

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

@ -44,8 +44,8 @@ ChooseValidatorCompileOptions(const ShBuiltInResources& resources,
options |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS;
#endif
#ifdef XP_MACOSX
if (gl->WorkAroundDriverBugs()) {
#ifdef XP_MACOSX
// Work around https://bugs.webkit.org/show_bug.cgi?id=124684,
// https://chromium.googlesource.com/angle/angle/+/5e70cf9d0b1bb
options |= SH_UNFOLD_SHORT_CIRCUIT;
@ -57,9 +57,14 @@ ChooseValidatorCompileOptions(const ShBuiltInResources& resources,
// Work around that Intel drivers on Mac OSX handle for-loop incorrectly.
if (gl->Vendor() == gl::GLVendor::Intel) {
options |= SH_ADD_AND_TRUE_TO_LOOP_CONDITION;
#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;
}
}
#endif
if (gfxPrefs::WebGLAllANGLEOptions()) {
options = -1;

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

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

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

@ -246,11 +246,11 @@ protected:
// optimized for native IMEs. For example, <br> element and some block
// elements causes "\n" (or "\r\n"), see also ShouldBreakLineBefore().
nsresult GenerateFlatTextContent(nsIContent* aContent,
nsAFlatString& aString,
nsString& aString,
LineBreakType aLineBreakType);
// Get the contents of aRange as plain text.
nsresult GenerateFlatTextContent(nsRange* aRange,
nsAFlatString& aString,
nsString& aString,
LineBreakType aLineBreakType);
// 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

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

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

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

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

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

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

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

@ -1403,7 +1403,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTM
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcMediaSource)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcStream)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcAttrStream)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourcePointer)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLoadBlockedDoc)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceLoadCandidate)
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_UNLINK_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLElement)
tmp->RemoveMutationObserver(tmp);
if (tmp->mSrcStream) {
// Need to EndMediaStreamPlayback to clear mSrcStream and make sure everything
// 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(mMediaSource)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSrcMediaSource)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSourcePointer)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mLoadBlockedDoc)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSourceLoadCandidate)
if (tmp->mAudioChannelWrapper) {
@ -1463,6 +1462,35 @@ NS_IMPL_BOOL_ATTR(HTMLMediaElement, Loop, loop)
NS_IMPL_BOOL_ATTR(HTMLMediaElement, DefaultMuted, muted)
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)
HTMLMediaElement::IsVideo()
{
@ -1741,7 +1769,7 @@ void HTMLMediaElement::AbortExistingLoads()
mIsEncrypted = false;
mPendingEncryptedInitData.Reset();
mWaitingForKey = NOT_WAITING_FOR_KEY;
mSourcePointer = nullptr;
mSourcePointer = 0;
mTags = nullptr;
@ -2244,10 +2272,7 @@ void HTMLMediaElement::LoadFromSourceChildren()
NS_ASSERTION(mIsLoadingFromSourceChildren,
"Must remember we're loading from source children");
nsIDocument* parentDoc = OwnerDoc()->GetParentDocument();
if (parentDoc) {
parentDoc->FlushPendingNotifications(FlushType::Layout);
}
AddMutationObserverUnlessExists(this);
while (true) {
nsIContent* child = GetNextSource();
@ -3708,6 +3733,7 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
mSrcStreamPausedCurrentTime(-1),
mShutdownObserver(new ShutdownObserver),
mCurrentLoadID(0),
mSourcePointer(0),
mNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY),
mReadyState(nsIDOMHTMLMediaElement::HAVE_NOTHING, "HTMLMediaElement::mReadyState"),
mLoadWaitStatus(NOT_WAITING),
@ -6356,46 +6382,16 @@ void HTMLMediaElement::NotifyAddedSource()
nsIContent* HTMLMediaElement::GetNextSource()
{
nsCOMPtr<nsIDOMNode> thisDomNode = do_QueryObject(this);
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) {
#ifdef DEBUG
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())
if (mSourcePointer >= GetChildCount())
return nullptr; // No more children.
// Advance the range to the next child.
rv = mSourcePointer->SetStart(thisDomNode, startOffset + 1);
NS_ENSURE_SUCCESS(rv, nullptr);
nsIContent* child = GetChildAt(mSourcePointer);
nsIContent* child = GetChildAt(startOffset);
// Advance to the next child.
++mSourcePointer;
// If child is a <source> element, it is the next candidate.
if (child && child->IsHTMLElement(nsGkAtoms::source)) {

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

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

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

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

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

@ -1416,6 +1416,11 @@ interface nsIDOMWindowUtils : nsISupports {
*/
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
* of the h264 decoder have been determined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -46,7 +46,7 @@ public:
* or -1 if no indices match.
* 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

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

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

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

@ -633,7 +633,8 @@ U2FSoftTokenManager::IsRegistered(const nsTArray<uint8_t>& aKeyHandle,
// * attestation signature
//
nsresult
U2FSoftTokenManager::Register(const nsTArray<uint8_t>& aApplication,
U2FSoftTokenManager::Register(const nsTArray<WebAuthnScopedCredentialDescriptor>& aDescriptors,
const nsTArray<uint8_t>& aApplication,
const nsTArray<uint8_t>& aChallenge,
/* out */ nsTArray<uint8_t>& aRegistration,
/* 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
MOZ_ASSERT(mWrappingKey);
@ -745,9 +758,10 @@ U2FSoftTokenManager::Register(const nsTArray<uint8_t>& aApplication,
// * Signature
//
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>& aKeyHandle,
nsTArray<uint8_t>& aKeyHandle,
nsTArray<uint8_t>& aSignature)
{
nsNSSShutDownPreventionLock locker;
@ -755,14 +769,20 @@ U2FSoftTokenManager::Sign(const nsTArray<uint8_t>& aApplication,
return NS_ERROR_NOT_AVAILABLE;
}
MOZ_ASSERT(mInitialized);
if (NS_WARN_IF(!mInitialized)) {
nsresult rv = Init();
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
for (auto desc: aDescriptors) {
bool isRegistered = false;
nsresult rv = IsRegistered(desc.id(), aApplication, isRegistered);
if (NS_SUCCEEDED(rv) && isRegistered) {
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);
UniquePK11SlotInfo slot(PK11_GetInternalSlot());

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

@ -24,17 +24,18 @@ class U2FSoftTokenManager final : public U2FTokenTransport,
{
public:
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,
/* out */ nsTArray<uint8_t>& aRegistration,
/* 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>& aKeyHandle,
/* out */ nsTArray<uint8_t>& aKeyHandle,
/* out */ nsTArray<uint8_t>& aSignature) override;
nsresult IsRegistered(const nsTArray<uint8_t>& aKeyHandle,
const nsTArray<uint8_t>& aAppParam,
bool& aResult);
// For nsNSSShutDownObject
virtual void virtualDestroyNSSReference() override;
@ -45,6 +46,10 @@ private:
nsresult Init();
bool IsCompatibleVersion(const nsAString& aVersion);
nsresult IsRegistered(const nsTArray<uint8_t>& aKeyHandle,
const nsTArray<uint8_t>& aAppParam,
bool& aResult);
bool mInitialized;
mozilla::UniquePK11SymKey mWrappingKey;

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

@ -154,7 +154,7 @@ U2FTokenManager::MaybeClearTransaction(WebAuthnTransactionParent* aParent)
}
mTransactionParent = nullptr;
// Drop managers at the end of all transactions
mSoftTokenManager = nullptr;
mTokenManagerImpl = nullptr;
}
void
@ -179,52 +179,39 @@ U2FTokenManager::Register(WebAuthnTransactionParent* aTransactionParent,
//
// TODO Check all transports and use WebAuthnRequest to aggregate
// replies
if (U2FPrefManager::Get()->GetSoftTokenEnabled()) {
if (!mSoftTokenManager) {
mSoftTokenManager = new U2FSoftTokenManager(U2FPrefManager::Get()->GetSoftTokenCounter());
}
// Check if all the supplied parameters are syntactically well-formed and
// of the correct length. If not, return an error code equivalent to
// UnknownError and terminate the operation.
if ((aTransactionInfo.RpIdHash().Length() != SHA256_LENGTH) ||
(aTransactionInfo.ClientDataHash().Length() != SHA256_LENGTH)) {
Cancel(NS_ERROR_DOM_UNKNOWN_ERR);
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> sig;
rv = mSoftTokenManager->Register(aTransactionInfo.RpIdHash(),
aTransactionInfo.ClientDataHash(),
reg,
sig);
if (NS_FAILED(rv)) {
Cancel(rv);
return;
}
Unused << mTransactionParent->SendConfirmRegister(reg,
sig);
MaybeClearTransaction(mTransactionParent);
if (!U2FPrefManager::Get()->GetSoftTokenEnabled()) {
Cancel(NS_ERROR_DOM_NOT_ALLOWED_ERR);
return;
}
Cancel(NS_ERROR_DOM_NOT_ALLOWED_ERR);
if (!mTokenManagerImpl) {
mTokenManagerImpl = new U2FSoftTokenManager(U2FPrefManager::Get()->GetSoftTokenCounter());
}
// Check if all the supplied parameters are syntactically well-formed and
// of the correct length. If not, return an error code equivalent to
// UnknownError and terminate the operation.
if ((aTransactionInfo.RpIdHash().Length() != SHA256_LENGTH) ||
(aTransactionInfo.ClientDataHash().Length() != SHA256_LENGTH)) {
Cancel(NS_ERROR_DOM_UNKNOWN_ERR);
return;
}
nsTArray<uint8_t> reg;
nsTArray<uint8_t> sig;
nsresult rv = mTokenManagerImpl->Register(aTransactionInfo.Descriptors(),
aTransactionInfo.RpIdHash(),
aTransactionInfo.ClientDataHash(),
reg,
sig);
if (NS_FAILED(rv)) {
Cancel(rv);
return;
}
Unused << mTransactionParent->SendConfirmRegister(reg, sig);
MaybeClearTransaction(mTransactionParent);
}
void
@ -240,39 +227,35 @@ U2FTokenManager::Sign(WebAuthnTransactionParent* aTransactionParent,
//
// TODO Check all transports and use WebAuthnRequest to aggregate
// replies
if (U2FPrefManager::Get()->GetSoftTokenEnabled()) {
if (!mSoftTokenManager) {
mSoftTokenManager = new U2FSoftTokenManager(U2FPrefManager::Get()->GetSoftTokenCounter());
}
if ((aTransactionInfo.RpIdHash().Length() != SHA256_LENGTH) ||
(aTransactionInfo.ClientDataHash().Length() != SHA256_LENGTH)) {
Cancel(NS_ERROR_DOM_UNKNOWN_ERR);
return;
}
for (auto desc: aTransactionInfo.Descriptors()) {
bool reg;
nsresult rv = mSoftTokenManager->IsRegistered(desc.id(), aTransactionInfo.RpIdHash(), reg);
if (!reg) {
continue;
}
nsTArray<uint8_t> sig;
rv = mSoftTokenManager->Sign(aTransactionInfo.RpIdHash(),
aTransactionInfo.ClientDataHash(),
desc.id(),
sig);
if (NS_FAILED(rv)) {
Cancel(rv);
return;
}
Unused << mTransactionParent->SendConfirmSign(desc.id(), sig);
MaybeClearTransaction(mTransactionParent);
return;
}
if (!U2FPrefManager::Get()->GetSoftTokenEnabled()) {
Cancel(NS_ERROR_DOM_NOT_ALLOWED_ERR);
return;
}
// If we come out of the loop, we aren't registered
Cancel(NS_ERROR_DOM_NOT_ALLOWED_ERR);
if (!mTokenManagerImpl) {
mTokenManagerImpl = new U2FSoftTokenManager(U2FPrefManager::Get()->GetSoftTokenCounter());
}
if ((aTransactionInfo.RpIdHash().Length() != SHA256_LENGTH) ||
(aTransactionInfo.ClientDataHash().Length() != SHA256_LENGTH)) {
Cancel(NS_ERROR_DOM_UNKNOWN_ERR);
return;
}
nsTArray<uint8_t> id;
nsTArray<uint8_t> sig;
nsresult rv = mTokenManagerImpl->Sign(aTransactionInfo.Descriptors(),
aTransactionInfo.RpIdHash(),
aTransactionInfo.ClientDataHash(),
id,
sig);
if (NS_FAILED(rv)) {
Cancel(rv);
return;
}
Unused << mTransactionParent->SendConfirmSign(id, sig);
MaybeClearTransaction(mTransactionParent);
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -84,7 +84,7 @@ nsresult
XMLUtils::splitQName(const nsAString& aName, nsIAtom** aPrefix,
nsIAtom** aLocalName)
{
const nsAFlatString& qName = PromiseFlatString(aName);
const nsString& qName = PromiseFlatString(aName);
const char16_t* colon;
bool valid = XMLUtils::isValidQName(qName, &colon);
if (!valid) {
@ -109,9 +109,9 @@ XMLUtils::splitQName(const nsAString& aName, nsIAtom** aPrefix,
/**
* 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.EndReading(end);
for ( ; start != end; ++start) {
@ -155,8 +155,7 @@ void XMLUtils::normalizePIValue(nsAString& piValue)
}
//static
bool XMLUtils::isValidQName(const nsAFlatString& aQName,
const char16_t** aColon)
bool XMLUtils::isValidQName(const nsString& aQName, const char16_t** aColon)
{
return NS_SUCCEEDED(nsContentUtils::CheckQName(aQName, true, aColon));
}

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

@ -43,7 +43,7 @@ public:
/**
* 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
@ -53,8 +53,7 @@ public:
/**
* Returns true if the given string is a valid XML QName
*/
static bool isValidQName(const nsAFlatString& aQName,
const char16_t** aColon);
static bool isValidQName(const nsString& aQName, const char16_t** aColon);
/**
* Returns true if the given character represents an Alpha letter

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

@ -430,7 +430,7 @@ txCoreFunctionCall::evaluate(txIEvalContext* aContext, txAExprResult** aResult)
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);
}
case SUBSTRING_BEFORE:

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

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

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