зеркало из https://github.com/mozilla/gecko-dev.git
merge mozilla-central to autoland. r=merge a=merge
This commit is contained in:
Коммит
db670f1744
|
@ -329,20 +329,27 @@ NotificationController::CoalesceMutationEvents()
|
|||
// queue, so we want to use the spot of the event with the higher
|
||||
// generation number, and keep that generation number.
|
||||
if (reorder && reorder->EventGeneration() < event->EventGeneration()) {
|
||||
// There really should be a show or hide event before the first
|
||||
// reorder event.
|
||||
if (reorder->PrevEvent()) {
|
||||
reorder->PrevEvent()->SetNextEvent(reorder->NextEvent());
|
||||
} else {
|
||||
mFirstMutationEvent = reorder->NextEvent();
|
||||
}
|
||||
|
||||
reorder->NextEvent()->SetPrevEvent(reorder->PrevEvent());
|
||||
event->PrevEvent()->SetNextEvent(reorder);
|
||||
reorder->SetPrevEvent(event->PrevEvent());
|
||||
event->SetPrevEvent(reorder);
|
||||
reorder->SetNextEvent(event);
|
||||
reorder->SetEventGeneration(event->EventGeneration());
|
||||
|
||||
// It may be true that reorder was before event, and we coalesced
|
||||
// away all the show / hide events between them. In that case
|
||||
// event is already immediately after reorder in the queue and we
|
||||
// do not need to rearrange the list of events.
|
||||
if (event != reorder->NextEvent()) {
|
||||
// There really should be a show or hide event before the first
|
||||
// reorder event.
|
||||
if (reorder->PrevEvent()) {
|
||||
reorder->PrevEvent()->SetNextEvent(reorder->NextEvent());
|
||||
} else {
|
||||
mFirstMutationEvent = reorder->NextEvent();
|
||||
}
|
||||
|
||||
reorder->NextEvent()->SetPrevEvent(reorder->PrevEvent());
|
||||
event->PrevEvent()->SetNextEvent(reorder);
|
||||
reorder->SetPrevEvent(event->PrevEvent());
|
||||
event->SetPrevEvent(reorder);
|
||||
reorder->SetNextEvent(event);
|
||||
}
|
||||
}
|
||||
DropMutationEvent(event);
|
||||
break;
|
||||
|
|
|
@ -360,8 +360,7 @@ HistoryDownloadElementShell.prototype = {
|
|||
DownloadsCommon.removeAndFinalizeDownload(this.download);
|
||||
}
|
||||
if (this._historyDownload) {
|
||||
let uri = NetUtil.newURI(this.download.source.url);
|
||||
PlacesUtils.bhistory.removePage(uri);
|
||||
PlacesUtils.history.remove(this.download.source.url);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -1204,8 +1204,7 @@ DownloadsViewItem.prototype = {
|
|||
|
||||
cmd_delete() {
|
||||
DownloadsCommon.removeAndFinalizeDownload(this.download);
|
||||
PlacesUtils.bhistory.removePage(
|
||||
NetUtil.newURI(this.download.source.url));
|
||||
PlacesUtils.history.remove(this.download.source.url).catch(Cu.reportError);
|
||||
},
|
||||
|
||||
downloadsCmd_unblock() {
|
||||
|
|
|
@ -58,8 +58,10 @@ function getTree(rootGuid, onlyChildren) {
|
|||
let children = root.children || [];
|
||||
return children.map(child => convert(child, root));
|
||||
}
|
||||
let treenode = convert(root, null);
|
||||
treenode.parentId = root.parentGuid;
|
||||
// It seems like the array always just contains the root node.
|
||||
return [convert(root, null)];
|
||||
return [treenode];
|
||||
}).catch(e => Promise.reject({message: e.message}));
|
||||
}
|
||||
|
||||
|
|
|
@ -287,6 +287,7 @@ add_task(async function test_bookmarks() {
|
|||
}).then(results => {
|
||||
browser.test.assertEq(1, results.length, "Expected number of nodes returned by getSubTree");
|
||||
browser.test.assertEq("Mozilla Folder", results[0].title, "Folder has the expected title");
|
||||
browser.test.assertEq(bookmarkGuids.unfiledGuid, results[0].parentId, "Folder has the expected parentId");
|
||||
let children = results[0].children;
|
||||
browser.test.assertEq(4, children.length, "Expected number of bookmarks returned by getSubTree");
|
||||
browser.test.assertEq("Firefox", children[0].title, "Bookmark has the expected title");
|
||||
|
|
|
@ -23,10 +23,6 @@ const RELOAD_ACTION_REMOVE = 2;
|
|||
// rows.
|
||||
const RELOAD_ACTION_MOVE = 3;
|
||||
|
||||
// When removing a bunch of pages we split them in chunks to give some breath
|
||||
// to the main-thread.
|
||||
const REMOVE_PAGES_CHUNKLEN = 300;
|
||||
|
||||
/**
|
||||
* Represents an insertion point within a container where we can insert
|
||||
* items.
|
||||
|
@ -892,7 +888,7 @@ PlacesController.prototype = {
|
|||
PlacesUtils.asQuery(node.parent).queryOptions.queryType ==
|
||||
Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY) {
|
||||
// This is a uri node inside an history query.
|
||||
PlacesUtils.bhistory.removePage(NetUtil.newURI(node.uri));
|
||||
PlacesUtils.history.removePage(node.uri).catch(Components.utils.reportError);
|
||||
// History deletes are not undoable, so we don't have a transaction.
|
||||
} else if (node.itemId == -1 &&
|
||||
PlacesUtils.nodeIsQuery(node) &&
|
||||
|
@ -945,21 +941,17 @@ PlacesController.prototype = {
|
|||
}),
|
||||
|
||||
/**
|
||||
* Removes the set of selected ranges from history.
|
||||
* Removes the set of selected ranges from history, asynchronously.
|
||||
*
|
||||
* @note history deletes are not undoable.
|
||||
*/
|
||||
_removeRowsFromHistory: function PC__removeRowsFromHistory() {
|
||||
let nodes = this._view.selectedNodes;
|
||||
let URIs = [];
|
||||
let URIs = new Set();
|
||||
for (let i = 0; i < nodes.length; ++i) {
|
||||
let node = nodes[i];
|
||||
if (PlacesUtils.nodeIsURI(node)) {
|
||||
let uri = NetUtil.newURI(node.uri);
|
||||
// Avoid duplicates.
|
||||
if (URIs.indexOf(uri) < 0) {
|
||||
URIs.push(uri);
|
||||
}
|
||||
URIs.add(node.uri);
|
||||
} else if (PlacesUtils.nodeIsQuery(node) &&
|
||||
PlacesUtils.asQuery(node).queryOptions.queryType ==
|
||||
Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY) {
|
||||
|
@ -967,18 +959,7 @@ PlacesController.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
// Do removal in chunks to give some breath to main-thread.
|
||||
function* pagesChunkGenerator(aURIs) {
|
||||
while (aURIs.length) {
|
||||
let URIslice = aURIs.splice(0, REMOVE_PAGES_CHUNKLEN);
|
||||
PlacesUtils.bhistory.removePages(URIslice, URIslice.length);
|
||||
Services.tm.mainThread.dispatch(() => gen.next(),
|
||||
Ci.nsIThread.DISPATCH_NORMAL);
|
||||
yield undefined;
|
||||
}
|
||||
}
|
||||
let gen = pagesChunkGenerator(URIs);
|
||||
gen.next();
|
||||
PlacesUtils.history.remove([...URIs]).catch(Components.utils.reportError);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,6 +41,26 @@
|
|||
* Ensures that history views are updated after deleting entries.
|
||||
*/
|
||||
|
||||
function promiseURIDeleted() {
|
||||
return new Promise(resolve => {
|
||||
let historyObserver = {
|
||||
onBeginUpdateBatch: function PEX_onBeginUpdateBatch() {},
|
||||
onEndUpdateBatch: function PEX_onEndUpdateBatch() {},
|
||||
onClearHistory() {},
|
||||
onVisit() {},
|
||||
onTitleChanged() {},
|
||||
onDeleteURI(aURI, aGUID, aReason) {
|
||||
PlacesUtils.history.removeObserver(historyObserver);
|
||||
resolve();
|
||||
},
|
||||
onPageChanged() {},
|
||||
onDeleteVisits(aURI, aTime) { },
|
||||
};
|
||||
|
||||
PlacesUtils.history.addObserver(historyObserver, false);
|
||||
});
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
@ -106,10 +126,12 @@
|
|||
for (let i = 0; i < rc; i++) {
|
||||
selection.select(0);
|
||||
let node = tree.selectedNode;
|
||||
let promiseDeleted = promiseURIDeleted();
|
||||
tree.controller.remove("Removing page");
|
||||
yield promiseDeleted;
|
||||
ok(treeView.treeIndexForNode(node) == Ci.nsINavHistoryResultTreeViewer.INDEX_INVISIBLE,
|
||||
node.uri + " removed.");
|
||||
ok(treeView.rowCount == rc - i - 1, "Rows count decreased");
|
||||
is(treeView.rowCount, rc - i - 1, "Rows count decreased");
|
||||
}
|
||||
|
||||
// Cleanup.
|
||||
|
|
|
@ -70,6 +70,7 @@ support-files =
|
|||
[browser_async_duplicate_tab.js]
|
||||
[browser_async_flushes.js]
|
||||
run-if = e10s && crashreporter
|
||||
skip-if = debug # bug 1167933
|
||||
[browser_async_remove_tab.js]
|
||||
run-if = e10s
|
||||
[browser_attributes.js]
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
This is the pdf.js project output, https://github.com/mozilla/pdf.js
|
||||
|
||||
Current extension version is: 1.7.359
|
||||
Current extension version is: 1.7.367
|
||||
|
|
|
@ -3667,8 +3667,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
|
|||
}
|
||||
};
|
||||
}();
|
||||
exports.version = '1.7.359';
|
||||
exports.build = 'd471e356';
|
||||
exports.version = '1.7.367';
|
||||
exports.build = 'f0c45f03';
|
||||
exports.getDocument = getDocument;
|
||||
exports.PDFDataRangeTransport = PDFDataRangeTransport;
|
||||
exports.PDFWorker = PDFWorker;
|
||||
|
@ -4685,8 +4685,8 @@ if (!globalScope.PDFJS) {
|
|||
globalScope.PDFJS = {};
|
||||
}
|
||||
var PDFJS = globalScope.PDFJS;
|
||||
PDFJS.version = '1.7.359';
|
||||
PDFJS.build = 'd471e356';
|
||||
PDFJS.version = '1.7.367';
|
||||
PDFJS.build = 'f0c45f03';
|
||||
PDFJS.pdfBug = false;
|
||||
if (PDFJS.verbosity !== undefined) {
|
||||
sharedUtil.setVerbosityLevel(PDFJS.verbosity);
|
||||
|
@ -7051,7 +7051,7 @@ var TilingPattern = function TilingPatternClosure() {
|
|||
0,
|
||||
0
|
||||
];
|
||||
this.bbox = IR[4];
|
||||
this.bbox = Util.normalizeRect(IR[4]);
|
||||
this.xstep = IR[5];
|
||||
this.ystep = IR[6];
|
||||
this.paintType = IR[7];
|
||||
|
@ -7135,7 +7135,7 @@ var TilingPattern = function TilingPatternClosure() {
|
|||
this.ctx.scale(1 / scale[0], 1 / scale[1]);
|
||||
},
|
||||
clipBbox: function clipBbox(graphics, bbox, x0, y0, x1, y1) {
|
||||
if (bbox && isArray(bbox) && bbox.length === 4) {
|
||||
if (isArray(bbox) && bbox.length === 4) {
|
||||
var bboxWidth = x1 - x0;
|
||||
var bboxHeight = y1 - y0;
|
||||
graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);
|
||||
|
@ -7186,8 +7186,8 @@ exports.TilingPattern = TilingPattern;
|
|||
|
||||
"use strict";
|
||||
|
||||
var pdfjsVersion = '1.7.359';
|
||||
var pdfjsBuild = 'd471e356';
|
||||
var pdfjsVersion = '1.7.367';
|
||||
var pdfjsBuild = 'f0c45f03';
|
||||
var pdfjsSharedUtil = __w_pdfjs_require__(0);
|
||||
var pdfjsDisplayGlobal = __w_pdfjs_require__(8);
|
||||
var pdfjsDisplayAPI = __w_pdfjs_require__(3);
|
||||
|
|
|
@ -19175,7 +19175,7 @@ var CFFParser = function CFFParserClosure() {
|
|||
return cffDict;
|
||||
},
|
||||
parseCharString: function CFFParser_parseCharString(state, data, localSubrIndex, globalSubrIndex) {
|
||||
if (state.callDepth > MAX_SUBR_NESTING) {
|
||||
if (!data || state.callDepth > MAX_SUBR_NESTING) {
|
||||
return false;
|
||||
}
|
||||
var stackSize = state.stackSize;
|
||||
|
@ -19241,7 +19241,7 @@ var CFFParser = function CFFParserClosure() {
|
|||
bias = 1131;
|
||||
}
|
||||
var subrNumber = stack[--stackSize] + bias;
|
||||
if (subrNumber < 0 || subrNumber >= subrsIndex.count) {
|
||||
if (subrNumber < 0 || subrNumber >= subrsIndex.count || isNaN(subrNumber)) {
|
||||
validationCommand = CharstringValidationData[value];
|
||||
warn('Out of bounds subrIndex for ' + validationCommand.id);
|
||||
return false;
|
||||
|
@ -49132,8 +49132,8 @@ exports.Type1Parser = Type1Parser;
|
|||
|
||||
"use strict";
|
||||
|
||||
var pdfjsVersion = '1.7.359';
|
||||
var pdfjsBuild = 'd471e356';
|
||||
var pdfjsVersion = '1.7.367';
|
||||
var pdfjsBuild = 'f0c45f03';
|
||||
var pdfjsCoreWorker = __w_pdfjs_require__(17);
|
||||
;
|
||||
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
|
||||
|
|
|
@ -72,13 +72,13 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||
<div id="mainContainer">
|
||||
<div class="findbar hidden doorHanger" id="findbar">
|
||||
<div id="findbarInputContainer">
|
||||
<input id="findInput" class="toolbarField" title="Find" placeholder="Find in document" tabindex="91" data-l10n-id="find_input">
|
||||
<input id="findInput" class="toolbarField" title="Find" placeholder="Find in document…" tabindex="91" data-l10n-id="find_input">
|
||||
<div class="splitToolbarButton">
|
||||
<button class="toolbarButton findPrevious" title="" id="findPrevious" tabindex="92" data-l10n-id="find_previous">
|
||||
<button id="findPrevious" class="toolbarButton findPrevious" title="Find the previous occurrence of the phrase" tabindex="92" data-l10n-id="find_previous">
|
||||
<span data-l10n-id="find_previous_label">Previous</span>
|
||||
</button>
|
||||
<div class="splitToolbarButtonSeparator"></div>
|
||||
<button class="toolbarButton findNext" title="" id="findNext" tabindex="93" data-l10n-id="find_next">
|
||||
<button id="findNext" class="toolbarButton findNext" title="Find the next occurrence of the phrase" tabindex="93" data-l10n-id="find_next">
|
||||
<span data-l10n-id="find_next_label">Next</span>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -160,7 +160,7 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||
</button>
|
||||
<div class="toolbarButtonSpacer"></div>
|
||||
<button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="findbar">
|
||||
<span data-l10n-id="findbar_label">Find</span>
|
||||
<span data-l10n-id="findbar_label">Find</span>
|
||||
</button>
|
||||
<div class="splitToolbarButton hiddenSmallView">
|
||||
<button class="toolbarButton pageUp" title="Previous Page" id="previous" tabindex="13" data-l10n-id="previous">
|
||||
|
|
|
@ -504,10 +504,12 @@ exports.localized = localized;
|
|||
{
|
||||
var pdfjsLib;
|
||||
if (typeof __pdfjsdev_webpack__ === 'undefined') {
|
||||
if (typeof require === 'function') {
|
||||
if (typeof window !== 'undefined' && window['pdfjs-dist/build/pdf']) {
|
||||
pdfjsLib = window['pdfjs-dist/build/pdf'];
|
||||
} else if (typeof require === 'function') {
|
||||
pdfjsLib = require('../build/pdf.js');
|
||||
} else {
|
||||
pdfjsLib = window['pdfjs-dist/build/pdf'];
|
||||
throw new Error('Neither `require` nor `window` found');
|
||||
}
|
||||
}
|
||||
module.exports = pdfjsLib;
|
||||
|
|
|
@ -10560,7 +10560,8 @@ nsIDocument::ObsoleteSheet(const nsAString& aSheetURI, ErrorResult& rv)
|
|||
class UnblockParsingPromiseHandler final : public PromiseNativeHandler
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(UnblockParsingPromiseHandler)
|
||||
|
||||
explicit UnblockParsingPromiseHandler(nsIDocument* aDocument, Promise* aPromise)
|
||||
: mDocument(aDocument)
|
||||
|
@ -10612,19 +10613,25 @@ private:
|
|||
RefPtr<Promise> mPromise;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS0(UnblockParsingPromiseHandler)
|
||||
NS_IMPL_CYCLE_COLLECTION(UnblockParsingPromiseHandler, mDocument, mPromise)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(UnblockParsingPromiseHandler)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(UnblockParsingPromiseHandler)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(UnblockParsingPromiseHandler)
|
||||
|
||||
already_AddRefed<Promise>
|
||||
nsIDocument::BlockParsing(OwningNonNull<Promise> aPromise,
|
||||
ErrorResult& aRv)
|
||||
nsIDocument::BlockParsing(Promise& aPromise, ErrorResult& aRv)
|
||||
{
|
||||
RefPtr<Promise> resultPromise = Promise::Create(aPromise->GetParentObject(), aRv);
|
||||
RefPtr<Promise> resultPromise = Promise::Create(aPromise.GetParentObject(), aRv);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<PromiseNativeHandler> promiseHandler = new UnblockParsingPromiseHandler(this, resultPromise);
|
||||
aPromise->AppendNativeHandler(promiseHandler);
|
||||
aPromise.AppendNativeHandler(promiseHandler);
|
||||
|
||||
return resultPromise.forget();
|
||||
}
|
||||
|
|
|
@ -2787,7 +2787,7 @@ public:
|
|||
|
||||
void ObsoleteSheet(const nsAString& aSheetURI, mozilla::ErrorResult& rv);
|
||||
|
||||
already_AddRefed<mozilla::dom::Promise> BlockParsing(mozilla::OwningNonNull<mozilla::dom::Promise> aPromise,
|
||||
already_AddRefed<mozilla::dom::Promise> BlockParsing(mozilla::dom::Promise& aPromise,
|
||||
mozilla::ErrorResult& aRv);
|
||||
|
||||
already_AddRefed<nsIURI> GetMozDocumentURIIfNotForErrorPages();
|
||||
|
|
|
@ -114,15 +114,12 @@
|
|||
#include <limits>
|
||||
|
||||
#include "nsIColorPicker.h"
|
||||
#include "nsIDatePicker.h"
|
||||
#include "nsIStringEnumerator.h"
|
||||
#include "HTMLSplitOnSpacesTokenizer.h"
|
||||
#include "nsIController.h"
|
||||
#include "nsIMIMEInfo.h"
|
||||
#include "nsFrameSelection.h"
|
||||
|
||||
#include "nsIConsoleService.h"
|
||||
|
||||
// input type=date
|
||||
#include "js/Date.h"
|
||||
|
||||
|
@ -547,8 +544,8 @@ GetDOMFileOrDirectoryPath(const OwningFileOrDirectory& aData,
|
|||
bool
|
||||
HTMLInputElement::ValueAsDateEnabled(JSContext* cx, JSObject* obj)
|
||||
{
|
||||
return IsExperimentalFormsEnabled() || IsDatePickerEnabled() ||
|
||||
IsInputDateTimeEnabled();
|
||||
return IsExperimentalFormsEnabled() || IsInputDateTimeEnabled() ||
|
||||
IsInputDateTimeOthersEnabled();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -751,60 +748,6 @@ nsColorPickerShownCallback::Done(const nsAString& aColor)
|
|||
|
||||
NS_IMPL_ISUPPORTS(nsColorPickerShownCallback, nsIColorPickerShownCallback)
|
||||
|
||||
class DatePickerShownCallback final : public nsIDatePickerShownCallback
|
||||
{
|
||||
~DatePickerShownCallback() {}
|
||||
public:
|
||||
DatePickerShownCallback(HTMLInputElement* aInput,
|
||||
nsIDatePicker* aDatePicker)
|
||||
: mInput(aInput)
|
||||
, mDatePicker(aDatePicker)
|
||||
{}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Done(const nsAString& aDate) override;
|
||||
NS_IMETHOD Cancel() override;
|
||||
|
||||
private:
|
||||
RefPtr<HTMLInputElement> mInput;
|
||||
nsCOMPtr<nsIDatePicker> mDatePicker;
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
DatePickerShownCallback::Cancel()
|
||||
{
|
||||
mInput->PickerClosed();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DatePickerShownCallback::Done(const nsAString& aDate)
|
||||
{
|
||||
nsAutoString oldValue;
|
||||
|
||||
mInput->PickerClosed();
|
||||
mInput->GetValue(oldValue, CallerType::System);
|
||||
|
||||
if(!oldValue.Equals(aDate)){
|
||||
IgnoredErrorResult rv;
|
||||
mInput->SetValue(aDate, CallerType::System, rv);
|
||||
nsContentUtils::DispatchTrustedEvent(mInput->OwnerDoc(),
|
||||
static_cast<nsIDOMHTMLInputElement*>(mInput.get()),
|
||||
NS_LITERAL_STRING("input"), true,
|
||||
false);
|
||||
return nsContentUtils::DispatchTrustedEvent(mInput->OwnerDoc(),
|
||||
static_cast<nsIDOMHTMLInputElement*>(mInput.get()),
|
||||
NS_LITERAL_STRING("change"), true,
|
||||
false);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(DatePickerShownCallback, nsIDatePickerShownCallback)
|
||||
|
||||
|
||||
bool
|
||||
HTMLInputElement::IsPopupBlocked() const
|
||||
{
|
||||
|
@ -829,56 +772,6 @@ HTMLInputElement::IsPopupBlocked() const
|
|||
return permission == nsIPopupWindowManager::DENY_POPUP;
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLInputElement::InitDatePicker()
|
||||
{
|
||||
if (!IsDatePickerEnabled()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (mPickerRunning) {
|
||||
NS_WARNING("Just one nsIDatePicker is allowed");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = OwnerDoc();
|
||||
|
||||
nsCOMPtr<nsPIDOMWindowOuter> win = doc->GetWindow();
|
||||
if (!win) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (IsPopupBlocked()) {
|
||||
win->FirePopupBlockedEvent(doc, nullptr, EmptyString(), EmptyString());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Get Loc title
|
||||
nsXPIDLString title;
|
||||
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
|
||||
"DatePicker", title);
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDatePicker> datePicker = do_CreateInstance("@mozilla.org/datepicker;1", &rv);
|
||||
if (!datePicker) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsAutoString initialValue;
|
||||
GetNonFileValueInternal(initialValue);
|
||||
rv = datePicker->Init(win, title, initialValue);
|
||||
|
||||
nsCOMPtr<nsIDatePickerShownCallback> callback =
|
||||
new DatePickerShownCallback(this, datePicker);
|
||||
|
||||
rv = datePicker->Open(callback);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mPickerRunning = true;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
HTMLInputElement::InitColorPicker()
|
||||
{
|
||||
|
@ -2548,9 +2441,8 @@ HTMLInputElement::ApplyStep(int32_t aStep)
|
|||
bool
|
||||
HTMLInputElement::IsExperimentalMobileType(uint8_t aType)
|
||||
{
|
||||
return (aType == NS_FORM_INPUT_DATE &&
|
||||
!IsInputDateTimeEnabled() && !IsDatePickerEnabled()) ||
|
||||
(aType == NS_FORM_INPUT_TIME && !IsInputDateTimeEnabled());
|
||||
return (aType == NS_FORM_INPUT_DATE || aType == NS_FORM_INPUT_TIME) &&
|
||||
!IsInputDateTimeEnabled();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -4383,9 +4275,6 @@ HTMLInputElement::MaybeInitPickers(EventChainPostVisitor& aVisitor)
|
|||
if (mType == NS_FORM_INPUT_COLOR) {
|
||||
return InitColorPicker();
|
||||
}
|
||||
if (mType == NS_FORM_INPUT_DATE) {
|
||||
return InitDatePicker();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -5816,15 +5705,13 @@ HTMLInputElement::ParseTime(const nsAString& aValue, uint32_t* aResult)
|
|||
/* static */ bool
|
||||
HTMLInputElement::IsDateTimeTypeSupported(uint8_t aDateTimeInputType)
|
||||
{
|
||||
return (aDateTimeInputType == NS_FORM_INPUT_DATE &&
|
||||
(IsInputDateTimeEnabled() || IsExperimentalFormsEnabled() ||
|
||||
IsDatePickerEnabled())) ||
|
||||
(aDateTimeInputType == NS_FORM_INPUT_TIME &&
|
||||
return ((aDateTimeInputType == NS_FORM_INPUT_DATE ||
|
||||
aDateTimeInputType == NS_FORM_INPUT_TIME) &&
|
||||
(IsInputDateTimeEnabled() || IsExperimentalFormsEnabled())) ||
|
||||
((aDateTimeInputType == NS_FORM_INPUT_MONTH ||
|
||||
aDateTimeInputType == NS_FORM_INPUT_WEEK ||
|
||||
aDateTimeInputType == NS_FORM_INPUT_DATETIME_LOCAL) &&
|
||||
IsInputDateTimeEnabled());
|
||||
IsInputDateTimeOthersEnabled());
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
|
@ -5871,20 +5758,6 @@ HTMLInputElement::IsDirPickerEnabled()
|
|||
return sDirPickerEnabled;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
HTMLInputElement::IsDatePickerEnabled()
|
||||
{
|
||||
static bool sDatePickerEnabled = false;
|
||||
static bool sDatePickerPrefCached = false;
|
||||
if (!sDatePickerPrefCached) {
|
||||
sDatePickerPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sDatePickerEnabled, "dom.forms.datepicker",
|
||||
false);
|
||||
}
|
||||
|
||||
return sDatePickerEnabled;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
HTMLInputElement::IsExperimentalFormsEnabled()
|
||||
{
|
||||
|
@ -5914,6 +5787,20 @@ HTMLInputElement::IsInputDateTimeEnabled()
|
|||
return sDateTimeEnabled;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
HTMLInputElement::IsInputDateTimeOthersEnabled()
|
||||
{
|
||||
static bool sDateTimeOthersEnabled = false;
|
||||
static bool sDateTimeOthersPrefCached = false;
|
||||
if (!sDateTimeOthersPrefCached) {
|
||||
sDateTimeOthersPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sDateTimeOthersEnabled,
|
||||
"dom.forms.datetime.others", false);
|
||||
}
|
||||
|
||||
return sDateTimeOthersEnabled;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
HTMLInputElement::IsInputNumberEnabled()
|
||||
{
|
||||
|
@ -5963,12 +5850,9 @@ HTMLInputElement::ParseAttribute(int32_t aNamespaceID,
|
|||
if (aAttribute == nsGkAtoms::type) {
|
||||
aResult.ParseEnumValue(aValue, kInputTypeTable, false, kInputDefaultType);
|
||||
int32_t newType = aResult.GetEnumValue();
|
||||
if ((IsExperimentalMobileType(newType) &&
|
||||
!IsExperimentalFormsEnabled()) ||
|
||||
(newType == NS_FORM_INPUT_NUMBER && !IsInputNumberEnabled()) ||
|
||||
if ((newType == NS_FORM_INPUT_NUMBER && !IsInputNumberEnabled()) ||
|
||||
(newType == NS_FORM_INPUT_COLOR && !IsInputColorEnabled()) ||
|
||||
(IsDateTimeInputType(newType) &&
|
||||
!IsDateTimeTypeSupported(newType))) {
|
||||
(IsDateTimeInputType(newType) && !IsDateTimeTypeSupported(newType))) {
|
||||
// There's no public way to set an nsAttrValue to an enum value, but we
|
||||
// can just re-parse with a table that doesn't have any types other than
|
||||
// "text" in it.
|
||||
|
|
|
@ -1460,7 +1460,6 @@ protected:
|
|||
};
|
||||
nsresult InitFilePicker(FilePickerType aType);
|
||||
nsresult InitColorPicker();
|
||||
nsresult InitDatePicker();
|
||||
|
||||
/**
|
||||
* Use this function before trying to open a picker.
|
||||
|
@ -1668,7 +1667,7 @@ private:
|
|||
|
||||
/**
|
||||
* Checks if aDateTimeInputType should be supported based on "dom.forms.datetime",
|
||||
* "dom.forms.datepicker" and "dom.experimental_forms".
|
||||
* and "dom.experimental_forms".
|
||||
*/
|
||||
static bool
|
||||
IsDateTimeTypeSupported(uint8_t aDateTimeInputType);
|
||||
|
@ -1694,13 +1693,6 @@ private:
|
|||
static bool
|
||||
IsDirPickerEnabled();
|
||||
|
||||
/**
|
||||
* Checks preference "dom.forms.datepicker" to determine if date picker should
|
||||
* be supported.
|
||||
*/
|
||||
static bool
|
||||
IsDatePickerEnabled();
|
||||
|
||||
/**
|
||||
* Checks preference "dom.experimental_forms" to determine if experimental
|
||||
* implementation of input element should be enabled.
|
||||
|
@ -1709,12 +1701,19 @@ private:
|
|||
IsExperimentalFormsEnabled();
|
||||
|
||||
/**
|
||||
* Checks preference "dom.forms.datetime" to determine if input date/time
|
||||
* related types should be supported.
|
||||
* Checks preference "dom.forms.datetime" to determine if input date and time
|
||||
* should be supported.
|
||||
*/
|
||||
static bool
|
||||
IsInputDateTimeEnabled();
|
||||
|
||||
/**
|
||||
* Checks preference "dom.forms.datetime.others" to determine if input week,
|
||||
* month and datetime-local should be supported.
|
||||
*/
|
||||
static bool
|
||||
IsInputDateTimeOthersEnabled();
|
||||
|
||||
/**
|
||||
* Checks preference "dom.forms.number" to determine if input type=number
|
||||
* should be supported.
|
||||
|
|
|
@ -37,47 +37,63 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=764481
|
|||
inputType: "color",
|
||||
expectedType: "color"
|
||||
}, {
|
||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datepicker", false],
|
||||
["dom.forms.datetime", false]],
|
||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datetime", false]],
|
||||
inputType: "date",
|
||||
expectedType: "text"
|
||||
}, {
|
||||
prefs: [["dom.experimental_forms", true], ["dom.forms.datepicker", false],
|
||||
["dom.forms.datetime", false]],
|
||||
prefs: [["dom.experimental_forms", true], ["dom.forms.datetime", false]],
|
||||
inputType: "date",
|
||||
expectedType: "date"
|
||||
}, {
|
||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datepicker", true],
|
||||
["dom.forms.datetime", false]],
|
||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datetime", true]],
|
||||
inputType: "date",
|
||||
expectedType: "date"
|
||||
}, {
|
||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datepicker", false],
|
||||
["dom.forms.datetime", true]],
|
||||
inputType: "date",
|
||||
expectedType: "date"
|
||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datetime", false]],
|
||||
inputType: "time",
|
||||
expectedType: "text"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", false]],
|
||||
prefs: [["dom.experimental_forms", true], ["dom.forms.datetime", false]],
|
||||
inputType: "time",
|
||||
expectedType: "time"
|
||||
}, {
|
||||
prefs: [["dom.experimental_forms", false], ["dom.forms.datetime", true]],
|
||||
inputType: "time",
|
||||
expectedType: "time"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", false]],
|
||||
inputType: "month",
|
||||
expectedType: "text"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", true]],
|
||||
prefs: [["dom.forms.datetime", true], ["dom.forms.datetime.others", false]],
|
||||
inputType: "month",
|
||||
expectedType: "text"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", true]],
|
||||
inputType: "month",
|
||||
expectedType: "month"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", false]],
|
||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", false]],
|
||||
inputType: "week",
|
||||
expectedType: "text"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", true]],
|
||||
prefs: [["dom.forms.datetime", true], ["dom.forms.datetime.others", false]],
|
||||
inputType: "week",
|
||||
expectedType: "text"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", true]],
|
||||
inputType: "week",
|
||||
expectedType: "week"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", false]],
|
||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", false]],
|
||||
inputType: "datetime-local",
|
||||
expectedType: "text"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", true]],
|
||||
prefs: [["dom.forms.datetime", true], ["dom.forms.datetime.others", false]],
|
||||
inputType: "datetime-local",
|
||||
expectedType: "text"
|
||||
}, {
|
||||
prefs: [["dom.forms.datetime", false], ["dom.forms.datetime.others", true]],
|
||||
inputType: "datetime-local",
|
||||
expectedType: "datetime-local"
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=874640
|
|||
|
||||
/** Test for Bug 874640 **/
|
||||
var states = [
|
||||
// dom.experimental_forms, dom.forms.datepicker, dom.forms.datetime, expectedValueAsDate
|
||||
[ 'true', 'true', 'true', 'true' ],
|
||||
// dom.experimental_forms, dom.forms.datetime, dom.forms.datetime.others, expectedValueAsDate
|
||||
[ 'true', 'true', ,'true', 'true' ],
|
||||
[ 'true', 'false', 'false', 'true' ],
|
||||
[ 'false', 'true', 'false', 'true' ],
|
||||
[ 'false', 'false', 'true', 'true' ],
|
||||
|
@ -33,8 +33,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=874640
|
|||
|
||||
SpecialPowers.pushPrefEnv({"set":[
|
||||
["dom.experimental_forms", state[0] === 'true'],
|
||||
["dom.forms.datepicker", state[1] === 'true'],
|
||||
["dom.forms.datetime", state[2] === 'true']]},
|
||||
["dom.forms.datetime", state[1] === 'true'],
|
||||
["dom.forms.datetime.others", state[2] === 'true']]},
|
||||
function() {
|
||||
iframe.src = 'data:text/html,<script>' +
|
||||
'parent.is("valueAsDate" in document.createElement("input"), ' +
|
||||
|
|
|
@ -1,87 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "DatePickerParent.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
|
||||
using mozilla::Unused;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
NS_IMPL_ISUPPORTS(DatePickerParent::DatePickerShownCallback,
|
||||
nsIDatePickerShownCallback);
|
||||
|
||||
NS_IMETHODIMP
|
||||
DatePickerParent::DatePickerShownCallback::Cancel()
|
||||
{
|
||||
if (mDatePickerParent) {
|
||||
Unused << mDatePickerParent->SendCancel();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DatePickerParent::DatePickerShownCallback::Done(const nsAString& aDate)
|
||||
{
|
||||
if (mDatePickerParent) {
|
||||
Unused << mDatePickerParent->Send__delete__(mDatePickerParent,
|
||||
nsString(aDate));
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
DatePickerParent::DatePickerShownCallback::Destroy()
|
||||
{
|
||||
mDatePickerParent = nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
DatePickerParent::CreateDatePicker()
|
||||
{
|
||||
mPicker = do_CreateInstance("@mozilla.org/datepicker;1");
|
||||
if (!mPicker) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Element* ownerElement = TabParent::GetFrom(Manager())->GetOwnerElement();
|
||||
if (!ownerElement) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<mozIDOMWindowProxy> window = do_QueryInterface(ownerElement->OwnerDoc()->GetWindow());
|
||||
if (!window) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return NS_SUCCEEDED(mPicker->Init(window, mTitle, mInitialDate));
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
DatePickerParent::RecvOpen()
|
||||
{
|
||||
if (!CreateDatePicker()) {
|
||||
Unused << Send__delete__(this, mInitialDate);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mCallback = new DatePickerShownCallback(this);
|
||||
|
||||
mPicker->Open(mCallback);
|
||||
return IPC_OK();
|
||||
};
|
||||
|
||||
void
|
||||
DatePickerParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
if (mCallback) {
|
||||
mCallback->Destroy();
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_dom_DatePickerParent_h
|
||||
#define mozilla_dom_DatePickerParent_h
|
||||
|
||||
#include "mozilla/dom/PDatePickerParent.h"
|
||||
#include "nsIDatePicker.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class DatePickerParent : public PDatePickerParent
|
||||
{
|
||||
public:
|
||||
DatePickerParent(const nsString& aTitle,
|
||||
const nsString& aInitialDate)
|
||||
: mTitle(aTitle)
|
||||
, mInitialDate(aInitialDate)
|
||||
{}
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvOpen() override;
|
||||
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
|
||||
class DatePickerShownCallback final
|
||||
: public nsIDatePickerShownCallback
|
||||
{
|
||||
public:
|
||||
explicit DatePickerShownCallback(DatePickerParent* aDatePickerParnet)
|
||||
: mDatePickerParent(aDatePickerParnet)
|
||||
{}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDATEPICKERSHOWNCALLBACK
|
||||
|
||||
void Destroy();
|
||||
|
||||
private:
|
||||
~DatePickerShownCallback() {}
|
||||
DatePickerParent* mDatePickerParent;
|
||||
};
|
||||
|
||||
private:
|
||||
virtual ~DatePickerParent() {}
|
||||
|
||||
bool CreateDatePicker();
|
||||
|
||||
RefPtr<DatePickerShownCallback> mCallback;
|
||||
nsCOMPtr<nsIDatePicker> mPicker;
|
||||
|
||||
nsString mTitle;
|
||||
nsString mInitialDate;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_DatePickerParent_h
|
|
@ -9,7 +9,6 @@ include protocol PBlob;
|
|||
include protocol PColorPicker;
|
||||
include protocol PContent;
|
||||
include protocol PContentBridge;
|
||||
include protocol PDatePicker;
|
||||
include protocol PDocAccessible;
|
||||
include protocol PDocumentRenderer;
|
||||
include protocol PFilePicker;
|
||||
|
@ -117,7 +116,6 @@ nested(upto inside_cpow) sync protocol PBrowser
|
|||
manager PContent or PContentBridge;
|
||||
|
||||
manages PColorPicker;
|
||||
manages PDatePicker;
|
||||
manages PDocAccessible;
|
||||
manages PDocumentRenderer;
|
||||
manages PFilePicker;
|
||||
|
@ -443,12 +441,6 @@ parent:
|
|||
*/
|
||||
async PColorPicker(nsString title, nsString initialColor);
|
||||
|
||||
/**
|
||||
* Create an asynchronous date picker on the parent side,
|
||||
* but don't open it yet.
|
||||
*/
|
||||
async PDatePicker(nsString title, nsString initialDate);
|
||||
|
||||
async PFilePicker(nsString aTitle, int16_t aMode);
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
|
||||
/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
|
||||
|
||||
/* 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 protocol PBrowser;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
protocol PDatePicker
|
||||
{
|
||||
manager PBrowser;
|
||||
|
||||
parent:
|
||||
async Open();
|
||||
|
||||
child:
|
||||
async Cancel();
|
||||
|
||||
async __delete__(nsString color);
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
|
@ -104,7 +104,6 @@
|
|||
#include "LayersLogging.h"
|
||||
#include "nsDOMClassInfoID.h"
|
||||
#include "nsColorPickerProxy.h"
|
||||
#include "nsDatePickerProxy.h"
|
||||
#include "nsContentPermissionHelper.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIPermissionManager.h"
|
||||
|
@ -2136,21 +2135,6 @@ TabChild::DeallocPColorPickerChild(PColorPickerChild* aColorPicker)
|
|||
return true;
|
||||
}
|
||||
|
||||
PDatePickerChild*
|
||||
TabChild::AllocPDatePickerChild(const nsString&, const nsString&)
|
||||
{
|
||||
MOZ_CRASH("unused");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::DeallocPDatePickerChild(PDatePickerChild* aDatePicker)
|
||||
{
|
||||
nsDatePickerProxy* picker = static_cast<nsDatePickerProxy*>(aDatePicker);
|
||||
NS_RELEASE(picker);
|
||||
return true;
|
||||
}
|
||||
|
||||
PFilePickerChild*
|
||||
TabChild::AllocPFilePickerChild(const nsString&, const int16_t&)
|
||||
{
|
||||
|
|
|
@ -472,10 +472,6 @@ public:
|
|||
|
||||
virtual bool DeallocPColorPickerChild(PColorPickerChild* aActor) override;
|
||||
|
||||
virtual PDatePickerChild*
|
||||
AllocPDatePickerChild(const nsString& title, const nsString& initialDate) override;
|
||||
virtual bool DeallocPDatePickerChild(PDatePickerChild* actor) override;
|
||||
|
||||
virtual PFilePickerChild*
|
||||
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
|
||||
|
||||
|
|
|
@ -79,7 +79,6 @@
|
|||
#include "PermissionMessageUtils.h"
|
||||
#include "StructuredCloneData.h"
|
||||
#include "ColorPickerParent.h"
|
||||
#include "DatePickerParent.h"
|
||||
#include "FilePickerParent.h"
|
||||
#include "TabChild.h"
|
||||
#include "LoadContext.h"
|
||||
|
@ -2470,20 +2469,6 @@ TabParent::DeallocPColorPickerParent(PColorPickerParent* actor)
|
|||
return true;
|
||||
}
|
||||
|
||||
PDatePickerParent*
|
||||
TabParent::AllocPDatePickerParent(const nsString& aTitle,
|
||||
const nsString& aInitialDate)
|
||||
{
|
||||
return new DatePickerParent(aTitle, aInitialDate);
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::DeallocPDatePickerParent(PDatePickerParent* actor)
|
||||
{
|
||||
delete actor;
|
||||
return true;
|
||||
}
|
||||
|
||||
PRenderFrameParent*
|
||||
TabParent::AllocPRenderFrameParent()
|
||||
{
|
||||
|
|
|
@ -346,10 +346,6 @@ public:
|
|||
virtual bool
|
||||
DeallocPColorPickerParent(PColorPickerParent* aColorPicker) override;
|
||||
|
||||
virtual PDatePickerParent*
|
||||
AllocPDatePickerParent(const nsString& aTitle, const nsString& aInitialDate) override;
|
||||
virtual bool DeallocPDatePickerParent(PDatePickerParent* aDatePicker) override;
|
||||
|
||||
virtual PDocAccessibleParent*
|
||||
AllocPDocAccessibleParent(PDocAccessibleParent*, const uint64_t&,
|
||||
const uint32_t&, const IAccessibleHolder&) override;
|
||||
|
|
|
@ -58,7 +58,6 @@ UNIFIED_SOURCES += [
|
|||
'ContentPrefs.cpp',
|
||||
'ContentProcess.cpp',
|
||||
'ContentProcessManager.cpp',
|
||||
'DatePickerParent.cpp',
|
||||
'FilePickerParent.cpp',
|
||||
'MemoryReportRequest.cpp',
|
||||
'nsIContentChild.cpp',
|
||||
|
@ -94,7 +93,6 @@ IPDL_SOURCES += [
|
|||
'PContentPermission.ipdlh',
|
||||
'PContentPermissionRequest.ipdl',
|
||||
'PCycleCollectWithLogs.ipdl',
|
||||
'PDatePicker.ipdl',
|
||||
'PDocumentRenderer.ipdl',
|
||||
'PFilePicker.ipdl',
|
||||
'PPluginWidget.ipdl',
|
||||
|
|
|
@ -34,7 +34,6 @@ NoDirSelected=No directory selected.
|
|||
# %S will be a number greater or equal to 2.
|
||||
XFilesSelected=%S files selected.
|
||||
ColorPicker=Choose a color
|
||||
DatePicker=Choose a date
|
||||
# LOCALIZATION NOTE (AndNMoreFiles): Semi-colon list of plural forms.
|
||||
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
|
||||
# This string is shown at the end of the tooltip text for <input type='file'
|
||||
|
|
|
@ -900,51 +900,52 @@ D3D11DXVA2Manager::CopyToImage(IMFSample* aVideoSample,
|
|||
|
||||
texture->QueryInterface((IDXGIKeyedMutex**)getter_AddRefs(mutex));
|
||||
|
||||
if (mutex) {
|
||||
hr = mutex->AcquireSync(0, 2000);
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
} else if (mDevice != DeviceManagerDx::Get()->GetCompositorDevice()) {
|
||||
NS_ENSURE_TRUE(mSyncObject, E_FAIL);
|
||||
{
|
||||
AutoTextureLock(mutex, hr, 2000);
|
||||
if (mutex && (FAILED(hr) || hr == WAIT_TIMEOUT || hr == WAIT_ABANDONED)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (!mutex && mDevice != DeviceManagerDx::Get()->GetCompositorDevice()) {
|
||||
NS_ENSURE_TRUE(mSyncObject, E_FAIL);
|
||||
}
|
||||
|
||||
if (client && client->GetFormat() == SurfaceFormat::NV12) {
|
||||
// Our video frame is stored in a non-sharable ID3D11Texture2D. We need
|
||||
// to create a copy of that frame as a sharable resource, save its share
|
||||
// handle, and put that handle into the rendering pipeline.
|
||||
|
||||
RefPtr<IMFMediaBuffer> buffer;
|
||||
hr = aVideoSample->GetBufferByIndex(0, getter_AddRefs(buffer));
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
RefPtr<IMFDXGIBuffer> dxgiBuf;
|
||||
hr = buffer->QueryInterface((IMFDXGIBuffer**)getter_AddRefs(dxgiBuf));
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
RefPtr<ID3D11Texture2D> tex;
|
||||
hr = dxgiBuf->GetResource(__uuidof(ID3D11Texture2D), getter_AddRefs(tex));
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
UINT index;
|
||||
dxgiBuf->GetSubresourceIndex(&index);
|
||||
mContext->CopySubresourceRegion(texture, 0, 0, 0, 0, tex, index, nullptr);
|
||||
} else {
|
||||
// Our video sample is in NV12 format but our output texture is in BGRA.
|
||||
// Use MFT to do color conversion.
|
||||
hr = mTransform->Input(aVideoSample);
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
RefPtr<IMFSample> sample;
|
||||
hr = CreateOutputSample(sample, texture);
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
hr = mTransform->Output(&sample);
|
||||
}
|
||||
}
|
||||
|
||||
if (client && client->GetFormat() == SurfaceFormat::NV12) {
|
||||
// Our video frame is stored in a non-sharable ID3D11Texture2D. We need
|
||||
// to create a copy of that frame as a sharable resource, save its share
|
||||
// handle, and put that handle into the rendering pipeline.
|
||||
|
||||
RefPtr<IMFMediaBuffer> buffer;
|
||||
hr = aVideoSample->GetBufferByIndex(0, getter_AddRefs(buffer));
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
RefPtr<IMFDXGIBuffer> dxgiBuf;
|
||||
hr = buffer->QueryInterface((IMFDXGIBuffer**)getter_AddRefs(dxgiBuf));
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
RefPtr<ID3D11Texture2D> tex;
|
||||
hr = dxgiBuf->GetResource(__uuidof(ID3D11Texture2D), getter_AddRefs(tex));
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
UINT index;
|
||||
dxgiBuf->GetSubresourceIndex(&index);
|
||||
mContext->CopySubresourceRegion(texture, 0, 0, 0, 0, tex, index, nullptr);
|
||||
} else {
|
||||
// Our video sample is in NV12 format but our output texture is in BGRA.
|
||||
// Use MFT to do color conversion.
|
||||
hr = mTransform->Input(aVideoSample);
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
RefPtr<IMFSample> sample;
|
||||
hr = CreateOutputSample(sample, texture);
|
||||
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
|
||||
|
||||
hr = mTransform->Output(&sample);
|
||||
}
|
||||
|
||||
if (!mutex && mDevice != DeviceManagerDx::Get()->GetCompositorDevice()) {
|
||||
client->SyncWithObject(mSyncObject);
|
||||
mSyncObject->FinalizeFrame();
|
||||
} else if (mutex) {
|
||||
mutex->ReleaseSync(0);
|
||||
}
|
||||
|
||||
image.forget(aOutImage);
|
||||
|
|
|
@ -5,14 +5,15 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Represents a pre-compiled JS script, which can be repeatedly exeuted in
|
||||
* Represents a pre-compiled JS script, which can be repeatedly executed in
|
||||
* different globals without being re-parsed.
|
||||
*/
|
||||
[ChromeOnly, Exposed=(Window,System)]
|
||||
interface PrecompiledScript {
|
||||
/**
|
||||
* Executes the script in the global of the given object, and returns the
|
||||
* value of its last expression, if compiled with a return value.
|
||||
* Executes the script in the context of, and with the security principal
|
||||
* of, the given object's global. If compiled with a return value, returns
|
||||
* the value of the script's last expression. Otherwise returns undefined.
|
||||
*/
|
||||
[Throws]
|
||||
any executeInGlobal(object global);
|
||||
|
|
|
@ -2052,12 +2052,14 @@ RuntimeService::Init()
|
|||
NS_FAILED(Preferences::RegisterCallbackAndCall( \
|
||||
WorkerPrefChanged, \
|
||||
name, \
|
||||
reinterpret_cast<void*>(WORKERPREF_##NAME))) ||
|
||||
reinterpret_cast<void*>(WORKERPREF_##NAME), \
|
||||
Preferences::ExactMatch)) ||
|
||||
#define WORKER_PREF(name, callback) \
|
||||
NS_FAILED(Preferences::RegisterCallbackAndCall( \
|
||||
callback, \
|
||||
name, \
|
||||
nullptr)) ||
|
||||
nullptr, \
|
||||
Preferences::ExactMatch)) ||
|
||||
#include "WorkerPrefs.h"
|
||||
#undef WORKER_SIMPLE_PREF
|
||||
#undef WORKER_PREF
|
||||
|
|
|
@ -37,10 +37,9 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
|||
EXPORTS.cairo += [
|
||||
'cairo-win32.h',
|
||||
]
|
||||
if CONFIG['MOZ_ENABLE_DWRITE_FONT']:
|
||||
SOURCES += [
|
||||
'cairo-dwrite-font.cpp',
|
||||
]
|
||||
SOURCES += [
|
||||
'cairo-dwrite-font.cpp',
|
||||
]
|
||||
if CONFIG['MOZ_ENABLE_D2D_SURFACE']:
|
||||
SOURCES += [
|
||||
'cairo-d2d-surface.cpp',
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include <sys/mman.h>
|
||||
|
@ -89,6 +91,7 @@ static const char* const sExtensionNames[] = {
|
|||
"GL_ARB_ES2_compatibility",
|
||||
"GL_ARB_ES3_compatibility",
|
||||
"GL_ARB_color_buffer_float",
|
||||
"GL_ARB_compatibility",
|
||||
"GL_ARB_copy_buffer",
|
||||
"GL_ARB_depth_texture",
|
||||
"GL_ARB_draw_buffers",
|
||||
|
@ -195,220 +198,18 @@ static const char* const sExtensionNames[] = {
|
|||
};
|
||||
|
||||
static bool
|
||||
ParseGLSLVersion(GLContext* gl, uint32_t* out_version)
|
||||
ParseVersion(const std::string& versionStr, uint32_t* const out_major,
|
||||
uint32_t* const out_minor)
|
||||
{
|
||||
if (gl->fGetError() != LOCAL_GL_NO_ERROR) {
|
||||
MOZ_ASSERT(false, "An OpenGL error has been triggered before.");
|
||||
static const std::regex kVersionRegex("([0-9]+)\\.([0-9]+)");
|
||||
std::smatch match;
|
||||
if (!std::regex_search(versionStr, match, kVersionRegex))
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* OpenGL 2.x, 3.x, 4.x specifications:
|
||||
* The VERSION and SHADING_LANGUAGE_VERSION strings are laid out as follows:
|
||||
*
|
||||
* <version number><space><vendor-specific information>
|
||||
*
|
||||
* The version number is either of the form major_number.minor_number or
|
||||
* major_number.minor_number.release_number, where the numbers all have
|
||||
* one or more digits.
|
||||
*
|
||||
* SHADING_LANGUAGE_VERSION is *almost* identical to VERSION. The
|
||||
* difference is that the minor version always has two digits and the
|
||||
* prefix has an additional 'GLSL ES'
|
||||
*
|
||||
*
|
||||
* OpenGL ES 2.0, 3.0 specifications:
|
||||
* The VERSION string is laid out as follows:
|
||||
*
|
||||
* "OpenGL ES N.M vendor-specific information"
|
||||
*
|
||||
* The version number is either of the form major_number.minor_number or
|
||||
* major_number.minor_number.release_number, where the numbers all have
|
||||
* one or more digits.
|
||||
*
|
||||
*
|
||||
* Note:
|
||||
* We don't care about release_number.
|
||||
*/
|
||||
const char* versionString = (const char*) gl->fGetString(LOCAL_GL_SHADING_LANGUAGE_VERSION);
|
||||
|
||||
if (gl->fGetError() != LOCAL_GL_NO_ERROR) {
|
||||
MOZ_ASSERT(false, "glGetString(GL_SHADING_LANGUAGE_VERSION) has generated an error");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!versionString) {
|
||||
// This happens on the Android emulators. We'll just return 100
|
||||
*out_version = 100;
|
||||
return true;
|
||||
}
|
||||
|
||||
const auto fnSkipPrefix = [&versionString](const char* prefix) {
|
||||
const auto len = strlen(prefix);
|
||||
if (strncmp(versionString, prefix, len) == 0)
|
||||
versionString += len;
|
||||
};
|
||||
|
||||
const char kGLESVersionPrefix[] = "OpenGL ES GLSL ES";
|
||||
fnSkipPrefix(kGLESVersionPrefix);
|
||||
|
||||
if (gl->WorkAroundDriverBugs()) {
|
||||
// Nexus 7 2013 (bug 1234441)
|
||||
const char kBadGLESVersionPrefix[] = "OpenGL ES GLSL";
|
||||
fnSkipPrefix(kBadGLESVersionPrefix);
|
||||
}
|
||||
|
||||
const char* itr = versionString;
|
||||
char* end = nullptr;
|
||||
auto majorVersion = strtol(itr, &end, 10);
|
||||
|
||||
if (!end) {
|
||||
MOZ_ASSERT(false, "Failed to parse the GL major version number.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (*end != '.') {
|
||||
MOZ_ASSERT(false, "Failed to parse GL's major-minor version number separator.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// we skip the '.' between the major and the minor version
|
||||
itr = end + 1;
|
||||
end = nullptr;
|
||||
|
||||
auto minorVersion = strtol(itr, &end, 10);
|
||||
if (!end) {
|
||||
MOZ_ASSERT(false, "Failed to parse GL's minor version number.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (majorVersion <= 0 || majorVersion >= 100) {
|
||||
MOZ_ASSERT(false, "Invalid major version.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (minorVersion < 0 || minorVersion >= 100) {
|
||||
MOZ_ASSERT(false, "Invalid minor version.");
|
||||
return false;
|
||||
}
|
||||
|
||||
*out_version = (uint32_t) majorVersion * 100 + (uint32_t) minorVersion;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
ParseGLVersion(GLContext* gl, uint32_t* out_version)
|
||||
{
|
||||
if (gl->fGetError() != LOCAL_GL_NO_ERROR) {
|
||||
MOZ_ASSERT(false, "An OpenGL error has been triggered before.");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* B2G emulator bug work around: The emulator implements OpenGL ES 2.0 on
|
||||
* OpenGL 3.2. The bug is that GetIntegerv(LOCAL_GL_{MAJOR,MINOR}_VERSION)
|
||||
* returns OpenGL 3.2 instead of generating an error.
|
||||
*/
|
||||
if (!gl->IsGLES()) {
|
||||
/**
|
||||
* OpenGL 3.1 and OpenGL ES 3.0 both introduce GL_{MAJOR,MINOR}_VERSION
|
||||
* with GetIntegerv. So we first try those constants even though we
|
||||
* might not have an OpenGL context supporting them, as this is a
|
||||
* better way than parsing GL_VERSION.
|
||||
*/
|
||||
GLint majorVersion = 0;
|
||||
GLint minorVersion = 0;
|
||||
|
||||
const bool ok = (gl->GetPotentialInteger(LOCAL_GL_MAJOR_VERSION,
|
||||
&majorVersion) &&
|
||||
gl->GetPotentialInteger(LOCAL_GL_MINOR_VERSION,
|
||||
&minorVersion));
|
||||
|
||||
// If it's not an OpenGL (ES) 3.0 context, we will have an error
|
||||
if (ok &&
|
||||
majorVersion > 0 &&
|
||||
minorVersion >= 0)
|
||||
{
|
||||
*out_version = majorVersion * 100 + minorVersion * 10;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We were not able to use GL_{MAJOR,MINOR}_VERSION, so we parse
|
||||
* GL_VERSION.
|
||||
*
|
||||
*
|
||||
* OpenGL 2.x, 3.x, 4.x specifications:
|
||||
* The VERSION and SHADING_LANGUAGE_VERSION strings are laid out as follows:
|
||||
*
|
||||
* <version number><space><vendor-specific information>
|
||||
*
|
||||
* The version number is either of the form major_number.minor_number or
|
||||
* major_number.minor_number.release_number, where the numbers all have
|
||||
* one or more digits.
|
||||
*
|
||||
*
|
||||
* OpenGL ES 2.0, 3.0 specifications:
|
||||
* The VERSION string is laid out as follows:
|
||||
*
|
||||
* "OpenGL ES N.M vendor-specific information"
|
||||
*
|
||||
* The version number is either of the form major_number.minor_number or
|
||||
* major_number.minor_number.release_number, where the numbers all have
|
||||
* one or more digits.
|
||||
*
|
||||
*
|
||||
* Note:
|
||||
* We don't care about release_number.
|
||||
*/
|
||||
const char* versionString = (const char*)gl->fGetString(LOCAL_GL_VERSION);
|
||||
|
||||
if (gl->fGetError() != LOCAL_GL_NO_ERROR) {
|
||||
MOZ_ASSERT(false, "glGetString(GL_VERSION) has generated an error");
|
||||
return false;
|
||||
} else if (!versionString) {
|
||||
MOZ_ASSERT(false, "glGetString(GL_VERSION) has returned 0");
|
||||
return false;
|
||||
}
|
||||
|
||||
const char kGLESVersionPrefix[] = "OpenGL ES ";
|
||||
if (strncmp(versionString, kGLESVersionPrefix, strlen(kGLESVersionPrefix)) == 0) {
|
||||
versionString += strlen(kGLESVersionPrefix);
|
||||
}
|
||||
|
||||
const char* itr = versionString;
|
||||
char* end = nullptr;
|
||||
auto majorVersion = strtol(itr, &end, 10);
|
||||
|
||||
if (!end) {
|
||||
MOZ_ASSERT(false, "Failed to parse the GL major version number.");
|
||||
return false;
|
||||
} else if (*end != '.') {
|
||||
MOZ_ASSERT(false, "Failed to parse GL's major-minor version number separator.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// we skip the '.' between the major and the minor version
|
||||
itr = end + 1;
|
||||
|
||||
end = nullptr;
|
||||
|
||||
auto minorVersion = strtol(itr, &end, 10);
|
||||
if (!end) {
|
||||
MOZ_ASSERT(false, "Failed to parse GL's minor version number.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (majorVersion <= 0 || majorVersion >= 100) {
|
||||
MOZ_ASSERT(false, "Invalid major version.");
|
||||
return false;
|
||||
} else if (minorVersion < 0 || minorVersion >= 10) {
|
||||
MOZ_ASSERT(false, "Invalid minor version.");
|
||||
return false;
|
||||
}
|
||||
|
||||
*out_version = (uint32_t)majorVersion * 100 + (uint32_t)minorVersion * 10;
|
||||
const auto& majorStr = match.str(1);
|
||||
const auto& minorStr = match.str(2);
|
||||
*out_major = atoi(majorStr.c_str());
|
||||
*out_minor = atoi(minorStr.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -721,32 +522,52 @@ GLContext::InitWithPrefixImpl(const char* prefix, bool trygl)
|
|||
////////////////
|
||||
|
||||
MakeCurrent();
|
||||
MOZ_ASSERT(mProfile != ContextProfile::Unknown);
|
||||
|
||||
uint32_t version = 0;
|
||||
ParseGLVersion(this, &version);
|
||||
const std::string versionStr = (const char*)fGetString(LOCAL_GL_VERSION);
|
||||
if (versionStr.find("OpenGL ES") == 0) {
|
||||
mProfile = ContextProfile::OpenGLES;
|
||||
}
|
||||
|
||||
mShadingLanguageVersion = 100;
|
||||
ParseGLSLVersion(this, &mShadingLanguageVersion);
|
||||
uint32_t majorVer, minorVer;
|
||||
if (!ParseVersion(versionStr, &majorVer, &minorVer)) {
|
||||
MOZ_ASSERT(false, "Failed to parse GL_VERSION");
|
||||
return false;
|
||||
}
|
||||
MOZ_ASSERT(majorVer < 10);
|
||||
MOZ_ASSERT(minorVer < 10);
|
||||
mVersion = majorVer*100 + minorVer*10;
|
||||
if (mVersion < 200) {
|
||||
// Mac OSX 10.6/10.7 machines with Intel GPUs claim only OpenGL 1.4 but
|
||||
// have all the GL2+ extensions that we need.
|
||||
mVersion = 200;
|
||||
}
|
||||
|
||||
////
|
||||
|
||||
const auto glslVersionStr = (const char*)fGetString(LOCAL_GL_SHADING_LANGUAGE_VERSION);
|
||||
if (!glslVersionStr) {
|
||||
// This happens on the Android emulators. We'll just return 100
|
||||
mShadingLanguageVersion = 100;
|
||||
} else if (ParseVersion(glslVersionStr, &majorVer, &minorVer)) {
|
||||
MOZ_ASSERT(majorVer < 10);
|
||||
MOZ_ASSERT(minorVer < 100);
|
||||
mShadingLanguageVersion = majorVer*100 + minorVer;
|
||||
} else {
|
||||
MOZ_ASSERT(false, "Failed to parse GL_SHADING_LANGUAGE_VERSION");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ShouldSpew()) {
|
||||
printf_stderr("OpenGL version detected: %u\n", version);
|
||||
printf_stderr("OpenGL shading language version detected: %u\n", mShadingLanguageVersion);
|
||||
printf_stderr("GL version detected: %u\n", mVersion);
|
||||
printf_stderr("GLSL version detected: %u\n", mShadingLanguageVersion);
|
||||
printf_stderr("OpenGL vendor: %s\n", fGetString(LOCAL_GL_VENDOR));
|
||||
printf_stderr("OpenGL renderer: %s\n", fGetString(LOCAL_GL_RENDERER));
|
||||
}
|
||||
|
||||
if (version >= mVersion) {
|
||||
mVersion = version;
|
||||
}
|
||||
// Don't fail if version < mVersion, see bug 999445,
|
||||
// Mac OSX 10.6/10.7 machines with Intel GPUs claim only OpenGL 1.4 but
|
||||
// have all the GL2+ extensions that we need.
|
||||
|
||||
////////////////
|
||||
|
||||
// Load OpenGL ES 2.0 symbols, or desktop if we aren't using ES 2.
|
||||
if (IsGLES()) {
|
||||
if (mProfile == ContextProfile::OpenGLES) {
|
||||
const SymLoadStruct symbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fGetShaderPrecisionFormat, { "GetShaderPrecisionFormat", nullptr } },
|
||||
{ (PRFuncPtr*) &mSymbols.fClearDepthf, { "ClearDepthf", nullptr } },
|
||||
|
@ -856,22 +677,42 @@ GLContext::InitWithPrefixImpl(const char* prefix, bool trygl)
|
|||
|
||||
////////////////
|
||||
|
||||
// We need this for retrieving the list of extensions on Core profiles.
|
||||
if (IsFeatureProvidedByCoreSymbols(GLFeature::get_string_indexed)) {
|
||||
if (mVersion >= 300) { // Both GL3 and ES3.
|
||||
const SymLoadStruct symbols[] = {
|
||||
{ (PRFuncPtr*) &mSymbols.fGetStringi, { "GetStringi", nullptr } },
|
||||
END_SYMBOLS
|
||||
};
|
||||
|
||||
if (!LoadGLSymbols(this, prefix, trygl, symbols, "get_string_indexed")) {
|
||||
MOZ_RELEASE_ASSERT(false, "GFX: get_string_indexed is required!");
|
||||
if (!LoadGLSymbols(this, prefix, trygl, symbols, "GetStringi")) {
|
||||
MOZ_RELEASE_ASSERT(false, "GFX: GetStringi is required!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
InitExtensions();
|
||||
if (mProfile != ContextProfile::OpenGLES) {
|
||||
if (mVersion >= 310 && !IsExtensionSupported(ARB_compatibility)) {
|
||||
mProfile = ContextProfile::OpenGLCore;
|
||||
} else {
|
||||
mProfile = ContextProfile::OpenGLCompatibility;
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(mProfile != ContextProfile::Unknown);
|
||||
|
||||
if (ShouldSpew()) {
|
||||
const char* profileStr = "";
|
||||
if (mProfile == ContextProfile::OpenGLES) {
|
||||
profileStr = " es";
|
||||
} else if (mProfile == ContextProfile::OpenGLCore) {
|
||||
profileStr = " core";
|
||||
}
|
||||
printf_stderr("Detected profile: %u%s\n", mVersion, profileStr);
|
||||
}
|
||||
|
||||
InitFeatures();
|
||||
|
||||
////
|
||||
|
||||
// Disable extensions with partial or incorrect support.
|
||||
if (WorkAroundDriverBugs()) {
|
||||
if (Renderer() == GLRenderer::AdrenoTM320) {
|
||||
|
@ -1121,8 +962,6 @@ GLContext::InitWithPrefixImpl(const char* prefix, bool trygl)
|
|||
true);
|
||||
}
|
||||
|
||||
mVersionString = nsPrintfCString("%u.%u.%u", mVersion / 100, (mVersion / 10) % 10,
|
||||
mVersion % 10);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1770,7 +1609,7 @@ GLContext::InitExtensions()
|
|||
|
||||
std::vector<nsCString> driverExtensionList;
|
||||
|
||||
if (IsFeatureProvidedByCoreSymbols(GLFeature::get_string_indexed)) {
|
||||
if (mSymbols.fGetStringi) {
|
||||
GLuint count = 0;
|
||||
GetUIntegerv(LOCAL_GL_NUM_EXTENSIONS, &count);
|
||||
for (GLuint i = 0; i < count; i++) {
|
||||
|
|
|
@ -102,7 +102,6 @@ enum class GLFeature {
|
|||
get_integer64_indexed,
|
||||
get_query_object_i64v,
|
||||
get_query_object_iv,
|
||||
get_string_indexed,
|
||||
gpu_shader4,
|
||||
instanced_arrays,
|
||||
instanced_non_arrays,
|
||||
|
@ -151,7 +150,6 @@ enum class GLFeature {
|
|||
|
||||
enum class ContextProfile : uint8_t {
|
||||
Unknown = 0,
|
||||
OpenGL, // only for IsAtLeast's <profile> parameter
|
||||
OpenGLCore,
|
||||
OpenGLCompatibility,
|
||||
OpenGLES
|
||||
|
@ -241,48 +239,12 @@ public:
|
|||
return mProfile == ContextProfile::OpenGLCompatibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the context is a true OpenGL ES context or an ANGLE context
|
||||
*/
|
||||
inline bool IsGLES() const {
|
||||
MOZ_ASSERT(mProfile != ContextProfile::Unknown, "unknown context profile");
|
||||
|
||||
return mProfile == ContextProfile::OpenGLES;
|
||||
}
|
||||
|
||||
static const char* GetProfileName(ContextProfile profile)
|
||||
{
|
||||
switch (profile)
|
||||
{
|
||||
case ContextProfile::OpenGL:
|
||||
return "OpenGL";
|
||||
case ContextProfile::OpenGLCore:
|
||||
return "OpenGL Core";
|
||||
case ContextProfile::OpenGLCompatibility:
|
||||
return "OpenGL Compatibility";
|
||||
case ContextProfile::OpenGLES:
|
||||
return "OpenGL ES";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(profile != ContextProfile::Unknown, "unknown context profile");
|
||||
return "OpenGL unknown profile";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if we are running on a OpenGL core profile context
|
||||
*/
|
||||
const char* ProfileString() const {
|
||||
return GetProfileName(mProfile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the context is compatible with given parameters
|
||||
*
|
||||
* IsAtLeast(ContextProfile::OpenGL, N) is exactly same as
|
||||
* IsAtLeast(ContextProfile::OpenGLCore, N) || IsAtLeast(ContextProfile::OpenGLCompatibility, N)
|
||||
*/
|
||||
inline bool IsAtLeast(ContextProfile profile, unsigned int version) const
|
||||
{
|
||||
MOZ_ASSERT(profile != ContextProfile::Unknown, "IsAtLeast: bad <profile> parameter");
|
||||
|
@ -293,11 +255,6 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
if (profile == ContextProfile::OpenGL) {
|
||||
return mProfile == ContextProfile::OpenGLCore ||
|
||||
mProfile == ContextProfile::OpenGLCompatibility;
|
||||
}
|
||||
|
||||
return profile == mProfile;
|
||||
}
|
||||
|
||||
|
@ -310,10 +267,6 @@ public:
|
|||
return mVersion;
|
||||
}
|
||||
|
||||
const char* VersionString() const {
|
||||
return mVersionString.get();
|
||||
}
|
||||
|
||||
inline uint32_t ShadingLanguageVersion() const {
|
||||
return mShadingLanguageVersion;
|
||||
}
|
||||
|
@ -361,7 +314,6 @@ protected:
|
|||
* the context is an OpenGL 2.1 context, mVersion value will be 210.
|
||||
*/
|
||||
uint32_t mVersion;
|
||||
nsCString mVersionString;
|
||||
ContextProfile mProfile;
|
||||
|
||||
uint32_t mShadingLanguageVersion;
|
||||
|
@ -369,19 +321,6 @@ protected:
|
|||
GLVendor mVendor;
|
||||
GLRenderer mRenderer;
|
||||
|
||||
void SetProfileVersion(ContextProfile profile, uint32_t version) {
|
||||
MOZ_ASSERT(!mSymbols.fBindFramebuffer,
|
||||
"SetProfileVersion can only be called before initialization!");
|
||||
MOZ_ASSERT(profile != ContextProfile::Unknown &&
|
||||
profile != ContextProfile::OpenGL,
|
||||
"Invalid `profile` for SetProfileVersion");
|
||||
MOZ_ASSERT(version >= 100, "Invalid `version` for SetProfileVersion");
|
||||
|
||||
mVersion = version;
|
||||
mProfile = profile;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Extensions management
|
||||
/**
|
||||
|
@ -417,6 +356,7 @@ public:
|
|||
ARB_ES2_compatibility,
|
||||
ARB_ES3_compatibility,
|
||||
ARB_color_buffer_float,
|
||||
ARB_compatibility,
|
||||
ARB_copy_buffer,
|
||||
ARB_depth_texture,
|
||||
ARB_draw_buffers,
|
||||
|
@ -3179,7 +3119,7 @@ public:
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// get_string_indexed
|
||||
// GL3+, ES3+
|
||||
|
||||
const GLubyte* fGetStringi(GLenum name, GLuint index) {
|
||||
BEFORE_GL_CALL;
|
||||
|
|
|
@ -29,7 +29,7 @@ class GLContextCGL : public GLContext
|
|||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextCGL, override)
|
||||
GLContextCGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
||||
NSOpenGLContext* context, bool isOffscreen, ContextProfile profile);
|
||||
NSOpenGLContext* context, bool isOffscreen);
|
||||
|
||||
~GLContextCGL();
|
||||
|
||||
|
|
|
@ -311,16 +311,6 @@ static const FeatureInfo sFeatureInfoArr[] = {
|
|||
* ARB_occlusion_query (added by OpenGL 2.0).
|
||||
*/
|
||||
},
|
||||
{
|
||||
"get_string_indexed",
|
||||
GLVersion::GL3,
|
||||
GLESVersion::ES3,
|
||||
GLContext::Extension_None,
|
||||
{
|
||||
GLContext::Extensions_End
|
||||
}
|
||||
// glGetStringi
|
||||
},
|
||||
{
|
||||
"gpu_shader4",
|
||||
GLVersion::GL3,
|
||||
|
|
|
@ -26,8 +26,7 @@ public:
|
|||
GLXDrawable drawable,
|
||||
GLXFBConfig cfg,
|
||||
bool deleteDrawable,
|
||||
gfxXlibSurface* pixmap = nullptr,
|
||||
ContextProfile profile = ContextProfile::OpenGLCompatibility);
|
||||
gfxXlibSurface* pixmap);
|
||||
|
||||
// Finds a GLXFBConfig compatible with the provided window.
|
||||
static bool
|
||||
|
@ -77,8 +76,7 @@ private:
|
|||
GLXContext aContext,
|
||||
bool aDeleteDrawable,
|
||||
bool aDoubleBuffered,
|
||||
gfxXlibSurface* aPixmap,
|
||||
ContextProfile profile);
|
||||
gfxXlibSurface* aPixmap);
|
||||
|
||||
GLXContext mContext;
|
||||
Display* mDisplay;
|
||||
|
|
|
@ -73,12 +73,10 @@ private:
|
|||
CGLLibrary sCGLLibrary;
|
||||
|
||||
GLContextCGL::GLContextCGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
||||
NSOpenGLContext* context, bool isOffscreen,
|
||||
ContextProfile profile)
|
||||
NSOpenGLContext* context, bool isOffscreen)
|
||||
: GLContext(flags, caps, nullptr, isOffscreen)
|
||||
, mContext(context)
|
||||
{
|
||||
SetProfileVersion(profile, 210);
|
||||
}
|
||||
|
||||
GLContextCGL::~GLContextCGL()
|
||||
|
@ -292,10 +290,9 @@ GLContextProviderCGL::CreateForWindow(nsIWidget* aWidget,
|
|||
GLint opaque = 0;
|
||||
[context setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity];
|
||||
|
||||
SurfaceCaps caps = SurfaceCaps::ForRGBA();
|
||||
ContextProfile profile = ContextProfile::OpenGLCompatibility;
|
||||
RefPtr<GLContextCGL> glContext = new GLContextCGL(CreateContextFlags::NONE, caps,
|
||||
context, false, profile);
|
||||
RefPtr<GLContextCGL> glContext = new GLContextCGL(CreateContextFlags::NONE,
|
||||
SurfaceCaps::ForRGBA(), context,
|
||||
false);
|
||||
|
||||
if (!glContext->Init()) {
|
||||
glContext = nullptr;
|
||||
|
@ -313,16 +310,12 @@ CreateOffscreenFBOContext(CreateContextFlags flags)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
ContextProfile profile;
|
||||
NSOpenGLContext* context = nullptr;
|
||||
|
||||
if (!(flags & CreateContextFlags::REQUIRE_COMPAT_PROFILE)) {
|
||||
profile = ContextProfile::OpenGLCore;
|
||||
context = CreateWithFormat(kAttribs_offscreen_coreProfile);
|
||||
}
|
||||
if (!context) {
|
||||
profile = ContextProfile::OpenGLCompatibility;
|
||||
|
||||
if (flags & CreateContextFlags::ALLOW_OFFLINE_RENDERER) {
|
||||
if (gfxPrefs::RequireHardwareGL())
|
||||
context = CreateWithFormat(kAttribs_singleBuffered);
|
||||
|
@ -341,9 +334,8 @@ CreateOffscreenFBOContext(CreateContextFlags flags)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
SurfaceCaps dummyCaps = SurfaceCaps::Any();
|
||||
RefPtr<GLContextCGL> glContext = new GLContextCGL(flags, dummyCaps, context, true,
|
||||
profile);
|
||||
RefPtr<GLContextCGL> glContext = new GLContextCGL(flags, SurfaceCaps::Any(), context,
|
||||
true);
|
||||
|
||||
if (gfxPrefs::GLMultithreaded()) {
|
||||
CGLEnable(glContext->GetCGLContext(), kCGLCEMPEngine);
|
||||
|
|
|
@ -24,15 +24,13 @@ using namespace mozilla::widget;
|
|||
|
||||
GLContextEAGL::GLContextEAGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
||||
EAGLContext* context, GLContext* sharedContext,
|
||||
bool isOffscreen, ContextProfile profile)
|
||||
bool isOffscreen)
|
||||
: GLContext(flags, caps, sharedContext, isOffscreen)
|
||||
, mContext(context)
|
||||
, mBackbufferRB(0)
|
||||
, mBackbufferFB(0)
|
||||
, mLayer(nil)
|
||||
{
|
||||
SetProfileVersion(ContextProfile::OpenGLES,
|
||||
[context API] == kEAGLRenderingAPIOpenGLES3 ? 300 : 200);
|
||||
}
|
||||
|
||||
GLContextEAGL::~GLContextEAGL()
|
||||
|
@ -198,13 +196,9 @@ CreateEAGLContext(CreateContextFlags flags, bool aOffscreen, GLContextEAGL* shar
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
SurfaceCaps caps = SurfaceCaps::ForRGBA();
|
||||
ContextProfile profile = ContextProfile::OpenGLES;
|
||||
RefPtr<GLContextEAGL> glContext = new GLContextEAGL(flags, caps, context,
|
||||
sharedContext,
|
||||
aOffscreen,
|
||||
profile);
|
||||
|
||||
RefPtr<GLContextEAGL> glContext = new GLContextEAGL(flags, SurfaceCaps::ForRGBA(),
|
||||
context, sharedContext,
|
||||
aOffscreen);
|
||||
if (!glContext->Init()) {
|
||||
glContext = nullptr;
|
||||
return nullptr;
|
||||
|
|
|
@ -218,9 +218,6 @@ GLContextEGL::GLContextEGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
|||
, mShareWithEGLImage(false)
|
||||
, mOwnsContext(true)
|
||||
{
|
||||
// any EGL contexts will always be GLESv2
|
||||
SetProfileVersion(ContextProfile::OpenGLES, 200);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf_stderr("Initializing context %p surface %p on display %p\n", mContext, mSurface, EGL_DISPLAY());
|
||||
#endif
|
||||
|
|
|
@ -484,7 +484,7 @@ already_AddRefed<GLContextGLX>
|
|||
GLContextGLX::CreateGLContext(CreateContextFlags flags, const SurfaceCaps& caps,
|
||||
bool isOffscreen, Display* display, GLXDrawable drawable,
|
||||
GLXFBConfig cfg, bool deleteDrawable,
|
||||
gfxXlibSurface* pixmap, ContextProfile profile)
|
||||
gfxXlibSurface* pixmap)
|
||||
{
|
||||
GLXLibrary& glx = sGLXLibrary;
|
||||
|
||||
|
@ -517,7 +517,7 @@ GLContextGLX::CreateGLContext(CreateContextFlags flags, const SurfaceCaps& caps,
|
|||
};
|
||||
attrib_list.AppendElements(robust_attribs, MOZ_ARRAY_LENGTH(robust_attribs));
|
||||
}
|
||||
if (profile == ContextProfile::OpenGLCore) {
|
||||
if (!(flags & CreateContextFlags::REQUIRE_COMPAT_PROFILE)) {
|
||||
int core_attribs[] = {
|
||||
LOCAL_GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
|
||||
LOCAL_GLX_CONTEXT_MINOR_VERSION_ARB, 2,
|
||||
|
@ -544,7 +544,7 @@ GLContextGLX::CreateGLContext(CreateContextFlags flags, const SurfaceCaps& caps,
|
|||
|
||||
if (context) {
|
||||
glContext = new GLContextGLX(flags, caps, isOffscreen, display, drawable,
|
||||
context, deleteDrawable, db, pixmap, profile);
|
||||
context, deleteDrawable, db, pixmap);
|
||||
if (!glContext->Init())
|
||||
error = true;
|
||||
} else {
|
||||
|
@ -710,8 +710,7 @@ GLContextGLX::GLContextGLX(
|
|||
GLXContext aContext,
|
||||
bool aDeleteDrawable,
|
||||
bool aDoubleBuffered,
|
||||
gfxXlibSurface* aPixmap,
|
||||
ContextProfile profile)
|
||||
gfxXlibSurface* aPixmap)
|
||||
: GLContext(flags, caps, nullptr, isOffscreen),
|
||||
mContext(aContext),
|
||||
mDisplay(aDisplay),
|
||||
|
@ -722,9 +721,6 @@ GLContextGLX::GLContextGLX(
|
|||
mPixmap(aPixmap),
|
||||
mOwnsContext(true)
|
||||
{
|
||||
MOZ_ASSERT(mGLX);
|
||||
// See 899855
|
||||
SetProfileVersion(profile, 200);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
@ -763,8 +759,7 @@ GLContextProviderGLX::CreateWrappingExisting(void* aContext, void* aSurface)
|
|||
(GLXDrawable)aSurface, (GLXContext)aContext,
|
||||
false, // aDeleteDrawable,
|
||||
true,
|
||||
(gfxXlibSurface*)nullptr,
|
||||
ContextProfile::OpenGLCompatibility);
|
||||
(gfxXlibSurface*)nullptr);
|
||||
|
||||
glContext->mOwnsContext = false;
|
||||
return glContext.forget();
|
||||
|
@ -805,22 +800,14 @@ CreateForWidget(Display* aXDisplay, Window aXWindow,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
SurfaceCaps caps = SurfaceCaps::Any();
|
||||
RefPtr<GLContextGLX> gl;
|
||||
CreateContextFlags flags;
|
||||
if (aWebRender) {
|
||||
gl = GLContextGLX::CreateGLContext(CreateContextFlags::NONE,
|
||||
caps, false,
|
||||
aXDisplay, aXWindow, config,
|
||||
//TODO: we might want to pass an additional bool to select GL core/compat
|
||||
false, nullptr, ContextProfile::OpenGLCore); //WR: required GL 3.2+
|
||||
flags = CreateContextFlags::NONE; // WR needs GL3.2+
|
||||
} else {
|
||||
gl = GLContextGLX::CreateGLContext(CreateContextFlags::NONE,
|
||||
caps, false,
|
||||
aXDisplay, aXWindow, config,
|
||||
false);
|
||||
flags = CreateContextFlags::REQUIRE_COMPAT_PROFILE;
|
||||
}
|
||||
|
||||
return gl.forget();
|
||||
return GLContextGLX::CreateGLContext(flags, SurfaceCaps::Any(), false, aXDisplay,
|
||||
aXWindow, config, false, nullptr);
|
||||
}
|
||||
|
||||
already_AddRefed<GLContext>
|
||||
|
@ -1001,8 +988,7 @@ GLContextGLX::FindFBConfigForWindow(Display* display, int screen, Window window,
|
|||
|
||||
static already_AddRefed<GLContextGLX>
|
||||
CreateOffscreenPixmapContext(CreateContextFlags flags, const IntSize& size,
|
||||
const SurfaceCaps& minCaps, nsACString* const out_failureId,
|
||||
ContextProfile profile = ContextProfile::OpenGLCompatibility)
|
||||
const SurfaceCaps& minCaps, nsACString* const out_failureId)
|
||||
{
|
||||
GLXLibrary* glx = &sGLXLibrary;
|
||||
if (!glx->EnsureInitialized())
|
||||
|
@ -1048,8 +1034,8 @@ CreateOffscreenPixmapContext(CreateContextFlags flags, const IntSize& size,
|
|||
if (error || serverError)
|
||||
return nullptr;
|
||||
|
||||
return GLContextGLX::CreateGLContext(flags, minCaps, true, display,
|
||||
pixmap, config, true, surface, profile);
|
||||
return GLContextGLX::CreateGLContext(flags, minCaps, true, display, pixmap, config,
|
||||
true, surface);
|
||||
}
|
||||
|
||||
/*static*/ already_AddRefed<GLContext>
|
||||
|
@ -1074,14 +1060,8 @@ GLContextProviderGLX::CreateOffscreen(const IntSize& size,
|
|||
minBackbufferCaps.stencil = false;
|
||||
}
|
||||
|
||||
ContextProfile profile = ContextProfile::OpenGLCore;
|
||||
if (flags & CreateContextFlags::REQUIRE_COMPAT_PROFILE) {
|
||||
profile = ContextProfile::OpenGLCompatibility;
|
||||
}
|
||||
|
||||
RefPtr<GLContext> gl;
|
||||
gl = CreateOffscreenPixmapContext(flags, size, minBackbufferCaps, out_failureId,
|
||||
profile);
|
||||
gl = CreateOffscreenPixmapContext(flags, size, minBackbufferCaps, out_failureId);
|
||||
if (!gl)
|
||||
return nullptr;
|
||||
|
||||
|
|
|
@ -278,8 +278,6 @@ GLContextWGL::GLContextWGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
|||
mPixelFormat(0),
|
||||
mIsDoubleBuffered(false)
|
||||
{
|
||||
// See 899855
|
||||
SetProfileVersion(ContextProfile::OpenGLCompatibility, 200);
|
||||
}
|
||||
|
||||
GLContextWGL::GLContextWGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
||||
|
@ -293,8 +291,6 @@ GLContextWGL::GLContextWGL(CreateContextFlags flags, const SurfaceCaps& caps,
|
|||
mPixelFormat(aPixelFormat),
|
||||
mIsDoubleBuffered(false)
|
||||
{
|
||||
// See 899855
|
||||
SetProfileVersion(ContextProfile::OpenGLCompatibility, 200);
|
||||
}
|
||||
|
||||
GLContextWGL::~GLContextWGL()
|
||||
|
|
|
@ -72,6 +72,23 @@ protected:
|
|||
manager->UpdateHitTestingTree(0, root, false, 0, 0);
|
||||
}
|
||||
|
||||
// Creates a layer tree with a parent layer that is only scrollable
|
||||
// horizontally, and a child layer that is only scrollable vertically.
|
||||
void CreateScrollHandoffLayerTree4() {
|
||||
const char* layerTreeSyntax = "c(t)";
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 0, 100, 100))
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(root, FrameMetrics::START_SCROLL_ID, CSSRect(0, 0, 200, 100));
|
||||
SetScrollableFrameMetrics(layers[1], FrameMetrics::START_SCROLL_ID + 1, CSSRect(0, 0, 100, 200));
|
||||
SetScrollHandoff(layers[1], root);
|
||||
registration = MakeUnique<ScopedLayerTreeRegistration>(manager, 0, root, mcc);
|
||||
manager->UpdateHitTestingTree(0, root, false, 0, 0);
|
||||
rootApzc = ApzcOf(root);
|
||||
}
|
||||
|
||||
void CreateScrollgrabLayerTree(bool makeParentScrollable = true) {
|
||||
const char* layerTreeSyntax = "c(t)";
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
|
@ -370,6 +387,22 @@ TEST_F(APZScrollHandoffTester, StuckInOverscroll_Bug1240202b) {
|
|||
EXPECT_FALSE(rootApzc->IsOverscrolled());
|
||||
}
|
||||
|
||||
TEST_F(APZScrollHandoffTester, OpposingConstrainedAxes_Bug1201098) {
|
||||
// Enable overscrolling.
|
||||
SCOPED_GFX_PREF(APZOverscrollEnabled, bool, true);
|
||||
|
||||
CreateScrollHandoffLayerTree4();
|
||||
|
||||
RefPtr<TestAsyncPanZoomController> childApzc = ApzcOf(layers[1]);
|
||||
|
||||
// Pan, causing the child APZC to overscroll.
|
||||
Pan(childApzc, 50, 60);
|
||||
|
||||
//Make sure only the child is overscrolled.
|
||||
EXPECT_TRUE(childApzc->IsOverscrolled());
|
||||
EXPECT_FALSE(rootApzc->IsOverscrolled());
|
||||
}
|
||||
|
||||
// Test that flinging in a direction where one component of the fling goes into
|
||||
// overscroll but the other doesn't, results in just the one component being
|
||||
// handed off to the parent, while the original APZC continues flinging in the
|
||||
|
|
|
@ -119,13 +119,18 @@ AutoTextureLock::AutoTextureLock(IDXGIKeyedMutex* aMutex,
|
|||
uint32_t aTimeout)
|
||||
{
|
||||
mMutex = aMutex;
|
||||
mResult = mMutex->AcquireSync(0, aTimeout);
|
||||
aResult = mResult;
|
||||
if (mMutex) {
|
||||
mResult = mMutex->AcquireSync(0, aTimeout);
|
||||
aResult = mResult;
|
||||
} else {
|
||||
aResult = E_INVALIDARG;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AutoTextureLock::~AutoTextureLock()
|
||||
{
|
||||
if (!FAILED(mResult) && mResult != WAIT_TIMEOUT &&
|
||||
if (mMutex && !FAILED(mResult) && mResult != WAIT_TIMEOUT &&
|
||||
mResult != WAIT_ABANDONED) {
|
||||
mMutex->ReleaseSync(0);
|
||||
}
|
||||
|
|
|
@ -744,14 +744,10 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
mGLContext = gl::GLContextGLX::CreateGLContext(
|
||||
gl::CreateContextFlags::NONE,
|
||||
gl::SurfaceCaps::Any(),
|
||||
false,
|
||||
mXDisplay,
|
||||
root,
|
||||
config,
|
||||
false);
|
||||
mGLContext = gl::GLContextGLX::CreateGLContext(gl::CreateContextFlags::NONE,
|
||||
gl::SurfaceCaps::Any(), false,
|
||||
mXDisplay, root, config, false,
|
||||
nullptr);
|
||||
|
||||
if (!mGLContext) {
|
||||
lock.NotifyAll();
|
||||
|
|
|
@ -145,6 +145,8 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
|||
'PrintTargetWindows.h',
|
||||
]
|
||||
SOURCES += [
|
||||
'gfxDWriteCommon.cpp',
|
||||
'gfxDWriteFonts.cpp',
|
||||
'gfxGDIFont.cpp',
|
||||
'gfxGDIFontList.cpp',
|
||||
'gfxWindowsNativeDrawing.cpp',
|
||||
|
@ -153,14 +155,9 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
|||
'PrintTargetPDF.cpp',
|
||||
'PrintTargetWindows.cpp',
|
||||
]
|
||||
if CONFIG['MOZ_ENABLE_DWRITE_FONT']:
|
||||
UNIFIED_SOURCES += [
|
||||
'gfxDWriteFontList.cpp',
|
||||
]
|
||||
SOURCES += [
|
||||
'gfxDWriteCommon.cpp',
|
||||
'gfxDWriteFonts.cpp',
|
||||
]
|
||||
UNIFIED_SOURCES += [
|
||||
'gfxDWriteFontList.cpp',
|
||||
]
|
||||
|
||||
# Are we targeting x86 or x64? If so, build gfxAlphaRecoverySSE2.cpp.
|
||||
if CONFIG['INTEL_ARCHITECTURE']:
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "mozilla/Move.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/ChaosMode.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
#include "nsImageModule.h"
|
||||
#include "imgRequestProxy.h"
|
||||
|
@ -2063,6 +2064,12 @@ imgLoader::LoadImage(nsIURI* aURI,
|
|||
const nsAString& initiatorType,
|
||||
imgRequestProxy** _retval)
|
||||
{
|
||||
// Note: We round the time to the nearest milliseconds. Due to this rounding,
|
||||
// the actual minimum value is 500 microseconds.
|
||||
static const uint32_t kMinTelemetryLatencyMs = 1;
|
||||
|
||||
mozilla::TimeStamp start = TimeStamp::Now();
|
||||
|
||||
VerifyCacheSizes();
|
||||
|
||||
NS_ASSERTION(aURI, "imgLoader::LoadImage -- NULL URI pointer");
|
||||
|
@ -2298,8 +2305,11 @@ imgLoader::LoadImage(nsIURI* aURI,
|
|||
if (!newChannel) {
|
||||
proxy->NotifyListener();
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
uint32_t latencyMs = round((TimeStamp::Now() - start).ToMilliseconds());
|
||||
if (XRE_IsContentProcess() && latencyMs >= kMinTelemetryLatencyMs) {
|
||||
Telemetry::Accumulate(Telemetry::IMAGE_LOAD_TRIGGER_LATENCY_MS, latencyMs);
|
||||
}
|
||||
|
||||
NS_ASSERTION(*_retval, "imgLoader::LoadImage -- no return value");
|
||||
|
|
|
@ -30,6 +30,9 @@ class AsyncScriptCompiler final : public nsIIncrementalStreamLoaderObserver
|
|||
, public Runnable
|
||||
{
|
||||
public:
|
||||
// Note: References to this class are never held by cycle-collected objects.
|
||||
// If at any point a reference is returned to a caller, please update this
|
||||
// class to implement cycle collection.
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIINCREMENTALSTREAMLOADEROBSERVER
|
||||
NS_DECL_NSIRUNNABLE
|
||||
|
@ -192,12 +195,15 @@ AsyncScriptCompiler::Reject(JSContext* aCx)
|
|||
void
|
||||
AsyncScriptCompiler::Reject(JSContext* aCx, const char* aMsg)
|
||||
{
|
||||
nsAutoCString msg(aMsg);
|
||||
msg.Append(": ");
|
||||
msg.Append(mURL);
|
||||
nsAutoString msg;
|
||||
msg.AppendASCII(aMsg);
|
||||
msg.AppendLiteral(": ");
|
||||
AppendUTF8toUTF16(mURL, msg);
|
||||
|
||||
RootedValue exn(aCx, StringValue(JS_NewStringCopyZ(aCx, msg.get())));
|
||||
JS_SetPendingException(aCx, exn);
|
||||
RootedValue exn(aCx);
|
||||
if (xpc::NonVoidStringToJsval(aCx, msg, &exn)) {
|
||||
JS_SetPendingException(aCx, exn);
|
||||
}
|
||||
|
||||
Reject(aCx);
|
||||
}
|
||||
|
@ -305,6 +311,7 @@ PrecompiledScript::ExecuteInGlobal(JSContext* aCx, HandleObject aGlobal,
|
|||
Rooted<JSScript*> script(aCx, mScript);
|
||||
if (!JS::CloneAndExecuteScript(aCx, script, aRval)) {
|
||||
aRv.NoteJSContextException(aCx);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,17 +92,21 @@ mozJSSubScriptLoader::~mozJSSubScriptLoader()
|
|||
NS_IMPL_ISUPPORTS(mozJSSubScriptLoader, mozIJSSubScriptLoader)
|
||||
|
||||
static void
|
||||
ReportError(JSContext* cx, const char* msg)
|
||||
ReportError(JSContext* cx, const nsACString& msg)
|
||||
{
|
||||
RootedValue exn(cx, JS::StringValue(JS_NewStringCopyZ(cx, msg)));
|
||||
JS_SetPendingException(cx, exn);
|
||||
NS_ConvertUTF8toUTF16 ucMsg(msg);
|
||||
|
||||
RootedValue exn(cx);
|
||||
if (xpc::NonVoidStringToJsval(cx, ucMsg, &exn)) {
|
||||
JS_SetPendingException(cx, exn);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ReportError(JSContext* cx, const char* origMsg, nsIURI* uri)
|
||||
{
|
||||
if (!uri) {
|
||||
ReportError(cx, origMsg);
|
||||
ReportError(cx, nsDependentCString(origMsg));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -114,7 +118,7 @@ ReportError(JSContext* cx, const char* origMsg, nsIURI* uri)
|
|||
nsAutoCString msg(origMsg);
|
||||
msg.Append(": ");
|
||||
msg.Append(spec);
|
||||
ReportError(cx, msg.get());
|
||||
ReportError(cx, msg);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -620,7 +624,7 @@ mozJSSubScriptLoader::DoLoadSubScriptWithOptions(const nsAString& url,
|
|||
: nullptr;
|
||||
nsCOMPtr<nsIIOService> serv = do_GetService(NS_IOSERVICE_CONTRACTID);
|
||||
if (!serv) {
|
||||
ReportError(cx, LOAD_ERROR_NOSERVICE);
|
||||
ReportError(cx, NS_LITERAL_CSTRING(LOAD_ERROR_NOSERVICE));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -628,13 +632,13 @@ mozJSSubScriptLoader::DoLoadSubScriptWithOptions(const nsAString& url,
|
|||
// canonicalized spec.
|
||||
rv = NS_NewURI(getter_AddRefs(uri), NS_LossyConvertUTF16toASCII(url).get(), nullptr, serv);
|
||||
if (NS_FAILED(rv)) {
|
||||
ReportError(cx, LOAD_ERROR_NOURI);
|
||||
ReportError(cx, NS_LITERAL_CSTRING(LOAD_ERROR_NOURI));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
rv = uri->GetSpec(uriStr);
|
||||
if (NS_FAILED(rv)) {
|
||||
ReportError(cx, LOAD_ERROR_NOSPEC);
|
||||
ReportError(cx, NS_LITERAL_CSTRING(LOAD_ERROR_NOSPEC));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -6185,6 +6185,7 @@ Selection::PostScrollSelectionIntoViewEvent(
|
|||
RefPtr<ScrollSelectionIntoViewEvent> ev =
|
||||
new ScrollSelectionIntoViewEvent(this, aRegion, aVertical, aHorizontal,
|
||||
aFlags);
|
||||
mScrollEvent = ev;
|
||||
nsresult rv;
|
||||
nsIDocument* doc = GetParentObject();
|
||||
if (doc) {
|
||||
|
@ -6195,10 +6196,10 @@ Selection::PostScrollSelectionIntoViewEvent(
|
|||
rv = NS_DispatchToCurrentThread(ev);
|
||||
}
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mScrollEvent = ev;
|
||||
return NS_OK;
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
mScrollEvent = nullptr; // no need to hold on to the event
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
var el = root.getElementById("one");
|
||||
el.checked = true;
|
||||
el.nextSibling.addEventListener("transitionend", function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
setTimeout(()=>{document.documentElement.removeAttribute("class")}, 1000); // wait for the checkbox SVG image to load on Android
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -588,7 +588,10 @@ public class BrowserApp extends GeckoApp
|
|||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
if (!HardwareUtils.isSupportedSystem()) {
|
||||
final Context appContext = getApplicationContext();
|
||||
|
||||
GeckoLoader.loadMozGlue(appContext);
|
||||
if (!HardwareUtils.isSupportedSystem() || !GeckoLoader.neonCompatible()) {
|
||||
// This build does not support the Android version of the device; Exit early.
|
||||
super.onCreate(savedInstanceState);
|
||||
return;
|
||||
|
@ -610,8 +613,6 @@ public class BrowserApp extends GeckoApp
|
|||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final Context appContext = getApplicationContext();
|
||||
|
||||
initSwitchboard(this, intent, isInAutomation);
|
||||
initTelemetryUploader(isInAutomation);
|
||||
|
||||
|
@ -1747,10 +1748,6 @@ public class BrowserApp extends GeckoApp
|
|||
final EventCallback callback) {
|
||||
switch (event) {
|
||||
case "Gecko:Ready":
|
||||
if (!GeckoLoader.neonCompatible()) {
|
||||
conditionallyNotifyEOL();
|
||||
}
|
||||
|
||||
EventDispatcher.getInstance().registerUiThreadListener(this, "Gecko:DelayedStartup");
|
||||
|
||||
// Handle this message in GeckoApp, but also enable the Settings
|
||||
|
|
|
@ -1157,7 +1157,7 @@ public abstract class GeckoApp
|
|||
enableStrictMode();
|
||||
}
|
||||
|
||||
if (!HardwareUtils.isSupportedSystem()) {
|
||||
if (!HardwareUtils.isSupportedSystem() || !GeckoLoader.neonCompatible()) {
|
||||
// This build does not support the Android version of the device: Show an error and finish the app.
|
||||
mIsAbortingAppLaunch = true;
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
|
@ -1192,10 +1192,13 @@ pref("dom.forms.number", true);
|
|||
// platforms which don't have a color picker implemented yet.
|
||||
pref("dom.forms.color", true);
|
||||
|
||||
// Support for input type=date, time, month, week and datetime-local. By
|
||||
// default, disabled.
|
||||
// Support for input type=date and type=time. By default, disabled.
|
||||
pref("dom.forms.datetime", false);
|
||||
|
||||
// Support for input type=month, type=week and type=datetime-local. By default,
|
||||
// disabled.
|
||||
pref("dom.forms.datetime.others", false);
|
||||
|
||||
// Enable time picker UI. By default, disabled.
|
||||
pref("dom.forms.datetime.timepicker", false);
|
||||
|
||||
|
|
|
@ -4884,7 +4884,6 @@ if test "$MOZ_TREE_CAIRO"; then
|
|||
WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
|
||||
WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
|
||||
MOZ_ENABLE_D2D_SURFACE=1
|
||||
MOZ_ENABLE_DWRITE_FONT=1
|
||||
|
||||
if test "$COMPILE_ENVIRONMENT"; then
|
||||
|
||||
|
@ -4899,7 +4898,6 @@ if test "$MOZ_TREE_CAIRO"; then
|
|||
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
|
||||
fi
|
||||
AC_SUBST(MOZ_ENABLE_CAIRO_FT)
|
||||
AC_SUBST(MOZ_ENABLE_DWRITE_FONT)
|
||||
AC_SUBST(MOZ_ENABLE_D2D_SURFACE)
|
||||
AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
|
||||
|
||||
|
|
|
@ -1157,4 +1157,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
|
|||
|
||||
static const int32_t kUnknownId = -1;
|
||||
|
||||
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1498232146167000);
|
||||
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1498316559434000);
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -255,6 +255,7 @@ HistoryStore.prototype = {
|
|||
|
||||
applyIncomingBatch: function applyIncomingBatch(records) {
|
||||
let failed = [];
|
||||
let blockers = [];
|
||||
|
||||
// Convert incoming records to mozIPlaceInfo objects. Some records can be
|
||||
// ignored or handled directly, so we're rewriting the array in-place.
|
||||
|
@ -263,11 +264,12 @@ HistoryStore.prototype = {
|
|||
let record = records[k] = records[i];
|
||||
let shouldApply;
|
||||
|
||||
// This is still synchronous I/O for now.
|
||||
try {
|
||||
if (record.deleted) {
|
||||
// Consider using nsIBrowserHistory::removePages() here.
|
||||
this.remove(record);
|
||||
let promise = this.remove(record);
|
||||
promise = promise.then(null, ex => failed.push(record.id));
|
||||
blockers.push(promise);
|
||||
|
||||
// No further processing needed. Remove it from the list.
|
||||
shouldApply = false;
|
||||
} else {
|
||||
|
@ -287,21 +289,35 @@ HistoryStore.prototype = {
|
|||
}
|
||||
records.length = k; // truncate array
|
||||
|
||||
// Nothing to do.
|
||||
if (!records.length) {
|
||||
return failed;
|
||||
let handleAsyncOperationsComplete = Async.makeSyncCallback();
|
||||
|
||||
if (records.length) {
|
||||
blockers.push(new Promise(resolve => {
|
||||
let updatePlacesCallback = {
|
||||
handleResult: function handleResult() {},
|
||||
handleError: function handleError(resultCode, placeInfo) {
|
||||
failed.push(placeInfo.guid);
|
||||
},
|
||||
handleCompletion: resolve,
|
||||
};
|
||||
this._asyncHistory.updatePlaces(records, updatePlacesCallback);
|
||||
}));
|
||||
}
|
||||
|
||||
let updatePlacesCallback = {
|
||||
handleResult: function handleResult() {},
|
||||
handleError: function handleError(resultCode, placeInfo) {
|
||||
failed.push(placeInfo.guid);
|
||||
},
|
||||
handleCompletion: Async.makeSyncCallback()
|
||||
};
|
||||
this._asyncHistory.updatePlaces(records, updatePlacesCallback);
|
||||
Async.waitForSyncCallback(updatePlacesCallback.handleCompletion);
|
||||
return failed;
|
||||
// Since `failed` is updated asynchronously and this function is
|
||||
// synchronous, we need to spin-wait until we are sure that all
|
||||
// updates to `fail` have completed.
|
||||
Promise.all(blockers).then(
|
||||
handleAsyncOperationsComplete,
|
||||
ex => {
|
||||
// In case of error, terminate wait, but make sure that the
|
||||
// error is reported nevertheless and still causes test
|
||||
// failures.
|
||||
handleAsyncOperationsComplete();
|
||||
throw ex;
|
||||
});
|
||||
Async.waitForSyncCallback(handleAsyncOperationsComplete);
|
||||
return failed;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -388,15 +404,15 @@ HistoryStore.prototype = {
|
|||
},
|
||||
|
||||
remove: function HistStore_remove(record) {
|
||||
let page = this._findURLByGUID(record.id);
|
||||
if (page == null) {
|
||||
this._log.debug("Page already removed: " + record.id);
|
||||
return;
|
||||
}
|
||||
|
||||
let uri = Utils.makeURI(page.url);
|
||||
PlacesUtils.history.removePage(uri);
|
||||
this._log.trace("Removed page: " + [record.id, page.url, page.title]);
|
||||
return PlacesUtils.history.remove(record.id).then(
|
||||
(removed) => {
|
||||
if (removed) {
|
||||
this._log.trace("Removed page: " + record.id);
|
||||
} else {
|
||||
this._log.debug("Page already removed: " + record.id);
|
||||
}
|
||||
});
|
||||
this._log.trace("Removing page: " + record.id);
|
||||
},
|
||||
|
||||
itemExists: function HistStore_itemExists(id) {
|
||||
|
|
|
@ -175,8 +175,7 @@ var HistoryEntry = {
|
|||
*/
|
||||
Delete(item, usSinceEpoch) {
|
||||
if ("uri" in item) {
|
||||
let uri = Services.io.newURI(item.uri);
|
||||
PlacesUtils.history.removePage(uri);
|
||||
PlacesUtils.history.remove(item.uri);
|
||||
} else if ("host" in item) {
|
||||
PlacesUtils.history.removePagesFromHost(item.host, false);
|
||||
} else if ("begin" in item && "end" in item) {
|
||||
|
|
|
@ -15,6 +15,11 @@ from taskgraph.transforms.task import task_description_schema
|
|||
from voluptuous import Schema, Any, Required, Optional
|
||||
|
||||
|
||||
# For developers: if you are adding any new artifacts here that need to be
|
||||
# transfered to S3, please be aware you also need to follow-up with patch in
|
||||
# the actual beetmoverscript logic that lies under
|
||||
# https://github.com/mozilla-releng/beetmoverscript/. See example in bug
|
||||
# 1348286
|
||||
_DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US = [
|
||||
"balrog_props.json",
|
||||
"target.common.tests.zip",
|
||||
|
@ -56,6 +61,7 @@ _MOBILE_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US = [
|
|||
"en-US/target.mozinfo.json",
|
||||
"en-US/target.reftest.tests.zip",
|
||||
"en-US/target.talos.tests.zip",
|
||||
"en-US/target.awsy.tests.zip",
|
||||
"en-US/target.test_packages.json",
|
||||
"en-US/target.txt",
|
||||
"en-US/target.web-platform.tests.zip",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[
|
||||
{
|
||||
"size": 1801469,
|
||||
"size": 2081948,
|
||||
"visibility": "public",
|
||||
"digest": "d91c2dcea4dc4eeef3dfba8965c207060fd77a9fc108230c44ae2b60650c9879da7600e0df53f2cd29d28705d139e594493917f45a6c5061c0b516f65687a4b4",
|
||||
"digest": "696f0a2eb9ff3abe253875990a7837877977cccd66f9a4ea4a823daaec866f1eae197c63394c093e664736da4f7ad9c480fd9515f30ad359d24e447c40f34925",
|
||||
"algorithm": "sha512",
|
||||
"filename": "geckodriver-v0.13.0-linux64.tar.gz"
|
||||
"filename": "geckodriver-v0.15.0-linux64.tar.gz"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -13,6 +13,7 @@ user_pref("dom.experimental_forms", true); // on for testing
|
|||
user_pref("dom.forms.number", true); // on for testing
|
||||
user_pref("dom.forms.color", true); // on for testing
|
||||
user_pref("dom.forms.datetime", true); // on for testing
|
||||
user_pref("dom.forms.datetime.others", true); // on for testing
|
||||
user_pref("dom.max_script_run_time", 0); // no slow script dialogs
|
||||
user_pref("hangmonitor.timeout", 0); // no hang monitor
|
||||
user_pref("dom.max_chrome_script_run_time", 0);
|
||||
|
@ -229,6 +230,7 @@ user_pref("browser.snippets.firstrunHomepage.enabled", false);
|
|||
|
||||
// Disable useragent updates.
|
||||
user_pref("general.useragent.updates.enabled", false);
|
||||
user_pref("general.useragent.updates.url", "https://example.com/0/%%APP_ID%%");
|
||||
|
||||
// Disable webapp updates. Yes, it is supposed to be an integer.
|
||||
user_pref("browser.webapps.checkForUpdates", 0);
|
||||
|
|
|
@ -19,7 +19,7 @@ with open(os.path.join(here, "requirements.txt")) as f:
|
|||
deps = f.read().splitlines()
|
||||
|
||||
# Browser-specific requirements
|
||||
requirements_files = glob.glob(os.path.join(here, "requirements_*.txt"))
|
||||
requirements_files = glob.glob("requirements_*.txt")
|
||||
|
||||
profile_dest = None
|
||||
dest_exists = False
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<html class="reftest-wait">
|
||||
<title>rel=match that should fail</title>
|
||||
<link rel=match href=red.html>
|
||||
<style>
|
||||
:root {background-color:red}
|
||||
</style>
|
||||
<body class="reftest-wait">
|
||||
<script>
|
||||
setTimeout(function() {
|
||||
document.documentElement.style.backgroundColor = "green";
|
||||
body.className = "";
|
||||
}, 2000);
|
||||
document.documentElement.className = "";
|
||||
}, 2000);
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -127,6 +127,9 @@ class Browser(object):
|
|||
|
||||
|
||||
class NullBrowser(Browser):
|
||||
def __init__(self, logger, **kwargs):
|
||||
super(NullBrowser, self).__init__(logger)
|
||||
|
||||
def start(self):
|
||||
"""No-op browser to use in scenarios where the TestRunnerManager shouldn't
|
||||
actually own the browser process (e.g. Servo where we start one browser
|
||||
|
|
|
@ -35,10 +35,18 @@ def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
|
|||
executor_kwargs = base_executor_kwargs(test_type, server_config,
|
||||
cache_manager, **kwargs)
|
||||
executor_kwargs["close_after_done"] = True
|
||||
executor_kwargs["capabilities"] = dict(DesiredCapabilities.CHROME.items())
|
||||
if kwargs["binary"] is not None:
|
||||
executor_kwargs["capabilities"]["chromeOptions"] = {"binary": kwargs["binary"]}
|
||||
|
||||
capabilities = dict(DesiredCapabilities.CHROME.items())
|
||||
capabilities.setdefault("chromeOptions", {})["prefs"] = {
|
||||
"profile": {
|
||||
"default_content_setting_values": {
|
||||
"popups": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
for (kwarg, capability) in [("binary", "binary"), ("binary_args", "args")]:
|
||||
if kwargs[kwarg] is not None:
|
||||
capabilities["chromeOptions"][capability] = kwargs[kwarg]
|
||||
executor_kwargs["capabilities"] = capabilities
|
||||
return executor_kwargs
|
||||
|
||||
|
||||
|
|
|
@ -58,7 +58,8 @@ def browser_kwargs(**kwargs):
|
|||
"certutil_binary": kwargs["certutil_binary"],
|
||||
"ca_certificate_path": kwargs["ssl_env"].ca_cert_path(),
|
||||
"e10s": kwargs["gecko_e10s"],
|
||||
"stackfix_dir": kwargs["stackfix_dir"]}
|
||||
"stackfix_dir": kwargs["stackfix_dir"],
|
||||
"binary_args": kwargs["binary_args"]}
|
||||
|
||||
|
||||
def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
|
||||
|
@ -76,6 +77,16 @@ def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
|
|||
executor_kwargs["timeout_multiplier"] = 3
|
||||
if test_type == "wdspec":
|
||||
executor_kwargs["webdriver_binary"] = kwargs.get("webdriver_binary")
|
||||
fxOptions = {}
|
||||
if kwargs["binary"]:
|
||||
fxOptions["binary"] = kwargs["binary"]
|
||||
if kwargs["binary_args"]:
|
||||
fxOptions["args"] = kwargs["binary_args"]
|
||||
fxOptions["prefs"] = {
|
||||
"network.dns.localDomains": ",".join(hostnames)
|
||||
}
|
||||
capabilities = {"moz:firefoxOptions": fxOptions}
|
||||
executor_kwargs["capabilities"] = capabilities
|
||||
return executor_kwargs
|
||||
|
||||
|
||||
|
@ -101,7 +112,8 @@ class FirefoxBrowser(Browser):
|
|||
|
||||
def __init__(self, logger, binary, prefs_root, debug_info=None,
|
||||
symbols_path=None, stackwalk_binary=None, certutil_binary=None,
|
||||
ca_certificate_path=None, e10s=False, stackfix_dir=None):
|
||||
ca_certificate_path=None, e10s=False, stackfix_dir=None,
|
||||
binary_args=None):
|
||||
Browser.__init__(self, logger)
|
||||
self.binary = binary
|
||||
self.prefs_root = prefs_root
|
||||
|
@ -114,6 +126,7 @@ class FirefoxBrowser(Browser):
|
|||
self.ca_certificate_path = ca_certificate_path
|
||||
self.certutil_binary = certutil_binary
|
||||
self.e10s = e10s
|
||||
self.binary_args = binary_args
|
||||
if self.symbols_path and stackfix_dir:
|
||||
self.stack_fixer = get_stack_fixer_function(stackfix_dir,
|
||||
self.symbols_path)
|
||||
|
@ -150,7 +163,9 @@ class FirefoxBrowser(Browser):
|
|||
if self.ca_certificate_path is not None:
|
||||
self.setup_ssl()
|
||||
|
||||
debug_args, cmd = browser_command(self.binary, [cmd_arg("marionette"), "about:blank"],
|
||||
debug_args, cmd = browser_command(self.binary,
|
||||
self.binary_args if self.binary_args else [] +
|
||||
[cmd_arg("marionette"), "about:blank"],
|
||||
self.debug_info)
|
||||
|
||||
self.runner = FirefoxRunner(profile=self.profile,
|
||||
|
|
|
@ -10,17 +10,20 @@ from ..executors.executorservo import ServoTestharnessExecutor, ServoRefTestExec
|
|||
|
||||
here = os.path.join(os.path.split(__file__)[0])
|
||||
|
||||
__wptrunner__ = {"product": "servo",
|
||||
"check_args": "check_args",
|
||||
"browser": "ServoBrowser",
|
||||
"executor": {"testharness": "ServoTestharnessExecutor",
|
||||
"reftest": "ServoRefTestExecutor",
|
||||
"wdspec": "ServoWdspecExecutor"},
|
||||
"browser_kwargs": "browser_kwargs",
|
||||
"executor_kwargs": "executor_kwargs",
|
||||
"env_options": "env_options",
|
||||
"run_info_extras": "run_info_extras",
|
||||
"update_properties": "update_properties"}
|
||||
__wptrunner__ = {
|
||||
"product": "servo",
|
||||
"check_args": "check_args",
|
||||
"browser": "ServoBrowser",
|
||||
"executor": {
|
||||
"testharness": "ServoTestharnessExecutor",
|
||||
"reftest": "ServoRefTestExecutor",
|
||||
"wdspec": "ServoWdspecExecutor",
|
||||
},
|
||||
"browser_kwargs": "browser_kwargs",
|
||||
"executor_kwargs": "executor_kwargs",
|
||||
"env_options": "env_options",
|
||||
"update_properties": "update_properties",
|
||||
}
|
||||
|
||||
|
||||
def check_args(**kwargs):
|
||||
|
@ -28,11 +31,12 @@ def check_args(**kwargs):
|
|||
|
||||
|
||||
def browser_kwargs(**kwargs):
|
||||
return {"binary": kwargs["binary"],
|
||||
"debug_info": kwargs["debug_info"],
|
||||
"binary_args": kwargs["binary_args"],
|
||||
"user_stylesheets": kwargs.get("user_stylesheets"),
|
||||
"render_backend": kwargs.get("servo_backend")}
|
||||
return {
|
||||
"binary": kwargs["binary"],
|
||||
"debug_info": kwargs["debug_info"],
|
||||
"binary_args": kwargs["binary_args"],
|
||||
"user_stylesheets": kwargs.get("user_stylesheets"),
|
||||
}
|
||||
|
||||
|
||||
def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
|
||||
|
@ -51,31 +55,23 @@ def env_options():
|
|||
"supports_debugger": True}
|
||||
|
||||
|
||||
def run_info_extras(**kwargs):
|
||||
return {"backend": kwargs["servo_backend"]}
|
||||
|
||||
|
||||
def update_properties():
|
||||
return ["debug", "os", "version", "processor", "bits", "backend"], None
|
||||
|
||||
|
||||
def render_arg(render_backend):
|
||||
return {"cpu": "--cpu", "webrender": "-w"}[render_backend]
|
||||
return ["debug", "os", "version", "processor", "bits"], None
|
||||
|
||||
|
||||
class ServoBrowser(NullBrowser):
|
||||
def __init__(self, logger, binary, debug_info=None, binary_args=None,
|
||||
user_stylesheets=None, render_backend="webrender"):
|
||||
user_stylesheets=None):
|
||||
NullBrowser.__init__(self, logger)
|
||||
self.binary = binary
|
||||
self.debug_info = debug_info
|
||||
self.binary_args = binary_args or []
|
||||
self.user_stylesheets = user_stylesheets or []
|
||||
self.render_backend = render_backend
|
||||
|
||||
def executor_browser(self):
|
||||
return ExecutorBrowser, {"binary": self.binary,
|
||||
"debug_info": self.debug_info,
|
||||
"binary_args": self.binary_args,
|
||||
"user_stylesheets": self.user_stylesheets,
|
||||
"render_backend": self.render_backend}
|
||||
return ExecutorBrowser, {
|
||||
"binary": self.binary,
|
||||
"debug_info": self.debug_info,
|
||||
"binary_args": self.binary_args,
|
||||
"user_stylesheets": self.user_stylesheets,
|
||||
}
|
||||
|
|
|
@ -9,23 +9,25 @@ import tempfile
|
|||
from mozprocess import ProcessHandler
|
||||
|
||||
from .base import Browser, require_arg, get_free_port, browser_command, ExecutorBrowser
|
||||
from .servo import render_arg
|
||||
from ..executors import executor_kwargs as base_executor_kwargs
|
||||
from ..executors.executorservodriver import (ServoWebDriverTestharnessExecutor,
|
||||
ServoWebDriverRefTestExecutor)
|
||||
|
||||
here = os.path.join(os.path.split(__file__)[0])
|
||||
|
||||
__wptrunner__ = {"product": "servodriver",
|
||||
"check_args": "check_args",
|
||||
"browser": "ServoWebDriverBrowser",
|
||||
"executor": {"testharness": "ServoWebDriverTestharnessExecutor",
|
||||
"reftest": "ServoWebDriverRefTestExecutor"},
|
||||
"browser_kwargs": "browser_kwargs",
|
||||
"executor_kwargs": "executor_kwargs",
|
||||
"env_options": "env_options",
|
||||
"run_info_extras": "run_info_extras",
|
||||
"update_properties": "update_properties"}
|
||||
__wptrunner__ = {
|
||||
"product": "servodriver",
|
||||
"check_args": "check_args",
|
||||
"browser": "ServoWebDriverBrowser",
|
||||
"executor": {
|
||||
"testharness": "ServoWebDriverTestharnessExecutor",
|
||||
"reftest": "ServoWebDriverRefTestExecutor",
|
||||
},
|
||||
"browser_kwargs": "browser_kwargs",
|
||||
"executor_kwargs": "executor_kwargs",
|
||||
"env_options": "env_options",
|
||||
"update_properties": "update_properties",
|
||||
}
|
||||
|
||||
hosts_text = """127.0.0.1 web-platform.test
|
||||
127.0.0.1 www.web-platform.test
|
||||
|
@ -41,10 +43,11 @@ def check_args(**kwargs):
|
|||
|
||||
|
||||
def browser_kwargs(**kwargs):
|
||||
return {"binary": kwargs["binary"],
|
||||
"debug_info": kwargs["debug_info"],
|
||||
"user_stylesheets": kwargs.get("user_stylesheets"),
|
||||
"render_backend": kwargs.get("servo_backend")}
|
||||
return {
|
||||
"binary": kwargs["binary"],
|
||||
"debug_info": kwargs["debug_info"],
|
||||
"user_stylesheets": kwargs.get("user_stylesheets"),
|
||||
}
|
||||
|
||||
|
||||
def executor_kwargs(test_type, server_config, cache_manager, run_info_data, **kwargs):
|
||||
|
@ -61,12 +64,8 @@ def env_options():
|
|||
"supports_debugger": True}
|
||||
|
||||
|
||||
def run_info_extras(**kwargs):
|
||||
return {"backend": kwargs["servo_backend"]}
|
||||
|
||||
|
||||
def update_properties():
|
||||
return ["debug", "os", "version", "processor", "bits", "backend"], None
|
||||
return ["debug", "os", "version", "processor", "bits"], None
|
||||
|
||||
|
||||
def make_hosts_file():
|
||||
|
@ -80,7 +79,7 @@ class ServoWebDriverBrowser(Browser):
|
|||
used_ports = set()
|
||||
|
||||
def __init__(self, logger, binary, debug_info=None, webdriver_host="127.0.0.1",
|
||||
user_stylesheets=None, render_backend="webrender"):
|
||||
user_stylesheets=None):
|
||||
Browser.__init__(self, logger)
|
||||
self.binary = binary
|
||||
self.webdriver_host = webdriver_host
|
||||
|
@ -90,7 +89,6 @@ class ServoWebDriverBrowser(Browser):
|
|||
self.hosts_path = make_hosts_file()
|
||||
self.command = None
|
||||
self.user_stylesheets = user_stylesheets if user_stylesheets else []
|
||||
self.render_backend = render_backend
|
||||
|
||||
def start(self):
|
||||
self.webdriver_port = get_free_port(4444, exclude=self.used_ports)
|
||||
|
@ -100,11 +98,15 @@ class ServoWebDriverBrowser(Browser):
|
|||
env["HOST_FILE"] = self.hosts_path
|
||||
env["RUST_BACKTRACE"] = "1"
|
||||
|
||||
debug_args, command = browser_command(self.binary,
|
||||
[render_arg(self.render_backend), "--hard-fail",
|
||||
"--webdriver", str(self.webdriver_port),
|
||||
"about:blank"],
|
||||
self.debug_info)
|
||||
debug_args, command = browser_command(
|
||||
self.binary,
|
||||
[
|
||||
"--hard-fail",
|
||||
"--webdriver", str(self.webdriver_port),
|
||||
"about:blank",
|
||||
],
|
||||
self.debug_info
|
||||
)
|
||||
|
||||
for stylesheet in self.user_stylesheets:
|
||||
command += ["--user-stylesheet", stylesheet]
|
||||
|
|
|
@ -38,6 +38,8 @@ def do_delayed_imports(logger, test_paths):
|
|||
|
||||
try:
|
||||
from tools.serve import serve
|
||||
except ImportError:
|
||||
from wpt_tools.serve import serve
|
||||
except ImportError:
|
||||
failed.append("serve")
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ from ..wpttest import WdspecResult, WdspecSubtestResult
|
|||
errors = None
|
||||
marionette = None
|
||||
pytestrunner = None
|
||||
webdriver = None
|
||||
|
||||
here = os.path.join(os.path.split(__file__)[0])
|
||||
|
||||
|
@ -270,24 +269,22 @@ class RemoteMarionetteProtocol(Protocol):
|
|||
def __init__(self, executor, browser):
|
||||
do_delayed_imports()
|
||||
Protocol.__init__(self, executor, browser)
|
||||
self.session = None
|
||||
self.webdriver_binary = executor.webdriver_binary
|
||||
self.marionette_port = browser.marionette_port
|
||||
self.capabilities = self.executor.capabilities
|
||||
self.session_config = None
|
||||
self.server = None
|
||||
|
||||
def setup(self, runner):
|
||||
"""Connect to browser via the Marionette HTTP server."""
|
||||
try:
|
||||
self.server = GeckoDriverServer(
|
||||
self.logger, self.marionette_port, binary=self.webdriver_binary)
|
||||
self.logger, binary=self.webdriver_binary)
|
||||
self.server.start(block=False)
|
||||
self.logger.info(
|
||||
"WebDriver HTTP server listening at %s" % self.server.url)
|
||||
|
||||
self.logger.info(
|
||||
"Establishing new WebDriver session with %s" % self.server.url)
|
||||
self.session = webdriver.Session(
|
||||
self.server.host, self.server.port, self.server.base_path)
|
||||
self.session_config = {"host": self.server.host,
|
||||
"port": self.server.port,
|
||||
"capabilities": self.capabilities}
|
||||
except Exception:
|
||||
self.logger.error(traceback.format_exc())
|
||||
self.executor.runner.send_message("init_failed")
|
||||
|
@ -295,11 +292,6 @@ class RemoteMarionetteProtocol(Protocol):
|
|||
self.executor.runner.send_message("init_succeeded")
|
||||
|
||||
def teardown(self):
|
||||
try:
|
||||
if self.session.session_id is not None:
|
||||
self.session.end()
|
||||
except Exception:
|
||||
pass
|
||||
if self.server is not None and self.server.is_alive:
|
||||
self.server.stop()
|
||||
|
||||
|
@ -560,12 +552,14 @@ class WdspecRun(object):
|
|||
|
||||
class MarionetteWdspecExecutor(WdspecExecutor):
|
||||
def __init__(self, browser, server_config, webdriver_binary,
|
||||
timeout_multiplier=1, close_after_done=True, debug_info=None):
|
||||
timeout_multiplier=1, close_after_done=True, debug_info=None,
|
||||
capabilities=None):
|
||||
self.do_delayed_imports()
|
||||
WdspecExecutor.__init__(self, browser, server_config,
|
||||
timeout_multiplier=timeout_multiplier,
|
||||
debug_info=debug_info)
|
||||
self.webdriver_binary = webdriver_binary
|
||||
self.capabilities = capabilities
|
||||
self.protocol = RemoteMarionetteProtocol(self, browser)
|
||||
|
||||
def is_alive(self):
|
||||
|
@ -578,7 +572,7 @@ class MarionetteWdspecExecutor(WdspecExecutor):
|
|||
timeout = test.timeout * self.timeout_multiplier + extra_timeout
|
||||
|
||||
success, data = WdspecRun(self.do_wdspec,
|
||||
self.protocol.session,
|
||||
self.protocol.session_config,
|
||||
test.abs_path,
|
||||
timeout).run()
|
||||
|
||||
|
@ -587,13 +581,14 @@ class MarionetteWdspecExecutor(WdspecExecutor):
|
|||
|
||||
return (test.result_cls(*data), [])
|
||||
|
||||
def do_wdspec(self, session, path, timeout):
|
||||
def do_wdspec(self, session_config, path, timeout):
|
||||
harness_result = ("OK", None)
|
||||
subtest_results = pytestrunner.run(
|
||||
path, session, self.server_url, timeout=timeout)
|
||||
subtest_results = pytestrunner.run(path,
|
||||
self.server_config,
|
||||
session_config,
|
||||
timeout=timeout)
|
||||
return (harness_result, subtest_results)
|
||||
|
||||
def do_delayed_imports(self):
|
||||
global pytestrunner, webdriver
|
||||
global pytestrunner
|
||||
from . import pytestrunner
|
||||
import webdriver
|
||||
|
|
|
@ -181,8 +181,9 @@ class SeleniumTestharnessExecutor(TestharnessExecutor):
|
|||
def is_alive(self):
|
||||
return self.protocol.is_alive()
|
||||
|
||||
def on_protocol_change(self, new_protocol):
|
||||
self.protocol.load_runner(new_protocol)
|
||||
def on_environment_change(self, new_environment):
|
||||
if new_environment["protocol"] != self.last_environment["protocol"]:
|
||||
self.protocol.load_runner(new_environment["protocol"])
|
||||
|
||||
def do_test(self, test):
|
||||
url = self.test_url(test)
|
||||
|
|
|
@ -30,15 +30,10 @@ from ..webdriver_server import ServoDriverServer
|
|||
from .executormarionette import WdspecRun
|
||||
|
||||
pytestrunner = None
|
||||
render_arg = None
|
||||
webdriver = None
|
||||
|
||||
extra_timeout = 5 # seconds
|
||||
|
||||
def do_delayed_imports():
|
||||
global render_arg
|
||||
from ..browsers.servo import render_arg
|
||||
|
||||
hosts_text = """127.0.0.1 web-platform.test
|
||||
127.0.0.1 www.web-platform.test
|
||||
127.0.0.1 www1.web-platform.test
|
||||
|
@ -80,8 +75,10 @@ class ServoTestharnessExecutor(ProcessTestExecutor):
|
|||
self.result_data = None
|
||||
self.result_flag = threading.Event()
|
||||
|
||||
args = [render_arg(self.browser.render_backend), "--hard-fail", "-u", "Servo/wptrunner",
|
||||
"-Z", "replace-surrogates", "-z", self.test_url(test)]
|
||||
args = [
|
||||
"--hard-fail", "-u", "Servo/wptrunner",
|
||||
"-Z", "replace-surrogates", "-z", self.test_url(test),
|
||||
]
|
||||
for stylesheet in self.browser.user_stylesheets:
|
||||
args += ["--user-stylesheet", stylesheet]
|
||||
for pref, value in test.environment.get('prefs', {}).iteritems():
|
||||
|
@ -213,9 +210,12 @@ class ServoRefTestExecutor(ProcessTestExecutor):
|
|||
with TempFilename(self.tempdir) as output_path:
|
||||
debug_args, command = browser_command(
|
||||
self.binary,
|
||||
[render_arg(self.browser.render_backend), "--hard-fail", "--exit",
|
||||
"-u", "Servo/wptrunner", "-Z", "disable-text-aa,load-webfonts-synchronously,replace-surrogates",
|
||||
"--output=%s" % output_path, full_url] + self.browser.binary_args,
|
||||
[
|
||||
"--hard-fail", "--exit",
|
||||
"-u", "Servo/wptrunner",
|
||||
"-Z", "disable-text-aa,load-webfonts-synchronously,replace-surrogates",
|
||||
"--output=%s" % output_path, full_url
|
||||
] + self.browser.binary_args,
|
||||
self.debug_info)
|
||||
|
||||
for stylesheet in self.browser.user_stylesheets:
|
||||
|
@ -295,7 +295,7 @@ class ServoWdspecProtocol(Protocol):
|
|||
|
||||
def setup(self, runner):
|
||||
try:
|
||||
self.server = ServoDriverServer(self.logger, binary=self.browser.binary, binary_args=self.browser.binary_args, render_backend=self.browser.render_backend)
|
||||
self.server = ServoDriverServer(self.logger, binary=self.browser.binary, binary_args=self.browser.binary_args)
|
||||
self.server.start(block=False)
|
||||
self.logger.info(
|
||||
"WebDriver HTTP server listening at %s" % self.server.url)
|
||||
|
|
|
@ -25,7 +25,7 @@ extra_timeout = 5
|
|||
|
||||
def do_delayed_imports():
|
||||
global webdriver
|
||||
from tools import webdriver
|
||||
import webdriver
|
||||
|
||||
|
||||
class ServoWebDriverProtocol(Protocol):
|
||||
|
|
|
@ -13,6 +13,8 @@ Usage::
|
|||
"""
|
||||
|
||||
import errno
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
|
@ -27,14 +29,13 @@ def do_delayed_imports():
|
|||
import pytest
|
||||
|
||||
|
||||
def run(path, session, url_getter, timeout=0):
|
||||
def run(path, server_config, session_config, timeout=0):
|
||||
"""Run Python test at ``path`` in pytest. The provided ``session``
|
||||
is exposed as a fixture available in the scope of the test functions.
|
||||
|
||||
:param path: Path to the test file.
|
||||
:param session: WebDriver session to expose.
|
||||
:param url_getter: Function to get server url from test environment, given
|
||||
a protocol.
|
||||
:param session_config: dictionary of host, port,capabilities parameters
|
||||
to pass through to the webdriver session
|
||||
:param timeout: Duration before interrupting potentially hanging
|
||||
tests. If 0, there is no timeout.
|
||||
|
||||
|
@ -46,10 +47,13 @@ def run(path, session, url_getter, timeout=0):
|
|||
do_delayed_imports()
|
||||
|
||||
recorder = SubtestResultRecorder()
|
||||
plugins = [recorder,
|
||||
fixtures,
|
||||
fixtures.Session(session),
|
||||
fixtures.Server(url_getter)]
|
||||
|
||||
os.environ["WD_HOST"] = session_config["host"]
|
||||
os.environ["WD_PORT"] = str(session_config["port"])
|
||||
os.environ["WD_CAPABILITIES"] = json.dumps(session_config["capabilities"])
|
||||
os.environ["WD_SERVER_CONFIG"] = json.dumps(server_config)
|
||||
|
||||
plugins = [recorder]
|
||||
|
||||
# TODO(ato): Deal with timeouts
|
||||
|
||||
|
@ -92,7 +96,9 @@ class SubtestResultRecorder(object):
|
|||
self.record(report.nodeid, "ERROR", message, report.longrepr)
|
||||
|
||||
def record_skip(self, report):
|
||||
self.record(report.nodeid, "PASS")
|
||||
self.record(report.nodeid, "ERROR",
|
||||
"In-test skip decorators are disallowed, "
|
||||
"please use WPT metadata to ignore tests.")
|
||||
|
||||
def record(self, test, status, message=None, stack=None):
|
||||
if stack is not None:
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
callback = arguments[arguments.length - 1];
|
||||
|
||||
function check_done() {
|
||||
if (!document.body.classList.contains('reftest-wait')) {
|
||||
if (!document.documentElement.classList.contains('reftest-wait')) {
|
||||
callback();
|
||||
} else {
|
||||
setTimeout(check_done, 50);
|
||||
|
|
|
@ -237,18 +237,16 @@ def get_manifest(metadata_root, test_path, url_base, run_info):
|
|||
except IOError:
|
||||
return None
|
||||
|
||||
def get_dir_manifest(metadata_root, path, run_info):
|
||||
def get_dir_manifest(path, run_info):
|
||||
"""Get the ExpectedManifest for a particular test path, or None if there is no
|
||||
metadata stored for that test path.
|
||||
|
||||
:param metadata_root: Absolute path to the root of the metadata directory
|
||||
:param path: Path to the ini file relative to the metadata root
|
||||
:param path: Full path to the ini file
|
||||
:param run_info: Dictionary of properties of the test run for which the expectation
|
||||
values should be computed.
|
||||
"""
|
||||
full_path = os.path.join(metadata_root, path)
|
||||
try:
|
||||
with open(full_path) as f:
|
||||
with open(path) as f:
|
||||
return static.compile(f,
|
||||
run_info,
|
||||
data_cls_getter=lambda x,y: DirectoryManifest)
|
||||
|
|
|
@ -496,10 +496,10 @@ class TestLoader(object):
|
|||
rv = []
|
||||
path_parts = os.path.dirname(test_path).split(os.path.sep)
|
||||
for i in xrange(1,len(path_parts) + 1):
|
||||
path = os.path.join(os.path.sep.join(path_parts[:i]), "__dir__.ini")
|
||||
path = os.path.join(metadata_path, os.path.sep.join(path_parts[:i]), "__dir__.ini")
|
||||
if path not in self.directory_manifests:
|
||||
self.directory_manifests[path] = manifestexpected.get_dir_manifest(
|
||||
metadata_path, path, self.run_info)
|
||||
self.directory_manifests[path] = manifestexpected.get_dir_manifest(path,
|
||||
self.run_info)
|
||||
manifest = self.directory_manifests[path]
|
||||
if manifest is not None:
|
||||
rv.append(manifest)
|
||||
|
|
|
@ -24,16 +24,19 @@ class MockTest(object):
|
|||
|
||||
def make_mock_manifest(*items):
|
||||
rv = []
|
||||
for dir_path, num_tests in items:
|
||||
for test_type, dir_path, num_tests in items:
|
||||
for i in range(num_tests):
|
||||
rv.append((dir_path + "/%i.test" % i, set([MockTest(i)])))
|
||||
rv.append((test_type,
|
||||
dir_path + "/%i.test" % i,
|
||||
set([MockTest(i)])))
|
||||
return rv
|
||||
|
||||
|
||||
class TestEqualTimeChunker(unittest.TestCase):
|
||||
|
||||
def test_include_all(self):
|
||||
tests = make_mock_manifest(("a", 10), ("a/b", 10), ("c", 10))
|
||||
tests = make_mock_manifest(("test", "a", 10), ("test", "a/b", 10),
|
||||
("test", "c", 10))
|
||||
|
||||
chunk_1 = list(EqualTimeChunker(3, 1)(tests))
|
||||
chunk_2 = list(EqualTimeChunker(3, 2)(tests))
|
||||
|
@ -44,7 +47,8 @@ class TestEqualTimeChunker(unittest.TestCase):
|
|||
self.assertEquals(tests[20:], chunk_3)
|
||||
|
||||
def test_include_all_1(self):
|
||||
tests = make_mock_manifest(("a", 5), ("a/b", 5), ("c", 10), ("d", 10))
|
||||
tests = make_mock_manifest(("test", "a", 5), ("test", "a/b", 5),
|
||||
("test", "c", 10), ("test", "d", 10))
|
||||
|
||||
chunk_1 = list(EqualTimeChunker(3, 1)(tests))
|
||||
chunk_2 = list(EqualTimeChunker(3, 2)(tests))
|
||||
|
@ -55,7 +59,8 @@ class TestEqualTimeChunker(unittest.TestCase):
|
|||
self.assertEquals(tests[20:], chunk_3)
|
||||
|
||||
def test_long(self):
|
||||
tests = make_mock_manifest(("a", 100), ("a/b", 1), ("c", 1))
|
||||
tests = make_mock_manifest(("test", "a", 100), ("test", "a/b", 1),
|
||||
("test", "c", 1))
|
||||
|
||||
chunk_1 = list(EqualTimeChunker(3, 1)(tests))
|
||||
chunk_2 = list(EqualTimeChunker(3, 2)(tests))
|
||||
|
@ -66,7 +71,8 @@ class TestEqualTimeChunker(unittest.TestCase):
|
|||
self.assertEquals(tests[101:102], chunk_3)
|
||||
|
||||
def test_long_1(self):
|
||||
tests = make_mock_manifest(("a", 1), ("a/b", 100), ("c", 1))
|
||||
tests = make_mock_manifest(("test", "a", 1), ("test", "a/b", 100),
|
||||
("test", "c", 1))
|
||||
|
||||
chunk_1 = list(EqualTimeChunker(3, 1)(tests))
|
||||
chunk_2 = list(EqualTimeChunker(3, 2)(tests))
|
||||
|
@ -78,7 +84,8 @@ class TestEqualTimeChunker(unittest.TestCase):
|
|||
|
||||
def test_too_few_dirs(self):
|
||||
with self.assertRaises(ValueError):
|
||||
tests = make_mock_manifest(("a", 1), ("a/b", 100), ("c", 1))
|
||||
tests = make_mock_manifest(("test", "a", 1), ("test", "a/b", 100),
|
||||
("test", "c", 1))
|
||||
list(EqualTimeChunker(4, 1)(tests))
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ skip: true
|
|||
"""
|
||||
|
||||
def test_filter_unicode():
|
||||
tests = make_mock_manifest(("a", 10), ("a/b", 10), ("c", 10))
|
||||
tests = make_mock_manifest(("test", "a", 10), ("test", "a/b", 10),
|
||||
("test", "c", 10))
|
||||
|
||||
with tempfile.NamedTemporaryFile("wb", suffix=".ini") as f:
|
||||
f.write(include_ini.encode('utf-8'))
|
||||
|
|
|
@ -15,7 +15,10 @@ from state import State
|
|||
|
||||
def setup_paths(sync_path):
|
||||
sys.path.insert(0, os.path.abspath(sync_path))
|
||||
from tools import localpaths
|
||||
try:
|
||||
from tools import localpaths
|
||||
except ImportError:
|
||||
from wpt_tools import localpaths
|
||||
|
||||
class LoadConfig(Step):
|
||||
"""Step for loading configuration from the ini file and kwargs."""
|
||||
|
|
|
@ -28,6 +28,10 @@ class WebDriverServer(object):
|
|||
|
||||
def __init__(self, logger, binary, host="127.0.0.1", port=None,
|
||||
base_path="", env=None):
|
||||
if binary is None:
|
||||
raise ValueError("WebDriver server binary must be given "
|
||||
"to --webdriver-binary argument")
|
||||
|
||||
self.logger = logger
|
||||
self.binary = binary
|
||||
self.host = host
|
||||
|
@ -149,7 +153,7 @@ class EdgeDriverServer(WebDriverServer):
|
|||
|
||||
|
||||
class GeckoDriverServer(WebDriverServer):
|
||||
def __init__(self, logger, marionette_port=2828, binary="wires",
|
||||
def __init__(self, logger, marionette_port=2828, binary="geckodriver",
|
||||
host="127.0.0.1", port=None):
|
||||
env = os.environ.copy()
|
||||
env["RUST_BACKTRACE"] = "1"
|
||||
|
@ -158,19 +162,17 @@ class GeckoDriverServer(WebDriverServer):
|
|||
|
||||
def make_command(self):
|
||||
return [self.binary,
|
||||
"--connect-existing",
|
||||
"--marionette-port", str(self.marionette_port),
|
||||
"--host", self.host,
|
||||
"--port", str(self.port)]
|
||||
|
||||
|
||||
class ServoDriverServer(WebDriverServer):
|
||||
def __init__(self, logger, binary="servo", binary_args=None, host="127.0.0.1", port=None, render_backend=None):
|
||||
def __init__(self, logger, binary="servo", binary_args=None, host="127.0.0.1", port=None):
|
||||
env = os.environ.copy()
|
||||
env["RUST_BACKTRACE"] = "1"
|
||||
WebDriverServer.__init__(self, logger, binary, host=host, port=port, env=env)
|
||||
self.binary_args = binary_args
|
||||
self.render_backend = render_backend
|
||||
|
||||
def make_command(self):
|
||||
command = [self.binary,
|
||||
|
@ -179,10 +181,6 @@ class ServoDriverServer(WebDriverServer):
|
|||
"--headless"]
|
||||
if self.binary_args:
|
||||
command += self.binary_args
|
||||
if self.render_backend == "cpu":
|
||||
command += ["--cpu"]
|
||||
elif self.render_backend == "webrender":
|
||||
command += ["--webrender"]
|
||||
return command
|
||||
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ scheme host and port.""")
|
|||
type=abs_path, help="Binary to run tests against")
|
||||
config_group.add_argument('--binary-arg',
|
||||
default=[], action="append", dest="binary_args",
|
||||
help="Extra argument for the binary (servo)")
|
||||
help="Extra argument for the binary")
|
||||
config_group.add_argument("--webdriver-binary", action="store", metavar="BINARY",
|
||||
type=abs_path, help="WebDriver server binary to use")
|
||||
|
||||
|
@ -180,9 +180,6 @@ scheme host and port.""")
|
|||
servo_group.add_argument("--user-stylesheet",
|
||||
default=[], action="append", dest="user_stylesheets",
|
||||
help="Inject a user CSS stylesheet into every test.")
|
||||
servo_group.add_argument("--servo-backend",
|
||||
default="webrender", choices=["cpu", "webrender"],
|
||||
help="Rendering backend to use with Servo.")
|
||||
|
||||
|
||||
parser.add_argument("test_list", nargs="*",
|
||||
|
|
|
@ -15,6 +15,7 @@ import wptcommandline
|
|||
import wptlogging
|
||||
import wpttest
|
||||
from testrunner import ManagerGroup
|
||||
from browsers.base import NullBrowser
|
||||
|
||||
here = os.path.split(__file__)[0]
|
||||
|
||||
|
@ -115,7 +116,7 @@ def run_tests(config, test_paths, product, **kwargs):
|
|||
env.do_delayed_imports(logger, test_paths)
|
||||
|
||||
(check_args,
|
||||
browser_cls, get_browser_kwargs,
|
||||
target_browser_cls, get_browser_kwargs,
|
||||
executor_classes, get_executor_kwargs,
|
||||
env_options, run_info_extras) = products.load_product(config, product)
|
||||
|
||||
|
@ -177,6 +178,16 @@ def run_tests(config, test_paths, product, **kwargs):
|
|||
for test_type in kwargs["test_types"]:
|
||||
logger.info("Running %s tests" % test_type)
|
||||
|
||||
# WebDriver tests may create and destroy multiple browser
|
||||
# processes as part of their expected behavior. These
|
||||
# processes are managed by a WebDriver server binary. This
|
||||
# obviates the need for wptrunner to provide a browser, so
|
||||
# the NullBrowser is used in place of the "target" browser
|
||||
if test_type == "wdspec":
|
||||
browser_cls = NullBrowser
|
||||
else:
|
||||
browser_cls = target_browser_cls
|
||||
|
||||
for test in test_loader.disabled_tests[test_type]:
|
||||
logger.test_start(test.id)
|
||||
logger.test_end(test.id, status="SKIP")
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
[Blob-XHR-revoke.html]
|
||||
type: testharness
|
||||
[Revoke blob URL before open(), network error (after send())]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
[event-dispatch-active-flag.html]
|
||||
type: testharness
|
||||
[Transactions are active during success handlers]
|
||||
expected: FAIL
|
||||
|
||||
[Transactions are active during success listeners]
|
||||
expected: FAIL
|
||||
|
||||
[Transactions are active during error handlers]
|
||||
expected: FAIL
|
||||
|
||||
[Transactions are active during error listeners]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
[fire-error-event-exception.html]
|
||||
type: testharness
|
||||
disabled:
|
||||
if not debug and (os == "win") and (version == "6.2.9200"): https://bugzilla.mozilla.org/show_bug.cgi?id=1347505
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
[idbcursor-update-exception-order.htm]
|
||||
type: testharness
|
||||
disabled: if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1336639
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
[idbobjectstore-deleteIndex-exception-order.html]
|
||||
type: testharness
|
||||
disabled: if os == "win": https://bugzilla.mozilla.org/show_bug.cgi?id=1336639
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
[keygenerator-explicit.html]
|
||||
type: testharness
|
||||
expected:
|
||||
if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): CRASH
|
||||
if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): CRASH
|
||||
if debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): CRASH
|
||||
if debug and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): CRASH
|
||||
if debug and e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): CRASH
|
||||
if debug and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): CRASH
|
||||
if debug and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): CRASH
|
||||
if debug and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): CRASH
|
||||
if debug and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): CRASH
|
||||
[Key generator vs. explicit key 63 bits]
|
||||
expected: FAIL
|
||||
|
||||
[Key generator vs. explicit key 64 bits]
|
||||
expected: FAIL
|
||||
|
||||
[Key generator vs. explicit key greater than 64 bits, but still finite]
|
||||
expected: FAIL
|
||||
|
||||
[Key generator vs. explicit key equal to Infinity]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
[transaction-deactivation-timing.html]
|
||||
type: testharness
|
||||
[New transactions are not deactivated until after the microtask checkpoint]
|
||||
expected: FAIL
|
||||
|
||||
[New transactions from microtask are still active through the microtask checkpoint]
|
||||
expected: FAIL
|
||||
|
||||
[Deactivation of new transactions happens at end of invocation]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
[upgrade-transaction-deactivation-timing.html]
|
||||
type: testharness
|
||||
[Upgrade transactions are active in upgradeneeded callback and microtasks]
|
||||
expected: FAIL
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -18,3 +18,6 @@
|
|||
[XHR method UNICORN with charset text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[XHR method GET with MIME type image/png]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
[getallresponseheaders-cl.htm]
|
||||
type: testharness
|
||||
[Casing of known headers]
|
||||
expected: FAIL
|
||||
|
||||
[Casing of known headers 1]
|
||||
expected: FAIL
|
||||
|
||||
[Casing of known headers 2]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
[getallresponseheaders.htm]
|
||||
type: testharness
|
||||
[XMLHttpRequest: getAllResponseHeaders() 1]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
[open-url-redirected-worker-origin.htm]
|
||||
type: testharness
|
||||
[Referer header]
|
||||
expected: FAIL
|
||||
|
||||
[Origin header]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
[open-url-worker-origin.htm]
|
||||
type: testharness
|
||||
[Referer header]
|
||||
expected: FAIL
|
||||
|
||||
[Origin header]
|
||||
expected: FAIL
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче