mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Merge inbound to m-c a=merge
This commit is contained in:
commit
41165287c7
@ -18,6 +18,10 @@
|
||||
#include "mozilla/AppUnits.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
#include "gfxPlatformGtk.h" // xxx - for UseFcFontList
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
@ -628,21 +632,30 @@ TextAttrsMgr::FontWeightTextAttr::
|
||||
if (font->IsSyntheticBold())
|
||||
return 700;
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
|
||||
// On Linux, font->GetStyle()->weight will give the absolute weight requested
|
||||
// of the font face. The Linux code uses the gfxFontEntry constructor which
|
||||
// doesn't initialize the weight field.
|
||||
return font->GetStyle()->weight;
|
||||
#else
|
||||
// On Windows, font->GetStyle()->weight will give the same weight as
|
||||
// fontEntry->Weight(), the weight of the first font in the font group, which
|
||||
// may not be the weight of the font face used to render the characters.
|
||||
// On Mac, font->GetStyle()->weight will just give the same number as
|
||||
// getComputedStyle(). fontEntry->Weight() will give the weight of the font
|
||||
// face used.
|
||||
gfxFontEntry *fontEntry = font->GetFontEntry();
|
||||
return fontEntry->Weight();
|
||||
bool useFontEntryWeight = true;
|
||||
|
||||
// Under Linux, when gfxPangoFontGroup code is used,
|
||||
// font->GetStyle()->weight will give the absolute weight requested of the
|
||||
// font face. The gfxPangoFontGroup code uses the gfxFontEntry constructor
|
||||
// which doesn't initialize the weight field.
|
||||
#if defined(MOZ_WIDGET_QT)
|
||||
useFontEntryWeight = false;
|
||||
#elif defined(MOZ_WIDGET_GTK)
|
||||
useFontEntryWeight = gfxPlatformGtk::UseFcFontList();
|
||||
#endif
|
||||
|
||||
if (useFontEntryWeight) {
|
||||
// On Windows, font->GetStyle()->weight will give the same weight as
|
||||
// fontEntry->Weight(), the weight of the first font in the font group,
|
||||
// which may not be the weight of the font face used to render the
|
||||
// characters. On Mac, font->GetStyle()->weight will just give the same
|
||||
// number as getComputedStyle(). fontEntry->Weight() will give the weight
|
||||
// of the font face used.
|
||||
gfxFontEntry *fontEntry = font->GetFontEntry();
|
||||
return fontEntry->Weight();
|
||||
} else {
|
||||
return font->GetStyle()->weight;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -149,7 +149,10 @@ WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
switch (msg) {
|
||||
case WM_GETOBJECT:
|
||||
{
|
||||
if (lParam == OBJID_CLIENT) {
|
||||
// Do explicit casting to make it working on 64bit systems (see bug 649236
|
||||
// for details).
|
||||
int32_t objId = static_cast<DWORD>(lParam);
|
||||
if (objId == OBJID_CLIENT) {
|
||||
DocAccessible* document =
|
||||
nsWinUtils::sHWNDCache->GetWeak(static_cast<void*>(hWnd));
|
||||
if (document) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
"use strict"
|
||||
|
||||
this.EXPORTED_SYMBOLS = [];
|
||||
this.EXPORTED_SYMBOLS = ["AboutServiceWorkers"];
|
||||
|
||||
const { interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
@ -47,19 +47,6 @@ function serializeServiceWorkerInfo(aServiceWorkerInfo) {
|
||||
return result;
|
||||
}
|
||||
|
||||
function sendResult(aId, aResult) {
|
||||
SystemAppProxy._sendCustomEvent("mozAboutServiceWorkersChromeEvent", {
|
||||
id: aId,
|
||||
result: aResult
|
||||
});
|
||||
}
|
||||
|
||||
function sendError(aId, aError) {
|
||||
SystemAppProxy._sendCustomEvent("mozAboutServiceWorkersChromeEvent", {
|
||||
id: aId,
|
||||
error: aError
|
||||
});
|
||||
}
|
||||
|
||||
this.AboutServiceWorkers = {
|
||||
get enabled() {
|
||||
@ -75,7 +62,21 @@ this.AboutServiceWorkers = {
|
||||
|
||||
init: function() {
|
||||
SystemAppProxy.addEventListener("mozAboutServiceWorkersContentEvent",
|
||||
AboutServiceWorkers);
|
||||
AboutServiceWorkers);
|
||||
},
|
||||
|
||||
sendResult: function(aId, aResult) {
|
||||
SystemAppProxy._sendCustomEvent("mozAboutServiceWorkersChromeEvent", {
|
||||
id: aId,
|
||||
result: aResult
|
||||
});
|
||||
},
|
||||
|
||||
sendError: function(aId, aError) {
|
||||
SystemAppProxy._sendCustomEvent("mozAboutServiceWorkersChromeEvent", {
|
||||
id: aId,
|
||||
error: aError
|
||||
});
|
||||
},
|
||||
|
||||
handleEvent: function(aEvent) {
|
||||
@ -88,10 +89,12 @@ this.AboutServiceWorkers = {
|
||||
return;
|
||||
}
|
||||
|
||||
let self = AboutServiceWorkers;
|
||||
|
||||
switch(message.name) {
|
||||
case "init":
|
||||
if (!this.enabled) {
|
||||
sendResult({
|
||||
if (!self.enabled) {
|
||||
self.sendResult(message.id, {
|
||||
enabled: false,
|
||||
registrations: []
|
||||
});
|
||||
@ -100,7 +103,7 @@ this.AboutServiceWorkers = {
|
||||
|
||||
let data = gServiceWorkerManager.getAllRegistrations();
|
||||
if (!data) {
|
||||
sendError(message.id, "NoServiceWorkersRegistrations");
|
||||
self.sendError(message.id, "NoServiceWorkersRegistrations");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -116,26 +119,26 @@ this.AboutServiceWorkers = {
|
||||
registrations.push(serializeServiceWorkerInfo(info));
|
||||
}
|
||||
|
||||
sendResult(message.id, {
|
||||
enabled: this.enabled,
|
||||
self.sendResult(message.id, {
|
||||
enabled: self.enabled,
|
||||
registrations: registrations
|
||||
});
|
||||
break;
|
||||
|
||||
case "update":
|
||||
if (!message.scope) {
|
||||
sendError(message.id, "MissingScope");
|
||||
self.sendError(message.id, "MissingScope");
|
||||
return;
|
||||
}
|
||||
gServiceWorkerManager.update(message.scope);
|
||||
sendResult(message.id, true);
|
||||
gServiceWorkerManager.softUpdate(message.scope);
|
||||
self.sendResult(message.id, true);
|
||||
break;
|
||||
|
||||
case "unregister":
|
||||
if (!message.principal ||
|
||||
!message.principal.origin ||
|
||||
!message.principal.appId) {
|
||||
sendError("MissingPrincipal");
|
||||
self.sendError("MissingPrincipal");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -146,17 +149,17 @@ this.AboutServiceWorkers = {
|
||||
);
|
||||
|
||||
if (!message.scope) {
|
||||
sendError("MissingScope");
|
||||
self.sendError("MissingScope");
|
||||
return;
|
||||
}
|
||||
|
||||
let serviceWorkerUnregisterCallback = {
|
||||
unregisterSucceeded: function() {
|
||||
sendResult(message.id, true);
|
||||
self.sendResult(message.id, true);
|
||||
},
|
||||
|
||||
unregisterFailed: function() {
|
||||
sendError(message.id, "UnregisterError");
|
||||
self.sendError(message.id, "UnregisterError");
|
||||
},
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([
|
||||
|
139
b2g/components/test/unit/test_aboutserviceworkers.js
Normal file
139
b2g/components/test/unit/test_aboutserviceworkers.js
Normal file
@ -0,0 +1,139 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AboutServiceWorkers",
|
||||
"resource://gre/modules/AboutServiceWorkers.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "gServiceWorkerManager",
|
||||
"@mozilla.org/serviceworkers/manager;1",
|
||||
"nsIServiceWorkerManager");
|
||||
|
||||
const CHROME_MSG = "mozAboutServiceWorkersChromeEvent";
|
||||
|
||||
const ORIGINAL_SENDRESULT = AboutServiceWorkers.sendResult;
|
||||
const ORIGINAL_SENDERROR = AboutServiceWorkers.sendError;
|
||||
|
||||
do_get_profile();
|
||||
|
||||
let mockSendResult = (aId, aResult) => {
|
||||
let msg = {
|
||||
id: aId,
|
||||
result: aResult
|
||||
};
|
||||
Services.obs.notifyObservers({wrappedJSObject: msg}, CHROME_MSG, null);
|
||||
};
|
||||
|
||||
let mockSendError = (aId, aError) => {
|
||||
let msg = {
|
||||
id: aId,
|
||||
result: aError
|
||||
};
|
||||
Services.obs.notifyObservers({wrappedJSObject: msg}, CHROME_MSG, null);
|
||||
};
|
||||
|
||||
function attachMocks() {
|
||||
AboutServiceWorkers.sendResult = mockSendResult;
|
||||
AboutServiceWorkers.sendError = mockSendError;
|
||||
}
|
||||
|
||||
function restoreMocks() {
|
||||
AboutServiceWorkers.sendResult = ORIGINAL_SENDRESULT;
|
||||
AboutServiceWorkers.sendError = ORIGINAL_SENDERROR;
|
||||
}
|
||||
|
||||
do_register_cleanup(restoreMocks);
|
||||
|
||||
function run_test() {
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
/**
|
||||
* "init" tests
|
||||
*/
|
||||
[
|
||||
// Pref disabled, no registrations
|
||||
{
|
||||
prefEnabled: false,
|
||||
expectedMessage: {
|
||||
id: Date.now(),
|
||||
result: {
|
||||
enabled: false,
|
||||
registrations: []
|
||||
}
|
||||
}
|
||||
},
|
||||
// Pref enabled, no registrations
|
||||
{
|
||||
prefEnabled: true,
|
||||
expectedMessage: {
|
||||
id: Date.now(),
|
||||
result: {
|
||||
enabled: true,
|
||||
registrations: []
|
||||
}
|
||||
}
|
||||
}].forEach(test => {
|
||||
add_test(function() {
|
||||
Services.prefs.setBoolPref("dom.serviceWorkers.enabled", test.prefEnabled);
|
||||
|
||||
let id = test.expectedMessage.id;
|
||||
|
||||
function onMessage(subject, topic, data) {
|
||||
let message = subject.wrappedJSObject;
|
||||
let expected = test.expectedMessage;
|
||||
|
||||
do_check_true(message.id, "Message should have id");
|
||||
do_check_eq(message.id, test.expectedMessage.id,
|
||||
"Id should be the expected one");
|
||||
do_check_eq(message.result.enabled, expected.result.enabled,
|
||||
"Pref should be disabled");
|
||||
do_check_true(message.result.registrations, "Registrations should exist");
|
||||
do_check_eq(message.result.registrations.length,
|
||||
expected.result.registrations.length,
|
||||
"Registrations length should be the expected one");
|
||||
|
||||
Services.obs.removeObserver(onMessage, CHROME_MSG);
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
Services.obs.addObserver(onMessage, CHROME_MSG, false);
|
||||
|
||||
attachMocks();
|
||||
|
||||
AboutServiceWorkers.handleEvent({ detail: {
|
||||
id: id,
|
||||
name: "init"
|
||||
}});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* ServiceWorkerManager tests.
|
||||
*/
|
||||
|
||||
// We cannot register a sw via ServiceWorkerManager cause chrome
|
||||
// registrations are not allowed.
|
||||
// All we can do for now is to test the interface of the swm.
|
||||
add_test(function test_swm() {
|
||||
do_check_true(gServiceWorkerManager, "SWM exists");
|
||||
do_check_true(gServiceWorkerManager.getAllRegistrations,
|
||||
"SWM.getAllRegistrations exists");
|
||||
do_check_true(typeof gServiceWorkerManager.getAllRegistrations == "function",
|
||||
"SWM.getAllRegistrations is a function");
|
||||
do_check_true(gServiceWorkerManager.softUpdate, "SWM.softUpdate exists");
|
||||
do_check_true(typeof gServiceWorkerManager.softUpdate == "function",
|
||||
"SWM.softUpdate is a function");
|
||||
do_check_true(gServiceWorkerManager.unregister, "SWM.unregister exists");
|
||||
do_check_true(typeof gServiceWorkerManager.unregister == "function",
|
||||
"SWM.unregister exists");
|
||||
|
||||
run_next_test();
|
||||
});
|
@ -28,3 +28,5 @@ skip-if = toolkit != "gonk"
|
||||
[test_logshake_gonk.js]
|
||||
# only run on b2g builds due to requiring b2g-specific log files to exist
|
||||
skip-if = (toolkit != "gonk")
|
||||
|
||||
[test_aboutserviceworkers.js]
|
||||
|
@ -3099,11 +3099,12 @@
|
||||
} else if (needSpinner && this.spinnerTab !== showTab) {
|
||||
if (this.spinnerTab) {
|
||||
this.spinnerTab.linkedBrowser.removeAttribute("pendingpaint");
|
||||
} else {
|
||||
this.spinnerDisplayed();
|
||||
}
|
||||
this.spinnerTab = showTab;
|
||||
this.tabbrowser.setAttribute("pendingpaint", "true");
|
||||
this.spinnerTab.linkedBrowser.setAttribute("pendingpaint", "true");
|
||||
this.spinnerDisplayed();
|
||||
}
|
||||
|
||||
// Switch to the tab we've decided to make visible.
|
||||
@ -3171,6 +3172,7 @@
|
||||
this.lastVisibleTab = null;
|
||||
}
|
||||
if (this.spinnerTab && !this.spinnerTab.linkedBrowser) {
|
||||
this.spinnerHidden();
|
||||
this.spinnerTab = null;
|
||||
}
|
||||
if (this.loadingTab && !this.loadingTab.linkedBrowser) {
|
||||
@ -3354,6 +3356,7 @@
|
||||
*/
|
||||
|
||||
startTabSwitch: function () {
|
||||
TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
|
||||
TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
|
||||
this.addMarker("AsyncTabSwitch:Start");
|
||||
},
|
||||
@ -3370,21 +3373,19 @@
|
||||
},
|
||||
|
||||
spinnerDisplayed: function () {
|
||||
if (this.spinnerTab) {
|
||||
TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window);
|
||||
this.addMarker("AsyncTabSwitch:SpinnerShown");
|
||||
}
|
||||
this.assert(!this.spinnerTab);
|
||||
TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window);
|
||||
this.addMarker("AsyncTabSwitch:SpinnerShown");
|
||||
},
|
||||
|
||||
spinnerHidden: function () {
|
||||
if (this.spinnerTab) {
|
||||
this.log("DEBUG: spinner time = " +
|
||||
TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window));
|
||||
TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window);
|
||||
this.addMarker("AsyncTabSwitch:SpinnerHidden");
|
||||
// we do not get a onPaint after displaying the spinner
|
||||
this.finishTabSwitch();
|
||||
}
|
||||
this.assert(this.spinnerTab);
|
||||
this.log("DEBUG: spinner time = " +
|
||||
TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window));
|
||||
TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window);
|
||||
this.addMarker("AsyncTabSwitch:SpinnerHidden");
|
||||
// we do not get a onPaint after displaying the spinner
|
||||
this.finishTabSwitch();
|
||||
},
|
||||
|
||||
addMarker: function(marker) {
|
||||
|
@ -3,6 +3,21 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
function simulateItemDragAndEnd(aToDrag, aTarget) {
|
||||
var ds = Components.classes["@mozilla.org/widget/dragservice;1"].
|
||||
getService(Components.interfaces.nsIDragService);
|
||||
|
||||
ds.startDragSession();
|
||||
try {
|
||||
var [result, dataTransfer] = ChromeUtils.synthesizeDragOver(aToDrag.parentNode, aTarget);
|
||||
ChromeUtils.synthesizeDropAfterDragOver(result, dataTransfer, aTarget);
|
||||
// Send dragend to move dragging item back to initial place.
|
||||
EventUtils.sendDragEvent({ type: "dragend", dataTransfer: dataTransfer },
|
||||
aToDrag.parentNode);
|
||||
} finally {
|
||||
ds.endDragSession(true);
|
||||
}
|
||||
}
|
||||
|
||||
add_task(function* checkNoAddingToPanel() {
|
||||
let area = CustomizableUI.AREA_PANEL;
|
||||
@ -66,7 +81,7 @@ add_task(function* checkDragging() {
|
||||
|
||||
yield startCustomizing();
|
||||
for (let id of elementsToMove) {
|
||||
simulateItemDrag(document.getElementById(id), PanelUI.contents);
|
||||
simulateItemDragAndEnd(document.getElementById(id), PanelUI.contents);
|
||||
}
|
||||
|
||||
assertAreaPlacements(startArea, placementsWithSpecials);
|
||||
|
@ -26,8 +26,20 @@ add_task(function*() {
|
||||
// async-ness of the 'shown' yield...
|
||||
let panelHiddenPromise = promisePanelElementHidden(window, widgetOverflowPanel);
|
||||
|
||||
ChromeUtils.synthesizeDrop(identityBox, overflowChevron, [], null);
|
||||
yield panelShownPromise;
|
||||
var ds = Components.classes["@mozilla.org/widget/dragservice;1"].
|
||||
getService(Components.interfaces.nsIDragService);
|
||||
|
||||
ds.startDragSession();
|
||||
try {
|
||||
var [result, dataTransfer] = ChromeUtils.synthesizeDragOver(identityBox, overflowChevron);
|
||||
|
||||
// Wait for showing panel before ending drag session.
|
||||
yield panelShownPromise;
|
||||
|
||||
ChromeUtils.synthesizeDropAfterDragOver(result, dataTransfer, overflowChevron);
|
||||
} finally {
|
||||
ds.endDragSession(true);
|
||||
}
|
||||
|
||||
info("Overflow panel is shown.");
|
||||
|
||||
|
@ -21,6 +21,7 @@ add_task(function() {
|
||||
simulateItemDrag(draggedItem, gCustomizeMode.visiblePalette);
|
||||
is(document.documentElement.hasAttribute("customizing-movingItem"), false,
|
||||
"Make sure customizing-movingItem is removed after dragging to the palette");
|
||||
yield endCustomizing();
|
||||
});
|
||||
|
||||
// Drop on a customization target itself
|
||||
@ -36,6 +37,7 @@ add_task(function() {
|
||||
simulateItemDrag(draggedItem, dest.customizationTarget);
|
||||
is(document.documentElement.hasAttribute("customizing-movingItem"), false,
|
||||
"Make sure customizing-movingItem is removed");
|
||||
yield endCustomizing();
|
||||
});
|
||||
|
||||
add_task(function asyncCleanup() {
|
||||
|
@ -18,6 +18,7 @@ add_task(function*() {
|
||||
ok(!CustomizableUI.getPlacementOfWidget("sync-button"), "Button moved to the palette");
|
||||
ok(gNavToolbox.palette.querySelector("#sync-button"), "Sync button really is in palette.");
|
||||
|
||||
syncButton.scrollIntoView();
|
||||
simulateItemDrag(syncButton, toolbar);
|
||||
ok(CustomizableUI.getPlacementOfWidget("sync-button"), "Button moved out of palette");
|
||||
is(CustomizableUI.getPlacementOfWidget("sync-button").area, TOOLBARID, "Button's back on toolbar");
|
||||
@ -49,6 +50,7 @@ add_task(function*() {
|
||||
ok(!CustomizableUI.inDefaultState, "Now that the toolbar is registered again, should no longer be in default state.");
|
||||
ok(gCustomizeMode.areas.has(toolbar), "Toolbar should be known to customize mode again.");
|
||||
|
||||
syncButton.scrollIntoView();
|
||||
simulateItemDrag(syncButton, toolbar);
|
||||
ok(CustomizableUI.getPlacementOfWidget("sync-button"), "Button moved out of palette");
|
||||
is(CustomizableUI.getPlacementOfWidget("sync-button").area, TOOLBARID, "Button's back on toolbar");
|
||||
@ -78,6 +80,7 @@ add_task(function*() {
|
||||
ok(gNavToolbox.palette.querySelector("#sync-button"), "Sync button really is in palette.");
|
||||
ok(!otherTB.querySelector("#sync-button"), "Sync button is in palette in other window, too.");
|
||||
|
||||
syncButton.scrollIntoView();
|
||||
simulateItemDrag(syncButton, toolbar);
|
||||
ok(CustomizableUI.getPlacementOfWidget("sync-button"), "Button moved out of palette");
|
||||
is(CustomizableUI.getPlacementOfWidget("sync-button").area, TOOLBARID, "Button's back on toolbar");
|
||||
|
@ -173,12 +173,8 @@ function getAreaWidgetIds(areaId) {
|
||||
return CustomizableUI.getWidgetIdsInArea(areaId);
|
||||
}
|
||||
|
||||
function simulateItemDrag(toDrag, target) {
|
||||
let docId = toDrag.ownerDocument.documentElement.id;
|
||||
let dragData = [[{type: 'text/toolbarwrapper-id/' + docId,
|
||||
data: toDrag.id}]];
|
||||
synthesizeDragStart(toDrag.parentNode, dragData);
|
||||
synthesizeDrop(target, target, dragData);
|
||||
function simulateItemDrag(aToDrag, aTarget) {
|
||||
synthesizeDrop(aToDrag.parentNode, aTarget);
|
||||
}
|
||||
|
||||
function endCustomizing(aWindow=window) {
|
||||
|
@ -23,7 +23,7 @@ data from the server.
|
||||
|
||||
For the directory source and ping endpoints, the default preference values point
|
||||
to Mozilla key-pinned servers with encryption. No cookies are set by the servers
|
||||
but not enforced by Firefox.
|
||||
and Firefox enforces this by making anonymous requests.
|
||||
|
||||
- default directory source endpoint:
|
||||
https://tiles.services.mozilla.com/v3/links/fetch/%LOCALE%/%CHANNEL%
|
||||
|
@ -9,8 +9,8 @@ this.EXPORTED_SYMBOLS = ["DirectoryLinksProvider"];
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
const Cu = Components.utils;
|
||||
const XMLHttpRequest =
|
||||
Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsIXMLHttpRequest");
|
||||
|
||||
Cu.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
@ -269,7 +269,7 @@ let DirectoryLinksProvider = {
|
||||
uri = uri.replace("%CHANNEL%", UpdateChannel.get());
|
||||
|
||||
let deferred = Promise.defer();
|
||||
let xmlHttp = new XMLHttpRequest();
|
||||
let xmlHttp = this._newXHR();
|
||||
|
||||
let self = this;
|
||||
xmlHttp.onload = function(aResponse) {
|
||||
@ -346,6 +346,13 @@ let DirectoryLinksProvider = {
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Create a new XMLHttpRequest that is anonymous, i.e., doesn't send cookies
|
||||
*/
|
||||
_newXHR() {
|
||||
return new XMLHttpRequest({mozAnon: true});
|
||||
},
|
||||
|
||||
/**
|
||||
* Reads directory links file and parses its content
|
||||
* @return a promise resolved to an object with keys 'directory' and 'suggested',
|
||||
@ -537,7 +544,7 @@ let DirectoryLinksProvider = {
|
||||
}
|
||||
|
||||
// Package the data to be sent with the ping
|
||||
let ping = new XMLHttpRequest();
|
||||
let ping = this._newXHR();
|
||||
ping.open("POST", pingEndPoint + (action == "view" ? "view" : "click"));
|
||||
ping.send(JSON.stringify(data));
|
||||
|
||||
|
@ -1674,3 +1674,7 @@ add_task(function test_DirectoryLinksProvider_ClickRemoval() {
|
||||
|
||||
yield promiseCleanDirectoryLinksProvider();
|
||||
});
|
||||
|
||||
add_task(function test_DirectoryLinksProvider_anonymous() {
|
||||
do_check_true(DirectoryLinksProvider._newXHR().mozAnon);
|
||||
});
|
||||
|
@ -238,10 +238,6 @@ bstring.h
|
||||
builtin.h
|
||||
Button.h
|
||||
byteswap.h
|
||||
#if MOZ_TREE_CAIRO!=1
|
||||
#define WRAP_CAIRO_HEADERS
|
||||
#endif
|
||||
#ifdef WRAP_CAIRO_HEADERS
|
||||
pixman.h
|
||||
cairo.h
|
||||
cairo-atsui.h
|
||||
@ -258,7 +254,6 @@ cairo-xlib-xrender.h
|
||||
cairo-directfb.h
|
||||
cairo-qpainter.h
|
||||
cairo-qt.h
|
||||
#endif
|
||||
dfiff.h
|
||||
exception
|
||||
ffi.h
|
||||
|
14
configure.in
14
configure.in
@ -549,6 +549,9 @@ case "$target" in
|
||||
CFLAGS="$CFLAGS -Wv:18"
|
||||
CXXFLAGS="$CXXFLAGS -Wv:18"
|
||||
|
||||
# -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
|
||||
CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
|
||||
|
||||
# https://connect.microsoft.com/VisualStudio/feedback/details/888527/warnings-on-dbghelp-h
|
||||
# for dbghelp.h, imagehlp.h, and shobj.h
|
||||
# C4091: 'typedef ': ignored on left of '' when no variable is declared
|
||||
@ -8054,13 +8057,7 @@ dnl ========================================================
|
||||
dnl Check for pixman and cairo
|
||||
dnl ========================================================
|
||||
|
||||
if test "$MOZ_WIDGET_TOOLKIT" = "gtk3" ; then
|
||||
# cairo-gtk3 can be build with system-cairo only
|
||||
MOZ_TREE_CAIRO=
|
||||
else
|
||||
MOZ_TREE_CAIRO=1
|
||||
fi
|
||||
|
||||
MOZ_TREE_CAIRO=1
|
||||
MOZ_ARG_ENABLE_BOOL(system-cairo,
|
||||
[ --enable-system-cairo Use system cairo (located with pkgconfig)],
|
||||
MOZ_TREE_CAIRO=,
|
||||
@ -8152,9 +8149,6 @@ if test "$MOZ_TREE_CAIRO"; then
|
||||
MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
|
||||
fi
|
||||
;;
|
||||
gtk3)
|
||||
AC_MSG_ERROR([cairo-gtk3 toolkit is incompatible with in-tree cairo. Please add --enable-system-cairo to your build config.])
|
||||
;;
|
||||
esac
|
||||
if test "$USE_FC_FREETYPE"; then
|
||||
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
|
||||
|
@ -576,10 +576,18 @@ Animation::DoPlay(LimitBehavior aLimitBehavior)
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear the start time until we resolve a new one (unless we are aborting
|
||||
// a pending pause operation, in which case we keep the old start time so
|
||||
// that the animation continues moving uninterrupted by the aborted pause).
|
||||
if (!abortedPause) {
|
||||
// Clear the start time until we resolve a new one. We do this except
|
||||
// for the case where we are aborting a pause and don't have a hold time.
|
||||
//
|
||||
// If we're aborting a pause and *do* have a hold time (e.g. because
|
||||
// the animation is finished or we just applied the auto-rewind behavior
|
||||
// above) we should respect it by clearing the start time. If we *don't*
|
||||
// have a hold time we should keep the current start time so that the
|
||||
// the animation continues moving uninterrupted by the aborted pause.
|
||||
//
|
||||
// (If we're not aborting a pause, mHoldTime must be resolved by now
|
||||
// or else we would have returned above.)
|
||||
if (!mHoldTime.IsNull()) {
|
||||
mStartTime.SetNull();
|
||||
}
|
||||
|
||||
|
@ -542,6 +542,29 @@ test(function(t) {
|
||||
'The currentTime of a cancelled animation should be null');
|
||||
}, 'Animation.currentTime after cancelling');
|
||||
|
||||
async_test(function(t) {
|
||||
var div = addDiv(t, {'class': 'animated-div'});
|
||||
div.style.animation = 'anim 100s';
|
||||
|
||||
var animation = div.getAnimations()[0];
|
||||
animation.ready.then(t.step_func(function() {
|
||||
animation.finish();
|
||||
|
||||
// Initiate a pause then abort it
|
||||
animation.pause();
|
||||
animation.play();
|
||||
|
||||
// Wait to return to running state
|
||||
return animation.ready;
|
||||
})).then(t.step_func(function() {
|
||||
assert_true(animation.currentTime < 100 * 1000,
|
||||
'After aborting a pause when finished, the currentTime should'
|
||||
+ ' jump back towards the start of the animation');
|
||||
t.done();
|
||||
}));
|
||||
}, 'After aborting a pause when finished, the call to play() should rewind'
|
||||
+ ' the current time');
|
||||
|
||||
done();
|
||||
</script>
|
||||
</body>
|
||||
|
@ -153,7 +153,7 @@ nsSimpleContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto
|
||||
}
|
||||
|
||||
// Hashtable for storing nsContentLists
|
||||
static PLDHashTable gContentListHashTable;
|
||||
static PLDHashTable* gContentListHashTable;
|
||||
|
||||
#define RECENTLY_USED_CONTENT_LIST_CACHE_SIZE 31
|
||||
static nsContentList*
|
||||
@ -215,19 +215,17 @@ NS_GetContentList(nsINode* aRootNode,
|
||||
};
|
||||
|
||||
// Initialize the hashtable if needed.
|
||||
if (!gContentListHashTable.IsInitialized()) {
|
||||
PL_DHashTableInit(&gContentListHashTable, &hash_table_ops,
|
||||
sizeof(ContentListHashEntry));
|
||||
if (!gContentListHashTable) {
|
||||
gContentListHashTable =
|
||||
new PLDHashTable(&hash_table_ops, sizeof(ContentListHashEntry));
|
||||
}
|
||||
|
||||
ContentListHashEntry *entry = nullptr;
|
||||
// First we look in our hashtable. Then we create a content list if needed
|
||||
if (gContentListHashTable.IsInitialized()) {
|
||||
entry = static_cast<ContentListHashEntry *>
|
||||
(PL_DHashTableAdd(&gContentListHashTable, &hashKey, fallible));
|
||||
if (entry)
|
||||
list = entry->mContentList;
|
||||
}
|
||||
entry = static_cast<ContentListHashEntry *>
|
||||
(PL_DHashTableAdd(gContentListHashTable, &hashKey, fallible));
|
||||
if (entry)
|
||||
list = entry->mContentList;
|
||||
|
||||
if (!list) {
|
||||
// We need to create a ContentList and add it to our new entry, if
|
||||
@ -272,7 +270,7 @@ nsCacheableFuncStringHTMLCollection::WrapObject(JSContext *cx, JS::Handle<JSObje
|
||||
}
|
||||
|
||||
// Hashtable for storing nsCacheableFuncStringContentList
|
||||
static PLDHashTable gFuncStringContentListHashTable;
|
||||
static PLDHashTable* gFuncStringContentListHashTable;
|
||||
|
||||
struct FuncStringContentListHashEntry : public PLDHashEntryHdr
|
||||
{
|
||||
@ -321,18 +319,18 @@ GetFuncStringContentList(nsINode* aRootNode,
|
||||
};
|
||||
|
||||
// Initialize the hashtable if needed.
|
||||
if (!gFuncStringContentListHashTable.IsInitialized()) {
|
||||
PL_DHashTableInit(&gFuncStringContentListHashTable, &hash_table_ops,
|
||||
sizeof(FuncStringContentListHashEntry));
|
||||
if (!gFuncStringContentListHashTable) {
|
||||
gFuncStringContentListHashTable =
|
||||
new PLDHashTable(&hash_table_ops, sizeof(FuncStringContentListHashEntry));
|
||||
}
|
||||
|
||||
FuncStringContentListHashEntry *entry = nullptr;
|
||||
// First we look in our hashtable. Then we create a content list if needed
|
||||
if (gFuncStringContentListHashTable.IsInitialized()) {
|
||||
if (gFuncStringContentListHashTable) {
|
||||
nsFuncStringCacheKey hashKey(aRootNode, aFunc, aString);
|
||||
|
||||
entry = static_cast<FuncStringContentListHashEntry *>
|
||||
(PL_DHashTableAdd(&gFuncStringContentListHashTable, &hashKey, fallible));
|
||||
(PL_DHashTableAdd(gFuncStringContentListHashTable, &hashKey, fallible));
|
||||
if (entry) {
|
||||
list = entry->mContentList;
|
||||
#ifdef DEBUG
|
||||
@ -970,13 +968,14 @@ nsContentList::RemoveFromHashtable()
|
||||
sRecentlyUsedContentLists[recentlyUsedCacheIndex] = nullptr;
|
||||
}
|
||||
|
||||
if (!gContentListHashTable.IsInitialized())
|
||||
if (!gContentListHashTable)
|
||||
return;
|
||||
|
||||
PL_DHashTableRemove(&gContentListHashTable, &key);
|
||||
PL_DHashTableRemove(gContentListHashTable, &key);
|
||||
|
||||
if (gContentListHashTable.EntryCount() == 0) {
|
||||
PL_DHashTableFinish(&gContentListHashTable);
|
||||
if (gContentListHashTable->EntryCount() == 0) {
|
||||
delete gContentListHashTable;
|
||||
gContentListHashTable = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1008,15 +1007,16 @@ nsCacheableFuncStringContentList::~nsCacheableFuncStringContentList()
|
||||
void
|
||||
nsCacheableFuncStringContentList::RemoveFromFuncStringHashtable()
|
||||
{
|
||||
if (!gFuncStringContentListHashTable.IsInitialized()) {
|
||||
if (!gFuncStringContentListHashTable) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsFuncStringCacheKey key(mRootNode, mFunc, mString);
|
||||
PL_DHashTableRemove(&gFuncStringContentListHashTable, &key);
|
||||
PL_DHashTableRemove(gFuncStringContentListHashTable, &key);
|
||||
|
||||
if (gFuncStringContentListHashTable.EntryCount() == 0) {
|
||||
PL_DHashTableFinish(&gFuncStringContentListHashTable);
|
||||
if (gFuncStringContentListHashTable->EntryCount() == 0) {
|
||||
delete gFuncStringContentListHashTable;
|
||||
gFuncStringContentListHashTable = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,7 +337,7 @@ namespace {
|
||||
static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID);
|
||||
static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
|
||||
|
||||
static PLDHashTable sEventListenerManagersHash;
|
||||
static PLDHashTable* sEventListenerManagersHash;
|
||||
|
||||
class DOMEventListenerManagersHashReporter final : public nsIMemoryReporter
|
||||
{
|
||||
@ -353,9 +353,9 @@ public:
|
||||
{
|
||||
// We don't measure the |EventListenerManager| objects pointed to by the
|
||||
// entries because those references are non-owning.
|
||||
int64_t amount = sEventListenerManagersHash.IsInitialized()
|
||||
int64_t amount = sEventListenerManagersHash
|
||||
? PL_DHashTableSizeOfExcludingThis(
|
||||
&sEventListenerManagersHash, nullptr, MallocSizeOf)
|
||||
sEventListenerManagersHash, nullptr, MallocSizeOf)
|
||||
: 0;
|
||||
|
||||
return MOZ_COLLECT_REPORT(
|
||||
@ -488,7 +488,7 @@ nsContentUtils::Init()
|
||||
if (!InitializeEventTable())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (!sEventListenerManagersHash.IsInitialized()) {
|
||||
if (!sEventListenerManagersHash) {
|
||||
static const PLDHashTableOps hash_table_ops =
|
||||
{
|
||||
PL_DHashVoidPtrKeyStub,
|
||||
@ -498,8 +498,8 @@ nsContentUtils::Init()
|
||||
EventListenerManagerHashInitEntry
|
||||
};
|
||||
|
||||
PL_DHashTableInit(&sEventListenerManagersHash, &hash_table_ops,
|
||||
sizeof(EventListenerManagerMapEntry));
|
||||
sEventListenerManagersHash =
|
||||
new PLDHashTable(&hash_table_ops, sizeof(EventListenerManagerMapEntry));
|
||||
|
||||
RegisterStrongMemoryReporter(new DOMEventListenerManagersHashReporter());
|
||||
}
|
||||
@ -1810,8 +1810,8 @@ nsContentUtils::Shutdown()
|
||||
delete sUserDefinedEvents;
|
||||
sUserDefinedEvents = nullptr;
|
||||
|
||||
if (sEventListenerManagersHash.IsInitialized()) {
|
||||
NS_ASSERTION(sEventListenerManagersHash.EntryCount() == 0,
|
||||
if (sEventListenerManagersHash) {
|
||||
NS_ASSERTION(sEventListenerManagersHash->EntryCount() == 0,
|
||||
"Event listener manager hash not empty at shutdown!");
|
||||
|
||||
// See comment above.
|
||||
@ -1823,8 +1823,9 @@ nsContentUtils::Shutdown()
|
||||
// it could leave dangling references in DOMClassInfo's preserved
|
||||
// wrapper table.
|
||||
|
||||
if (sEventListenerManagersHash.EntryCount() == 0) {
|
||||
PL_DHashTableFinish(&sEventListenerManagersHash);
|
||||
if (sEventListenerManagersHash->EntryCount() == 0) {
|
||||
delete sEventListenerManagersHash;
|
||||
sEventListenerManagersHash = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3989,8 +3990,8 @@ ListenerEnumerator(PLDHashTable* aTable, PLDHashEntryHdr* aEntry,
|
||||
void
|
||||
nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments(uint32_t aGeneration)
|
||||
{
|
||||
if (sEventListenerManagersHash.IsInitialized()) {
|
||||
PL_DHashTableEnumerate(&sEventListenerManagersHash, ListenerEnumerator,
|
||||
if (sEventListenerManagersHash) {
|
||||
PL_DHashTableEnumerate(sEventListenerManagersHash, ListenerEnumerator,
|
||||
&aGeneration);
|
||||
}
|
||||
}
|
||||
@ -4000,14 +4001,14 @@ void
|
||||
nsContentUtils::TraverseListenerManager(nsINode *aNode,
|
||||
nsCycleCollectionTraversalCallback &cb)
|
||||
{
|
||||
if (!sEventListenerManagersHash.IsInitialized()) {
|
||||
if (!sEventListenerManagersHash) {
|
||||
// We're already shut down, just return.
|
||||
return;
|
||||
}
|
||||
|
||||
EventListenerManagerMapEntry *entry =
|
||||
static_cast<EventListenerManagerMapEntry *>
|
||||
(PL_DHashTableSearch(&sEventListenerManagersHash, aNode));
|
||||
(PL_DHashTableSearch(sEventListenerManagersHash, aNode));
|
||||
if (entry) {
|
||||
CycleCollectionNoteChild(cb, entry->mListenerManager.get(),
|
||||
"[via hash] mListenerManager");
|
||||
@ -4017,7 +4018,7 @@ nsContentUtils::TraverseListenerManager(nsINode *aNode,
|
||||
EventListenerManager*
|
||||
nsContentUtils::GetListenerManagerForNode(nsINode *aNode)
|
||||
{
|
||||
if (!sEventListenerManagersHash.IsInitialized()) {
|
||||
if (!sEventListenerManagersHash) {
|
||||
// We're already shut down, don't bother creating an event listener
|
||||
// manager.
|
||||
|
||||
@ -4026,7 +4027,7 @@ nsContentUtils::GetListenerManagerForNode(nsINode *aNode)
|
||||
|
||||
EventListenerManagerMapEntry *entry =
|
||||
static_cast<EventListenerManagerMapEntry *>
|
||||
(PL_DHashTableAdd(&sEventListenerManagersHash, aNode, fallible));
|
||||
(PL_DHashTableAdd(sEventListenerManagersHash, aNode, fallible));
|
||||
|
||||
if (!entry) {
|
||||
return nullptr;
|
||||
@ -4048,7 +4049,7 @@ nsContentUtils::GetExistingListenerManagerForNode(const nsINode *aNode)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!sEventListenerManagersHash.IsInitialized()) {
|
||||
if (!sEventListenerManagersHash) {
|
||||
// We're already shut down, don't bother creating an event listener
|
||||
// manager.
|
||||
|
||||
@ -4057,7 +4058,7 @@ nsContentUtils::GetExistingListenerManagerForNode(const nsINode *aNode)
|
||||
|
||||
EventListenerManagerMapEntry *entry =
|
||||
static_cast<EventListenerManagerMapEntry *>
|
||||
(PL_DHashTableSearch(&sEventListenerManagersHash, aNode));
|
||||
(PL_DHashTableSearch(sEventListenerManagersHash, aNode));
|
||||
if (entry) {
|
||||
return entry->mListenerManager;
|
||||
}
|
||||
@ -4069,16 +4070,16 @@ nsContentUtils::GetExistingListenerManagerForNode(const nsINode *aNode)
|
||||
void
|
||||
nsContentUtils::RemoveListenerManager(nsINode *aNode)
|
||||
{
|
||||
if (sEventListenerManagersHash.IsInitialized()) {
|
||||
if (sEventListenerManagersHash) {
|
||||
EventListenerManagerMapEntry *entry =
|
||||
static_cast<EventListenerManagerMapEntry *>
|
||||
(PL_DHashTableSearch(&sEventListenerManagersHash, aNode));
|
||||
(PL_DHashTableSearch(sEventListenerManagersHash, aNode));
|
||||
if (entry) {
|
||||
nsRefPtr<EventListenerManager> listenerManager;
|
||||
listenerManager.swap(entry->mListenerManager);
|
||||
// Remove the entry and *then* do operations that could cause further
|
||||
// modification of sEventListenerManagersHash. See bug 334177.
|
||||
PL_DHashTableRawRemove(&sEventListenerManagersHash, entry);
|
||||
PL_DHashTableRawRemove(sEventListenerManagersHash, entry);
|
||||
if (listenerManager) {
|
||||
listenerManager->Disconnect();
|
||||
}
|
||||
@ -7763,4 +7764,4 @@ nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem,
|
||||
if (doc->IsShowing() == aFireIfShowing) {
|
||||
doc->OnPageShow(true, aChromeEventHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -408,7 +408,7 @@ public:
|
||||
bool aUseCapture,
|
||||
const mozilla::dom::Nullable<bool>& aWantsUntrusted,
|
||||
mozilla::ErrorResult& aRv) override;
|
||||
virtual nsIDOMWindow* GetOwnerGlobal() override
|
||||
virtual nsIDOMWindow* GetOwnerGlobalForBindings() override
|
||||
{
|
||||
if (IsOuterWindow()) {
|
||||
return this;
|
||||
@ -417,6 +417,15 @@ public:
|
||||
return GetOuterFromCurrentInner(this);
|
||||
}
|
||||
|
||||
virtual nsIGlobalObject* GetOwnerGlobal() const override
|
||||
{
|
||||
if (IsOuterWindow()) {
|
||||
return GetCurrentInnerWindowInternal();
|
||||
}
|
||||
|
||||
return const_cast<nsGlobalWindow*>(this);
|
||||
}
|
||||
|
||||
// nsPIDOMWindow
|
||||
virtual nsPIDOMWindow* GetPrivateRoot() override;
|
||||
|
||||
|
@ -2872,7 +2872,7 @@ protected:
|
||||
nsTArray<nsWeakPtr> mBlockedTrackingNodes;
|
||||
|
||||
// Weak reference to mScriptGlobalObject QI:d to nsPIDOMWindow,
|
||||
// updated on every set of mSecriptGlobalObject.
|
||||
// updated on every set of mScriptGlobalObject.
|
||||
nsPIDOMWindow *mWindow;
|
||||
|
||||
nsCOMPtr<nsIDocumentEncoder> mCachedEncoder;
|
||||
|
@ -1296,13 +1296,20 @@ nsINode::GetContextForEventHandlers(nsresult* aRv)
|
||||
}
|
||||
|
||||
nsIDOMWindow*
|
||||
nsINode::GetOwnerGlobal()
|
||||
nsINode::GetOwnerGlobalForBindings()
|
||||
{
|
||||
bool dummy;
|
||||
return nsPIDOMWindow::GetOuterFromCurrentInner(
|
||||
static_cast<nsGlobalWindow*>(OwnerDoc()->GetScriptHandlingObject(dummy)));
|
||||
}
|
||||
|
||||
nsIGlobalObject*
|
||||
nsINode::GetOwnerGlobal() const
|
||||
{
|
||||
bool dummy;
|
||||
return OwnerDoc()->GetScriptHandlingObject(dummy);
|
||||
}
|
||||
|
||||
bool
|
||||
nsINode::UnoptimizableCCNode() const
|
||||
{
|
||||
|
@ -988,7 +988,8 @@ public:
|
||||
const mozilla::dom::Nullable<bool>& aWantsUntrusted,
|
||||
mozilla::ErrorResult& aRv) override;
|
||||
using nsIDOMEventTarget::AddSystemEventListener;
|
||||
virtual nsIDOMWindow* GetOwnerGlobal() override;
|
||||
virtual nsIDOMWindow* GetOwnerGlobalForBindings() override;
|
||||
virtual nsIGlobalObject* GetOwnerGlobal() const override;
|
||||
|
||||
/**
|
||||
* Adds a mutation observer to be notified when this node, or any of its
|
||||
|
@ -38,7 +38,6 @@ public:
|
||||
|
||||
virtual void SetParentTarget(mozilla::dom::EventTarget* aTarget) = 0;
|
||||
virtual mozilla::dom::EventTarget* GetParentTarget() = 0;
|
||||
virtual nsIDOMWindow* GetOwnerGlobal() override = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsPIWindowRoot, NS_IWINDOWROOT_IID)
|
||||
|
@ -287,21 +287,18 @@ nsPropertyTable::PropertyList::PropertyList(nsIAtom *aName,
|
||||
void *aDtorData,
|
||||
bool aTransfer)
|
||||
: mName(aName),
|
||||
mObjectValueMap(PL_DHashGetStubOps(), sizeof(PropertyListMapEntry)),
|
||||
mDtorFunc(aDtorFunc),
|
||||
mDtorData(aDtorData),
|
||||
mTransfer(aTransfer),
|
||||
mNext(nullptr)
|
||||
{
|
||||
PL_DHashTableInit(&mObjectValueMap, PL_DHashGetStubOps(),
|
||||
sizeof(PropertyListMapEntry));
|
||||
}
|
||||
|
||||
nsPropertyTable::PropertyList::~PropertyList()
|
||||
{
|
||||
PL_DHashTableFinish(&mObjectValueMap);
|
||||
}
|
||||
|
||||
|
||||
static PLDHashOperator
|
||||
DestroyPropertyEnumerator(PLDHashTable *table, PLDHashEntryHdr *hdr,
|
||||
uint32_t number, void *arg)
|
||||
|
@ -188,11 +188,20 @@ nsWindowRoot::PostHandleEvent(EventChainPostVisitor& aVisitor)
|
||||
}
|
||||
|
||||
nsIDOMWindow*
|
||||
nsWindowRoot::GetOwnerGlobal()
|
||||
nsWindowRoot::GetOwnerGlobalForBindings()
|
||||
{
|
||||
return GetWindow();
|
||||
}
|
||||
|
||||
nsIGlobalObject*
|
||||
nsWindowRoot::GetOwnerGlobal() const
|
||||
{
|
||||
nsCOMPtr<nsIGlobalObject> global =
|
||||
do_QueryInterface(mWindow->GetCurrentInnerWindow());
|
||||
// We're still holding a ref to it, so returning the raw pointer is ok...
|
||||
return global;
|
||||
}
|
||||
|
||||
nsPIDOMWindow*
|
||||
nsWindowRoot::GetWindow()
|
||||
{
|
||||
|
@ -59,7 +59,8 @@ public:
|
||||
mParent = aTarget;
|
||||
}
|
||||
virtual mozilla::dom::EventTarget* GetParentTarget() override { return mParent; }
|
||||
virtual nsIDOMWindow* GetOwnerGlobal() override;
|
||||
virtual nsIDOMWindow* GetOwnerGlobalForBindings() override;
|
||||
virtual nsIGlobalObject* GetOwnerGlobal() const override;
|
||||
|
||||
nsIGlobalObject* GetParentObject();
|
||||
|
||||
|
@ -391,29 +391,33 @@ nsXMLHttpRequest::InitParameters(bool aAnon, bool aSystem)
|
||||
}
|
||||
|
||||
// Check for permissions.
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(GetOwner());
|
||||
if (!window || !window->GetDocShell()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Chrome is always allowed access, so do the permission check only
|
||||
// for non-chrome pages.
|
||||
if (!IsSystemXHR() && aSystem) {
|
||||
nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
|
||||
if (!doc) {
|
||||
nsIGlobalObject* global = GetOwnerGlobal();
|
||||
if (NS_WARN_IF(!global)) {
|
||||
SetParameters(aAnon, false);
|
||||
return;
|
||||
}
|
||||
|
||||
nsIPrincipal* principal = global->PrincipalOrNull();
|
||||
if (NS_WARN_IF(!principal)) {
|
||||
SetParameters(aAnon, false);
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrincipal> principal = doc->NodePrincipal();
|
||||
nsCOMPtr<nsIPermissionManager> permMgr =
|
||||
services::GetPermissionManager();
|
||||
if (!permMgr)
|
||||
if (NS_WARN_IF(!permMgr)) {
|
||||
SetParameters(aAnon, false);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t permission;
|
||||
nsresult rv =
|
||||
permMgr->TestPermissionFromPrincipal(principal, "systemXHR", &permission);
|
||||
if (NS_FAILED(rv) || permission != nsIPermissionManager::ALLOW_ACTION) {
|
||||
SetParameters(aAnon, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -21,18 +21,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=426308
|
||||
|
||||
function startTest() {
|
||||
req = new XMLHttpRequest({mozSystem: true});
|
||||
is(req.mozAnon, true, "XMLHttpRequest should be mozAnon");
|
||||
is(req.mozAnon, true, "XMLHttpRequest should be mozAnon (3)");
|
||||
|
||||
req = new XMLHttpRequest({mozAnon: true});
|
||||
is(req.mozAnon, true, "XMLHttpRequest should be mozAnon");
|
||||
is(req.mozSystem, false, "XMLHttpRequest should not be mozSystem");
|
||||
is(req.mozAnon, true, "XMLHttpRequest should be mozAnon (4)");
|
||||
is(req.mozSystem, false, "XMLHttpRequest should not be mozSystem (4)");
|
||||
|
||||
req = new XMLHttpRequest({mozAnon: true, mozSystem: true});
|
||||
is(req.mozAnon, true, "XMLHttpRequest should be mozAnon");
|
||||
is(req.mozSystem, true, "XMLHttpRequest should be mozSystem");
|
||||
is(req.mozAnon, true, "XMLHttpRequest should be mozAnon (5)");
|
||||
is(req.mozSystem, true, "XMLHttpRequest should be mozSystem (5)");
|
||||
|
||||
req = new XMLHttpRequest({mozAnon: false, mozSystem: true});
|
||||
is(req.mozAnon, true, "XMLHttpRequest should be mozAnon");
|
||||
is(req.mozAnon, true, "XMLHttpRequest should be mozAnon (6)");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
@ -44,8 +44,8 @@ is(req.mozAnon, true, "XMLHttpRequest should be mozAnon");
|
||||
is(req.mozSystem, false, "XMLHttpRequest should not be mozSystem");
|
||||
|
||||
req = new XMLHttpRequest({mozAnon: true, mozSystem: true});
|
||||
is(req.mozAnon, false, "XMLHttpRequest should be mozAnon");
|
||||
is(req.mozSystem, false, "XMLHttpRequest should not be mozSystem");
|
||||
is(req.mozAnon, true, "XMLHttpRequest should be mozAnon (2)");
|
||||
is(req.mozSystem, false, "XMLHttpRequest should not be mozSystem (2)");
|
||||
|
||||
addLoadEvent(function() {
|
||||
SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], startTest);
|
||||
|
@ -121,7 +121,7 @@ public:
|
||||
JSContext* aCx,
|
||||
JS::Value* aValue);
|
||||
using dom::EventTarget::GetEventHandler;
|
||||
virtual nsIDOMWindow* GetOwnerGlobal() override
|
||||
virtual nsIDOMWindow* GetOwnerGlobalForBindings() override
|
||||
{
|
||||
return nsPIDOMWindow::GetOuterFromCurrentInner(GetOwner());
|
||||
}
|
||||
@ -140,7 +140,12 @@ public:
|
||||
void BindToOwner(nsPIDOMWindow* aOwner);
|
||||
void BindToOwner(DOMEventTargetHelper* aOther);
|
||||
virtual void DisconnectFromOwner();
|
||||
nsIGlobalObject* GetParentObject() const {
|
||||
nsIGlobalObject* GetParentObject() const
|
||||
{
|
||||
return GetOwnerGlobal();
|
||||
}
|
||||
virtual nsIGlobalObject* GetOwnerGlobal() const override
|
||||
{
|
||||
nsCOMPtr<nsIGlobalObject> parentObject = do_QueryReferent(mParentObject);
|
||||
return parentObject;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "nsIAtom.h"
|
||||
|
||||
class nsIDOMWindow;
|
||||
class nsIGlobalObject;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -27,8 +28,8 @@ template <class T> struct Nullable;
|
||||
|
||||
// IID for the dom::EventTarget interface
|
||||
#define NS_EVENTTARGET_IID \
|
||||
{ 0xce3817d0, 0x177b, 0x402f, \
|
||||
{ 0xae, 0x75, 0xf8, 0x4e, 0xbe, 0x5a, 0x07, 0xc3 } }
|
||||
{ 0x605158a9, 0xe229, 0x45b1, \
|
||||
{ 0xbc, 0x12, 0x02, 0x9f, 0xa3, 0xa9, 0x3f, 0xcb } }
|
||||
|
||||
class EventTarget : public nsIDOMEventTarget,
|
||||
public nsWrapperCache
|
||||
@ -69,7 +70,12 @@ public:
|
||||
// Returns an outer window that corresponds to the inner window this event
|
||||
// target is associated with. Will return null if the inner window is not the
|
||||
// current inner or if there is no window around at all.
|
||||
virtual nsIDOMWindow* GetOwnerGlobal() = 0;
|
||||
virtual nsIDOMWindow* GetOwnerGlobalForBindings() = 0;
|
||||
|
||||
// The global object this event target is associated with, if any.
|
||||
// This may be an inner window or some other global object. This
|
||||
// will never be an outer window.
|
||||
virtual nsIGlobalObject* GetOwnerGlobal() const = 0;
|
||||
|
||||
/**
|
||||
* Get the event listener manager, creating it if it does not already exist.
|
||||
|
@ -136,21 +136,16 @@ Touch::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
return TouchBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
// Parent ourselves to the window of the target. This achieves the desirable
|
||||
// Parent ourselves to the global of the target. This achieves the desirable
|
||||
// effects of parenting to the target, but avoids making the touch inaccessible
|
||||
// when the target happens to be NAC and therefore reflected into the XBL scope.
|
||||
EventTarget*
|
||||
nsIGlobalObject*
|
||||
Touch::GetParentObject()
|
||||
{
|
||||
if (!mTarget) {
|
||||
return nullptr;
|
||||
}
|
||||
nsCOMPtr<nsPIDOMWindow> outer = do_QueryInterface(mTarget->GetOwnerGlobal());
|
||||
if (!outer) {
|
||||
return nullptr;
|
||||
}
|
||||
MOZ_ASSERT(outer->IsOuterWindow());
|
||||
return static_cast<nsGlobalWindow*>(outer->GetCurrentInnerWindow());
|
||||
return mTarget->GetOwnerGlobal();
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
EventTarget* GetParentObject();
|
||||
nsIGlobalObject* GetParentObject();
|
||||
|
||||
// WebIDL
|
||||
int32_t Identifier() const { return mIdentifier; }
|
||||
|
@ -46,10 +46,10 @@
|
||||
== dir_auto-pre-N-EN.html dir_auto-pre-N-EN-ref.html
|
||||
== dir_auto-R.html dir_auto-R-ref.html
|
||||
== dir_auto-textarea-mixed.html dir_auto-textarea-mixed-ref.html
|
||||
fails-if(B2G) == dir_auto-textarea-N-between-Rs.html dir_auto-textarea-N-between-Rs-ref.html # B2G scrollbar on opposite side
|
||||
fails-if(B2G||Mulet) == dir_auto-textarea-N-between-Rs.html dir_auto-textarea-N-between-Rs-ref.html # B2G scrollbar on opposite side
|
||||
== dir_auto-textarea-N-EN.html dir_auto-textarea-N-EN-ref.html
|
||||
== dir_auto-textarea-script-mixed.html dir_auto-textarea-script-mixed-ref.html
|
||||
fails-if(B2G) == dir_auto-textarea-script-N-between-Rs.html dir_auto-textarea-script-N-between-Rs-ref.html # B2G scrollbar on reference only
|
||||
fails-if(B2G||Mulet) == dir_auto-textarea-script-N-between-Rs.html dir_auto-textarea-script-N-between-Rs-ref.html # B2G scrollbar on reference only
|
||||
== dir_auto-textarea-script-N-EN.html dir_auto-textarea-script-N-EN-ref.html
|
||||
== lang-xyzzy.html lang-xyzzy-ref.html
|
||||
== lang-xmllang-01.html lang-xmllang-01-ref.html
|
||||
|
@ -428,7 +428,8 @@ IndexedDatabaseManager::CommonPostHandleEvent(EventChainPostVisitor& aVisitor,
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
||||
if (NS_IsMainThread()) {
|
||||
if (nsIDOMWindow* window = eventTarget->GetOwnerGlobal()) {
|
||||
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(eventTarget->GetOwnerGlobal());
|
||||
if (window) {
|
||||
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(window);
|
||||
MOZ_ASSERT(sgo);
|
||||
|
||||
|
@ -2548,7 +2548,7 @@ bool
|
||||
ContentParent::RecvReadFontList(InfallibleTArray<FontListEntry>* retValue)
|
||||
{
|
||||
#ifdef ANDROID
|
||||
gfxAndroidPlatform::GetPlatform()->GetFontList(retValue);
|
||||
gfxAndroidPlatform::GetPlatform()->GetSystemFontList(retValue);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
24
dom/media/test/crashtests/1122218.html
Normal file
24
dom/media/test/crashtests/1122218.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
function boom() {
|
||||
var r0=new AudioContext();
|
||||
|
||||
var cm=r0.createChannelMerger(20);
|
||||
|
||||
var o1=r0.createOscillator();
|
||||
var o2=r0.createOscillator();
|
||||
|
||||
var pw=r0.createPeriodicWave(new Float32Array(4),new Float32Array(4));
|
||||
o2.setPeriodicWave(pw);
|
||||
|
||||
o1.connect(cm);
|
||||
cm.connect(o2.frequency);
|
||||
|
||||
o1.start();
|
||||
o2.start(0.476);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom();"></body>
|
||||
</html>
|
@ -77,6 +77,7 @@ load oscillator-ended-2.html
|
||||
load 1080986.html
|
||||
load 1158427.html
|
||||
load 1157994.html
|
||||
load 1122218.html
|
||||
include ../../mediasource/test/crashtests/crashtests.list
|
||||
|
||||
# This needs to run at the end to avoid leaking busted state into other tests.
|
||||
|
@ -303,7 +303,7 @@ public:
|
||||
*aFinished = true;
|
||||
return;
|
||||
}
|
||||
if (ticks + WEBAUDIO_BLOCK_SIZE < mStart) {
|
||||
if (ticks + WEBAUDIO_BLOCK_SIZE <= mStart) {
|
||||
// We're not playing yet.
|
||||
ComputeSilence(aOutput);
|
||||
return;
|
||||
|
@ -147,6 +147,12 @@ SpeechSynthesisUtterance::SetPitch(float aPitch)
|
||||
mPitch = aPitch;
|
||||
}
|
||||
|
||||
void
|
||||
SpeechSynthesisUtterance::GetChosenVoiceURI(nsString& aResult) const
|
||||
{
|
||||
aResult = mChosenVoiceURI;
|
||||
}
|
||||
|
||||
void
|
||||
SpeechSynthesisUtterance::DispatchSpeechSynthesisEvent(const nsAString& aEventType,
|
||||
uint32_t aCharIndex,
|
||||
|
@ -71,6 +71,8 @@ public:
|
||||
|
||||
void SetPitch(float aPitch);
|
||||
|
||||
void GetChosenVoiceURI(nsString& aResult) const;
|
||||
|
||||
enum {
|
||||
STATE_NONE,
|
||||
STATE_PENDING,
|
||||
@ -107,6 +109,8 @@ private:
|
||||
|
||||
float mPitch;
|
||||
|
||||
nsString mChosenVoiceURI;
|
||||
|
||||
uint32_t mState;
|
||||
|
||||
bool mPaused;
|
||||
|
@ -25,7 +25,7 @@ async protocol PSpeechSynthesisRequest
|
||||
|
||||
__delete__(bool aIsError, float aElapsedTime, uint32_t aCharIndex);
|
||||
|
||||
OnStart();
|
||||
OnStart(nsString aUri);
|
||||
|
||||
OnPause(float aElapsedTime, uint32_t aCharIndex);
|
||||
|
||||
|
@ -73,9 +73,9 @@ SpeechSynthesisRequestChild::~SpeechSynthesisRequestChild()
|
||||
}
|
||||
|
||||
bool
|
||||
SpeechSynthesisRequestChild::RecvOnStart()
|
||||
SpeechSynthesisRequestChild::RecvOnStart(const nsString& aUri)
|
||||
{
|
||||
mTask->DispatchStartImpl();
|
||||
mTask->DispatchStartImpl(aUri);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
virtual ~SpeechSynthesisRequestChild();
|
||||
|
||||
protected:
|
||||
virtual bool RecvOnStart() override;
|
||||
virtual bool RecvOnStart(const nsString& aUri) override;
|
||||
|
||||
virtual bool Recv__delete__(const bool& aIsError,
|
||||
const float& aElapsedTime,
|
||||
|
@ -120,10 +120,10 @@ SpeechSynthesisRequestParent::RecvCancel()
|
||||
// SpeechTaskParent
|
||||
|
||||
nsresult
|
||||
SpeechTaskParent::DispatchStartImpl()
|
||||
SpeechTaskParent::DispatchStartImpl(const nsAString& aUri)
|
||||
{
|
||||
MOZ_ASSERT(mActor);
|
||||
NS_ENSURE_TRUE(mActor->SendOnStart(), NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(mActor->SendOnStart(nsString(aUri)), NS_ERROR_FAILURE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public:
|
||||
SpeechTaskParent(float aVolume, const nsAString& aUtterance)
|
||||
: nsSpeechTask(aVolume, aUtterance) {}
|
||||
|
||||
virtual nsresult DispatchStartImpl();
|
||||
virtual nsresult DispatchStartImpl(const nsAString& aUri);
|
||||
|
||||
virtual nsresult DispatchEndImpl(float aElapsedTime, uint32_t aCharIndex);
|
||||
|
||||
|
@ -140,6 +140,12 @@ nsSpeechTask::BindStream(ProcessedMediaStream* aStream)
|
||||
mPort = aStream->AllocateInputPort(mStream, 0);
|
||||
}
|
||||
|
||||
void
|
||||
nsSpeechTask::SetChosenVoiceURI(const nsAString& aUri)
|
||||
{
|
||||
mChosenVoiceURI = aUri;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSpeechTask::Setup(nsISpeechTaskCallback* aCallback,
|
||||
uint32_t aChannels, uint32_t aRate, uint8_t argc)
|
||||
@ -281,6 +287,12 @@ nsSpeechTask::DispatchStart()
|
||||
|
||||
nsresult
|
||||
nsSpeechTask::DispatchStartImpl()
|
||||
{
|
||||
return DispatchStartImpl(mChosenVoiceURI);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSpeechTask::DispatchStartImpl(const nsAString& aUri)
|
||||
{
|
||||
LOG(PR_LOG_DEBUG, ("nsSpeechTask::DispatchStart"));
|
||||
|
||||
@ -289,6 +301,7 @@ nsSpeechTask::DispatchStartImpl()
|
||||
NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
mUtterance->mState = SpeechSynthesisUtterance::STATE_SPEAKING;
|
||||
mUtterance->mChosenVoiceURI = aUri;
|
||||
mUtterance->DispatchSpeechSynthesisEvent(NS_LITERAL_STRING("start"), 0, 0,
|
||||
NS_LITERAL_STRING(""));
|
||||
|
||||
|
@ -47,10 +47,14 @@ public:
|
||||
|
||||
void BindStream(ProcessedMediaStream* aStream);
|
||||
|
||||
void SetChosenVoiceURI(const nsAString& aUri);
|
||||
|
||||
protected:
|
||||
virtual ~nsSpeechTask();
|
||||
|
||||
virtual nsresult DispatchStartImpl();
|
||||
nsresult DispatchStartImpl();
|
||||
|
||||
virtual nsresult DispatchStartImpl(const nsAString& aUri);
|
||||
|
||||
virtual nsresult DispatchEndImpl(float aElapsedTime, uint32_t aCharIndex);
|
||||
|
||||
@ -89,6 +93,8 @@ private:
|
||||
nsRefPtr<SpeechSynthesis> mSpeechSynthesis;
|
||||
|
||||
bool mIndirectAudio;
|
||||
|
||||
nsString mChosenVoiceURI;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
@ -567,6 +567,8 @@ nsSynthVoiceRegistry::Speak(const nsAString& aText,
|
||||
return;
|
||||
}
|
||||
|
||||
aTask->SetChosenVoiceURI(voice->mUri);
|
||||
|
||||
LOG(PR_LOG_DEBUG, ("nsSynthVoiceRegistry::Speak - Using voice URI: %s",
|
||||
NS_ConvertUTF16toUTF8(voice->mUri).get()));
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "nsIFile.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "prenv.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include <dlfcn.h>
|
||||
|
||||
@ -453,6 +453,11 @@ nsPicoService::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
NS_ENSURE_TRUE(!strcmp(aTopic, "profile-after-change"), NS_ERROR_UNEXPECTED);
|
||||
|
||||
if (!Preferences::GetBool("media.webspeech.synth.enabled") ||
|
||||
Preferences::GetBool("media.webspeech.synth.test")) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
DebugOnly<nsresult> rv = NS_NewNamedThread("Pico Worker", getter_AddRefs(mThread));
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
return mThread->Dispatch(
|
||||
|
@ -83,7 +83,7 @@ static JSObjWrapperTable sJSObjWrappers;
|
||||
static bool sJSObjWrappersAccessible = false;
|
||||
|
||||
// Hash of NPObject wrappers that wrap NPObjects as JSObjects.
|
||||
static PLDHashTable sNPObjWrappers;
|
||||
static PLDHashTable* sNPObjWrappers;
|
||||
|
||||
// Global wrapper count. This includes JSObject wrappers *and*
|
||||
// NPObject wrappers. When this count goes to zero, there are no more
|
||||
@ -401,23 +401,24 @@ DestroyJSObjWrapperTable()
|
||||
static bool
|
||||
CreateNPObjWrapperTable()
|
||||
{
|
||||
MOZ_ASSERT(!sNPObjWrappers.IsInitialized());
|
||||
MOZ_ASSERT(!sNPObjWrappers);
|
||||
|
||||
if (!RegisterGCCallbacks()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PL_DHashTableInit(&sNPObjWrappers, PL_DHashGetStubOps(),
|
||||
sizeof(NPObjWrapperHashEntry));
|
||||
sNPObjWrappers =
|
||||
new PLDHashTable(PL_DHashGetStubOps(), sizeof(NPObjWrapperHashEntry));
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
DestroyNPObjWrapperTable()
|
||||
{
|
||||
MOZ_ASSERT(sNPObjWrappers.EntryCount() == 0);
|
||||
MOZ_ASSERT(sNPObjWrappers->EntryCount() == 0);
|
||||
|
||||
PL_DHashTableFinish(&sNPObjWrappers);
|
||||
delete sNPObjWrappers;
|
||||
sNPObjWrappers = nullptr;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -436,7 +437,7 @@ OnWrapperDestroyed()
|
||||
DestroyJSObjWrapperTable();
|
||||
}
|
||||
|
||||
if (sNPObjWrappers.IsInitialized()) {
|
||||
if (sNPObjWrappers) {
|
||||
// No more wrappers, and our hash was initialized. Finish the
|
||||
// hash to prevent leaking it.
|
||||
DestroyNPObjWrapperTable();
|
||||
@ -1761,8 +1762,8 @@ NPObjWrapper_Finalize(js::FreeOp *fop, JSObject *obj)
|
||||
{
|
||||
NPObject *npobj = (NPObject *)::JS_GetPrivate(obj);
|
||||
if (npobj) {
|
||||
if (sNPObjWrappers.IsInitialized()) {
|
||||
PL_DHashTableRemove(&sNPObjWrappers, npobj);
|
||||
if (sNPObjWrappers) {
|
||||
PL_DHashTableRemove(sNPObjWrappers, npobj);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1777,7 +1778,7 @@ NPObjWrapper_ObjectMoved(JSObject *obj, const JSObject *old)
|
||||
// The wrapper JSObject has been moved, so we need to update the entry in the
|
||||
// sNPObjWrappers hash table, if present.
|
||||
|
||||
if (!sNPObjWrappers.IsInitialized()) {
|
||||
if (!sNPObjWrappers) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1790,7 +1791,7 @@ NPObjWrapper_ObjectMoved(JSObject *obj, const JSObject *old)
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
NPObjWrapperHashEntry *entry = static_cast<NPObjWrapperHashEntry *>
|
||||
(PL_DHashTableSearch(&sNPObjWrappers, npobj));
|
||||
(PL_DHashTableSearch(sNPObjWrappers, npobj));
|
||||
MOZ_ASSERT(entry && entry->mJSObj);
|
||||
MOZ_ASSERT(entry->mJSObj == old);
|
||||
entry->mJSObj = obj;
|
||||
@ -1836,14 +1837,14 @@ nsNPObjWrapper::OnDestroy(NPObject *npobj)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sNPObjWrappers.IsInitialized()) {
|
||||
if (!sNPObjWrappers) {
|
||||
// No hash yet (or any more), no used wrappers available.
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
NPObjWrapperHashEntry *entry = static_cast<NPObjWrapperHashEntry *>
|
||||
(PL_DHashTableSearch(&sNPObjWrappers, npobj));
|
||||
(PL_DHashTableSearch(sNPObjWrappers, npobj));
|
||||
|
||||
if (entry && entry->mJSObj) {
|
||||
// Found a live NPObject wrapper, null out its JSObjects' private
|
||||
@ -1852,7 +1853,7 @@ nsNPObjWrapper::OnDestroy(NPObject *npobj)
|
||||
::JS_SetPrivate(entry->mJSObj, nullptr);
|
||||
|
||||
// Remove the npobj from the hash now that it went away.
|
||||
PL_DHashTableRawRemove(&sNPObjWrappers, entry);
|
||||
PL_DHashTableRawRemove(sNPObjWrappers, entry);
|
||||
|
||||
// The finalize hook will call OnWrapperDestroyed().
|
||||
}
|
||||
@ -1886,7 +1887,7 @@ nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, NPObject *npobj)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!sNPObjWrappers.IsInitialized()) {
|
||||
if (!sNPObjWrappers) {
|
||||
// No hash yet (or any more), initialize it.
|
||||
if (!CreateNPObjWrapperTable()) {
|
||||
return nullptr;
|
||||
@ -1894,7 +1895,7 @@ nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, NPObject *npobj)
|
||||
}
|
||||
|
||||
NPObjWrapperHashEntry *entry = static_cast<NPObjWrapperHashEntry *>
|
||||
(PL_DHashTableAdd(&sNPObjWrappers, npobj, fallible));
|
||||
(PL_DHashTableAdd(sNPObjWrappers, npobj, fallible));
|
||||
|
||||
if (!entry) {
|
||||
// Out of memory
|
||||
@ -1916,24 +1917,24 @@ nsNPObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, NPObject *npobj)
|
||||
entry->mNPObj = npobj;
|
||||
entry->mNpp = npp;
|
||||
|
||||
uint32_t generation = sNPObjWrappers.Generation();
|
||||
uint32_t generation = sNPObjWrappers->Generation();
|
||||
|
||||
// No existing JSObject, create one.
|
||||
|
||||
JS::Rooted<JSObject*> obj(cx, ::JS_NewObject(cx, js::Jsvalify(&sNPObjectJSWrapperClass)));
|
||||
|
||||
if (generation != sNPObjWrappers.Generation()) {
|
||||
if (generation != sNPObjWrappers->Generation()) {
|
||||
// Reload entry if the JS_NewObject call caused a GC and reallocated
|
||||
// the table (see bug 445229). This is guaranteed to succeed.
|
||||
|
||||
NS_ASSERTION(PL_DHashTableSearch(&sNPObjWrappers, npobj),
|
||||
NS_ASSERTION(PL_DHashTableSearch(sNPObjWrappers, npobj),
|
||||
"Hashtable didn't find what we just added?");
|
||||
}
|
||||
|
||||
if (!obj) {
|
||||
// OOM? Remove the stale entry from the hash.
|
||||
|
||||
PL_DHashTableRawRemove(&sNPObjWrappers, entry);
|
||||
PL_DHashTableRawRemove(sNPObjWrappers, entry);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
@ -2039,9 +2040,9 @@ nsJSNPRuntime::OnPluginDestroy(NPP npp)
|
||||
// Use the safe JSContext here as we're not always able to find the
|
||||
// JSContext associated with the NPP any more.
|
||||
AutoSafeJSContext cx;
|
||||
if (sNPObjWrappers.IsInitialized()) {
|
||||
if (sNPObjWrappers) {
|
||||
NppAndCx nppcx = { npp, cx };
|
||||
PL_DHashTableEnumerate(&sNPObjWrappers,
|
||||
PL_DHashTableEnumerate(sNPObjWrappers,
|
||||
NPObjWrapperPluginDestroyedCallback, &nppcx);
|
||||
}
|
||||
}
|
||||
@ -2074,7 +2075,7 @@ LookupNPP(NPObject *npobj)
|
||||
}
|
||||
|
||||
NPObjWrapperHashEntry *entry = static_cast<NPObjWrapperHashEntry *>
|
||||
(PL_DHashTableAdd(&sNPObjWrappers, npobj, fallible));
|
||||
(PL_DHashTableAdd(sNPObjWrappers, npobj, fallible));
|
||||
|
||||
if (!entry) {
|
||||
return nullptr;
|
||||
|
16
dom/tests/unit/test_xhr_init.js
Normal file
16
dom/tests/unit/test_xhr_init.js
Normal file
@ -0,0 +1,16 @@
|
||||
function run_test()
|
||||
{
|
||||
Components.utils.importGlobalProperties(["XMLHttpRequest"]);
|
||||
|
||||
var x = new XMLHttpRequest({mozAnon: true, mozSystem: false});
|
||||
do_check_true(x.mozAnon);
|
||||
do_check_true(x.mozSystem); // Because we're system principal
|
||||
|
||||
x = new XMLHttpRequest({mozAnon: true});
|
||||
do_check_true(x.mozAnon);
|
||||
do_check_true(x.mozSystem);
|
||||
|
||||
x = new XMLHttpRequest();
|
||||
do_check_false(x.mozAnon);
|
||||
do_check_true(x.mozSystem);
|
||||
}
|
@ -23,3 +23,4 @@ skip-if = os == "android"
|
||||
[test_geolocation_position_unavailable_wrap.js]
|
||||
skip-if = os == "mac" || os == "android"
|
||||
[test_PromiseDebugging.js]
|
||||
[test_xhr_init.js]
|
||||
|
@ -43,6 +43,6 @@ partial interface EventTarget {
|
||||
// chrome easier. This returns the window which can be used to create
|
||||
// events to fire at this EventTarget, or null if there isn't one.
|
||||
partial interface EventTarget {
|
||||
[ChromeOnly, Exposed=Window]
|
||||
[ChromeOnly, Exposed=Window, BinaryName="ownerGlobalForBindings"]
|
||||
readonly attribute WindowProxy? ownerGlobal;
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ interface FontFaceSet : EventTarget {
|
||||
readonly attribute unsigned long size;
|
||||
[Throws] void add(FontFace font);
|
||||
boolean has(FontFace font);
|
||||
[Throws] boolean delete(FontFace font);
|
||||
boolean delete(FontFace font);
|
||||
void clear();
|
||||
[NewObject] FontFaceSetIterator entries();
|
||||
// Iterator keys();
|
||||
|
@ -28,4 +28,7 @@ interface SpeechSynthesisUtterance : EventTarget {
|
||||
attribute EventHandler onresume;
|
||||
attribute EventHandler onmark;
|
||||
attribute EventHandler onboundary;
|
||||
|
||||
[ChromeOnly]
|
||||
readonly attribute DOMString chosenVoiceURI;
|
||||
};
|
||||
|
@ -1093,7 +1093,7 @@ nsresult nsHTMLEditor::InsertObject(const char* aType, nsISupports* aObject, boo
|
||||
aSourceDoc,
|
||||
aDestinationNode, aDestOffset,
|
||||
aDoDeleteSelection,
|
||||
aIsSafe);
|
||||
aIsSafe, false);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -25,6 +25,7 @@ skip-if = buildapp == 'mulet'
|
||||
[test_bug1102906.html]
|
||||
[test_bug1101392.html]
|
||||
[test_bug1140105.html]
|
||||
[test_bug1140617.xul]
|
||||
[test_bug1154791.html]
|
||||
[test_composition_event_created_in_chrome.html]
|
||||
[test_contenteditable_text_input_handling.html]
|
||||
|
70
editor/libeditor/tests/test_bug1140617.xul
Normal file
70
editor/libeditor/tests/test_bug1140617.xul
Normal file
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin"
|
||||
type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1140617
|
||||
-->
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="Mozilla Bug 1140617" onload="runTest();">
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1140617"
|
||||
target="_blank">Mozilla Bug 1140617</a>
|
||||
<p/>
|
||||
<iframe id="i1" width="200" height="100" src="about:blank" /><br />
|
||||
<img id="i" src="green.png" />
|
||||
<p/>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
<script class="testbody" type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
function runTest() {
|
||||
function pasteIntoAndCheck() {
|
||||
var e = document.getElementById('i1');
|
||||
var doc = e.contentDocument;
|
||||
doc.designMode = "on";
|
||||
doc.defaultView.focus();
|
||||
var selection = doc.defaultView.getSelection();
|
||||
selection.removeAllRanges();
|
||||
selection.selectAllChildren(doc.body);
|
||||
selection.collapseToEnd();
|
||||
|
||||
doc.execCommand("fontname", false, "Arial");
|
||||
doc.execCommand("bold", false, null);
|
||||
doc.execCommand("insertText", false, "12345");
|
||||
doc.execCommand("paste", false, null);
|
||||
doc.execCommand("insertText", false, "a");
|
||||
|
||||
is(doc.queryCommandValue("fontname"), "Arial", "Arial expected");
|
||||
is(doc.queryCommandState("bold"), true, "Bold expected");
|
||||
}
|
||||
|
||||
function copyToClipBoard() {
|
||||
var tmpNode = document.popupNode;
|
||||
document.popupNode = document.getElementById("i");
|
||||
|
||||
const kCmd = "cmd_copyImageContents";
|
||||
var controller = top.document.commandDispatcher
|
||||
.getControllerForCommand(kCmd);
|
||||
ok((controller && controller.isCommandEnabled(kCmd)), "have copy command");
|
||||
controller.doCommand(kCmd);
|
||||
|
||||
document.popupNode = tmpNode;
|
||||
}
|
||||
|
||||
copyToClipBoard();
|
||||
pasteIntoAndCheck();
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* vim: ft=cpp tw=78 sw=4 et ts=8
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 sw=2 et tw=78: */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
@ -8,6 +8,11 @@
|
||||
|
||||
#include "2D.h"
|
||||
|
||||
#ifdef MOZ_X11
|
||||
#include <X11/extensions/Xrender.h>
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
|
||||
struct _cairo;
|
||||
typedef struct _cairo cairo_t;
|
||||
|
||||
@ -69,6 +74,69 @@ private:
|
||||
DrawTarget *mDT;
|
||||
};
|
||||
|
||||
#ifdef MOZ_X11
|
||||
/* This is a helper class that let's you borrow an Xlib drawable from
|
||||
* a DrawTarget. This is used for drawing themed widgets.
|
||||
*
|
||||
* Callers should check the Xlib drawable after constructing the object
|
||||
* to see if it succeeded. The DrawTarget should not be used while
|
||||
* the drawable is borrowed. */
|
||||
class BorrowedXlibDrawable
|
||||
{
|
||||
public:
|
||||
BorrowedXlibDrawable()
|
||||
: mDT(nullptr),
|
||||
mDisplay(nullptr),
|
||||
mDrawable(None),
|
||||
mScreen(nullptr),
|
||||
mVisual(nullptr),
|
||||
mXRenderFormat(nullptr)
|
||||
{}
|
||||
|
||||
explicit BorrowedXlibDrawable(DrawTarget *aDT)
|
||||
: mDT(nullptr),
|
||||
mDisplay(nullptr),
|
||||
mDrawable(None),
|
||||
mScreen(nullptr),
|
||||
mVisual(nullptr),
|
||||
mXRenderFormat(nullptr)
|
||||
{
|
||||
Init(aDT);
|
||||
}
|
||||
|
||||
// We can optionally Init after construction in
|
||||
// case we don't know what the DT will be at construction
|
||||
// time.
|
||||
bool Init(DrawTarget *aDT);
|
||||
|
||||
// The caller needs to call Finish if drawable is non-zero when
|
||||
// they are done with the context. This is currently explicit
|
||||
// instead of happening implicitly in the destructor to make
|
||||
// what's happening in the caller more clear. It also
|
||||
// let's you resume using the DrawTarget in the same scope.
|
||||
void Finish();
|
||||
|
||||
~BorrowedXlibDrawable() {
|
||||
MOZ_ASSERT(!mDrawable);
|
||||
}
|
||||
|
||||
Display *GetDisplay() const { return mDisplay; }
|
||||
Drawable GetDrawable() const { return mDrawable; }
|
||||
Screen *GetScreen() const { return mScreen; }
|
||||
Visual *GetVisual() const { return mVisual; }
|
||||
|
||||
XRenderPictFormat* GetXRenderFormat() const { return mXRenderFormat; }
|
||||
|
||||
private:
|
||||
DrawTarget *mDT;
|
||||
Display *mDisplay;
|
||||
Drawable mDrawable;
|
||||
Screen *mScreen;
|
||||
Visual *mVisual;
|
||||
XRenderPictFormat *mXRenderFormat;
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
/* This is a helper class that let's you borrow a CGContextRef from a
|
||||
* DrawTargetCG. This is used for drawing themed widgets.
|
||||
|
@ -1714,5 +1714,50 @@ BorrowedCairoContext::ReturnCairoContextToDrawTarget(DrawTarget* aDT,
|
||||
cairoDT->mContext = aCairo;
|
||||
}
|
||||
|
||||
#ifdef MOZ_X11
|
||||
bool
|
||||
BorrowedXlibDrawable::Init(DrawTarget* aDT)
|
||||
{
|
||||
MOZ_ASSERT(aDT, "Caller should check for nullptr");
|
||||
MOZ_ASSERT(!mDT, "Can't initialize twice!");
|
||||
mDT = aDT;
|
||||
mDrawable = None;
|
||||
|
||||
#ifdef CAIRO_HAS_XLIB_SURFACE
|
||||
if (aDT->GetBackendType() != BackendType::CAIRO ||
|
||||
aDT->IsDualDrawTarget() ||
|
||||
aDT->IsTiledDrawTarget()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DrawTargetCairo* cairoDT = static_cast<DrawTargetCairo*>(aDT);
|
||||
cairo_surface_t* surf = cairoDT->mSurface;
|
||||
if (cairo_surface_get_type(surf) != CAIRO_SURFACE_TYPE_XLIB) {
|
||||
return false;
|
||||
}
|
||||
|
||||
cairoDT->WillChange();
|
||||
|
||||
mDisplay = cairo_xlib_surface_get_display(surf);
|
||||
mDrawable = cairo_xlib_surface_get_drawable(surf);
|
||||
mScreen = cairo_xlib_surface_get_screen(surf);
|
||||
mVisual = cairo_xlib_surface_get_visual(surf);
|
||||
mXRenderFormat = cairo_xlib_surface_get_xrender_format(surf);
|
||||
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
BorrowedXlibDrawable::Finish()
|
||||
{
|
||||
if (mDrawable) {
|
||||
mDrawable = None;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ class DrawTargetCairo final : public DrawTarget
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetCairo, override)
|
||||
friend class BorrowedCairoContext;
|
||||
friend class BorrowedXlibDrawable;
|
||||
|
||||
DrawTargetCairo();
|
||||
virtual ~DrawTargetCairo();
|
||||
|
@ -148,6 +148,35 @@ DrawTargetSkia::Snapshot()
|
||||
return snapshot.forget();
|
||||
}
|
||||
|
||||
bool
|
||||
DrawTargetSkia::LockBits(uint8_t** aData, IntSize* aSize,
|
||||
int32_t* aStride, SurfaceFormat* aFormat)
|
||||
{
|
||||
const SkBitmap &bitmap = mCanvas->getDevice()->accessBitmap(false);
|
||||
if (!bitmap.lockPixelsAreWritable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MarkChanged();
|
||||
|
||||
bitmap.lockPixels();
|
||||
*aData = reinterpret_cast<uint8_t*>(bitmap.getPixels());
|
||||
*aSize = IntSize(bitmap.width(), bitmap.height());
|
||||
*aStride = int32_t(bitmap.rowBytes());
|
||||
*aFormat = SkiaColorTypeToGfxFormat(bitmap.colorType());
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
DrawTargetSkia::ReleaseBits(uint8_t* aData)
|
||||
{
|
||||
const SkBitmap &bitmap = mCanvas->getDevice()->accessBitmap(false);
|
||||
MOZ_ASSERT(bitmap.lockPixelsAreWritable());
|
||||
|
||||
bitmap.unlockPixels();
|
||||
bitmap.notifyPixelsChanged();
|
||||
}
|
||||
|
||||
static void
|
||||
SetPaintPattern(SkPaint& aPaint, const Pattern& aPattern, TempBitmap& aTmpBitmap,
|
||||
Float aAlpha = 1.0)
|
||||
@ -688,10 +717,10 @@ DrawTargetSkia::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurfa
|
||||
cairo_surface_t* surf = static_cast<cairo_surface_t*>(aSurface.mSurface);
|
||||
return new SourceSurfaceCairo(surf, aSurface.mSize, aSurface.mFormat);
|
||||
#if USE_SKIA_GPU
|
||||
} else if (aSurface.mType == NativeSurfaceType::OPENGL_TEXTURE) {
|
||||
} else if (aSurface.mType == NativeSurfaceType::OPENGL_TEXTURE && UsingSkiaGPU()) {
|
||||
RefPtr<SourceSurfaceSkia> newSurf = new SourceSurfaceSkia();
|
||||
unsigned int texture = (unsigned int)((uintptr_t)aSurface.mSurface);
|
||||
if (UsingSkiaGPU() && newSurf->InitFromTexture((DrawTargetSkia*)this, texture, aSurface.mSize, aSurface.mFormat)) {
|
||||
if (newSurf->InitFromTexture((DrawTargetSkia*)this, texture, aSurface.mSize, aSurface.mFormat)) {
|
||||
return newSurf;
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -36,6 +36,9 @@ public:
|
||||
virtual BackendType GetBackendType() const override { return BackendType::SKIA; }
|
||||
virtual TemporaryRef<SourceSurface> Snapshot() override;
|
||||
virtual IntSize GetSize() override { return mSize; }
|
||||
virtual bool LockBits(uint8_t** aData, IntSize* aSize,
|
||||
int32_t* aStride, SurfaceFormat* aFormat) override;
|
||||
virtual void ReleaseBits(uint8_t* aData) override;
|
||||
virtual void Flush() override;
|
||||
virtual void DrawSurface(SourceSurface *aSurface,
|
||||
const Rect &aDest,
|
||||
|
@ -79,6 +79,7 @@ if CONFIG['MOZ_ENABLE_SKIA']:
|
||||
'image_operations.cpp', # Uses _USE_MATH_DEFINES
|
||||
]
|
||||
EXPORTS.mozilla.gfx += [
|
||||
'HelpersCairo.h',
|
||||
'HelpersSkia.h',
|
||||
]
|
||||
|
||||
|
@ -14,11 +14,44 @@
|
||||
#define cairo_copy_path_flat _moz_cairo_copy_path_flat
|
||||
#define cairo_create _moz_cairo_create
|
||||
#define cairo_curve_to _moz_cairo_curve_to
|
||||
#define cairo_d2d_create_device _moz_cairo_d2d_create_device
|
||||
#define cairo_d2d_create_device_from_d3d10device _moz_cairo_d2d_create_device_from_d3d10device
|
||||
#define cairo_d2d_device_get_device _moz_cairo_d2d_device_get_device
|
||||
#define cairo_d2d_get_dc _moz_cairo_d2d_get_dc
|
||||
#define cairo_d2d_get_image_surface_cache_usage _moz_cairo_d2d_get_image_surface_cache_usage
|
||||
#define cairo_d2d_get_surface_vram_usage _moz_cairo_d2d_get_surface_vram_usage
|
||||
#define cairo_d2d_present_backbuffer _moz_cairo_d2d_present_backbuffer
|
||||
#define cairo_d2d_release_dc _moz_cairo_d2d_release_dc
|
||||
#define cairo_d2d_scroll _moz_cairo_d2d_scroll
|
||||
#define cairo_d2d_surface_create _moz_cairo_d2d_surface_create
|
||||
#define cairo_d2d_surface_create_for_handle _moz_cairo_d2d_surface_create_for_handle
|
||||
#define cairo_d2d_surface_create_for_hwnd _moz_cairo_d2d_surface_create_for_hwnd
|
||||
#define cairo_d2d_surface_create_for_texture _moz_cairo_d2d_surface_create_for_texture
|
||||
#define cairo_d2d_surface_get_height _moz_cairo_d2d_surface_get_height
|
||||
#define cairo_d2d_surface_get_texture _moz_cairo_d2d_surface_get_texture
|
||||
#define cairo_d2d_surface_get_width _moz_cairo_d2d_surface_get_width
|
||||
#define cairo_debug_reset_static_data _moz_cairo_debug_reset_static_data
|
||||
#define cairo_destroy _moz_cairo_destroy
|
||||
#define cairo_device_acquire _moz_cairo_device_acquire
|
||||
#define cairo_device_destroy _moz_cairo_device_destroy
|
||||
#define cairo_device_finish _moz_cairo_device_finish
|
||||
#define cairo_device_flush _moz_cairo_device_flush
|
||||
#define cairo_device_get_reference_count _moz_cairo_device_get_reference_count
|
||||
#define cairo_device_get_type _moz_cairo_device_get_type
|
||||
#define cairo_device_get_user_data _moz_cairo_device_get_user_data
|
||||
#define cairo_device_release _moz_cairo_device_release
|
||||
#define cairo_device_set_user_data _moz_cairo_device_set_user_data
|
||||
#define cairo_device_status _moz_cairo_device_status
|
||||
#define cairo_device_reference _moz_cairo_device_reference
|
||||
#define cairo_device_to_user _moz_cairo_device_to_user
|
||||
#define cairo_device_to_user_distance _moz_cairo_device_to_user_distance
|
||||
#define cairo_directfb_surface_create _moz_cairo_directfb_surface_create
|
||||
#define cairo_dwrite_font_face_create_for_dwrite_fontface _moz_cairo_dwrite_font_face_create_for_dwrite_fontface
|
||||
#define cairo_dwrite_get_cleartype_rendering_mode _moz_cairo_dwrite_get_cleartype_rendering_mode
|
||||
#define cairo_dwrite_scaled_font_allow_manual_show_glyphs _moz_cairo_dwrite_scaled_font_allow_manual_show_glyphs
|
||||
#define cairo_dwrite_scaled_font_get_force_GDI_classic _moz_cairo_dwrite_scaled_font_get_force_GDI_classic
|
||||
#define cairo_dwrite_scaled_font_set_force_GDI_classic _moz_cairo_dwrite_scaled_font_set_force_GDI_classic
|
||||
#define cairo_dwrite_set_cleartype_params _moz_cairo_dwrite_set_cleartype_params
|
||||
#define cairo_fill _moz_cairo_fill
|
||||
#define cairo_fill_extents _moz_cairo_fill_extents
|
||||
#define cairo_fill_preserve _moz_cairo_fill_preserve
|
||||
@ -112,6 +145,7 @@
|
||||
#define cairo_move_to _moz_cairo_move_to
|
||||
#define cairo_new_path _moz_cairo_new_path
|
||||
#define cairo_new_sub_path _moz_cairo_new_sub_path
|
||||
#define cairo_null_surface_create _moz_cairo_null_surface_create
|
||||
#define cairo_os2_fini _moz_cairo_os2_fini
|
||||
#define cairo_os2_init _moz_cairo_os2_init
|
||||
#define cairo_os2_surface_create _moz_cairo_os2_surface_create
|
||||
@ -215,9 +249,12 @@
|
||||
#define cairo_region_translate _moz_cairo_region_translate
|
||||
#define cairo_region_union _moz_cairo_region_union
|
||||
#define cairo_region_union_rectangle _moz_cairo_region_union_rectangle
|
||||
#define cairo_region_xor _moz_cairo_region_xor
|
||||
#define cairo_region_xor_rectangle _moz_cairo_region_xor_rectangle
|
||||
#define cairo_rel_curve_to _moz_cairo_rel_curve_to
|
||||
#define cairo_rel_line_to _moz_cairo_rel_line_to
|
||||
#define cairo_rel_move_to _moz_cairo_rel_move_to
|
||||
#define cairo_release_device _moz_cairo_release_device
|
||||
#define cairo_reset_clip _moz_cairo_reset_clip
|
||||
#define cairo_restore _moz_cairo_restore
|
||||
#define cairo_rotate _moz_cairo_rotate
|
||||
@ -271,12 +308,16 @@
|
||||
#define cairo_stroke_extents _moz_cairo_stroke_extents
|
||||
#define cairo_stroke_preserve _moz_cairo_stroke_preserve
|
||||
#define cairo_stroke_to_path _moz_cairo_stroke_to_path
|
||||
#define cairo_surface_attach_snapshot _moz_cairo_surface_attach_snapshot
|
||||
#define cairo_surface_copy_page _moz_cairo_surface_copy_page
|
||||
#define cairo_surface_create_for_rectangle _moz_cairo_surface_create_for_rectangle
|
||||
#define cairo_surface_create_similar _moz_cairo_surface_create_similar
|
||||
#define cairo_surface_detach_snapshot _moz_cairo_surface_detach_snapshot
|
||||
#define cairo_surface_destroy _moz_cairo_surface_destroy
|
||||
#define cairo_surface_finish _moz_cairo_surface_finish
|
||||
#define cairo_surface_flush _moz_cairo_surface_flush
|
||||
#define cairo_surface_get_content _moz_cairo_surface_get_content
|
||||
#define cairo_surface_get_device _moz_cairo_surface_get_device
|
||||
#define cairo_surface_get_device_offset _moz_cairo_surface_get_device_offset
|
||||
#define cairo_surface_get_fallback_resolution _moz_cairo_surface_get_fallback_resolution
|
||||
#define cairo_surface_get_font_options _moz_cairo_surface_get_font_options
|
||||
@ -330,6 +371,8 @@
|
||||
#define cairo_user_to_device_distance _moz_cairo_user_to_device_distance
|
||||
#define cairo_version _moz_cairo_version
|
||||
#define cairo_version_string _moz_cairo_version_string
|
||||
#define cairo_win32_get_dc_with_clip _moz_cairo_win32_get_dc_with_clip
|
||||
#define cairo_win32_get_system_text_quality _moz_cairo_win32_get_system_text_quality
|
||||
#define cairo_win32_font_face_create_for_hfont _moz_cairo_win32_font_face_create_for_hfont
|
||||
#define cairo_win32_font_face_create_for_logfontw _moz_cairo_win32_font_face_create_for_logfontw
|
||||
#define cairo_win32_font_face_create_for_logfontw_hfont _moz_cairo_win32_font_face_create_for_logfontw_hfont
|
||||
@ -340,11 +383,15 @@
|
||||
#define cairo_win32_scaled_font_get_metrics_factor _moz_cairo_win32_scaled_font_get_metrics_factor
|
||||
#define cairo_win32_scaled_font_select_font _moz_cairo_win32_scaled_font_select_font
|
||||
#define cairo_win32_surface_create _moz_cairo_win32_surface_create
|
||||
#define cairo_win32_surface_create_with_alpha _moz_cairo_win32_surface_create_with_alpha
|
||||
#define cairo_win32_surface_create_with_d3dsurface9 _moz_cairo_win32_surface_create_with_d3dsurface9
|
||||
#define cairo_win32_surface_create_with_ddb _moz_cairo_win32_surface_create_with_ddb
|
||||
#define cairo_win32_surface_create_with_dib _moz_cairo_win32_surface_create_with_dib
|
||||
#define cairo_win32_surface_get_dc _moz_cairo_win32_surface_get_dc
|
||||
#define cairo_win32_surface_get_height _moz_cairo_win32_surface_get_height
|
||||
#define cairo_win32_surface_get_image _moz_cairo_win32_surface_get_image
|
||||
#define cairo_win32_surface_get_width _moz_cairo_win32_surface_get_width
|
||||
#define cairo_win32_surface_set_can_convert_to_dib _moz_cairo_win32_surface_set_can_convert_to_dib
|
||||
#define cairo_xcb_surface_create _moz_cairo_xcb_surface_create
|
||||
#define cairo_xcb_surface_create_for_bitmap _moz_cairo_xcb_surface_create_for_bitmap
|
||||
#define cairo_xcb_surface_create_with_xrender_format _moz_cairo_xcb_surface_create_with_xrender_format
|
||||
@ -362,4 +409,3 @@
|
||||
#define cairo_xlib_surface_get_xrender_format _moz_cairo_xlib_surface_get_xrender_format
|
||||
#define cairo_xlib_surface_set_drawable _moz_cairo_xlib_surface_set_drawable
|
||||
#define cairo_xlib_surface_set_size _moz_cairo_xlib_surface_set_size
|
||||
#include "pixman-rename.h"
|
||||
|
@ -1,4 +1,15 @@
|
||||
#ifdef MOZ_TREE_PIXMAN
|
||||
#define pixman_composite_glyphs _moz_pixman_composite_glyphs
|
||||
#define pixman_composite_glyphs_no_mask _moz_pixman_composite_glyphs_no_mask
|
||||
#define pixman_glyph_cache_create _moz_pixman_glyph_cache_create
|
||||
#define pixman_glyph_cache_destroy _moz_pixman_glyph_cache_destroy
|
||||
#define pixman_glyph_cache_freeze _moz_pixman_glyph_cache_freeze
|
||||
#define pixman_glyph_cache_insert _moz_pixman_glyph_cache_insert
|
||||
#define pixman_glyph_cache_lookup _moz_pixman_glyph_cache_lookup
|
||||
#define pixman_glyph_cache_remove _moz_pixman_glyph_cache_remove
|
||||
#define pixman_glyph_cache_thaw _moz_pixman_glyph_cache_thaw
|
||||
#define pixman_glyph_get_extents _moz_pixman_glyph_get_extents
|
||||
#define pixman_glyph_get_mask_format _moz_pixman_glyph_get_mask_format
|
||||
#define pixman_region_set_static_pointers _moz_pixman_region_set_static_pointers
|
||||
#define pixman_region_init _moz_pixman_region_init
|
||||
#define pixman_region_init_rect _moz_pixman_region_init_rect
|
||||
@ -21,6 +32,8 @@
|
||||
#define pixman_region_equal _moz_pixman_region_equal
|
||||
#define pixman_region_selfcheck _moz_pixman_region_selfcheck
|
||||
#define pixman_region_reset _moz_pixman_region_reset
|
||||
#define pixman_region_clear _moz_pixman_region_clear
|
||||
#define pixman_region_print _moz_pixman_region_print
|
||||
#define pixman_region32_init _moz_pixman_region32_init
|
||||
#define pixman_region32_init_rect _moz_pixman_region32_init_rect
|
||||
#define pixman_region32_init_rects _moz_pixman_region32_init_rects
|
||||
@ -45,6 +58,7 @@
|
||||
#define pixman_region32_selfcheck _moz_pixman_region32_selfcheck
|
||||
#define pixman_region32_reset _moz_pixman_region32_reset
|
||||
#define pixman_region32_clear _moz_pixman_region32_clear
|
||||
#define pixman_region32_print _moz_pixman_region32_print
|
||||
#define pixman_blt _moz_pixman_blt
|
||||
#define pixman_fill _moz_pixman_fill
|
||||
#define pixman_transform_point_3d _moz_pixman_transform_point_3d
|
||||
@ -86,6 +100,9 @@
|
||||
#define pixman_rasterize_edges _moz_pixman_rasterize_edges
|
||||
#define pixman_add_traps _moz_pixman_add_traps
|
||||
#define pixman_add_trapezoids _moz_pixman_add_trapezoids
|
||||
#define pixman_add_triangles _moz_pixman_add_triangles
|
||||
#define pixman_composite_trapezoids _moz_pixman_composite_trapezoids
|
||||
#define pixman_composite_triangles _moz_pixman_composite_triangles
|
||||
#define pixman_rasterize_trapezoid _moz_pixman_rasterize_trapezoid
|
||||
#define pixman_disable_out_of_bounds_workaround _moz_pixman_disable_out_of_bounds_workaround
|
||||
#define pixman_f_transform_bounds _moz_pixman_f_transform_bounds
|
||||
|
@ -517,7 +517,7 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
|
||||
RefPtr<CompositingRenderTarget> target = CreateRenderTarget(mInvalidRect, INIT_MODE_CLEAR);
|
||||
if (!target) {
|
||||
if (!mTarget) {
|
||||
mWidget->EndRemoteDrawing();
|
||||
mWidget->EndRemoteDrawingInRegion(mDrawTarget, mInvalidRegion);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -579,7 +579,7 @@ BasicCompositor::EndFrame()
|
||||
IntPoint(r->x - offset.x, r->y - offset.y));
|
||||
}
|
||||
if (!mTarget) {
|
||||
mWidget->EndRemoteDrawing();
|
||||
mWidget->EndRemoteDrawingInRegion(mDrawTarget, mInvalidRegion);
|
||||
}
|
||||
|
||||
mDrawTarget = nullptr;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user