MozReview-Commit-ID: Fp2oBAcru51
This commit is contained in:
Wes Kocher 2017-05-09 14:34:34 -07:00
Родитель 760cf164e9 742aa0d07f
Коммит e2902f93a3
225 изменённых файлов: 2848 добавлений и 1829 удалений

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

@ -42,7 +42,7 @@
</header>
<section>
<img class="graphic graphic-sync-intro" src="chrome://browser/skin/fxa/sync-illustration.svg#blueFill"/>
<img class="graphic graphic-sync-intro" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
<div class="button-row">
<button id="buttonOpenPrefs" class="button" href="#" tabindex="0">&aboutAccountsConfig.syncPreferences.label;</button>
@ -56,7 +56,7 @@
</header>
<section>
<img class="graphic graphic-sync-intro" src="chrome://browser/skin/fxa/sync-illustration.svg#blueFill"/>
<img class="graphic graphic-sync-intro" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
<div class="description">&aboutAccountsConfig.description;</div>
<div class="button-row">
@ -71,7 +71,7 @@
</header>
<section>
<img class="graphic graphic-sync-intro" src="chrome://browser/skin/fxa/sync-illustration.svg#blueFill"/>
<img class="graphic graphic-sync-intro" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
<div class="description">&aboutAccounts.noConnection.description;</div>
<div class="button-row">
@ -86,7 +86,7 @@
</header>
<section>
<img class="graphic graphic-sync-intro" src="chrome://browser/skin/fxa/sync-illustration.svg#blueFill"/>
<img class="graphic graphic-sync-intro" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
<div class="description">&aboutAccounts.badConfig.description;</div>
</section>

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

@ -118,6 +118,8 @@ header h1
overflow: hidden;
text-indent: 100%;
white-space: nowrap;
-moz-context-properties: fill;
fill: #bfcbd3;
}
.description,

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

@ -19,10 +19,6 @@ const EXPECTED_REFLOWS = [
// Focusing the content area causes a reflow.
"_delayedStartup@chrome://browser/content/browser.js|",
// Sometimes sessionstore collects data during this test, which causes a sync reflow
// (https://bugzilla.mozilla.org/show_bug.cgi?id=892154 will fix this)
"ssi_getWindowDimension@resource:///modules/sessionstore/SessionStore.jsm",
];
if (Services.appinfo.OS == "WINNT" || Services.appinfo.OS == "Darwin") {

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

@ -189,9 +189,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
}
}
} else {
let originalUrl = ReaderMode.getOriginalUrl(aValue);
let originalUrl = ReaderMode.getOriginalUrlObjectForDisplay(aValue);
if (originalUrl) {
returnValue = originalUrl;
returnValue = originalUrl.spec;
}
}
@ -825,16 +825,17 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
}
// Avoid copying 'about:reader?url=', and always provide the original URI:
let readerOriginalURL = ReaderMode.getOriginalUrl(uri.spec);
if (readerOriginalURL) {
uri = uriFixup.createFixupURI(readerOriginalURL, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
// Reader mode ensures we call createExposableURI itself.
let readerStrippedURI = ReaderMode.getOriginalUrlObjectForDisplay(uri.spec);
if (readerStrippedURI) {
uri = readerStrippedURI;
} else {
// Only copy exposable URIs
try {
uri = uriFixup.createExposableURI(uri);
} catch (ex) {}
}
// Only copy exposable URIs
try {
uri = uriFixup.createExposableURI(uri);
} catch (ex) {}
// If the entire URL is selected, just use the actual loaded URI,
// unless we want a decoded URI, or it's a data: or javascript: URI,
// since those are hard to read when encoded.

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

@ -12,6 +12,7 @@ support-files =
[browser_favicon.js]
[browser_forgetaboutsite.js]
[browser_forgetAPI_cookie_getCookiesWithOriginAttributes.js]
[browser_restore_getCookiesWithOriginAttributes.js]
[browser_forgetAPI_EME_forgetThisSite.js]
[browser_forgetAPI_quota_clearStoragesForPrincipal.js]
[browser_newtabButton.js]

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

@ -0,0 +1,114 @@
/*
* Bug 1334587 - A Test case for checking whether forgetting APIs are working for cookies.
*/
const { classes: Cc, Constructor: CC, interfaces: Ci, utils: Cu } = Components;
const TEST_HOST = "example.com";
const TEST_URL = "http://" + TEST_HOST + "/browser/browser/components/contextualidentity/test/browser/";
const USER_CONTEXTS = [
"default",
"personal",
"work"
];
const DELETE_CONTEXT = 1;
const COOKIE_NAME = "userContextId";
//
// Support functions.
//
function* openTabInUserContext(uri, userContextId) {
// Open the tab in the correct userContextId.
let tab = gBrowser.addTab(uri, {userContextId});
// Select tab and make sure its browser is focused.
gBrowser.selectedTab = tab;
tab.ownerGlobal.focus();
let browser = gBrowser.getBrowserForTab(tab);
yield BrowserTestUtils.browserLoaded(browser);
return {tab, browser};
}
function getCookiesForOA(host, userContextId) {
return Services.cookies.getCookiesFromHost(host, {userContextId});
}
//
// Test functions.
//
add_task(function* setup() {
// Make sure userContext is enabled.
yield SpecialPowers.pushPrefEnv({"set": [
[ "privacy.userContext.enabled", true ],
]});
});
function checkCookies(ignoreContext = null) {
for (let userContextId of Object.keys(USER_CONTEXTS)) {
if (ignoreContext && userContextId === String(ignoreContext)) {
continue;
}
let enumerator = getCookiesForOA(TEST_HOST, userContextId);
ok(enumerator.hasMoreElements(), "Cookies available");
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
is(foundCookie["name"], COOKIE_NAME, "Check cookie name");
is(foundCookie["value"], USER_CONTEXTS[userContextId], "Check cookie value");
}
}
function deleteCookies(onlyContext = null) {
// Using getCookiesWithOriginAttributes() to get all cookies for a certain
// domain by using the originAttributes pattern, and clear all these cookies.
let enumerator = Services.cookies.getCookiesWithOriginAttributes(JSON.stringify({}), TEST_HOST);
while (enumerator.hasMoreElements()) {
let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie);
if (!onlyContext || cookie.originAttributes.userContextId == onlyContext) {
Services.cookies.remove(cookie.host, cookie.name, cookie.path, false, cookie.originAttributes);
}
}
}
add_task(function* test_cookie_getCookiesWithOriginAttributes() {
let tabs = [];
for (let userContextId of Object.keys(USER_CONTEXTS)) {
// Load the page in different contexts and set a cookie
// which should only be visible in that context.
let value = USER_CONTEXTS[userContextId];
// Open our tab in the given user context.
tabs[userContextId] = yield* openTabInUserContext(TEST_URL + "file_reflect_cookie_into_title.html?" + value, userContextId);
// Close this tab.
yield BrowserTestUtils.removeTab(tabs[userContextId].tab);
}
// Check that cookies have been set properly.
for (let userContextId of Object.keys(USER_CONTEXTS)) {
let enumerator = getCookiesForOA(TEST_HOST, userContextId);
ok(enumerator.hasMoreElements(), "Cookies available");
let foundCookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
is(foundCookie["name"], COOKIE_NAME, "Check cookie name");
is(foundCookie["value"], USER_CONTEXTS[userContextId], "Check cookie value");
}
checkCookies();
deleteCookies(DELETE_CONTEXT);
checkCookies(DELETE_CONTEXT);
deleteCookies();
// Check that whether cookies has been cleared.
for (let userContextId of Object.keys(USER_CONTEXTS)) {
let e = getCookiesForOA(TEST_HOST, userContextId);
ok(!e.hasMoreElements(), "No Cookie should be here");
}
});

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

@ -60,7 +60,7 @@
</groupbox>
</vbox>
<vbox>
<html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg#blueFill"/>
<html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
</vbox>
</hbox>
<label class="fxaMobilePromo">
@ -178,7 +178,7 @@
</groupbox>
</vbox>
<vbox>
<html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg#blueFill"/>
<html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
</vbox>
</hbox>
<groupbox>

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

@ -18,7 +18,7 @@
<hbox hidden="true"
class="container-header-links"
data-category="paneContainers">
<label class="text-link" id="backContainersLink" value="&backLink.label;" />
<label class="text-link" id="backContainersLink">&backLink.label;</label>
</hbox>
<hbox id="header-containers"

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

@ -291,6 +291,10 @@ var gSearchResultsPane = {
valueResult = this.stringMatchesFilters(nodeObject.getAttribute("value"), searchPhrase);
}
if (nodeObject.tagName == "button" && (labelResult || valueResult)) {
nodeObject.setAttribute("highlightable", "true");
}
matchesFound = matchesFound || complexTextNodesResult || labelResult || valueResult;
}

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

@ -380,7 +380,7 @@
<separator class="thin"/>
<hbox id="addEnginesBox" pack="start">
<label id="addEngines" class="text-link" value="&addMoreSearchEngines2.label;"/>
<label id="addEngines" class="text-link">&addMoreSearchEngines2.label;</label>
</hbox>
</groupbox>

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

@ -355,8 +355,7 @@
<vbox flex="1">
<description>
&trackingProtection.description;
<label id="trackingProtectionLearnMore" class="learnMore text-link"
value="&trackingProtectionLearnMore.label;"/>
<label id="trackingProtectionLearnMore" class="learnMore text-link">&trackingProtectionLearnMore.label;</label>
</description>
<description id="trackingProtectionDesc"
control="trackingProtectionRadioGroup">
@ -397,8 +396,7 @@
accesskey="&trackingProtectionPBM5.accesskey;"
label="&trackingProtectionPBM5.label;" />
<label id="trackingProtectionPBMLearnMore"
class="learnMore text-link"
value="&trackingProtectionPBMLearnMore.label;"/>
class="learnMore text-link">&trackingProtectionPBMLearnMore.label;</label>
<spacer flex="1" />
<button id="changeBlockListPBM"
label="&changeBlockList.label;" accesskey="&changeBlockList.accesskey;"
@ -441,8 +439,7 @@
<hbox flex="1">
<label id="notificationsPolicy">&notificationsPolicyDesc3.label;</label>
<label id="notificationsPolicyLearnMore"
class="learnMore text-link"
value="&notificationsPolicyLearnMore.label;"/>
class="learnMore text-link">&notificationsPolicyLearnMore.label;</label>
</hbox>
<hbox pack="end">
<button id="notificationsPolicyButton"
@ -457,8 +454,7 @@
<checkbox id="notificationsDoNotDisturb" label="&notificationsDoNotDisturb.label;"
accesskey="&notificationsDoNotDisturb.accesskey;"/>
<label id="notificationsDoNotDisturbDetails"
class="indent"
value="&notificationsDoNotDisturbDetails.value;"/>
class="indent">&notificationsDoNotDisturbDetails.value;</label>
</vbox>
</groupbox>
@ -570,7 +566,9 @@
<hbox align="center">
<checkbox id="playDRMContent" preference="media.eme.enabled"
label="&playDRMContent.label;" accesskey="&playDRMContent.accesskey;"/>
<label id="playDRMContentLink" class="learnMore text-link" value="&playDRMContent.learnMore.label;"/>
<label id="playDRMContentLink" class="learnMore text-link">
&playDRMContent.learnMore.label;
</label>
</hbox>
</row>
</rows>
@ -587,8 +585,9 @@
accesskey="&browserContainersEnabled.accesskey;"
preference="privacy.userContext.enabled"
onsyncfrompreference="return gPrivacyPane.readBrowserContainersCheckbox();"/>
<label id="browserContainersLearnMore" class="learnMore text-link"
value="&browserContainersLearnMore.label;"/>
<label id="browserContainersLearnMore" class="learnMore text-link">
&browserContainersLearnMore.label;
</label>
<spacer flex="1"/>
<button id="browserContainersSettings"
class="accessory-button"

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

@ -59,7 +59,7 @@
</groupbox>
</vbox>
<vbox>
<html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg#blueFill"/>
<html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
</vbox>
</hbox>
<label class="fxaMobilePromo">
@ -178,7 +178,7 @@
</groupbox>
</vbox>
<vbox>
<html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg#blueFill"/>
<html:img class="fxaSyncIllustration" src="chrome://browser/skin/fxa/sync-illustration.svg"/>
</vbox>
</hbox>
<groupbox>

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

@ -1,10 +1,8 @@
add_task(function*() {
yield SpecialPowers.pushPrefEnv({set: [
["browser.preferences.defaultPerformanceSettings.enabled", true],
["dom.ipc.processCount", 4],
["layers.acceleration.disabled", false],
]});
});
SpecialPowers.pushPrefEnv({set: [
["browser.preferences.defaultPerformanceSettings.enabled", true],
["dom.ipc.processCount", 4],
["layers.acceleration.disabled", false],
]});
add_task(function*() {
let prefs = yield openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});

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

@ -576,6 +576,19 @@ toolbarpaletteitem[place="palette"] > #personal-bookmarks > #bookmarks-toolbar-p
list-style-image: url("chrome://browser/skin/menu-forward.png") !important;
}
@media (-moz-mac-yosemite-theme) {
#forward-button > .toolbarbutton-icon {
border-top: none !important;
border-bottom: none !important;
box-shadow: 0 .5px 0 0 rgba(0,0,0,0.2) !important;
}
#forward-button:-moz-window-inactive > .toolbarbutton-icon {
box-shadow: 0 1px 0 0 rgba(0,0,0,0.2) inset,
0 -1px 0 0 rgba(0,0,0,0.2) inset !important;
}
}
/* ----- FULLSCREEN WINDOW CONTROLS ----- */
#minimize-button,

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

