зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to autoland a=merge
This commit is contained in:
Коммит
34df20e0f1
|
@ -30,8 +30,8 @@
|
|||
getService(SpecialPowers.Ci.nsIAccessibilityService);
|
||||
|
||||
var treecol = document.getElementById("col");
|
||||
var x = treecol.boxObject.screenX;
|
||||
var y = treecol.boxObject.screenY;
|
||||
var x = treecol.screenX;
|
||||
var y = treecol.screenY;
|
||||
|
||||
var tree = document.getElementById("tree");
|
||||
addA11yLoadEvent(accService, () => {
|
||||
|
|
|
@ -4645,7 +4645,7 @@ var XULBrowserWindow = {
|
|||
elt.label = tooltip;
|
||||
elt.style.direction = direction;
|
||||
|
||||
elt.openPopupAtScreen(browser.boxObject.screenX + x, browser.boxObject.screenY + y, false, null);
|
||||
elt.openPopupAtScreen(browser.screenX + x, browser.screenY + y, false, null);
|
||||
},
|
||||
|
||||
hideTooltip() {
|
||||
|
|
|
@ -630,14 +630,14 @@
|
|||
|
||||
let leftTab = tabs[0];
|
||||
let rightTab = tabs[tabs.length - 1];
|
||||
let rightMovingTabScreenX = movingTabs[movingTabs.length - 1].boxObject.screenX;
|
||||
let leftMovingTabScreenX = movingTabs[0].boxObject.screenX;
|
||||
let rightMovingTabScreenX = movingTabs[movingTabs.length - 1].screenX;
|
||||
let leftMovingTabScreenX = movingTabs[0].screenX;
|
||||
let translateX = screenX - draggedTab._dragData.screenX;
|
||||
if (!pinned) {
|
||||
translateX += this.arrowScrollbox.scrollbox.scrollLeft - draggedTab._dragData.scrollX;
|
||||
}
|
||||
let leftBound = leftTab.boxObject.screenX - leftMovingTabScreenX;
|
||||
let rightBound = (rightTab.boxObject.screenX + rightTab.boxObject.width) -
|
||||
let leftBound = leftTab.screenX - leftMovingTabScreenX;
|
||||
let rightBound = (rightTab.screenX + rightTab.boxObject.width) -
|
||||
(rightMovingTabScreenX + tabWidth);
|
||||
translateX = Math.min(Math.max(translateX, leftBound), rightBound);
|
||||
|
||||
|
@ -672,11 +672,10 @@
|
|||
let mid = Math.floor((low + high) / 2);
|
||||
if (tabs[mid] == draggedTab && ++mid > high)
|
||||
break;
|
||||
let boxObject = tabs[mid].boxObject;
|
||||
screenX = boxObject.screenX + getTabShift(tabs[mid], oldIndex);
|
||||
screenX = tabs[mid].screenX + getTabShift(tabs[mid], oldIndex);
|
||||
if (screenX > tabCenter) {
|
||||
high = mid - 1;
|
||||
} else if (screenX + boxObject.width < tabCenter) {
|
||||
} else if (screenX + tabs[mid].getBoundingClientRect().width < tabCenter) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
newIndex = tabs[mid]._tPos;
|
||||
|
@ -998,8 +997,8 @@
|
|||
let tab = event.target.localName == "tab" ? event.target : null;
|
||||
if (tab && isLink) {
|
||||
let boxObject = tab.boxObject;
|
||||
if (event.screenX < boxObject.screenX + boxObject.width * .25 ||
|
||||
event.screenX > boxObject.screenX + boxObject.width * .75)
|
||||
if (event.screenX < tab.screenX + boxObject.width * .25 ||
|
||||
event.screenX > tab.screenX + boxObject.width * .75)
|
||||
return null;
|
||||
}
|
||||
return tab;
|
||||
|
@ -1014,11 +1013,11 @@
|
|||
var tab = this._getDragTargetTab(event, isLink);
|
||||
if (!RTL_UI) {
|
||||
for (let i = tab ? tab._tPos : 0; i < tabs.length; i++)
|
||||
if (event.screenX < tabs[i].boxObject.screenX + tabs[i].boxObject.width / 2)
|
||||
if (event.screenX < tabs[i].screenX + tabs[i].boxObject.width / 2)
|
||||
return i;
|
||||
} else {
|
||||
for (let i = tab ? tab._tPos : 0; i < tabs.length; i++)
|
||||
if (event.screenX > tabs[i].boxObject.screenX + tabs[i].boxObject.width / 2)
|
||||
if (event.screenX > tabs[i].screenX + tabs[i].boxObject.width / 2)
|
||||
return i;
|
||||
}
|
||||
return tabs.length;
|
||||
|
|
|
@ -1057,9 +1057,11 @@ var PanelMultiView = class extends AssociatedToNode {
|
|||
// view based on the space that will be available. We cannot just use
|
||||
// window.screen.availTop and availHeight because these may return an
|
||||
// incorrect value when the window spans multiple screens.
|
||||
let anchorBox = this._panel.anchorNode.boxObject;
|
||||
let screen = this._screenManager.screenForRect(anchorBox.screenX,
|
||||
anchorBox.screenY,
|
||||
let anchor = this._panel.anchorNode;
|
||||
let anchorBox = anchor.boxObject;
|
||||
|
||||
let screen = this._screenManager.screenForRect(anchor.screenX,
|
||||
anchor.screenY,
|
||||
anchorBox.width,
|
||||
anchorBox.height);
|
||||
let availTop = {}, availHeight = {};
|
||||
|
@ -1070,9 +1072,9 @@ var PanelMultiView = class extends AssociatedToNode {
|
|||
// based on whether the panel will open towards the top or the bottom.
|
||||
let maxHeight;
|
||||
if (this._panel.alignmentPosition.startsWith("before_")) {
|
||||
maxHeight = anchorBox.screenY - cssAvailTop;
|
||||
maxHeight = anchor.screenY - cssAvailTop;
|
||||
} else {
|
||||
let anchorScreenBottom = anchorBox.screenY + anchorBox.height;
|
||||
let anchorScreenBottom = anchor.screenY + anchorBox.height;
|
||||
let cssAvailHeight = availHeight.value / screen.defaultCSSScaleFactor;
|
||||
maxHeight = cssAvailTop + cssAvailHeight - anchorScreenBottom;
|
||||
}
|
||||
|
|
|
@ -68,13 +68,12 @@ add_task(async function testPopupSelectPopup() {
|
|||
return {left: r.left, bottom: r.bottom};
|
||||
});
|
||||
|
||||
let {boxObject} = browser;
|
||||
let popupRect = selectPopup.getOuterScreenRect();
|
||||
|
||||
is(Math.floor(boxObject.screenX + elemRect.left), popupRect.left,
|
||||
is(Math.floor(browser.screenX + elemRect.left), popupRect.left,
|
||||
"Select popup has the correct x origin");
|
||||
|
||||
is(Math.floor(boxObject.screenY + elemRect.bottom), popupRect.top,
|
||||
is(Math.floor(browser.screenY + elemRect.bottom), popupRect.top,
|
||||
"Select popup has the correct y origin");
|
||||
|
||||
// Close the select popup before proceeding to the next test.
|
||||
|
|
|
@ -438,10 +438,10 @@
|
|||
let newMarginTop = 0;
|
||||
if (scrollDir == 0) {
|
||||
let elt = this.firstElementChild;
|
||||
while (elt && event.screenY > elt.boxObject.screenY +
|
||||
while (elt && event.screenY > elt.screenY +
|
||||
elt.boxObject.height / 2)
|
||||
elt = elt.nextElementSibling;
|
||||
newMarginTop = elt ? elt.boxObject.screenY - scrollbox.screenY :
|
||||
newMarginTop = elt ? elt.screenY - this._scrollBox.screenY :
|
||||
scrollbox.height;
|
||||
} else if (scrollDir == 1)
|
||||
newMarginTop = scrollbox.height;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
[
|
||||
{
|
||||
"version": "Visual Studio 2017 15.4.2 / SDK 10.0.15063.0",
|
||||
"digest": "18700889e6b5e81613b9cf57ce4e0d46a6ee45bb4c5c33bae2604a5275326128775b8a032a1eb178c5db973746d565340c4e36d98375789e1d5bd836ab16ba58",
|
||||
"size": 303146863,
|
||||
"version": "Visual Studio 2017 15.8.4 / SDK 10.0.17134.0",
|
||||
"digest": "ecf1e03f6f98f86775059a43f9e7dc7e326f6643d7c08962d9f614e4f5a65b1ca63fa1cfeb0f1a3c2474bf0d4318dda960b378beb2a44ecf8a91111207f4ece5",
|
||||
"size": 349626009,
|
||||
"algorithm": "sha512",
|
||||
"filename": "vs2017_15.4.2.zip",
|
||||
"filename": "vs2017_15.8.4.zip",
|
||||
"unpack": true
|
||||
},
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
[
|
||||
{
|
||||
"version": "Visual Studio 2017 15.4.2 / SDK 10.0.15063.0",
|
||||
"size": 303146863,
|
||||
"digest": "18700889e6b5e81613b9cf57ce4e0d46a6ee45bb4c5c33bae2604a5275326128775b8a032a1eb178c5db973746d565340c4e36d98375789e1d5bd836ab16ba58",
|
||||
"version": "Visual Studio 2017 15.8.4 / SDK 10.0.17134.0",
|
||||
"digest": "ecf1e03f6f98f86775059a43f9e7dc7e326f6643d7c08962d9f614e4f5a65b1ca63fa1cfeb0f1a3c2474bf0d4318dda960b378beb2a44ecf8a91111207f4ece5",
|
||||
"size": 349626009,
|
||||
"algorithm": "sha512",
|
||||
"filename": "vs2017_15.4.2.zip",
|
||||
"filename": "vs2017_15.8.4.zip",
|
||||
"unpack": true
|
||||
},
|
||||
{
|
||||
|
@ -23,4 +23,4 @@
|
|||
"filename": "git.zip",
|
||||
"unpack": true
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
[
|
||||
{
|
||||
"version": "Visual Studio 2017 15.4.2 / SDK 10.0.15063.0",
|
||||
"size": 303146863,
|
||||
"digest": "18700889e6b5e81613b9cf57ce4e0d46a6ee45bb4c5c33bae2604a5275326128775b8a032a1eb178c5db973746d565340c4e36d98375789e1d5bd836ab16ba58",
|
||||
"version": "Visual Studio 2017 15.8.4 / SDK 10.0.17134.0",
|
||||
"digest": "ecf1e03f6f98f86775059a43f9e7dc7e326f6643d7c08962d9f614e4f5a65b1ca63fa1cfeb0f1a3c2474bf0d4318dda960b378beb2a44ecf8a91111207f4ece5",
|
||||
"size": 349626009,
|
||||
"algorithm": "sha512",
|
||||
"filename": "vs2017_15.4.2.zip",
|
||||
"filename": "vs2017_15.8.4.zip",
|
||||
"unpack": true
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,14 +9,14 @@ add_task(async function() {
|
|||
.QueryInterface(Ci.nsIBaseWindow)
|
||||
.devicePixelsPerDesktopPixel;
|
||||
let {bounds, rects} = TestRunner._findBoundingBox(["#tabbrowser-tabs"]);
|
||||
let element = document.querySelector("#tabbrowser-tabs");
|
||||
let tabBar = element.ownerDocument.getBoxObjectFor(element);
|
||||
let tabBar = document.querySelector("#tabbrowser-tabs");
|
||||
let tabBarRect = tabBar.getBoundingClientRect();
|
||||
|
||||
// Calculate expected values
|
||||
let expectedLeft = scale * (tabBar.screenX - TestRunner.croppingPadding);
|
||||
let expectedTop = scale * (tabBar.screenY - TestRunner.croppingPadding);
|
||||
let expectedRight = scale * (tabBar.width + TestRunner.croppingPadding * 2) + expectedLeft;
|
||||
let expectedBottom = scale * (tabBar.height + TestRunner.croppingPadding * 2) + expectedTop;
|
||||
let expectedRight = scale * (tabBarRect.width + TestRunner.croppingPadding * 2) + expectedLeft;
|
||||
let expectedBottom = scale * (tabBarRect.height + TestRunner.croppingPadding * 2) + expectedTop;
|
||||
|
||||
// Calculate browser region
|
||||
let windowLeft = window.screenX * scale;
|
||||
|
@ -48,21 +48,21 @@ add_task(async function() {
|
|||
bounds = result.bounds;
|
||||
rects = result.rects;
|
||||
|
||||
element = document.querySelector("#TabsToolbar");
|
||||
let tabToolbar = element.ownerDocument.getBoxObjectFor(element);
|
||||
element = document.querySelector("#forward-button");
|
||||
let fButton = element.ownerDocument.getBoxObjectFor(element);
|
||||
let tabToolbar = document.querySelector("#TabsToolbar");
|
||||
let tabToolbarRect = tabToolbar.getBoundingClientRect();
|
||||
let fButton = document.querySelector("#forward-button");
|
||||
let fButtonRect = fButton.getBoundingClientRect();
|
||||
|
||||
// Calculate expected values
|
||||
expectedLeft = scale * (Math.min(tabToolbar.screenX, fButton.screenX)
|
||||
- TestRunner.croppingPadding);
|
||||
expectedTop = scale * (Math.min(tabToolbar.screenY, fButton.screenY)
|
||||
- TestRunner.croppingPadding);
|
||||
expectedRight = scale * (Math.max(tabToolbar.width + tabToolbar.screenX,
|
||||
fButton.width + fButton.screenX)
|
||||
expectedRight = scale * (Math.max(tabToolbarRect.width + tabToolbar.screenX,
|
||||
fButtonRect.width + fButton.screenX)
|
||||
+ TestRunner.croppingPadding);
|
||||
expectedBottom = scale * (Math.max(tabToolbar.height + tabToolbar.screenY,
|
||||
fButton.height + fButton.screenY)
|
||||
expectedBottom = scale * (Math.max(tabToolbarRect.height + tabToolbar.screenY,
|
||||
fButtonRect.height + fButton.screenY)
|
||||
+ TestRunner.croppingPadding );
|
||||
|
||||
// Adjust values based on browser window
|
||||
|
@ -81,13 +81,13 @@ add_task(async function() {
|
|||
is(rects[0].left, Math.max(scale * (fButton.screenX - TestRunner.croppingPadding), windowLeft),
|
||||
"Checking single selector's left position when _findBoundingBox has multiple selectors");
|
||||
// Check single selector's right position
|
||||
is(rects[0].right, Math.min(scale * (fButton.width + fButton.screenX + TestRunner.croppingPadding), windowRight),
|
||||
is(rects[0].right, Math.min(scale * (fButtonRect.width + fButton.screenX + TestRunner.croppingPadding), windowRight),
|
||||
"Checking single selector's right position when _findBoundingBox has multiple selectors");
|
||||
// Check single selector's top position
|
||||
is(rects[0].top, Math.max(scale * (fButton.screenY - TestRunner.croppingPadding), windowTop),
|
||||
"Checking single selector's top position when _findBoundingBox has multiple selectors");
|
||||
// Check single selector's bottom position
|
||||
is(rects[0].bottom, Math.min(scale * (fButton.height + fButton.screenY + TestRunner.croppingPadding), windowBottom),
|
||||
is(rects[0].bottom, Math.min(scale * (fButtonRect.height + fButton.screenY + TestRunner.croppingPadding), windowBottom),
|
||||
"Checking single selector's bottom position when _findBoundingBox has multiple selectors");
|
||||
|
||||
// Check that nonexistent selectors throws an exception
|
||||
|
|
|
@ -257,9 +257,9 @@ var TestRunner = {
|
|||
}
|
||||
|
||||
// Calculate box region, convert to Rect
|
||||
let box = element.ownerDocument.getBoxObjectFor(element);
|
||||
let rect = new Rect(box.screenX * scale, box.screenY * scale,
|
||||
box.width * scale, box.height * scale);
|
||||
let elementRect = element.getBoundingClientRect();
|
||||
let rect = new Rect(element.screenX * scale, element.screenY * scale,
|
||||
elementRect.width * scale, elementRect.height * scale);
|
||||
rect.inflateFixed(this.croppingPadding * scale);
|
||||
rect.left = Math.max(rect.left, windowLeft);
|
||||
rect.top = Math.max(rect.top, windowTop);
|
||||
|
|
|
@ -125,6 +125,8 @@ function addMessage(state, filtersState, prefsState, newMessage) {
|
|||
newMessage.groupId = currentGroup;
|
||||
newMessage.indent = parentGroups.length;
|
||||
|
||||
ensureExecutionPoint(state, newMessage);
|
||||
|
||||
const addedMessage = Object.freeze(newMessage);
|
||||
state.messagesById.set(newMessage.id, addedMessage);
|
||||
|
||||
|
@ -148,6 +150,7 @@ function addMessage(state, filtersState, prefsState, newMessage) {
|
|||
|
||||
if (visible) {
|
||||
state.visibleMessages.push(newMessage.id);
|
||||
maybeSortVisibleMessages(state);
|
||||
} else if (DEFAULT_FILTERS.includes(cause)) {
|
||||
state.filteredMessagesCount.global++;
|
||||
state.filteredMessagesCount[cause]++;
|
||||
|
@ -365,11 +368,14 @@ function messages(state = MessageState(), action, filtersState, prefsState) {
|
|||
}
|
||||
});
|
||||
|
||||
return {
|
||||
const filteredState = {
|
||||
...state,
|
||||
visibleMessages: messagesToShow,
|
||||
filteredMessagesCount: filtered,
|
||||
};
|
||||
maybeSortVisibleMessages(filteredState);
|
||||
|
||||
return filteredState;
|
||||
}
|
||||
|
||||
return state;
|
||||
|
@ -939,4 +945,77 @@ function getDefaultFiltersCounter() {
|
|||
return count;
|
||||
}
|
||||
|
||||
// Make sure that message has an execution point which can be used for sorting
|
||||
// if other messages with real execution points appear later.
|
||||
function ensureExecutionPoint(state, newMessage) {
|
||||
if (newMessage.executionPoint) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add a lastExecutionPoint property which will place this message immediately
|
||||
// after the last visible one when sorting.
|
||||
let point = { progress: 0 }, messageCount = 1;
|
||||
if (state.visibleMessages.length) {
|
||||
const lastId = state.visibleMessages[state.visibleMessages.length - 1];
|
||||
const lastMessage = state.messagesById.get(lastId);
|
||||
if (lastMessage.executionPoint) {
|
||||
point = lastMessage.executionPoint;
|
||||
} else {
|
||||
point = lastMessage.lastExecutionPoint.point;
|
||||
messageCount = lastMessage.lastExecutionPoint.messageCount + 1;
|
||||
}
|
||||
}
|
||||
newMessage.lastExecutionPoint = { point, messageCount };
|
||||
}
|
||||
|
||||
function messageExecutionPoint(state, id) {
|
||||
const message = state.messagesById.get(id);
|
||||
return message.executionPoint || message.lastExecutionPoint.point;
|
||||
}
|
||||
|
||||
function messageCountSinceLastExecutionPoint(state, id) {
|
||||
const message = state.messagesById.get(id);
|
||||
return message.lastExecutionPoint ? message.lastExecutionPoint.messageCount : 0;
|
||||
}
|
||||
|
||||
function maybeSortVisibleMessages(state) {
|
||||
// When using log points while replaying, messages can be added out of order
|
||||
// with respect to how they originally executed. Use the execution point
|
||||
// information in the messages to sort visible messages according to how
|
||||
// they originally executed. This isn't necessary if we haven't seen any
|
||||
// messages with progress counters, as either we aren't replaying or haven't
|
||||
// seen any messages yet.
|
||||
if (state.replayProgressMessages.size) {
|
||||
state.visibleMessages.sort((a, b) => {
|
||||
const pointA = messageExecutionPoint(state, a);
|
||||
const pointB = messageExecutionPoint(state, b);
|
||||
if (pointA.progress != pointB.progress) {
|
||||
return pointA.progress > pointB.progress;
|
||||
}
|
||||
// Execution points without a progress counter predate execution points
|
||||
// with one, i.e. a console.log() call (which bumps the progress value)
|
||||
// predates the code that runs afterward.
|
||||
if ("frameIndex" in pointA != "frameIndex" in pointB) {
|
||||
return "frameIndex" in pointA;
|
||||
}
|
||||
// Deeper frames predate shallower frames, if the progress counter is the
|
||||
// same. We bump the progress counter when pushing frames, but not when
|
||||
// popping them.
|
||||
if (pointA.frameIndex != pointB.frameIndex) {
|
||||
return pointA.frameIndex < pointB.frameIndex;
|
||||
}
|
||||
// Earlier script locations predate later script locations.
|
||||
if (pointA.offset != pointB.offset) {
|
||||
return pointA.offset > pointB.offset;
|
||||
}
|
||||
// When messages don't have their own execution point, they can still be
|
||||
// distinguished by the number of messages since the last one which did
|
||||
// have an execution point.
|
||||
const countA = messageCountSinceLastExecutionPoint(state, a);
|
||||
const countB = messageCountSinceLastExecutionPoint(state, b);
|
||||
return countA > countB;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
exports.messages = messages;
|
||||
|
|
|
@ -335,6 +335,7 @@ function getRepeatId(message) {
|
|||
userProvidedStyles: message.userProvidedStyles,
|
||||
private: message.private,
|
||||
stacktrace: message.stacktrace,
|
||||
executionPoint: message.executionPoint,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ function WebConsoleConnectionProxy(webConsoleUI, target) {
|
|||
this._onPageError = this._onPageError.bind(this);
|
||||
this._onLogMessage = this._onLogMessage.bind(this);
|
||||
this._onConsoleAPICall = this._onConsoleAPICall.bind(this);
|
||||
this._onVirtualConsoleLog = this._onVirtualConsoleLog.bind(this);
|
||||
this._onNetworkEvent = this._onNetworkEvent.bind(this);
|
||||
this._onNetworkEventUpdate = this._onNetworkEventUpdate.bind(this);
|
||||
this._onTabNavigated = this._onTabNavigated.bind(this);
|
||||
|
@ -128,8 +127,6 @@ WebConsoleConnectionProxy.prototype = {
|
|||
client.addListener("consoleAPICall", this._onConsoleAPICall);
|
||||
client.addListener("lastPrivateContextExited",
|
||||
this._onLastPrivateContextExited);
|
||||
client.addListener("virtualConsoleLog",
|
||||
this._onVirtualConsoleLog);
|
||||
|
||||
this.target.on("will-navigate", this._onTabWillNavigate);
|
||||
this.target.on("navigate", this._onTabNavigated);
|
||||
|
@ -312,19 +309,6 @@ WebConsoleConnectionProxy.prototype = {
|
|||
this.dispatchMessageAdd(packet);
|
||||
},
|
||||
|
||||
_onVirtualConsoleLog: function(type, packet) {
|
||||
if (!this.webConsoleUI) {
|
||||
return;
|
||||
}
|
||||
this.dispatchMessageAdd({
|
||||
type: "consoleAPICall",
|
||||
message: {
|
||||
executionPoint: packet.executionPoint,
|
||||
"arguments": [packet.url + ":" + packet.line, packet.message],
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* The "networkEvent" message type handler. We redirect any message to
|
||||
* the UI for displaying.
|
||||
|
@ -438,8 +422,6 @@ WebConsoleConnectionProxy.prototype = {
|
|||
this.client.removeListener("consoleAPICall", this._onConsoleAPICall);
|
||||
this.client.removeListener("lastPrivateContextExited",
|
||||
this._onLastPrivateContextExited);
|
||||
this.client.removeListener("virtualConsoleLog",
|
||||
this._onVirtualConsoleLog);
|
||||
this.webConsoleClient.off("networkEvent", this._onNetworkEvent);
|
||||
this.webConsoleClient.off("networkEventUpdate", this._onNetworkEventUpdate);
|
||||
this.target.off("will-navigate", this._onTabWillNavigate);
|
||||
|
|
|
@ -99,16 +99,14 @@ BreakpointActor.prototype = {
|
|||
for (const offset of offsets) {
|
||||
const { lineNumber, columnNumber } = script.getOffsetLocation(offset);
|
||||
script.replayVirtualConsoleLog(offset, newLogValue, (point, rv) => {
|
||||
const packet = {
|
||||
from: this.actorID,
|
||||
type: "virtualConsoleLog",
|
||||
url: script.url,
|
||||
line: lineNumber,
|
||||
column: columnNumber,
|
||||
const message = {
|
||||
filename: script.url,
|
||||
lineNumber,
|
||||
columnNumber,
|
||||
executionPoint: point,
|
||||
message: "return" in rv ? "" + rv.return : "" + rv.throw,
|
||||
"arguments": ["return" in rv ? rv.return : rv.throw],
|
||||
};
|
||||
this.conn.send(packet);
|
||||
this.threadActor._parent._consoleActor.onConsoleAPICall(message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -382,8 +382,9 @@ ReplayDebugger.prototype = {
|
|||
type: "frameEvaluate",
|
||||
index: frameData.index,
|
||||
text,
|
||||
convertOptions: { snapshot: true },
|
||||
});
|
||||
evaluateResult = this._convertCompletionValue(rv, { forSearch: true });
|
||||
evaluateResult = this._convertCompletionValue(rv);
|
||||
}
|
||||
}
|
||||
results.push(point);
|
||||
|
@ -530,21 +531,12 @@ ReplayDebugger.prototype = {
|
|||
// Object methods
|
||||
/////////////////////////////////////////////////////////
|
||||
|
||||
_getObject(id, options) {
|
||||
if (options && options.forSearch) {
|
||||
// Returning objects through searches is NYI.
|
||||
return "<UnknownSearchObject>";
|
||||
}
|
||||
const forConsole = options && options.forConsole;
|
||||
|
||||
_getObject(id) {
|
||||
if (id && !this._objects[id]) {
|
||||
const data = this._sendRequest({ type: "getObject", id });
|
||||
switch (data.kind) {
|
||||
case "Object":
|
||||
// Objects which |forConsole| is set are objects that were logged in
|
||||
// console messages, and had their properties recorded so that they can
|
||||
// be inspected without switching to a replaying child.
|
||||
this._objects[id] = new ReplayDebuggerObject(this, data, forConsole);
|
||||
this._objects[id] = new ReplayDebuggerObject(this, data);
|
||||
break;
|
||||
case "Environment":
|
||||
this._objects[id] = new ReplayDebuggerEnvironment(this, data);
|
||||
|
@ -553,18 +545,17 @@ ReplayDebugger.prototype = {
|
|||
ThrowError("Unknown object kind");
|
||||
}
|
||||
}
|
||||
const rv = this._objects[id];
|
||||
if (forConsole) {
|
||||
rv._forConsole = true;
|
||||
}
|
||||
return rv;
|
||||
return this._objects[id];
|
||||
},
|
||||
|
||||
// Convert a value we received from the child.
|
||||
_convertValue(value, options) {
|
||||
_convertValue(value) {
|
||||
if (isNonNullObject(value)) {
|
||||
if (value.object) {
|
||||
return this._getObject(value.object, options);
|
||||
return this._getObject(value.object);
|
||||
}
|
||||
if (value.snapshot) {
|
||||
return new ReplayDebuggerObjectSnapshot(this, value.snapshot);
|
||||
}
|
||||
switch (value.special) {
|
||||
case "undefined": return undefined;
|
||||
|
@ -577,12 +568,12 @@ ReplayDebugger.prototype = {
|
|||
return value;
|
||||
},
|
||||
|
||||
_convertCompletionValue(value, options) {
|
||||
_convertCompletionValue(value) {
|
||||
if ("return" in value) {
|
||||
return { return: this._convertValue(value.return, options) };
|
||||
return { return: this._convertValue(value.return) };
|
||||
}
|
||||
if ("throw" in value) {
|
||||
return { throw: this._convertValue(value.throw, options) };
|
||||
return { throw: this._convertValue(value.throw) };
|
||||
}
|
||||
ThrowError("Unexpected completion value");
|
||||
return null; // For eslint
|
||||
|
@ -647,8 +638,7 @@ ReplayDebugger.prototype = {
|
|||
// other contents of the message can be left alone.
|
||||
if (message.messageType == "ConsoleAPI" && message.arguments) {
|
||||
for (let i = 0; i < message.arguments.length; i++) {
|
||||
message.arguments[i] = this._convertValue(message.arguments[i],
|
||||
{ forConsole: true });
|
||||
message.arguments[i] = this._convertValue(message.arguments[i]);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
|
@ -902,10 +892,9 @@ ReplayDebuggerFrame.prototype = {
|
|||
// ReplayDebuggerObject
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function ReplayDebuggerObject(dbg, data, forConsole) {
|
||||
function ReplayDebuggerObject(dbg, data) {
|
||||
this._dbg = dbg;
|
||||
this._data = data;
|
||||
this._forConsole = forConsole;
|
||||
this._properties = null;
|
||||
this._proxyData = null;
|
||||
}
|
||||
|
@ -933,18 +922,12 @@ ReplayDebuggerObject.prototype = {
|
|||
get boundArguments() { return this.isBoundFunction ? NYI() : undefined; },
|
||||
get global() { return this._dbg._getObject(this._data.global); },
|
||||
get isProxy() { return this._data.isProxy; },
|
||||
get proto() { return this._dbg._getObject(this._data.proto); },
|
||||
|
||||
isExtensible() { return this._data.isExtensible; },
|
||||
isSealed() { return this._data.isSealed; },
|
||||
isFrozen() { return this._data.isFrozen; },
|
||||
|
||||
get proto() {
|
||||
// Don't allow inspection of the prototypes of objects logged to the
|
||||
// console. This is a hack that prevents the object inspector from crawling
|
||||
// the object's prototype chain.
|
||||
return this._forConsole ? null : this._dbg._getObject(this._data.proto);
|
||||
},
|
||||
|
||||
unsafeDereference() {
|
||||
// Direct access to the referent is not currently available.
|
||||
return null;
|
||||
|
@ -969,9 +952,8 @@ ReplayDebuggerObject.prototype = {
|
|||
_ensureProperties() {
|
||||
if (!this._properties) {
|
||||
const id = this._data.id;
|
||||
const properties = this._forConsole
|
||||
? this._dbg._sendRequest({ type: "getObjectPropertiesForConsole", id })
|
||||
: this._dbg._sendRequestAllowDiverge({ type: "getObjectProperties", id });
|
||||
const properties =
|
||||
this._dbg._sendRequestAllowDiverge({ type: "getObjectProperties", id });
|
||||
this._properties = Object.create(null);
|
||||
properties.forEach(({name, desc}) => { this._properties[name] = desc; });
|
||||
}
|
||||
|
@ -1059,6 +1041,23 @@ ReplayDebuggerObject.prototype = {
|
|||
forceLexicalInitializationByName: NotAllowed,
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// ReplayDebuggerObjectSnapshot
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Create an object based on snapshot data which can be consulted without
|
||||
// communicating with the child process. This uses data provided by the child
|
||||
// process in the same format as for normal ReplayDebuggerObjects, except that
|
||||
// it does not contain references to any other objects.
|
||||
function ReplayDebuggerObjectSnapshot(dbg, data) {
|
||||
this._dbg = dbg;
|
||||
this._data = data;
|
||||
this._properties = Object.create(null);
|
||||
data.properties.forEach(({name, desc}) => { this._properties[name] = desc; });
|
||||
}
|
||||
|
||||
ReplayDebuggerObjectSnapshot.prototype = ReplayDebuggerObject.prototype;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// ReplayDebuggerEnvironment
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -191,24 +191,48 @@ dbg.onNewScript = function(script) {
|
|||
installPendingHandlers();
|
||||
};
|
||||
|
||||
const gConsoleObjectProperties = new Map();
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Object Snapshots
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function shouldSaveConsoleProperty({ desc }) {
|
||||
// When logging an object to the console, only properties captured here will
|
||||
// be shown. We limit this to non-object data properties, as more complex
|
||||
// properties have two problems: A) to inspect them we will need to switch to
|
||||
// a replaying child process, which is very slow when there are many console
|
||||
// messages, and B) trying to access objects transitively referred to by
|
||||
// logged console objects will fail when unpaused, and depends on the current
|
||||
// state of the process otherwise.
|
||||
return "value" in desc && !isNonNullObject(desc.value);
|
||||
// Snapshots are generated for objects that might be inspected at times when we
|
||||
// are not paused at the point where the snapshot was originally taken. The
|
||||
// snapshot data is provided to the server, which can use it to provide limited
|
||||
// answers to the client about the object's contents, without having to consult
|
||||
// a child process.
|
||||
|
||||
function snapshotObjectProperty({ name, desc }) {
|
||||
// Only capture primitive properties in object snapshots.
|
||||
if ("value" in desc && !convertedValueIsObject(desc.value)) {
|
||||
return { name, desc };
|
||||
}
|
||||
return { name, desc: { value: "<unavailable>" } };
|
||||
}
|
||||
|
||||
function saveConsoleObjectProperties(obj) {
|
||||
if (obj instanceof Debugger.Object) {
|
||||
const properties = getObjectProperties(obj).filter(shouldSaveConsoleProperty);
|
||||
gConsoleObjectProperties.set(obj, properties);
|
||||
}
|
||||
function makeObjectSnapshot(object) {
|
||||
assert(object instanceof Debugger.Object);
|
||||
|
||||
// Include properties that would be included in a normal object's data packet,
|
||||
// except do not allow inspection of any other referenced objects.
|
||||
// In particular, don't set the prototype so that the object inspector will
|
||||
// not attempt to crawl the object's prototype chain.
|
||||
return {
|
||||
kind: "Object",
|
||||
callable: object.callable,
|
||||
isBoundFunction: object.isBoundFunction,
|
||||
isArrowFunction: object.isArrowFunction,
|
||||
isGeneratorFunction: object.isGeneratorFunction,
|
||||
isAsyncFunction: object.isAsyncFunction,
|
||||
class: object.class,
|
||||
name: object.name,
|
||||
displayName: object.displayName,
|
||||
parameterNames: object.parameterNames,
|
||||
isProxy: object.isProxy,
|
||||
isExtensible: object.isExtensible(),
|
||||
isSealed: object.isSealed(),
|
||||
isFrozen: object.isFrozen(),
|
||||
properties: getObjectProperties(object).map(snapshotObjectProperty),
|
||||
};
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -281,27 +305,15 @@ Services.obs.addObserver({
|
|||
|
||||
// Message arguments are preserved as debuggee values.
|
||||
if (apiMessage.arguments) {
|
||||
contents.arguments = apiMessage.arguments.map(makeDebuggeeValue);
|
||||
contents.arguments.forEach(saveConsoleObjectProperties);
|
||||
contents.arguments = apiMessage.arguments.map(v => {
|
||||
return convertValue(makeDebuggeeValue(v), { snapshot: true });
|
||||
});
|
||||
}
|
||||
|
||||
newConsoleMessage("ConsoleAPI", null, contents);
|
||||
},
|
||||
}, "console-api-log-event");
|
||||
|
||||
function convertConsoleMessage(contents) {
|
||||
const result = {};
|
||||
for (const id in contents) {
|
||||
if (id == "arguments" && contents.messageType == "ConsoleAPI") {
|
||||
// Copy arguments over as debuggee values.
|
||||
result.arguments = contents.arguments.map(convertValue);
|
||||
} else {
|
||||
result[id] = contents[id];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Position Handler State
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -469,25 +481,33 @@ function getObjectId(obj) {
|
|||
}
|
||||
|
||||
// Convert a value for sending to the parent.
|
||||
function convertValue(value) {
|
||||
function convertValue(value, options) {
|
||||
if (value instanceof Debugger.Object) {
|
||||
return { object: getObjectId(value) };
|
||||
} else if (value === undefined ||
|
||||
value == Infinity ||
|
||||
value == -Infinity ||
|
||||
Object.is(value, NaN) ||
|
||||
Object.is(value, -0)) {
|
||||
return { special: "" + value };
|
||||
if (options && options.snapshot) {
|
||||
return { snapshot: makeObjectSnapshot(value) };
|
||||
}
|
||||
return { object: getObjectId(value) };
|
||||
}
|
||||
if (value === undefined ||
|
||||
value == Infinity ||
|
||||
value == -Infinity ||
|
||||
Object.is(value, NaN) ||
|
||||
Object.is(value, -0)) {
|
||||
return { special: "" + value };
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function convertCompletionValue(value) {
|
||||
function convertedValueIsObject(value) {
|
||||
return isNonNullObject(value) && "object" in value;
|
||||
}
|
||||
|
||||
function convertCompletionValue(value, options) {
|
||||
if ("return" in value) {
|
||||
return { return: convertValue(value.return) };
|
||||
return { return: convertValue(value.return, options) };
|
||||
}
|
||||
if ("throw" in value) {
|
||||
return { throw: convertValue(value.throw) };
|
||||
return { throw: convertValue(value.throw, options) };
|
||||
}
|
||||
throw new Error("Unexpected completion value");
|
||||
}
|
||||
|
@ -693,15 +713,6 @@ const gRequestHandlers = {
|
|||
return getObjectProperties(object);
|
||||
},
|
||||
|
||||
getObjectPropertiesForConsole(request) {
|
||||
const object = gPausedObjects.getObject(request.id);
|
||||
const properties = gConsoleObjectProperties.get(object);
|
||||
if (!properties) {
|
||||
throw new Error("Console object properties not saved");
|
||||
}
|
||||
return properties;
|
||||
},
|
||||
|
||||
objectProxyData(request) {
|
||||
if (!RecordReplayControl.maybeDivergeFromRecording()) {
|
||||
return { exception: "Recording divergence in unwrapObject" };
|
||||
|
@ -794,7 +805,7 @@ const gRequestHandlers = {
|
|||
|
||||
const frame = scriptFrameForIndex(request.index);
|
||||
const rv = frame.eval(request.text, request.options);
|
||||
return convertCompletionValue(rv);
|
||||
return convertCompletionValue(rv, request.convertOptions);
|
||||
},
|
||||
|
||||
popFrameResult(request) {
|
||||
|
@ -802,11 +813,11 @@ const gRequestHandlers = {
|
|||
},
|
||||
|
||||
findConsoleMessages(request) {
|
||||
return gConsoleMessages.map(convertConsoleMessage);
|
||||
return gConsoleMessages;
|
||||
},
|
||||
|
||||
getNewConsoleMessage(request) {
|
||||
return convertConsoleMessage(gConsoleMessages[gConsoleMessages.length - 1]);
|
||||
return gConsoleMessages[gConsoleMessages.length - 1];
|
||||
},
|
||||
|
||||
currentExecutionPoint(request) {
|
||||
|
|
|
@ -37,7 +37,6 @@ const UnsolicitedNotifications = {
|
|||
"evaluationResult": "evaluationResult",
|
||||
"updatedSource": "updatedSource",
|
||||
"inspectObject": "inspectObject",
|
||||
"virtualConsoleLog": "virtualConsoleLog",
|
||||
|
||||
// newSource is still emitted on the ThreadActor, in addition to the
|
||||
// BrowsingContextActor we have to keep it here until ThreadClient is converted to
|
||||
|
|
|
@ -89,7 +89,7 @@ class Timeout final : public LinkedListElement<RefPtr<Timeout>> {
|
|||
// when sync loops trigger nested firing.
|
||||
uint32_t mFiringId;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
int64_t mFiringIndex;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -454,7 +454,7 @@ TimeoutManager::TimeoutManager(nsGlobalWindowInner& aWindow,
|
|||
mTimeouts(*this),
|
||||
mTimeoutIdCounter(1),
|
||||
mNextFiringId(InvalidFiringId + 1),
|
||||
#ifdef DEBUG
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
mFiringIndex(0),
|
||||
mLastFiringIndex(-1),
|
||||
#endif
|
||||
|
@ -563,6 +563,9 @@ nsresult TimeoutManager::SetTimeout(nsITimeoutHandler* aHandler,
|
|||
}
|
||||
|
||||
RefPtr<Timeout> timeout = new Timeout();
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
timeout->mFiringIndex = -1;
|
||||
#endif
|
||||
timeout->mWindow = &mWindow;
|
||||
timeout->mIsInterval = aIsInterval;
|
||||
timeout->mInterval = TimeDuration::FromMilliseconds(interval);
|
||||
|
@ -798,7 +801,8 @@ void TimeoutManager::RunTimeout(const TimeStamp& aNow,
|
|||
MOZ_LOG(gTimeoutLog, LogLevel::Debug,
|
||||
("Running %u deferred timeouts on idle (TimeoutManager=%p), "
|
||||
"nextDeadline = %gms from now",
|
||||
numTimersToRun, this, (nextDeadline - now).ToMilliseconds()));
|
||||
numTimersToRun, this,
|
||||
nextDeadline.IsNull() ? 0.0 : (nextDeadline - now).ToMilliseconds()));
|
||||
}
|
||||
|
||||
now = TimeStamp::Now();
|
||||
|
@ -894,7 +898,7 @@ void TimeoutManager::RunTimeout(const TimeStamp& aNow,
|
|||
// ("Wait until any invocations of this algorithm that had the same
|
||||
// method context, that started before this one, and whose timeout is
|
||||
// equal to or less than this one's, have completed.").
|
||||
#ifdef DEBUG
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
if (timeout->mFiringIndex == -1) {
|
||||
timeout->mFiringIndex = mFiringIndex++;
|
||||
}
|
||||
|
@ -934,8 +938,8 @@ void TimeoutManager::RunTimeout(const TimeStamp& aNow,
|
|||
continue;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
MOZ_ASSERT(timeout->mFiringIndex > mLastFiringIndex);
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
MOZ_DIAGNOSTIC_ASSERT(timeout->mFiringIndex > mLastFiringIndex);
|
||||
mLastFiringIndex = timeout->mFiringIndex;
|
||||
#endif
|
||||
// This timeout is good to run
|
||||
|
@ -1063,7 +1067,7 @@ bool TimeoutManager::RescheduleTimeout(Timeout* aTimeout,
|
|||
TimeStamp firingTime = aLastCallbackTime + nextInterval;
|
||||
TimeDuration delay = firingTime - aCurrentNow;
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
aTimeout->mFiringIndex = -1;
|
||||
#endif
|
||||
// And make sure delay is nonnegative; that might happen if the timer
|
||||
|
|
|
@ -203,7 +203,7 @@ class TimeoutManager final {
|
|||
Timeouts mTimeouts;
|
||||
uint32_t mTimeoutIdCounter;
|
||||
uint32_t mNextFiringId;
|
||||
#ifdef DEBUG
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
int64_t mFiringIndex;
|
||||
int64_t mLastFiringIndex;
|
||||
#endif
|
||||
|
|
|
@ -37,8 +37,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
|
|||
function click() {
|
||||
// The bug is not reproducible with synthesizeMouseAtCenter.
|
||||
// Need to emulate native mouse event.
|
||||
synthesizeNativeOSXClick(button.boxObject.screenX + button.boxObject.width / 2,
|
||||
button.boxObject.screenY + button.boxObject.height / 2);
|
||||
synthesizeNativeOSXClick(button.screenX + button.boxObject.width / 2,
|
||||
button.screenY + button.boxObject.height / 2);
|
||||
}
|
||||
click();
|
||||
// On debug build, it's possible that the click event handler is not
|
||||
|
|
|
@ -38,8 +38,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
|
|||
function click() {
|
||||
// The bug is not reproducible with synthesizeMouseAtCenter.
|
||||
// Need to emulate native mouse event.
|
||||
synthesizeNativeOSXClick(button.boxObject.screenX + button.boxObject.width / 2,
|
||||
button.boxObject.screenY + button.boxObject.height / 2);
|
||||
synthesizeNativeOSXClick(button.screenX + button.boxObject.width / 2,
|
||||
button.screenY + button.boxObject.height / 2);
|
||||
}
|
||||
click();
|
||||
// On debug build, it's possible that the click event handler is not
|
||||
|
|
|
@ -40,10 +40,10 @@ function doTests()
|
|||
|
||||
is(window.devicePixelRatio, devPxPerCSSPx, "window.devicePixelRatio");
|
||||
|
||||
var windowBO = document.documentElement.boxObject;
|
||||
isRounded(window.mozInnerScreenX*devPxPerCSSPx, windowBO.screenX,
|
||||
var rootElement = document.documentElement;
|
||||
isRounded(window.mozInnerScreenX*devPxPerCSSPx, rootElement.screenX,
|
||||
"window screen X");
|
||||
isRounded(window.mozInnerScreenY*devPxPerCSSPx, windowBO.screenY,
|
||||
isRounded(window.mozInnerScreenY*devPxPerCSSPx, rootElement.screenY,
|
||||
"window screen Y");
|
||||
|
||||
var f = document.getElementById("f");
|
||||
|
|
|
@ -60,6 +60,10 @@ interface XULElement : Element {
|
|||
[SetterThrows]
|
||||
attribute DOMString top;
|
||||
|
||||
// Return the screen coordinates of the element.
|
||||
readonly attribute long screenX;
|
||||
readonly attribute long screenY;
|
||||
|
||||
// Tooltip
|
||||
[SetterThrows]
|
||||
attribute DOMString tooltipText;
|
||||
|
|
|
@ -2703,7 +2703,8 @@ void WorkerPrivate::DoRunLoop(JSContext* aCx) {
|
|||
size_t queuedEvents = mMainThreadEventTarget->Length() +
|
||||
mMainThreadDebuggeeEventTarget->Length();
|
||||
if (queuedEvents > 5000) {
|
||||
mMainThreadEventTarget->AwaitIdle();
|
||||
// Note, postMessage uses mMainThreadDebuggeeEventTarget!
|
||||
mMainThreadDebuggeeEventTarget->AwaitIdle();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -472,6 +472,16 @@ bool nsXULElement::IsFocusableInternal(int32_t* aTabIndex, bool aWithMouse) {
|
|||
return shouldFocus;
|
||||
}
|
||||
|
||||
int32_t nsXULElement::ScreenX() {
|
||||
nsIFrame* frame = GetPrimaryFrame(FlushType::Layout);
|
||||
return frame ? frame->GetScreenRect().x: 0;
|
||||
}
|
||||
|
||||
int32_t nsXULElement::ScreenY() {
|
||||
nsIFrame* frame = GetPrimaryFrame(FlushType::Layout);
|
||||
return frame ? frame->GetScreenRect().y : 0;
|
||||
}
|
||||
|
||||
bool nsXULElement::HasMenu() {
|
||||
nsMenuFrame* menu = do_QueryFrame(GetPrimaryFrame());
|
||||
return menu != nullptr;
|
||||
|
|
|
@ -337,6 +337,9 @@ class nsXULElement : public nsStyledElement {
|
|||
bool aDumpAll) const override {}
|
||||
#endif
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT int32_t ScreenX();
|
||||
MOZ_CAN_RUN_SCRIPT int32_t ScreenY();
|
||||
|
||||
bool HasMenu();
|
||||
MOZ_CAN_RUN_SCRIPT void OpenMenu(bool aOpenFlag);
|
||||
|
||||
|
|
|
@ -47,20 +47,20 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
|||
|
||||
var d = 10;
|
||||
function middle(e) {
|
||||
return { "x": e.boxObject.x + e.boxObject.width/2,
|
||||
"y": e.boxObject.y + e.boxObject.height/2 };
|
||||
return { "x": e.getBoundingClientRect().x + e.getBoundingClientRect().width/2,
|
||||
"y": e.getBoundingClientRect().y + e.getBoundingClientRect().height/2 };
|
||||
}
|
||||
function lower_right(e) {
|
||||
return { "x": e.boxObject.x + e.boxObject.width - d,
|
||||
"y": e.boxObject.y + e.boxObject.height - d };
|
||||
return { "x": e.getBoundingClientRect().x + e.getBoundingClientRect().width - d,
|
||||
"y": e.getBoundingClientRect().y + e.getBoundingClientRect().height - d };
|
||||
}
|
||||
function upper_left(e) {
|
||||
return { "x": e.boxObject.x + d,
|
||||
"y": e.boxObject.y + d };
|
||||
return { "x": e.getBoundingClientRect().x + d,
|
||||
"y": e.getBoundingClientRect().y + d };
|
||||
}
|
||||
function scrollbar_button(e) { // a bit down from upper right
|
||||
return { "x": e.boxObject.x + e.boxObject.width - d,
|
||||
"y": e.boxObject.y + d + 15 };
|
||||
return { "x": e.getBoundingClientRect().x + e.getBoundingClientRect().width - d,
|
||||
"y": e.getBoundingClientRect().y + d + 15 };
|
||||
}
|
||||
|
||||
function test(ptFunc, id, message) {
|
||||
|
|
|
@ -876,11 +876,6 @@ void gfxContext::SetDeviceOffset(const Point& aOffset) {
|
|||
CurrentState().deviceOffset = aOffset;
|
||||
}
|
||||
|
||||
Matrix gfxContext::GetDeviceTransform() const {
|
||||
return Matrix::Translation(-CurrentState().deviceOffset.x,
|
||||
-CurrentState().deviceOffset.y);
|
||||
}
|
||||
|
||||
Matrix gfxContext::GetDTTransform() const {
|
||||
Matrix mat = mTransform;
|
||||
mat._31 -= CurrentState().deviceOffset.x;
|
||||
|
|
|
@ -525,7 +525,6 @@ class gfxContext final {
|
|||
void ChangeTransform(const mozilla::gfx::Matrix& aNewMatrix,
|
||||
bool aUpdatePatternTransform = true);
|
||||
Rect GetAzureDeviceSpaceClipBounds() const;
|
||||
Matrix GetDeviceTransform() const;
|
||||
Matrix GetDTTransform() const;
|
||||
|
||||
bool mPathIsRect;
|
||||
|
|
|
@ -66,6 +66,16 @@
|
|||
// compression, then instead of treating the pixel data as 0RGB it is treated
|
||||
// as ARGB, but only if one or more of the A values are non-zero.
|
||||
//
|
||||
// Clipboard variants.
|
||||
// - It's the BMP format used for BMP images captured from the clipboard.
|
||||
// - It is missing the file header, containing the BM signature and the data
|
||||
// offset. Instead the data begins after the header.
|
||||
// - If it uses BITFIELDS compression, then there is always an additional 12
|
||||
// bytes of data after the header that must be read. In WinBMPv4+, the masks
|
||||
// are supposed to be included in the header size, which are the values we use
|
||||
// for decoding purposes, but there is additional three masks following the
|
||||
// header which must be skipped to get to the pixel data.
|
||||
//
|
||||
// OS/2 VERSIONS OF THE BMP FORMAT
|
||||
// -------------------------------
|
||||
// OS2-BMPv1.
|
||||
|
@ -157,10 +167,12 @@ static mozilla::LazyLogModule sBMPLog("BMPDecoder");
|
|||
// The length of the mBIHSize field in the info header.
|
||||
static const uint32_t BIHSIZE_FIELD_LENGTH = 4;
|
||||
|
||||
nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength)
|
||||
nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength,
|
||||
bool aForClipboard)
|
||||
: Decoder(aImage),
|
||||
mLexer(Transition::To(aState, aLength), Transition::TerminateSuccess()),
|
||||
mIsWithinICO(false),
|
||||
mIsForClipboard(aForClipboard),
|
||||
mMayHaveTransparency(false),
|
||||
mDoesHaveTransparency(false),
|
||||
mNumColors(0),
|
||||
|
@ -175,12 +187,14 @@ nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength)
|
|||
// Constructor for normal BMP files or from the clipboard.
|
||||
nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, bool aForClipboard)
|
||||
: nsBMPDecoder(aImage,
|
||||
aForClipboard ? State::CLIPBOARD_HEADER : State::FILE_HEADER,
|
||||
aForClipboard ? BIHSIZE_FIELD_LENGTH : FILE_HEADER_LENGTH) {}
|
||||
aForClipboard ? State::INFO_HEADER_SIZE : State::FILE_HEADER,
|
||||
aForClipboard ? BIHSIZE_FIELD_LENGTH : FILE_HEADER_LENGTH,
|
||||
aForClipboard) {}
|
||||
|
||||
// Constructor used for WinBMPv3-ICO files, which lack a file header.
|
||||
nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, uint32_t aDataOffset)
|
||||
: nsBMPDecoder(aImage, State::INFO_HEADER_SIZE, BIHSIZE_FIELD_LENGTH) {
|
||||
: nsBMPDecoder(aImage, State::INFO_HEADER_SIZE, BIHSIZE_FIELD_LENGTH,
|
||||
/* aForClipboard */ false) {
|
||||
SetIsWithinICO();
|
||||
|
||||
// Even though the file header isn't present in this case, the dataOffset
|
||||
|
@ -404,8 +418,6 @@ LexerResult nsBMPDecoder::DoDecode(SourceBufferIterator& aIterator,
|
|||
switch (aState) {
|
||||
case State::FILE_HEADER:
|
||||
return ReadFileHeader(aData, aLength);
|
||||
case State::CLIPBOARD_HEADER:
|
||||
return ReadClipboardHeader(aData, aLength);
|
||||
case State::INFO_HEADER_SIZE:
|
||||
return ReadInfoHeaderSize(aData, aLength);
|
||||
case State::INFO_HEADER_REST:
|
||||
|
@ -448,13 +460,6 @@ LexerTransition<nsBMPDecoder::State> nsBMPDecoder::ReadFileHeader(
|
|||
return Transition::To(State::INFO_HEADER_SIZE, BIHSIZE_FIELD_LENGTH);
|
||||
}
|
||||
|
||||
LexerTransition<nsBMPDecoder::State> nsBMPDecoder::ReadClipboardHeader(
|
||||
const char* aData, size_t aLength) {
|
||||
// With the clipboard, the data offset is the header length.
|
||||
mH.mDataOffset = LittleEndian::readUint32(aData);
|
||||
return ReadInfoHeaderSize(aData, aLength);
|
||||
}
|
||||
|
||||
// We read the info header in two steps: (a) read the mBIHSize field to
|
||||
// determine how long the header is; (b) read the rest of the header.
|
||||
LexerTransition<nsBMPDecoder::State> nsBMPDecoder::ReadInfoHeaderSize(
|
||||
|
@ -571,6 +576,13 @@ LexerTransition<nsBMPDecoder::State> nsBMPDecoder::ReadInfoHeaderRest(
|
|||
// Bitfields are present in the info header, so we can read them
|
||||
// immediately.
|
||||
mBitFields.ReadFromHeader(aData + 36, /* aReadAlpha = */ true);
|
||||
|
||||
// If this came from the clipboard, then we know that even if the header
|
||||
// explicitly includes the bitfield masks, we need to add an additional
|
||||
// offset for the start of the RGB data.
|
||||
if (mIsForClipboard) {
|
||||
mH.mDataOffset += BitFields::LENGTH;
|
||||
}
|
||||
} else {
|
||||
// Bitfields are present after the info header, so we will read them in
|
||||
// ReadBitfields().
|
||||
|
@ -682,6 +694,12 @@ LexerTransition<nsBMPDecoder::State> nsBMPDecoder::ReadColorTable(
|
|||
aData += mBytesPerColor;
|
||||
}
|
||||
|
||||
// If we are decoding a BMP from the clipboard, we did not know the data
|
||||
// offset in advance. It is just defined as after the header and color table.
|
||||
if (mIsForClipboard) {
|
||||
mH.mDataOffset += mPreGapLength;
|
||||
}
|
||||
|
||||
// We know how many bytes we've read so far (mPreGapLength) and we know the
|
||||
// offset of the pixel data (mH.mDataOffset), so we can determine the length
|
||||
// of the gap (possibly zero) between the color table and the pixel data.
|
||||
|
|
|
@ -154,7 +154,6 @@ class nsBMPDecoder : public Decoder {
|
|||
|
||||
enum class State {
|
||||
FILE_HEADER,
|
||||
CLIPBOARD_HEADER,
|
||||
INFO_HEADER_SIZE,
|
||||
INFO_HEADER_REST,
|
||||
BITFIELDS,
|
||||
|
@ -174,7 +173,8 @@ class nsBMPDecoder : public Decoder {
|
|||
nsBMPDecoder(RasterImage* aImage, uint32_t aDataOffset);
|
||||
|
||||
// Helper constructor called by the other two.
|
||||
nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength);
|
||||
nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength,
|
||||
bool aForClipboard);
|
||||
|
||||
int32_t AbsoluteHeight() const { return abs(mH.mHeight); }
|
||||
|
||||
|
@ -183,7 +183,6 @@ class nsBMPDecoder : public Decoder {
|
|||
void FinishRow();
|
||||
|
||||
LexerTransition<State> ReadFileHeader(const char* aData, size_t aLength);
|
||||
LexerTransition<State> ReadClipboardHeader(const char* aData, size_t aLength);
|
||||
LexerTransition<State> ReadInfoHeaderSize(const char* aData, size_t aLength);
|
||||
LexerTransition<State> ReadInfoHeaderRest(const char* aData, size_t aLength);
|
||||
LexerTransition<State> ReadBitfields(const char* aData, size_t aLength);
|
||||
|
@ -202,6 +201,9 @@ class nsBMPDecoder : public Decoder {
|
|||
// If the BMP is within an ICO file our treatment of it differs slightly.
|
||||
bool mIsWithinICO;
|
||||
|
||||
// If the BMP decoded from the clipboard, we don't start with a data offset.
|
||||
bool mIsForClipboard;
|
||||
|
||||
bmp::BitFields mBitFields;
|
||||
|
||||
// Might the image have transparency? Determined from the headers during
|
||||
|
|
|
@ -479,18 +479,29 @@ LexerResult nsWebPDecoder::ReadSingle(const uint8_t* aData, size_t aLength,
|
|||
}
|
||||
|
||||
WriteState result;
|
||||
if (noPremultiply) {
|
||||
result = mPipe.WritePixelsToRow<uint32_t>([&]() -> NextPixel<uint32_t> {
|
||||
MOZ_ASSERT(mFormat == SurfaceFormat::B8G8R8A8 || src[3] == 0xFF);
|
||||
const uint32_t pixel =
|
||||
gfxPackedPixelNoPreMultiply(src[3], src[0], src[1], src[2]);
|
||||
src += 4;
|
||||
return AsVariant(pixel);
|
||||
});
|
||||
if (mFormat == SurfaceFormat::B8G8R8A8) {
|
||||
if (noPremultiply) {
|
||||
result =
|
||||
mPipe.WritePixelsToRow<uint32_t>([&]() -> NextPixel<uint32_t> {
|
||||
const uint32_t pixel =
|
||||
gfxPackedPixelNoPreMultiply(src[3], src[0], src[1], src[2]);
|
||||
src += 4;
|
||||
return AsVariant(pixel);
|
||||
});
|
||||
} else {
|
||||
result =
|
||||
mPipe.WritePixelsToRow<uint32_t>([&]() -> NextPixel<uint32_t> {
|
||||
const uint32_t pixel =
|
||||
gfxPackedPixel(src[3], src[0], src[1], src[2]);
|
||||
src += 4;
|
||||
return AsVariant(pixel);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// We are producing a surface without transparency. Ignore the alpha
|
||||
// channel provided to us by the library.
|
||||
result = mPipe.WritePixelsToRow<uint32_t>([&]() -> NextPixel<uint32_t> {
|
||||
MOZ_ASSERT(mFormat == SurfaceFormat::B8G8R8A8 || src[3] == 0xFF);
|
||||
const uint32_t pixel = gfxPackedPixel(src[3], src[0], src[1], src[2]);
|
||||
const uint32_t pixel = gfxPackedPixel(0xFF, src[0], src[1], src[2]);
|
||||
src += 4;
|
||||
return AsVariant(pixel);
|
||||
});
|
||||
|
|
|
@ -613,6 +613,20 @@ ImageTestCase TransparentGIFTestCase() {
|
|||
TEST_CASE_IS_TRANSPARENT);
|
||||
}
|
||||
|
||||
ImageTestCase TransparentWebPTestCase() {
|
||||
ImageTestCase test("transparent.webp", "image/webp", IntSize(100, 100),
|
||||
TEST_CASE_IS_TRANSPARENT);
|
||||
test.mColor = BGRAColor::Transparent();
|
||||
return test;
|
||||
}
|
||||
|
||||
ImageTestCase TransparentNoAlphaHeaderWebPTestCase() {
|
||||
ImageTestCase test("transparent-no-alpha-header.webp", "image/webp",
|
||||
IntSize(100, 100), TEST_CASE_IS_FUZZY);
|
||||
test.mColor = BGRAColor(0x00, 0x00, 0x00, 0xFF); // black
|
||||
return test;
|
||||
}
|
||||
|
||||
ImageTestCase FirstFramePaddingGIFTestCase() {
|
||||
return ImageTestCase("transparent.gif", "image/gif", IntSize(16, 16),
|
||||
TEST_CASE_IS_TRANSPARENT);
|
||||
|
|
|
@ -30,40 +30,6 @@ namespace image {
|
|||
// Types
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
enum TestCaseFlags {
|
||||
TEST_CASE_DEFAULT_FLAGS = 0,
|
||||
TEST_CASE_IS_FUZZY = 1 << 0,
|
||||
TEST_CASE_HAS_ERROR = 1 << 1,
|
||||
TEST_CASE_IS_TRANSPARENT = 1 << 2,
|
||||
TEST_CASE_IS_ANIMATED = 1 << 3,
|
||||
TEST_CASE_IGNORE_OUTPUT = 1 << 4,
|
||||
};
|
||||
|
||||
struct ImageTestCase {
|
||||
ImageTestCase(const char* aPath, const char* aMimeType, gfx::IntSize aSize,
|
||||
uint32_t aFlags = TEST_CASE_DEFAULT_FLAGS)
|
||||
: mPath(aPath),
|
||||
mMimeType(aMimeType),
|
||||
mSize(aSize),
|
||||
mOutputSize(aSize),
|
||||
mFlags(aFlags) {}
|
||||
|
||||
ImageTestCase(const char* aPath, const char* aMimeType, gfx::IntSize aSize,
|
||||
gfx::IntSize aOutputSize,
|
||||
uint32_t aFlags = TEST_CASE_DEFAULT_FLAGS)
|
||||
: mPath(aPath),
|
||||
mMimeType(aMimeType),
|
||||
mSize(aSize),
|
||||
mOutputSize(aOutputSize),
|
||||
mFlags(aFlags) {}
|
||||
|
||||
const char* mPath;
|
||||
const char* mMimeType;
|
||||
gfx::IntSize mSize;
|
||||
gfx::IntSize mOutputSize;
|
||||
uint32_t mFlags;
|
||||
};
|
||||
|
||||
struct BGRAColor {
|
||||
BGRAColor() : BGRAColor(0, 0, 0, 0) {}
|
||||
|
||||
|
@ -103,6 +69,43 @@ struct BGRAColor {
|
|||
bool mPremultiplied;
|
||||
};
|
||||
|
||||
enum TestCaseFlags {
|
||||
TEST_CASE_DEFAULT_FLAGS = 0,
|
||||
TEST_CASE_IS_FUZZY = 1 << 0,
|
||||
TEST_CASE_HAS_ERROR = 1 << 1,
|
||||
TEST_CASE_IS_TRANSPARENT = 1 << 2,
|
||||
TEST_CASE_IS_ANIMATED = 1 << 3,
|
||||
TEST_CASE_IGNORE_OUTPUT = 1 << 4,
|
||||
};
|
||||
|
||||
struct ImageTestCase {
|
||||
ImageTestCase(const char* aPath, const char* aMimeType, gfx::IntSize aSize,
|
||||
uint32_t aFlags = TEST_CASE_DEFAULT_FLAGS)
|
||||
: mPath(aPath),
|
||||
mMimeType(aMimeType),
|
||||
mSize(aSize),
|
||||
mOutputSize(aSize),
|
||||
mFlags(aFlags),
|
||||
mColor(BGRAColor::Green()) {}
|
||||
|
||||
ImageTestCase(const char* aPath, const char* aMimeType, gfx::IntSize aSize,
|
||||
gfx::IntSize aOutputSize,
|
||||
uint32_t aFlags = TEST_CASE_DEFAULT_FLAGS)
|
||||
: mPath(aPath),
|
||||
mMimeType(aMimeType),
|
||||
mSize(aSize),
|
||||
mOutputSize(aOutputSize),
|
||||
mFlags(aFlags),
|
||||
mColor(BGRAColor::Green()) {}
|
||||
|
||||
const char* mPath;
|
||||
const char* mMimeType;
|
||||
gfx::IntSize mSize;
|
||||
gfx::IntSize mOutputSize;
|
||||
uint32_t mFlags;
|
||||
BGRAColor mColor;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// General Helpers
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -436,6 +439,8 @@ ImageTestCase CorruptICOWithBadBppTestCase();
|
|||
|
||||
ImageTestCase TransparentPNGTestCase();
|
||||
ImageTestCase TransparentGIFTestCase();
|
||||
ImageTestCase TransparentWebPTestCase();
|
||||
ImageTestCase TransparentNoAlphaHeaderWebPTestCase();
|
||||
ImageTestCase FirstFramePaddingGIFTestCase();
|
||||
ImageTestCase TransparentIfWithinICOBMPTestCase(TestCaseFlags aFlags);
|
||||
ImageTestCase NoFrameDelayGIFTestCase();
|
||||
|
|
|
@ -89,7 +89,7 @@ static void CheckDecoderResults(const ImageTestCase& aTestCase,
|
|||
}
|
||||
|
||||
// Check the output.
|
||||
EXPECT_TRUE(IsSolidColor(surface, BGRAColor::Green(),
|
||||
EXPECT_TRUE(IsSolidColor(surface, aTestCase.mColor,
|
||||
aTestCase.mFlags & TEST_CASE_IS_FUZZY ? 1 : 0));
|
||||
}
|
||||
|
||||
|
@ -725,6 +725,14 @@ TEST_F(ImageDecoders, WebPIccSrgbMultiChunk) {
|
|||
CheckDecoderMultiChunk(GreenWebPIccSrgbTestCase());
|
||||
}
|
||||
|
||||
TEST_F(ImageDecoders, WebPTransparentSingleChunk) {
|
||||
CheckDecoderSingleChunk(TransparentWebPTestCase());
|
||||
}
|
||||
|
||||
TEST_F(ImageDecoders, WebPTransparentNoAlphaHeaderSingleChunk) {
|
||||
CheckDecoderSingleChunk(TransparentNoAlphaHeaderWebPTestCase());
|
||||
}
|
||||
|
||||
TEST_F(ImageDecoders, AnimatedGIFSingleChunk) {
|
||||
CheckDecoderSingleChunk(GreenFirstFrameAnimatedGIFTestCase());
|
||||
}
|
||||
|
|
|
@ -76,8 +76,10 @@ TEST_HARNESS_FILES.gtest += [
|
|||
'rle8.bmp',
|
||||
'transparent-ico-with-and-mask.ico',
|
||||
'transparent-if-within-ico.bmp',
|
||||
'transparent-no-alpha-header.webp',
|
||||
'transparent.gif',
|
||||
'transparent.png',
|
||||
'transparent.webp',
|
||||
]
|
||||
|
||||
include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 120 B |
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 120 B |
|
@ -138,8 +138,8 @@ function RadixSort(array, len, buffer, nbytes, signed, floating, comparefn) {
|
|||
// |array| is a possibly cross-compartment wrapped typed array.
|
||||
let offset = IsTypedArray(array)
|
||||
? TypedArrayByteOffset(array)
|
||||
: callFunction(CallTypedArrayMethodIfWrapped, array, array,
|
||||
"TypedArrayByteOffset");
|
||||
: callFunction(CallTypedArrayMethodIfWrapped, array,
|
||||
"TypedArrayByteOffsetMethod");
|
||||
|
||||
view = new Int32Array(buffer, offset, len);
|
||||
|
||||
|
|
|
@ -37,6 +37,10 @@ function TypedArrayLengthMethod() {
|
|||
return TypedArrayLength(this);
|
||||
}
|
||||
|
||||
function TypedArrayByteOffsetMethod() {
|
||||
return TypedArrayByteOffset(this);
|
||||
}
|
||||
|
||||
function GetAttachedArrayBuffer(tarray) {
|
||||
var buffer = ViewedArrayBufferIfReified(tarray);
|
||||
if (IsDetachedBuffer(buffer))
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
let a = wrapWithProto(new Float32Array(1024), new Float32Array());
|
||||
|
||||
a.sort();
|
|
@ -6532,13 +6532,15 @@ class BaseCompiler final : public BaseCompilerInterface {
|
|||
#ifdef JS_64BIT
|
||||
pushI64(RegI64(Register64(valueAddr)));
|
||||
if (!emitInstanceCall(bytecodeOffset, SigPL_, ExprType::Void,
|
||||
SymbolicAddress::PostBarrier)) {
|
||||
SymbolicAddress::PostBarrier,
|
||||
/*pushReturnedValue=*/false)) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
pushI32(RegI32(valueAddr));
|
||||
if (!emitInstanceCall(bytecodeOffset, SigPI_, ExprType::Void,
|
||||
SymbolicAddress::PostBarrier)) {
|
||||
SymbolicAddress::PostBarrier,
|
||||
/*pushReturnedValue=*/false)) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -6758,7 +6760,7 @@ class BaseCompiler final : public BaseCompilerInterface {
|
|||
void endIfThenElse(ExprType type);
|
||||
|
||||
void doReturn(ExprType returnType, bool popStack);
|
||||
void pushReturnedIfNonVoid(const FunctionCall& call, ExprType type);
|
||||
void pushReturnValueOfCall(const FunctionCall& call, ExprType type);
|
||||
|
||||
void emitCompareI32(Assembler::Condition compareOp, ValType compareType);
|
||||
void emitCompareI64(Assembler::Condition compareOp, ValType compareType);
|
||||
|
@ -6876,7 +6878,8 @@ class BaseCompiler final : public BaseCompilerInterface {
|
|||
void emitRound(RoundingMode roundingMode, ValType operandType);
|
||||
MOZ_MUST_USE bool emitInstanceCall(uint32_t lineOrBytecode,
|
||||
const MIRTypeVector& sig, ExprType retType,
|
||||
SymbolicAddress builtin);
|
||||
SymbolicAddress builtin,
|
||||
bool pushReturnedValue=true);
|
||||
MOZ_MUST_USE bool emitGrowMemory();
|
||||
MOZ_MUST_USE bool emitCurrentMemory();
|
||||
|
||||
|
@ -8627,12 +8630,9 @@ bool BaseCompiler::emitCallArgs(const ValTypeVector& argTypes,
|
|||
return true;
|
||||
}
|
||||
|
||||
void BaseCompiler::pushReturnedIfNonVoid(const FunctionCall& call,
|
||||
void BaseCompiler::pushReturnValueOfCall(const FunctionCall& call,
|
||||
ExprType type) {
|
||||
switch (type.code()) {
|
||||
case ExprType::Void:
|
||||
// There's no return value. Do nothing.
|
||||
break;
|
||||
case ExprType::I32: {
|
||||
RegI32 rv = captureReturnedI32();
|
||||
pushI32(rv);
|
||||
|
@ -8662,6 +8662,8 @@ void BaseCompiler::pushReturnedIfNonVoid(const FunctionCall& call,
|
|||
case ExprType::NullRef:
|
||||
MOZ_CRASH("NullRef not expressible");
|
||||
default:
|
||||
// In particular, passing |type| == ExprType::Void to this function is
|
||||
// an error.
|
||||
MOZ_CRASH("Function return type");
|
||||
}
|
||||
}
|
||||
|
@ -8724,7 +8726,9 @@ bool BaseCompiler::emitCall() {
|
|||
|
||||
popValueStackBy(numArgs);
|
||||
|
||||
pushReturnedIfNonVoid(baselineCall, funcType.ret());
|
||||
if (funcType.ret() != ExprType::Void) {
|
||||
pushReturnValueOfCall(baselineCall, funcType.ret());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -8776,7 +8780,9 @@ bool BaseCompiler::emitCallIndirect() {
|
|||
|
||||
popValueStackBy(numArgs);
|
||||
|
||||
pushReturnedIfNonVoid(baselineCall, funcType.ret());
|
||||
if (funcType.ret() != ExprType::Void) {
|
||||
pushReturnValueOfCall(baselineCall, funcType.ret());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -8839,7 +8845,8 @@ bool BaseCompiler::emitUnaryMathBuiltinCall(SymbolicAddress callee,
|
|||
|
||||
popValueStackBy(numArgs);
|
||||
|
||||
pushReturnedIfNonVoid(baselineCall, retType);
|
||||
// We know retType isn't ExprType::Void here, so there's no need to check it.
|
||||
pushReturnValueOfCall(baselineCall, retType);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -9768,7 +9775,8 @@ void BaseCompiler::emitCompareRef(Assembler::Condition compareOp,
|
|||
|
||||
bool BaseCompiler::emitInstanceCall(uint32_t lineOrBytecode,
|
||||
const MIRTypeVector& sig, ExprType retType,
|
||||
SymbolicAddress builtin) {
|
||||
SymbolicAddress builtin,
|
||||
bool pushReturnedValue/*=true*/) {
|
||||
MOZ_ASSERT(sig[0] == MIRType::Pointer);
|
||||
|
||||
sync();
|
||||
|
@ -9819,7 +9827,10 @@ bool BaseCompiler::emitInstanceCall(uint32_t lineOrBytecode,
|
|||
// a return value. Examples include memory and table operations that are
|
||||
// implemented as callouts.
|
||||
|
||||
pushReturnedIfNonVoid(baselineCall, retType);
|
||||
if (pushReturnedValue) {
|
||||
MOZ_ASSERT(retType != ExprType::Void);
|
||||
pushReturnValueOfCall(baselineCall, retType);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -10235,15 +10246,17 @@ bool BaseCompiler::emitMemOrTableCopy(bool isMem) {
|
|||
if (isMem) {
|
||||
MOZ_ASSERT(srcMemOrTableIndex == 0);
|
||||
MOZ_ASSERT(dstMemOrTableIndex == 0);
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPIII_, ExprType::Void,
|
||||
SymbolicAddress::MemCopy)) {
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPIII_, ExprType::I32,
|
||||
SymbolicAddress::MemCopy,
|
||||
/*pushReturnedValue=*/false)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
pushI32(dstMemOrTableIndex);
|
||||
pushI32(srcMemOrTableIndex);
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPIIIII_, ExprType::Void,
|
||||
SymbolicAddress::TableCopy)) {
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPIIIII_, ExprType::I32,
|
||||
SymbolicAddress::TableCopy,
|
||||
/*pushReturnedValue=*/false)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -10274,7 +10287,8 @@ bool BaseCompiler::emitDataOrElemDrop(bool isData) {
|
|||
pushI32(int32_t(segIndex));
|
||||
SymbolicAddress callee =
|
||||
isData ? SymbolicAddress::DataDrop : SymbolicAddress::ElemDrop;
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPI_, ExprType::Void, callee)) {
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPI_, ExprType::Void, callee,
|
||||
/*pushReturnedValue=*/false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -10300,7 +10314,8 @@ bool BaseCompiler::emitMemFill() {
|
|||
|
||||
// Returns -1 on trap, otherwise 0.
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPIII_, ExprType::Void,
|
||||
SymbolicAddress::MemFill)) {
|
||||
SymbolicAddress::MemFill,
|
||||
/*pushReturnedValue=*/false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -10331,13 +10346,15 @@ bool BaseCompiler::emitMemOrTableInit(bool isMem) {
|
|||
pushI32(int32_t(segIndex));
|
||||
if (isMem) {
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPIIII_, ExprType::Void,
|
||||
SymbolicAddress::MemInit)) {
|
||||
SymbolicAddress::MemInit,
|
||||
/*pushReturnedValue=*/false)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
pushI32(dstTableIndex);
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPIIIII_, ExprType::Void,
|
||||
SymbolicAddress::TableInit)) {
|
||||
SymbolicAddress::TableInit,
|
||||
/*pushReturnedValue=*/false)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -10415,8 +10432,9 @@ bool BaseCompiler::emitTableSet() {
|
|||
//
|
||||
// Returns -1 on range error, otherwise 0 (which is then ignored).
|
||||
pushI32(tableIndex);
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPIRI_, ExprType::Void,
|
||||
SymbolicAddress::TableSet)) {
|
||||
if (!emitInstanceCall(lineOrBytecode, SigPIRI_, ExprType::I32,
|
||||
SymbolicAddress::TableSet,
|
||||
/*pushReturnedValue=*/false)) {
|
||||
return false;
|
||||
}
|
||||
Label noTrap;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Use a XUL element here so we can get its boxObject.screenX/Y -->
|
||||
<!-- Use a XUL element here so we can get its screenX/Y -->
|
||||
<hbox style="height:10px; position:absolute; left:0; top:0; z-index:-100;" id="h1"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<hbox style="width:100px;"></hbox><hbox id="h2"/>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Use a XUL element here so we can get its boxObject.screenX/Y -->
|
||||
<!-- Use a XUL element here so we can get its screenX/Y -->
|
||||
<hbox style="height:10px; position:absolute; left:0; top:0; z-index:-100;" id="h1"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<hbox style="width:100px;"></hbox><hbox id="h2"/>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Use a XUL element here so we can get its boxObject.screenX/Y -->
|
||||
<!-- Use a XUL element here so we can get its screenX/Y -->
|
||||
<hbox style="height:10px; position:absolute; left:0; top:0; z-index:-100;" id="h1"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<hbox style="width:100px;"></hbox><hbox id="h2"/>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Use a XUL element here so we can get its boxObject.screenX/Y -->
|
||||
<!-- Use a XUL element here so we can get its screenX/Y -->
|
||||
<hbox style="height:10px; position:absolute; left:0; top:0; z-index:-100;" id="h1"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<hbox style="width:100px;"></hbox><hbox id="h2"/>
|
||||
|
|
|
@ -131,7 +131,7 @@ checkClipRegionNoBounds = function checkClipRegionNoBounds(id, rects) {
|
|||
function loaded() {
|
||||
var h1 = document.getElementById("h1");
|
||||
var h2 = document.getElementById("h2");
|
||||
var hwidth = h2.boxObject.screenX - h1.boxObject.screenX;
|
||||
var hwidth = h2.screenX - h1.screenX;
|
||||
if (hwidth != 100) {
|
||||
// Maybe it's a DPI issue
|
||||
todo(false, "Unexpected DPI?");
|
||||
|
@ -148,8 +148,8 @@ function loaded() {
|
|||
}
|
||||
|
||||
var bounds = h1.getBoundingClientRect();
|
||||
windowFrameX = h1.boxObject.screenX - bounds.left - window.screenX;
|
||||
windowFrameY = h1.boxObject.screenY - bounds.top - window.screenY;
|
||||
windowFrameX = h1.screenX - bounds.left - window.screenX;
|
||||
windowFrameY = h1.screenY - bounds.top - window.screenY;
|
||||
|
||||
// Run actual test code
|
||||
runTests();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Use a XUL element here so we can get its boxObject.screenX/Y -->
|
||||
<!-- Use a XUL element here so we can get its screenX/Y -->
|
||||
<hbox style="height:10px; position:absolute; left:0; top:0; z-index:-100;" id="h1"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<hbox style="width:100px;"></hbox><hbox id="h2"/>
|
||||
|
@ -41,7 +41,7 @@ function checkGeometry(id, x, y, w, h) {
|
|||
function runTests() {
|
||||
var h1 = document.getElementById("h1");
|
||||
var h2 = document.getElementById("h2");
|
||||
var hwidth = h2.boxObject.screenX - h1.boxObject.screenX;
|
||||
var hwidth = h2.screenX - h1.screenX;
|
||||
if (hwidth != 100) {
|
||||
// Maybe it's a DPI issue
|
||||
todo(false, "Unexpected DPI?");
|
||||
|
@ -56,8 +56,8 @@ function runTests() {
|
|||
}
|
||||
|
||||
var bounds = h1.getBoundingClientRect();
|
||||
windowFrameX = h1.boxObject.screenX - bounds.left - window.screenX;
|
||||
windowFrameY = h1.boxObject.screenY - bounds.top - window.screenY;
|
||||
windowFrameX = h1.screenX - bounds.left - window.screenX;
|
||||
windowFrameY = h1.screenY - bounds.top - window.screenY;
|
||||
|
||||
checkGeometry("p", 0, 0, 200, 200);
|
||||
// This one tests widget positioning in the presence of borders and padding
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<html class="reftest-paged">
|
||||
<title>A reference of green box</title>
|
||||
<style>
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: green;
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
||||
</html>
|
|
@ -0,0 +1,16 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<html>
|
||||
<title>prefers-color-scheme is supported</title>
|
||||
<style>
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme) {
|
||||
div { background-color: green; }
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
||||
</html>
|
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<html>
|
||||
<title>prefers-color-scheme: dark</title>
|
||||
<style>
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
div { background-color: green; }
|
||||
}
|
||||
@media (prefers-color-scheme: light) {
|
||||
div { background-color: red; }
|
||||
}
|
||||
@media (prefers-color-scheme: no-preference) {
|
||||
div { background-color: red; }
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
||||
</html>
|
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<html>
|
||||
<title>prefers-color-scheme: light</title>
|
||||
<style>
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
div { background-color: green; }
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
div { background-color: red; }
|
||||
}
|
||||
@media (prefers-color-scheme: no-preference) {
|
||||
div { background-color: red; }
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
||||
</html>
|
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<html>
|
||||
<title>prefers-color-scheme: no-preference</title>
|
||||
<style>
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: no-preference) {
|
||||
div { background-color: green; }
|
||||
}
|
||||
@media (prefers-color-scheme: light) {
|
||||
div { background-color: red; }
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
div { background-color: red; }
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
||||
</html>
|
|
@ -0,0 +1,22 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<html class="reftest-paged">
|
||||
<title>prefers-color-scheme: light in print mode</title>
|
||||
<style>
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
div { background-color: green; }
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
div { background-color: red; }
|
||||
}
|
||||
@media (prefers-color-scheme: no-preference) {
|
||||
div { background-color: red; }
|
||||
}
|
||||
</style>
|
||||
<div></div>
|
||||
</html>
|
|
@ -27,3 +27,9 @@ test-pref(ui.prefersReducedMotion,0) == mq_prefers_reduced_motion_reduce.html ab
|
|||
test-pref(ui.prefersReducedMotion,1) == mq_prefers_reduced_motion_reduce.html greenbox.html
|
||||
test-pref(privacy.resistFingerprinting,true) test-pref(ui.prefersReducedMotion,1) == mq_prefers_reduced_motion_reduce.html about:blank
|
||||
test-pref(privacy.resistFingerprinting,true) == mq_prefers_reduced_motion_both.html greenbox.html
|
||||
test-pref(ui.systemUsesDarkTheme,1) == mq_prefers_color_scheme.html greenbox.html
|
||||
test-pref(privacy.resistFingerprinting,true) == mq_prefers_color_scheme_light.html greenbox.html
|
||||
== mq_prefers_color_scheme_print.html greenbox-print.html
|
||||
test-pref(ui.systemUsesDarkTheme,0) == mq_prefers_color_scheme_light.html greenbox.html
|
||||
test-pref(ui.systemUsesDarkTheme,1) == mq_prefers_color_scheme_dark.html greenbox.html
|
||||
test-pref(ui.systemUsesDarkTheme,2) == mq_prefers_color_scheme_no_preference.html greenbox.html
|
||||
|
|
|
@ -799,6 +799,8 @@ void Gecko_MediaFeatures_GetDeviceSize(mozilla::dom::Document*, nscoord* width,
|
|||
|
||||
float Gecko_MediaFeatures_GetResolution(mozilla::dom::Document*);
|
||||
bool Gecko_MediaFeatures_PrefersReducedMotion(mozilla::dom::Document*);
|
||||
mozilla::StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme(
|
||||
mozilla::dom::Document*);
|
||||
|
||||
mozilla::PointerCapabilities Gecko_MediaFeatures_PrimaryPointerCapabilities(
|
||||
mozilla::dom::Document*);
|
||||
|
|
|
@ -390,6 +390,7 @@ cbindgen-types = [
|
|||
{ gecko = "StyleCursorKind", servo = "values::computed::ui::CursorKind" },
|
||||
{ gecko = "StyleDisplay", servo = "values::specified::Display" },
|
||||
{ gecko = "StyleDisplayMode", servo = "gecko::media_features::DisplayMode" },
|
||||
{ gecko = "StylePrefersColorScheme", servo = "gecko::media_features::PrefersColorScheme" },
|
||||
{ gecko = "StyleExtremumLength", servo = "values::computed::length::ExtremumLength" },
|
||||
{ gecko = "StyleFillRule", servo = "values::generics::basic_shape::FillRule" },
|
||||
{ gecko = "StyleFontDisplay", servo = "font_face::FontDisplay" },
|
||||
|
@ -485,6 +486,7 @@ structs-types = [
|
|||
"mozilla::StyleMotion",
|
||||
"mozilla::UniquePtr",
|
||||
"mozilla::StyleDisplayMode",
|
||||
"mozilla::StylePrefersColorScheme",
|
||||
"mozilla::StyleIntersectionObserverRootMargin",
|
||||
"mozilla::StyleComputedFontStretchRange",
|
||||
"mozilla::StyleComputedFontStyleDescriptor",
|
||||
|
|
|
@ -238,6 +238,26 @@ bool Gecko_MediaFeatures_PrefersReducedMotion(Document* aDocument) {
|
|||
return LookAndFeel::GetInt(LookAndFeel::eIntID_PrefersReducedMotion, 0) == 1;
|
||||
}
|
||||
|
||||
StylePrefersColorScheme Gecko_MediaFeatures_PrefersColorScheme(Document* aDocument) {
|
||||
if (nsContentUtils::ShouldResistFingerprinting(aDocument)) {
|
||||
return StylePrefersColorScheme::Light;
|
||||
}
|
||||
if (nsPresContext* pc = aDocument->GetPresContext()) {
|
||||
if (pc->IsPrintingOrPrintPreview()) {
|
||||
return StylePrefersColorScheme::Light;
|
||||
}
|
||||
}
|
||||
// If LookAndFeel::eIntID_SystemUsesDarkTheme fails then return 2 (no-preference)
|
||||
switch (LookAndFeel::GetInt(LookAndFeel::eIntID_SystemUsesDarkTheme, 2)) {
|
||||
case 0: return StylePrefersColorScheme::Light;
|
||||
case 1: return StylePrefersColorScheme::Dark;
|
||||
case 2: return StylePrefersColorScheme::NoPreference;
|
||||
default:
|
||||
// This only occurs if the user has set the ui.systemUsesDarkTheme pref to an invalid value.
|
||||
return StylePrefersColorScheme::Light;
|
||||
}
|
||||
}
|
||||
|
||||
static PointerCapabilities GetPointerCapabilities(Document* aDocument,
|
||||
LookAndFeel::IntID aID) {
|
||||
MOZ_ASSERT(aID == LookAndFeel::eIntID_PrimaryPointerCapabilities ||
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
# include "nsXULPopupManager.h"
|
||||
#endif
|
||||
#include "nsIPopupContainer.h"
|
||||
#include "nsIBoxObject.h"
|
||||
#include "nsTreeColumns.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
|
@ -30,7 +29,6 @@
|
|||
#include "mozilla/LookAndFeel.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/Event.h" // for Event
|
||||
#include "mozilla/dom/BoxObject.h"
|
||||
#include "mozilla/dom/MouseEvent.h"
|
||||
#include "mozilla/dom/TreeColumnBinding.h"
|
||||
#include "mozilla/dom/XULTreeElementBinding.h"
|
||||
|
@ -325,25 +323,19 @@ void nsXULTooltipListener::CheckTreeBodyMove(MouseEvent* aMouseEvent) {
|
|||
nsCOMPtr<nsIContent> sourceNode = do_QueryReferent(mSourceNode);
|
||||
if (!sourceNode) return;
|
||||
|
||||
// get the boxObject of the documentElement of the document the tree is in
|
||||
nsCOMPtr<nsIBoxObject> bx;
|
||||
// get the documentElement of the document the tree is in
|
||||
Document* doc = sourceNode->GetComposedDoc();
|
||||
if (doc) {
|
||||
ErrorResult ignored;
|
||||
bx = doc->GetBoxObjectFor(doc->GetRootElement(), ignored);
|
||||
}
|
||||
|
||||
RefPtr<XULTreeElement> tree = GetSourceTree();
|
||||
if (bx && tree) {
|
||||
Element* root = doc ? doc->GetRootElement() : nullptr;
|
||||
if (root && root->GetPrimaryFrame() && tree) {
|
||||
int32_t x = aMouseEvent->ScreenX(CallerType::System);
|
||||
int32_t y = aMouseEvent->ScreenY(CallerType::System);
|
||||
|
||||
// subtract off the documentElement's boxObject
|
||||
int32_t boxX, boxY;
|
||||
bx->GetScreenX(&boxX);
|
||||
bx->GetScreenY(&boxY);
|
||||
x -= boxX;
|
||||
y -= boxY;
|
||||
// subtract off the documentElement's position
|
||||
CSSIntRect rect = root->GetPrimaryFrame()->GetScreenRect();
|
||||
x -= rect.x;
|
||||
y -= rect.y;
|
||||
|
||||
ErrorResult rv;
|
||||
TreeCellInfo cellInfo;
|
||||
|
|
|
@ -10,11 +10,7 @@
|
|||
|
||||
#include "common_audio/fir_filter_neon.h"
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
|
|
|
@ -13,11 +13,7 @@
|
|||
|
||||
#include "common_audio/resampler/sinc_resampler.h"
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
|
|
@ -10,11 +10,7 @@
|
|||
|
||||
#include "common_audio/signal_processing/include/signal_processing_library.h"
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
static inline void DotProductWithScaleNeon(int32_t* cross_correlation,
|
||||
const int16_t* vector1,
|
||||
|
@ -55,7 +51,7 @@ static inline void DotProductWithScaleNeon(int32_t* cross_correlation,
|
|||
}
|
||||
|
||||
sum0 = vaddq_s64(sum0, sum1);
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
int64_t sum2 = vaddvq_s64(sum0);
|
||||
*cross_correlation = (int32_t)((sum2 + sum_res) >> scaling);
|
||||
#else
|
||||
|
|
|
@ -10,11 +10,7 @@
|
|||
|
||||
#include "common_audio/signal_processing/include/signal_processing_library.h"
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
// NEON intrinsics version of WebRtcSpl_DownsampleFast()
|
||||
// for ARM 32-bit/64-bit platforms.
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
|
@ -41,7 +37,7 @@ int16_t WebRtcSpl_MaxAbsValueW16Neon(const int16_t* vector, size_t length) {
|
|||
p_start += 8;
|
||||
}
|
||||
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#ifdef WEBRTC_ARCH_ARM64
|
||||
maximum = (int)vmaxvq_u16(max_qv);
|
||||
#else
|
||||
uint16x4_t max_dv;
|
||||
|
@ -101,7 +97,7 @@ int32_t WebRtcSpl_MaxAbsValueW32Neon(const int32_t* vector, size_t length) {
|
|||
}
|
||||
|
||||
uint32x4_t max32x4 = vmaxq_u32(max32x4_0, max32x4_1);
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
maximum = vmaxvq_u32(max32x4);
|
||||
#else
|
||||
uint32x2_t max32x2 = vmax_u32(vget_low_u32(max32x4), vget_high_u32(max32x4));
|
||||
|
@ -144,7 +140,7 @@ int16_t WebRtcSpl_MaxValueW16Neon(const int16_t* vector, size_t length) {
|
|||
p_start += 8;
|
||||
}
|
||||
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
maximum = vmaxvq_s16(max16x8);
|
||||
#else
|
||||
int16x4_t max16x4 = vmax_s16(vget_low_s16(max16x8), vget_high_s16(max16x8));
|
||||
|
@ -187,7 +183,7 @@ int32_t WebRtcSpl_MaxValueW32Neon(const int32_t* vector, size_t length) {
|
|||
}
|
||||
|
||||
int32x4_t max32x4 = vmaxq_s32(max32x4_0, max32x4_1);
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
maximum = vmaxvq_s32(max32x4);
|
||||
#else
|
||||
int32x2_t max32x2 = vmax_s32(vget_low_s32(max32x4), vget_high_s32(max32x4));
|
||||
|
@ -224,7 +220,7 @@ int16_t WebRtcSpl_MinValueW16Neon(const int16_t* vector, size_t length) {
|
|||
p_start += 8;
|
||||
}
|
||||
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
minimum = vminvq_s16(min16x8);
|
||||
#else
|
||||
int16x4_t min16x4 = vmin_s16(vget_low_s16(min16x8), vget_high_s16(min16x8));
|
||||
|
@ -267,7 +263,7 @@ int32_t WebRtcSpl_MinValueW32Neon(const int32_t* vector, size_t length) {
|
|||
}
|
||||
|
||||
int32x4_t min32x4 = vminq_s32(min32x4_0, min32x4_1);
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
minimum = vminvq_s32(min32x4);
|
||||
#else
|
||||
int32x2_t min32x2 = vmin_s32(vget_low_s32(min32x4), vget_high_s32(min32x4));
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
|
||||
#include "entropy_coding.h"
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
|
||||
#include "signal_processing_library.h"
|
||||
|
|
|
@ -13,11 +13,7 @@
|
|||
// WebRtcIsacfix_AllpassFilter2FixDec16C() in filterbanks.c. Prototype
|
||||
// C code is at end of this file.
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
#include "modules/audio_coding/codecs/isac/fix/source/codec.h"
|
||||
|
@ -48,7 +44,7 @@ int WebRtcIsacfix_AutocorrNeon(int32_t* __restrict r,
|
|||
x_start += 4;
|
||||
}
|
||||
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#ifdef WEBRTC_ARCH_ARM64
|
||||
prod = vaddvq_s64(tmpb_v);
|
||||
#else
|
||||
prod = vget_lane_s64(vadd_s64(vget_low_s64(tmpb_v), vget_high_s64(tmpb_v)),
|
||||
|
@ -94,7 +90,7 @@ int WebRtcIsacfix_AutocorrNeon(int32_t* __restrict r,
|
|||
x_start += 4;
|
||||
y_start += 4;
|
||||
}
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#ifdef WEBRTC_ARCH_ARM64
|
||||
prod = vaddvq_s64(tmpb_v);
|
||||
#else
|
||||
prod = vget_lane_s64(vadd_s64(vget_low_s64(tmpb_v), vget_high_s64(tmpb_v)),
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
#include "modules/audio_coding/codecs/isac/fix/source/codec.h"
|
||||
#include "modules/audio_coding/codecs/isac/fix/source/settings.h"
|
||||
|
|
|
@ -11,12 +11,8 @@
|
|||
#include "modules/audio_coding/codecs/isac/fix/source/pitch_estimator.h"
|
||||
|
||||
#ifdef WEBRTC_HAS_NEON
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "common_audio/signal_processing/include/signal_processing_library.h"
|
||||
#include "rtc_base/compile_assert_c.h"
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
#include "modules/audio_coding/codecs/isac/fix/source/codec.h"
|
||||
#include "modules/audio_coding/codecs/isac/fix/source/fft.h"
|
||||
|
@ -55,7 +51,7 @@ static inline int32_t ComplexMulAndFindMaxNeon(int16_t* inre1Q9,
|
|||
int32x4_t tmp1 = vmull_s16(vget_low_s16(tmpr), vget_low_s16(inre2));
|
||||
tmp0 = vmlal_s16(tmp0, vget_low_s16(tmpi), vget_low_s16(inre2));
|
||||
tmp1 = vmlsl_s16(tmp1, vget_low_s16(tmpi), vget_low_s16(inre1));
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
int32x4_t tmp2 = vmull_high_s16(tmpr, inre1);
|
||||
int32x4_t tmp3 = vmull_high_s16(tmpr, inre2);
|
||||
tmp2 = vmlal_high_s16(tmp2, tmpi, inre2);
|
||||
|
@ -94,7 +90,7 @@ static inline int32_t ComplexMulAndFindMaxNeon(int16_t* inre1Q9,
|
|||
}
|
||||
|
||||
max_r = vmaxq_u32(max_r, max_i);
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
uint32_t maximum = vmaxvq_u32(max_r);
|
||||
#else
|
||||
uint32x2_t max32x2_r = vmax_u32(vget_low_u32(max_r), vget_high_u32(max_r));
|
||||
|
@ -335,7 +331,7 @@ static inline int32_t TransformAndFindMaxNeon(int16_t* inre,
|
|||
}
|
||||
|
||||
max_r = vmaxq_u32(max_r, max_i);
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
uint32_t maximum = vmaxvq_u32(max_r);
|
||||
#else
|
||||
uint32x2_t max32x2_r = vmax_u32(vget_low_u32(max_r), vget_high_u32(max_r));
|
||||
|
|
|
@ -14,11 +14,7 @@
|
|||
* Based on aec_core_sse2.c.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
#include <math.h>
|
||||
#include <string.h> // memset
|
||||
|
||||
|
@ -103,8 +99,7 @@ static float32x4_t vdivq_f32(float32x4_t a, float32x4_t b) {
|
|||
// a/b = a*(1/b)
|
||||
return vmulq_f32(a, x);
|
||||
}
|
||||
#endif
|
||||
#if !defined(WEBRTC_ARCH_ARM64) || (defined(_MSC_VER) && !defined(__clang__))
|
||||
|
||||
static float32x4_t vsqrtq_f32(float32x4_t s) {
|
||||
int i;
|
||||
float32x4_t x = vrsqrteq_f32(s);
|
||||
|
|
|
@ -11,12 +11,8 @@
|
|||
#include "modules/audio_processing/aec3/adaptive_fir_filter.h"
|
||||
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
#endif
|
||||
#include "typedefs.h" // NOLINT(build/include)
|
||||
#if defined(WEBRTC_ARCH_X86_FAMILY)
|
||||
#include <emmintrin.h>
|
||||
|
|
|
@ -10,12 +10,8 @@
|
|||
#include "modules/audio_processing/aec3/matched_filter.h"
|
||||
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
#endif
|
||||
#include "typedefs.h" // NOLINT(build/include)
|
||||
#if defined(WEBRTC_ARCH_X86_FAMILY)
|
||||
#include <emmintrin.h>
|
||||
|
|
|
@ -13,12 +13,8 @@
|
|||
|
||||
#include "typedefs.h" // NOLINT(build/include)
|
||||
#if defined(WEBRTC_HAS_NEON)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
#endif
|
||||
#if defined(WEBRTC_ARCH_X86_FAMILY)
|
||||
#include <emmintrin.h>
|
||||
#endif
|
||||
|
@ -68,7 +64,7 @@ class VectorMath {
|
|||
int j = 0;
|
||||
for (; j < vector_limit * 4; j += 4) {
|
||||
float32x4_t g = vld1q_f32(&x[j]);
|
||||
#if !defined(WEBRTC_ARCH_ARM64) || (defined(_MSC_VER) && !defined(__clang__))
|
||||
#if !defined(WEBRTC_ARCH_ARM64)
|
||||
float32x4_t y = vrsqrteq_f32(g);
|
||||
|
||||
// Code to handle sqrt(0).
|
||||
|
|
|
@ -10,11 +10,7 @@
|
|||
|
||||
#include "modules/audio_processing/aecm/aecm_core.h"
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
#include "common_audio/signal_processing/include/real_fft.h"
|
||||
#include "rtc_base/checks.h"
|
||||
|
@ -23,7 +19,7 @@
|
|||
// generating script and makefile, to replace these C functions.
|
||||
|
||||
static inline void AddLanes(uint32_t* ptr, uint32x4_t v) {
|
||||
#if defined(WEBRTC_ARCH_ARM64) && (!defined(_MSC_VER) || defined(__clang__))
|
||||
#if defined(WEBRTC_ARCH_ARM64)
|
||||
*(ptr) = vaddvq_u32(v);
|
||||
#else
|
||||
uint32x2_t tmp_v;
|
||||
|
|
|
@ -10,11 +10,7 @@
|
|||
|
||||
#include "modules/audio_processing/ns/nsx_core.h"
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
|
|
|
@ -16,11 +16,7 @@
|
|||
|
||||
#include "modules/audio_processing/utility/ooura_fft.h"
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
#include "modules/audio_processing/utility/ooura_fft_tables_common.h"
|
||||
#include "modules/audio_processing/utility/ooura_fft_tables_neon_sse2.h"
|
||||
|
|
|
@ -8,11 +8,7 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#include <arm64_neon.h>
|
||||
#else
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
#include "modules/video_processing/util/denoiser_filter_neon.h"
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ import android.util.Log
|
|||
import android.util.SparseArray
|
||||
|
||||
import org.hamcrest.Matchers.*
|
||||
import org.junit.Assume.assumeThat
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import java.io.File
|
||||
|
@ -149,6 +150,8 @@ class SessionLifecycleTest : BaseSessionTest() {
|
|||
}
|
||||
|
||||
@Test fun readFromParcel_closedSessionAfterReadParcel() {
|
||||
// disable test on opt for frequently failing Bug 1519591
|
||||
assumeThat(sessionRule.env.isDebugBuild, equalTo(true))
|
||||
val session = sessionRule.createOpenSession()
|
||||
|
||||
session.toParcel { parcel ->
|
||||
|
|
|
@ -2839,8 +2839,14 @@ nsresult WebSocketChannel::ApplyForAdmission() {
|
|||
// Called after both OnStartRequest and OnTransportAvailable have
|
||||
// executed. This essentially ends the handshake and starts the websockets
|
||||
// protocol state machine.
|
||||
nsresult WebSocketChannel::StartWebsocketData() {
|
||||
nsresult rv;
|
||||
nsresult WebSocketChannel::CallStartWebsocketData() {
|
||||
LOG(("WebSocketChannel::CallStartWebsocketData() %p", this));
|
||||
MOZ_ASSERT(NS_IsMainThread(), "not main thread");
|
||||
|
||||
if (mOpenTimer) {
|
||||
mOpenTimer->Cancel();
|
||||
mOpenTimer = nullptr;
|
||||
}
|
||||
|
||||
if (!IsOnTargetThread()) {
|
||||
return mTargetThread->Dispatch(
|
||||
|
@ -2849,6 +2855,12 @@ nsresult WebSocketChannel::StartWebsocketData() {
|
|||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
return StartWebsocketData();
|
||||
}
|
||||
|
||||
nsresult WebSocketChannel::StartWebsocketData() {
|
||||
nsresult rv;
|
||||
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
LOG(("WebSocketChannel::StartWebsocketData() %p", this));
|
||||
|
@ -2925,7 +2937,7 @@ nsresult WebSocketChannel::StartPinging() {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void WebSocketChannel::ReportConnectionTelemetry() {
|
||||
void WebSocketChannel::ReportConnectionTelemetry(nsresult aStatusCode) {
|
||||
// 3 bits are used. high bit is for wss, middle bit for failed,
|
||||
// and low bit for proxy..
|
||||
// 0 - 7 : ws-ok-plain, ws-ok-proxy, ws-failed-plain, ws-failed-proxy,
|
||||
|
@ -2943,8 +2955,10 @@ void WebSocketChannel::ReportConnectionTelemetry() {
|
|||
didProxy = true;
|
||||
}
|
||||
|
||||
uint8_t value = (mEncrypted ? (1 << 2) : 0) |
|
||||
(!mGotUpgradeOK ? (1 << 1) : 0) | (didProxy ? (1 << 0) : 0);
|
||||
uint8_t value =
|
||||
(mEncrypted ? (1 << 2) : 0) |
|
||||
(!(mGotUpgradeOK && NS_SUCCEEDED(aStatusCode)) ? (1 << 1) : 0) |
|
||||
(didProxy ? (1 << 0) : 0);
|
||||
|
||||
LOG(("WebSocketChannel::ReportConnectionTelemetry() %p %d", this, value));
|
||||
Telemetry::Accumulate(Telemetry::WEBSOCKETS_HANDSHAKE_TYPE, value);
|
||||
|
@ -3165,7 +3179,6 @@ WebSocketChannel::Notify(nsITimer *timer) {
|
|||
LOG(("WebSocketChannel:: Expecting Server Close - Timed Out\n"));
|
||||
AbortSession(NS_ERROR_NET_TIMEOUT);
|
||||
} else if (timer == mOpenTimer) {
|
||||
MOZ_ASSERT(!mGotUpgradeOK, "Open Timer after open complete");
|
||||
MOZ_ASSERT(NS_IsMainThread(), "not main thread");
|
||||
|
||||
mOpenTimer = nullptr;
|
||||
|
@ -3597,7 +3610,7 @@ WebSocketChannel::OnTransportAvailable(nsISocketTransport *aTransport,
|
|||
// is pending
|
||||
nsWSAdmissionManager::OnConnected(this);
|
||||
|
||||
return StartWebsocketData();
|
||||
return CallStartWebsocketData();
|
||||
}
|
||||
|
||||
if (mIsServerSide) {
|
||||
|
@ -3640,7 +3653,7 @@ WebSocketChannel::OnTransportAvailable(nsISocketTransport *aTransport,
|
|||
}
|
||||
}
|
||||
|
||||
return StartWebsocketData();
|
||||
return CallStartWebsocketData();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -3655,11 +3668,6 @@ WebSocketChannel::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) {
|
|||
MOZ_ASSERT(NS_IsMainThread(), "not main thread");
|
||||
MOZ_ASSERT(!mGotUpgradeOK, "OTA duplicated");
|
||||
|
||||
if (mOpenTimer) {
|
||||
mOpenTimer->Cancel();
|
||||
mOpenTimer = nullptr;
|
||||
}
|
||||
|
||||
if (mStopped) {
|
||||
LOG(("WebSocketChannel::OnStartRequest: Channel Already Done\n"));
|
||||
AbortSession(NS_ERROR_CONNECTION_REFUSED);
|
||||
|
@ -3832,7 +3840,7 @@ WebSocketChannel::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) {
|
|||
// is pending
|
||||
nsWSAdmissionManager::OnConnected(this);
|
||||
|
||||
return StartWebsocketData();
|
||||
return CallStartWebsocketData();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -3845,7 +3853,13 @@ WebSocketChannel::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext,
|
|||
aRequest, mHttpChannel.get(), static_cast<uint32_t>(aStatusCode)));
|
||||
MOZ_ASSERT(NS_IsMainThread(), "not main thread");
|
||||
|
||||
ReportConnectionTelemetry();
|
||||
// OnTransportAvailable won't be called if the request is stopped with
|
||||
// an error. Abort the session now instead of waiting for timeout.
|
||||
if (NS_FAILED(aStatusCode) && !mRecvdHttpUpgradeTransport) {
|
||||
AbortSession(aStatusCode);
|
||||
}
|
||||
|
||||
ReportConnectionTelemetry(aStatusCode);
|
||||
|
||||
// This is the end of the HTTP upgrade transaction, the
|
||||
// upgraded streams live on
|
||||
|
|
|
@ -157,9 +157,10 @@ class WebSocketChannel : public BaseWebSocketChannel,
|
|||
MOZ_MUST_USE nsresult SetupRequest();
|
||||
MOZ_MUST_USE nsresult ApplyForAdmission();
|
||||
MOZ_MUST_USE nsresult DoAdmissionDNS();
|
||||
MOZ_MUST_USE nsresult CallStartWebsocketData();
|
||||
MOZ_MUST_USE nsresult StartWebsocketData();
|
||||
uint16_t ResultToCloseCode(nsresult resultCode);
|
||||
void ReportConnectionTelemetry();
|
||||
void ReportConnectionTelemetry(nsresult aStatusCode);
|
||||
|
||||
void StopSession(nsresult reason);
|
||||
void DoStopSession(nsresult reason);
|
||||
|
|
|
@ -57,6 +57,7 @@ include = [
|
|||
"CursorKind",
|
||||
"Display",
|
||||
"DisplayMode",
|
||||
"PrefersColorScheme",
|
||||
"ExtremumLength",
|
||||
"FillRule",
|
||||
"FontDisplay",
|
||||
|
|
|
@ -280,6 +280,16 @@ enum PrefersReducedMotion {
|
|||
Reduce,
|
||||
}
|
||||
|
||||
/// Values for the prefers-color-scheme media feature.
|
||||
#[derive(Clone, Copy, Debug, FromPrimitive, Parse, PartialEq, ToCss)]
|
||||
#[repr(u8)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum PrefersColorScheme {
|
||||
Light,
|
||||
Dark,
|
||||
NoPreference,
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion
|
||||
fn eval_prefers_reduced_motion(device: &Device, query_value: Option<PrefersReducedMotion>) -> bool {
|
||||
let prefers_reduced =
|
||||
|
@ -348,6 +358,16 @@ fn eval_overflow_inline(device: &Device, query_value: Option<OverflowInline>) ->
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme
|
||||
fn eval_prefers_color_scheme(device: &Device, query_value: Option<PrefersColorScheme>) -> bool {
|
||||
let prefers_color_scheme =
|
||||
unsafe { bindings::Gecko_MediaFeatures_PrefersColorScheme(device.document()) };
|
||||
match query_value {
|
||||
Some(v) => prefers_color_scheme == v,
|
||||
None => prefers_color_scheme != PrefersColorScheme::NoPreference,
|
||||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/mediaqueries-4/#mf-interaction
|
||||
bitflags! {
|
||||
struct PointerCapabilities: u8 {
|
||||
|
@ -526,7 +546,7 @@ lazy_static! {
|
|||
/// to support new types in these entries and (2) ensuring that either
|
||||
/// nsPresContext::MediaFeatureValuesChanged is called when the value that
|
||||
/// would be returned by the evaluator function could change.
|
||||
pub static ref MEDIA_FEATURES: [MediaFeatureDescription; 52] = [
|
||||
pub static ref MEDIA_FEATURES: [MediaFeatureDescription; 53] = [
|
||||
feature!(
|
||||
atom!("width"),
|
||||
AllowsRanges::Yes,
|
||||
|
@ -657,6 +677,12 @@ lazy_static! {
|
|||
keyword_evaluator!(eval_overflow_inline, OverflowInline),
|
||||
ParsingRequirements::empty(),
|
||||
),
|
||||
feature!(
|
||||
atom!("prefers-color-scheme"),
|
||||
AllowsRanges::No,
|
||||
keyword_evaluator!(eval_prefers_color_scheme, PrefersColorScheme),
|
||||
ParsingRequirements::empty(),
|
||||
),
|
||||
feature!(
|
||||
atom!("pointer"),
|
||||
AllowsRanges::No,
|
||||
|
|
|
@ -22,13 +22,34 @@ jobs:
|
|||
symbol: I(ib)
|
||||
desktop1604-test:
|
||||
symbol: I(dt16t)
|
||||
# Neither the debian7-*raw nor the debian7-*packages images can have
|
||||
# packages dependencies.
|
||||
debian7-raw:
|
||||
symbol: I(deb7-raw)
|
||||
definition: debian-raw
|
||||
args:
|
||||
BASE_IMAGE: debian:wheezy-20171210
|
||||
DIST: wheezy
|
||||
SNAPSHOT: '20171210T214726Z'
|
||||
debian7-packages:
|
||||
symbol: I(deb7-pkg)
|
||||
definition: debian-packages
|
||||
parent: debian7-raw
|
||||
debian7-i386-raw:
|
||||
symbol: I(deb7-32-raw)
|
||||
definition: debian-raw
|
||||
args:
|
||||
BASE_IMAGE: i386/debian:wheezy-20171210
|
||||
DIST: wheezy
|
||||
SNAPSHOT: '20171210T214726Z'
|
||||
debian7-i386-packages:
|
||||
symbol: I(deb7-32-pkg)
|
||||
definition: debian-packages
|
||||
parent: debian7-i386-raw
|
||||
debian7-base:
|
||||
symbol: I(deb7-base)
|
||||
definition: debian-base
|
||||
args:
|
||||
DIST: wheezy
|
||||
BASE_TAG: '20171210'
|
||||
SNAPSHOT: '20171210T214726Z'
|
||||
parent: debian7-raw
|
||||
packages:
|
||||
- deb7-gdb
|
||||
- deb7-git
|
||||
|
@ -111,13 +132,23 @@ jobs:
|
|||
parent: debian7-amd64-build
|
||||
lint:
|
||||
symbol: I(lnt)
|
||||
# Neither the debian9-raw nor the debian9-packages images can have
|
||||
# packages dependencies.
|
||||
debian9-raw:
|
||||
symbol: I(deb9-raw)
|
||||
definition: debian-raw
|
||||
args:
|
||||
BASE_IMAGE: debian:stretch-20170620
|
||||
DIST: stretch
|
||||
SNAPSHOT: '20170830T000511Z'
|
||||
debian9-packages:
|
||||
symbol: I(deb9-pkg)
|
||||
definition: debian-packages
|
||||
parent: debian9-raw
|
||||
debian9-base:
|
||||
symbol: I(deb9-base)
|
||||
definition: debian-base
|
||||
args:
|
||||
DIST: stretch
|
||||
BASE_TAG: '20170620'
|
||||
SNAPSHOT: '20170830T000511Z'
|
||||
parent: debian9-raw
|
||||
packages:
|
||||
- deb9-mercurial
|
||||
- deb9-python-zstandard
|
||||
|
|
|
@ -23,7 +23,7 @@ linux64-gn:
|
|||
run:
|
||||
script: build-gn-linux.sh
|
||||
toolchains:
|
||||
- linux64-gcc-4.9
|
||||
- linux64-gcc-6
|
||||
|
||||
macosx64-gn:
|
||||
treeherder:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# %ARG DIST
|
||||
# %ARG BASE_TAG
|
||||
FROM debian:$DIST-$BASE_TAG
|
||||
# %ARG DOCKER_IMAGE_PARENT
|
||||
FROM $DOCKER_IMAGE_PARENT
|
||||
MAINTAINER Mike Hommey <mhommey@mozilla.com>
|
||||
|
||||
### Add worker user and setup its workspace.
|
||||
|
@ -23,36 +22,14 @@ ENV HOME=/builds/worker \
|
|||
SHELL=/bin/bash \
|
||||
USER=worker \
|
||||
LOGNAME=worker \
|
||||
HOSTNAME=taskcluster-worker \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
HOSTNAME=taskcluster-worker
|
||||
|
||||
# Set a default command useful for debugging
|
||||
CMD ["/bin/bash", "--login"]
|
||||
|
||||
# %ARG SNAPSHOT
|
||||
# Set apt sources list to a snapshot.
|
||||
RUN for s in debian_$DIST debian_$DIST-updates debian_$DIST-backports debian-security_$DIST/updates; do \
|
||||
echo "deb http://snapshot.debian.org/archive/${s%_*}/$SNAPSHOT/ ${s#*_} main"; \
|
||||
done > /etc/apt/sources.list && \
|
||||
( echo 'quiet "true";'; \
|
||||
echo 'APT::Get::Assume-Yes "true";'; \
|
||||
echo 'APT::Install-Recommends "false";'; \
|
||||
echo 'Acquire::Check-Valid-Until "false";'; \
|
||||
echo 'Acquire::Retries "5";'; \
|
||||
) > /etc/apt/apt.conf.d/99taskcluster
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install \
|
||||
apt-transport-https \
|
||||
ca-certificates
|
||||
|
||||
COPY setup_packages.sh /usr/local/sbin/
|
||||
COPY cloud-mirror-workaround.sh /usr/local/sbin/
|
||||
|
||||
# %ARG TASKCLUSTER_ROOT_URL
|
||||
# %ARG DOCKER_IMAGE_PACKAGES
|
||||
RUN /usr/local/sbin/setup_packages.sh $TASKCLUSTER_ROOT_URL $DOCKER_IMAGE_PACKAGES && \
|
||||
echo 'dir::bin::methods::https "/usr/local/sbin/cloud-mirror-workaround.sh";' > /etc/apt/apt.conf.d/99cloud-mirror-workaround && \
|
||||
apt-get update && \
|
||||
apt-get install \
|
||||
git \
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
# %ARG DOCKER_IMAGE_PARENT
|
||||
FROM $DOCKER_IMAGE_PARENT
|
||||
MAINTAINER Mike Hommey <mhommey@mozilla.com>
|
||||
|
||||
RUN apt-get install --install-recommends \
|
||||
apt-utils \
|
||||
aptitude \
|
||||
build-essential \
|
||||
devscripts \
|
||||
fakeroot
|
|
@ -0,0 +1,30 @@
|
|||
# %ARG BASE_IMAGE
|
||||
FROM $BASE_IMAGE
|
||||
MAINTAINER Mike Hommey <mhommey@mozilla.com>
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Set a default command useful for debugging
|
||||
CMD ["/bin/bash", "--login"]
|
||||
|
||||
COPY setup_packages.sh /usr/local/sbin/
|
||||
COPY cloud-mirror-workaround.sh /usr/local/sbin/
|
||||
|
||||
# %ARG DIST
|
||||
# %ARG SNAPSHOT
|
||||
# Set apt sources list to a snapshot.
|
||||
RUN for s in debian_$DIST debian_$DIST-updates debian_$DIST-backports debian-security_$DIST/updates; do \
|
||||
echo "deb http://snapshot.debian.org/archive/${s%_*}/$SNAPSHOT/ ${s#*_} main"; \
|
||||
done > /etc/apt/sources.list && \
|
||||
( echo 'quiet "true";'; \
|
||||
echo 'APT::Get::Assume-Yes "true";'; \
|
||||
echo 'APT::Install-Recommends "false";'; \
|
||||
echo 'Acquire::Check-Valid-Until "false";'; \
|
||||
echo 'Acquire::Retries "5";'; \
|
||||
echo 'dir::bin::methods::https "/usr/local/sbin/cloud-mirror-workaround.sh";'; \
|
||||
) > /etc/apt/apt.conf.d/99taskcluster
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install \
|
||||
apt-transport-https \
|
||||
ca-certificates
|
|
@ -18,11 +18,13 @@ MINGW*)
|
|||
WIN_WORKSPACE="$(pwd -W)"
|
||||
COMPRESS_EXT=bz2
|
||||
|
||||
export INCLUDE="$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/include;$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/atlmfc/include;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/ucrt;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/shared;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/um;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/winrt;$WIN_WORKSPACE/build/src/vs2017_15.4.2/DIA SDK/include"
|
||||
export INCLUDE="$WIN_WORKSPACE/build/src/vs2017_15.8.4/VC/include;$WIN_WORKSPACE/build/src/vs2017_15.8.4/VC/atlmfc/include;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/Include/10.0.17134.0/ucrt;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/Include/10.0.17134.0/shared;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/Include/10.0.17134.0/um;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/Include/10.0.17134.0/winrt;$WIN_WORKSPACE/build/src/vs2017_15.8.4/DIA SDK/include"
|
||||
|
||||
export LIB="$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/atlmfc/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/lib/10.0.15063.0/um/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/lib/10.0.15063.0/ucrt/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/DIA SDK/lib/amd64"
|
||||
export LIB="$WIN_WORKSPACE/build/src/vs2017_15.8.4/VC/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.8.4/VC/atlmfc/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/lib/10.0.17134.0/um/x64;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/lib/10.0.17134.0/ucrt/x64;$WIN_WORKSPACE/build/src/vs2017_15.8.4/DIA SDK/lib/amd64"
|
||||
|
||||
PATH="$WORKSPACE/build/src/vs2017_15.4.2/VC/bin/Hostx64/x64:$WORKSPACE/build/src/vs2017_15.4.2/VC/bin/Hostx86/x86:$WORKSPACE/build/src/vs2017_15.4.2/SDK/bin/10.0.15063.0/x64:$WORKSPACE/build/src/vs2017_15.4.2/redist/x64/Microsoft.VC141.CRT:$WORKSPACE/build/src/vs2017_15.4.2/SDK/Redist/ucrt/DLLs/x64:$WORKSPACE/build/src/vs2017_15.4.2/DIA SDK/bin/amd64:$WORKSPACE/build/src/mingw64/bin:$PATH"
|
||||
PATH="$WORKSPACE/build/src/vs2017_15.8.4/VC/bin/Hostx64/x64:$WORKSPACE/build/src/vs2017_15.8.4/VC/bin/Hostx86/x86:$WORKSPACE/build/src/vs2017_15.8.4/SDK/bin/10.0.17134.0/x64:$WORKSPACE/build/src/vs2017_15.8.4/redist/x64/Microsoft.VC141.CRT:$WORKSPACE/build/src/vs2017_15.8.4/SDK/Redist/ucrt/DLLs/x64:$WORKSPACE/build/src/vs2017_15.8.4/DIA SDK/bin/amd64:$WORKSPACE/build/src/mingw64/bin:$PATH"
|
||||
|
||||
export CC=clang-cl
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ fi
|
|||
./build/src/mach artifact toolchain -v --authentication-file="${TOOLTOOL_AUTH_FILE}" --tooltool-manifest "build/src/${TOOLTOOL_MANIFEST}"${TOOLTOOL_CACHE:+ --cache-dir ${TOOLTOOL_CACHE}}${MOZ_TOOLCHAINS:+ ${MOZ_TOOLCHAINS}}
|
||||
|
||||
# Set up all the Visual Studio paths.
|
||||
MSVC_DIR=vs2017_15.4.2
|
||||
MSVC_DIR=vs2017_15.8.4
|
||||
VSWINPATH="$(cd ${MSVC_DIR} && pwd)"
|
||||
|
||||
echo vswinpath ${VSWINPATH}
|
||||
|
@ -29,11 +29,11 @@ export WINDOWSSDKDIR="${VSWINPATH}/SDK"
|
|||
export WIN32_REDIST_DIR="${VSWINPATH}/VC/redist/x86/Microsoft.VC141.CRT"
|
||||
export WIN_UCRT_REDIST_DIR="${VSWINPATH}/SDK/Redist/ucrt/DLLs/x86"
|
||||
|
||||
export PATH="${VSWINPATH}/VC/bin/Hostx64/x86:${VSWINPATH}/VC/bin/Hostx64/x64:${VSWINPATH}/SDK/bin/10.0.15063.0/x64:${VSWINPATH}/DIA SDK/bin:${PATH}"
|
||||
export PATH="${VSWINPATH}/VC/bin/Hostx64/x86:${VSWINPATH}/VC/bin/Hostx64/x64:${VSWINPATH}/SDK/bin/10.0.17134.0/x64:${VSWINPATH}/DIA SDK/bin:${PATH}"
|
||||
export PATH="${VSWINPATH}/VC/redist/x86/Microsoft.VC141.CRT:${VSWINPATH}/SDK/Redist/ucrt/DLLs/x86:${PATH}"
|
||||
|
||||
export INCLUDE="${VSWINPATH}/VC/include:${VSWINPATH}/VC/atlmfc/include:${VSWINPATH}/SDK/Include/10.0.15063.0/ucrt:${VSWINPATH}/SDK/Include/10.0.15063.0/shared:${VSWINPATH}/SDK/Include/10.0.15063.0/um:${VSWINPATH}/SDK/Include/10.0.15063.0/winrt:${VSWINPATH}/DIA SDK/include"
|
||||
export LIB="${VSWINPATH}/VC/lib/x86:${VSWINPATH}/VC/atlmfc/lib/x86:${VSWINPATH}/SDK/Lib/10.0.15063.0/ucrt/x86:${VSWINPATH}/SDK/Lib/10.0.15063.0/um/x86:${VSWINPATH}/DIA SDK/lib"
|
||||
export INCLUDE="${VSWINPATH}/VC/include:${VSWINPATH}/VC/atlmfc/include:${VSWINPATH}/SDK/Include/10.0.17134.0/ucrt:${VSWINPATH}/SDK/Include/10.0.17134.0/shared:${VSWINPATH}/SDK/Include/10.0.17134.0/um:${VSWINPATH}/SDK/Include/10.0.17134.0/winrt:${VSWINPATH}/DIA SDK/include"
|
||||
export LIB="${VSWINPATH}/VC/lib/x86:${VSWINPATH}/VC/atlmfc/lib/x86:${VSWINPATH}/SDK/Lib/10.0.17134.0/ucrt/x86:${VSWINPATH}/SDK/Lib/10.0.17134.0/um/x86:${VSWINPATH}/DIA SDK/lib"
|
||||
|
||||
export PATH="$(cd svn && pwd)/bin:${PATH}"
|
||||
export PATH="$(cd cmake && pwd)/bin:${PATH}"
|
||||
|
|
|
@ -16,7 +16,7 @@ fi
|
|||
./build/src/mach artifact toolchain -v --authentication-file="${TOOLTOOL_AUTH_FILE}" --tooltool-manifest "build/src/${TOOLTOOL_MANIFEST}"${TOOLTOOL_CACHE:+ --cache-dir ${TOOLTOOL_CACHE}}${MOZ_TOOLCHAINS:+ ${MOZ_TOOLCHAINS}}
|
||||
|
||||
# Set up all the Visual Studio paths.
|
||||
MSVC_DIR=vs2017_15.4.2
|
||||
MSVC_DIR=vs2017_15.8.4
|
||||
VSWINPATH="$(cd ${MSVC_DIR} && pwd)"
|
||||
|
||||
echo vswinpath ${VSWINPATH}
|
||||
|
@ -29,10 +29,10 @@ export WINDOWSSDKDIR="${VSWINPATH}/SDK"
|
|||
export WIN32_REDIST_DIR="${VSWINPATH}/VC/redist/x64/Microsoft.VC141.CRT"
|
||||
export WIN_UCRT_REDIST_DIR="${VSWINPATH}/SDK/Redist/ucrt/DLLs/x64"
|
||||
|
||||
export PATH="${VSWINPATH}/VC/bin/Hostx64/x64:${VSWINPATH}/SDK/bin/10.0.15063.0/x64:${VSWINPATH}/VC/redist/x64/Microsoft.VC141.CRT:${VSWINPATH}/SDK/Redist/ucrt/DLLs/x64:${VSWINPATH}/DIA SDK/bin/amd64:${PATH}"
|
||||
export PATH="${VSWINPATH}/VC/bin/Hostx64/x64:${VSWINPATH}/SDK/bin/10.0.17134.0/x64:${VSWINPATH}/VC/redist/x64/Microsoft.VC141.CRT:${VSWINPATH}/SDK/Redist/ucrt/DLLs/x64:${VSWINPATH}/DIA SDK/bin/amd64:${PATH}"
|
||||
|
||||
export INCLUDE="${VSWINPATH}/VC/include:${VSWINPATH}/VC/atlmfc/include:${VSWINPATH}/SDK/Include/10.0.15063.0/ucrt:${VSWINPATH}/SDK/Include/10.0.15063.0/shared:${VSWINPATH}/SDK/Include/10.0.15063.0/um:${VSWINPATH}/SDK/Include/10.0.15063.0/winrt:${VSWINPATH}/DIA SDK/include"
|
||||
export LIB="${VSWINPATH}/VC/lib/x64:${VSWINPATH}/VC/atlmfc/lib/x64:${VSWINPATH}/SDK/Lib/10.0.15063.0/ucrt/x64:${VSWINPATH}/SDK/Lib/10.0.15063.0/um/x64:${VSWINPATH}/DIA SDK/lib/amd64"
|
||||
export INCLUDE="${VSWINPATH}/VC/include:${VSWINPATH}/VC/atlmfc/include:${VSWINPATH}/SDK/Include/10.0.17134.0/ucrt:${VSWINPATH}/SDK/Include/10.0.17134.0/shared:${VSWINPATH}/SDK/Include/10.0.17134.0/um:${VSWINPATH}/SDK/Include/10.0.17134.0/winrt:${VSWINPATH}/DIA SDK/include"
|
||||
export LIB="${VSWINPATH}/VC/lib/x64:${VSWINPATH}/VC/atlmfc/lib/x64:${VSWINPATH}/SDK/Lib/10.0.17134.0/ucrt/x64:${VSWINPATH}/SDK/Lib/10.0.17134.0/um/x64:${VSWINPATH}/DIA SDK/lib/amd64"
|
||||
|
||||
export PATH="$(cd svn && pwd)/bin:${PATH}"
|
||||
export PATH="$(cd cmake && pwd)/bin:${PATH}"
|
||||
|
|
|
@ -2,37 +2,48 @@
|
|||
set -e -v
|
||||
|
||||
# This is shared code for building GN.
|
||||
|
||||
# Each is a recent commit from chromium's master branch.
|
||||
: CHROMIUM_REV ${CHROMIUM_REV:=e6ba81e00ae835946e069e5bd80bd533b11d8442}
|
||||
: GTEST_REV ${GTEST_REV:=6c5116014ce51ef3273d800cbf75fcef99e798c6}
|
||||
: CHROMIUM_SRC_REV ${CHROMIUM_SRC_REV:=c338d43f49c0d72e69cd6e40eeaf4c0597dbdda1}
|
||||
: GN_REV ${GN_REV:=d69a9c3765dee2e650bcccebbadf72c5d42d92b1}
|
||||
|
||||
|
||||
git clone --no-checkout https://chromium.googlesource.com/chromium/src $WORKSPACE/gn-standalone
|
||||
git clone --no-checkout https://gn.googlesource.com/gn $WORKSPACE/gn-standalone
|
||||
cd $WORKSPACE/gn-standalone
|
||||
git checkout $CHROMIUM_SRC_REV
|
||||
git checkout $GN_REV
|
||||
|
||||
git clone --no-checkout https://chromium.googlesource.com/chromium/chromium chromium_checkout
|
||||
cd chromium_checkout
|
||||
git checkout $CHROMIUM_REV
|
||||
mkdir -p ../third_party
|
||||
mv third_party/libevent ../third_party
|
||||
cd ..
|
||||
# We remove /WC because of https://bugs.chromium.org/p/gn/issues/detail?id=51
|
||||
# And /MACHINE:x64 because we just let the PATH decide what cl and link are
|
||||
# used, and if cl is targetting x86, we don't want linkage to fail because of
|
||||
# /MACHINE:x64.
|
||||
patch -p1 <<'EOF'
|
||||
diff --git a/build/gen.py b/build/gen.py
|
||||
index a7142fab..78d0fd56 100755
|
||||
--- a/build/gen.py
|
||||
+++ b/build/gen.py
|
||||
@@ -357,7 +357,6 @@ def WriteGNNinja(path, platform, host, options):
|
||||
'/D_WIN32_WINNT=0x0A00',
|
||||
'/FS',
|
||||
'/W4',
|
||||
- '/WX',
|
||||
'/Zi',
|
||||
'/wd4099',
|
||||
'/wd4100',
|
||||
@@ -373,7 +372,7 @@ def WriteGNNinja(path, platform, host, options):
|
||||
'/D_HAS_EXCEPTIONS=0',
|
||||
])
|
||||
|
||||
- ldflags.extend(['/DEBUG', '/MACHINE:x64'])
|
||||
+ ldflags.extend(['/DEBUG'])
|
||||
|
||||
static_libraries = {
|
||||
'base': {'sources': [
|
||||
EOF
|
||||
|
||||
rm -rf testing
|
||||
mkdir testing
|
||||
cd testing
|
||||
git clone https://chromium.googlesource.com/chromium/testing/gtest
|
||||
cd gtest
|
||||
git checkout $GTEST_REV
|
||||
cd ../..
|
||||
if test -n "$MAC_CROSS"; then
|
||||
python build/gen.py --platform darwin
|
||||
else
|
||||
python build/gen.py
|
||||
fi
|
||||
|
||||
cd tools/gn
|
||||
patch -p1 < $WORKSPACE/build/src/taskcluster/scripts/misc/gn.patch
|
||||
|
||||
./bootstrap/bootstrap.py -s
|
||||
cd ../..
|
||||
ninja -C out -v
|
||||
|
||||
STAGE=gn
|
||||
mkdir -p $UPLOAD_DIR $STAGE
|
||||
|
@ -40,9 +51,9 @@ mkdir -p $UPLOAD_DIR $STAGE
|
|||
# At this point, the resulting binary is at:
|
||||
# $WORKSPACE/out/Release/gn
|
||||
if test "$MAC_CROSS" = "" -a "$(uname)" = "Linux"; then
|
||||
strip out/Release/gn
|
||||
strip out/gn
|
||||
fi
|
||||
cp out/Release/gn $STAGE
|
||||
cp out/gn $STAGE
|
||||
|
||||
tar -acf gn.tar.$COMPRESS_EXT $STAGE
|
||||
cp gn.tar.$COMPRESS_EXT $UPLOAD_DIR
|
||||
|
|
|
@ -8,6 +8,7 @@ UPLOAD_DIR=$HOME/artifacts
|
|||
COMPRESS_EXT=xz
|
||||
export CC=$WORKSPACE/build/src/gcc/bin/gcc
|
||||
export CXX=$WORKSPACE/build/src/gcc/bin/g++
|
||||
export LDFLAGS=-lrt
|
||||
|
||||
# Gn build scripts use #!/usr/bin/env python, which will be python 2.6 on
|
||||
# the worker and cause failures. Work around this by putting python2.7
|
||||
|
|
|
@ -13,7 +13,7 @@ CROSS_SYSROOT=$WORKSPACE/build/src/MacOSX10.11.sdk
|
|||
export LD_LIBRARY_PATH=$WORKSPACE/build/src/clang/lib
|
||||
export CC=$WORKSPACE/build/src/clang/bin/clang
|
||||
export CXX=$WORKSPACE/build/src/clang/bin/clang++
|
||||
export AR=$WORKSPACE/build/src/clang/bin/clang
|
||||
export AR=$WORKSPACE/build/src/clang/bin/llvm-ar
|
||||
export CFLAGS="-target x86_64-darwin11 -mlinker-version=137 -B ${CROSS_CCTOOLS_PATH}/bin -isysroot ${CROSS_SYSROOT} -I${CROSS_SYSROOT}/usr/include -iframework ${CROSS_SYSROOT}/System/Library/Frameworks"
|
||||
export CXXFLAGS="-stdlib=libc++ ${CFLAGS}"
|
||||
export LDFLAGS="${CXXFLAGS} -Wl,-syslibroot,${CROSS_SYSROOT} -Wl,-dead_strip"
|
||||
|
|
|
@ -7,17 +7,22 @@ WORKSPACE=$PWD
|
|||
UPLOAD_DIR=$WORKSPACE/public/build
|
||||
COMPRESS_EXT=bz2
|
||||
|
||||
VSPATH="$WORKSPACE/build/src/vs2017_15.4.2"
|
||||
VSPATH="$WORKSPACE/build/src/vs2017_15.8.4"
|
||||
|
||||
export INCLUDE="${VSPATH}/VC/include:${VSPATH}/VC/atlmfc/include:${VSPATH}/SDK/Include/10.0.15063.0/ucrt:${VSPATH}/SDK/Include/10.0.15063.0/shared:${VSPATH}/SDK/Include/10.0.15063.0/um:${VSPATH}/SDK/Include/10.0.15063.0/winrt:${VSPATH}/DIA SDK/include"
|
||||
export LIB="${VSPATH}/VC/lib/x86:${VSPATH}/VC/atlmfc/lib/x86:${VSPATH}/SDK/lib/10.0.15063.0/ucrt/x86:${VSPATH}/SDK/lib/10.0.15063.0/um/x86:${VSPATH}/DIA SDK/lib"
|
||||
export INCLUDE="${VSPATH}/VC/include:${VSPATH}/VC/atlmfc/include:${VSPATH}/SDK/Include/10.0.17134.0/ucrt:${VSPATH}/SDK/Include/10.0.17134.0/shared:${VSPATH}/SDK/Include/10.0.17134.0/um:${VSPATH}/SDK/Include/10.0.17134.0/winrt:${VSPATH}/DIA SDK/include"
|
||||
export LIB="${VSPATH}/VC/lib/x86:${VSPATH}/VC/atlmfc/lib/x86:${VSPATH}/SDK/lib/10.0.17134.0/ucrt/x86:${VSPATH}/SDK/lib/10.0.17134.0/um/x86:${VSPATH}/DIA SDK/lib"
|
||||
|
||||
export PATH="$WORKSPACE/build/src/ninja/bin:$PATH"
|
||||
export PATH="$WORKSPACE/build/src/mingw64/bin:$PATH"
|
||||
export PATH="${VSPATH}/VC/bin/Hostx64/x86:${VSPATH}/VC/bin/Hostx64/x64:${VSPATH}/VC/bin/Hostx86/x86:${VSPATH}/SDK/bin/10.0.15063.0/x64:${VSPATH}/DIA SDK/bin:${PATH}"
|
||||
export PATH="${VSPATH}/VC/bin/Hostx64/x86:${VSPATH}/VC/bin/Hostx64/x64:${VSPATH}/VC/bin/Hostx86/x86:${VSPATH}/SDK/bin/10.0.17134.0/x64:${VSPATH}/DIA SDK/bin:${PATH}"
|
||||
export PATH="${VSPATH}/VC/redist/x86/Microsoft.VC141.CRT:${VSPATH}/SDK/Redist/ucrt/DLLs/x86:${PATH}"
|
||||
|
||||
cd $WORKSPACE/build/src
|
||||
|
||||
. taskcluster/scripts/misc/tooltool-download.sh
|
||||
. taskcluster/scripts/misc/build-gn-common.sh
|
||||
|
||||
# Building with MSVC spawns a mspdbsrv process that keeps a dll open in the MSVC directory.
|
||||
# This prevents the taskcluster worker from unmounting cleanly, and fails the build.
|
||||
# So we kill it.
|
||||
taskkill -f -im mspdbsrv.exe || true
|
||||
|
|
|
@ -22,11 +22,11 @@ MINGW*)
|
|||
WIN_WORKSPACE="$(pwd -W)"
|
||||
COMPRESS_EXT=bz2
|
||||
|
||||
export INCLUDE="$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/include;$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/atlmfc/include;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/ucrt;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/shared;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/um;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/Include/10.0.15063.0/winrt;$WIN_WORKSPACE/build/src/vs2017_15.4.2/DIA SDK/include"
|
||||
export INCLUDE="$WIN_WORKSPACE/build/src/vs2017_15.8.4/VC/include;$WIN_WORKSPACE/build/src/vs2017_15.8.4/VC/atlmfc/include;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/Include/10.0.17134.0/ucrt;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/Include/10.0.17134.0/shared;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/Include/10.0.17134.0/um;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/Include/10.0.17134.0/winrt;$WIN_WORKSPACE/build/src/vs2017_15.8.4/DIA SDK/include"
|
||||
|
||||
export LIB="$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/VC/atlmfc/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/lib/10.0.15063.0/um/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/SDK/lib/10.0.15063.0/ucrt/x64;$WIN_WORKSPACE/build/src/vs2017_15.4.2/DIA SDK/lib/amd64"
|
||||
export LIB="$WIN_WORKSPACE/build/src/vs2017_15.8.4/VC/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.8.4/VC/atlmfc/lib/x64;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/lib/10.0.17134.0/um/x64;$WIN_WORKSPACE/build/src/vs2017_15.8.4/SDK/lib/10.0.17134.0/ucrt/x64;$WIN_WORKSPACE/build/src/vs2017_15.8.4/DIA SDK/lib/amd64"
|
||||
|
||||
PATH="$WORKSPACE/build/src/vs2017_15.4.2/VC/bin/Hostx64/x64:$WORKSPACE/build/src/vs2017_15.4.2/VC/bin/Hostx86/x86:$WORKSPACE/build/src/vs2017_15.4.2/SDK/bin/10.0.15063.0/x64:$WORKSPACE/build/src/vs2017_15.4.2/redist/x64/Microsoft.VC141.CRT:$WORKSPACE/build/src/vs2017_15.4.2/SDK/Redist/ucrt/DLLs/x64:$WORKSPACE/build/src/vs2017_15.4.2/DIA SDK/bin/amd64:$WORKSPACE/build/src/mingw64/bin:$PATH"
|
||||
PATH="$WORKSPACE/build/src/vs2017_15.8.4/VC/bin/Hostx64/x64:$WORKSPACE/build/src/vs2017_15.8.4/VC/bin/Hostx86/x86:$WORKSPACE/build/src/vs2017_15.8.4/SDK/bin/10.0.17134.0/x64:$WORKSPACE/build/src/vs2017_15.8.4/redist/x64/Microsoft.VC141.CRT:$WORKSPACE/build/src/vs2017_15.8.4/SDK/Redist/ucrt/DLLs/x64:$WORKSPACE/build/src/vs2017_15.8.4/DIA SDK/bin/amd64:$WORKSPACE/build/src/mingw64/bin:$PATH"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче