merge mozilla-central to mozilla-inbound. r=merge a=merge

This commit is contained in:
Sebastian Hengst 2017-10-21 00:19:00 +02:00
Родитель 8cd7b1c9be 8d0319bfa2
Коммит 6964317620
208 изменённых файлов: 4138 добавлений и 2413 удалений

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

@ -145,6 +145,9 @@ GPATH
^testing/talos/talos/mitmproxy/mitmproxy
^testing/talos/talos/mitmproxy/mitmweb
# Ignore toolchains.json created by tooltool.
^toolchains\.json
# Ignore files created when running a reftest.
^lextab.py$

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

@ -1010,14 +1010,14 @@
if (sizedIconUrl) {
if (!browser.mIconLoadingPrincipal ||
!browser.mIconLoadingPrincipal.equals(loadingPrincipal)) {
aTab.setAttribute("iconLoadingPrincipal",
aTab.setAttribute("iconloadingprincipal",
this.serializationHelper.serializeToString(loadingPrincipal));
aTab.setAttribute("requestcontextid", requestContextID);
browser.mIconLoadingPrincipal = loadingPrincipal;
}
aTab.setAttribute("image", sizedIconUrl);
} else {
aTab.removeAttribute("iconLoadingPrincipal");
aTab.removeAttribute("iconloadingprincipal");
delete browser.mIconLoadingPrincipal;
aTab.removeAttribute("image");
}
@ -7769,7 +7769,7 @@
anonid="tab-throbber"
class="tab-throbber"
layer="true"/>
<xul:image xbl:inherits="src=image,loadingprincipal=iconLoadingPrincipal,requestcontextid,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
<xul:image xbl:inherits="src=image,loadingprincipal=iconloadingprincipal,requestcontextid,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
anonid="tab-icon-image"
class="tab-icon-image"
validate="never"
@ -8258,8 +8258,10 @@
if (aTab.hasAttribute("busy")) {
aMenuitem.setAttribute("busy", aTab.getAttribute("busy"));
aMenuitem.removeAttribute("iconloadingprincipal");
aMenuitem.removeAttribute("image");
} else {
aMenuitem.setAttribute("iconloadingprincipal", aTab.getAttribute("iconloadingprincipal"));
aMenuitem.setAttribute("image", aTab.getAttribute("image"));
aMenuitem.removeAttribute("busy");
}

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

@ -102,6 +102,7 @@ add_task(async function test_pkcs11() {
browser.test.assertEq("Test PKCS11 Slot", slots[0].name, "The first slot name matches the expected name");
browser.test.assertEq("Test PKCS11 Slot 二", slots[1].name, "The second slot name matches the expected name");
browser.test.assertTrue(slots[1].token, "The second slot has a token");
browser.test.assertFalse(slots[2].token, "The third slot has no token");
browser.test.assertEq("Test PKCS11 Tokeñ 2 Label", slots[1].token.name, "The token name matches the expected name");
browser.test.assertEq("Test PKCS11 Manufacturer ID", slots[1].token.manufacturer, "The token manufacturer matches the expected manufacturer");
browser.test.assertEq("0.0", slots[1].token.HWVersion, "The token hardware version matches the expected version");

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

@ -6,6 +6,10 @@ const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/PlacesUtils.jsm");
let EventUtils = {};
Services.scriptloader.loadSubScript(
"chrome://mochikit/content/tests/SimpleTest/EventUtils.js", EventUtils);
const FIRST_PARTY_ONE = "example.com";
const FIRST_PARTY_TWO = "example.org";
const THIRD_PARTY = "mochi.test:8888";
@ -52,9 +56,10 @@ function clearAllPlacesFavicons() {
});
}
function observeFavicon(aFirstPartyDomain, aExpectedCookie, aPageURI) {
function observeFavicon(aFirstPartyDomain, aExpectedCookie, aPageURI, aOnlyXUL) {
let faviconReqXUL = false;
let faviconReqPlaces = false;
// If aOnlyXUL is true, we only care about the favicon request from XUL.
let faviconReqPlaces = aOnlyXUL === true;
let expectedPrincipal = Services.scriptSecurityManager
.createCodebasePrincipal(aPageURI, { firstPartyDomain: aFirstPartyDomain });
@ -244,6 +249,85 @@ async function doTest(aTestPage, aExpectedCookies, aFaviconURL) {
await BrowserTestUtils.removeTab(tabInfo.tab);
}
async function doTestForAllTabsFavicon(aTestPage, aExpectedCookies, aIsThirdParty) {
let firstPageURI = makeURI(TEST_SITE_ONE + aTestPage);
let secondPageURI = makeURI(TEST_SITE_TWO + aTestPage);
let faviconURI = aIsThirdParty ? THIRD_PARTY_SITE + FAVICON_URI :
TEST_SITE_ONE + FAVICON_URI;
// Set the 'overflow' attribute to make allTabs button available.
let tabBrowser = document.getElementById("tabbrowser-tabs");
let allTabsBtn = document.getElementById("alltabs-button");
tabBrowser.setAttribute("overflow", true);
// Start to observe the event of that the favicon has been fully loaded.
let promiseFaviconLoaded = waitOnFaviconLoaded(faviconURI);
// Open the tab for the first site.
let tabInfo = await openTab(TEST_SITE_ONE + aTestPage);
// Waiting until the favicon loaded.
await promiseFaviconLoaded;
// We need to clear the image cache here for making sure the network request will
// be made for the favicon of allTabs menuitem.
clearAllImageCaches();
// Start to observe the allTabs favicon requests earlier in case we miss it.
let promiseObserveFavicon = observeFavicon(FIRST_PARTY_ONE, aExpectedCookies[0],
firstPageURI, true);
// Make the popup of allTabs showing up and trigger the loading of the favicon.
let allTabsPopupShownPromise = BrowserTestUtils.waitForEvent(allTabsBtn, "popupshown");
EventUtils.synthesizeMouseAtCenter(allTabsBtn, {});
await promiseObserveFavicon;
await allTabsPopupShownPromise;
// Close the popup of allTabs and wait until it's done.
let allTabsPopupHiddenPromise = BrowserTestUtils.waitForEvent(allTabsBtn, "popuphidden");
EventUtils.synthesizeMouseAtCenter(allTabsBtn, {});
await allTabsPopupHiddenPromise;
// Close the tab.
await BrowserTestUtils.removeTab(tabInfo.tab);
faviconURI = aIsThirdParty ? THIRD_PARTY_SITE + FAVICON_URI :
TEST_SITE_TWO + FAVICON_URI;
// Start to observe the event of that favicon has been fully loaded.
promiseFaviconLoaded = waitOnFaviconLoaded(faviconURI);
// Open the tab for the second site.
tabInfo = await openTab(TEST_SITE_TWO + aTestPage);
// Wait until the favicon is fully loaded.
await promiseFaviconLoaded;
// Clear the image cache for the favicon of the second site.
clearAllImageCaches();
// Start to observe the allTabs favicon requests earlier in case we miss it.
promiseObserveFavicon = observeFavicon(FIRST_PARTY_TWO, aExpectedCookies[1],
secondPageURI, true);
// Make the popup of allTabs showing up again.
allTabsPopupShownPromise = BrowserTestUtils.waitForEvent(allTabsBtn, "popupshown");
EventUtils.synthesizeMouseAtCenter(allTabsBtn, {});
await promiseObserveFavicon;
await allTabsPopupShownPromise;
// Close the popup of allTabs and wait until it's done.
allTabsPopupHiddenPromise = BrowserTestUtils.waitForEvent(allTabsBtn, "popuphidden");
EventUtils.synthesizeMouseAtCenter(allTabsBtn, {});
await allTabsPopupHiddenPromise;
// Close the tab.
await BrowserTestUtils.removeTab(tabInfo.tab);
// Reset the 'overflow' attribute to make the allTabs button hidden again.
tabBrowser.removeAttribute("overflow");
}
add_task(async function setup() {
// Make sure first party isolation is enabled.
await SpecialPowers.pushPrefEnv({"set": [
@ -282,6 +366,26 @@ add_task(async function test_favicon_firstParty() {
}
});
add_task(async function test_allTabs_favicon_firstParty() {
for (let testThirdParty of [false, true]) {
// Clear all image caches and network caches before running the test.
clearAllImageCaches();
Services.cache2.clear();
// Clear Places favicon caches.
await clearAllPlacesFavicons();
let cookies = await generateCookies(testThirdParty);
if (testThirdParty) {
await doTestForAllTabsFavicon(TEST_THIRD_PARTY_PAGE, cookies, testThirdParty);
} else {
await doTestForAllTabsFavicon(TEST_PAGE, cookies, testThirdParty);
}
}
});
add_task(async function test_favicon_cache_firstParty() {
// Clear all image caches and network caches before running the test.
clearAllImageCaches();

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

@ -7,6 +7,10 @@ const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/Promise.jsm");
let EventUtils = {};
Services.scriptloader.loadSubScript(
"chrome://mochikit/content/tests/SimpleTest/EventUtils.js", EventUtils);
const TEST_SITE = "http://example.net";
const TEST_THIRD_PARTY_SITE = "http://mochi.test:8888";
@ -52,8 +56,8 @@ function clearAllPlacesFavicons() {
});
}
function FaviconObserver(aUserContextId, aExpectedCookie, aPageURI, aFaviconURL) {
this.reset(aUserContextId, aExpectedCookie, aPageURI, aFaviconURL);
function FaviconObserver(aUserContextId, aExpectedCookie, aPageURI, aFaviconURL, aOnlyXUL) {
this.reset(aUserContextId, aExpectedCookie, aPageURI, aFaviconURL, aOnlyXUL);
}
FaviconObserver.prototype = {
@ -108,13 +112,14 @@ FaviconObserver.prototype = {
}
},
reset(aUserContextId, aExpectedCookie, aPageURI, aFaviconURL) {
reset(aUserContextId, aExpectedCookie, aPageURI, aFaviconURL, aOnlyXUL) {
this._curUserContextId = aUserContextId;
this._expectedCookie = aExpectedCookie;
this._expectedPrincipal = Services.scriptSecurityManager
.createCodebasePrincipal(aPageURI, { userContextId: aUserContextId });
this._faviconReqXUL = false;
this._faviconReqPlaces = false;
// If aOnlyXUL is true, we only care about the favicon request from XUL.
this._faviconReqPlaces = aOnlyXUL === true;
this._faviconURL = aFaviconURL;
this._faviconLoaded = new Promise.defer();
},
@ -201,6 +206,87 @@ async function doTest(aTestPage, aFaviconHost, aFaviconURL) {
await BrowserTestUtils.removeTab(tabInfo.tab);
}
async function doTestForAllTabsFavicon(aTestPage, aFaviconHost, aFaviconURL) {
let cookies = await generateCookies(aFaviconHost);
let pageURI = makeURI(aTestPage);
// Set the 'overflow' attribute to make allTabs button available.
let tabBrowser = document.getElementById("tabbrowser-tabs");
let allTabsBtn = document.getElementById("alltabs-button");
tabBrowser.setAttribute("overflow", true);
// Create the observer object for observing request channels of the personal
// container.
let observer = new FaviconObserver(USER_CONTEXT_ID_PERSONAL, cookies[0], pageURI, aFaviconURL, true);
// Add the observer earlier in case we miss it.
let promiseWaitOnFaviconLoaded = waitOnFaviconLoaded(aFaviconURL);
// Open the tab with the personal container.
let tabInfo = await openTabInUserContext(aTestPage, USER_CONTEXT_ID_PERSONAL);
// Waiting for favicon loaded.
await promiseWaitOnFaviconLoaded;
// We need to clear the image cache here for making sure the network request will
// be made for the favicon of allTabs menuitem.
clearAllImageCaches();
// Add the observer for listening favicon requests.
Services.obs.addObserver(observer, "http-on-modify-request");
// Make the popup of allTabs showing up and trigger the loading of the favicon.
let allTabsPopupShownPromise = BrowserTestUtils.waitForEvent(allTabsBtn, "popupshown");
EventUtils.synthesizeMouseAtCenter(allTabsBtn, {});
await observer.promise;
await allTabsPopupShownPromise;
// Close the popup of allTabs and wait until it's done.
let allTabsPopupHiddenPromise = BrowserTestUtils.waitForEvent(allTabsBtn, "popuphidden");
EventUtils.synthesizeMouseAtCenter(allTabsBtn, {});
await allTabsPopupHiddenPromise;
// Remove the observer for not receiving the favicon requests for opening a tab
// since we want to focus on the favicon of allTabs menu here.
Services.obs.removeObserver(observer, "http-on-modify-request");
// Close the tab.
await BrowserTestUtils.removeTab(tabInfo.tab);
// Open the tab under the work container and wait until the favicon is loaded.
promiseWaitOnFaviconLoaded = waitOnFaviconLoaded(aFaviconURL);
tabInfo = await openTabInUserContext(aTestPage, USER_CONTEXT_ID_WORK);
await promiseWaitOnFaviconLoaded;
// Clear the image cache again.
clearAllImageCaches();
// Reset the observer for observing requests for the work container.
observer.reset(USER_CONTEXT_ID_WORK, cookies[1], pageURI, aFaviconURL, true);
// Add the observer back for listening the favicon requests for allTabs menuitem.
Services.obs.addObserver(observer, "http-on-modify-request");
// Make the popup of allTabs showing up again.
allTabsPopupShownPromise = BrowserTestUtils.waitForEvent(allTabsBtn, "popupshown");
EventUtils.synthesizeMouseAtCenter(allTabsBtn, {});
await observer.promise;
await allTabsPopupShownPromise;
// Close the popup of allTabs and wait until it's done.
allTabsPopupHiddenPromise = BrowserTestUtils.waitForEvent(allTabsBtn, "popuphidden");
EventUtils.synthesizeMouseAtCenter(allTabsBtn, {});
await allTabsPopupHiddenPromise;
Services.obs.removeObserver(observer, "http-on-modify-request");
// Close the tab.
await BrowserTestUtils.removeTab(tabInfo.tab);
// Reset the 'overflow' attribute to make the allTabs button hidden again.
tabBrowser.removeAttribute("overflow");
}
add_task(async function setup() {
// Make sure userContext is enabled.
await SpecialPowers.pushPrefEnv({"set": [
@ -247,3 +333,29 @@ add_task(async function test_thirdPartyFavicon_userContextId() {
await doTest(TEST_THIRD_PARTY_PAGE, TEST_THIRD_PARTY_SITE, THIRD_PARTY_FAVICON_URI);
});
add_task(async function test_allTabs_favicon_userContextId() {
// Clear all image caches before running the test.
clearAllImageCaches();
// Clear all network caches.
Services.cache2.clear();
// Clear Places favicon caches.
await clearAllPlacesFavicons();
await doTestForAllTabsFavicon(TEST_PAGE, TEST_SITE, FAVICON_URI);
});
add_task(async function test_allTabs_thirdPartyFavicon_userContextId() {
// Clear all image caches before running the test.
clearAllImageCaches();
// Clear all network caches.
Services.cache2.clear();
// Clear Places favicon caches.
await clearAllPlacesFavicons();
await doTestForAllTabsFavicon(TEST_THIRD_PARTY_PAGE, TEST_THIRD_PARTY_SITE, THIRD_PARTY_FAVICON_URI);
});

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

@ -30,7 +30,7 @@ add_task(async function() {
tree.controller.doCommand("placesCmd_new:folder");
},
async function test(dialogWin) {
let promiseTitleChangeNotification = promiseBookmarksNotification(
let promiseTitleChangeNotification = PlacesTestUtils.waitForNotification(
"onItemChanged", (itemId, prop, isAnno, val) => prop == "title" && val == "n");
fillBookmarkTextField("editBMPanel_namePicker", "n", dialogWin, false);

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

@ -14,7 +14,7 @@ add_task(async function() {
"livemark", "description");
},
async function test(dialogWin) {
let promiseTitleChangeNotification = promiseBookmarksNotification(
let promiseTitleChangeNotification = PlacesTestUtils.waitForNotification(
"onItemChanged", (unused, prop, isAnno, val) => prop == "title" && val == "modified");
fillBookmarkTextField("editBMPanel_namePicker", "modified", dialogWin);

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

@ -29,7 +29,7 @@ add_task(async function() {
let folderName = dialog.document.getElementById("stringBundle").getString("bookmarkAllTabsDefault");
Assert.equal(namepicker.value, folderName, "Name field is correct.");
let promiseTitleChange = promiseBookmarksNotification(
let promiseTitleChange = PlacesTestUtils.waitForNotification(
"onItemChanged", (id, prop, isAnno, val) => prop == "title" && val == "folder");
fillBookmarkTextField("editBMPanel_namePicker", "folder", dialog);
await promiseTitleChange;

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

@ -99,7 +99,7 @@ add_task(async function test_cancel_with_changes() {
await BrowserTestUtils.waitForCondition(() => !acceptButton.disabled,
"The accept button should be enabled");
let promiseTitleChangeNotification = promiseBookmarksNotification(
let promiseTitleChangeNotification = PlacesTestUtils.waitForNotification(
"onItemChanged", (itemId, prop, isAnno, val) => prop == "title" && val == "n");
fillBookmarkTextField("editBMPanel_namePicker", "n", dialogWin);

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

@ -57,7 +57,7 @@ add_task(async function test_create_and_batch_remove_bookmarks() {
Assert.equal(PO._places.selectedNode.title, "deleteme", "Folder node selected");
Assert.ok(PO._places.controller.isCommandEnabled("cmd_delete"),
"Delete command is enabled");
let promiseItemRemovedNotification = promiseBookmarksNotification(
let promiseItemRemovedNotification = PlacesTestUtils.waitForNotification(
"onItemRemoved", (itemId, parentId, index, type, uri, guid) => guid == folderNode.bookmarkGuid);
// Execute the delete command and check bookmark has been removed.
PO._places.controller.doCommand("cmd_delete");

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

@ -59,8 +59,8 @@ add_task(async function test_date_container() {
"Delete command is enabled");
// Execute the delete command and check visit has been removed.
let promiseURIRemoved = promiseHistoryNotification("onDeleteURI",
v => TEST_URI.equals(v));
let promiseURIRemoved = PlacesTestUtils.waitForNotification(
"onDeleteURI", v => TEST_URI.equals(v), "history");
PO._places.controller.doCommand("cmd_delete");
await promiseURIRemoved;
@ -124,8 +124,8 @@ add_task(async function test_query_on_toolbar() {
"Delete command is enabled");
// Execute the delete command and check bookmark has been removed.
let promiseItemRemoved = promiseBookmarksNotification("onItemRemoved",
(...args) => query.guid == args[5]);
let promiseItemRemoved = PlacesTestUtils.waitForNotification(
"onItemRemoved", (...args) => query.guid == args[5]);
PO._places.controller.doCommand("cmd_delete");
await promiseItemRemoved;

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

@ -33,7 +33,7 @@ add_task(async function test() {
*/
let simulateDragDrop = async function(aEffect, aMimeType) {
const url = "http://www.mozilla.org/D1995729-A152-4e30-8329-469B01F30AA7";
let promiseItemAddedNotification = promiseBookmarksNotification(
let promiseItemAddedNotification = PlacesTestUtils.waitForNotification(
"onItemAdded", (itemId, parentId, index, type, uri, guid) => uri.spec == url);
// We use the toolbar as the drag source, as we just need almost any node
@ -79,7 +79,7 @@ add_task(async function test() {
else
data = urls.join("\n");
let promiseItemAddedNotification = promiseBookmarksNotification(
let promiseItemAddedNotification = PlacesTestUtils.waitForNotification(
"onItemAdded", (itemId, parentId, index, type, uri, guid) => uri.spec == urls[2]);
// See notes for EventUtils.synthesizeDrop in simulateDragDrop().

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

@ -160,51 +160,6 @@ function promiseIsURIVisited(aURI) {
});
}
function promiseBookmarksNotification(notification, conditionFn) {
info(`promiseBookmarksNotification: waiting for ${notification}`);
return new Promise((resolve) => {
let proxifiedObserver = new Proxy({}, {
get: (target, name) => {
if (name == "QueryInterface")
return XPCOMUtils.generateQI([ Ci.nsINavBookmarkObserver ]);
info(`promiseBookmarksNotification: got ${name} notification`);
if (name == notification)
return (...args) => {
if (conditionFn.apply(this, args)) {
PlacesUtils.bookmarks.removeObserver(proxifiedObserver, false);
executeSoon(resolve);
} else {
info(`promiseBookmarksNotification: skip cause condition doesn't apply to ${JSON.stringify(args)}`);
}
};
return () => {};
}
});
PlacesUtils.bookmarks.addObserver(proxifiedObserver);
});
}
function promiseHistoryNotification(notification, conditionFn) {
info(`Waiting for ${notification}`);
return new Promise((resolve) => {
let proxifiedObserver = new Proxy({}, {
get: (target, name) => {
if (name == "QueryInterface")
return XPCOMUtils.generateQI([ Ci.nsINavHistoryObserver ]);
if (name == notification)
return (...args) => {
if (conditionFn.apply(this, args)) {
PlacesUtils.history.removeObserver(proxifiedObserver, false);
executeSoon(resolve);
}
};
return () => {};
}
});
PlacesUtils.history.addObserver(proxifiedObserver);
});
}
/**
* Makes the specified toolbar visible or invisible and returns a Promise object
* that is resolved when the toolbar has completed any animations associated

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

@ -12,12 +12,12 @@ this.EXPORTED_SYMBOLS = ["TabAttributes"];
// 'muted' should not be accessed directly but handled by using the
// tab.linkedBrowser.audioMuted/toggleMuteAudio methods.
// 'pending' is used internal by sessionstore and managed accordingly.
// 'iconLoadingPrincipal' is same as 'image' that it should be handled by
// 'iconloadingprincipal' is same as 'image' that it should be handled by
// using the gBrowser.getIcon()/setIcon() methods.
// 'activemedia-blocked' should not be accessed directly but handled by using
// tab's toggleMuteAudio() or linkedBrowser's methods
// activeMediaBlockStarted()/activeMediaBlockBlockStopped().
const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", "iconLoadingPrincipal",
const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", "iconloadingprincipal",
"skipbackgroundnotify", "activemedia-blocked"]);
// A set of tab attributes to persist. We will read a given list of tab

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

@ -30,9 +30,9 @@ add_task(async function test() {
return gBrowser.getIcon(tab) != null;
}, "wait for favicon load to finish", 100, 5);
// Check that the tab has 'image' and 'iconLoadingPrincipal' attributes.
// Check that the tab has 'image' and 'iconloadingprincipal' attributes.
ok(tab.hasAttribute("image"), "tab.image exists");
ok(tab.hasAttribute("iconLoadingPrincipal"), "tab.iconLoadingPrincipal exists");
ok(tab.hasAttribute("iconloadingprincipal"), "tab.iconloadingprincipal exists");
tab.toggleMuteAudio();
// Check that the tab has a 'muted' attribute.
@ -45,11 +45,11 @@ add_task(async function test() {
// Make sure we do not persist 'image','muted' and 'activemedia-blocked' attributes.
ss.persistTabAttribute("image");
ss.persistTabAttribute("muted");
ss.persistTabAttribute("iconLoadingPrincipal");
ss.persistTabAttribute("iconloadingprincipal");
ss.persistTabAttribute("activemedia-blocked");
let {attributes} = JSON.parse(ss.getTabState(tab));
ok(!("image" in attributes), "'image' attribute not saved");
ok(!("iconLoadingPrincipal" in attributes), "'iconLoadingPrincipal' attribute not saved");
ok(!("iconloadingprincipal" in attributes), "'iconloadingprincipal' attribute not saved");
ok(!("muted" in attributes), "'muted' attribute not saved");
ok(!("custom" in attributes), "'custom' attribute not saved");
ok(!("activemedia-blocked" in attributes), "'activemedia-blocked' attribute not saved");

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

@ -41,7 +41,7 @@ add_task(async function test_label_and_icon() {
let serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
.getService(Ci.nsISerializationHelper);
let serializedPrincipal = tab.getAttribute("iconLoadingPrincipal");
let serializedPrincipal = tab.getAttribute("iconloadingprincipal");
let iconLoadingPrincipal = serhelper.deserializeObject(serializedPrincipal)
.QueryInterface(Ci.nsIPrincipal);
is(iconLoadingPrincipal.origin, "about:robots", "correct loadingPrincipal used");

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

@ -19,11 +19,8 @@ if test "$OS_ARCH" = "WINNT"; then
if test "$MOZ_UPDATE_CHANNEL" = "nightly" -o \
"$MOZ_UPDATE_CHANNEL" = "nightly-try" -o \
"$MOZ_UPDATE_CHANNEL" = "aurora" -o \
"$MOZ_UPDATE_CHANNEL" = "aurora-dev" -o \
"$MOZ_UPDATE_CHANNEL" = "beta" -o \
"$MOZ_UPDATE_CHANNEL" = "beta-dev" -o \
"$MOZ_UPDATE_CHANNEL" = "release" -o \
"$MOZ_UPDATE_CHANNEL" = "release-dev"; then
"$MOZ_UPDATE_CHANNEL" = "release"; then
if ! test "$MOZ_DEBUG"; then
MOZ_STUB_INSTALLER=1
fi

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

@ -251,6 +251,14 @@ panelview {
margin-top: -7px;
}
#PersonalToolbar #BMB_bookmarksPopup {
margin-top: -2px
}
:root[uidensity=touch] #PersonalToolbar #BMB_bookmarksPopup {
margin-top: -5px;
}
.panel-subview-body {
overflow-y: auto;
overflow-x: hidden;
@ -1026,7 +1034,7 @@ toolbaritem[cui-areatype="menu-panel"][sdkstylewidget="true"]:not(.panel-wide-it
.PanelUI-remotetabs-prefs-button {
-moz-appearance: none;
background-color: #0096dd;
background-color: #0060df;
/* !important for the color as an OSX specific rule when a lightweight theme
is used for buttons in the toolbox overrides. See bug 1238531 for details */
color: white !important;
@ -1041,9 +1049,12 @@ toolbaritem[cui-areatype="menu-panel"][sdkstylewidget="true"]:not(.panel-wide-it
min-width: 200px;
}
.PanelUI-remotetabs-prefs-button:hover,
.PanelUI-remotetabs-prefs-button:hover {
background-color: #003eaa;
}
.PanelUI-remotetabs-prefs-button:hover:active {
background-color: #018acb;
background-color: #002275;
}
.remotetabs-promo-link {

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

@ -26,11 +26,11 @@ add_task(function* () {
let state = controller.animationPlayers[i].state;
if (state.delay) {
ok(title.match(/Delay: [\d.-]+s/), "The tooltip shows the delay");
ok(title.match(/Delay: [\d.,-]+s/), "The tooltip shows the delay");
}
ok(title.match(/Duration: [\d.]+s/), "The tooltip shows the duration");
ok(title.match(/Duration: [\d.,]+s/), "The tooltip shows the duration");
if (state.endDelay) {
ok(title.match(/End delay: [\d.-]+s/), "The tooltip shows the endDelay");
ok(title.match(/End delay: [\d.,-]+s/), "The tooltip shows the endDelay");
}
if (state.iterationCount !== 1) {
ok(title.match(/Repeats: /), "The tooltip shows the iterations");

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

@ -28,6 +28,14 @@ function test() {
"Number was properly localized with decimals set 0.");
is(l10n.numberWithDecimals(-1234.56789, 0), "-1,235",
"Negative number was properly localized with decimals set 0.");
is(l10n.numberWithDecimals(12, 2), "12",
"The integer was properly localized, without decimals.");
is(l10n.numberWithDecimals(-12, 2), "-12",
"The negative integer was properly localized, without decimals.");
is(l10n.numberWithDecimals(1200, 2), "1,200",
"The big integer was properly localized, no decimals but with a separator.");
is(l10n.numberWithDecimals(-1200, 2), "-1,200",
"The negative big integer was properly localized, no decimals but with a separator.");
finish();
}

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

@ -365,6 +365,15 @@ const TEST_DATA = [
input: "stroke-dasharray: 1/*ThisIsAComment*/2;",
expected: [{name: "stroke-dasharray", value: "1 2", priority: "", offsets: [0, 39]}]
},
// Regression test for bug 1384463 - don't trim significant
// whitespace.
{
// \u00a0 is non-breaking space.
input: "\u00a0vertical-align: top",
expected: [{name: "\u00a0vertical-align", value: "top", priority: "",
offsets: [0, 20]}]
},
];
function run_test() {

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

@ -44,7 +44,7 @@ function filtersClear() {
type: FILTERS_CLEAR,
});
const filterState = getAllFilters(getState());
const filterState = getAllFilters(getState()).toJS();
for (let filter in filterState) {
if (filter !== FILTERS.TEXT) {
Services.prefs.clearUserPref(PREFS.FILTER[filter.toUpperCase()]);
@ -61,11 +61,13 @@ function filtersClear() {
*/
function defaultFiltersReset() {
return (dispatch, getState) => {
// Get the state before dispatching so the action does not alter prefs reset.
const filterState = getAllFilters(getState());
dispatch({
type: DEFAULT_FILTERS_RESET,
});
const filterState = getAllFilters(getState());
DEFAULT_FILTERS.forEach(filter => {
if (filterState[filter] === false) {
Services.prefs.clearUserPref(PREFS.FILTER[filter.toUpperCase()]);

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

@ -17,12 +17,18 @@ const { getAllFilters } = require("devtools/client/webconsole/new-console-output
const {
MESSAGES_CLEAR,
FILTERS,
PREFS,
} = require("devtools/client/webconsole/new-console-output/constants");
const { setupStore } = require("devtools/client/webconsole/new-console-output/test/helpers");
const serviceContainer = require("devtools/client/webconsole/new-console-output/test/fixtures/serviceContainer");
const ServicesMock = require("Services");
describe("FilterBar component:", () => {
afterEach(() => {
ServicesMock.prefs.testHelpers.clearPrefs();
});
it("initial render", () => {
const store = setupStore([]);
@ -190,11 +196,13 @@ describe("FilterBar component:", () => {
const store = setupStore([]);
expect(getAllUi(store.getState()).filterBarVisible).toBe(false);
expect(ServicesMock.prefs.getBoolPref(PREFS.UI.FILTER_BAR), false);
const wrapper = mount(Provider({store}, FilterBar({ serviceContainer })));
wrapper.find(".devtools-filter-icon").simulate("click");
expect(getAllUi(store.getState()).filterBarVisible).toBe(true);
expect(ServicesMock.prefs.getBoolPref(PREFS.UI.FILTER_BAR), true);
const secondaryBar = wrapper.find(".webconsole-filterbar-secondary");
expect(secondaryBar.length).toBe(1);
@ -250,10 +258,12 @@ describe("FilterBar component:", () => {
const store = setupStore([]);
expect(getAllUi(store.getState()).persistLogs).toBe(false);
expect(ServicesMock.prefs.getBoolPref(PREFS.UI.PERSIST), false);
const wrapper = mount(Provider({store}, FilterBar({ serviceContainer })));
wrapper.find(".filter-checkbox input").simulate("change");
expect(getAllUi(store.getState()).persistLogs).toBe(true);
expect(ServicesMock.prefs.getBoolPref(PREFS.UI.PERSIST), true);
});
});

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

@ -3,28 +3,44 @@
"use strict";
const { PREFS } = require("devtools/client/webconsole/new-console-output/constants");
const {
DEFAULT_FILTERS_VALUES,
FILTERS,
PREFS
} = require("devtools/client/webconsole/new-console-output/constants");
function getDefaultPrefs() {
return Object.assign({
"devtools.hud.loglimit": 1000,
[PREFS.UI.FILTER_BAR]: false,
[PREFS.UI.PERSIST]: false,
}, Object.entries(PREFS.FILTER).reduce((res, [key, pref]) => {
res[pref] = DEFAULT_FILTERS_VALUES[FILTERS[key]];
return res;
}, {}));
}
let prefs = Object.assign({}, getDefaultPrefs());
module.exports = {
prefs: {
getIntPref: pref => {
switch (pref) {
case "devtools.hud.loglimit":
return 1000;
getIntPref: pref => prefs[pref],
getBoolPref: pref => prefs[pref],
setBoolPref: (pref, value) => {
prefs[pref] = value;
},
clearUserPref: (pref) => {
prefs[pref] = (getDefaultPrefs())[pref];
},
testHelpers: {
getAllPrefs: () => prefs,
getFiltersPrefs: () => Object.values(PREFS.FILTER).reduce((res, pref) => {
res[pref] = prefs[pref];
return res;
}, {}),
clearPrefs: () => {
prefs = Object.assign({}, getDefaultPrefs());
}
return null;
},
getBoolPref: pref => {
const falsey = [
PREFS.FILTER.CSS,
PREFS.FILTER.NET,
PREFS.FILTER.NETXHR,
PREFS.UI.FILTER_BAR,
PREFS.UI.PERSIST,
];
return !falsey.includes(pref);
},
setBoolPref: () => {},
clearUserPref: () => {},
}
}
};

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

@ -467,8 +467,6 @@ skip-if = true # Bug 1403200
[browser_webconsole_variables_view_while_debugging_and_inspecting.js]
skip-if = true # Bug 1403205
[browser_webconsole_view_source.js]
skip-if = true # Bug 1405652
# old console skip-if = (os == 'win' && bits == 64) # Bug 1390001
[browser_webconsole_violation.js]
skip-if = true # Bug 1405245
# old console skip-if = e10s && (os == 'win') # Bug 1264955

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

@ -11,42 +11,20 @@
"use strict";
const TEST_URI = "https://example.com/browser/devtools/client/webconsole/" +
"test/test-mixedcontent-securityerrors.html";
"new-console-output/test/mochitest/test-mixedcontent-securityerrors.html";
add_task(function* () {
yield actuallyTest();
});
add_task(function* () {
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
yield actuallyTest();
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
var actuallyTest = Task.async(function*() {
yield loadTab(TEST_URI);
let hud = yield openConsole(null);
add_task(async function () {
let hud = await openNewTabAndConsole(TEST_URI);
info("console opened");
let [result] = yield waitForMessages({
webconsole: hud,
messages: [{
text: "Blocked loading mixed active content",
category: CATEGORY_SECURITY,
severity: SEVERITY_ERROR,
}],
});
let msg = [...result.matched][0];
let msg = await waitFor(() => findMessage(hud, "Blocked loading mixed active content"));
ok(msg, "error message");
let locationNode = msg.querySelector(".message-location .frame-link-filename");
ok(locationNode, "location node");
let onTabOpen = waitForTab();
let onTabOpen = BrowserTestUtils.waitForNewTab(gBrowser, null, true);
EventUtils.sendMouseEvent({ type: "click" }, locationNode);
let tab = yield onTabOpen;
locationNode.click();
let tab = await onTabOpen;
ok(true, "the view source tab was opened in response to clicking the location node");
gBrowser.removeTab(tab);
});

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

@ -11,9 +11,10 @@ const { ConsoleCommand } = require("devtools/client/webconsole/new-console-outpu
const { getVisibleMessages } = require("devtools/client/webconsole/new-console-output/selectors/messages");
const { getAllFilters } = require("devtools/client/webconsole/new-console-output/selectors/filters");
const { setupStore } = require("devtools/client/webconsole/new-console-output/test/helpers");
const { FILTERS } = require("devtools/client/webconsole/new-console-output/constants");
const { FILTERS, PREFS } = require("devtools/client/webconsole/new-console-output/constants");
const { stubPackets } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index");
const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index");
const ServicesMock = require("Services");
describe("Filtering", () => {
let store;
@ -215,31 +216,52 @@ describe("Clear filters", () => {
let filters = getAllFilters(store.getState());
expect(filters.toJS()).toEqual({
// default
"warn": true,
"log": true,
"info": true,
"debug": true,
"css": true,
[FILTERS.WARN]: true,
[FILTERS.LOG]: true,
[FILTERS.INFO]: true,
[FILTERS.DEBUG]: true,
// changed
"error": false,
"net": true,
"netxhr": true,
"text": "foobar",
[FILTERS.ERROR]: false,
[FILTERS.CSS]: true,
[FILTERS.NET]: true,
[FILTERS.NETXHR]: true,
[FILTERS.TEXT]: "foobar",
});
expect(ServicesMock.prefs.testHelpers.getFiltersPrefs()).toEqual({
[PREFS.FILTER.WARN]: true,
[PREFS.FILTER.LOG]: true,
[PREFS.FILTER.INFO]: true,
[PREFS.FILTER.DEBUG]: true,
[PREFS.FILTER.ERROR]: false,
[PREFS.FILTER.CSS]: true,
[PREFS.FILTER.NET]: true,
[PREFS.FILTER.NETXHR]: true,
});
store.dispatch(actions.filtersClear());
filters = getAllFilters(store.getState());
expect(filters.toJS()).toEqual({
"css": false,
"debug": true,
"error": true,
"info": true,
"log": true,
"net": false,
"netxhr": false,
"warn": true,
"text": "",
[FILTERS.CSS]: false,
[FILTERS.DEBUG]: true,
[FILTERS.ERROR]: true,
[FILTERS.INFO]: true,
[FILTERS.LOG]: true,
[FILTERS.NET]: false,
[FILTERS.NETXHR]: false,
[FILTERS.WARN]: true,
[FILTERS.TEXT]: "",
});
expect(ServicesMock.prefs.testHelpers.getFiltersPrefs()).toEqual({
[PREFS.FILTER.CSS]: false,
[PREFS.FILTER.DEBUG]: true,
[PREFS.FILTER.ERROR]: true,
[PREFS.FILTER.INFO]: true,
[PREFS.FILTER.LOG]: true,
[PREFS.FILTER.NET]: false,
[PREFS.FILTER.NETXHR]: false,
[PREFS.FILTER.WARN]: true,
});
});
});
@ -259,16 +281,27 @@ describe("Resets filters", () => {
let filters = getAllFilters(store.getState());
expect(filters.toJS()).toEqual({
// default
"warn": true,
"info": true,
"debug": true,
[FILTERS.WARN]: true,
[FILTERS.INFO]: true,
[FILTERS.DEBUG]: true,
// changed
"error": false,
"log": false,
"css": true,
"net": true,
"netxhr": true,
"text": "foobar",
[FILTERS.ERROR]: false,
[FILTERS.LOG]: false,
[FILTERS.CSS]: true,
[FILTERS.NET]: true,
[FILTERS.NETXHR]: true,
[FILTERS.TEXT]: "foobar",
});
expect(ServicesMock.prefs.testHelpers.getFiltersPrefs()).toEqual({
[PREFS.FILTER.WARN]: true,
[PREFS.FILTER.INFO]: true,
[PREFS.FILTER.DEBUG]: true,
[PREFS.FILTER.ERROR]: false,
[PREFS.FILTER.LOG]: false,
[PREFS.FILTER.CSS]: true,
[PREFS.FILTER.NET]: true,
[PREFS.FILTER.NETXHR]: true,
});
store.dispatch(actions.defaultFiltersReset());
@ -276,16 +309,27 @@ describe("Resets filters", () => {
filters = getAllFilters(store.getState());
expect(filters.toJS()).toEqual({
// default
"error": true,
"warn": true,
"log": true,
"info": true,
"debug": true,
"text": "",
[FILTERS.ERROR]: true,
[FILTERS.WARN]: true,
[FILTERS.LOG]: true,
[FILTERS.INFO]: true,
[FILTERS.DEBUG]: true,
[FILTERS.TEXT]: "",
// non-default filters weren't changed
"css": true,
"net": true,
"netxhr": true,
[FILTERS.CSS]: true,
[FILTERS.NET]: true,
[FILTERS.NETXHR]: true,
});
expect(ServicesMock.prefs.testHelpers.getFiltersPrefs()).toEqual({
[PREFS.FILTER.ERROR]: true,
[PREFS.FILTER.WARN]: true,
[PREFS.FILTER.LOG]: true,
[PREFS.FILTER.INFO]: true,
[PREFS.FILTER.DEBUG]: true,
[PREFS.FILTER.CSS]: true,
[PREFS.FILTER.NET]: true,
[PREFS.FILTER.NETXHR]: true,
});
});
});

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

@ -249,6 +249,28 @@ function getEmptyDeclaration() {
colonOffsets: false};
}
/**
* Like trim, but only trims CSS-allowed whitespace.
*/
function cssTrim(str) {
let match = /^[ \t\r\n\f]*(.*?)[ \t\r\n\f]*$/.exec(str);
if (match) {
return match[1];
}
return str;
}
/**
* Like trimRight, but only trims CSS-allowed whitespace.
*/
function cssTrimRight(str) {
let match = /^(.*?)[ \t\r\n\f]*$/.exec(str);
if (match) {
return match[1];
}
return str;
}
/**
* A helper function that does all the parsing work for
* parseDeclarations. This is separate because it has some arguments
@ -310,7 +332,7 @@ function parseDeclarationsInternal(isCssPropertyKnown, inputString,
if (token.tokenType === "symbol" && token.text === ":") {
if (!lastProp.name) {
// Set the current declaration name if there's no name yet
lastProp.name = current.trim();
lastProp.name = cssTrim(current);
lastProp.colonOffsets = [token.startOffset, token.endOffset];
current = "";
hasBang = false;
@ -336,7 +358,7 @@ function parseDeclarationsInternal(isCssPropertyKnown, inputString,
current = "";
break;
}
lastProp.value = current.trim();
lastProp.value = cssTrim(current);
current = "";
hasBang = false;
declarations.push(getEmptyDeclaration());
@ -384,11 +406,11 @@ function parseDeclarationsInternal(isCssPropertyKnown, inputString,
// Ignore this case in comments.
if (!inComment) {
// Trailing property found, e.g. p1:v1;p2:v2;p3
lastProp.name = current.trim();
lastProp.name = cssTrim(current);
}
} else {
// Trailing value found, i.e. value without an ending ;
lastProp.value = current.trim();
lastProp.value = cssTrim(current);
let terminator = lexer.performEOFFixup("", true);
lastProp.terminator = terminator + ";";
// If the input was unterminated, attribute the remainder to
@ -833,7 +855,7 @@ RuleRewriter.prototype = {
// a property but which would break the entire style sheet.
let newText = this.inputString.substring(decl.colonOffsets[1],
decl.offsets[1]);
newText = unescapeCSSComment(newText).trimRight();
newText = cssTrimRight(unescapeCSSComment(newText));
this.result += this.sanitizeText(newText, index) + ";";
// See if the comment end can be deleted.

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

@ -151,13 +151,14 @@ LocalizationHelper.prototype = {
* The localized number as a string.
*/
numberWithDecimals: function (number, decimals = 0) {
// If this is an integer, don't do anything special.
// Do not show decimals for integers.
if (number === (number|0)) {
return number;
return getNumberFormatter(0).format(number);
}
// If this isn't a number (and yes, `isNaN(null)` is false), return zero.
if (isNaN(number) || number === null) {
return "0";
return getNumberFormatter(0).format(0);
}
// Localize the number using a memoized Intl.NumberFormat formatter.

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

@ -1,5 +1,15 @@
:root {
/* Photon color variables used on the aboutdevtools page */
--blue-60: #0060df;
--blue-70: #003eaa;
--blue-80: #002275;
--grey-30: #d7d7db;
--white: #ffffff;
}
.box {
width: 980px;
width: 100vw;
max-width: 850px;
display: flex;
align-items: center;
height: 400px;
@ -16,7 +26,7 @@
.left-pane {
width: 360px;
background-image: url(images/otter.png);
background-size: 100%;
background-size: 85%;
background-position: 50%;
background-repeat: no-repeat;
height: 100%;
@ -33,7 +43,7 @@
.features {
max-width: 980px;
border-top: 1px solid #d7d7db;
border-top: 1px solid var(--grey-30);
}
.features-list {
@ -53,12 +63,27 @@
margin: 1em 20px
}
a {
color: #0A84FF;
.installpage-link {
color: var(--blue-60);
}
h1 {
font-size: 36px;
.installpage-link::after {
content: "";
display: inline-block;
height: 16px;
width: 16px;
margin: 0 5px;
vertical-align: middle;
background-image: url(images/external-link.svg);
background-repeat: no-repeat;
background-size: 16px 16px;
}
.installpage-title {
font-size: 33px;
margin-top: 16px;
font-weight: 300;
line-height: 44px;
@ -67,24 +92,30 @@ h1 {
.installpage-button {
display: block;
margin-top: 2em;
margin: 2em 0 0 0;
padding: 10px 20px;
border: none;
border-radius: 3px;
border-radius: 2px;
font-size: 15px;
font-weight: 600;
font-weight: 400;
line-height: 21px;
background-color: #0060df;
color: #fff;
background-color: var(--blue-60);
color: var(--white);
box-shadow: 0 1px 0 rgba(0,0,0,0.23);
cursor: pointer;
}
.installpage-button:enabled:hover {
background-color: #003eaa
background-color: var(--blue-70)
}
.installpage-button:active,
.installpage-button:hover:active,
.installpage-button:enabled:hover:active {
background-color: var(--blue-80);
}
/* Remove light gray outline when clicking on the button */

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

@ -21,8 +21,8 @@
<div class="box">
<div class="left-pane" />
<div class="right-pane">
<h1 id="common-title" hidden="true">&aboutDevtools.enable.title;</h1>
<h1 id="inspect-title" hidden="true">&aboutDevtools.enable.inspectElementTitle;</h1>
<h1 class="installpage-title" id="common-title" hidden="true">&aboutDevtools.enable.title;</h1>
<h1 class="installpage-title" id="inspect-title" hidden="true">&aboutDevtools.enable.inspectElementTitle;</h1>
<!-- Include all the possible message, hidden by default
as we can't lazily load localized strings from dtd -->
@ -32,7 +32,7 @@
<p class="message" id="inspect-element-message" hidden="true">&aboutDevtools.enable.inspectElementMessage;</p>
<p class="message">&aboutDevtools.enable.commonMessage;</p>
<a href="https://developer.mozilla.org/docs/Tools" target="_blank">&aboutDevtools.enable.learnMoreLink;</a>
<a class="installpage-link" href="https://developer.mozilla.org/docs/Tools" target="_blank">&aboutDevtools.enable.learnMoreLink;</a>
<button class="installpage-button" id="install">&aboutDevtools.enable.installButton;</button>
</div>
</div>
@ -103,24 +103,6 @@
<h3 class="feature-name">Memory</h3>
<p class="feature-desc">Find memory leaks and make your application zippy.</p>
</li>
<li class="feature">
<img class="feature-icon" src="chrome://devtools-shim/content/aboutdevtools/images/feature-web-audio.svg" alt=""/>
<h3 class="feature-name">Web Audio</h3>
<p class="feature-desc">The only developer tool for inspecting the Web Audio API.</p>
</li>
<li class="feature">
<img class="feature-icon" src="chrome://devtools-shim/content/aboutdevtools/images/feature-scratchpad.svg" alt=""/>
<h3 class="feature-name">Scratchpad</h3>
<p class="feature-desc">Edit, write, run and execute JavaScript in real time.</p>
</li>
<li class="feature">
<img class="feature-icon" src="chrome://devtools-shim/content/aboutdevtools/images/feature-style-editor.svg" alt=""/>
<h3 class="feature-name">Style Editor</h3>
<p class="feature-desc">Edit and manage all your CSS stylesheets in your browser.</p>
</li>
</ul>
</div>
</div>

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

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#003eaa" d="M14.923 1.618A1 1 0 0 0 14 1H9a1 1 0 0 0 0 2h2.586L8.293 6.293a1 1 0 1 0 1.414 1.414L13 4.414V7a1 1 0 0 0 2 0V2a1 1 0 0 0-.077-.382z"/>
<path fill="#0060df" d="M14 10a1 1 0 0 0-1 1v2H3V3h2a1 1 0 0 0 0-2H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1z"/>
</svg>

После

Ширина:  |  Высота:  |  Размер: 393 B

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

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="222" height="122" viewBox="0 0 222 122"><defs><filter id="a" filterUnits="userSpaceOnUse" x="53.5" y="11.8" width="114" height="106.4"><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"/></filter></defs><mask maskUnits="userSpaceOnUse" x="53.5" y="11.8" width="114" height="106.4" id="b"><path fill="#FFF" d="M167.5 11.8v106.3h-114V11.8z" filter="url(#a)"/></mask><path mask="url(#b)" fill="#306EFD" d="M67.4 14.7c-6 0-11 4.9-11 11v78.6c0 6 4.9 11 11 11h86.2c6 0 11-4.9 11-11V25.6c0-6-4.9-11-11-11H67.4zm86.2 103.4H67.4c-7.7 0-13.9-6.2-13.9-13.9V25.6c0-7.7 6.2-13.9 13.9-13.9h86.2c7.7 0 13.9 6.2 13.9 13.9v78.6c0 7.7-6.2 13.9-13.9 13.9z"/><path fill="#0022A9" d="M132 23.4h2.9V3.5H132m16.2 19.9h2.9V3.5h-2.9m-31.8 19.9h2.9V3.5h-2.9m-15.7 19.9h2.9V3.5h-2.9M85.1 23.4H88V3.5h-2.9M69.4 23.4h3V3.5h-3"/><path fill="#4DE5FF" d="M77.8 41.3h66.6v-2.9H77.8m0 20.2h66.6v-2.9H77.8m0 20.2h66.6V73H77.8m48 20.2h18.6v-2.9h-18.6m-48 2.9h48v-2.9h-48"/></svg>

До

Ширина:  |  Высота:  |  Размер: 1004 B

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

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="222" height="122" viewBox="0 0 222 122"><path fill="#306EFD" d="M53.5 27.5v89.6h90.3V50h-3.1v64H56.6V30.7h69.7v-3.2"/><path fill="#4DE5FF" d="M120.6 94.1H76.7V50.5H103v3.2H79.9v37.2h37.6V73.3h3.1"/><path fill="#0022A9" d="M96.6 80.8c-1.2 0-2.3-.4-3-1.1-1.1-1.2-1.4-3.1-.6-5.6l3.6-17 35.9-36.2 2.2 2.2-35.2 35.5-3.4 16.2c-.5 1.8-.3 2.5-.2 2.6.1.2.9.3 2.5-.1l16.7-3L150 39l2.2 2.2-35.6 36-17.5 3.2c-.9.2-1.7.4-2.5.4"/><path fill="#306EFD" d="M168.5 14.2c0-2.2-.8-4.3-2.4-5.8l-1-1c-3.2-3.2-8.4-3.2-11.5 0l-16.3 16L126.1 12l-2.2 2.2L159 49.7l2.2-2.2L150 36.2 166.1 20c1.5-1.6 2.4-3.6 2.4-5.8zm-4.6 3.5L147.8 34l-8.3-8.4 16.3-16c2-2 5.2-2 7.1 0l1 1c1 1 1.5 2.2 1.5 3.6-.1 1.3-.6 2.6-1.5 3.5z"/></svg>

До

Ширина:  |  Высота:  |  Размер: 743 B

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

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="222" height="122" viewBox="0 0 222 122"><path fill="#306EFD" d="M130.7 103.3H36.5c-5.2 0-9.5-4.3-9.5-9.5V4.4h145.5v44.9h-2.8V7.2h-140v86.6c0 3.7 3 6.7 6.7 6.7h94.2v2.8z"/><path fill="#306EFD" d="M28.4 30h142.7v-2.8H28.4M43 17.2c0 2-1.6 3.5-3.5 3.5-2 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5c1.9-.1 3.5 1.5 3.5 3.5M54.8 17.2c0 2-1.6 3.5-3.5 3.5-2 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5c1.9-.1 3.5 1.5 3.5 3.5M66.7 17.2c0 2-1.6 3.5-3.5 3.5-2 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5c1.9-.1 3.5 1.5 3.5 3.5M39.4 49.4h47v-2.7h-47M39.4 78.5h47v-2.7h-47M93.8 49.4h18.5v-2.7H93.8M39.4 64h61.9v-2.8H39.4"/><path fill="#0022A9" d="M158.6 49.8c-18 0-32.7 14.6-32.7 32.6s14.7 32.6 32.7 32.6 32.7-14.6 32.7-32.6-14.7-32.6-32.7-32.6m0 68c-19.6 0-35.5-15.9-35.5-35.4s16-35.4 35.5-35.4 35.5 15.9 35.5 35.4-15.9 35.4-35.5 35.4"/><path fill="#4DE5FF" d="M183 93.8c-3.4 0-4.6-5.2-5.9-11.2-.6-2.7-2-9-3.2-9-1.2 0-2.6 6.3-3.2 9-1.4 6-2.5 11.1-5.9 11.1-3.4 0-4.6-5.2-5.9-11.1-.6-2.7-2-9-3.2-9-1.2 0-2.6 6.3-3.2 9-1.4 6-2.5 11.1-5.9 11.1s-4.6-5.2-5.9-11.2c-.6-2.7-2-9-3.2-9v-2.8c3.4 0 4.6 5.2 5.9 11.1.6 2.7 2 9 3.2 9 1.2 0 2.6-6.3 3.2-9 1.4-6 2.5-11.1 5.9-11.1 3.4 0 4.6 5.2 5.9 11.1.6 2.7 2 9 3.2 9 1.2 0 2.6-6.3 3.2-9 1.4-6 2.5-11.2 5.9-11.2s4.6 5.2 5.9 11.1c.6 2.7 2 9 3.2 9v3.1z"/></svg>

До

Ширина:  |  Высота:  |  Размер: 1.3 KiB

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

@ -7,11 +7,11 @@
<!ENTITY aboutDevtools.enable.inspectElementTitle "Enable Firefox Developer Tools to use Inspect Element">
<!ENTITY aboutDevtools.enable.aboutDebuggingMessage
"Develop and debug WebExtensions, web workers, service workers and more with the Firefox DevTools.">
"Develop and debug WebExtensions, web workers, service workers and more with Firefox DevTools.">
<!ENTITY aboutDevtools.enable.inspectElementMessage
"Examine and edit HTML and CSS with the DevTools Inspector.">
<!ENTITY aboutDevtools.enable.keyShortcutMessage
"You activated a Developer Tool shortcut. If that was a mistake, you can close this tab.">
"You activated a Developer Tools shortcut. If that was a mistake, you can close this tab.">
<!ENTITY aboutDevtools.enable.menuMessage
"Examine, edit and debug HTML, CSS, and JavaScript with tools like Inspector and Debugger.">
@ -21,4 +21,4 @@
<!ENTITY aboutDevtools.enable.learnMoreLink "Learn more about DevTools">
<!ENTITY aboutDevtools.enable.installButton "Enable Developer Tools">
<!ENTITY aboutDevtools.welcome.title "Welcome to Firefox Developer Tools!">
<!ENTITY aboutDevtools.welcome.message "Youve successfully enabled DevTools! To get started explore the Web Developer menu or open the tools with ##INSPECTOR_SHORTCUT##.">
<!ENTITY aboutDevtools.welcome.message "Youve successfully enabled DevTools! To get started, explore the Web Developer menu or open the tools with ##INSPECTOR_SHORTCUT##.">

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

@ -14,6 +14,7 @@ devtools-shim.jar:
# See https://bugzilla.mozilla.org/show_bug.cgi?id=1408369
content/aboutdevtools/tmp-locale/aboutdevtools.dtd (aboutdevtools/tmp-locale/aboutdevtools.dtd)
content/aboutdevtools/images/external-link.svg (aboutdevtools/images/external-link.svg)
content/aboutdevtools/images/feature-inspector.svg (aboutdevtools/images/feature-inspector.svg)
content/aboutdevtools/images/feature-console.svg (aboutdevtools/images/feature-console.svg)
content/aboutdevtools/images/feature-debugger.svg (aboutdevtools/images/feature-debugger.svg)
@ -23,8 +24,5 @@ devtools-shim.jar:
content/aboutdevtools/images/feature-responsive-mode.svg (aboutdevtools/images/feature-responsive-mode.svg)
content/aboutdevtools/images/feature-storage.svg (aboutdevtools/images/feature-storage.svg)
content/aboutdevtools/images/feature-performance.svg (aboutdevtools/images/feature-performance.svg)
content/aboutdevtools/images/feature-style-editor.svg (aboutdevtools/images/feature-style-editor.svg)
content/aboutdevtools/images/feature-web-audio.svg (aboutdevtools/images/feature-web-audio.svg)
content/aboutdevtools/images/feature-scratchpad.svg (aboutdevtools/images/feature-scratchpad.svg)
content/DevToolsShim.jsm (DevToolsShim.jsm)

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

@ -125,14 +125,6 @@ KeyframeEffectReadOnly::NotifyAnimationTimingUpdated()
ResetIsRunningOnCompositor();
}
// Detect changes to "in effect" status since we need to recalculate the
// animation cascade for this element whenever that changes.
bool inEffect = IsInEffect();
if (inEffect != mInEffectOnLastAnimationTimingUpdate) {
MarkCascadeNeedsUpdate();
mInEffectOnLastAnimationTimingUpdate = inEffect;
}
// Request restyle if necessary.
if (mAnimation && !mProperties.IsEmpty() && HasComputedTimingChanged()) {
EffectCompositor::RestyleType restyleType =
@ -142,6 +134,16 @@ KeyframeEffectReadOnly::NotifyAnimationTimingUpdated()
RequestRestyle(restyleType);
}
// Detect changes to "in effect" status since we need to recalculate the
// animation cascade for this element whenever that changes.
// Note that updating mInEffectOnLastAnimationTimingUpdate has to be done
// after above CanThrottle() call since the function uses the flag inside it.
bool inEffect = IsInEffect();
if (inEffect != mInEffectOnLastAnimationTimingUpdate) {
MarkCascadeNeedsUpdate();
mInEffectOnLastAnimationTimingUpdate = inEffect;
}
// If we're no longer "in effect", our ComposeStyle method will never be
// called and we will never have a chance to update mProgressOnLastCompose
// and mCurrentIterationOnLastCompose.
@ -1375,9 +1377,10 @@ KeyframeEffectReadOnly::CanThrottle() const
return true;
}
// We can throttle the animation if the animation is paint only and
// the target frame is out of view or the document is in background tabs.
if (CanIgnoreIfNotVisible()) {
// Unless we are newly in-effect, we can throttle the animation if the
// animation is paint only and the target frame is out of view or the document
// is in background tabs.
if (mInEffectOnLastAnimationTimingUpdate && CanIgnoreIfNotVisible()) {
nsIPresShell* presShell = GetPresShell();
if ((presShell && !presShell->IsActive()) ||
frame->IsScrolledOutOfView()) {

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

@ -27,7 +27,7 @@
#include "nsIScriptError.h"
#include "nsStyleContext.h"
#include "nsTArray.h"
#include <algorithm> // For std::stable_sort
#include <algorithm> // For std::stable_sort, std::min
namespace mozilla {
@ -1392,11 +1392,6 @@ GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
return;
}
Maybe<dom::CompositeOperation> composite;
if (keyframeDict.mComposite.WasPassed()) {
composite.emplace(keyframeDict.mComposite.Value());
}
// Get all the property--value-list pairs off the object.
JS::Rooted<JSObject*> object(aCx, &aValue.toObject());
nsTArray<PropertyValuesPair> propertyValuesPairs;
@ -1407,15 +1402,6 @@ GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
return;
}
// Parse the easing property. We need to do this after reading off the
// property values since this is conceptually a separate step that happens
// after the WebIDL-like processing.
Maybe<ComputedTimingFunction> easing =
TimingParams::ParseEasing(keyframeDict.mEasing, aDocument, aRv);
if (aRv.Failed()) {
return;
}
// Create a set of keyframes for each property.
nsCSSParser parser(aDocument->CSSLoader());
nsClassHashtable<nsFloatHashKey, Keyframe> processedKeyframes;
@ -1444,8 +1430,6 @@ GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
double offset = n ? i++ / double(n) : 1;
Keyframe* keyframe = processedKeyframes.LookupOrAdd(offset);
if (keyframe->mPropertyValues.IsEmpty()) {
keyframe->mTimingFunction = easing;
keyframe->mComposite = composite;
keyframe->mComputedOffset = offset;
}
@ -1464,6 +1448,124 @@ GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
}
aResult.Sort(ComputedOffsetComparator());
// Fill in any specified offsets
//
// This corresponds to step 5, "Otherwise," branch, substeps 5-6 of
// https://w3c.github.io/web-animations/#processing-a-keyframes-argument
const FallibleTArray<Nullable<double>>* offsets = nullptr;
AutoTArray<Nullable<double>, 1> singleOffset;
auto& offset = keyframeDict.mOffset;
if (offset.IsDouble()) {
singleOffset.AppendElement(offset.GetAsDouble());
// dom::Sequence is a fallible but AutoTArray is infallible and we need to
// point to one or the other. Fortunately, fallible and infallible array
// types can be implicitly converted provided they are const.
const FallibleTArray<Nullable<double>>& asFallibleArray = singleOffset;
offsets = &asFallibleArray;
} else if (offset.IsDoubleOrNullSequence()) {
offsets = &offset.GetAsDoubleOrNullSequence();
}
// If offset.IsNull() is true, then we want to leave the mOffset member of
// each keyframe with its initialized value of null. By leaving |offsets|
// as nullptr here, we skip updating mOffset below.
size_t offsetsToFill =
offsets ? std::min(offsets->Length(), aResult.Length()) : 0;
for (size_t i = 0; i < offsetsToFill; i++) {
if (!offsets->ElementAt(i).IsNull()) {
aResult[i].mOffset.emplace(offsets->ElementAt(i).Value());
}
}
// Check that the keyframes are loosely sorted and that any specified offsets
// are between 0.0 and 1.0 inclusive.
//
// This corresponds to steps 6-7 of
// https://w3c.github.io/web-animations/#processing-a-keyframes-argument
//
// In the spec, TypeErrors arising from invalid offsets and easings are thrown
// at the end of the procedure since it assumes we initially store easing
// values as strings and then later parse them.
//
// However, we will parse easing members immediately when we process them
// below. In order to maintain the relative order in which TypeErrors are
// thrown according to the spec, namely exceptions arising from invalid
// offsets are thrown before exceptions arising from invalid easings, we check
// the offsets here.
if (!HasValidOffsets(aResult)) {
aRv.ThrowTypeError<dom::MSG_INVALID_KEYFRAME_OFFSETS>();
aResult.Clear();
return;
}
// Fill in any easings.
//
// This corresponds to step 5, "Otherwise," branch, substeps 7-11 of
// https://w3c.github.io/web-animations/#processing-a-keyframes-argument
FallibleTArray<Maybe<ComputedTimingFunction>> easings;
auto parseAndAppendEasing = [&](const nsString& easingString,
ErrorResult& aRv) {
auto easing = TimingParams::ParseEasing(easingString, aDocument, aRv);
if (!aRv.Failed() && !easings.AppendElement(Move(easing), fallible)) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
}
};
auto& easing = keyframeDict.mEasing;
if (easing.IsString()) {
parseAndAppendEasing(easing.GetAsString(), aRv);
if (aRv.Failed()) {
aResult.Clear();
return;
}
} else {
for (const nsString& easingString : easing.GetAsStringSequence()) {
parseAndAppendEasing(easingString, aRv);
if (aRv.Failed()) {
aResult.Clear();
return;
}
}
}
// If |easings| is empty, then we are supposed to fill it in with the value
// "linear" and then repeat the list as necessary.
//
// However, for Keyframe.mTimingFunction we represent "linear" as a None
// value. Since we have not assigned 'mTimingFunction' for any of the
// keyframes in |aResult| they will already have their initial None value
// (i.e. linear). As a result, if |easings| is empty, we don't need to do
// anything.
if (!easings.IsEmpty()) {
for (size_t i = 0; i < aResult.Length(); i++) {
aResult[i].mTimingFunction = easings[i % easings.Length()];
}
}
// Fill in any composite operations.
//
// This corresponds to step 5, "Otherwise," branch, substep 12 of
// https://w3c.github.io/web-animations/#processing-a-keyframes-argument
const FallibleTArray<dom::CompositeOperation>* compositeOps;
AutoTArray<dom::CompositeOperation, 1> singleCompositeOp;
auto& composite = keyframeDict.mComposite;
if (composite.IsCompositeOperation()) {
singleCompositeOp.AppendElement(composite.GetAsCompositeOperation());
const FallibleTArray<dom::CompositeOperation>& asFallibleArray =
singleCompositeOp;
compositeOps = &asFallibleArray;
} else {
compositeOps = &composite.GetAsCompositeOperationSequence();
}
// Fill in and repeat as needed.
if (!compositeOps->IsEmpty()) {
for (size_t i = 0; i < aResult.Length(); i++) {
aResult[i].mComposite.emplace(
compositeOps->ElementAt(i % compositeOps->Length()));
}
}
}
/**

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

@ -7,10 +7,12 @@
#include "nsTreeSanitizer.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/ServoDeclarationBlock.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/css/Declaration.h"
#include "mozilla/css/StyleRule.h"
#include "mozilla/css/Rule.h"
#include "mozilla/dom/CSSRuleList.h"
#include "nsCSSParser.h"
#include "nsCSSPropertyID.h"
#include "nsUnicharInputStream.h"
@ -1065,13 +1067,9 @@ nsTreeSanitizer::MustPrune(int32_t aNamespace,
}
bool
nsTreeSanitizer::SanitizeStyleDeclaration(mozilla::css::Declaration* aDeclaration,
nsAutoString& aRuleText)
nsTreeSanitizer::SanitizeStyleDeclaration(DeclarationBlock* aDeclaration)
{
bool didSanitize = aDeclaration->HasProperty(eCSSProperty__moz_binding);
aDeclaration->RemovePropertyByID(eCSSProperty__moz_binding);
aDeclaration->ToString(aRuleText);
return didSanitize;
return aDeclaration->RemovePropertyByID(eCSSProperty__moz_binding);
}
bool
@ -1086,24 +1084,44 @@ nsTreeSanitizer::SanitizeStyleSheet(const nsAString& aOriginal,
// -moz-binding is blacklisted.
bool didSanitize = false;
// Create a sheet to hold the parsed CSS
RefPtr<CSSStyleSheet> sheet =
new CSSStyleSheet(mozilla::css::eAuthorSheetFeatures,
CORS_NONE, aDocument->GetReferrerPolicy());
RefPtr<StyleSheet> sheet;
if (aDocument->IsStyledByServo()) {
sheet = new ServoStyleSheet(mozilla::css::eAuthorSheetFeatures,
CORS_NONE, aDocument->GetReferrerPolicy(),
SRIMetadata());
} else {
sheet = new CSSStyleSheet(mozilla::css::eAuthorSheetFeatures,
CORS_NONE, aDocument->GetReferrerPolicy());
}
sheet->SetURIs(aDocument->GetDocumentURI(), nullptr, aBaseURI);
sheet->SetPrincipal(aDocument->NodePrincipal());
// Create the CSS parser, and parse the CSS text.
nsCSSParser parser(nullptr, sheet);
rv = parser.ParseSheet(aOriginal, aDocument->GetDocumentURI(), aBaseURI,
aDocument->NodePrincipal(), 0);
if (aDocument->IsStyledByServo()) {
rv = sheet->AsServo()->ParseSheet(
aDocument->CSSLoader(), NS_ConvertUTF16toUTF8(aOriginal),
aDocument->GetDocumentURI(), aBaseURI, aDocument->NodePrincipal(),
0, aDocument->GetCompatibilityMode());
} else {
// Create the CSS parser, and parse the CSS text.
nsCSSParser parser(nullptr, sheet->AsGecko());
rv = parser.ParseSheet(aOriginal, aDocument->GetDocumentURI(), aBaseURI,
aDocument->NodePrincipal(), 0);
}
NS_ENSURE_SUCCESS(rv, true);
// Mark the sheet as complete.
MOZ_ASSERT(!sheet->IsModified(),
"should not get marked modified during parsing");
sheet->SetComplete();
// Loop through all the rules found in the CSS text
int32_t ruleCount = sheet->StyleRuleCount();
for (int32_t i = 0; i < ruleCount; ++i) {
mozilla::css::Rule* rule = sheet->GetStyleRuleAt(i);
ErrorResult err;
RefPtr<dom::CSSRuleList> rules =
sheet->GetCssRules(*nsContentUtils::GetSystemPrincipal(), err);
err.SuppressException();
if (!rules) {
return true;
}
uint32_t ruleCount = rules->Length();
for (uint32_t i = 0; i < ruleCount; ++i) {
mozilla::css::Rule* rule = rules->Item(i);
if (!rule)
continue;
switch (rule->GetType()) {
@ -1127,15 +1145,14 @@ nsTreeSanitizer::SanitizeStyleSheet(const nsAString& aOriginal,
case mozilla::css::Rule::STYLE_RULE: {
// For style rules, we will just look for and remove the
// -moz-binding properties.
RefPtr<mozilla::css::StyleRule> styleRule = do_QueryObject(rule);
NS_ASSERTION(styleRule, "Must be a style rule");
nsAutoString decl;
bool sanitized =
SanitizeStyleDeclaration(styleRule->GetDeclaration(), decl);
didSanitize = sanitized || didSanitize;
if (!sanitized) {
styleRule->GetCssText(decl);
auto styleRule = static_cast<BindingStyleRule*>(rule);
DeclarationBlock* styleDecl = styleRule->GetDeclarationBlock();
MOZ_ASSERT(styleDecl);
if (SanitizeStyleDeclaration(styleDecl)) {
didSanitize = true;
}
nsAutoString decl;
styleRule->GetCssText(decl);
aSanitized.Append(decl);
}
}
@ -1160,19 +1177,28 @@ nsTreeSanitizer::SanitizeAttributes(mozilla::dom::Element* aElement,
if (kNameSpaceID_None == attrNs) {
if (aAllowStyle && nsGkAtoms::style == attrLocal) {
nsCOMPtr<nsIURI> baseURI = aElement->GetBaseURI();
nsIDocument* document = aElement->OwnerDoc();
// Pass the CSS Loader object to the parser, to allow parser error
// reports to include the outer window ID.
nsCSSParser parser(document->CSSLoader());
RefPtr<DeclarationBlock> decl;
nsAutoString value;
aElement->GetAttr(attrNs, attrLocal, value);
RefPtr<mozilla::css::Declaration> decl =
parser.ParseStyleAttribute(value, document->GetDocumentURI(),
baseURI, document->NodePrincipal());
nsIDocument* document = aElement->OwnerDoc();
if (document->IsStyledByServo()) {
decl = ServoDeclarationBlock::FromCssText(
value,
aElement->GetURLDataForStyleAttr(),
document->GetCompatibilityMode(),
document->CSSLoader());
} else {
// Pass the CSS Loader object to the parser, to allow parser error
// reports to include the outer window ID.
nsCSSParser parser(document->CSSLoader());
decl = parser.ParseStyleAttribute(value, document->GetDocumentURI(),
aElement->GetBaseURIForStyleAttr(),
document->NodePrincipal());
}
if (decl) {
nsAutoString cleanValue;
if (SanitizeStyleDeclaration(decl, cleanValue)) {
if (SanitizeStyleDeclaration(decl)) {
nsAutoString cleanValue;
decl->ToString(cleanValue);
aElement->SetAttr(kNameSpaceID_None,
nsGkAtoms::style,
cleanValue,

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

@ -151,15 +151,12 @@ class MOZ_STACK_CLASS nsTreeSanitizer {
/**
* Checks a style rule for the presence of the 'binding' CSS property and
* removes that property from the rule and reserializes in case the
* property was found.
* removes that property from the rule.
*
* @param aDeclaration The style declaration to check
* @param aRuleText the serialized mutated rule if the method returns true
* @return true if the rule was modified and false otherwise
*/
bool SanitizeStyleDeclaration(mozilla::css::Declaration* aDeclaration,
nsAutoString& aRuleText);
bool SanitizeStyleDeclaration(mozilla::DeclarationBlock* aDeclaration);
/**
* Parses a style sheet and reserializes it with the 'binding' property

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

@ -29,8 +29,8 @@ is(s.sanitize("<a onclick='boom()'></a>", 0), "<html><head></head><body><a></a><
is(s.sanitize("<style>p { color: red; }</style><p style='background-color: blue;'></p>", 0), "<html><head></head><body><p></p></body></html>", "Wrong sanitizer result 4");
// Can allow styles
is(s.sanitize("<style>p { color: red; }</style><p style='background-color: blue;'></p>", u.SanitizerAllowStyle), '<html><head><style>p { color: red; }</style></head><body><p style="background-color: blue;"></p></body></html>', "Wrong sanitizer result 5");
// -moz-binding gets dropped when styles allowed; however, reconstructing the p { ... } part seems broken!
todo_is(s.sanitize("<style>p { color: red; -moz-binding: url(foo); }</style><p style='background-color: blue; -moz-binding: url(foo);'></p>", u.SanitizerAllowStyle), '<html><head><style>p { color: red; }</style></head><body><p style="background-color: blue;"></p></body></html>', "Wrong sanitizer result 6");
// -moz-binding gets dropped when styles allowed
is(s.sanitize("<style>p { color: red; -moz-binding: url(foo); }</style><p style='background-color: blue; -moz-binding: url(foo);'></p>", u.SanitizerAllowStyle), '<html><head><style>p { color: red; }</style></head><body><p style="background-color: blue;"></p></body></html>', "Wrong sanitizer result 6");
// Various cid: embeds only cases
is(s.sanitize("<img src='foo.html'>", u.SanitizerCidEmbedsOnly), '<html><head></head><body><img></body></html>', "Wrong sanitizer result 7");
is(s.sanitize("<img src='cid:foo'>", u.SanitizerCidEmbedsOnly), '<html><head></head><body><img src="cid:foo"></body></html>', "Wrong sanitizer result 8");

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

@ -0,0 +1,11 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body onload="document.getElementById('b').appendChild(document.getElementById('v'));">
<fieldset><fieldset id="b"></fieldset></fieldset>
<div id="v"><fieldset><input required="" /><input required="" /></fieldset></div>
</body>
</html>

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

@ -70,6 +70,7 @@ load 877910.html
load 903106.html
load 916322-1.html
load 916322-2.html
load 978644.xhtml
load 1032654.html
load 1141260.html
load 1228876.html

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

@ -32,6 +32,7 @@ var gTestWindows = [
"file_fullscreen-esc-exit.html",
"file_fullscreen-denied.html",
"file_fullscreen-api.html",
"file_fullscreen-plugins.html",
"file_fullscreen-hidden.html",
"file_fullscreen-svg-element.html",
"file_fullscreen-navigation.html",

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

@ -79,6 +79,17 @@ class Manifest {
await this._store.load();
}
async prefetch(browser) {
const manifestData = await ManifestObtainer.browserObtainManifest(browser);
const icon = await ManifestIcons.browserFetchIcon(browser, manifestData, 192);
const data = {
installed: false,
manifest: manifestData,
cached_icon: icon
};
return data;
}
async install() {
const manifestData = await ManifestObtainer.browserObtainManifest(this._browser);
this._store.data = {

Двоичные данные
dom/media/test/crashtests/1393272.webm Normal file

Двоичный файл не отображается.

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

@ -93,6 +93,7 @@ load 1368490.html
load 1291702.html
load 1378826.html
load 1384248.html
load 1393272.webm
load disconnect-wrong-destination.html
load analyser-channels-1.html
load audiocontext-double-suspend.html

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

@ -20,8 +20,9 @@ enum CompositeOperation { "replace", "add", "accumulate" };
// KeyframeEffectReadOnly's implementation.
dictionary BasePropertyIndexedKeyframe {
DOMString easing = "linear";
CompositeOperation composite;
(double? or sequence<double?>) offset = [];
(DOMString or sequence<DOMString>) easing = [];
(CompositeOperation or sequence<CompositeOperation>) composite = [];
};
dictionary BaseKeyframe {

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

@ -13,7 +13,7 @@ load 336096-1.xhtml
load 344215-1.xul
load 354611-1.html
load 360078-1.xhtml
asserts-if(stylo,11-16) load 363791-1.xul # bug 1397644
load 363791-1.xul
load 384740-1.xul
load 384877-1.html
load 386914-1.html

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

@ -0,0 +1,20 @@
<html>
<head>
<script></script>
<script>
document.designMode = 'on';
o1 = window.getSelection();
o2 = document.createElement('code');
o3 = document.createElement('style');
o4 = document.createElement('style');
document.head.appendChild(o3);
o1.modify("move", "right", "character");
document.styleSheets[0].insertRule("* { position: absolute; }", 0);
document.head.appendChild(o4);
window.resizeTo(1,1);
document.documentElement.appendChild(o2);
o1.selectAllChildren(o2);
</script>
</head>
<body></body>
</html>

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

@ -74,6 +74,7 @@ load 1317704.html
load 1317718.html
load 1324505.html
needs-focus load 1343918.html
load 1344097.html
load 1345015.html
load 1348851.html
load 1350772.html

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

@ -50,11 +50,6 @@ Mozilla Bug 666446: lots of animated gifs swamp us with paint events
/** Test for Bug 666446 nsSVGFEImageElement/RasterImage**/
if (SpecialPowers.DOMWindowUtils.isStyledByServo) {
// Stylo currently asserts for any XUL bits.
SimpleTest.expectAssertions(7, 7);
}
const FAILURE_TIMEOUT = 5000; // Fail early after 120 seconds (2 minutes)
function main() {

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

@ -4,6 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <locale.h>
#include "OSPreferences.h"
#include "dlfcn.h"
#include "glib.h"

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

@ -19,6 +19,7 @@
#include "mozilla/dom/ElementInlines.h"
#include "nsBlockFrame.h"
#include "nsBulletFrame.h"
#include "nsImageFrame.h"
#include "nsPlaceholderFrame.h"
#include "nsContentUtils.h"
#include "nsCSSFrameConstructor.h"
@ -784,7 +785,7 @@ ServoRestyleManager::ProcessPostTraversal(
// We should really fix the weird primary frame mapping for image maps
// (bug 135040)...
if (styleFrame && styleFrame->GetContent() != aElement) {
MOZ_ASSERT(styleFrame->IsImageFrame());
MOZ_ASSERT(static_cast<nsImageFrame*>(do_QueryFrame(styleFrame)));
styleFrame = nullptr;
}

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

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
function boom()
{
var td = document.createElement("td");
document.body.appendChild(td);
var audio = document.createElement("audio");
audio.controls = true;
td.appendChild(audio);
}
</script>
</head>
<body onload="boom();"></body>
</html>

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

@ -70,8 +70,8 @@ load 317934-1.html
load 320459-1.html
load 321058-1.xul
load 321058-2.xul
asserts-if(stylo,3) load 321077-1.xul # bug 1397644
asserts-if(stylo,3) load 321077-2.xul # bug 1397644
load 321077-1.xul
load 321077-2.xul
load 322436-1.html
load 325967-1.html
load 325984-1.xhtml
@ -469,6 +469,7 @@ load 1116104.html
load 1127198-1.html
load 1140198.html
load 1143535.html
load 1153716.html
pref(layout.css.grid.enabled,true) load 1156588.html
load 1162813.xul
load 1163583.html

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

@ -0,0 +1,5 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<td style="writing-mode: vertical-lr;"><col style="float: left; visibility: collapse;"><tr style="display: -moz-inline-grid;"><div style="display: ruby-base-container;"><div style="display: list-item;"><td style="float: right;"></td></div></div></tr></col></td>
</body>
</html>

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

@ -607,6 +607,7 @@ load 1221112-1.html
load 1221112-2.html
load 1221874-1.html
load 1222783.xhtml
load 1223522.xhtml
load 1223568-1.html
load 1223568-2.html
load 1224230-1.html

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

@ -130,6 +130,8 @@ public:
nsDisplayListBuilder* aDisplayListBuilder) override
{
HTMLCanvasElement* element = static_cast<HTMLCanvasElement*>(mFrame->GetContent());
element->HandlePrintCallback(mFrame->PresContext()->Type());
switch(element->GetCurrentContextType()) {
case CanvasContextType::Canvas2D:
case CanvasContextType::WebGL1:

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

@ -143,7 +143,7 @@ fuzzy-if(skiaContent,1,3) == 698291-1.html 698291-1-ref.html
== 817406-3.html 817406-1-ref.html
== 817406-4.html 817406-4-ref.html
== 847242-1.html 847242-1-ref.html
fuzzy-if(xulRuntime.widgetToolkit=="gtk3",1,11) fails-if(stylo||styloVsGecko) asserts-if(stylo,24-26) == 869833-1.xul 869833-1-ref.xul # stylo: bug 1397644
fuzzy-if(xulRuntime.widgetToolkit=="gtk3",1,11) == 869833-1.xul 869833-1-ref.xul
== 922530-1.html 922530-1-ref.html
== 922550-1.html 922550-1-ref.html
== 1067268-1.html 1067268-1-ref.html

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

@ -317,7 +317,7 @@ random-if(d2d) fuzzy-if(Android,8,1439) skip-if(styloVsGecko) HTTP == 289480.htm
== 299136-1.html 299136-1-ref.html
== 299837-1.html 299837-1-ref.html
fails-if(styloVsGecko) == 299837-2.xul 299837-2-ref.xul # bug 1408235
random-if(d2d) asserts-if(stylo,24-128) asserts-if(styloVsGecko,12-64) == 299837-3.xul 299837-3-ref.xul # bug 587631, stylo: bug 1397644
random-if(d2d) == 299837-3.xul 299837-3-ref.xul # bug 587631
== 300691-1a.html 300691-1-ref.html
== 300691-1b.html 300691-1-ref.html
== 300691-1c.html 300691-1-ref.html
@ -1289,7 +1289,7 @@ fuzzy-if(skiaContent,1,5) skip-if((stylo||styloVsGecko)&&isDebugBuild&&winWidget
== 476598-1b.html 476598-1-ref2.html
!= 476598-1-ref.html about:blank
== 476856-1.html 476856-1-ref.html
random-if(d2d) fails-if(styloVsGecko) asserts-if(stylo,16-18) == 478377-1.xul 478377-1-ref.xul # bug 1397644
random-if(d2d) == 478377-1.xul 478377-1-ref.xul
== 478614-1.html 478614-1-ref.html
== 478614-2.html 478614-1-ref.html
== 478614-3.html 478614-3-ref.html
@ -1688,11 +1688,11 @@ fuzzy-if(skiaContent,1,4500) == 654950-1.html 654950-1-ref.html # Quartz alpha b
!= 656875.html about:blank
== 658952.html 658952-ref.html
fuzzy-if(skiaContent,7,3500) == 660682-1.html 660682-1-ref.html
fuzzy-if(d2d,1,256) skip-if(Android) fuzzy-if(skiaContent,1,68000) fails-if(styloVsGecko) asserts-if(stylo,16-18) == 664127-1.xul 664127-1-ref.xul # Android: Intermittent failures - bug 1019131, stylo: bug 1397644
fuzzy-if(d2d,1,256) skip-if(Android) fuzzy-if(skiaContent,1,68000) == 664127-1.xul 664127-1-ref.xul # Android: Intermittent failures - bug 1019131
== 665597-1.html 665597-1-ref.html
== 665597-2.html 665597-2-ref.html
== 667079-1.html 667079-1-ref.html
fails-if(stylo||styloVsGecko) asserts-if(stylo,8-9) == 668319-1.xul about:blank # bug 1397644
== 668319-1.xul about:blank
fails-if(stylo||styloVsGecko) != 669015-1.xul 669015-1-notref.xul # bug 1408235
skip-if(azureSkiaGL) == 670442-1.html 670442-1-ref.html
== 670467-1.html 670467-1-ref.html
@ -1859,7 +1859,7 @@ test-pref(layout.css.grid.enabled,true) == 1053035-1-grid.html 1053035-1-ref.htm
== 1062963-floatmanager-reflow.html 1062963-floatmanager-reflow-ref.html
test-pref(dom.webcomponents.enabled,true) == 1066554-1.html 1066554-1-ref.html
== 1069716-1.html 1069716-1-ref.html
random-if(webrender) == 1078262-1.html about:blank
fails-if(webrender) == 1078262-1.html about:blank
test-pref(layout.testing.overlay-scrollbars.always-visible,false) == 1081072-1.html 1081072-1-ref.html
== 1081185-1.html 1081185-1-ref.html
== 1097437-1.html 1097437-1-ref.html
@ -2023,8 +2023,8 @@ fails-if(!stylo||styloVsGecko) == 1365162-1.html 1365162-1-ref.html
== 1375315-8.html 1375315-8-ref.html
== 1375315-9.html 1375315-9-ref.html
== 1375315-10.html 1375315-10-ref.html
random-if(webrender) == 1375315-11.html 1375315-11-ref.html
random-if(webrender) == 1375315-12.html 1375315-12-ref.html
== 1375315-11.html 1375315-11-ref.html
== 1375315-12.html 1375315-12-ref.html
== 1374062.html 1374062-ref.html
== 1375513.html 1375513-ref.html
== 1375674.html 1375674-ref.html

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

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<title>Bug 1383239</title>
<style>
div {
position: absolute;
background: orange;
width: 20px;
height: 20px;
left: 0px;
}
</style>
<div></div>
</html>

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

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html class="reftest-wait reftest-no-flush">
<title>Bug 1383239</title>
<style>
div {
position: absolute;
left: -9999px;
background: orange;
width: 20px;
height: 20px;
animation: anim 100s 0.1s infinite;
}
@keyframes anim {
0% {
left: 0px;
}
100% {
left: 0px;
}
}
</style>
<div></div>
<script>
document.querySelector('div').addEventListener('animationstart', ()=> {
document.documentElement.classList.remove('reftest-wait');
});
</script>
</html>

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

@ -4,6 +4,7 @@ skip-if(stylo) fails == print-no-animations.html print-no-animations-ref.html #
skip-if(stylo) fails != print-no-animations.html print-no-animations-notref.html # reftest harness doesn't actually make pres context non-dynamic for reftest-paged tests. Bug 1374154 for stylo
== animate-opacity.html animate-opacity-ref.html
== animate-preserves3d.html animate-preserves3d-ref.html
== animation-initially-out-of-view-with-delay.html animation-initially-out-of-view-with-delay-ref.html
== animation-on-empty-height-frame.html about:blank
== in-visibility-hidden-animation.html in-visibility-hidden-animation-ref.html
== in-visibility-hidden-animation-pseudo-element.html in-visibility-hidden-animation-pseudo-element-ref.html

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

@ -103,7 +103,7 @@ fuzzy-if(skiaContent,1,23) == resize-reflow-001.html resize-reflow-001.ref.html
== 115199-2a.html 115199-2-ref.html
== 115199-2b.html 115199-2-ref.html
== 652178-1.html 652178-1-ref2.html
fuzzy-if(cocoaWidget,1,5000) skip-if(webrender) == 745025-1.html 745025-1-ref.html
fuzzy-if(cocoaWidget,1,5000) == 745025-1.html 745025-1-ref.html
== 820496-1.html 820496-1-ref.html
# NOTE: These tests don't yet rigorously test what they're

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

@ -122,7 +122,7 @@ fuzzy-if(skiaContent,1,600) == anim-feGaussianBlur-01.svg lime.svg
# animate some <angle> attributes:
== anim-marker-orient-01.svg lime.svg
random-if(webrender) == anim-marker-orient-02.svg lime.svg
== anim-marker-orient-02.svg lime.svg
#animate points list:
== anim-polygon-points-01.svg anim-polygon-points-01-ref.svg
@ -235,7 +235,7 @@ skip == anim-text-x-y-dx-dy-01.svg anim-text-x-y-dx-dy-01-ref.svg # bug 579588
# Test we don't rely on HasAttr to see if an attribute has been set
== anim-rect-rxry-1.svg anim-rect-rxry-1-ref.svg
random-if(webrender) == anim-pattern-attr-presence-01.svg anim-pattern-attr-presence-01-ref.svg
fuzzy-if(webrender,1,350) == anim-pattern-attr-presence-01.svg anim-pattern-attr-presence-01-ref.svg
fails == anim-pattern-attr-presence-02.svg anim-pattern-attr-presence-02-ref.svg
# ^ bug 621651
fuzzy-if(cocoaWidget&&layersGPUAccelerated,1,2) == anim-gradient-attr-presence-01.svg anim-gradient-attr-presence-01-ref.svg

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

@ -34,7 +34,7 @@ fails == 1102175-1a.html 1102175-1-ref.html
== 1111944-1-list-marker.html 1111944-1-list-marker-ref.html
fuzzy(116,94) fuzzy-if(winWidget,135,124) HTTP(..) == 1115916-1-vertical-metrics.html 1115916-1-vertical-metrics-ref.html
== 1117210-1-vertical-baseline-snap.html 1117210-1-vertical-baseline-snap-ref.html
random-if(webrender) == 1117227-1-text-overflow.html 1117227-1-text-overflow-ref.html
== 1117227-1-text-overflow.html 1117227-1-text-overflow-ref.html
== 1122366-1-margin-collapse.html 1122366-1-margin-collapse-ref.html
== 1124636-1-fieldset-max-height.html 1124636-1-fieldset-max-height-ref.html
== 1124636-2-fieldset-min-height.html 1124636-2-fieldset-min-height-ref.html

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

@ -7,9 +7,9 @@ random-if(Android) fails-if(winWidget||stylo||styloVsGecko) == menulist-shrinkwr
fails-if(styloVsGecko) == textbox-overflow-1.xul textbox-overflow-1-ref.xul # for bug 749658, stylo: bug 1408235
# accesskeys are not normally displayed on Mac, so skip this test
skip-if(cocoaWidget) fails-if(styloVsGecko) == accesskey.xul accesskey-ref.xul # stylo: bug 1408811
fails-if(cocoaWidget&&!stylo) fuzzy-if(xulRuntime.widgetToolkit=="gtk3",1,11) asserts-if(stylo,13-26) fails-if(styloVsGecko) == tree-row-outline-1.xul tree-row-outline-1-ref.xul # win8: bug 1254832, stylo: bug 1397644
fails-if(cocoaWidget) fuzzy-if(xulRuntime.widgetToolkit=="gtk3",1,11) == tree-row-outline-1.xul tree-row-outline-1-ref.xul # win8: bug 1254832
skip-if(!cocoaWidget) == mac-tab-toolbar.xul mac-tab-toolbar-ref.xul
asserts-if(stylo,13-26) fails-if(stylo||styloVsGecko) != tree-row-outline-1.xul tree-row-outline-1-notref.xul # stylo: bug 1397644
!= tree-row-outline-1.xul tree-row-outline-1-notref.xul
== text-crop.xul text-crop-ref.xul
fails-if(stylo||styloVsGecko) == text-small-caps-1.xul text-small-caps-1-ref.xul # stylo: bug 1408235
fuzzy-if(skiaContent,1,60) fuzzy-if(cocoaWidget&&browserIsRemote&&!skiaContent,1,31) fuzzy-if(winWidget&&browserIsRemote&&layersGPUAccelerated,1,50) == inactive-fixed-bg-bug1205630.xul inactive-fixed-bg-bug1205630-ref.html
@ -72,4 +72,4 @@ fails-if(styloVsGecko) == stack-sizing-2.xul stack-sizing-2-ref.xul # bug 140823
skip == treecell-image-svg-1a.xul treecell-image-svg-1-ref.xul # bug 1218954
skip == treecell-image-svg-1b.xul treecell-image-svg-1-ref.xul # bug 1218954
asserts-if(stylo,16-18) fails-if(styloVsGecko) == treechildren-padding-percent-1.xul treechildren-padding-percent-1-ref.xul # bug 1397644
== treechildren-padding-percent-1.xul treechildren-padding-percent-1-ref.xul

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

@ -9,6 +9,7 @@
#include "nscore.h"
#include "nsStringGlue.h"
#include "mozilla/css/Rule.h"
#include "mozilla/NotNull.h"
/**
* Shared superclass for mozilla::css::StyleRule and mozilla::ServoStyleRule,
@ -18,6 +19,7 @@
class nsICSSDeclaration;
namespace mozilla {
class DeclarationBlock;
namespace dom {
class Element;
}
@ -54,6 +56,7 @@ public:
uint32_t aSelectorIndex,
const nsAString& aPseudo,
bool* aMatches) = 0;
virtual NotNull<DeclarationBlock*> GetDeclarationBlock() const = 0;
// WebIDL API
// For GetSelectorText/SetSelectorText, we purposefully use a signature that

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

@ -204,7 +204,7 @@ Declaration::RemoveProperty(const nsAString& aProperty)
[&](const nsAString& name) { RemoveVariable(name); });
}
void
bool
Declaration::RemovePropertyByID(nsCSSPropertyID aProperty)
{
MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT);
@ -213,18 +213,22 @@ Declaration::RemovePropertyByID(nsCSSPropertyID aProperty)
ExpandTo(&data);
MOZ_ASSERT(!mData && !mImportantData, "Expand didn't null things out");
bool removed = false;
if (nsCSSProps::IsShorthand(aProperty)) {
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(p, aProperty,
CSSEnabledState::eForAllContent) {
data.ClearLonghandProperty(*p);
mOrder.RemoveElement(static_cast<uint32_t>(*p));
if (mOrder.RemoveElement(static_cast<uint32_t>(*p))) {
removed = true;
}
}
} else {
data.ClearLonghandProperty(aProperty);
mOrder.RemoveElement(static_cast<uint32_t>(aProperty));
removed = mOrder.RemoveElement(static_cast<uint32_t>(aProperty));
}
CompressFrom(&data);
return removed;
}
bool

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

@ -127,7 +127,7 @@ public:
void GetPropertyValueByID(nsCSSPropertyID aPropID, nsAString& aValue) const;
bool GetPropertyIsImportant(const nsAString& aProperty) const;
void RemoveProperty(const nsAString& aProperty);
void RemovePropertyByID(nsCSSPropertyID aProperty);
bool RemovePropertyByID(nsCSSPropertyID aProperty);
bool HasProperty(nsCSSPropertyID aProperty) const;

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

@ -133,7 +133,8 @@ public:
nsAString& aValue) const;
inline bool GetPropertyIsImportant(const nsAString& aProperty) const;
inline void RemoveProperty(const nsAString& aProperty);
inline void RemovePropertyByID(nsCSSPropertyID aProperty);
// Returns whether the property was removed.
inline bool RemovePropertyByID(nsCSSPropertyID aProperty);
private:
union {

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

@ -105,7 +105,7 @@ DeclarationBlock::RemoveProperty(const nsAString& aProperty)
MOZ_STYLO_FORWARD(RemoveProperty, (aProperty))
}
void
bool
DeclarationBlock::RemovePropertyByID(nsCSSPropertyID aProperty)
{
MOZ_STYLO_FORWARD(RemovePropertyByID, (aProperty))

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

@ -435,7 +435,7 @@ SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetPropertyById, bool,
SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemoveProperty, void,
RawServoDeclarationBlockBorrowed declarations,
const nsACString* property)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemovePropertyById, void,
SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemovePropertyById, bool,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_HasCSSWideKeyword, bool,
@ -583,6 +583,13 @@ SERVO_BINDING_FUNC(Servo_ResolvePseudoStyle, ServoStyleContextStrong,
bool is_probe,
ServoStyleContextBorrowedOrNull inherited_style,
RawServoStyleSetBorrowed set)
SERVO_BINDING_FUNC(Servo_ComputedValues_ResolveXULTreePseudoStyle,
ServoStyleContextStrong,
RawGeckoElementBorrowed element,
nsAtom* pseudo_tag,
ServoStyleContextBorrowed inherited_style,
const mozilla::AtomArray* input_word,
RawServoStyleSetBorrowed set)
SERVO_BINDING_FUNC(Servo_SetExplicitStyle, void,
RawGeckoElementBorrowed element,
ServoStyleContextBorrowed primary_style)

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

@ -9,6 +9,7 @@
#include <stdint.h>
#include "mozilla/AtomArray.h"
#include "mozilla/ServoTypes.h"
#include "mozilla/ServoBindingTypes.h"
#include "mozilla/ServoElementSnapshot.h"

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

@ -142,6 +142,7 @@ whitelist-types = [
"RawGecko.*",
"mozilla::AnimationPropertySegment",
"mozilla::AnonymousCounterStyle",
"mozilla::AtomArray",
"mozilla::ComputedTiming",
"mozilla::ComputedTimingFunction",
"mozilla::ComputedTimingFunction::BeforeFlag",
@ -390,6 +391,7 @@ structs-types = [
"mozilla::css::URLValue",
"mozilla::css::URLValueData",
"mozilla::AnonymousCounterStyle",
"mozilla::AtomArray",
"mozilla::MallocSizeOf",
"mozilla::OriginFlags",
"mozilla::UniquePtr",

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

@ -55,11 +55,11 @@ ServoDeclarationBlock::RemoveProperty(const nsAString& aProperty)
Servo_DeclarationBlock_RemoveProperty(mRaw, &property);
}
void
bool
ServoDeclarationBlock::RemovePropertyByID(nsCSSPropertyID aPropID)
{
AssertMutable();
Servo_DeclarationBlock_RemovePropertyById(mRaw, aPropID);
return Servo_DeclarationBlock_RemovePropertyById(mRaw, aPropID);
}
} // namespace mozilla

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

@ -66,7 +66,7 @@ public:
void GetPropertyValueByID(nsCSSPropertyID aPropID, nsAString& aValue) const;
bool GetPropertyIsImportant(const nsAString& aProperty) const;
void RemoveProperty(const nsAString& aProperty);
void RemovePropertyByID(nsCSSPropertyID aPropID);
bool RemovePropertyByID(nsCSSPropertyID aPropID);
private:
~ServoDeclarationBlock() {}

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

@ -298,4 +298,10 @@ ServoStyleRule::SelectorMatchesElement(Element* aElement,
return NS_OK;
}
NotNull<DeclarationBlock*>
ServoStyleRule::GetDeclarationBlock() const
{
return WrapNotNull(mDecls.mDecls);
}
} // namespace mozilla

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

@ -80,6 +80,7 @@ public:
uint32_t aSelectorIndex,
const nsAString& aPseudo,
bool* aMatches) override;
NotNull<DeclarationBlock*> GetDeclarationBlock() const override;
// WebIDL interface
uint16_t Type() const final;

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

@ -701,6 +701,27 @@ ServoStyleSet::ResolveNonInheritingAnonymousBoxStyle(nsAtom* aPseudoTag)
return computedValues.forget();
}
#ifdef MOZ_XUL
already_AddRefed<ServoStyleContext>
ServoStyleSet::ResolveXULTreePseudoStyle(dom::Element* aParentElement,
nsICSSAnonBoxPseudo* aPseudoTag,
ServoStyleContext* aParentContext,
const AtomArray& aInputWord)
{
MOZ_ASSERT(nsCSSAnonBoxes::IsTreePseudoElement(aPseudoTag));
MOZ_ASSERT(aParentContext);
MOZ_ASSERT(!StylistNeedsUpdate());
return Servo_ComputedValues_ResolveXULTreePseudoStyle(
aParentElement,
aPseudoTag,
aParentContext,
&aInputWord,
mRawSet.get()
).Consume();
}
#endif
// manage the set of style sheets in the style set
nsresult
ServoStyleSet::AppendStyleSheet(SheetType aType,

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

@ -7,6 +7,7 @@
#ifndef mozilla_ServoStyleSet_h
#define mozilla_ServoStyleSet_h
#include "mozilla/AtomArray.h"
#include "mozilla/EffectCompositor.h"
#include "mozilla/EnumeratedArray.h"
#include "mozilla/EventStates.h"
@ -239,6 +240,14 @@ public:
already_AddRefed<ServoStyleContext>
ResolveNonInheritingAnonymousBoxStyle(nsAtom* aPseudoTag);
#ifdef MOZ_XUL
already_AddRefed<ServoStyleContext>
ResolveXULTreePseudoStyle(dom::Element* aParentElement,
nsICSSAnonBoxPseudo* aPseudoTag,
ServoStyleContext* aParentContext,
const AtomArray& aInputWord);
#endif
// manage the set of style sheets in the style set
nsresult AppendStyleSheet(SheetType aType, ServoStyleSheet* aSheet);
nsresult PrependStyleSheet(SheetType aType, ServoStyleSheet* aSheet);

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

@ -1513,5 +1513,11 @@ StyleRule::SelectorMatchesElement(Element* aElement,
return NS_OK;
}
NotNull<DeclarationBlock*>
StyleRule::GetDeclarationBlock() const
{
return WrapNotNull(mDeclaration);
}
} // namespace css
} // namespace mozilla

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

@ -347,6 +347,7 @@ public:
uint32_t aSelectorIndex,
const nsAString& aPseudo,
bool* aMatches) override;
mozilla::NotNull<DeclarationBlock*> GetDeclarationBlock() const override;
// WebIDL interface
uint16_t Type() const override;

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

@ -7,6 +7,7 @@
#ifndef mozilla_StyleSetHandle_h
#define mozilla_StyleSetHandle_h
#include "mozilla/AtomArray.h"
#include "mozilla/EventStates.h"
#include "mozilla/RefPtr.h"
#include "mozilla/ServoTypes.h"
@ -29,6 +30,7 @@ class nsBindingManager;
class nsCSSCounterStyleRule;
struct nsFontFaceRuleContainer;
class nsAtom;
class nsICSSAnonBoxPseudo;
class nsIContent;
class nsIDocument;
class nsStyleContext;
@ -144,6 +146,13 @@ public:
nsStyleContext* aParentContext);
inline already_AddRefed<nsStyleContext>
ResolveNonInheritingAnonymousBoxStyle(nsAtom* aPseudoTag);
#ifdef MOZ_XUL
inline already_AddRefed<nsStyleContext>
ResolveXULTreePseudoStyle(dom::Element* aParentElement,
nsICSSAnonBoxPseudo* aPseudoTag,
nsStyleContext* aParentContext,
const AtomArray& aInputWord);
#endif
inline nsresult AppendStyleSheet(SheetType aType, StyleSheet* aSheet);
inline nsresult PrependStyleSheet(SheetType aType, StyleSheet* aSheet);
inline nsresult RemoveStyleSheet(SheetType aType, StyleSheet* aSheet);

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

@ -152,6 +152,18 @@ StyleSetHandle::Ptr::ResolveNonInheritingAnonymousBoxStyle(nsAtom* aPseudoTag)
FORWARD(ResolveNonInheritingAnonymousBoxStyle, (aPseudoTag));
}
#ifdef MOZ_XUL
already_AddRefed<nsStyleContext>
StyleSetHandle::Ptr::ResolveXULTreePseudoStyle(dom::Element* aParentElement,
nsICSSAnonBoxPseudo* aPseudoTag,
nsStyleContext* aParentContext,
const AtomArray& aInputWord)
{
FORWARD_WITH_PARENT(ResolveXULTreePseudoStyle, aParentContext,
(aParentElement, aPseudoTag, parent, aInputWord));
}
#endif
// manage the set of style sheets in the style set
nsresult
StyleSetHandle::Ptr::AppendStyleSheet(SheetType aType, StyleSheet* aSheet)

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

@ -0,0 +1,14 @@
<!doctype html>
<map id="htmlvar00005">
<area></area>
<input
id="htmlvar00019"
type="image"
usemap="#htmlvar00005"
src="data:image/gif;base64,R0lGODlhIAAgAPIBAGbMzP///wAAADOZZpn/zAAAAAAAAAAAACH5BAAAAAAALAAAAAAgACAAAAOLGLrc/k7ISau9S5DNu/8fICgaYJ5oqqbDGJRrLAMtScw468J5Xr+3nm8XFM5+PGMMWYwxcMyZ40iULQaDhSzqDGBNisGyuhUDrmNb72pWcaXhtpsM/27pVi8UX96rcQpDf3V+QD12d4NKK2+Lc4qOKI2RJ5OUNHyXSDRYnZ6foKAuLxelphMQqaoPCQA7">
<script>
onload = () => {
document.body.offsetTop;
document.querySelector('area').style.color = "red";
}
</script>

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

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var ss = document.getElementsByTagName('style')[0];
var styleText = '@font-face { font-family: "MarkA"; src: url(markA.ttf); } :root { font-family: "MarkA"; }';
ss.firstChild.data = styleText;
setTimeout(function() {
ss.firstChild.data = styleText + " ";
}, 0);
}
</script>
<style>
</style>
</head>
<body onload="boom();"></body>
</html>

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

@ -89,6 +89,7 @@ load 786108-1.html
load 786108-2.html
load 788836.html
load 806310-1.html
load 809762.html
load 812824.html
load 822766-1.html
load 822842.html
@ -251,3 +252,4 @@ load 1404324-2.html
load 1404324-3.html
load 1404057.html
load 1409502.html
load 1409931.html

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

@ -390,15 +390,21 @@ GetSystemMetric(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
nsCSSValue& aResult)
{
aResult.Reset();
if (ShouldResistFingerprinting(aPresContext)) {
const bool isAccessibleFromContentPages =
!(aFeature->mReqFlags & nsMediaFeature::eUserAgentAndChromeOnly);
if (isAccessibleFromContentPages &&
ShouldResistFingerprinting(aPresContext)) {
// If "privacy.resistFingerprinting" is enabled, then we simply don't
// return any system-backed media feature values. (No spoofed values returned.)
// return any system-backed media feature values. (No spoofed values
// returned.)
return;
}
MOZ_ASSERT(aFeature->mValueType == nsMediaFeature::eBoolInteger,
"unexpected type");
nsAtom *metricAtom = *aFeature->mData.mMetric;
nsAtom* metricAtom = *aFeature->mData.mMetric;
bool hasMetric = nsCSSRuleProcessor::HasSystemMetric(metricAtom);
aResult.SetIntValue(hasMetric ? 1 : 0, eCSSUnit_Integer);
}

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

@ -1,12 +1,12 @@
load 131008-1.xul
load 137216-1.xul
asserts-if(stylo,3) load 140218-1.xml # bug 1397644
load 140218-1.xml
load 151826-1.xul
load 168724-1.xul
load 189814-1.xul
load 237787-1.xul
load 265161-1.xul
asserts-if(stylo,3) load 289410-1.xul # bug 1397644
load 289410-1.xul
load 290743.html
load 291702-1.xul
load 291702-2.xul
@ -24,12 +24,12 @@ load 329327-1.xul
load 329407-1.xml
load 329477-1.xhtml
load 336962-1.xul
asserts-if(stylo,3) load 344228-1.xul # bug 1397644
load 344228-1.xul
load 346083-1.xul
load 346281-1.xul
load 350460.xul
load 360642-1.xul
asserts-if(stylo,3-4) load 365151.xul # bug 1397644
load 365151.xul
load 366112-1.xul
asserts(0-50) load 366203-1.xul # bug 1217984
load 367185-1.xhtml
@ -90,7 +90,7 @@ load 508927-1.xul
load 508927-2.xul
load 514300-1.xul
load 536931-1.xhtml
asserts-if(stylo,4) load 538308-1.xul # bug 1397644
load 538308-1.xul
load 557174-1.xml
load 564705-1.xul
load 583957-1.html

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

@ -1,25 +1,24 @@
# All stylo assertions below are bug 1397644
asserts-if(stylo,3-4) load 307298-1.xul
asserts-if(stylo,8) load 309732-1.xul
asserts-if(stylo,8) load 309732-2.xul
asserts-if(stylo,13-23) load 366583-1.xul
asserts-if(stylo,6) load 380217-1.xul
load 307298-1.xul
load 309732-1.xul
load 309732-2.xul
load 366583-1.xul
load 380217-1.xul
load 382444-1.html
load 391178-1.xhtml
load 391178-2.xul
load 393665-1.xul
asserts-if(stylo,12) load 399227-1.xul
asserts-if(stylo,13) load 399227-2.xul
asserts-if(stylo,3) load 399692-1.xhtml
load 399227-1.xul
load 399227-2.xul
load 399692-1.xhtml
load 399715-1.xhtml
asserts-if(stylo,3) load 409807-1.xul
asserts-if(stylo,3) load 414170-1.xul
load 409807-1.xul
load 414170-1.xul
load 430394-1.xul
asserts-if(stylo,12) load 454186-1.xul
asserts-if(stylo,3) load 479931-1.xhtml
asserts-if(stylo,3) load 509602-1.xul
asserts-if(stylo,27-34) load 585815.html
load 454186-1.xul
load 479931-1.xhtml
load 509602-1.xul
load 585815.html
load 601427.html
asserts-if(stylo,3) load 730441-1.xul
asserts-if(stylo,3) load 730441-2.xul
asserts-if(stylo,3) load 730441-3.xul
load 730441-1.xul
load 730441-2.xul
load 730441-3.xul

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

@ -79,17 +79,9 @@ nsTreeStyleCache::GetStyleContext(nsPresContext* aPresContext,
}
if (!result) {
// We missed the cache. Resolve this pseudo-style.
// XXXheycam ServoStyleSets do not support XUL tree styles.
RefPtr<nsStyleContext> newResult;
if (aPresContext->StyleSet()->IsServo()) {
NS_ERROR("stylo: ServoStyleSets should not support XUL tree styles yet");
newResult = aPresContext->StyleSet()->
ResolveStyleForPlaceholder();
} else {
newResult = aPresContext->StyleSet()->AsGecko()->
ResolveXULTreePseudoStyle(aContent->AsElement(), aPseudoElement,
aContext->AsGecko(), aInputWord);
}
RefPtr<nsStyleContext> newResult = aPresContext->StyleSet()->
ResolveXULTreePseudoStyle(aContent->AsElement(),
aPseudoElement, aContext, aInputWord);
// Put the style context in our table, transferring the owning reference to the table.
if (!mCache) {

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

@ -1,2 +0,0 @@
# DO NOT check this file into source control.
sdk.dir=/Users/nechen/.android-sdk

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

@ -403,14 +403,6 @@ pref("ui.bookmark.mobilefolder.enabled", true);
pref("ui.bookmark.mobilefolder.enabled", false);
#endif
#if MOZ_UPDATE_CHANNEL == nightly
pref("mma.enabled", true);
#elif MOZ_UPDATE_CHANNEL == beta
pref("mma.enabled", true);
#else
pref("mma.enabled", true);
#endif
pref("ui.touch.radius.enabled", false);
pref("ui.touch.radius.leftmm", 3);

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

@ -81,7 +81,7 @@
android:title="@string/contextmenu_pin_to_top_sites"/>
<item android:id="@+id/add_to_launcher"
android:title="@string/contextmenu_add_to_launcher"/>
android:title="@string/contextmenu_add_page_shortcut"/>
<item android:id="@+id/set_as_homepage"
android:title="@string/contextmenu_set_as_homepage"/>

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

@ -15,7 +15,7 @@
android:title="@string/contextmenu_copyurl"/>
<item android:id="@+id/add_to_launcher"
android:title="@string/contextmenu_add_to_launcher"/>
android:title="@string/contextmenu_add_page_shortcut"/>
<item android:id="@+id/set_as_homepage"
android:title="@string/contextmenu_set_as_homepage"/>

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

@ -82,7 +82,7 @@
android:title="@string/contextmenu_pin_to_top_sites"/>
<item android:id="@+id/add_to_launcher"
android:title="@string/contextmenu_add_to_launcher"/>
android:title="@string/contextmenu_add_page_shortcut"/>
<item android:id="@+id/set_as_homepage"
android:title="@string/contextmenu_set_as_homepage"/>

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

@ -45,6 +45,6 @@
<item
android:id="@+id/add_homescreen"
android:icon="@drawable/as_home"
android:title="@string/contextmenu_add_to_launcher"/>
android:title="@string/contextmenu_add_page_shortcut"/>
</group>
</menu>

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