@ -817,6 +817,8 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton {
.fxaSyncIllustration {
width: 180px;
height: var(--panel-ui-sync-illustration-height);
-moz-context-properties: fill;
fill: #cdcdcd;
}
.PanelUI-remotetabs-prefs-button > .toolbarbutton-text {

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

@ -1,30 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" viewBox="0 0 320 280" xmlns:xlink="http://www.w3.org/1999/xlink" >
<style>
#blueFill:target ~ use,
#blueFill:target ~ g {
fill: #bfcbd3;
}
svg {
fill:#cdcdcd;
}
</style>
<defs>
<g id="logo">
<path d="M46.352,148.919 L46.352,148.919 L44.938,150.333 L43.523,148.919 L43.523,148.919 L37.866,143.262 L39.281,141.848 L44.938,147.505 L50.594,141.848 L52.009,143.262 L46.352,148.919 ZM43.937,134.000 L45.938,134.000 L45.938,142.000 L43.937,142.000 L43.937,134.000 ZM43.937,122.000 L45.938,122.000 L45.938,130.000 L43.937,130.000 L43.937,122.000 Z"/>
<path d="M306.641,132.110 L300.984,126.453 L295.328,132.110 L293.913,130.696 L300.984,123.625 L308.055,130.696 L306.641,132.110 ZM302.000,223.969 L300.000,223.969 L300.000,215.969 L302.000,215.969 L302.000,223.969 ZM302.000,211.969 L300.000,211.969 L300.000,203.969 L302.000,203.969 L302.000,211.969 ZM302.000,199.969 L300.000,199.969 L300.000,191.969 L302.000,191.969 L302.000,199.969 ZM302.000,187.969 L300.000,187.969 L300.000,179.969 L302.000,179.969 L302.000,187.969 ZM302.000,175.969 L300.000,175.969 L300.000,167.969 L302.000,167.969 L302.000,175.969 ZM302.000,163.969 L300.000,163.969 L300.000,155.969 L302.000,155.969 L302.000,163.969 ZM300.000,131.969 L302.000,131.969 L302.000,139.969 L300.000,139.969 L300.000,131.969 ZM302.000,151.969 L300.000,151.969 L300.000,143.969 L302.000,143.969 L302.000,151.969 ZM300.000,227.969 L302.000,227.969 L302.000,232.000 L302.000,234.000 L300.000,234.000 L292.000,234.000 L292.000,232.000 L300.000,232.000 L300.000,227.969 Z"/>
<path d="M101.335,236.009 L99.921,234.594 L105.578,228.938 L99.921,223.281 L101.335,221.866 L108.406,228.938 L101.335,236.009 ZM100.000,229.938 L92.000,229.938 L92.000,227.937 L100.000,227.937 L100.000,229.938 ZM80.000,227.937 L88.000,227.937 L88.000,229.938 L80.000,229.938 L80.000,227.937 Z"/>
<path d="M182.000,54.000 L182.000,52.000 L190.000,52.000 L190.000,54.000 L182.000,54.000 ZM170.000,52.000 L178.000,52.000 L178.000,54.000 L170.000,54.000 L170.000,52.000 ZM168.488,60.071 L161.417,53.000 L168.488,45.929 L169.902,47.343 L164.245,53.000 L169.902,58.657 L168.488,60.071 Z"/>
<path d="M297.688,276.000 L102.312,276.000 C97.721,276.000 94.000,272.279 94.000,267.688 L94.000,260.000 L306.000,260.000 L306.000,267.688 C306.000,272.279 302.279,276.000 297.688,276.000 ZM117.906,150.312 C117.906,145.721 121.628,142.000 126.218,142.000 L273.688,142.000 C278.279,142.000 282.000,145.721 282.000,150.312 L282.000,256.000 L117.906,256.000 L117.906,150.312 ZM132.000,242.000 L270.000,242.000 L270.000,156.000 L132.000,156.000 L132.000,242.000 Z"/>
<path d="M307.074,115.969 L206.926,115.969 C203.101,115.969 200.000,112.868 200.000,109.042 L200.000,38.926 C200.000,35.101 203.101,32.000 206.926,32.000 L307.074,32.000 C310.899,32.000 314.000,35.101 314.000,38.926 L314.000,109.042 C314.000,112.868 310.899,115.969 307.074,115.969 ZM210.000,65.875 C210.000,64.770 209.105,63.875 208.000,63.875 C206.895,63.875 206.000,64.770 206.000,65.875 L206.000,82.000 C206.000,83.105 206.895,84.000 208.000,84.000 C209.105,84.000 210.000,83.105 210.000,82.000 L210.000,65.875 ZM302.000,42.000 L216.000,42.000 L216.000,106.000 L302.000,106.000 L302.000,42.000 Z"/>
<path d="M65.844,240.000 L26.156,240.000 C23.861,240.000 22.000,238.139 22.000,235.844 L22.000,162.156 C22.000,159.861 23.861,158.000 26.156,158.000 L65.844,158.000 C68.139,158.000 70.000,159.861 70.000,162.156 L70.000,235.844 C70.000,238.139 68.139,240.000 65.844,240.000 ZM46.000,236.000 C48.287,236.000 50.141,234.195 50.141,231.969 C50.141,229.742 48.287,227.938 46.000,227.938 C43.713,227.938 41.859,229.742 41.859,231.969 C41.859,234.195 43.713,236.000 46.000,236.000 ZM66.000,168.000 L26.000,168.000 L26.000,224.000 L66.000,224.000 L66.000,168.000 Z"/>
<path d="M171.906,86.156 C171.906,102.329 159.026,115.469 143.017,115.797 L143.039,115.955 L28.850,115.955 L28.869,115.797 C12.872,115.475 -0.000,102.333 -0.000,86.156 C-0.000,71.661 10.336,59.603 23.994,57.019 C23.620,55.457 23.401,53.834 23.401,52.156 C23.401,40.714 32.606,31.438 43.962,31.438 C47.561,31.438 50.941,32.375 53.884,34.012 C53.883,33.930 53.878,33.848 53.878,33.766 C53.878,17.137 67.301,3.656 83.858,3.656 C97.763,3.656 109.453,13.164 112.843,26.059 C116.677,23.334 121.343,21.719 126.393,21.719 C139.394,21.719 149.933,32.331 149.933,45.422 C149.933,49.572 148.868,53.468 147.007,56.861 C161.114,59.082 171.906,71.351 171.906,86.156 Z"/>
</g>
</defs>
<g id="blueFill"></g>
<use xlink:href="#logo" />
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 320 280" preserveAspectRatio="xMidYMid">
<path fill="context-fill" d="M46.352,148.919 L46.352,148.919 L44.938,150.333 L43.523,148.919 L43.523,148.919 L37.866,143.262 L39.281,141.848 L44.938,147.505 L50.594,141.848 L52.009,143.262 L46.352,148.919 ZM43.937,134.000 L45.938,134.000 L45.938,142.000 L43.937,142.000 L43.937,134.000 ZM43.937,122.000 L45.938,122.000 L45.938,130.000 L43.937,130.000 L43.937,122.000 Z"/>
<path fill="context-fill" d="M306.641,132.110 L300.984,126.453 L295.328,132.110 L293.913,130.696 L300.984,123.625 L308.055,130.696 L306.641,132.110 ZM302.000,223.969 L300.000,223.969 L300.000,215.969 L302.000,215.969 L302.000,223.969 ZM302.000,211.969 L300.000,211.969 L300.000,203.969 L302.000,203.969 L302.000,211.969 ZM302.000,199.969 L300.000,199.969 L300.000,191.969 L302.000,191.969 L302.000,199.969 ZM302.000,187.969 L300.000,187.969 L300.000,179.969 L302.000,179.969 L302.000,187.969 ZM302.000,175.969 L300.000,175.969 L300.000,167.969 L302.000,167.969 L302.000,175.969 ZM302.000,163.969 L300.000,163.969 L300.000,155.969 L302.000,155.969 L302.000,163.969 ZM300.000,131.969 L302.000,131.969 L302.000,139.969 L300.000,139.969 L300.000,131.969 ZM302.000,151.969 L300.000,151.969 L300.000,143.969 L302.000,143.969 L302.000,151.969 ZM300.000,227.969 L302.000,227.969 L302.000,232.000 L302.000,234.000 L300.000,234.000 L292.000,234.000 L292.000,232.000 L300.000,232.000 L300.000,227.969 Z"/>
<path fill="context-fill" d="M101.335,236.009 L99.921,234.594 L105.578,228.938 L99.921,223.281 L101.335,221.866 L108.406,228.938 L101.335,236.009 ZM100.000,229.938 L92.000,229.938 L92.000,227.937 L100.000,227.937 L100.000,229.938 ZM80.000,227.937 L88.000,227.937 L88.000,229.938 L80.000,229.938 L80.000,227.937 Z"/>
<path fill="context-fill" d="M182.000,54.000 L182.000,52.000 L190.000,52.000 L190.000,54.000 L182.000,54.000 ZM170.000,52.000 L178.000,52.000 L178.000,54.000 L170.000,54.000 L170.000,52.000 ZM168.488,60.071 L161.417,53.000 L168.488,45.929 L169.902,47.343 L164.245,53.000 L169.902,58.657 L168.488,60.071 Z"/>
<path fill="context-fill" d="M297.688,276.000 L102.312,276.000 C97.721,276.000 94.000,272.279 94.000,267.688 L94.000,260.000 L306.000,260.000 L306.000,267.688 C306.000,272.279 302.279,276.000 297.688,276.000 ZM117.906,150.312 C117.906,145.721 121.628,142.000 126.218,142.000 L273.688,142.000 C278.279,142.000 282.000,145.721 282.000,150.312 L282.000,256.000 L117.906,256.000 L117.906,150.312 ZM132.000,242.000 L270.000,242.000 L270.000,156.000 L132.000,156.000 L132.000,242.000 Z"/>
<path fill="context-fill" d="M307.074,115.969 L206.926,115.969 C203.101,115.969 200.000,112.868 200.000,109.042 L200.000,38.926 C200.000,35.101 203.101,32.000 206.926,32.000 L307.074,32.000 C310.899,32.000 314.000,35.101 314.000,38.926 L314.000,109.042 C314.000,112.868 310.899,115.969 307.074,115.969 ZM210.000,65.875 C210.000,64.770 209.105,63.875 208.000,63.875 C206.895,63.875 206.000,64.770 206.000,65.875 L206.000,82.000 C206.000,83.105 206.895,84.000 208.000,84.000 C209.105,84.000 210.000,83.105 210.000,82.000 L210.000,65.875 ZM302.000,42.000 L216.000,42.000 L216.000,106.000 L302.000,106.000 L302.000,42.000 Z"/>
<path fill="context-fill" d="M65.844,240.000 L26.156,240.000 C23.861,240.000 22.000,238.139 22.000,235.844 L22.000,162.156 C22.000,159.861 23.861,158.000 26.156,158.000 L65.844,158.000 C68.139,158.000 70.000,159.861 70.000,162.156 L70.000,235.844 C70.000,238.139 68.139,240.000 65.844,240.000 ZM46.000,236.000 C48.287,236.000 50.141,234.195 50.141,231.969 C50.141,229.742 48.287,227.938 46.000,227.938 C43.713,227.938 41.859,229.742 41.859,231.969 C41.859,234.195 43.713,236.000 46.000,236.000 ZM66.000,168.000 L26.000,168.000 L26.000,224.000 L66.000,224.000 L66.000,168.000 Z"/>
<path fill="context-fill" d="M171.906,86.156 C171.906,102.329 159.026,115.469 143.017,115.797 L143.039,115.955 L28.850,115.955 L28.869,115.797 C12.872,115.475 -0.000,102.333 -0.000,86.156 C-0.000,71.661 10.336,59.603 23.994,57.019 C23.620,55.457 23.401,53.834 23.401,52.156 C23.401,40.714 32.606,31.438 43.962,31.438 C47.561,31.438 50.941,32.375 53.884,34.012 C53.883,33.930 53.878,33.848 53.878,33.766 C53.878,17.137 67.301,3.656 83.858,3.656 C97.763,3.656 109.453,13.164 112.843,26.059 C116.677,23.334 121.343,21.719 126.393,21.719 C139.394,21.719 149.933,32.331 149.933,45.422 C149.933,49.572 148.868,53.468 147.007,56.861 C161.114,59.082 171.906,71.351 171.906,86.156 Z"/>
</svg>

До

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

После

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

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

@ -440,6 +440,9 @@ description > html|a {
.fxaSyncIllustration {
margin-top: 35px;
width: 231px;
-moz-context-properties: fill;
fill: #bfcbd3;
}
#syncOptions caption {
@ -495,10 +498,6 @@ description > html|a {
color: var(--in-content-link-color);
}
.fxaSyncIllustration {
width: 231px;
}
#fxaLoginStatus[hasName] #fxaEmailAddress1 {
font-size: 1.1rem;
}

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

@ -443,6 +443,9 @@ description > html|a {
.fxaSyncIllustration {
margin-top: 35px;
width: 231px;
-moz-context-properties: fill;
fill: #bfcbd3;
}
#syncOptions caption {
@ -498,10 +501,6 @@ description > html|a {
color: var(--in-content-link-color);
}
.fxaSyncIllustration {
width: 231px;
}
#fxaLoginStatus[hasName] #fxaEmailAddress1 {
font-size: 1.1rem;
}

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

@ -6,6 +6,10 @@
/******************************************************************************/
/* General */
html, body, #content {
height: 100%;
}
body {
color: var(--theme-body-color);
background-color: var(--theme-body-background);
@ -18,10 +22,6 @@ body {
outline: none !important;
}
#content {
height: 100%;
}
pre {
background-color: white;
border: none;

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

@ -95,14 +95,6 @@ define(function (require, exports, module) {
let content = document.getElementById("content");
let theApp = render(MainTabbedArea(input), content);
let onResize = event => {
window.document.body.style.height = window.innerHeight + "px";
window.document.body.style.width = window.innerWidth + "px";
};
window.addEventListener("resize", onResize);
onResize();
// Send notification event to the window. Can be useful for
// tests as well as extensions.
let event = new CustomEvent("JSONViewInitialized", {});

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

@ -2,8 +2,8 @@
<meta charset=utf-8>
<title>Web Animations API: DocumentTimeline tests</title>
<script src="../testcommon.js"></script>
<iframe src="data:text/html;charset=utf-8," width="10" height="10" id="iframe"></iframe>
<iframe src="data:text/html;charset=utf-8,%3Chtml%20style%3D%22display%3Anone%22%3E%3C%2Fhtml%3E" width="10" height="10" id="hidden-iframe"></iframe>
<iframe srcdoc='<html><meta charset=utf-8></html>' width="10" height="10" id="iframe"></iframe>
<iframe srcdoc='<html style="display:none"><meta charset=utf-8></html>' width="10" height="10" id="hidden-iframe"></iframe>
<script>
'use strict';

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

@ -78,12 +78,21 @@ CustomElementCallback::CustomElementCallback(Element* aThisObject,
{
}
//-----------------------------------------------------
// CustomElementData
CustomElementData::CustomElementData(nsIAtom* aType)
: mType(aType),
mCurrentCallback(-1),
mElementIsBeingCreated(false),
mCreatedCallbackInvoked(true),
mAssociatedMicroTask(-1)
: CustomElementData(aType, CustomElementData::State::eUndefined)
{
}
CustomElementData::CustomElementData(nsIAtom* aType, State aState)
: mType(aType)
, mCurrentCallback(-1)
, mElementIsBeingCreated(false)
, mCreatedCallbackInvoked(true)
, mAssociatedMicroTask(-1)
, mState(aState)
{
}
@ -99,6 +108,9 @@ CustomElementData::RunCallbackQueue()
mCurrentCallback = -1;
}
//-----------------------------------------------------
// CustomElementRegistry
// Only needed for refcounted objects.
NS_IMPL_CYCLE_COLLECTION_CLASS(CustomElementRegistry)
@ -306,10 +318,15 @@ CustomElementRegistry::SetupCustomElement(Element* aElement,
aElement->SetAttr(kNameSpaceID_None, nsGkAtoms::is, *aTypeExtension, true);
}
CustomElementDefinition* data = LookupCustomElementDefinition(
// SetupCustomElement() should be called with an element that don't have
// CustomElementData setup, if not we will hit the assertion in
// SetCustomElementData().
aElement->SetCustomElementData(new CustomElementData(typeAtom));
CustomElementDefinition* definition = LookupCustomElementDefinition(
aElement->NodeInfo()->LocalName(), aTypeExtension);
if (!data) {
if (!definition) {
// The type extension doesn't exist in the registry,
// thus we don't need to enqueue callback or adjust
// the "is" attribute, but it is possibly an upgrade candidate.
@ -317,7 +334,7 @@ CustomElementRegistry::SetupCustomElement(Element* aElement,
return;
}
if (data->mLocalName != tagAtom) {
if (definition->mLocalName != tagAtom) {
// The element doesn't match the local name for the
// definition, thus the element isn't a custom element
// and we don't need to do anything more.
@ -326,7 +343,7 @@ CustomElementRegistry::SetupCustomElement(Element* aElement,
// Enqueuing the created callback will set the CustomElementData on the
// element, causing prototype swizzling to occur in Element::WrapObject.
EnqueueLifecycleCallback(nsIDocument::eCreated, aElement, nullptr, data);
EnqueueLifecycleCallback(nsIDocument::eCreated, aElement, nullptr, definition);
}
void
@ -335,7 +352,8 @@ CustomElementRegistry::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType
LifecycleCallbackArgs* aArgs,
CustomElementDefinition* aDefinition)
{
CustomElementData* elementData = aCustomElement->GetCustomElementData();
RefPtr<CustomElementData> elementData = aCustomElement->GetCustomElementData();
MOZ_ASSERT(elementData, "CustomElementData should exist");
// Let DEFINITION be ELEMENT's definition
CustomElementDefinition* definition = aDefinition;
@ -355,16 +373,6 @@ CustomElementRegistry::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType
}
}
if (!elementData) {
// Create the custom element data the first time
// that we try to enqueue a callback.
elementData = new CustomElementData(definition->mType);
// aCustomElement takes ownership of elementData
aCustomElement->SetCustomElementData(elementData);
MOZ_ASSERT(aType == nsIDocument::eCreated,
"First callback should be the created callback");
}
// Let CALLBACK be the callback associated with the key NAME in CALLBACKS.
CallbackFunction* func = nullptr;
switch (aType) {
@ -860,33 +868,41 @@ CustomElementRegistry::Upgrade(Element* aElement,
}
MOZ_ASSERT(aElement->IsHTMLElement(aDefinition->mLocalName));
nsWrapperCache* cache;
CallQueryInterface(aElement, &cache);
MOZ_ASSERT(cache, "Element doesn't support wrapper cache?");
AutoJSAPI jsapi;
if (NS_WARN_IF(!jsapi.Init(mWindow))) {
return;
}
JSContext *cx = jsapi.cx();
// We want to set the custom prototype in the the compartment of define()'s caller.
// We store the prototype from define() directly,
// hence the prototype's compartment is the caller's compartment.
JS::RootedObject wrapper(cx);
JS::Rooted<JSObject*> prototype(cx, aDefinition->mPrototype);
{ // Enter prototype's compartment.
JSAutoCompartment ac(cx, prototype);
JSContext* cx = jsapi.cx();
if ((wrapper = cache->GetWrapper()) && JS_WrapObject(cx, &wrapper)) {
if (!JS_SetPrototype(cx, wrapper, prototype)) {
JS::Rooted<JSObject*> reflector(cx, aElement->GetWrapper());
if (reflector) {
Maybe<JSAutoCompartment> ac;
JS::Rooted<JSObject*> prototype(cx, aDefinition->mPrototype);
if (aElement->NodePrincipal()->SubsumesConsideringDomain(nsContentUtils::ObjectPrincipal(prototype))) {
ac.emplace(cx, reflector);
if (!JS_WrapObject(cx, &prototype) ||
!JS_SetPrototype(cx, reflector, prototype)) {
return;
}
} else {
// We want to set the custom prototype in the compartment where it was
// registered. We store the prototype from define() without unwrapped,
// hence the prototype's compartment is the compartment where it was
// registered.
// In the case that |reflector| and |prototype| are in different
// compartments, this will set the prototype on the |reflector|'s wrapper
// and thus only visible in the wrapper's compartment, since we know
// reflector's principal does not subsume prototype's in this case.
ac.emplace(cx, prototype);
if (!JS_WrapObject(cx, &reflector) ||
!JS_SetPrototype(cx, reflector, prototype)) {
return;
}
}
} // Leave prototype's compartment.
}
// Enqueuing the created callback will set the CustomElementData on the
// element, causing prototype swizzling to occur in Element::WrapObject.
EnqueueLifecycleCallback(nsIDocument::eCreated, aElement, nullptr, aDefinition);
}

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

@ -72,7 +72,18 @@ struct CustomElementData
{
NS_INLINE_DECL_REFCOUNTING(CustomElementData)
// https://dom.spec.whatwg.org/#concept-element-custom-element-state
// CustomElementData is only created on the element which is a custom element
// or an upgrade candidate, so the state of an element without
// CustomElementData is "uncustomized".
enum class State {
eUndefined,
eFailed,
eCustom
};
explicit CustomElementData(nsIAtom* aType);
CustomElementData(nsIAtom* aType, State aState);
// Objects in this array are transient and empty after each microtask
// checkpoint.
nsTArray<nsAutoPtr<CustomElementCallback>> mCallbackQueue;
@ -90,6 +101,8 @@ struct CustomElementData
// it is used to determine if a new queue needs to be pushed onto the
// processing stack.
int32_t mAssociatedMicroTask;
// Custom element state as described in the custom element spec.
State mState;
// Empties the callback queue.
void RunCallbackQueue();

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

@ -283,23 +283,33 @@ Location::SetURI(nsIURI* aURI, bool aReplace)
return NS_OK;
}
NS_IMETHODIMP
Location::GetHash(nsAString& aHash)
void
Location::GetHash(nsAString& aHash,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aHash.SetLength(0);
nsCOMPtr<nsIURI> uri;
nsresult rv = GetURI(getter_AddRefs(uri));
if (NS_FAILED(rv) || !uri) {
return rv;
aRv = GetURI(getter_AddRefs(uri));
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
nsAutoCString ref;
nsAutoString unicodeRef;
rv = uri->GetRef(ref);
aRv = uri->GetRef(ref);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) {
if (!ref.IsEmpty()) {
aHash.Assign(char16_t('#'));
AppendUTF8toUTF16(ref, aHash);
}
@ -312,29 +322,42 @@ Location::GetHash(nsAString& aHash)
} else {
mCachedHash = aHash;
}
return rv;
}
NS_IMETHODIMP
Location::SetHash(const nsAString& aHash)
void
Location::SetHash(const nsAString& aHash,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
NS_ConvertUTF16toUTF8 hash(aHash);
if (hash.IsEmpty() || hash.First() != char16_t('#')) {
hash.Insert(char16_t('#'), 0);
}
nsCOMPtr<nsIURI> uri;
nsresult rv = GetWritableURI(getter_AddRefs(uri), &hash);
if (NS_FAILED(rv) || !uri) {
return rv;
aRv = GetWritableURI(getter_AddRefs(uri), &hash);
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
return SetURI(uri);
aRv = SetURI(uri);
}
NS_IMETHODIMP
Location::GetHost(nsAString& aHost)
void
Location::GetHost(nsAString& aHost,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aHost.Truncate();
nsCOMPtr<nsIURI> uri;
@ -351,30 +374,42 @@ Location::GetHost(nsAString& aHost)
AppendUTF8toUTF16(hostport, aHost);
}
}
return NS_OK;
}
NS_IMETHODIMP
Location::SetHost(const nsAString& aHost)
void
Location::SetHost(const nsAString& aHost,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
nsCOMPtr<nsIURI> uri;
nsresult rv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(NS_FAILED(rv) || !uri)) {
return rv;
aRv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
rv = uri->SetHostPort(NS_ConvertUTF16toUTF8(aHost));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
aRv = uri->SetHostPort(NS_ConvertUTF16toUTF8(aHost));
if (NS_WARN_IF(aRv.Failed())) {
return;
}
return SetURI(uri);
aRv = SetURI(uri);
}
NS_IMETHODIMP
Location::GetHostname(nsAString& aHostname)
void
Location::GetHostname(nsAString& aHostname,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aHostname.Truncate();
nsCOMPtr<nsIURI> uri;
@ -382,79 +417,85 @@ Location::GetHostname(nsAString& aHostname)
if (uri) {
nsContentUtils::GetHostOrIPv6WithBrackets(uri, aHostname);
}
return NS_OK;
}
NS_IMETHODIMP
Location::SetHostname(const nsAString& aHostname)
void
Location::SetHostname(const nsAString& aHostname,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
nsCOMPtr<nsIURI> uri;
nsresult rv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(NS_FAILED(rv) || !uri)) {
return rv;
aRv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
rv = uri->SetHost(NS_ConvertUTF16toUTF8(aHostname));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
aRv = uri->SetHost(NS_ConvertUTF16toUTF8(aHostname));
if (NS_WARN_IF(aRv.Failed())) {
return;
}
return SetURI(uri);
aRv = SetURI(uri);
}
NS_IMETHODIMP
nsresult
Location::GetHref(nsAString& aHref)
{
aHref.Truncate();
nsCOMPtr<nsIURI> uri;
nsresult result;
result = GetURI(getter_AddRefs(uri));
if (uri) {
nsAutoCString uriString;
result = uri->GetSpec(uriString);
if (NS_SUCCEEDED(result)) {
AppendUTF8toUTF16(uriString, aHref);
}
nsresult rv = GetURI(getter_AddRefs(uri));
if (NS_WARN_IF(NS_FAILED(rv)) || !uri) {
return rv;
}
return result;
nsAutoCString uriString;
rv = uri->GetSpec(uriString);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
AppendUTF8toUTF16(uriString, aHref);
return NS_OK;
}
NS_IMETHODIMP
Location::SetHref(const nsAString& aHref)
void
Location::SetHref(const nsAString& aHref,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
nsAutoString oldHref;
nsresult rv = NS_OK;
JSContext *cx = nsContentUtils::GetCurrentJSContext();
if (cx) {
rv = SetHrefWithContext(cx, aHref, false);
} else {
rv = GetHref(oldHref);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIURI> oldUri;
rv = NS_NewURI(getter_AddRefs(oldUri), oldHref);
if (oldUri) {
rv = SetHrefWithBase(aHref, oldUri, false);
}
}
aRv = SetHrefWithContext(cx, aHref, false);
return;
}
return rv;
nsAutoString oldHref;
aRv = GetHref(oldHref);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
nsCOMPtr<nsIURI> oldUri;
aRv = NS_NewURI(getter_AddRefs(oldUri), oldHref);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
aRv = SetHrefWithBase(aHref, oldUri, false);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
}
nsresult
Location::SetHrefWithContext(JSContext* cx, const nsAString& aHref,
bool aReplace)
bool aReplace)
{
nsCOMPtr<nsIURI> base;
@ -470,7 +511,7 @@ Location::SetHrefWithContext(JSContext* cx, const nsAString& aHref,
nsresult
Location::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
bool aReplace)
bool aReplace)
{
nsresult result;
nsCOMPtr<nsIURI> newUri;
@ -486,13 +527,12 @@ Location::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
if (newUri) {
/* Check with the scriptContext if it is currently processing a script tag.
* If so, this must be a <script> tag with a location.href in it.
* we want to do a replace load, in such a situation.
* we want to do a replace load, in such a situation.
* In other cases, for example if a event handler or a JS timer
* had a location.href in it, we want to do a normal load,
* so that the new url will be appended to Session History.
* This solution is tricky. Hopefully it isn't going to bite
* anywhere else. This is part of solution for bug # 39938, 72197
*
*/
bool inScriptTag = false;
nsIScriptContext* scriptContext = nullptr;
@ -518,96 +558,125 @@ Location::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
return result;
}
NS_IMETHODIMP
Location::GetOrigin(nsAString& aOrigin)
void
Location::GetOrigin(nsAString& aOrigin,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aOrigin.Truncate();
nsCOMPtr<nsIURI> uri;
nsresult rv = GetURI(getter_AddRefs(uri), true);
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(uri, NS_OK);
aRv = GetURI(getter_AddRefs(uri), true);
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
nsAutoString origin;
rv = nsContentUtils::GetUTFOrigin(uri, origin);
NS_ENSURE_SUCCESS(rv, rv);
aRv = nsContentUtils::GetUTFOrigin(uri, origin);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
aOrigin = origin;
return NS_OK;
}
NS_IMETHODIMP
Location::GetPathname(nsAString& aPathname)
void
Location::GetPathname(nsAString& aPathname,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aPathname.Truncate();
nsCOMPtr<nsIURI> uri;
nsresult result = GetURI(getter_AddRefs(uri));
if (NS_FAILED(result) || !uri) {
return result;
aRv = GetURI(getter_AddRefs(uri));
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
nsAutoCString file;
result = uri->GetFilePath(file);
if (NS_SUCCEEDED(result)) {
AppendUTF8toUTF16(file, aPathname);
aRv = uri->GetFilePath(file);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
return result;
AppendUTF8toUTF16(file, aPathname);
}
NS_IMETHODIMP
Location::SetPathname(const nsAString& aPathname)
void
Location::SetPathname(const nsAString& aPathname,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
nsCOMPtr<nsIURI> uri;
nsresult rv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(NS_FAILED(rv) || !uri)) {
return rv;
aRv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
if (NS_SUCCEEDED(uri->SetFilePath(NS_ConvertUTF16toUTF8(aPathname)))) {
return SetURI(uri);
aRv = SetURI(uri);
}
return NS_OK;
}
NS_IMETHODIMP
Location::GetPort(nsAString& aPort)
void
Location::GetPort(nsAString& aPort,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aPort.SetLength(0);
nsCOMPtr<nsIURI> uri;
nsresult result = NS_OK;
result = GetURI(getter_AddRefs(uri), true);
if (uri) {
int32_t port;
result = uri->GetPort(&port);
if (NS_SUCCEEDED(result) && -1 != port) {
nsAutoString portStr;
portStr.AppendInt(port);
aPort.Append(portStr);
}
// Don't propagate this exception to caller
result = NS_OK;
aRv = GetURI(getter_AddRefs(uri), true);
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
return result;
int32_t port;
nsresult result = uri->GetPort(&port);
// Don't propagate this exception to caller
if (NS_SUCCEEDED(result) && -1 != port) {
nsAutoString portStr;
portStr.AppendInt(port);
aPort.Append(portStr);
}
}
NS_IMETHODIMP
Location::SetPort(const nsAString& aPort)
void
Location::SetPort(const nsAString& aPort,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
nsCOMPtr<nsIURI> uri;
nsresult rv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(NS_FAILED(rv) || !uri)) {
return rv;
aRv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(aRv.Failed() || !uri)) {
return;
}
// perhaps use nsReadingIterators at some point?
@ -624,45 +693,57 @@ Location::SetPort(const nsAString& aPort)
}
}
rv = uri->SetPort(port);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
aRv = uri->SetPort(port);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
return SetURI(uri);
aRv = SetURI(uri);
}
NS_IMETHODIMP
Location::GetProtocol(nsAString& aProtocol)
void
Location::GetProtocol(nsAString& aProtocol,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aProtocol.SetLength(0);
nsCOMPtr<nsIURI> uri;
nsresult result = NS_OK;
result = GetURI(getter_AddRefs(uri));
if (uri) {
nsAutoCString protocol;
result = uri->GetScheme(protocol);
if (NS_SUCCEEDED(result)) {
CopyASCIItoUTF16(protocol, aProtocol);
aProtocol.Append(char16_t(':'));
}
aRv = GetURI(getter_AddRefs(uri));
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
return result;
nsAutoCString protocol;
aRv = uri->GetScheme(protocol);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
CopyASCIItoUTF16(protocol, aProtocol);
aProtocol.Append(char16_t(':'));
}
NS_IMETHODIMP
Location::SetProtocol(const nsAString& aProtocol)
void
Location::SetProtocol(const nsAString& aProtocol,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
nsCOMPtr<nsIURI> uri;
nsresult rv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(NS_FAILED(rv) || !uri)) {
return rv;
aRv = GetWritableURI(getter_AddRefs(uri));
if (NS_WARN_IF(aRv.Failed()) || !uri) {
return;
}
nsAString::const_iterator start, end;
@ -671,16 +752,18 @@ Location::SetProtocol(const nsAString& aProtocol)
nsAString::const_iterator iter(start);
Unused << FindCharInReadable(':', iter, end);
rv = uri->SetScheme(NS_ConvertUTF16toUTF8(Substring(start, iter)));
nsresult rv = uri->SetScheme(NS_ConvertUTF16toUTF8(Substring(start, iter)));
if (NS_WARN_IF(NS_FAILED(rv))) {
// Oh, I wish nsStandardURL returned NS_ERROR_MALFORMED_URI for _all_ the
// malformed cases, not just some of them!
return NS_ERROR_DOM_SYNTAX_ERR;
aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
return;
}
nsAutoCString newSpec;
rv = uri->GetSpec(newSpec);
if (NS_FAILED(rv)) {
return rv;
aRv = uri->GetSpec(newSpec);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
// We may want a new URI class for the new URI, so recreate it:
rv = NS_NewURI(getter_AddRefs(uri), newSpec);
@ -688,32 +771,41 @@ Location::SetProtocol(const nsAString& aProtocol)
if (rv == NS_ERROR_MALFORMED_URI) {
rv = NS_ERROR_DOM_SYNTAX_ERR;
}
return rv;
aRv.Throw(rv);
return;
}
bool isHttp;
rv = uri->SchemeIs("http", &isHttp);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
aRv = uri->SchemeIs("http", &isHttp);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
bool isHttps;
rv = uri->SchemeIs("https", &isHttps);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
aRv = uri->SchemeIs("https", &isHttps);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
if (!isHttp && !isHttps) {
// No-op, per spec.
return NS_OK;
return;
}
return SetURI(uri);
aRv = SetURI(uri);
}
NS_IMETHODIMP
Location::GetSearch(nsAString& aSearch)
void
Location::GetSearch(nsAString& aSearch,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aSearch.SetLength(0);
nsCOMPtr<nsIURI> uri;
@ -733,44 +825,36 @@ Location::GetSearch(nsAString& aSearch)
AppendUTF8toUTF16(search, aSearch);
}
}
return NS_OK;
}
NS_IMETHODIMP
Location::SetSearch(const nsAString& aSearch)
void
Location::SetSearch(const nsAString& aSearch,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
nsresult rv = SetSearchInternal(aSearch);
if (NS_FAILED(rv)) {
return rv;
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
return NS_OK;
nsCOMPtr<nsIURI> uri;
aRv = GetWritableURI(getter_AddRefs(uri));
nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
if (NS_WARN_IF(aRv.Failed()) || !url) {
return;
}
aRv = url->SetQuery(NS_ConvertUTF16toUTF8(aSearch));
if (NS_WARN_IF(aRv.Failed())) {
return;
}
aRv = SetURI(uri);
}
nsresult
Location::SetSearchInternal(const nsAString& aSearch)
{
nsCOMPtr<nsIURI> uri;
nsresult rv = GetWritableURI(getter_AddRefs(uri));
nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
if (NS_WARN_IF(NS_FAILED(rv) || !url)) {
return rv;
}
rv = url->SetQuery(NS_ConvertUTF16toUTF8(aSearch));
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return SetURI(uri);
}
NS_IMETHODIMP
Location::Reload(bool aForceget)
{
nsresult rv;
nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mDocShell));
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(docShell));
nsCOMPtr<nsPIDOMWindowOuter> window = docShell ? docShell->GetWindow()
@ -795,85 +879,84 @@ Location::Reload(bool aForceget)
return NS_OK;
}
if (webNav) {
uint32_t reloadFlags = nsIWebNavigation::LOAD_FLAGS_NONE;
if (!webNav) {
return NS_ERROR_FAILURE;
}
if (aForceget) {
reloadFlags = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE |
nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY;
}
rv = webNav->Reload(reloadFlags);
if (rv == NS_BINDING_ABORTED) {
// This happens when we attempt to reload a POST result and the user says
// no at the "do you want to reload?" prompt. Don't propagate this one
// back to callers.
rv = NS_OK;
}
} else {
rv = NS_ERROR_FAILURE;
uint32_t reloadFlags = nsIWebNavigation::LOAD_FLAGS_NONE;
if (aForceget) {
reloadFlags = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE |
nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY;
}
nsresult rv = webNav->Reload(reloadFlags);
if (rv == NS_BINDING_ABORTED) {
// This happens when we attempt to reload a POST result and the user says
// no at the "do you want to reload?" prompt. Don't propagate this one
// back to callers.
rv = NS_OK;
}
return rv;
}
NS_IMETHODIMP
Location::Replace(const nsAString& aUrl)
void
Location::Replace(const nsAString& aUrl,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
nsresult rv = NS_OK;
if (JSContext *cx = nsContentUtils::GetCurrentJSContext()) {
return SetHrefWithContext(cx, aUrl, true);
aRv = SetHrefWithContext(cx, aUrl, true);
return;
}
nsAutoString oldHref;
rv = GetHref(oldHref);
NS_ENSURE_SUCCESS(rv, rv);
aRv = GetHref(oldHref);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
nsCOMPtr<nsIURI> oldUri;
rv = NS_NewURI(getter_AddRefs(oldUri), oldHref);
NS_ENSURE_SUCCESS(rv, rv);
aRv = NS_NewURI(getter_AddRefs(oldUri), oldHref);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
return SetHrefWithBase(aUrl, oldUri, true);
aRv = SetHrefWithBase(aUrl, oldUri, true);
}
NS_IMETHODIMP
Location::Assign(const nsAString& aUrl)
void
Location::Assign(const nsAString& aUrl,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aRv)
{
if (!CallerSubsumes(&aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
if (JSContext *cx = nsContentUtils::GetCurrentJSContext()) {
return SetHrefWithContext(cx, aUrl, false);
aRv = SetHrefWithContext(cx, aUrl, false);
return;
}
nsAutoString oldHref;
nsresult result = NS_OK;
result = GetHref(oldHref);
if (NS_SUCCEEDED(result)) {
nsCOMPtr<nsIURI> oldUri;
result = NS_NewURI(getter_AddRefs(oldUri), oldHref);
if (oldUri) {
result = SetHrefWithBase(aUrl, oldUri, false);
}
aRv = GetHref(oldHref);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
return result;
}
nsCOMPtr<nsIURI> oldUri;
aRv = NS_NewURI(getter_AddRefs(oldUri), oldHref);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
NS_IMETHODIMP
Location::ToString(nsAString& aReturn)
{
return GetHref(aReturn);
}
NS_IMETHODIMP
Location::ValueOf(nsIDOMLocation** aReturn)
{
nsCOMPtr<nsIDOMLocation> loc(this);
loc.forget(aReturn);
return NS_OK;
if (oldUri) {
aRv = SetHrefWithBase(aUrl, oldUri, false);
}
}
nsresult

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

@ -37,37 +37,24 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Location,
nsIDOMLocation)
// nsIDOMLocation
NS_DECL_NSIDOMLOCATION
#define THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME() { \
if (!CallerSubsumes(&aSubjectPrincipal)) { \
aError.Throw(NS_ERROR_DOM_SECURITY_ERR); \
return; \
} \
}
// WebIDL API:
void Assign(const nsAString& aUrl,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = Assign(aUrl);
}
ErrorResult& aError);
void Replace(const nsAString& aUrl,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
aError = Replace(aUrl);
}
ErrorResult& aError);
void Reload(bool aForceget,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
if (!CallerSubsumes(&aSubjectPrincipal)) {
aError.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aError = Reload(aForceget);
}
@ -75,136 +62,77 @@ public:
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
if (!CallerSubsumes(&aSubjectPrincipal)) {
aError.Throw(NS_ERROR_DOM_SECURITY_ERR);
return;
}
aError = GetHref(aHref);
}
void SetHref(const nsAString& aHref,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
aError = SetHref(aHref);
}
ErrorResult& aError);
void GetOrigin(nsAString& aOrigin,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = GetOrigin(aOrigin);
}
ErrorResult& aError);
void GetProtocol(nsAString& aProtocol,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = GetProtocol(aProtocol);
}
ErrorResult& aError);
void SetProtocol(const nsAString& aProtocol,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = SetProtocol(aProtocol);
}
ErrorResult& aError);
void GetHost(nsAString& aHost,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = GetHost(aHost);
}
ErrorResult& aError);
void SetHost(const nsAString& aHost,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = SetHost(aHost);
}
ErrorResult& aError);
void GetHostname(nsAString& aHostname,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = GetHostname(aHostname);
}
ErrorResult& aError);
void SetHostname(const nsAString& aHostname,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = SetHostname(aHostname);
}
ErrorResult& aError);
void GetPort(nsAString& aPort,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = GetPort(aPort);
}
ErrorResult& aError);
void SetPort(const nsAString& aPort,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = SetPort(aPort);
}
ErrorResult& aError);
void GetPathname(nsAString& aPathname,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = GetPathname(aPathname);
}
ErrorResult& aError);
void SetPathname(const nsAString& aPathname,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = SetPathname(aPathname);
}
ErrorResult& aError);
void GetSearch(nsAString& aSeach,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = GetSearch(aSeach);
}
ErrorResult& aError);
void SetSearch(const nsAString& aSeach,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = SetSearch(aSeach);
}
ErrorResult& aError);
void GetHash(nsAString& aHash,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = GetHash(aHash);
}
ErrorResult& aError);
void SetHash(const nsAString& aHash,
nsIPrincipal& aSubjectPrincipal,
ErrorResult& aError)
{
THROW_AND_RETURN_IF_CALLER_DOESNT_SUBSUME();
aError = SetHash(aHash);
}
ErrorResult& aError);
void Stringify(nsAString& aRetval,
nsIPrincipal& aSubjectPrincipal,
@ -222,11 +150,20 @@ public:
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
// Non WebIDL methods:
nsresult GetHref(nsAString& aHref);
nsresult ToString(nsAString& aString)
{
return GetHref(aString);
}
nsresult Reload(bool aForceget);
protected:
virtual ~Location();
nsresult SetSearchInternal(const nsAString& aSearch);
// In the case of jar: uris, we sometimes want the place the jar was
// fetched from as the URI instead of the jar: uri itself. Pass in
// true for aGetInnermostURI when that's the case.

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

@ -5745,12 +5745,10 @@ nsDocument::CreateElement(const nsAString& aTagName,
if (aOptions.IsElementCreationOptions()) {
const ElementCreationOptions& options =
aOptions.GetAsElementCreationOptions();
// Throw NotFoundError if 'is' is not-null and definition is null
is = CheckCustomElementName(options,
needsLowercase ? lcTagName : aTagName,
mDefaultElementType, rv);
if (rv.Failed()) {
return nullptr;
if (CustomElementRegistry::IsCustomElementEnabled() &&
options.mIs.WasPassed()) {
is = &options.mIs.Value();
}
// Check 'pseudo' and throw an exception if it's not one allowed
@ -5809,12 +5807,11 @@ nsDocument::CreateElementNS(const nsAString& aNamespaceURI,
}
const nsString* is = nullptr;
if (aOptions.IsElementCreationOptions()) {
// Throw NotFoundError if 'is' is not-null and definition is null
is = CheckCustomElementName(aOptions.GetAsElementCreationOptions(),
aQualifiedName, nodeInfo->NamespaceID(), rv);
if (rv.Failed()) {
return nullptr;
if (CustomElementRegistry::IsCustomElementEnabled() &&
aOptions.IsElementCreationOptions()) {
const ElementCreationOptions& options = aOptions.GetAsElementCreationOptions();
if (options.mIs.WasPassed()) {
is = &options.mIs.Value();
}
}
@ -13187,30 +13184,6 @@ nsIDocument::UpdateStyleBackendType()
#endif
}
const nsString*
nsDocument::CheckCustomElementName(const ElementCreationOptions& aOptions,
const nsAString& aLocalName,
uint32_t aNamespaceID,
ErrorResult& rv)
{
// only check aOptions if 'is' is passed and the webcomponents preference
// is enabled
if (!aOptions.mIs.WasPassed() ||
!CustomElementRegistry::IsCustomElementEnabled()) {
return nullptr;
}
const nsString* is = &aOptions.mIs.Value();
// Throw NotFoundError if 'is' is not-null and definition is null
if (!nsContentUtils::LookupCustomElementDefinition(this, aLocalName,
aNamespaceID, is)) {
rv.Throw(NS_ERROR_DOM_NOT_FOUND_ERR);
}
return is;
}
/**
* Helper function for |nsDocument::PrincipalFlashClassification|
*

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

@ -1463,20 +1463,6 @@ private:
void UpdatePossiblyStaleDocumentState();
static bool CustomElementConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp);
/**
* Check if the passed custom element name, aOptions.mIs, is a registered
* custom element type or not, then return the custom element name for future
* usage.
*
* If there is no existing custom element definition for this name, throw a
* NotFoundError.
*/
const nsString* CheckCustomElementName(
const mozilla::dom::ElementCreationOptions& aOptions,
const nsAString& aLocalName,
uint32_t aNamespaceID,
ErrorResult& rv);
public:
virtual already_AddRefed<mozilla::dom::CustomElementRegistry>
GetCustomElementRegistry() override;

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

@ -1507,9 +1507,6 @@ nsFrameLoader::SwapWithOtherRemoteLoader(nsFrameLoader* aOther,
ourShell->BackingScaleFactorChanged();
otherShell->BackingScaleFactorChanged();
ourDoc->FlushPendingNotifications(FlushType::Layout);
otherDoc->FlushPendingNotifications(FlushType::Layout);
// Initialize browser API if needed now that owner content has changed.
InitializeBrowserAPI();
aOther->InitializeBrowserAPI();
@ -1950,9 +1947,6 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
ourShell->BackingScaleFactorChanged();
otherShell->BackingScaleFactorChanged();
ourParentDocument->FlushPendingNotifications(FlushType::Layout);
otherParentDocument->FlushPendingNotifications(FlushType::Layout);
// Initialize browser API if needed now that owner content has changed
InitializeBrowserAPI();
aOther->InitializeBrowserAPI();

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

@ -107,6 +107,37 @@ GK_ATOM(applyImports, "apply-imports")
GK_ATOM(applyTemplates, "apply-templates")
GK_ATOM(archive, "archive")
GK_ATOM(area, "area")
GK_ATOM(aria_activedescendant, "aria-activedescendant")
GK_ATOM(aria_atomic, "aria-atomic")
GK_ATOM(aria_autocomplete, "aria-autocomplete")
GK_ATOM(aria_busy, "aria-busy")
GK_ATOM(aria_checked, "aria-checked")
GK_ATOM(aria_controls, "aria-controls")
GK_ATOM(aria_describedby, "aria-describedby")
GK_ATOM(aria_disabled, "aria-disabled")
GK_ATOM(aria_dropeffect, "aria-dropeffect")
GK_ATOM(aria_expanded, "aria-expanded")
GK_ATOM(aria_flowto, "aria-flowto")
GK_ATOM(aria_haspopup, "aria-haspopup")
GK_ATOM(aria_hidden, "aria-hidden")
GK_ATOM(aria_invalid, "aria-invalid")
GK_ATOM(aria_labelledby, "aria-labelledby")
GK_ATOM(aria_level, "aria-level")
GK_ATOM(aria_live, "aria-live")
GK_ATOM(aria_multiline, "aria-multiline")
GK_ATOM(aria_multiselectable, "aria-multiselectable")
GK_ATOM(aria_owns, "aria-owns")
GK_ATOM(aria_posinset, "aria-posinset")
GK_ATOM(aria_pressed, "aria-pressed")
GK_ATOM(aria_readonly, "aria-readonly")
GK_ATOM(aria_relevant, "aria-relevant")
GK_ATOM(aria_required, "aria-required")
GK_ATOM(aria_selected, "aria-selected")
GK_ATOM(aria_setsize, "aria-setsize")
GK_ATOM(aria_sort, "aria-sort")
GK_ATOM(aria_valuemax, "aria-valuemax")
GK_ATOM(aria_valuemin, "aria-valuemin")
GK_ATOM(aria_valuenow, "aria-valuenow")
GK_ATOM(arrow, "arrow")
GK_ATOM(article, "article")
GK_ATOM(ascending, "ascending")
@ -1218,6 +1249,7 @@ GK_ATOM(sub, "sub")
GK_ATOM(sum, "sum")
GK_ATOM(sup, "sup")
GK_ATOM(summary, "summary")
GK_ATOM(_switch, "switch")
GK_ATOM(systemProperty, "system-property")
GK_ATOM(tab, "tab")
GK_ATOM(tabbox, "tabbox")
@ -2242,47 +2274,16 @@ GK_ATOM(restore, "restore")
GK_ATOM(alert, "alert")
GK_ATOM(alertdialog, "alertdialog")
GK_ATOM(application, "application")
GK_ATOM(aria_activedescendant, "aria-activedescendant")
GK_ATOM(aria_atomic, "aria-atomic")
GK_ATOM(aria_autocomplete, "aria-autocomplete")
GK_ATOM(aria_busy, "aria-busy")
GK_ATOM(aria_checked, "aria-checked")
GK_ATOM(aria_colcount, "aria-colcount")
GK_ATOM(aria_colindex, "aria-colindex")
GK_ATOM(aria_controls, "aria-controls")
GK_ATOM(aria_describedby, "aria-describedby")
GK_ATOM(aria_details, "aria-details")
GK_ATOM(aria_disabled, "aria-disabled")
GK_ATOM(aria_dropeffect, "aria-dropeffect")
GK_ATOM(aria_errormessage, "aria-errormessage")
GK_ATOM(aria_expanded, "aria-expanded")
GK_ATOM(aria_flowto, "aria-flowto")
GK_ATOM(aria_grabbed, "aria-grabbed")
GK_ATOM(aria_haspopup, "aria-haspopup")
GK_ATOM(aria_hidden, "aria-hidden")
GK_ATOM(aria_invalid, "aria-invalid")
GK_ATOM(aria_label, "aria-label")
GK_ATOM(aria_labelledby, "aria-labelledby")
GK_ATOM(aria_level, "aria-level")
GK_ATOM(aria_live, "aria-live")
GK_ATOM(aria_modal, "aria-modal")
GK_ATOM(aria_multiline, "aria-multiline")
GK_ATOM(aria_multiselectable, "aria-multiselectable")
GK_ATOM(aria_orientation, "aria-orientation")
GK_ATOM(aria_owns, "aria-owns")
GK_ATOM(aria_posinset, "aria-posinset")
GK_ATOM(aria_pressed, "aria-pressed")
GK_ATOM(aria_readonly, "aria-readonly")
GK_ATOM(aria_relevant, "aria-relevant")
GK_ATOM(aria_required, "aria-required")
GK_ATOM(aria_rowcount, "aria-rowcount")
GK_ATOM(aria_rowindex, "aria-rowindex")
GK_ATOM(aria_selected, "aria-selected")
GK_ATOM(aria_setsize, "aria-setsize")
GK_ATOM(aria_sort, "aria-sort")
GK_ATOM(aria_valuenow, "aria-valuenow")
GK_ATOM(aria_valuemin, "aria-valuemin")
GK_ATOM(aria_valuemax, "aria-valuemax")
GK_ATOM(aria_valuetext, "aria-valuetext")
GK_ATOM(auto_generated, "auto-generated")
GK_ATOM(banner, "banner")
@ -2330,7 +2331,6 @@ GK_ATOM(setsize, "setsize")
GK_ATOM(spelling, "spelling")
GK_ATOM(spinbutton, "spinbutton")
GK_ATOM(status, "status")
GK_ATOM(_switch, "switch")
GK_ATOM(tableCellIndex, "table-cell-index")
GK_ATOM(tablist, "tablist")
GK_ATOM(textIndent, "text-indent")

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

@ -1740,8 +1740,7 @@ void
InterSliceGCTimerFired(nsITimer *aTimer, void *aClosure)
{
nsJSContext::KillInterSliceGCTimer();
bool e10sParent = XRE_IsParentProcess() && BrowserTabsRemoteAutostart();
int64_t budget = e10sParent && nsContentUtils::GetUserIsInteracting() && sActiveIntersliceGCBudget ?
int64_t budget = XRE_IsE10sParentProcess() && nsContentUtils::GetUserIsInteracting() && sActiveIntersliceGCBudget ?
sActiveIntersliceGCBudget : NS_INTERSLICE_GC_BUDGET;
nsJSContext::GarbageCollectNow(JS::gcreason::INTER_SLICE_GC,
nsJSContext::IncrementalGC,

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

@ -0,0 +1 @@
<svg xmlns='http://www.w3.org/2000/svg' onload='parent.ran[2]=true'/>

После

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

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

@ -0,0 +1 @@
<html></html>

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

@ -0,0 +1 @@
<html><meta charset="UTF-8"></html>

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

@ -0,0 +1 @@
<html><meta charset="ISO-8859-1"></html>

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

@ -0,0 +1 @@
<html></html>

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

@ -0,0 +1 @@
<?xml version='1.0'?><html></html>

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

@ -0,0 +1 @@
<?xml version='1.0' encoding='UTF-8'?><html></html>

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

@ -0,0 +1 @@
<?xml version='1.0' encoding='ISO-8859-1'?><html></html>

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

@ -227,6 +227,16 @@ support-files =
intersectionobserver_iframe.html
intersectionobserver_cross_domain_iframe.html
intersectionobserver_window.html
object_bug353334.html
embed_bug455472.html
object_bug455472.html
iframe1_bug431701.html
iframe2_bug431701.html
iframe3_bug431701.html
iframe4_bug431701.xml
iframe5_bug431701.xml
iframe6_bug431701.xml
iframe7_bug431701.xml
[test_anchor_area_referrer.html]
[test_anchor_area_referrer_changing.html]

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

@ -0,0 +1 @@
<body>test</body>

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

@ -0,0 +1 @@
<script>parent.ran[1]=true</script>

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

@ -14,8 +14,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=353334
<p id="display">
<iframe id="one"></iframe>
<object id="two" data="about:blank"></object>
<iframe id="three" src="data:text/html,<body>test</body>"></iframe>
<object id="four" data="data:text/html,<body>test</body>"></object>
<iframe id="three" srcdoc="<body>test</body>"></iframe>
<object id="four" data="object_bug353334.html"></object>
<iframe id="five" src="javascript:parent.x"></iframe>
<object id="six" data="javascript:x"></object>
</p>

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

@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=358660
<p id="display"></p>
<div id="content" style="display: none">
<iframe id="testframe"
src="data:text/html,<html><body>Some text</body></html>"></iframe>
srcdoc="<html><body>Some text</body></html>"></iframe>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">

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

@ -52,7 +52,7 @@ addLoadEvent(runTest);
</script>
</pre>
<iframe src="data:text/html,<script>function listener() { ++parent.eventCount; } </script>">
<iframe srcdoc="<script>function listener() { ++parent.eventCount; } </script>"></iframe>
</body>
</html>

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

@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=401662
<p id="display"></p>
<div id="content" style="display: none">
<iframe id="testframe"
src="data:text/html,<html><body>foo<style>bar</style></body></html>">
srcdoc="<html><body>foo<style>bar</style></body></html>">
</iframe>
</div>
<pre id="test">

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

@ -28,13 +28,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=431701
SimpleTest.waitForExplicitFinish();
var docSources = [
"data:text/html,<html></html>",
"data:text/html;charset=UTF-8,<html></html>",
"data:text/html;charset=ISO-8859-1,<html></html>",
"data:text/xml,<html></html>",
"data:text/xml,<?xml version='1.0'?><html></html>",
"data:text/xml,<?xml version='1.0' encoding='UTF-8'?><html></html>",
"data:text/xml,<?xml version='1.0' encoding='ISO-8859-1'?><html></html>",
"iframe1_bug431701.html",
"iframe2_bug431701.html",
"iframe3_bug431701.html",
"iframe4_bug431701.xml",
"iframe5_bug431701.xml",
"iframe6_bug431701.xml",
"iframe7_bug431701.xml",
];
for (var i = 0; i < docSources.length; ++i) {

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

@ -19,9 +19,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=431833
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=431833">Mozilla Bug 431833</a>
<p id="display">
<iframe id="f1" src="data:text/html,1"></iframe>
<iframe id="f2" src="data:text/html,2"></iframe>
<iframe id="f3" src="data:text/html,<iframe id='f4' src='data:text/html,3'></iframe>"></iframe>
<iframe id="f1" srcdoc="1"></iframe>
<iframe id="f2" srcdoc="2"></iframe>
<iframe id="f3" srcdoc="<iframe id='f4' src='data:text/html,3'></iframe>"></iframe>
</p>
<div id="content" style="display: none">

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

@ -15,9 +15,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=455472
var ran = [ false, false, false, false, false ];
</script>
<div id="content" style="display: none">
<iframe src="data:text/html,<script>parent.ran[0]=true</script>"></iframe>
<object type="text/html" data="data:text/html,<script>parent.ran[1]=true</script>"></object>
<embed type="image/svg+xml" src="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20onload='parent.ran[2]=true'/>">
<iframe srcdoc="<script>parent.ran[0]=true</script>"></iframe>
<object id="o1" type="text/html" data="object_bug455472.html"></object>
<embed type="image/svg+xml" src="embed_bug455472.html">
<object type="text/html" data="data:application/octet-stream,<script>parent.ran[3]=true</script>"></object>
<embed type="image/svg+xml" src="data:application/octet-stream,<svg%20xmlns='http://www.w3.org/2000/svg'%20onload='parent.ran[4]=true'/>">
</div>

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

@ -3542,6 +3542,9 @@ CreateHTMLElement(const GlobalObject& aGlobal, const JS::CallArgs& aCallArgs,
element = CreateHTMLElement(tag, nodeInfo.forget(), NOT_FROM_PARSER);
}
element->SetCustomElementData(
new CustomElementData(definition->mType, CustomElementData::State::eCustom));
return element.forget();
}

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

@ -46,8 +46,8 @@ addLoadEvent(SimpleTest.finish);
</script>
</pre>
<iframe id="i1" src="data:text/html,&lt;html&gt;&lt;body&gt;&lt;pre&gt;Foobar&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;"></iframe>
<iframe id="i2" src="data:text/html,&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;"></iframe>
<iframe id="i1" srcdoc="&lt;html&gt;&lt;body&gt;&lt;pre&gt;Foobar&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;"></iframe>
<iframe id="i2" srcdoc="&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;"></iframe>
</body>
</html>

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

@ -111,12 +111,18 @@ FileReader::FileReader(nsIGlobalObject* aGlobal,
, mReadyState(EMPTY)
, mTotal(0)
, mTransferred(0)
, mTarget(do_GetCurrentThread())
, mBusyCount(0)
, mWorkerPrivate(aWorkerPrivate)
{
MOZ_ASSERT(aGlobal);
MOZ_ASSERT(NS_IsMainThread() == !mWorkerPrivate);
if (NS_IsMainThread()) {
mTarget = aGlobal->EventTargetFor(TaskCategory::Other);
} else {
mTarget = do_GetCurrentThread();
}
SetDOMStringToNull(mResult);
}
@ -645,10 +651,10 @@ FileReader::OnInputStreamReady(nsIAsyncInputStream* aStream)
if (NS_SUCCEEDED(rv) && count) {
rv = DoReadData(count);
}
if (NS_SUCCEEDED(rv)) {
rv = DoAsyncWait();
if (NS_SUCCEEDED(rv)) {
rv = DoAsyncWait();
}
}
if (NS_FAILED(rv) || !count) {

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

@ -167,15 +167,24 @@ IPCBlobInputStreamChild::StreamNeeded(IPCBlobInputStream* aStream,
mozilla::ipc::IPCResult
IPCBlobInputStreamChild::RecvStreamReady(const OptionalIPCStream& aStream)
{
MOZ_ASSERT(!mPendingOperations.IsEmpty());
nsCOMPtr<nsIInputStream> stream = DeserializeIPCStream(aStream);
RefPtr<StreamReadyRunnable> runnable =
new StreamReadyRunnable(mPendingOperations[0].mStream, stream);
mPendingOperations[0].mEventTarget->Dispatch(runnable, NS_DISPATCH_NORMAL);
RefPtr<IPCBlobInputStream> pendingStream;
nsCOMPtr<nsIEventTarget> eventTarget;
mPendingOperations.RemoveElementAt(0);
{
MutexAutoLock lock(mMutex);
MOZ_ASSERT(!mPendingOperations.IsEmpty());
pendingStream = mPendingOperations[0].mStream;
eventTarget = mPendingOperations[0].mEventTarget;
mPendingOperations.RemoveElementAt(0);
}
RefPtr<StreamReadyRunnable> runnable =
new StreamReadyRunnable(pendingStream, stream);
eventTarget->Dispatch(runnable, NS_DISPATCH_NORMAL);
return IPC_OK();
}

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

@ -6,7 +6,17 @@ addMessageListener("file.open", function (e) {
.getService(Ci.nsIDirectoryService)
.QueryInterface(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);
testFile.append("prefs.js");
testFile.append("ipc_fileReader_testing");
testFile.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0o600);
var outStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate
0666, 0);
var fileData = "Hello World!";
outStream.write(fileData, fileData.length);
outStream.close();
File.createFromNsIFile(testFile).then(function(file) {
sendAsyncMessage("file.opened", { file });

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

@ -13,21 +13,74 @@ function workerScript() {
onmessage = function(event) {
let readerMemoryBlob = new FileReaderSync();
let status = readerMemoryBlob.readAsText(new Blob(['hello world'])) == 'hello world';
postMessage({ status, message: "FileReaderSync with memory blob still works" });
let readerIPCBlob = new FileReaderSync();
postMessage({ blob: event.data, data: readerIPCBlob.readAsText(event.data), status });
let readerIPCBlob1 = new FileReaderSync();
postMessage({ blob: event.data, method: 'readAsText',
data: readerIPCBlob1.readAsText(event.data)});
let readerIPCBlob2 = new FileReaderSync();
postMessage({ blob: event.data, method: 'readAsArrayBuffer',
data: readerIPCBlob2.readAsArrayBuffer(event.data)});
let readerIPCBlob3 = new FileReaderSync();
postMessage({ blob: event.data, method: 'readAsDataURL',
data: readerIPCBlob3.readAsDataURL(event.data)});
let multipartBlob = new Blob(['wow', event.data]);
let readerIPCBlobMultipart1 = new FileReaderSync();
postMessage({ blob: multipartBlob, method: 'readAsText',
data: readerIPCBlobMultipart1.readAsText(multipartBlob)});
let readerIPCBlobMultipart2 = new FileReaderSync();
postMessage({ blob: multipartBlob, method: 'readAsArrayBuffer',
data: readerIPCBlobMultipart2.readAsArrayBuffer(multipartBlob)});
let readerIPCBlobMultipart3 = new FileReaderSync();
postMessage({ blob: multipartBlob, method: 'readAsDataURL',
data: readerIPCBlobMultipart3.readAsDataURL(multipartBlob)});
postMessage({ finish: true });
}
}
let completed = false;
let pendingTasks = 0;
function maybeFinish() {
if (completed && !pendingTasks) {
SimpleTest.finish();
}
}
let workerUrl = URL.createObjectURL(new Blob(["(", workerScript.toSource(), ")()"]));
let worker = new Worker(workerUrl);
worker.onmessage = event => {
let fr = new FileReader();
fr.readAsText(event.data.blob);
fr.onload = () => {
is(event.data.data, fr.result, "The file has been read");
ok(event.data.status, "FileReaderSync with memory blob still works");
SimpleTest.finish();
if ("status" in event.data) {
ok(event.data.status, event.data.message);
return;
}
if ("blob" in event.data) {
let fr = new FileReader();
fr[event.data.method](event.data.blob);
++pendingTasks;
fr.onload = () => {
if (event.data.method != 'readAsArrayBuffer') {
is(event.data.data, fr.result, "The file has been read");
} else {
is(event.data.data.byteLength, fr.result.byteLength, "The file has been read");
}
--pendingTasks;
maybeFinish();
}
return;
}
if ("finish" in event.data) {
completed = true;
maybeFinish();
}
};

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

@ -17,6 +17,7 @@
#include "mozilla/LoadInfo.h"
#include "mozilla/ModuleUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/SystemGroup.h"
#include "nsClassHashtable.h"
#include "nsContentUtils.h"
#include "nsError.h"
@ -424,6 +425,7 @@ class BlobURLsReporter final : public nsIMemoryReporter
NS_IMPL_ISUPPORTS(BlobURLsReporter, nsIMemoryReporter)
class ReleasingTimerHolder final : public nsITimerCallback
, public nsINamed
{
public:
NS_DECL_ISUPPORTS
@ -439,6 +441,9 @@ public:
return;
}
MOZ_ALWAYS_SUCCEEDS(holder->mTimer->SetTarget(
SystemGroup::EventTargetFor(TaskCategory::Other)));
nsresult rv = holder->mTimer->InitWithCallback(holder, RELEASING_TIMER,
nsITimer::TYPE_ONE_SHOT);
NS_ENSURE_SUCCESS_VOID(rv);
@ -457,6 +462,20 @@ public:
return NS_OK;
}
NS_IMETHOD
GetName(nsACString& aName) override
{
aName.AssignLiteral("ReleasingTimerHolder");
return NS_OK;
}
NS_IMETHOD
SetName(const char* aName) override
{
MOZ_CRASH("The name shall never be set!");
return NS_OK;
}
private:
explicit ReleasingTimerHolder(nsTArray<nsWeakPtr>&& aArray)
: mURIs(aArray)
@ -469,7 +488,7 @@ private:
nsCOMPtr<nsITimer> mTimer;
};
NS_IMPL_ISUPPORTS(ReleasingTimerHolder, nsITimerCallback)
NS_IMPL_ISUPPORTS(ReleasingTimerHolder, nsITimerCallback, nsINamed)
} // namespace mozilla

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

@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=737851
<div id="content">
<iframe id="frame" width="800px" height="600px" src='data:text/html,
<iframe id="frame" width="800px" height="600px" srcdoc='
<html>
<body style="display:none;">

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

@ -36,7 +36,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=874640
["dom.forms.datetime", state[1] === 'true'],
["dom.forms.datetime.others", state[2] === 'true']]},
function() {
iframe.src = 'data:text/html,<script>' +
iframe.srcdoc = '<script>' +
'parent.is("valueAsDate" in document.createElement("input"), ' +
state[3] + ', "valueAsDate presence state should be ' + state[3] + '");' +
'<\/script>'

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

@ -187,6 +187,9 @@ support-files =
file_bug1166138_2x.png
file_bug1166138_def.png
script_fakepath.js
object_bug287465_o1.html
object_bug287465_o2.html
object_bug556645.html
[test_a_text.html]
[test_anchor_href_cache_invalidation.html]

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

@ -0,0 +1 @@
<svg xmlns='http://www.w3.org/2000/svg'></svg>

После

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

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

@ -0,0 +1 @@
<html></html>

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

@ -0,0 +1 @@
<body><button>Child</button></body>

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

@ -13,10 +13,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=287465
<p id="display"></p>
<div id="content" style="display:none">
<iframe id="i1" src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>"></iframe>
<object id="o1" data="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>"></object>
<iframe id="i2" src="data:text/html,<html></html>"></iframe>
<object id="o2" data="data:text/html,<html></html>"></object>
<iframe id="i1" srcdoc="<svg xmlns='http://www.w3.org/2000/svg'></svg>"></iframe>
<object id="o1" data="object_bug287465_o1.html"></object>
<iframe id="i2" srcdoc="<html></html>"></iframe>
<object id="o2" data="object_bug287465_o2.html"></object>
</div>
<pre id="test">

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

@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386496
<p id="display"></p>
<div id="content">
<iframe style='display: block;' id="testIframe"
src="data:text/html,<div><a id='a' href='http://a.invalid/'>Link</a></div>">
srcdoc="<div><a id='a' href='http://a.invalid/'>Link</a></div>">
</iframe>
</div>
<pre id="test">

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

@ -43,7 +43,7 @@ function runTest()
<button id="pbutton">Parent</button>
<object id="obj" type="text/html"
data="data:text/html,%3Cbody%3E%3Cbutton%3EChild%3C/button%3E%3C/body%3E"
data="object_bug556645.html"
width="200" height="200"></object>
</body>

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

@ -8,26 +8,5 @@
[scriptable, uuid(79de76e5-994e-4f6b-81aa-42d9adb6e67e)]
interface nsIDOMLocation : nsISupports
{
/**
* These properties refer to the current location of the document.
* This will correspond to the URI shown in the location bar, which
* can be different from the documentURI of the document.
*/
attribute DOMString hash;
attribute DOMString host;
attribute DOMString hostname;
attribute DOMString href;
attribute DOMString pathname;
attribute DOMString port;
attribute DOMString protocol;
attribute DOMString search;
readonly attribute DOMString origin;
void reload([optional] in boolean forceget);
void replace(in DOMString url);
void assign(in DOMString url);
DOMString toString();
nsIDOMLocation valueOf();
// Empty interface. Location is defined using WebIDL.
};

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

@ -1620,6 +1620,12 @@ public:
return NS_OK;
}
uint64_t
GetWindowID()
{
return mWindowID;
}
private:
MediaStreamConstraints mConstraints;
@ -3010,6 +3016,12 @@ MediaManager::Observe(nsISupports* aSubject, const char* aTopic,
return NS_OK;
}
nsTArray<nsString>* array;
if (!mCallIds.Get(task->GetWindowID(), &array)) {
return NS_OK;
}
array->RemoveElement(key);
if (aSubject) {
// A particular device or devices were chosen by the user.
// NOTE: does not allow setting a device to null; assumes nullptr
@ -3074,6 +3086,11 @@ MediaManager::Observe(nsISupports* aSubject, const char* aTopic,
mActiveCallbacks.Remove(key, getter_AddRefs(task));
if (task) {
task->Denied(errorMessage);
nsTArray<nsString>* array;
if (!mCallIds.Get(task->GetWindowID(), &array)) {
return NS_OK;
}
array->RemoveElement(key);
}
return NS_OK;

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

@ -1152,7 +1152,7 @@ tags = suspend
skip-if = toolkit == 'android' # bug 1346705
tags = suspend
[test_background_video_resume_after_end_show_last_frame.html]
skip-if = toolkit == 'android' # bug 1346705
skip-if = toolkit == 'android' || (os == "win" && debug) # bug 1346705, win bug 1360452
tags = suspend
[test_background_video_suspend.html]
skip-if = toolkit == 'android' # android(bug 1304480)

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

@ -1,7 +1,7 @@
<html>
<body>
Page 2 has an iframe of its own.
<iframe id='inner-iframe' onload='innerIframeLoaded()' src='data:text/html,
<iframe id='inner-iframe' onload='innerIframeLoaded()' srcdoc='
<html><body>
<script>function go() { window.location = "file_bug593174_1.html"; }</script>
</body></html>'>

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

@ -8,7 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1022869
<title>Test for Bug 1022869</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<iframe src="data:text/html,<html><body>"></iframe>
<iframe srcdoc="<html><body>"></iframe>
<script type="application/javascript">
var f = document.getElementsByTagName("iframe")[0];

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

@ -11,7 +11,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=335976
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=335976">Mozilla Bug 335976</a>
<p id="display"></p>
<iframe src="data:application/xhtml+xml,&lt;html xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;body&gt; &lt;textbox xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'/&gt; &lt;/body&gt;&lt;/html&gt;" style="width: 95%; height: 150px;"></iframe>
<iframe srcdoc="&lt;html xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;body&gt; &lt;textbox xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'/&gt; &lt;/body&gt;&lt;/html&gt;" style="width: 95%; height: 150px;"></iframe>
<div id="rootish" style="background: yellow">
<div>

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

@ -23,7 +23,7 @@ var sw;
var child_sw = -1;
function test(){
var t = '<div style="display: none;"><iframe onload="doChecks()" src="data:text/html,<body><scr'+'ipt>try {parent.child_sw=screen.width}catch(e){}</scr'+'ipt>"></iframe></div>';
var t = '<div style="display: none;"><iframe onload="doChecks()" srcdoc="<body><scr'+'ipt>try {parent.child_sw=screen.width}catch(e){}</scr'+'ipt>"></iframe></div>';
var div = document.createElement('div');
div.innerHTML = t;
document.getElementsByTagName('body')[0].appendChild(div);

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

@ -12,12 +12,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=42976
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=42976">Mozilla Bug 42976</a>
<p id="display"></p>
<div id="content">
<iframe id=specialtest src="data:text/html,<meta http-equiv='Content-Language' content='ja-JP'><base href='http://www.mozilla.org'><p>asdf"></iframe>;
<iframe id=htmlquirks src="data:text/html;charset=ISO-8859-2,<html><body><div></div></body></html>"></iframe>
<iframe id=htmlstd src="data:text/html;charset=ISO-8859-3,<!DOCTYPE html><html><body><div></div></body></html>"></iframe>
<iframe id=textplain src="data:text/plain;charset=ISO-8859-4,asdf%0Azxcv%0A"></iframe>
<iframe id=xhtmlstd src="data:application/xhtml+xml;charset=ISO-8859-5,<!DOCTYPE html><html xmlns='http://www.w3.org/1999/xhtml'><body><div></div></body></html>"></iframe>
<iframe id=xmlstd src="data:image/svg+xml;charset=ISO-8859-6,<svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width='300' height='300'><text x='60' y='150' fill='blue'>Hello, World!</text><text x='60' y='250' fill='blue'>Hello, World!</text></svg>"></iframe>
<iframe id=specialtest srcdoc="<meta http-equiv='Content-Language' content='ja-JP'><base href='http://www.mozilla.org'><p>asdf"></iframe>;
<iframe id=htmlquirks srcdoc="<html><meta charset=ISO-8859-2><body><div></div></body></html>"></iframe>
<iframe id=htmlstd srcdoc="<!DOCTYPE html><html><meta charset=ISO-8859-3><body><div></div></body></html>"></iframe>
<iframe id=textplain srcdoc="<meta charset=ISO-8859-4>asdf%0Azxcv%0A"></iframe>
<iframe id=xhtmlstd srcdoc="<!DOCTYPE html><html xmlns='http://www.w3.org/1999/xhtml'><meta charset=ISO-8859-5><body><div></div></body></html>"></iframe>
<iframe id=xmlstd srcdoc="<meta charset=ISO-8859-6><svg xmlns=&quot;http://www.w3.org/2000/svg&quot; width='300' height='300'><text x='60' y='150' fill='blue'>Hello, World!</text><text x='60' y='250' fill='blue'>Hello, World!</text></svg>"></iframe>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">

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

@ -27,7 +27,7 @@ function loaded() {
}
</script>
<iframe id="ifr" onload="loaded()" src="data:text/html,<script>navigator</script>"></iframe>
<iframe id="ifr" onload="loaded()" srcdoc="<script>navigator</script>"></iframe>
</pre>
</body>
</html>

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

@ -90,15 +90,15 @@ function checkElement(id, list, eps, doc) {
<!-- Root element; see d9 -->
<!-- Element in iframe -->
<iframe id="f1" style="position:absolute; left:300px; top:0; width:100px; height:200px; border:none"
src="data:text/html,<div id='d10' style='position:absolute; left:0; top:25px; width:100px; height:100px; background:cyan'>">
srcdoc="<div id='d10' style='position:absolute; left:0; top:25px; width:100px; height:100px; background:cyan'>">
</iframe>
<!-- Root element in iframe -->
<iframe id="f2" style="position:absolute; left:300px; top:250px; width:100px; height:200px; border:none"
src="data:text/html,<html id='d11' style='width:100px; height:100px; background:magenta'>">
srcdoc="<html id='d11' style='width:100px; height:100px; background:magenta'>">
</iframe>
<!-- Fixed-pos element in iframe -->
<iframe id="f3" style="position:absolute; left:300px; top:400px; border:none"
src="data:text/html,<div id='d12' style='position:fixed; left:0; top:0; width:100px; height:100px;'>"></iframe>
srcdoc="<div id='d12' style='position:fixed; left:0; top:0; width:100px; height:100px;'>"></iframe>
<script>
function doTest() {

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

@ -77,7 +77,7 @@
<!-- can't run this in the test document, since it potentially runs in a
scrolling="no" test harness iframe, and that causes a failure for some
reason -->
<iframe src="data:text/html,<body style='width: 100000px; height: 100000px;'><p>top</p></body>"
<iframe srcdoc="<body style='width: 100000px; height: 100000px;'><p>top</p></body>"
id="iframe"
onload="doTests();">
</iframe>

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

@ -119,6 +119,6 @@ SimpleTest.waitForExplicitFinish();
</head>
<body onload="startTest();">
<iframe id="testframe" src="data:text/html;charset=utf-8,"></iframe>
<iframe id="testframe" srcdoc="<meta charset=utf-8>"></iframe>
</body>
</html>

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

@ -226,6 +226,6 @@ SimpleTest.waitForExplicitFinish();
</head>
<body onload="startTest();">
<iframe id="testframe" src="data:text/html;charset=utf-8,"></iframe>
<iframe id="testframe" srcdoc="<meta charset=utf-8>"></iframe>
</body>
</html>

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

@ -103,52 +103,12 @@ function startTest() {
is(extendedButton.getAttribute("is"), "x-extended-button", "The |is| attribute of the created element should be the extended type.");
is(extendedButton.type, "submit", "Created element should be a button with type of \"submit\"");
// document.createElementNS with different namespace than definition.
try {
var svgButton = document.createElementNS("http://www.w3.org/2000/svg", "button", {is: "x-extended-button"});
ok(false, "An exception should've been thrown");
} catch(err) {
is(err.name, "NotFoundError", "A NotFoundError exception should've been thrown");
}
// document.createElementNS with no namespace.
try {
var noNamespaceButton = document.createElementNS("", "button", {is: "x-extended-button"});
ok(false, "An exception should've been thrown");
} catch(err) {
is(err.name, "NotFoundError", "A NotFoundError exception should've been thrown");
}
// document.createElement with non-existant extended type.
try {
var normalButton = document.createElement("button", {is: "x-non-existant"});
ok(false, "An exception should've been thrown");
} catch(err) {
is(err.name, "NotFoundError", "A NotFoundError exception should've been thrown");
}
// document.createElement with exteneded type that does not match with local name of element.
try {
var normalDiv = document.createElement("div", {is: "x-extended-button"});
ok(false, "An exception should've been thrown");
} catch(err) {
is(err.name, "NotFoundError", "A NotFoundError exception should've been thrown");
}
// Custom element constructor.
var constructedButton = new buttonConstructor();
is(constructedButton.tagName, "BUTTON", "Created element should have local name of BUTTON");
is(constructedButton.__proto__, extendedProto, "Created element should have the prototype of the extended type.");
is(constructedButton.getAttribute("is"), "x-extended-button", "The |is| attribute of the created element should be the extended type.");
// document.createElement with different namespace than definition for extended element.
try {
var htmlText = document.createElement("text", {is: "x-extended-text"});
ok(false, "An exception should've been thrown");
} catch(err) {
is(err.name, "NotFoundError", "A NotFoundError exception should've been thrown");
}
// Try creating an element with a custom element name, but not in the html namespace.
var htmlNamespaceProto = Object.create(HTMLElement.prototype);
document.registerElement("x-in-html-namespace", { prototype: htmlNamespaceProto });

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

@ -10,6 +10,8 @@
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/dom/VRServiceTestBinding.h"
#include "gfxVR.h"
namespace mozilla {
namespace dom {

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

@ -21,6 +21,7 @@
#include "nsIConverterInputStream.h"
#include "nsIInputStream.h"
#include "nsIMultiplexInputStream.h"
#include "nsStreamUtils.h"
#include "nsStringStream.h"
#include "nsISupportsImpl.h"
#include "nsNetUtil.h"
@ -78,11 +79,16 @@ FileReaderSync::ReadAsArrayBuffer(JSContext* aCx,
}
uint32_t numRead;
aRv = Read(stream, bufferData.get(), blobSize, &numRead);
aRv = SyncRead(stream, bufferData.get(), blobSize, &numRead);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
NS_ASSERTION(numRead == blobSize, "failed to read data");
// The file is changed in the meantime?
if (numRead != blobSize) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
JSObject* arrayBuffer = JS_NewArrayBufferWithContents(aCx, blobSize, bufferData.get());
if (!arrayBuffer) {
@ -110,7 +116,7 @@ FileReaderSync::ReadAsBinaryString(Blob& aBlob,
uint32_t numRead;
do {
char readBuf[4096];
aRv = Read(stream, readBuf, sizeof(readBuf), &numRead);
aRv = SyncRead(stream, readBuf, sizeof(readBuf), &numRead);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
@ -145,11 +151,17 @@ FileReaderSync::ReadAsText(Blob& aBlob,
}
uint32_t numRead = 0;
aRv = Read(stream, sniffBuf.BeginWriting(), sniffBuf.Length(), &numRead);
aRv = SyncRead(stream, sniffBuf.BeginWriting(), sniffBuf.Length(), &numRead);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
// No data, we don't need to continue.
if (numRead == 0) {
aResult.Truncate();
return;
}
// The BOM sniffing is baked into the "decode" part of the Encoding
// Standard, which the File API references.
if (!nsContentUtils::CheckForBOM((const unsigned char*)sniffBuf.BeginReading(),
@ -182,16 +194,10 @@ FileReaderSync::ReadAsText(Blob& aBlob,
}
// Let's recreate the full stream using a:
// multiplexStream(stringStream + original stream)
// multiplexStream(syncStream + original stream)
// In theory, we could try to see if the inputStream is a nsISeekableStream,
// but this doesn't work correctly for nsPipe3 - See bug 1349570.
nsCOMPtr<nsIInputStream> stringStream;
aRv = NS_NewCStringInputStream(getter_AddRefs(stringStream), sniffBuf);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
nsCOMPtr<nsIMultiplexInputStream> multiplexStream =
do_CreateInstance("@mozilla.org/io/multiplex-input-stream;1");
if (NS_WARN_IF(!multiplexStream)) {
@ -199,12 +205,24 @@ FileReaderSync::ReadAsText(Blob& aBlob,
return;
}
aRv = multiplexStream->AppendStream(stringStream);
nsCOMPtr<nsIInputStream> sniffStringStream;
aRv = NS_NewCStringInputStream(getter_AddRefs(sniffStringStream), sniffBuf);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
aRv = multiplexStream->AppendStream(stream);
aRv = multiplexStream->AppendStream(sniffStringStream);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
nsCOMPtr<nsIInputStream> syncStream;
aRv = ConvertAsyncToSyncStream(stream, getter_AddRefs(syncStream));
if (NS_WARN_IF(aRv.Failed())) {
return;
}
aRv = multiplexStream->AppendStream(syncStream);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
@ -238,19 +256,30 @@ FileReaderSync::ReadAsDataURL(Blob& aBlob, nsAString& aResult,
return;
}
uint64_t size = aBlob.GetSize(aRv);
nsCOMPtr<nsIInputStream> syncStream;
aRv = ConvertAsyncToSyncStream(stream, getter_AddRefs(syncStream));
if (NS_WARN_IF(aRv.Failed())) {
return;
}
uint64_t size;
aRv = syncStream->Available(&size);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
uint64_t blobSize = aBlob.GetSize(aRv);
if (NS_WARN_IF(aRv.Failed())){
return;
}
nsCOMPtr<nsIInputStream> bufferedStream;
aRv = NS_NewBufferedInputStream(getter_AddRefs(bufferedStream), stream, size);
if (NS_WARN_IF(aRv.Failed())){
// The file is changed in the meantime?
if (blobSize != size) {
return;
}
nsAutoString encodedData;
aRv = Base64EncodeInputStream(bufferedStream, encodedData, size);
aRv = Base64EncodeInputStream(syncStream, encodedData, size);
if (NS_WARN_IF(aRv.Failed())){
return;
}
@ -361,8 +390,8 @@ NS_INTERFACE_MAP_END
} // anonymous
nsresult
FileReaderSync::Read(nsIInputStream* aStream, char* aBuffer, uint32_t aBufferSize,
uint32_t* aRead)
FileReaderSync::SyncRead(nsIInputStream* aStream, char* aBuffer,
uint32_t aBufferSize, uint32_t* aRead)
{
MOZ_ASSERT(aStream);
MOZ_ASSERT(aBuffer);
@ -370,10 +399,34 @@ FileReaderSync::Read(nsIInputStream* aStream, char* aBuffer, uint32_t aBufferSiz
// Let's try to read, directly.
nsresult rv = aStream->Read(aBuffer, aBufferSize, aRead);
if (NS_SUCCEEDED(rv) || rv != NS_BASE_STREAM_WOULD_BLOCK) {
// Nothing else to read.
if (rv == NS_BASE_STREAM_CLOSED ||
(NS_SUCCEEDED(rv) && *aRead == 0)) {
return NS_OK;
}
// An error.
if (NS_FAILED(rv) && rv != NS_BASE_STREAM_WOULD_BLOCK) {
return rv;
}
// All good.
if (NS_SUCCEEDED(rv)) {
// Not enough data, let's read recursively.
if (*aRead != aBufferSize) {
uint32_t byteRead = 0;
rv = SyncRead(aStream, aBuffer + *aRead, aBufferSize - *aRead, &byteRead);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
*aRead += byteRead;
}
return NS_OK;
}
// We need to proceed async.
nsCOMPtr<nsIAsyncInputStream> asyncStream = do_QueryInterface(aStream);
if (!asyncStream) {
@ -408,5 +461,44 @@ FileReaderSync::Read(nsIInputStream* aStream, char* aBuffer, uint32_t aBufferSiz
}
// Now, we can try to read again.
return Read(aStream, aBuffer, aBufferSize, aRead);
return SyncRead(aStream, aBuffer, aBufferSize, aRead);
}
nsresult
FileReaderSync::ConvertAsyncToSyncStream(nsIInputStream* aAsyncStream,
nsIInputStream** aSyncStream)
{
// If the stream is not async, we just need it to be bufferable.
nsCOMPtr<nsIAsyncInputStream> asyncStream = do_QueryInterface(aAsyncStream);
if (!asyncStream) {
return NS_NewBufferedInputStream(aSyncStream, aAsyncStream, 4096);
}
uint64_t length;
nsresult rv = aAsyncStream->Available(&length);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
nsAutoCString buffer;
if (!buffer.SetLength(length, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
uint32_t read;
rv = SyncRead(aAsyncStream, buffer.BeginWriting(), length, &read);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (read != length) {
return NS_ERROR_FAILURE;
}
rv = NS_NewCStringInputStream(aSyncStream, buffer);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}

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

@ -32,8 +32,11 @@ private:
nsresult ConvertStream(nsIInputStream *aStream, const char *aCharset,
nsAString &aResult);
nsresult Read(nsIInputStream* aStream, char* aBuffer, uint32_t aBufferSize,
uint32_t* aRead);
nsresult ConvertAsyncToSyncStream(nsIInputStream* aAsyncStream,
nsIInputStream** aSyncStream);
nsresult SyncRead(nsIInputStream* aStream, char* aBuffer,
uint32_t aBufferSize, uint32_t* aRead);
public:
static already_AddRefed<FileReaderSync>

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

@ -2827,6 +2827,7 @@ XMLHttpRequestMainThread::Send(nsIVariant* aVariant)
void
XMLHttpRequestMainThread::UnsuppressEventHandlingAndResume()
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mFlagSynchronous);
if (mSuspendedDoc) {
@ -2835,7 +2836,7 @@ XMLHttpRequestMainThread::UnsuppressEventHandlingAndResume()
}
if (mResumeTimeoutRunnable) {
NS_DispatchToCurrentThread(mResumeTimeoutRunnable);
DispatchToMainThread(mResumeTimeoutRunnable.forget());
mResumeTimeoutRunnable = nullptr;
}
}
@ -2843,6 +2844,8 @@ XMLHttpRequestMainThread::UnsuppressEventHandlingAndResume()
nsresult
XMLHttpRequestMainThread::SendInternal(const BodyExtractorBase* aBody)
{
MOZ_ASSERT(NS_IsMainThread());
NS_ENSURE_TRUE(mPrincipal, NS_ERROR_NOT_INITIALIZED);
// Step 1
@ -3026,11 +3029,9 @@ XMLHttpRequestMainThread::SendInternal(const BodyExtractorBase* aBody)
} else {
// Defer the actual sending of async events just in case listeners
// are attached after the send() method is called.
NS_DispatchToCurrentThread(
NewRunnableMethod<ProgressEventType>(this,
&XMLHttpRequestMainThread::CloseRequestWithError,
ProgressEventType::error));
return NS_OK;
return DispatchToMainThread(NewRunnableMethod<ProgressEventType>(this,
&XMLHttpRequestMainThread::CloseRequestWithError,
ProgressEventType::error));
}
}
@ -3127,6 +3128,19 @@ XMLHttpRequestMainThread::SetTimerEventTarget(nsITimer* aTimer)
}
}
nsresult
XMLHttpRequestMainThread::DispatchToMainThread(already_AddRefed<nsIRunnable> aRunnable)
{
if (nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal()) {
nsCOMPtr<nsIEventTarget> target = global->EventTargetFor(TaskCategory::Other);
MOZ_ASSERT(target);
return target->Dispatch(Move(aRunnable), NS_DISPATCH_NORMAL);
}
return NS_DispatchToMainThread(Move(aRunnable));
}
void
XMLHttpRequestMainThread::StartTimeoutTimer()
{

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

@ -580,6 +580,8 @@ protected:
void SetTimerEventTarget(nsITimer* aTimer);
nsresult DispatchToMainThread(already_AddRefed<nsIRunnable> aRunnable);
already_AddRefed<nsXMLHttpRequestXPCOMifier> EnsureXPCOMifier();
nsCOMPtr<nsISupports> mContext;

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

@ -460,7 +460,7 @@ public:
return false;
}
return NS_SUCCEEDED(NS_DispatchToCurrentThread(this));
return NS_SUCCEEDED(mWorkerPrivate->DispatchToMainThread(this));
}
private:

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

@ -42,8 +42,8 @@ function expectJSAllowed(allowed, testCondition, callback) {
is(self_.ICanRunMyJS, allowed, msg);
callback();
}, {once: true});
var iframeSrc = "data:text/html,<script>parent.parent.ICanRunMyJS = true;</scr" + "ipt>";
innerFrame.src = iframeSrc;
var iframeSrc = "<script>parent.parent.ICanRunMyJS = true;</scr" + "ipt>";
innerFrame.srcdoc = iframeSrc;
}
SimpleTest.waitForExplicitFinish();
@ -109,8 +109,8 @@ function testDocumentDisabledJS() {
is(self_.ICanRunMyJS, false, msg);
SimpleTest.finish();
}, {once: true});
var iframeSrc = "data:text/html,<script>parent.parent.ICanRunMyJS = true;</scr" + "ipt>";
innerFrame.src = iframeSrc;
var iframeSrc = "<script>parent.parent.ICanRunMyJS = true;</scr" + "ipt>";
innerFrame.srcdoc = iframeSrc;
}
</script>

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

@ -16,7 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=795418
<div id="content" style="display: none">
</div>
<iframe src="data:text/html,<html><body><span>Edit me!</span>"></iframe>
<iframe srcdoc="<html><body><span>Edit me!</span>"></iframe>
<pre id="test">

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

@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=372345
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=372345">Mozilla Bug 372345</a>
<p id="display"></p>
<div id="content">
<iframe src="data:text/html,<body>"></iframe>
<iframe srcdoc="<body>"></iframe>
</div>
<pre id="test">
<script type="application/javascript">

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

@ -13,8 +13,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=620906
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=620906">Mozilla Bug 620906</a>
<p id="display"></p>
<div id="content">
<iframe src="data:text/html,
<body contenteditable
<iframe srcdoc=
"<body contenteditable
onmousedown='
document.designMode=&quot;on&quot;;
document.designMode=&quot;off&quot;;

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

@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=622371
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=622371">Mozilla Bug 622371</a>
<p id="display"></p>
<div id="content">
<iframe src="data:text/html,<body contenteditable>abc</body>"></iframe>
<iframe srcdoc="<body contenteditable>abc</body>"></iframe>
</div>
<pre id="test">
<script type="application/javascript">

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

@ -4,7 +4,7 @@
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=646194"
target="_blank">Mozilla Bug 646194</a>
<iframe id="i" src="data:text/html,&lt;div contenteditable=true id=t&gt;test me now&lt;/div&gt;"></iframe>
<iframe id="i" srcdoc="&lt;div contenteditable=true id=t&gt;test me now&lt;/div&gt;"></iframe>
<script>
SimpleTest.expectAssertions(1);

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

@ -1,6 +1,3 @@
This directory contains the Graphite2 library release 1.3.9 from
https://github.com/silnrsi/graphite/releases/download/1.3.9/graphite2-minimal-1.3.9.tgz
See gfx/graphite2/moz-gr-update.sh for update procedure.
Cherry-picked post-1.3.9 commit 1ce331d5548b98ed8b818532b2556d6f2c7a3b83 to fix
https://bugzilla.mozilla.org/show_bug.cgi?id=1345461.
This directory contains the Graphite2 library release 1.3.10 from
https://github.com/silnrsi/graphite/releases/download/1.3.10/graphite2-minimal-1.3.10.tgz
See ./gfx/graphite2/moz-gr-update.sh for update procedure.

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

@ -30,7 +30,7 @@
#define GR2_VERSION_MAJOR 1
#define GR2_VERSION_MINOR 3
#define GR2_VERSION_BUGFIX 9
#define GR2_VERSION_BUGFIX 10
#ifdef __cplusplus
extern "C"

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

@ -111,6 +111,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector"
LINK_FLAGS "-nodefaultlibs ${GRAPHITE_LINK_FLAGS}"
LINKER_LANGUAGE C)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86|i.86")
add_definitions(-mfpmath=sse -msse2)
endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86|i.86")
if (CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-Wdouble-promotion)
endif (CMAKE_COMPILER_IS_GNUCXX)
@ -135,7 +138,7 @@ endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set_target_properties(graphite2 PROPERTIES
COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wimplicit-fallthrough -Wendif-labels -Wshadow -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector"
COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wimplicit-fallthrough -Wendif-labels -Wshadow -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector -mfpmath=sse -msse2"
LINK_FLAGS "-nodefaultlibs"
LINKER_LANGUAGE C)
target_link_libraries(graphite2 c)

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

@ -262,7 +262,7 @@ inline void ShiftCollider::removeBox(const Rect &box, const BBox &bb, const Slan
// Adjust the movement limits for the target to avoid having it collide
// with the given neighbor slot. Also determine if there is in fact a collision
// between the target and the given slot.
bool ShiftCollider::mergeSlot(Segment *seg, Slot *slot, const Position &currShift,
bool ShiftCollider::mergeSlot(Segment *seg, Slot *slot, const SlotCollision *cslot, const Position &currShift,
bool isAfter, // slot is logically after _target
bool sameCluster, bool &hasCol, bool isExclusion,
GR_MAYBE_UNUSED json * const dbgout )
@ -282,7 +282,7 @@ bool ShiftCollider::mergeSlot(Segment *seg, Slot *slot, const Position &currShif
return false;
const BBox &bb = gc.getBoundingBBox(gid);
SlotCollision * cslot = seg->collisionInfo(slot);
// SlotCollision * cslot = seg->collisionInfo(slot);
int orderFlags = 0;
bool sameClass = _seqProxClass == 0 && cslot->seqClass() == _seqClass;
if (sameCluster && _seqClass
@ -561,7 +561,8 @@ bool ShiftCollider::mergeSlot(Segment *seg, Slot *slot, const Position &currShif
exclSlot->setGlyph(seg, cslot->exclGlyph());
Position exclOrigin(slot->origin() + cslot->exclOffset());
exclSlot->origin(exclOrigin);
res &= mergeSlot(seg, exclSlot, currShift, isAfter, sameCluster, isCol, true, dbgout );
SlotCollision exclInfo(seg, exclSlot);
res &= mergeSlot(seg, exclSlot, &exclInfo, currShift, isAfter, sameCluster, isCol, true, dbgout );
seg->freeSlot(exclSlot);
}
hasCol |= isCol;

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

@ -51,7 +51,7 @@ bool read_sequence(u8 const * &src, u8 const * const end, u8 const * &literal, u
literal = src;
src += literal_len;
if (src > end - 2)
if (src > end - 2 || src < literal)
return false;
match_dist = *src++;
@ -85,7 +85,7 @@ int lz4::decompress(void const *in, size_t in_size, void *out, size_t out_size)
{
// Copy in literal. At this point the last full sequence must be at
// least MINMATCH + 5 from the end of the output buffer.
if (dst + align(literal_len) > dst_end - (MINMATCH+5))
if (align(literal_len) > unsigned(dst_end - dst - (MINMATCH+5)) || dst_end - dst < MINMATCH + 5)
return -1;
dst = overrun_copy(dst, literal, literal_len);
}
@ -94,7 +94,9 @@ int lz4::decompress(void const *in, size_t in_size, void *out, size_t out_size)
// decoded output.
u8 const * const pcpy = dst - match_dist;
if (pcpy < static_cast<u8*>(out)
|| dst + match_len + MINMATCH > dst_end - 5)
|| pcpy >= dst
|| match_len > unsigned(dst_end - dst - (MINMATCH+5))
|| dst_end - dst < MINMATCH + 5)
return -1;
if (dst > pcpy+sizeof(unsigned long)
&& dst + align(match_len + MINMATCH) <= dst_end)
@ -103,8 +105,8 @@ int lz4::decompress(void const *in, size_t in_size, void *out, size_t out_size)
dst = safe_copy(dst, pcpy, match_len + MINMATCH);
}
if (literal + literal_len > src_end
|| dst + literal_len > dst_end)
if (literal_len > src_end - literal
|| literal_len > dst_end - dst)
return -1;
dst = fast_copy(dst, literal, literal_len);

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

@ -275,7 +275,8 @@ bool FeatureRef::applyValToFeature(uint32 val, Features & pDest) const
else
if (pDest.m_pMap!=&m_pFace->theSill().theFeatureMap())
return false; //incompatible
pDest.reserve(m_index + 1);
if (m_index >= pDest.size())
pDest.resize(m_index+1);
pDest[m_index] &= ~m_mask;
pDest[m_index] |= (uint32(val) << m_bits);
return true;

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

@ -380,12 +380,16 @@ const GlyphFace * GlyphCache::Loader::read_glyph(unsigned short glyphid, GlyphFa
be::skip<uint16>(gloc,2);
if (_long_fmt)
{
if (8 + glyphid * sizeof(uint32) > m_pGloc.size())
return 0;
be::skip<uint32>(gloc, glyphid);
glocs = be::read<uint32>(gloc);
gloce = be::peek<uint32>(gloc);
}
else
{
if (8 + glyphid * sizeof(uint16) > m_pGloc.size())
return 0;
be::skip<uint16>(gloc, glyphid);
glocs = be::read<uint16>(gloc);
gloce = be::peek<uint16>(gloc);

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

@ -171,7 +171,7 @@ bool Pass::readPass(const byte * const pass_start, size_t pass_length, size_t su
const uint16 * const o_actions = reinterpret_cast<const uint16 *>(p);
be::skip<uint16>(p, m_numRules + 1);
const byte * const states = p;
if (e.test(p + 2u*m_numTransition*m_numColumns >= pass_end, E_BADPASSLENGTH)) return face.error(e);
if (e.test(2u*m_numTransition*m_numColumns >= (unsigned)(pass_end - p), E_BADPASSLENGTH)) return face.error(e);
be::skip<int16>(p, m_numTransition*m_numColumns);
be::skip<uint8>(p);
if (e.test(p != pcCode, E_BADPASSCCODEPTR)) return face.error(e);
@ -192,7 +192,7 @@ bool Pass::readPass(const byte * const pass_start, size_t pass_length, size_t su
m_cPConstraint = vm::Machine::Code(true, pcCode, pcCode + pass_constraint_len,
precontext[0], be::peek<uint16>(sort_keys), *m_silf, face, PASS_TYPE_UNKNOWN);
if (e.test(!m_cPConstraint, E_OUTOFMEM)
|| e.test(!m_cPConstraint, m_cPConstraint.status() + E_CODEFAILURE))
|| e.test(m_cPConstraint.status() != Code::loaded, m_cPConstraint.status() + E_CODEFAILURE))
return face.error(e);
face.error_context(face.error_context() - 1);
}
@ -974,7 +974,7 @@ bool Pass::resolveCollisions(Segment *seg, Slot *slotFix, Slot *start,
|| !(cNbor->flags() & SlotCollision::COLL_FIX) // merge in immovable stuff
|| ((cNbor->flags() & SlotCollision::COLL_KERN) && !sameCluster) // ignore other kernable clusters
|| (cNbor->flags() & SlotCollision::COLL_ISCOL)) // test against other collided glyphs
&& !coll.mergeSlot(seg, nbor, cNbor->shift(), !ignoreForKern, sameCluster, collides, false, dbgout))
&& !coll.mergeSlot(seg, nbor, cNbor, cNbor->shift(), !ignoreForKern, sameCluster, collides, false, dbgout))
return false;
else if (nbor == slotFix)
// Switching sides of this glyph - if we were ignoring kernable stuff before, don't anymore.

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

@ -155,8 +155,8 @@ bool Silf::readGraphite(const byte * const silf_start, size_t lSilf, Face& face,
be::skip<uint32>(p, be::read<uint8>(p)); // don't use scriptTag array.
if (e.test(p + sizeof(uint16) + sizeof(uint32) >= silf_end, E_BADSCRIPTTAGS)) { releaseBuffers(); return face.error(e); }
m_gEndLine = be::read<uint16>(p); // lbGID
const byte * o_passes = p,
* const passes_start = silf_start + be::read<uint32>(p);
const byte * o_passes = p;
uint32 passes_start = be::read<uint32>(p);
const size_t num_attrs = face.glyphs().numAttrs();
if (e.test(m_aPseudo >= num_attrs, E_BADAPSEUDO)
@ -164,7 +164,7 @@ bool Silf::readGraphite(const byte * const silf_start, size_t lSilf, Face& face,
|| e.test(m_aBidi >= num_attrs, E_BADABIDI)
|| e.test(m_aMirror>= num_attrs, E_BADAMIRROR)
|| e.test(m_aCollision && m_aCollision >= num_attrs - 5, E_BADACOLLISION)
|| e.test(m_numPasses > 128, E_BADNUMPASSES) || e.test(passes_start >= silf_end, E_BADPASSESSTART)
|| e.test(m_numPasses > 128, E_BADNUMPASSES) || e.test(passes_start >= lSilf, E_BADPASSESSTART)
|| e.test(m_pPass < m_sPass, E_BADPASSBOUND) || e.test(m_pPass > m_numPasses, E_BADPPASS) || e.test(m_sPass > m_numPasses, E_BADSPASS)
|| e.test(m_jPass < m_pPass, E_BADJPASSBOUND) || e.test(m_jPass > m_numPasses, E_BADJPASS)
|| e.test((m_bPass != 0xFF && (m_bPass < m_jPass || m_bPass > m_numPasses)), E_BADBPASS)
@ -174,11 +174,11 @@ bool Silf::readGraphite(const byte * const silf_start, size_t lSilf, Face& face,
return face.error(e);
}
be::skip<uint32>(p, m_numPasses);
if (e.test(p + sizeof(uint16) >= passes_start, E_BADPASSESSTART)) { releaseBuffers(); return face.error(e); }
if (e.test(unsigned(p - silf_start) + sizeof(uint16) >= passes_start, E_BADPASSESSTART)) { releaseBuffers(); return face.error(e); }
m_numPseudo = be::read<uint16>(p);
be::skip<uint16>(p, 3); // searchPseudo, pseudoSelector, pseudoShift
m_pseudos = new Pseudo[m_numPseudo];
if (e.test(p + m_numPseudo*(sizeof(uint32) + sizeof(uint16)) >= passes_start, E_BADNUMPSEUDO)
if (e.test(unsigned(p - silf_start) + m_numPseudo*(sizeof(uint32) + sizeof(uint16)) >= passes_start, E_BADNUMPSEUDO)
|| e.test(!m_pseudos, E_OUTOFMEM))
{
releaseBuffers(); return face.error(e);
@ -189,20 +189,20 @@ bool Silf::readGraphite(const byte * const silf_start, size_t lSilf, Face& face,
m_pseudos[i].gid = be::read<uint16>(p);
}
const size_t clen = readClassMap(p, passes_start - p, version, e);
const size_t clen = readClassMap(p, passes_start + silf_start - p, version, e);
m_passes = new Pass[m_numPasses];
if (e || e.test(p + clen > passes_start, E_BADPASSESSTART)
if (e || e.test(clen > unsigned(passes_start + silf_start - p), E_BADPASSESSTART)
|| e.test(!m_passes, E_OUTOFMEM))
{ releaseBuffers(); return face.error(e); }
for (size_t i = 0; i < m_numPasses; ++i)
{
const byte * const pass_start = silf_start + be::read<uint32>(o_passes),
* const pass_end = silf_start + be::peek<uint32>(o_passes);
uint32 pass_start = be::read<uint32>(o_passes);
uint32 pass_end = be::peek<uint32>(o_passes);
face.error_context((face.error_context() & 0xFF00) + EC_ASILF + (i << 16));
if (e.test(pass_start > pass_end, E_BADPASSSTART)
|| e.test(pass_start < passes_start, E_BADPASSSTART)
|| e.test(pass_end > silf_end, E_BADPASSEND)) {
|| e.test(pass_end > lSilf, E_BADPASSEND)) {
releaseBuffers(); return face.error(e);
}
@ -213,7 +213,7 @@ bool Silf::readGraphite(const byte * const silf_start, size_t lSilf, Face& face,
else pt = PASS_TYPE_LINEBREAK;
m_passes[i].init(this);
if (!m_passes[i].readPass(pass_start, pass_end - pass_start, pass_start - silf_start, face, pt,
if (!m_passes[i].readPass(silf_start + pass_start, pass_end - pass_start, pass_start, face, pt,
version, e))
{
releaseBuffers();
@ -293,7 +293,8 @@ size_t Silf::readClassMap(const byte *p, size_t data_len, uint32 version, Error
if (e.test(*o + 4 > max_off, E_HIGHCLASSOFFSET) // LookupClass doesn't stretch over max_off
|| e.test(lookup[0] == 0 // A LookupClass with no looks is a suspicious thing ...
|| lookup[0] * 2 + *o + 4 > max_off // numIDs lookup pairs fits within (start of LookupClass' lookups array, max_off]
|| lookup[3] + lookup[1] != lookup[0], E_BADCLASSLOOKUPINFO)) // rangeShift: numIDs - searchRange
|| lookup[3] + lookup[1] != lookup[0], E_BADCLASSLOOKUPINFO) // rangeShift: numIDs - searchRange
|| e.test(((o[1] - *o) & 1) != 0, ERROROFFSET)) // glyphs are in pairs so difference must be even.
return ERROROFFSET;
}

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

@ -133,7 +133,7 @@ public:
bool initSlot(Segment *seg, Slot *aSlot, const Rect &constraint,
float margin, float marginMin, const Position &currShift,
const Position &currOffset, int dir, GR_MAYBE_UNUSED json * const dbgout);
bool mergeSlot(Segment *seg, Slot *slot, const Position &currShift, bool isAfter,
bool mergeSlot(Segment *seg, Slot *slot, const SlotCollision *cinfo, const Position &currShift, bool isAfter,
bool sameCluster, bool &hasCol, bool isExclusion, GR_MAYBE_UNUSED json * const dbgout);
Position resolve(Segment *seg, bool &isCol, GR_MAYBE_UNUSED json * const dbgout);
void addBox_slope(bool isx, const Rect &box, const BBox &bb, const SlantBox &sb, const Position &org, float weight, float m, bool minright, int mode);

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