Compare commits
94
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ffed6e8bf | ||
|
|
98bd23c78f | ||
|
|
a5b2695841 | ||
|
|
724368467b | ||
|
|
cee1324f0f | ||
|
|
b4a65a3e01 | ||
|
|
3be7cb940e | ||
|
|
1af286ffef | ||
|
|
cc53748228 | ||
|
|
9e3ca2878d | ||
|
|
2ae457f21e | ||
|
|
6478daf298 | ||
|
|
181cb5210e | ||
|
|
aabb3573ea | ||
|
|
9d01447a21 | ||
|
|
f8c7e321a5 | ||
|
|
5ec124cf03 | ||
|
|
80dfca4577 | ||
|
|
90a44b312f | ||
|
|
38986a488b | ||
|
|
932ecf52b6 | ||
|
|
9676ebdced | ||
|
|
333c64ef30 | ||
|
|
ae971bfe8e | ||
|
|
915ae7981a | ||
|
|
33420c43a2 | ||
|
|
ce9d45fc59 | ||
|
|
f29d7ff617 | ||
|
|
cdc5daf5da | ||
|
|
b1de755d0f | ||
|
|
da9d7b4362 | ||
|
|
6efbf737e5 | ||
|
|
f97c06d435 | ||
|
|
1f058d19ef | ||
|
|
260b06c1c9 | ||
|
|
c4ed602e3f | ||
|
|
ed290ba09d | ||
|
|
e746ec8441 | ||
|
|
48d8e28fe6 | ||
|
|
cdfe2e11c8 | ||
|
|
ed9341c4a4 | ||
|
|
263d8500ce | ||
|
|
b06821da15 | ||
|
|
b578943a42 | ||
|
|
b4edb88144 | ||
|
|
f84f1961bc | ||
|
|
3aac951411 | ||
|
|
1a6159363f | ||
|
|
814e0bca31 | ||
|
|
29b9d4496a | ||
|
|
cc6a935ce5 | ||
|
|
d129c900c9 | ||
|
|
de2c8419c6 | ||
|
|
f6137449b6 | ||
|
|
020248c6e3 | ||
|
|
e0a09e1aaf | ||
|
|
4af3ad5dfe | ||
|
|
ff66da9af4 | ||
|
|
c2e358c520 | ||
|
|
d185071acf | ||
|
|
e517e70eb1 | ||
|
|
0a6db54d86 | ||
|
|
c5d5a28f76 | ||
|
|
a0e20005ef | ||
|
|
a3c1f180ce | ||
|
|
cd4f7a1798 | ||
|
|
914294e570 | ||
|
|
831b9d8d9e | ||
|
|
6864a02d7b | ||
|
|
bffec09e66 | ||
|
|
51e5770962 | ||
|
|
e1bfe33031 | ||
|
|
8240fb9c73 | ||
|
|
f9e04b54c2 | ||
|
|
775e800ca0 | ||
|
|
882aaf5b1f | ||
|
|
8ee235ca5d | ||
|
|
cc54bbe952 | ||
|
|
73b202b1e5 | ||
|
|
21042963de | ||
|
|
d443656df5 | ||
|
|
29a8db7280 | ||
|
|
daa52eef9a | ||
|
|
95ce1f0d63 | ||
|
|
4dadef2740 | ||
|
|
b5d8e6d28f | ||
|
|
fc0477a98e | ||
|
|
36d06b9e75 | ||
|
|
51bdd3efbc | ||
|
|
bc2584493a | ||
|
|
0f38772573 | ||
|
|
ef81277925 | ||
|
|
8b20931e12 | ||
|
|
b247982d37 |
No files matched your search
@@ -145,9 +145,6 @@
|
||||
</radiogroup>
|
||||
</box>
|
||||
</row>
|
||||
<label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
|
||||
<textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
|
||||
<label value="&noproxyExplain.label;" control="networkProxyNone"/>
|
||||
</rows>
|
||||
</grid>
|
||||
<radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/>
|
||||
@@ -162,6 +159,9 @@
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
<separator class="thin"/>
|
||||
<label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
|
||||
<textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
|
||||
<label value="&noproxyExplain.label;" control="networkProxyNone"/>
|
||||
<checkbox id="autologinProxy"
|
||||
label="&autologinproxy.label;"
|
||||
accesskey="&autologinproxy.accesskey;"
|
||||
|
||||
@@ -37,20 +37,20 @@ pref("extensions.strictCompatibility", false);
|
||||
// for it to be compatible by default.
|
||||
pref("extensions.minCompatibleAppVersion", "1.5");
|
||||
|
||||
// Preferences for APO integration
|
||||
#define APO_AM_URL addons.palemoon.org/integration/addon-manager
|
||||
#define APO_AUS_ARGS reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
|
||||
#define AM_DOMAIN addons.palemoon.org
|
||||
#define AM_AUS_ARGS reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
|
||||
|
||||
// Preferences for AMO integration
|
||||
pref("extensions.getAddons.cache.enabled", false);
|
||||
pref("extensions.getAddons.maxResults", 10);
|
||||
pref("extensions.getAddons.get.url", "https://@APO_AM_URL@/internal/get?addonguid=%IDS%&os=%OS%&version=%VERSION%");
|
||||
pref("extensions.getAddons.getWithPerformance.url", "https://@APO_AM_URL@/internal/get?addonguid=%IDS%&os=%OS%&version=%VERSION%");
|
||||
pref("extensions.getAddons.search.browseURL", "https://@APO_AM_URL@/external/recommended");
|
||||
pref("extensions.getAddons.search.url", "https://@APO_AM_URL@/internal/search?q=%TERMS%&locale=%LOCALE%&os=%OS%&version=%VERSION%");
|
||||
pref("extensions.webservice.discoverURL", "http://@APO_AM_URL@/internal/discover/");
|
||||
pref("extensions.getAddons.recommended.url", "https://@APO_AM_URL@/internal/recommended?locale=%LOCALE%&os=%OS%");
|
||||
pref("extensions.getAddons.browseAddons", "https://addons.palemoon.org");
|
||||
pref("extensions.getAddons.recommended.browseURL", "https://@APO_AM_URL@/external/recommended");
|
||||
pref("extensions.getAddons.get.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%");
|
||||
pref("extensions.getAddons.getWithPerformance.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%");
|
||||
pref("extensions.getAddons.search.browseURL", "https://@AM_DOMAIN@/search/?terms=%TERMS%");
|
||||
pref("extensions.getAddons.search.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=search&q=%TERMS%&locale=%LOCALE%&os=%OS%&version=%VERSION%");
|
||||
pref("extensions.webservice.discoverURL", "http://@AM_DOMAIN@/?component=discover");
|
||||
pref("extensions.getAddons.recommended.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=recommended&locale=%LOCALE%&os=%OS%");
|
||||
pref("extensions.getAddons.browseAddons", "http://@AM_DOMAIN@/");
|
||||
pref("extensions.getAddons.recommended.browseURL", "https://@AM_DOMAIN@/?component=integration&type=external&request=recommended");
|
||||
|
||||
// Blocklist preferences
|
||||
pref("extensions.blocklist.enabled", true);
|
||||
@@ -70,10 +70,10 @@ pref("extensions.update.autoUpdateDefault", true);
|
||||
pref("extensions.autoDisableScopes", 15);
|
||||
|
||||
// Dictionary download preference
|
||||
pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/");
|
||||
pref("browser.dictionaries.download.url", "https://@AM_DOMAIN@/dictionaries/");
|
||||
|
||||
// Get More Tools link URL
|
||||
pref("browser.getdevtools.url","https://@APO_AM_URL@/external/devtools");
|
||||
pref("browser.getdevtools.url","https://@AM_DOMAIN@/?component=integration&type=external&request=devtools");
|
||||
|
||||
// Feedback URL
|
||||
pref("browser.feedback.url", "https://forum.palemoon.org");
|
||||
@@ -194,8 +194,8 @@ pref("app.update.incompatible.mode", 0);
|
||||
// .. etc ..
|
||||
//
|
||||
pref("extensions.update.enabled", true);
|
||||
pref("extensions.update.url", "https://@APO_AM_URL@/internal/update?@APO_AUS_ARGS@");
|
||||
pref("extensions.update.background.url", "https://@APO_AM_URL@/internal/update?@APO_AUS_ARGS@");
|
||||
pref("extensions.update.url", "https://@AM_DOMAIN@/?component=aus&@AM_AUS_ARGS@");
|
||||
pref("extensions.update.background.url", "https://@AM_DOMAIN@/?component=aus&@AM_AUS_ARGS@");
|
||||
pref("extensions.update.interval", 86400); // Check for updates to Extensions and
|
||||
// Themes every day
|
||||
// Non-symmetric (not shared by extensions) extension-specific [update] preferences
|
||||
@@ -362,7 +362,7 @@ pref("browser.download.panel.shown", false);
|
||||
pref("browser.download.panel.firstSessionCompleted", false);
|
||||
|
||||
// search engines URL
|
||||
pref("browser.search.searchEnginesURL", "https://@APO_AM_URL@/external/searchplugins");
|
||||
pref("browser.search.searchEnginesURL", "https://@AM_DOMAIN@/?component=integration&type=external&request=searchplugins");
|
||||
|
||||
// pointer to the default engine name
|
||||
pref("browser.search.defaultenginename", "chrome://browser-region/locale/region.properties");
|
||||
@@ -1121,6 +1121,9 @@ pref("security.csp.speccompliant", true);
|
||||
// Block insecure active content on https pages
|
||||
pref("security.mixed_content.block_active_content", true);
|
||||
|
||||
// Disable Microsoft Family Safety MitM support
|
||||
pref("security.family_safety.mode", 0);
|
||||
|
||||
// Override the Gecko-default value of false for Pale Moon.
|
||||
pref("plain_text.wrap_long_lines", true);
|
||||
|
||||
|
||||
@@ -4408,7 +4408,13 @@ nsBrowserAccess.prototype = {
|
||||
|
||||
openURI: function (aURI, aOpener, aWhere, aContext) {
|
||||
var newWindow = null;
|
||||
var isExternal = (aContext == Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
|
||||
var isExternal = !!(aContext & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
|
||||
|
||||
if (aOpener && isExternal) {
|
||||
Cu.reportError("nsBrowserAccess.openURI did not expect an opener to be " +
|
||||
"passed if the context is OPEN_EXTERNAL.");
|
||||
throw Cr.NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (isExternal && aURI && aURI.schemeIs("chrome")) {
|
||||
dump("use -chrome command-line option to load external chrome urls\n");
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#define APO_AM_URL addons.palemoon.org/integration/addon-manager
|
||||
#define APO_AUS_ARGS reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
|
||||
|
||||
// ===| General |==============================================================
|
||||
|
||||
pref("startup.homepage_welcome_url","http://www.palemoon.org/firstrun.shtml");
|
||||
@@ -29,15 +26,12 @@ pref("app.update.promptWaitTime", 172800);
|
||||
// ===| Add-ons Manager |======================================================
|
||||
|
||||
// Add-on window fixes
|
||||
pref("extensions.getMoreThemesURL", "https://@APO_AM_URL@/external/themes");
|
||||
pref("extensions.getMoreThemesURL", "https://addons.palemoon.org/themes/");
|
||||
|
||||
// Extensions Blocklist
|
||||
pref("extensions.blocklist.url","http://blocklist.palemoon.org/%VERSION%/blocklist.xml");
|
||||
pref("extensions.blocklist.itemURL", "http://blocklist.palemoon.org/info/?id=%blockID%");
|
||||
|
||||
// Dictionary URL
|
||||
pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/");
|
||||
|
||||
pref("extensions.update.autoUpdateDefault", true); // Automatically update extensions by default
|
||||
pref("extensions.getAddons.maxResults", 10);
|
||||
pref("extensions.getAddons.cache.enabled", false);
|
||||
|
||||
@@ -57,12 +57,16 @@ pref("@GUAO_PREF@.www.amazon.com","Mozilla/5.0 (@OS_SLICE@ rv:45.9) @GK_SLICE@ F
|
||||
pref("@GUAO_PREF@.soundcloud.com","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
|
||||
// Daily motion only likes strict Firefox UAs
|
||||
pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (@OS_SLICE@ rv:52.0) @GK_SLICE@ Firefox/52.0");
|
||||
// Financial Times' polyfill.io breaks horribly on a Pale Moon UA. Send a strict Firefox UA instead.
|
||||
pref("@GUAO_PREF@.polyfill.io","Mozilla/5.0 (@OS_SLICE@ rv:60.9) @GK_SLICE@ Firefox/60.9");
|
||||
|
||||
|
||||
// The following requires native mode. Or it blocks.. "too old firefox", breakage, etc.
|
||||
pref("@GUAO_PREF@.deviantart.com","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
|
||||
pref("@GUAO_PREF@.deviantart.net","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
|
||||
pref("@GUAO_PREF@.altibox.dk","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
|
||||
pref("@GUAO_PREF@.altibox.no","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
|
||||
pref("@GUAO_PREF@.firefox.com","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
|
||||
|
||||
// UA-Sniffing domains below have indicated no interest in supporting Pale Moon (BOO!)
|
||||
pref("@GUAO_PREF@.humblebundle.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)");
|
||||
|
||||
@@ -138,9 +138,6 @@
|
||||
<radio id="networkProxySOCKSVersion5" value="5" label="&socks5.label;" accesskey="&socks5.accesskey;"/>
|
||||
</radiogroup>
|
||||
</row>
|
||||
<label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
|
||||
<textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
|
||||
<label value="&noproxyExplain.label;" control="networkProxyNone"/>
|
||||
</rows>
|
||||
</grid>
|
||||
<radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/>
|
||||
@@ -154,6 +151,9 @@
|
||||
</hbox>
|
||||
</radiogroup>
|
||||
<separator class="thin"/>
|
||||
<label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
|
||||
<textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
|
||||
<label value="&noproxyExplain.label;" control="networkProxyNone"/>
|
||||
<checkbox id="autologinProxy" preference="signon.autologin.proxy"
|
||||
label="&autologinproxy.label;" accesskey="&autologinproxy.accesskey;"
|
||||
tooltiptext="&autologinproxy.tooltip;"/>
|
||||
|
||||
@@ -1 +1 @@
|
||||
28.4.0a1
|
||||
28.4.1
|
||||
@@ -189,7 +189,8 @@ exports.menuitems = [
|
||||
l10nKey: "getMoreDevtoolsCmd",
|
||||
oncommand(event) {
|
||||
let window = event.target.ownerDocument.defaultView;
|
||||
window.openUILinkIn("https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/", "tab");
|
||||
let getMoreURL = Services.prefs.getCharPref("browser.getdevtools.url");
|
||||
window.openUILinkIn(getMoreURL, "tab");
|
||||
}
|
||||
},
|
||||
];
|
||||
@@ -375,6 +375,7 @@ const CurlUtils = {
|
||||
.replace(/\'/g, "\\\'")
|
||||
.replace(/\n/g, "\\n")
|
||||
.replace(/\r/g, "\\r")
|
||||
.replace(/!/g, "\\041")
|
||||
.replace(/[^\x20-\x7E]/g, escapeCharacter) + "'";
|
||||
}
|
||||
|
||||
|
||||
@@ -789,10 +789,6 @@ Location::GetSearch(nsAString& aSearch)
|
||||
NS_IMETHODIMP
|
||||
Location::SetSearch(const nsAString& aSearch)
|
||||
{
|
||||
if (aSearch.IsEmpty()) {
|
||||
return NS_OK; // Ignore empty string
|
||||
}
|
||||
|
||||
nsresult rv = SetSearchInternal(aSearch);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
|
||||
@@ -1105,6 +1105,7 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(layers::LayersBackend aCompos
|
||||
, mIsCapturedFrameInvalid(false)
|
||||
, mPathTransformWillUpdate(false)
|
||||
, mInvalidateCount(0)
|
||||
, mWriteOnly(false) // == !origin-clean
|
||||
{
|
||||
sNumLivingContexts++;
|
||||
|
||||
@@ -2562,7 +2563,8 @@ CanvasRenderingContext2D::CreatePattern(const CanvasImageSource& aSource,
|
||||
// nullptr and set CORSUsed to true for passing the security check in
|
||||
// CanvasUtils::DoDrawImageSecurityCheck().
|
||||
RefPtr<CanvasPattern> pat =
|
||||
new CanvasPattern(this, srcSurf, repeatMode, nullptr, false, true);
|
||||
new CanvasPattern(this, srcSurf, repeatMode, nullptr,
|
||||
imgBitmap.IsWriteOnly(), true);
|
||||
|
||||
return pat.forget();
|
||||
}
|
||||
@@ -4952,6 +4954,10 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
|
||||
aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (canvas->IsWriteOnly()) {
|
||||
SetWriteOnly();
|
||||
}
|
||||
} else if (aImage.IsImageBitmap()) {
|
||||
ImageBitmap& imageBitmap = aImage.GetAsImageBitmap();
|
||||
srcSurf = imageBitmap.PrepareForDrawTarget(mTarget);
|
||||
@@ -4960,6 +4966,10 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
|
||||
return;
|
||||
}
|
||||
|
||||
if (imageBitmap.IsWriteOnly()) {
|
||||
SetWriteOnly();
|
||||
}
|
||||
|
||||
imgSize = gfx::IntSize(imageBitmap.Width(), imageBitmap.Height());
|
||||
}
|
||||
else {
|
||||
@@ -5674,9 +5684,8 @@ CanvasRenderingContext2D::GetImageData(JSContext* aCx, double aSx,
|
||||
|
||||
// Check only if we have a canvas element; if we were created with a docshell,
|
||||
// then it's special internal use.
|
||||
if (mCanvasElement && mCanvasElement->IsWriteOnly() &&
|
||||
!nsContentUtils::IsCallerChrome())
|
||||
{
|
||||
if (IsWriteOnly() ||
|
||||
(mCanvasElement && mCanvasElement->IsWriteOnly() && !nsContentUtils::IsCallerChrome())) {
|
||||
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
|
||||
aError.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
@@ -6320,6 +6329,13 @@ CanvasRenderingContext2D::ShouldForceInactiveLayer(LayerManager* aManager)
|
||||
return !aManager->CanUseCanvasLayerForSize(GetSize());
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::SetWriteOnly() {
|
||||
mWriteOnly = true;
|
||||
if (mCanvasElement) {
|
||||
mCanvasElement->SetWriteOnly();
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CanvasPath, AddRef)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CanvasPath, Release)
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ class SourceSurface;
|
||||
namespace dom {
|
||||
class HTMLImageElementOrSVGImageElementOrHTMLCanvasElementOrHTMLVideoElementOrImageBitmap;
|
||||
typedef HTMLImageElementOrSVGImageElementOrHTMLCanvasElementOrHTMLVideoElementOrImageBitmap CanvasImageSource;
|
||||
class ImageBitmap;
|
||||
class ImageData;
|
||||
class StringOrCanvasGradientOrCanvasPattern;
|
||||
class OwningStringOrCanvasGradientOrCanvasPattern;
|
||||
@@ -1151,6 +1152,17 @@ protected:
|
||||
|
||||
friend struct CanvasBidiProcessor;
|
||||
friend class CanvasDrawObserver;
|
||||
friend class ImageBitmap;
|
||||
|
||||
// For the origin-clean algorithm (mWriteOnly == !origin-clean)
|
||||
// See https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html
|
||||
void SetWriteOnly();
|
||||
|
||||
bool IsWriteOnly() const {
|
||||
return mWriteOnly;
|
||||
}
|
||||
|
||||
bool mWriteOnly;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
||||
+58
-43
@@ -351,29 +351,27 @@ CheckSecurityForHTMLElements(const nsLayoutUtils::SurfaceFromElementResult& aRes
|
||||
*/
|
||||
template<class HTMLElementType>
|
||||
static already_AddRefed<SourceSurface>
|
||||
GetSurfaceFromElement(nsIGlobalObject* aGlobal, HTMLElementType& aElement, ErrorResult& aRv)
|
||||
GetSurfaceFromElement(nsIGlobalObject* aGlobal, HTMLElementType& aElement,
|
||||
bool* aWriteOnly, ErrorResult& aRv)
|
||||
{
|
||||
nsLayoutUtils::SurfaceFromElementResult res =
|
||||
nsLayoutUtils::SurfaceFromElement(&aElement, nsLayoutUtils::SFE_WANT_FIRST_FRAME);
|
||||
|
||||
// check origin-clean
|
||||
if (!CheckSecurityForHTMLElements(res)) {
|
||||
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<SourceSurface> surface = res.GetSourceSurface();
|
||||
|
||||
if (NS_WARN_IF(!surface)) {
|
||||
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Check origin-clean and pass back
|
||||
*aWriteOnly = !CheckSecurityForHTMLElements(res);
|
||||
|
||||
return surface.forget();
|
||||
}
|
||||
|
||||
/*
|
||||
* The specification doesn't allow to create an ImegeBitmap from a vector image.
|
||||
* The specification doesn't allow to create an ImageBitmap from a vector image.
|
||||
* This function is used to check if the given HTMLImageElement contains a
|
||||
* raster image.
|
||||
*/
|
||||
@@ -398,7 +396,7 @@ HasRasterImage(HTMLImageElement& aImageEl)
|
||||
}
|
||||
|
||||
ImageBitmap::ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData,
|
||||
bool aIsPremultipliedAlpha /* = true */)
|
||||
bool aWriteOnly, bool aIsPremultipliedAlpha /* = true */)
|
||||
: mParent(aGlobal)
|
||||
, mData(aData)
|
||||
, mSurface(nullptr)
|
||||
@@ -406,6 +404,7 @@ ImageBitmap::ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData,
|
||||
, mPictureRect(0, 0, aData->GetSize().width, aData->GetSize().height)
|
||||
, mIsPremultipliedAlpha(aIsPremultipliedAlpha)
|
||||
, mIsCroppingAreaOutSideOfSourceImage(false)
|
||||
, mWriteOnly(aWriteOnly)
|
||||
{
|
||||
MOZ_ASSERT(aData, "aData is null in ImageBitmap constructor.");
|
||||
}
|
||||
@@ -698,6 +697,7 @@ ImageBitmap::ToCloneData() const
|
||||
RefPtr<SourceSurface> surface = mData->GetAsSourceSurface();
|
||||
result->mSurface = surface->GetDataSurface();
|
||||
MOZ_ASSERT(result->mSurface);
|
||||
result->mWriteOnly = mWriteOnly;
|
||||
|
||||
return Move(result);
|
||||
}
|
||||
@@ -708,7 +708,7 @@ ImageBitmap::CreateFromCloneData(nsIGlobalObject* aGlobal,
|
||||
{
|
||||
RefPtr<layers::Image> data = CreateImageFromSurface(aData->mSurface);
|
||||
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data,
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, aData->mWriteOnly,
|
||||
aData->mIsPremultipliedAlpha);
|
||||
|
||||
ret->mIsCroppingAreaOutSideOfSourceImage =
|
||||
@@ -724,11 +724,8 @@ ImageBitmap::CreateFromOffscreenCanvas(nsIGlobalObject* aGlobal,
|
||||
OffscreenCanvas& aOffscreenCanvas,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
// Check origin-clean.
|
||||
if (aOffscreenCanvas.IsWriteOnly()) {
|
||||
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
// Check origin-clean
|
||||
bool writeOnly = aOffscreenCanvas.IsWriteOnly();
|
||||
|
||||
nsLayoutUtils::SurfaceFromElementResult res =
|
||||
nsLayoutUtils::SurfaceFromOffscreenCanvas(&aOffscreenCanvas,
|
||||
@@ -744,7 +741,7 @@ ImageBitmap::CreateFromOffscreenCanvas(nsIGlobalObject* aGlobal,
|
||||
RefPtr<layers::Image> data =
|
||||
CreateImageFromSurface(surface);
|
||||
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
|
||||
return ret.forget();
|
||||
}
|
||||
|
||||
@@ -757,16 +754,19 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLImageElement& aImageEl
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
// Check if the image element is a bitmap (e.g. it's a vector graphic) or not.
|
||||
if (!HasRasterImage(aImageEl)) {
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool writeOnly = true;
|
||||
|
||||
// Get the SourceSurface out from the image element and then do security
|
||||
// checking.
|
||||
RefPtr<SourceSurface> surface = GetSurfaceFromElement(aGlobal, aImageEl, aRv);
|
||||
RefPtr<SourceSurface> surface = GetSurfaceFromElement(aGlobal, aImageEl,
|
||||
&writeOnly, aRv);
|
||||
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return nullptr;
|
||||
@@ -780,7 +780,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLImageElement& aImageEl
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
|
||||
|
||||
// Set the picture rectangle.
|
||||
if (ret && aCropRect.isSome()) {
|
||||
@@ -812,13 +812,13 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLVideoElement& aVideoEl
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool writeOnly = true;
|
||||
|
||||
// Check security.
|
||||
nsCOMPtr<nsIPrincipal> principal = aVideoEl.GetCurrentVideoPrincipal();
|
||||
bool CORSUsed = aVideoEl.GetCORSMode() != CORS_NONE;
|
||||
if (!CheckSecurityForHTMLElements(false, CORSUsed, principal)) {
|
||||
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
writeOnly = !CheckSecurityForHTMLElements(false, CORSUsed, principal);
|
||||
|
||||
// Create ImageBitmap.
|
||||
ImageContainer *container = aVideoEl.GetImageContainer();
|
||||
@@ -834,7 +834,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLVideoElement& aVideoEl
|
||||
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
|
||||
|
||||
// Set the picture rectangle.
|
||||
if (ret && aCropRect.isSome()) {
|
||||
@@ -856,12 +856,18 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvas
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<SourceSurface> surface = GetSurfaceFromElement(aGlobal, aCanvasEl, aRv);
|
||||
bool writeOnly = true;
|
||||
|
||||
RefPtr<SourceSurface> surface = GetSurfaceFromElement(aGlobal, aCanvasEl, &writeOnly, aRv);
|
||||
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!writeOnly) {
|
||||
writeOnly = aCanvasEl.IsWriteOnly();
|
||||
}
|
||||
|
||||
// Crop the source surface if needed.
|
||||
RefPtr<SourceSurface> croppedSurface;
|
||||
IntRect cropRect = aCropRect.valueOr(IntRect());
|
||||
@@ -874,8 +880,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvas
|
||||
aCropRect.isSome()) {
|
||||
// The _surface_ must be a DataSourceSurface.
|
||||
MOZ_ASSERT(surface->GetType() == SurfaceType::DATA,
|
||||
"The snapshot SourceSurface from WebGL rendering contest is not \
|
||||
DataSourceSurface.");
|
||||
"The snapshot SourceSurface from WebGL rendering contest is not DataSourceSurface.");
|
||||
RefPtr<DataSourceSurface> dataSurface = surface->GetDataSurface();
|
||||
croppedSurface = CropAndCopyDataSourceSurface(dataSurface, cropRect);
|
||||
cropRect.MoveTo(0, 0);
|
||||
@@ -897,7 +902,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvas
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
|
||||
|
||||
// Set the picture rectangle.
|
||||
if (ret && aCropRect.isSome()) {
|
||||
@@ -958,9 +963,12 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Create an ImageBimtap.
|
||||
// Create an ImageBitmap.
|
||||
// ImageData's underlying data is not alpha-premultiplied.
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, false);
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal,
|
||||
data,
|
||||
false /* write-only */,
|
||||
false /* alpha-premult */);
|
||||
|
||||
// The cropping information has been handled in the CreateImageFromRawData()
|
||||
// function.
|
||||
@@ -975,11 +983,8 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData,
|
||||
ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, CanvasRenderingContext2D& aCanvasCtx,
|
||||
const Maybe<IntRect>& aCropRect, ErrorResult& aRv)
|
||||
{
|
||||
// Check origin-clean.
|
||||
if (aCanvasCtx.GetCanvas()->IsWriteOnly()) {
|
||||
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
// Check origin-clean
|
||||
bool writeOnly = aCanvasCtx.GetCanvas()->IsWriteOnly() || aCanvasCtx.IsWriteOnly();
|
||||
|
||||
RefPtr<SourceSurface> surface = aCanvasCtx.GetSurfaceSnapshot();
|
||||
|
||||
@@ -1001,7 +1006,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, CanvasRenderingContext2D&
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
|
||||
|
||||
// Set the picture rectangle.
|
||||
if (ret && aCropRect.isSome()) {
|
||||
@@ -1024,7 +1029,10 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageBitmap& aImageBitmap,
|
||||
}
|
||||
|
||||
RefPtr<layers::Image> data = aImageBitmap.mData;
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, aImageBitmap.mIsPremultipliedAlpha);
|
||||
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal,
|
||||
data,
|
||||
aImageBitmap.mWriteOnly,
|
||||
aImageBitmap.mIsPremultipliedAlpha);
|
||||
|
||||
// Set the picture rectangle.
|
||||
if (ret && aCropRect.isSome()) {
|
||||
@@ -1295,7 +1303,7 @@ private:
|
||||
}
|
||||
|
||||
// Create ImageBitmap object.
|
||||
RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(mGlobalObject, data);
|
||||
RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(mGlobalObject, data, false /* write-only */);
|
||||
|
||||
// Set mIsCroppingAreaOutSideOfSourceImage.
|
||||
imageBitmap->SetIsCroppingAreaOutSideOfSourceImage(sourceSize, originalCropRect);
|
||||
@@ -1391,7 +1399,7 @@ private:
|
||||
}
|
||||
|
||||
// Create ImageBitmap object.
|
||||
RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(mGlobalObject, data);
|
||||
RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(mGlobalObject, data, false /* write-only */);
|
||||
|
||||
// Set mIsCroppingAreaOutSideOfSourceImage.
|
||||
imageBitmap->SetIsCroppingAreaOutSideOfSourceImage(sourceSize, originalCropRect);
|
||||
@@ -1486,14 +1494,19 @@ ImageBitmap::ReadStructuredClone(JSContext* aCx,
|
||||
uint32_t picRectHeight_;
|
||||
uint32_t isPremultipliedAlpha_;
|
||||
uint32_t isCroppingAreaOutSideOfSourceImage_;
|
||||
uint32_t writeOnly;
|
||||
uint32_t dummy;
|
||||
|
||||
if (!JS_ReadUint32Pair(aReader, &picRectX_, &picRectY_) ||
|
||||
!JS_ReadUint32Pair(aReader, &picRectWidth_, &picRectHeight_) ||
|
||||
!JS_ReadUint32Pair(aReader, &isPremultipliedAlpha_,
|
||||
&isCroppingAreaOutSideOfSourceImage_)) {
|
||||
&isCroppingAreaOutSideOfSourceImage_) ||
|
||||
!JS_ReadUint32Pair(aReader, &writeOnly, &dummy)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(dummy == 0);
|
||||
|
||||
int32_t picRectX = BitwiseCast<int32_t>(picRectX_);
|
||||
int32_t picRectY = BitwiseCast<int32_t>(picRectY_);
|
||||
int32_t picRectWidth = BitwiseCast<int32_t>(picRectWidth_);
|
||||
@@ -1512,7 +1525,7 @@ ImageBitmap::ReadStructuredClone(JSContext* aCx,
|
||||
{
|
||||
RefPtr<layers::Image> img = CreateImageFromSurface(aClonedSurfaces[aIndex]);
|
||||
RefPtr<ImageBitmap> imageBitmap =
|
||||
new ImageBitmap(aParent, img, isPremultipliedAlpha_);
|
||||
new ImageBitmap(aParent, img, !!writeOnly, isPremultipliedAlpha_);
|
||||
|
||||
imageBitmap->mIsCroppingAreaOutSideOfSourceImage =
|
||||
isCroppingAreaOutSideOfSourceImage_;
|
||||
@@ -1547,6 +1560,7 @@ ImageBitmap::WriteStructuredClone(JSStructuredCloneWriter* aWriter,
|
||||
const uint32_t picRectHeight = BitwiseCast<uint32_t>(aImageBitmap->mPictureRect.height);
|
||||
const uint32_t isPremultipliedAlpha = aImageBitmap->mIsPremultipliedAlpha ? 1 : 0;
|
||||
const uint32_t isCroppingAreaOutSideOfSourceImage = aImageBitmap->mIsCroppingAreaOutSideOfSourceImage ? 1 : 0;
|
||||
const uint32_t isWriteOnly = aImageBitmap->mWriteOnly ? 1 : 0;
|
||||
|
||||
// Indexing the cloned surfaces and send the index to the receiver.
|
||||
uint32_t index = aClonedSurfaces.Length();
|
||||
@@ -1555,7 +1569,8 @@ ImageBitmap::WriteStructuredClone(JSStructuredCloneWriter* aWriter,
|
||||
NS_WARN_IF(!JS_WriteUint32Pair(aWriter, picRectX, picRectY)) ||
|
||||
NS_WARN_IF(!JS_WriteUint32Pair(aWriter, picRectWidth, picRectHeight)) ||
|
||||
NS_WARN_IF(!JS_WriteUint32Pair(aWriter, isPremultipliedAlpha,
|
||||
isCroppingAreaOutSideOfSourceImage))) {
|
||||
isCroppingAreaOutSideOfSourceImage)) ||
|
||||
NS_WARN_IF(!JS_WriteUint32Pair(aWriter, isWriteOnly, 0))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ struct ImageBitmapCloneData final
|
||||
gfx::IntRect mPictureRect;
|
||||
bool mIsPremultipliedAlpha;
|
||||
bool mIsCroppingAreaOutSideOfSourceImage;
|
||||
bool mWriteOnly;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -161,6 +162,10 @@ public:
|
||||
template<typename T>
|
||||
friend class MapDataIntoBufferSource;
|
||||
|
||||
bool IsWriteOnly() const {
|
||||
return mWriteOnly;
|
||||
}
|
||||
|
||||
// Mozilla Extensions
|
||||
ImageBitmapFormat
|
||||
FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPossibleFormats,
|
||||
@@ -197,6 +202,7 @@ protected:
|
||||
* CreateInternal(from ImageData) method.
|
||||
*/
|
||||
ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData,
|
||||
bool aWriteOnly,
|
||||
bool aIsPremultipliedAlpha = true);
|
||||
|
||||
virtual ~ImageBitmap();
|
||||
@@ -280,6 +286,12 @@ protected:
|
||||
*/
|
||||
bool mIsCroppingAreaOutSideOfSourceImage;
|
||||
|
||||
/*
|
||||
* Write-Only flag is set to true if this image has been generated from a
|
||||
* cross-origin source. This is the opposite of what is called 'origin-clean'
|
||||
* in the spec.
|
||||
*/
|
||||
bool mWriteOnly;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
||||
@@ -63,6 +63,11 @@ ImageBitmapRenderingContext::TransferFromImageBitmap(ImageBitmap& aImageBitmap)
|
||||
if (!mImage) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if ImageBitmap is tainted, and if so flag the canvas tainted too.
|
||||
if (aImageBitmap.IsWriteOnly() && mCanvasElement) {
|
||||
mCanvasElement->SetWriteOnly();
|
||||
}
|
||||
|
||||
Redraw(gfxRect(0, 0, mWidth, mHeight));
|
||||
}
|
||||
|
||||
@@ -275,8 +275,9 @@ struct TexImageSourceAdapter final : public TexImageSource
|
||||
mPboOffset = pboOffset;
|
||||
}
|
||||
|
||||
TexImageSourceAdapter(const dom::ImageBitmap* imageBitmap, ErrorResult*) {
|
||||
TexImageSourceAdapter(const dom::ImageBitmap* imageBitmap, ErrorResult* out_error) {
|
||||
mImageBitmap = imageBitmap;
|
||||
mOut_error = out_error;
|
||||
}
|
||||
|
||||
TexImageSourceAdapter(const dom::ImageData* imageData, ErrorResult*) {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "GLBlitHelper.h"
|
||||
#include "GLContext.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/dom/HTMLCanvasElement.h"
|
||||
#include "mozilla/dom/HTMLVideoElement.h"
|
||||
#include "mozilla/dom/ImageBitmap.h"
|
||||
#include "mozilla/dom/ImageData.h"
|
||||
@@ -214,9 +215,18 @@ FromPboOffset(WebGLContext* webgl, const char* funcName, TexImageTarget target,
|
||||
static UniquePtr<webgl::TexUnpackBlob>
|
||||
FromImageBitmap(WebGLContext* webgl, const char* funcName, TexImageTarget target,
|
||||
uint32_t width, uint32_t height, uint32_t depth,
|
||||
const dom::ImageBitmap& imageBitmap)
|
||||
const dom::ImageBitmap& imageBitmap, ErrorResult* aRv)
|
||||
{
|
||||
if (imageBitmap.IsWriteOnly()) {
|
||||
aRv->Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
UniquePtr<dom::ImageBitmapCloneData> cloneData = Move(imageBitmap.ToCloneData());
|
||||
if (!cloneData) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const RefPtr<gfx::DataSourceSurface> surf = cloneData->mSurface;
|
||||
|
||||
////
|
||||
@@ -293,6 +303,14 @@ WebGLContext::FromDomElem(const char* funcName, TexImageTarget target, uint32_t
|
||||
uint32_t height, uint32_t depth, const dom::Element& elem,
|
||||
ErrorResult* const out_error)
|
||||
{
|
||||
if (elem.IsHTMLElement(nsGkAtoms::canvas)) {
|
||||
const dom::HTMLCanvasElement* canvas = static_cast<const dom::HTMLCanvasElement*>(&elem);
|
||||
if (canvas->IsWriteOnly()) {
|
||||
out_error->Throw(NS_ERROR_DOM_SECURITY_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t flags = nsLayoutUtils::SFE_WANT_IMAGE_SURFACE |
|
||||
nsLayoutUtils::SFE_USE_ELEMENT_SIZE_IF_VECTOR;
|
||||
|
||||
@@ -412,7 +430,7 @@ WebGLContext::From(const char* funcName, TexImageTarget target, GLsizei rawWidth
|
||||
|
||||
if (src.mImageBitmap) {
|
||||
return FromImageBitmap(this, funcName, target, width, height, depth,
|
||||
*(src.mImageBitmap));
|
||||
*(src.mImageBitmap), src.mOut_error);
|
||||
}
|
||||
|
||||
if (src.mImageData) {
|
||||
|
||||
@@ -270,13 +270,22 @@ function testSecurityErrors() {
|
||||
}
|
||||
|
||||
function checkPromiseFailedWithSecurityError(p) {
|
||||
return p.then( function(reason) { ok(false, "Did not get SecurityError with unclean source. ImageBitmap was created successfully."); },
|
||||
function(reason) { if (reason == "SecurityError: The operation is insecure.") {
|
||||
ok(true, reason);
|
||||
}
|
||||
else {
|
||||
ok(false, "Did not get SecurityError with unclean source. Error Message: " + reason);
|
||||
}});
|
||||
return p.then(imageBitmap => {
|
||||
ok(!!imageBitmap, "ImageBitmaps are always created");
|
||||
const context = document.createElement("canvas").getContext("2d");
|
||||
context.drawImage(imageBitmap, 0, 0);
|
||||
try {
|
||||
context.getImageData(0, 0, 1, 1);
|
||||
ok(false, "Did not get SecurityError with unclean source. ImageBitmap was created successfully.");
|
||||
} catch (ex) {
|
||||
if (ex == "SecurityError: The operation is insecure.") {
|
||||
ok(true, ex);
|
||||
}
|
||||
else {
|
||||
ok(false, "Did not get SecurityError with unclean source. Error Message: " + ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.all([
|
||||
|
||||
@@ -1000,7 +1000,7 @@ HTMLCanvasElement::GetSize()
|
||||
}
|
||||
|
||||
bool
|
||||
HTMLCanvasElement::IsWriteOnly()
|
||||
HTMLCanvasElement::IsWriteOnly() const
|
||||
{
|
||||
return mWriteOnly;
|
||||
}
|
||||
|
||||
@@ -224,9 +224,9 @@ public:
|
||||
nsIntSize GetSize();
|
||||
|
||||
/**
|
||||
* Determine whether the canvas is write-only.
|
||||
* Determine whether the canvas is write-only (tainted).
|
||||
*/
|
||||
bool IsWriteOnly();
|
||||
bool IsWriteOnly() const;
|
||||
|
||||
/**
|
||||
* Force the canvas to be write-only.
|
||||
|
||||
@@ -421,11 +421,10 @@ HTMLTableElement::CreateTHead()
|
||||
void
|
||||
HTMLTableElement::DeleteTHead()
|
||||
{
|
||||
HTMLTableSectionElement* tHead = GetTHead();
|
||||
RefPtr<HTMLTableSectionElement> tHead = GetTHead();
|
||||
if (tHead) {
|
||||
mozilla::ErrorResult rv;
|
||||
mozilla::IgnoredErrorResult rv;
|
||||
nsINode::RemoveChild(*tHead, rv);
|
||||
MOZ_ASSERT(!rv.Failed());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,11 +451,10 @@ HTMLTableElement::CreateTFoot()
|
||||
void
|
||||
HTMLTableElement::DeleteTFoot()
|
||||
{
|
||||
HTMLTableSectionElement* tFoot = GetTFoot();
|
||||
RefPtr<HTMLTableSectionElement> tFoot = GetTFoot();
|
||||
if (tFoot) {
|
||||
mozilla::ErrorResult rv;
|
||||
mozilla::IgnoredErrorResult rv;
|
||||
nsINode::RemoveChild(*tFoot, rv);
|
||||
MOZ_ASSERT(!rv.Failed());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -483,11 +481,10 @@ HTMLTableElement::CreateCaption()
|
||||
void
|
||||
HTMLTableElement::DeleteCaption()
|
||||
{
|
||||
HTMLTableCaptionElement* caption = GetCaption();
|
||||
RefPtr<HTMLTableCaptionElement> caption = GetCaption();
|
||||
if (caption) {
|
||||
mozilla::ErrorResult rv;
|
||||
mozilla::IgnoredErrorResult rv;
|
||||
nsINode::RemoveChild(*caption, rv);
|
||||
MOZ_ASSERT(!rv.Failed());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
|
||||
refIndex = (uint32_t)aValue;
|
||||
}
|
||||
|
||||
nsINode* row = rows->Item(refIndex);
|
||||
nsCOMPtr<nsINode> row = rows->Item(refIndex);
|
||||
if (!row) {
|
||||
aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
|
||||
return;
|
||||
|
||||
@@ -85,3 +85,5 @@ BlockScriptWithWrongMimeType=Script from “%1$S” was blocked because of a dis
|
||||
|
||||
# LOCALIZATION NOTE: Do not translate "data: URI".
|
||||
BlockTopLevelDataURINavigation=Navigation to toplevel data: URI not allowed (Blocked loading of: “%1$S”)
|
||||
|
||||
BlockSubresourceFTP=Loading FTP subresource within http(s) page not allowed (Blocked loading of: “%1$S”)
|
||||
@@ -2049,6 +2049,16 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Disallow access to null principal pages
|
||||
nsCOMPtr<nsIPrincipal> principal = aWindow->GetExtantDoc()->NodePrincipal();
|
||||
if (principal->GetIsNullPrincipal()) {
|
||||
RefPtr<MediaStreamError> error =
|
||||
new MediaStreamError(aWindow,
|
||||
NS_LITERAL_STRING("NotAllowedError"));
|
||||
onFailure->OnError(error);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!Preferences::GetBool("media.navigator.video.enabled", true)) {
|
||||
c.mVideo.SetAsBoolean() = false;
|
||||
}
|
||||
@@ -2188,7 +2198,6 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
|
||||
StreamListeners* listeners = AddWindowID(windowID);
|
||||
|
||||
// Create a disabled listener to act as a placeholder
|
||||
nsIPrincipal* principal = aWindow->GetExtantDoc()->NodePrincipal();
|
||||
RefPtr<GetUserMediaCallbackMediaStreamListener> listener =
|
||||
new GetUserMediaCallbackMediaStreamListener(mMediaThread, windowID,
|
||||
MakePrincipalHandle(principal));
|
||||
|
||||
@@ -61,7 +61,7 @@ void VideoFrameContainer::UpdatePrincipalHandleForFrameIDLocked(const PrincipalH
|
||||
mFrameIDForPendingPrincipalHandle = aFrameID;
|
||||
}
|
||||
|
||||
static void
|
||||
static bool
|
||||
SetImageToBlackPixel(PlanarYCbCrImage* aImage)
|
||||
{
|
||||
uint8_t blackPixel[] = { 0x10, 0x80, 0x80 };
|
||||
@@ -72,7 +72,7 @@ SetImageToBlackPixel(PlanarYCbCrImage* aImage)
|
||||
data.mCrChannel = blackPixel + 2;
|
||||
data.mYStride = data.mCbCrStride = 1;
|
||||
data.mPicSize = data.mYSize = data.mCbCrSize = gfx::IntSize(1, 1);
|
||||
aImage->CopyData(data);
|
||||
return aImage->CopyData(data);
|
||||
}
|
||||
|
||||
class VideoFrameContainerInvalidateRunnable : public Runnable {
|
||||
@@ -122,11 +122,13 @@ void VideoFrameContainer::SetCurrentFrames(const VideoSegment& aSegment)
|
||||
|
||||
if (frame->GetForceBlack()) {
|
||||
if (!mBlackImage) {
|
||||
mBlackImage = GetImageContainer()->CreatePlanarYCbCrImage();
|
||||
if (mBlackImage) {
|
||||
RefPtr<Image> blackImage = GetImageContainer()->CreatePlanarYCbCrImage();
|
||||
if (blackImage) {
|
||||
// Sets the image to a single black pixel, which will be scaled to
|
||||
// fill the rendered size.
|
||||
SetImageToBlackPixel(mBlackImage->AsPlanarYCbCrImage());
|
||||
if (SetImageToBlackPixel(blackImage->AsPlanarYCbCrImage())) {
|
||||
mBlackImage = blackImage;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mBlackImage) {
|
||||
|
||||
@@ -92,6 +92,55 @@ nsContentSecurityManager::AllowTopLevelNavigationToDataURI(nsIChannel* aChannel)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* static */ nsresult
|
||||
nsContentSecurityManager::CheckFTPSubresourceLoad(nsIChannel* aChannel)
|
||||
{
|
||||
// We dissallow using FTP resources as a subresource everywhere.
|
||||
// The only valid way to use FTP resources is loading it as
|
||||
// a top level document.
|
||||
|
||||
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
|
||||
if (!loadInfo) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsContentPolicyType type = loadInfo->GetExternalContentPolicyType();
|
||||
if (type == nsIContentPolicy::TYPE_DOCUMENT) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsresult rv = NS_GetFinalChannelURI(aChannel, getter_AddRefs(uri));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!uri) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool isFtpURI = (NS_SUCCEEDED(uri->SchemeIs("ftp", &isFtpURI)) && isFtpURI);
|
||||
if (!isFtpURI) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc;
|
||||
if (nsINode* node = loadInfo->LoadingNode()) {
|
||||
doc = node->OwnerDoc();
|
||||
}
|
||||
|
||||
nsAutoCString spec;
|
||||
uri->GetSpec(spec);
|
||||
NS_ConvertUTF8toUTF16 specUTF16(NS_UnescapeURL(spec));
|
||||
const char16_t* params[] = { specUTF16.get() };
|
||||
|
||||
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
|
||||
NS_LITERAL_CSTRING("FTP_URI_BLOCKED"),
|
||||
doc,
|
||||
nsContentUtils::eSECURITY_PROPERTIES,
|
||||
"BlockSubresourceFTP",
|
||||
params, ArrayLength(params));
|
||||
|
||||
return NS_ERROR_CONTENT_BLOCKED;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
ValidateSecurityFlags(nsILoadInfo* aLoadInfo)
|
||||
{
|
||||
@@ -574,6 +623,10 @@ nsContentSecurityManager::doContentSecurityCheck(nsIChannel* aChannel,
|
||||
rv = DoContentSecurityChecks(aChannel, loadInfo);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Apply this after CSP checks to allow CSP reporting.
|
||||
rv = CheckFTPSubresourceLoad(aChannel);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// now lets set the initalSecurityFlag for subsequent calls
|
||||
loadInfo->SetInitialSecurityCheckDone(true);
|
||||
|
||||
@@ -591,6 +644,9 @@ nsContentSecurityManager::AsyncOnChannelRedirect(nsIChannel* aOldChannel,
|
||||
// Are we enforcing security using LoadInfo?
|
||||
if (loadInfo && loadInfo->GetEnforceSecurity()) {
|
||||
nsresult rv = CheckChannel(aNewChannel);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = CheckFTPSubresourceLoad(aNewChannel);
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
aOldChannel->Cancel(rv);
|
||||
return rv;
|
||||
|
||||
@@ -36,6 +36,7 @@ public:
|
||||
|
||||
private:
|
||||
static nsresult CheckChannel(nsIChannel* aChannel);
|
||||
static nsresult CheckFTPSubresourceLoad(nsIChannel* aChannel);
|
||||
|
||||
virtual ~nsContentSecurityManager() {}
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ void
|
||||
nsSMILAnimationController::NotifyRefreshDriverCreated(
|
||||
nsRefreshDriver* aRefreshDriver)
|
||||
{
|
||||
if (!mPauseState) {
|
||||
if (!mPauseState && mChildContainerTable.Count()) {
|
||||
MaybeStartSampling(aRefreshDriver);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ public:
|
||||
@param extraPtCount The number of extra points the path should
|
||||
preallocate for.
|
||||
*/
|
||||
void incReserve(unsigned extraPtCount);
|
||||
void incReserve(int extraPtCount);
|
||||
|
||||
/** Set the beginning of the next contour to the point (x,y).
|
||||
|
||||
|
||||
@@ -716,9 +716,11 @@ void SkPath::setConvexity(Convexity c) {
|
||||
fFirstDirection = SkPathPriv::kUnknown_FirstDirection; \
|
||||
} while (0)
|
||||
|
||||
void SkPath::incReserve(U16CPU inc) {
|
||||
void SkPath::incReserve(int inc) {
|
||||
SkDEBUGCODE(this->validate();)
|
||||
SkPathRef::Editor(&fPathRef, inc, inc);
|
||||
if (inc > 0) {
|
||||
SkPathRef::Editor(&fPathRef, inc, inc);
|
||||
}
|
||||
SkDEBUGCODE(this->validate();)
|
||||
}
|
||||
|
||||
@@ -1742,7 +1744,7 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const {
|
||||
|
||||
if (this != dst) {
|
||||
dst->fFillType = fFillType;
|
||||
dst->fConvexity = fConvexity;
|
||||
dst->fConvexity = kUnknown_Convexity;
|
||||
dst->fIsVolatile = fIsVolatile;
|
||||
}
|
||||
|
||||
|
||||
@@ -152,13 +152,18 @@ void* GrBufferAllocPool::makeSpace(size_t size,
|
||||
BufferBlock& back = fBlocks.back();
|
||||
size_t usedBytes = back.fBuffer->gpuMemorySize() - back.fBytesFree;
|
||||
size_t pad = GrSizeAlignUpPad(usedBytes, alignment);
|
||||
if ((size + pad) <= back.fBytesFree) {
|
||||
SkSafeMath safeMath;
|
||||
size_t alignedSize = safeMath.add(pad, size);
|
||||
if (!safeMath.ok()) {
|
||||
return nullptr;
|
||||
}
|
||||
if (alignedSize <= back.fBytesFree) {
|
||||
memset((void*)(reinterpret_cast<intptr_t>(fBufferPtr) + usedBytes), 0, pad);
|
||||
usedBytes += pad;
|
||||
*offset = usedBytes;
|
||||
*buffer = back.fBuffer;
|
||||
back.fBytesFree -= size + pad;
|
||||
fBytesInUse += size + pad;
|
||||
back.fBytesFree -= alignedSize;
|
||||
fBytesInUse += alignedSize;
|
||||
VALIDATE();
|
||||
return (void*)(reinterpret_cast<intptr_t>(fBufferPtr) + usedBytes);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,17 @@
|
||||
// compression, then instead of treating the pixel data as 0RGB it is treated
|
||||
// as ARGB, but only if one or more of the A values are non-zero.
|
||||
//
|
||||
// Clipboard variants.
|
||||
// - It's the BMP format used for BMP images captured from the clipboard.
|
||||
// - It is missing the file header, containing the BM signature and the data
|
||||
// offset. Instead the data begins after the header.
|
||||
// - If it uses BITFIELDS compression, then there is always an additional 12
|
||||
// bytes of data after the header that must be read. In WinBMPv4+, the masks
|
||||
// are supposed to be included in the header size, which are the values we use
|
||||
// for decoding purposes, but there is additional three masks following the
|
||||
// header which must be skipped to get to the pixel data.
|
||||
//
|
||||
//
|
||||
// OS/2 VERSIONS OF THE BMP FORMAT
|
||||
// -------------------------------
|
||||
// OS2-BMPv1.
|
||||
@@ -168,10 +179,12 @@ static mozilla::LazyLogModule sBMPLog("BMPDecoder");
|
||||
// The length of the mBIHSize field in the info header.
|
||||
static const uint32_t BIHSIZE_FIELD_LENGTH = 4;
|
||||
|
||||
nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength)
|
||||
nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength,
|
||||
bool aForClipboard)
|
||||
: Decoder(aImage)
|
||||
, mLexer(Transition::To(aState, aLength), Transition::TerminateSuccess())
|
||||
, mIsWithinICO(false)
|
||||
, mIsForClipboard(aForClipboard)
|
||||
, mMayHaveTransparency(false)
|
||||
, mDoesHaveTransparency(false)
|
||||
, mNumColors(0)
|
||||
@@ -188,14 +201,16 @@ nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength)
|
||||
// Constructor for normal BMP files or from the clipboard.
|
||||
nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, bool aForClipboard)
|
||||
: nsBMPDecoder(aImage,
|
||||
aForClipboard ? State::CLIPBOARD_HEADER : State::FILE_HEADER,
|
||||
aForClipboard ? BIHSIZE_FIELD_LENGTH : FILE_HEADER_LENGTH)
|
||||
aForClipboard ? State::INFO_HEADER_SIZE : State::FILE_HEADER,
|
||||
aForClipboard ? BIHSIZE_FIELD_LENGTH : FILE_HEADER_LENGTH,
|
||||
aForClipboard)
|
||||
{
|
||||
}
|
||||
|
||||
// Constructor used for WinBMPv3-ICO files, which lack a file header.
|
||||
nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, uint32_t aDataOffset)
|
||||
: nsBMPDecoder(aImage, State::INFO_HEADER_SIZE, BIHSIZE_FIELD_LENGTH)
|
||||
: nsBMPDecoder(aImage, State::INFO_HEADER_SIZE, BIHSIZE_FIELD_LENGTH,
|
||||
/* aForClipboard */ false)
|
||||
{
|
||||
SetIsWithinICO();
|
||||
|
||||
@@ -457,7 +472,6 @@ nsBMPDecoder::DoDecode(SourceBufferIterator& aIterator, IResumable* aOnResume)
|
||||
[=](State aState, const char* aData, size_t aLength) {
|
||||
switch (aState) {
|
||||
case State::FILE_HEADER: return ReadFileHeader(aData, aLength);
|
||||
case State::CLIPBOARD_HEADER: return ReadClipboardHeader(aData, aLength);
|
||||
case State::INFO_HEADER_SIZE: return ReadInfoHeaderSize(aData, aLength);
|
||||
case State::INFO_HEADER_REST: return ReadInfoHeaderRest(aData, aLength);
|
||||
case State::BITFIELDS: return ReadBitfields(aData, aLength);
|
||||
@@ -491,14 +505,6 @@ nsBMPDecoder::ReadFileHeader(const char* aData, size_t aLength)
|
||||
return Transition::To(State::INFO_HEADER_SIZE, BIHSIZE_FIELD_LENGTH);
|
||||
}
|
||||
|
||||
LexerTransition<nsBMPDecoder::State>
|
||||
nsBMPDecoder::ReadClipboardHeader(const char* aData, size_t aLength)
|
||||
{
|
||||
// With the clipboard, the data offset is the header length.
|
||||
mH.mDataOffset = LittleEndian::readUint32(aData);
|
||||
return ReadInfoHeaderSize(aData, aLength);
|
||||
}
|
||||
|
||||
// We read the info header in two steps: (a) read the mBIHSize field to
|
||||
// determine how long the header is; (b) read the rest of the header.
|
||||
LexerTransition<nsBMPDecoder::State>
|
||||
@@ -609,6 +615,13 @@ nsBMPDecoder::ReadInfoHeaderRest(const char* aData, size_t aLength)
|
||||
// Bitfields are present in the info header, so we can read them
|
||||
// immediately.
|
||||
mBitFields.ReadFromHeader(aData + 36, /* aReadAlpha = */ true);
|
||||
|
||||
// If this came from the clipboard, then we know that even if the header
|
||||
// explicitly includes the bitfield masks, we need to add an additional
|
||||
// offset for the start of the RGB data.
|
||||
if (mIsForClipboard) {
|
||||
mH.mDataOffset += BitFields::LENGTH;
|
||||
}
|
||||
} else {
|
||||
// Bitfields are present after the info header, so we will read them in
|
||||
// ReadBitfields().
|
||||
@@ -723,6 +736,12 @@ nsBMPDecoder::ReadColorTable(const char* aData, size_t aLength)
|
||||
aData += mBytesPerColor;
|
||||
}
|
||||
|
||||
// If we are decoding a BMP from the clipboard, we did not know the data
|
||||
// offset in advance. It is defined as just after the header and color table.
|
||||
if (mIsForClipboard) {
|
||||
mH.mDataOffset += mPreGapLength;
|
||||
}
|
||||
|
||||
// We know how many bytes we've read so far (mPreGapLength) and we know the
|
||||
// offset of the pixel data (mH.mDataOffset), so we can determine the length
|
||||
// of the gap (possibly zero) between the color table and the pixel data.
|
||||
|
||||
@@ -152,7 +152,6 @@ private:
|
||||
|
||||
enum class State {
|
||||
FILE_HEADER,
|
||||
CLIPBOARD_HEADER,
|
||||
INFO_HEADER_SIZE,
|
||||
INFO_HEADER_REST,
|
||||
BITFIELDS,
|
||||
@@ -172,7 +171,7 @@ private:
|
||||
nsBMPDecoder(RasterImage* aImage, uint32_t aDataOffset);
|
||||
|
||||
// Helper constructor called by the other two.
|
||||
nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength);
|
||||
nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength, bool aForClipboard);
|
||||
|
||||
int32_t AbsoluteHeight() const { return abs(mH.mHeight); }
|
||||
|
||||
@@ -181,7 +180,6 @@ private:
|
||||
void FinishRow();
|
||||
|
||||
LexerTransition<State> ReadFileHeader(const char* aData, size_t aLength);
|
||||
LexerTransition<State> ReadClipboardHeader(const char* aData, size_t aLength);
|
||||
LexerTransition<State> ReadInfoHeaderSize(const char* aData, size_t aLength);
|
||||
LexerTransition<State> ReadInfoHeaderRest(const char* aData, size_t aLength);
|
||||
LexerTransition<State> ReadBitfields(const char* aData, size_t aLength);
|
||||
@@ -200,6 +198,9 @@ private:
|
||||
// If the BMP is within an ICO file our treatment of it differs slightly.
|
||||
bool mIsWithinICO;
|
||||
|
||||
// If the BMP is decoded from the clipboard, we start with a data offset.
|
||||
bool mIsForClipboard;
|
||||
|
||||
bmp::BitFields mBitFields;
|
||||
|
||||
// Might the image have transparency? Determined from the headers during
|
||||
|
||||
+5
-2
@@ -567,8 +567,11 @@ class MOZ_NON_PARAM alignas(8) Value
|
||||
}
|
||||
|
||||
bool isMagic(JSWhyMagic why) const {
|
||||
MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why);
|
||||
return isMagic();
|
||||
if (!isMagic()) {
|
||||
return false;
|
||||
}
|
||||
MOZ_RELEASE_ASSERT(data.s.payload.why == why);
|
||||
return true;
|
||||
}
|
||||
|
||||
JS::TraceKind traceKind() const {
|
||||
|
||||
@@ -102,7 +102,6 @@ GetObject(const MDefinition* ins)
|
||||
case MDefinition::Op_SetDisjointTypedElements:
|
||||
case MDefinition::Op_ArrayPopShift:
|
||||
case MDefinition::Op_ArrayPush:
|
||||
case MDefinition::Op_ArraySlice:
|
||||
case MDefinition::Op_LoadTypedArrayElementHole:
|
||||
case MDefinition::Op_StoreTypedArrayElementHole:
|
||||
case MDefinition::Op_LoadFixedSlot:
|
||||
@@ -126,6 +125,7 @@ GetObject(const MDefinition* ins)
|
||||
object = ins->getOperand(0);
|
||||
break;
|
||||
case MDefinition::Op_GetPropertyCache:
|
||||
case MDefinition::Op_CallGetProperty:
|
||||
case MDefinition::Op_LoadTypedArrayElementStatic:
|
||||
case MDefinition::Op_StoreTypedArrayElementStatic:
|
||||
case MDefinition::Op_GetDOMProperty:
|
||||
@@ -148,6 +148,7 @@ GetObject(const MDefinition* ins)
|
||||
case MDefinition::Op_WasmLoadGlobalVar:
|
||||
case MDefinition::Op_WasmStoreGlobalVar:
|
||||
case MDefinition::Op_ArrayJoin:
|
||||
case MDefinition::Op_ArraySlice:
|
||||
return nullptr;
|
||||
default:
|
||||
#ifdef DEBUG
|
||||
|
||||
@@ -3127,6 +3127,15 @@ ExtractMathSpace(MDefinition* ins)
|
||||
MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Unknown TruncateKind");
|
||||
}
|
||||
|
||||
static bool MonotoneAdd(int32_t lhs, int32_t rhs) {
|
||||
return (lhs >= 0 && rhs >= 0) || (lhs <= 0 && rhs <= 0);
|
||||
}
|
||||
|
||||
static bool MonotoneSub(int32_t lhs, int32_t rhs) {
|
||||
return (lhs >= 0 && rhs <= 0) || (lhs <= 0 && rhs >= 0);
|
||||
}
|
||||
|
||||
|
||||
// Extract a linear sum from ins, if possible (otherwise giving the sum 'ins + 0').
|
||||
SimpleLinearSum
|
||||
jit::ExtractLinearSum(MDefinition* ins, MathSpace space)
|
||||
@@ -3168,10 +3177,12 @@ jit::ExtractLinearSum(MDefinition* ins, MathSpace space)
|
||||
// Check if this is of the form <SUM> + n or n + <SUM>.
|
||||
if (ins->isAdd()) {
|
||||
int32_t constant;
|
||||
if (space == MathSpace::Modulo)
|
||||
if (space == MathSpace::Modulo) {
|
||||
constant = lsum.constant + rsum.constant;
|
||||
else if (!SafeAdd(lsum.constant, rsum.constant, &constant))
|
||||
} else if (!SafeAdd(lsum.constant, rsum.constant, &constant) ||
|
||||
!MonotoneAdd(lsum.constant, rsum.constant)) {
|
||||
return SimpleLinearSum(ins, 0);
|
||||
}
|
||||
return SimpleLinearSum(lsum.term ? lsum.term : rsum.term, constant);
|
||||
}
|
||||
|
||||
@@ -3179,10 +3190,12 @@ jit::ExtractLinearSum(MDefinition* ins, MathSpace space)
|
||||
// Check if this is of the form <SUM> - n.
|
||||
if (lsum.term) {
|
||||
int32_t constant;
|
||||
if (space == MathSpace::Modulo)
|
||||
if (space == MathSpace::Modulo) {
|
||||
constant = lsum.constant - rsum.constant;
|
||||
else if (!SafeSub(lsum.constant, rsum.constant, &constant))
|
||||
} else if (!SafeSub(lsum.constant, rsum.constant, &constant) ||
|
||||
!MonotoneSub(lsum.constant, rsum.constant)) {
|
||||
return SimpleLinearSum(ins, 0);
|
||||
}
|
||||
return SimpleLinearSum(lsum.term, constant);
|
||||
}
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ DefaultJitOptions::DefaultJitOptions()
|
||||
}
|
||||
|
||||
// Toggles whether unboxed plain objects can be created by the VM.
|
||||
SET_DEFAULT(disableUnboxedObjects, false);
|
||||
SET_DEFAULT(disableUnboxedObjects, true);
|
||||
|
||||
// Test whether Atomics are allowed in asm.js code.
|
||||
SET_DEFAULT(asmJSAtomicsEnable, false);
|
||||
|
||||
+2
-5
@@ -9910,10 +9910,6 @@ class MArraySlice
|
||||
return unboxedType_;
|
||||
}
|
||||
|
||||
AliasSet getAliasSet() const override {
|
||||
return AliasSet::Store(AliasSet::BoxedOrUnboxedElements(unboxedType()) |
|
||||
AliasSet::ObjectFields);
|
||||
}
|
||||
bool possiblyCalls() const override {
|
||||
return true;
|
||||
}
|
||||
@@ -11837,7 +11833,8 @@ class MCallGetProperty
|
||||
AliasSet getAliasSet() const override {
|
||||
if (!idempotent_)
|
||||
return AliasSet::Store(AliasSet::Any);
|
||||
return AliasSet::None();
|
||||
return AliasSet::Load(AliasSet::ObjectFields | AliasSet::FixedSlot |
|
||||
AliasSet::DynamicSlot);
|
||||
}
|
||||
bool possiblyCalls() const override {
|
||||
return true;
|
||||
|
||||
@@ -6410,6 +6410,9 @@ JS_SetGlobalJitCompilerOption(JSContext* cx, JSJitCompilerOption opt, uint32_t v
|
||||
}
|
||||
jit::JitOptions.jumpThreshold = value;
|
||||
break;
|
||||
case JSJITCOMPILER_UNBOXED_OBJECTS:
|
||||
jit::JitOptions.disableUnboxedObjects = !value;
|
||||
break;
|
||||
case JSJITCOMPILER_ASMJS_ATOMICS_ENABLE:
|
||||
jit::JitOptions.asmJSAtomicsEnable = !!value;
|
||||
break;
|
||||
|
||||
+13
-12
@@ -5783,19 +5783,20 @@ JS_SetParallelParsingEnabled(JSContext* cx, bool enabled);
|
||||
extern JS_PUBLIC_API(void)
|
||||
JS_SetOffthreadIonCompilationEnabled(JSContext* cx, bool enabled);
|
||||
|
||||
#define JIT_COMPILER_OPTIONS(Register) \
|
||||
Register(BASELINE_WARMUP_TRIGGER, "baseline.warmup.trigger") \
|
||||
Register(ION_WARMUP_TRIGGER, "ion.warmup.trigger") \
|
||||
Register(ION_GVN_ENABLE, "ion.gvn.enable") \
|
||||
Register(ION_FORCE_IC, "ion.forceinlineCaches") \
|
||||
Register(ION_ENABLE, "ion.enable") \
|
||||
#define JIT_COMPILER_OPTIONS(Register) \
|
||||
Register(BASELINE_WARMUP_TRIGGER, "baseline.warmup.trigger") \
|
||||
Register(ION_WARMUP_TRIGGER, "ion.warmup.trigger") \
|
||||
Register(ION_GVN_ENABLE, "ion.gvn.enable") \
|
||||
Register(ION_FORCE_IC, "ion.forceinlineCaches") \
|
||||
Register(ION_ENABLE, "ion.enable") \
|
||||
Register(ION_INTERRUPT_WITHOUT_SIGNAL, "ion.interrupt-without-signals") \
|
||||
Register(ION_CHECK_RANGE_ANALYSIS, "ion.check-range-analysis") \
|
||||
Register(BASELINE_ENABLE, "baseline.enable") \
|
||||
Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \
|
||||
Register(JUMP_THRESHOLD, "jump-threshold") \
|
||||
Register(ASMJS_ATOMICS_ENABLE, "asmjs.atomics.enable") \
|
||||
Register(WASM_TEST_MODE, "wasm.test-mode") \
|
||||
Register(ION_CHECK_RANGE_ANALYSIS, "ion.check-range-analysis") \
|
||||
Register(BASELINE_ENABLE, "baseline.enable") \
|
||||
Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \
|
||||
Register(JUMP_THRESHOLD, "jump-threshold") \
|
||||
Register(UNBOXED_OBJECTS, "unboxed_objects") \
|
||||
Register(ASMJS_ATOMICS_ENABLE, "asmjs.atomics.enable") \
|
||||
Register(WASM_TEST_MODE, "wasm.test-mode") \
|
||||
Register(WASM_FOLD_OFFSETS, "wasm.fold-offsets")
|
||||
|
||||
typedef enum JSJitCompilerOption {
|
||||
|
||||
+12
-46
@@ -288,6 +288,12 @@ CallerGetterImpl(JSContext* cx, const CallArgs& args)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (JS_IsDeadWrapper(callerObj)) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_DEAD_OBJECT);
|
||||
return false;
|
||||
}
|
||||
|
||||
JSFunction* callerFun = &callerObj->as<JSFunction>();
|
||||
MOZ_ASSERT(!callerFun->isBuiltin(), "non-builtin iterator returned a builtin?");
|
||||
|
||||
@@ -314,54 +320,14 @@ CallerSetterImpl(JSContext* cx, const CallArgs& args)
|
||||
{
|
||||
MOZ_ASSERT(IsFunction(args.thisv()));
|
||||
|
||||
// Beware! This function can be invoked on *any* function! It can't
|
||||
// assume it'll never be invoked on natives, strict mode functions, bound
|
||||
// functions, or anything else that ordinarily has immutable .caller
|
||||
// defined with [[ThrowTypeError]].
|
||||
RootedFunction fun(cx, &args.thisv().toObject().as<JSFunction>());
|
||||
if (!CallerRestrictions(cx, fun))
|
||||
return false;
|
||||
// We just have to return |undefined|, but first we call CallerGetterImpl
|
||||
// because we need the same strict-mode and security checks.
|
||||
|
||||
if (!CallerGetterImpl(cx, args)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return |undefined| unless an error must be thrown.
|
||||
args.rval().setUndefined();
|
||||
|
||||
// We can almost just return |undefined| here -- but if the caller function
|
||||
// was strict mode code, we still have to throw a TypeError. This requires
|
||||
// computing the caller, checking that no security boundaries are crossed,
|
||||
// and throwing a TypeError if the resulting caller is strict.
|
||||
|
||||
NonBuiltinScriptFrameIter iter(cx);
|
||||
if (!AdvanceToActiveCallLinear(cx, iter, fun))
|
||||
return true;
|
||||
|
||||
++iter;
|
||||
while (!iter.done() && iter.isEvalFrame())
|
||||
++iter;
|
||||
|
||||
if (iter.done() || !iter.isFunctionFrame())
|
||||
return true;
|
||||
|
||||
RootedObject caller(cx, iter.callee(cx));
|
||||
if (!cx->compartment()->wrap(cx, &caller)) {
|
||||
cx->clearPendingException();
|
||||
return true;
|
||||
}
|
||||
|
||||
// If we don't have full access to the caller, or the caller is not strict,
|
||||
// return undefined. Otherwise throw a TypeError.
|
||||
JSObject* callerObj = CheckedUnwrap(caller);
|
||||
if (!callerObj)
|
||||
return true;
|
||||
|
||||
JSFunction* callerFun = &callerObj->as<JSFunction>();
|
||||
MOZ_ASSERT(!callerFun->isBuiltin(), "non-builtin iterator returned a builtin?");
|
||||
|
||||
if (callerFun->strict()) {
|
||||
JS_ReportErrorFlagsAndNumberASCII(cx, JSREPORT_ERROR, GetErrorMessage, nullptr,
|
||||
JSMSG_CALLER_IS_STRICT);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -206,10 +206,6 @@ case "$target" in
|
||||
|
||||
# -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
|
||||
CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
|
||||
|
||||
# Disable C++11 thread-safe statics due to crashes on XP (bug 1204752)
|
||||
# See https://connect.microsoft.com/VisualStudio/feedback/details/1789709/visual-c-2015-runtime-broken-on-windows-server-2003-c-11-magic-statics
|
||||
CXXFLAGS="$CXXFLAGS -Zc:threadSafeInit-"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(MSVS_VERSION)
|
||||
|
||||
@@ -1427,6 +1427,8 @@ ReloadPrefsCallback(const char* pref, void* data)
|
||||
|
||||
bool extraWarnings = Preferences::GetBool(JS_OPTIONS_DOT_STR "strict");
|
||||
|
||||
bool unboxedObjects = Preferences::GetBool(JS_OPTIONS_DOT_STR "unboxed_objects");
|
||||
|
||||
sSharedMemoryEnabled = Preferences::GetBool(JS_OPTIONS_DOT_STR "shared_memory");
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -1455,6 +1457,8 @@ ReloadPrefsCallback(const char* pref, void* data)
|
||||
useBaselineEager ? 0 : -1);
|
||||
JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_ION_WARMUP_TRIGGER,
|
||||
useIonEager ? 0 : -1);
|
||||
JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_UNBOXED_OBJECTS,
|
||||
unboxedObjects);
|
||||
}
|
||||
|
||||
XPCJSContext::~XPCJSContext()
|
||||
|
||||
@@ -2681,6 +2681,10 @@ nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(nsIFrame* aFrame)
|
||||
nsIFrame*
|
||||
nsLayoutUtils::FindNearestCommonAncestorFrame(nsIFrame* aFrame1, nsIFrame* aFrame2)
|
||||
{
|
||||
if (!aFrame1 || !aFrame2) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AutoTArray<nsIFrame*,100> ancestors1;
|
||||
AutoTArray<nsIFrame*,100> ancestors2;
|
||||
nsIFrame* commonAncestor = nullptr;
|
||||
|
||||
@@ -7296,11 +7296,11 @@ PresShell::HandleEvent(nsIFrame* aFrame,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIContent* capturingContent = ((aEvent->mClass == ePointerEventClass ||
|
||||
aEvent->mClass == eWheelEventClass ||
|
||||
aEvent->HasMouseEventMessage())
|
||||
? GetCapturingContent()
|
||||
: nullptr);
|
||||
nsCOMPtr<nsIContent> capturingContent = ((aEvent->mClass == ePointerEventClass ||
|
||||
aEvent->mClass == eWheelEventClass ||
|
||||
aEvent->HasMouseEventMessage())
|
||||
? GetCapturingContent()
|
||||
: nullptr);
|
||||
|
||||
nsCOMPtr<nsIDocument> retargetEventDoc;
|
||||
if (!aDontRetargetEvents) {
|
||||
|
||||
@@ -1264,6 +1264,7 @@ pref("javascript.options.strict", false);
|
||||
#ifdef DEBUG
|
||||
pref("javascript.options.strict.debug", false);
|
||||
#endif
|
||||
pref("javascript.options.unboxed_objects", false);
|
||||
pref("javascript.options.baselinejit", true);
|
||||
pref("javascript.options.ion", true);
|
||||
pref("javascript.options.asmjs", true);
|
||||
|
||||
@@ -117,10 +117,6 @@ pref("security.webauth.u2f", false);
|
||||
pref("security.webauth.u2f_enable_softtoken", false);
|
||||
pref("security.webauth.u2f_enable_usbtoken", false);
|
||||
|
||||
pref("security.ssl.errorReporting.enabled", true);
|
||||
pref("security.ssl.errorReporting.url", "https://incoming.telemetry.mozilla.org/submit/sslreports/");
|
||||
pref("security.ssl.errorReporting.automatic", false);
|
||||
|
||||
// OCSP must-staple
|
||||
pref("security.ssl.enable_ocsp_must_staple", true);
|
||||
|
||||
|
||||
@@ -516,33 +516,6 @@ FTPChannelChild::RecvOnStopRequest(const nsresult& aChannelStatus,
|
||||
return true;
|
||||
}
|
||||
|
||||
class nsFtpChildAsyncAlert : public Runnable
|
||||
{
|
||||
public:
|
||||
nsFtpChildAsyncAlert(nsIPrompt *aPrompter, nsString aResponseMsg)
|
||||
: mPrompter(aPrompter)
|
||||
, mResponseMsg(aResponseMsg)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsFtpChildAsyncAlert);
|
||||
}
|
||||
protected:
|
||||
virtual ~nsFtpChildAsyncAlert()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsFtpChildAsyncAlert);
|
||||
}
|
||||
public:
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
if (mPrompter) {
|
||||
mPrompter->Alert(nullptr, mResponseMsg.get());
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
private:
|
||||
nsCOMPtr<nsIPrompt> mPrompter;
|
||||
nsString mResponseMsg;
|
||||
};
|
||||
|
||||
class MaybeDivertOnStopFTPEvent : public ChannelEvent
|
||||
{
|
||||
public:
|
||||
@@ -600,19 +573,7 @@ FTPChannelChild::DoOnStopRequest(const nsresult& aChannelStatus,
|
||||
(void)mListener->OnStopRequest(this, mListenerContext, aChannelStatus);
|
||||
|
||||
if (NS_FAILED(aChannelStatus) && !aErrorMsg.IsEmpty()) {
|
||||
nsCOMPtr<nsIPrompt> prompter;
|
||||
GetCallback(prompter);
|
||||
if (prompter) {
|
||||
nsCOMPtr<nsIRunnable> alertEvent;
|
||||
if (aUseUTF8) {
|
||||
alertEvent = new nsFtpChildAsyncAlert(prompter,
|
||||
NS_ConvertUTF8toUTF16(aErrorMsg));
|
||||
} else {
|
||||
alertEvent = new nsFtpChildAsyncAlert(prompter,
|
||||
NS_ConvertASCIItoUTF16(aErrorMsg));
|
||||
}
|
||||
NS_DispatchToMainThread(alertEvent);
|
||||
}
|
||||
NS_ERROR("FTP error on stop request.");
|
||||
}
|
||||
|
||||
mListener = nullptr;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "nsIStreamListenerTee.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsAuthInformationHolder.h"
|
||||
#include "nsIProtocolProxyService.h"
|
||||
#include "nsICancelable.h"
|
||||
@@ -926,38 +925,7 @@ nsFtpState::R_syst() {
|
||||
mServerType = FTP_VMS_TYPE;
|
||||
} else {
|
||||
NS_ERROR("Server type list format unrecognized.");
|
||||
// Guessing causes crashes.
|
||||
// (Of course, the parsing code should be more robust...)
|
||||
nsCOMPtr<nsIStringBundleService> bundleService =
|
||||
do_GetService(NS_STRINGBUNDLE_CONTRACTID);
|
||||
if (!bundleService)
|
||||
return FTP_ERROR;
|
||||
|
||||
nsCOMPtr<nsIStringBundle> bundle;
|
||||
nsresult rv = bundleService->CreateBundle(NECKO_MSGS_URL,
|
||||
getter_AddRefs(bundle));
|
||||
if (NS_FAILED(rv))
|
||||
return FTP_ERROR;
|
||||
|
||||
char16_t* ucs2Response = ToNewUnicode(mResponseMsg);
|
||||
const char16_t *formatStrings[1] = { ucs2Response };
|
||||
NS_NAMED_LITERAL_STRING(name, "UnsupportedFTPServer");
|
||||
|
||||
nsXPIDLString formattedString;
|
||||
rv = bundle->FormatStringFromName(name.get(), formatStrings, 1,
|
||||
getter_Copies(formattedString));
|
||||
free(ucs2Response);
|
||||
if (NS_FAILED(rv))
|
||||
return FTP_ERROR;
|
||||
|
||||
// TODO(darin): this code should not be dictating UI like this!
|
||||
nsCOMPtr<nsIPrompt> prompter;
|
||||
mChannel->GetCallback(prompter);
|
||||
if (prompter)
|
||||
prompter->Alert(nullptr, formattedString.get());
|
||||
|
||||
// since we just alerted the user, clear mResponseMsg,
|
||||
// which is displayed to the user.
|
||||
// clear mResponseMsg, which is displayed to the user.
|
||||
mResponseMsg = "";
|
||||
return FTP_ERROR;
|
||||
}
|
||||
@@ -1779,34 +1747,6 @@ nsFtpState::KillControlConnection()
|
||||
mControlConnection = nullptr;
|
||||
}
|
||||
|
||||
class nsFtpAsyncAlert : public Runnable
|
||||
{
|
||||
public:
|
||||
nsFtpAsyncAlert(nsIPrompt *aPrompter, nsString aResponseMsg)
|
||||
: mPrompter(aPrompter)
|
||||
, mResponseMsg(aResponseMsg)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsFtpAsyncAlert);
|
||||
}
|
||||
protected:
|
||||
virtual ~nsFtpAsyncAlert()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsFtpAsyncAlert);
|
||||
}
|
||||
public:
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
if (mPrompter) {
|
||||
mPrompter->Alert(nullptr, mResponseMsg.get());
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
private:
|
||||
nsCOMPtr<nsIPrompt> mPrompter;
|
||||
nsString mResponseMsg;
|
||||
};
|
||||
|
||||
|
||||
nsresult
|
||||
nsFtpState::StopProcessing()
|
||||
{
|
||||
@@ -1818,23 +1758,8 @@ nsFtpState::StopProcessing()
|
||||
LOG_INFO(("FTP:(%x) nsFtpState stopping", this));
|
||||
|
||||
if (NS_FAILED(mInternalError) && !mResponseMsg.IsEmpty()) {
|
||||
// check to see if the control status is bad.
|
||||
// web shell wont throw an alert. we better:
|
||||
|
||||
// XXX(darin): this code should not be dictating UI like this!
|
||||
nsCOMPtr<nsIPrompt> prompter;
|
||||
mChannel->GetCallback(prompter);
|
||||
if (prompter) {
|
||||
nsCOMPtr<nsIRunnable> alertEvent;
|
||||
if (mUseUTF8) {
|
||||
alertEvent = new nsFtpAsyncAlert(prompter,
|
||||
NS_ConvertUTF8toUTF16(mResponseMsg));
|
||||
} else {
|
||||
alertEvent = new nsFtpAsyncAlert(prompter,
|
||||
NS_ConvertASCIItoUTF16(mResponseMsg));
|
||||
}
|
||||
NS_DispatchToMainThread(alertEvent);
|
||||
}
|
||||
NS_ERROR("FTP: bad control status.");
|
||||
// check to see if the control status is bad; forward the error message.
|
||||
nsCOMPtr<nsIFTPChannelParentInternal> ftpChanP;
|
||||
mChannel->GetCallback(ftpChanP);
|
||||
if (ftpChanP) {
|
||||
|
||||
@@ -215,11 +215,6 @@ case "$target" in
|
||||
|
||||
# -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
|
||||
CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
|
||||
|
||||
# Disable C++11 thread-safe statics due to crashes on XP (bug 1204752)
|
||||
# See https://connect.microsoft.com/VisualStudio/feedback/details/1789709/visual-c-2015-runtime-broken-on-windows-server-2003-c-11-magic-statics
|
||||
CXXFLAGS="$CXXFLAGS -Zc:threadSafeInit-"
|
||||
|
||||
# https://connect.microsoft.com/VisualStudio/feedback/details/888527/warnings-on-dbghelp-h
|
||||
# for dbghelp.h, imagehlp.h, and shobj.h
|
||||
# C4091: 'typedef ': ignored on left of '' when no variable is declared
|
||||
|
||||
@@ -36,10 +36,12 @@
|
||||
skin/classic/global/arrow/arrow-down.png (../../windows/global/arrow/arrow-down.png)
|
||||
skin/classic/global/arrow/arrow-lft.gif (../../windows/global/arrow/arrow-lft.gif)
|
||||
skin/classic/global/arrow/arrow-lft-dis.gif (../../windows/global/arrow/arrow-lft-dis.gif)
|
||||
skin/classic/global/arrow/arrow-lft-hov.gif (../../windows/global/arrow/arrow-lft-hov.gif)
|
||||
skin/classic/global/arrow/arrow-lft-sharp.gif (../../windows/global/arrow/arrow-lft-sharp.gif)
|
||||
skin/classic/global/arrow/arrow-lft-sharp-end.gif (../../windows/global/arrow/arrow-lft-sharp-end.gif)
|
||||
skin/classic/global/arrow/arrow-rit.gif (../../windows/global/arrow/arrow-rit.gif)
|
||||
skin/classic/global/arrow/arrow-rit-dis.gif (../../windows/global/arrow/arrow-rit-dis.gif)
|
||||
skin/classic/global/arrow/arrow-rit-hov.gif (../../windows/global/arrow/arrow-rit-hov.gif)
|
||||
skin/classic/global/arrow/arrow-rit-sharp.gif (../../windows/global/arrow/arrow-rit-sharp.gif)
|
||||
skin/classic/global/arrow/arrow-rit-sharp-end.gif (../../windows/global/arrow/arrow-rit-sharp-end.gif)
|
||||
skin/classic/global/arrow/arrow-up.gif (../../windows/global/arrow/arrow-up.gif)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 91 B |
Binary file not shown.
|
After Width: | Height: | Size: 91 B |
@@ -4130,9 +4130,12 @@ XRE_InitCommandLine(int aArgc, char* aArgv[])
|
||||
#endif
|
||||
|
||||
const char *path = nullptr;
|
||||
ArgResult ar = CheckArg("greomni", false, &path);
|
||||
ArgResult ar = CheckArg("greomni", true, &path);
|
||||
if (ar == ARG_BAD) {
|
||||
PR_fprintf(PR_STDERR, "Error: argument --greomni requires a path argument\n");
|
||||
PR_fprintf(PR_STDERR,
|
||||
"Error: argument --greomni requires a path argument or the "
|
||||
"--osint argument was specified with the --greomni argument "
|
||||
"which is invalid.\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@@ -4146,9 +4149,12 @@ XRE_InitCommandLine(int aArgc, char* aArgv[])
|
||||
return rv;
|
||||
}
|
||||
|
||||
ar = CheckArg("appomni", false, &path);
|
||||
ar = CheckArg("appomni", true, &path);
|
||||
if (ar == ARG_BAD) {
|
||||
PR_fprintf(PR_STDERR, "Error: argument --appomni requires a path argument\n");
|
||||
PR_fprintf(PR_STDERR,
|
||||
"Error: argument --appomni requires a path argument or the "
|
||||
"--osint argument was specified with the --appomni argument "
|
||||
"which is invalid.\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#define LOG(args) MOZ_LOG(mLog, mozilla::LogLevel::Debug, args)
|
||||
|
||||
// helper methods: forward declarations...
|
||||
static nsresult GetExtensionFrom4xRegistryInfo(const nsACString& aMimeType,
|
||||
nsString& aFileExtension);
|
||||
static nsresult GetExtensionFromWindowsMimeDatabase(const nsACString& aMimeType,
|
||||
nsString& aFileExtension);
|
||||
|
||||
@@ -77,79 +75,45 @@ static nsresult GetExtensionFromWindowsMimeDatabase(const nsACString& aMimeType,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// We have a serious problem!! I have this content type and the windows registry only gives me
|
||||
// helper apps based on extension. Right now, we really don't have a good place to go for
|
||||
// trying to figure out the extension for a particular mime type....One short term hack is to look
|
||||
// this information in 4.x (it's stored in the windows regsitry).
|
||||
static nsresult GetExtensionFrom4xRegistryInfo(const nsACString& aMimeType,
|
||||
nsString& aFileExtension)
|
||||
{
|
||||
nsCOMPtr<nsIWindowsRegKey> regKey =
|
||||
do_CreateInstance("@mozilla.org/windows-registry-key;1");
|
||||
if (!regKey)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
nsresult rv = regKey->
|
||||
Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
|
||||
NS_LITERAL_STRING("Software\\Netscape\\Netscape Navigator\\Suffixes"),
|
||||
nsIWindowsRegKey::ACCESS_QUERY_VALUE);
|
||||
if (NS_FAILED(rv))
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
rv = regKey->ReadStringValue(NS_ConvertASCIItoUTF16(aMimeType),
|
||||
aFileExtension);
|
||||
if (NS_FAILED(rv))
|
||||
return NS_OK;
|
||||
|
||||
aFileExtension.Insert(char16_t('.'), 0);
|
||||
|
||||
// this may be a comma separated list of extensions...just take the
|
||||
// first one for now...
|
||||
|
||||
int32_t pos = aFileExtension.FindChar(char16_t(','));
|
||||
if (pos > 0) {
|
||||
// we have a comma separated list of types...
|
||||
// truncate everything after the first comma (including the comma)
|
||||
aFileExtension.Truncate(pos);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolScheme, bool * aHandlerExists)
|
||||
{
|
||||
// look up the protocol scheme in the windows registry....if we find a match then we have a handler for it...
|
||||
*aHandlerExists = false;
|
||||
if (aProtocolScheme && *aProtocolScheme)
|
||||
{
|
||||
// Vista: use new application association interface
|
||||
if (mAppAssoc) {
|
||||
wchar_t * pResult = nullptr;
|
||||
NS_ConvertASCIItoUTF16 scheme(aProtocolScheme);
|
||||
// We are responsible for freeing returned strings.
|
||||
HRESULT hr = mAppAssoc->QueryCurrentDefault(scheme.get(),
|
||||
AT_URLPROTOCOL, AL_EFFECTIVE,
|
||||
&pResult);
|
||||
if (SUCCEEDED(hr)) {
|
||||
CoTaskMemFree(pResult);
|
||||
*aHandlerExists = true;
|
||||
NS_ENSURE_TRUE(mAppAssoc, NS_ERROR_NOT_AVAILABLE);
|
||||
wchar_t * pResult = nullptr;
|
||||
NS_ConvertASCIItoUTF16 scheme(aProtocolScheme);
|
||||
// We are responsible for freeing returned strings.
|
||||
HRESULT hr = mAppAssoc->QueryCurrentDefault(scheme.get(),
|
||||
AT_URLPROTOCOL, AL_EFFECTIVE,
|
||||
&pResult);
|
||||
if (SUCCEEDED(hr)) {
|
||||
CoTaskMemFree(pResult);
|
||||
// Check the registry to see if it's a valid handler.
|
||||
nsCOMPtr<nsIWindowsRegKey> regKey = do_CreateInstance("@mozilla.org/windows-registry-key;1");
|
||||
if (!regKey) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
HKEY hKey;
|
||||
LONG err = ::RegOpenKeyExW(HKEY_CLASSES_ROOT,
|
||||
NS_ConvertASCIItoUTF16(aProtocolScheme).get(),
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey);
|
||||
if (err == ERROR_SUCCESS)
|
||||
{
|
||||
err = ::RegQueryValueExW(hKey, L"URL Protocol",
|
||||
nullptr, nullptr, nullptr, nullptr);
|
||||
*aHandlerExists = (err == ERROR_SUCCESS);
|
||||
// close the key
|
||||
::RegCloseKey(hKey);
|
||||
nsresult rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT,
|
||||
nsDependentString(scheme.get()),
|
||||
nsIWindowsRegKey::ACCESS_QUERY_VALUE);
|
||||
if (NS_FAILED(rv)) {
|
||||
// Open will fail if the registry key path doesn't exist.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool hasValue;
|
||||
rv = regKey->HasValue(NS_LITERAL_STRING("URL Protocol"), &hasValue);
|
||||
if (NS_FAILED(rv)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
if (!hasValue) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*aHandlerExists = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,40 +144,21 @@ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString&
|
||||
}
|
||||
}
|
||||
|
||||
if (mAppAssoc) {
|
||||
// Vista: use new application association interface
|
||||
wchar_t * pResult = nullptr;
|
||||
// We are responsible for freeing returned strings.
|
||||
HRESULT hr = mAppAssoc->QueryCurrentDefault(buf.get(),
|
||||
AT_URLPROTOCOL, AL_EFFECTIVE,
|
||||
&pResult);
|
||||
if (SUCCEEDED(hr)) {
|
||||
nsCOMPtr<nsIFile> app;
|
||||
nsAutoString appInfo(pResult);
|
||||
CoTaskMemFree(pResult);
|
||||
if (NS_SUCCEEDED(GetDefaultAppInfo(appInfo, _retval, getter_AddRefs(app))))
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
NS_ENSURE_TRUE(mAppAssoc, NS_ERROR_NOT_AVAILABLE);
|
||||
wchar_t * pResult = nullptr;
|
||||
// We are responsible for freeing returned strings.
|
||||
HRESULT hr = mAppAssoc->QueryCurrentDefault(buf.get(),
|
||||
AT_URLPROTOCOL, AL_EFFECTIVE,
|
||||
&pResult);
|
||||
if (SUCCEEDED(hr)) {
|
||||
nsCOMPtr<nsIFile> app;
|
||||
nsAutoString appInfo(pResult);
|
||||
CoTaskMemFree(pResult);
|
||||
if (NS_SUCCEEDED(GetDefaultAppInfo(appInfo, _retval, getter_AddRefs(app))))
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFile> app;
|
||||
GetDefaultAppInfo(buf, _retval, getter_AddRefs(app));
|
||||
|
||||
if (!_retval.Equals(buf))
|
||||
return NS_OK;
|
||||
|
||||
// Fall back to full path
|
||||
buf.AppendLiteral("\\shell\\open\\command");
|
||||
nsresult rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT,
|
||||
buf,
|
||||
nsIWindowsRegKey::ACCESS_QUERY_VALUE);
|
||||
if (NS_FAILED(rv))
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
rv = regKey->ReadStringValue(EmptyString(), _retval);
|
||||
|
||||
return NS_SUCCEEDED(rv) ? NS_OK : NS_ERROR_NOT_AVAILABLE;
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
// GetMIMEInfoFromRegistry: This function obtains the values of some of the nsIMIMEInfo
|
||||
@@ -421,36 +366,18 @@ already_AddRefed<nsMIMEInfoWin> nsOSHelperAppService::GetByExtension(const nsAFl
|
||||
bool found;
|
||||
|
||||
// Retrieve the default application for this extension
|
||||
if (mAppAssoc) {
|
||||
// Vista: use the new application association COM interfaces
|
||||
// for resolving helpers.
|
||||
nsString assocType(fileExtToUse);
|
||||
wchar_t * pResult = nullptr;
|
||||
HRESULT hr = mAppAssoc->QueryCurrentDefault(assocType.get(),
|
||||
AT_FILEEXTENSION, AL_EFFECTIVE,
|
||||
&pResult);
|
||||
if (SUCCEEDED(hr)) {
|
||||
found = true;
|
||||
appInfo.Assign(pResult);
|
||||
CoTaskMemFree(pResult);
|
||||
}
|
||||
else {
|
||||
found = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nsCOMPtr<nsIWindowsRegKey> regKey =
|
||||
do_CreateInstance("@mozilla.org/windows-registry-key;1");
|
||||
if (!regKey)
|
||||
return nullptr;
|
||||
nsresult rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT,
|
||||
fileExtToUse,
|
||||
nsIWindowsRegKey::ACCESS_QUERY_VALUE);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
found = NS_SUCCEEDED(regKey->ReadStringValue(EmptyString(),
|
||||
appInfo));
|
||||
}
|
||||
NS_ENSURE_TRUE(mAppAssoc, nullptr);
|
||||
nsString assocType(fileExtToUse);
|
||||
wchar_t * pResult = nullptr;
|
||||
HRESULT hr = mAppAssoc->QueryCurrentDefault(assocType.get(),
|
||||
AT_FILEEXTENSION, AL_EFFECTIVE,
|
||||
&pResult);
|
||||
if (SUCCEEDED(hr)) {
|
||||
found = true;
|
||||
appInfo.Assign(pResult);
|
||||
CoTaskMemFree(pResult);
|
||||
} else {
|
||||
found = false;
|
||||
}
|
||||
|
||||
// Bug 358297 - ignore the default handler, force the user to choose app
|
||||
@@ -496,14 +423,9 @@ already_AddRefed<nsIMIMEInfo> nsOSHelperAppService::GetMIMEInfoFromOS(const nsAC
|
||||
* We'll do extension-based lookup for this type later in this function.
|
||||
*/
|
||||
if (!aMIMEType.LowerCaseEqualsLiteral(APPLICATION_OCTET_STREAM)) {
|
||||
// (1) try to use the windows mime database to see if there is a mapping to a file extension
|
||||
// (2) try to see if we have some left over 4.x registry info we can peek at...
|
||||
// try to use the windows mime database to see if there is a mapping to a file extension
|
||||
GetExtensionFromWindowsMimeDatabase(aMIMEType, fileExtension);
|
||||
LOG(("Windows mime database: extension '%s'\n", fileExtension.get()));
|
||||
if (fileExtension.IsEmpty()) {
|
||||
GetExtensionFrom4xRegistryInfo(aMIMEType, fileExtension);
|
||||
LOG(("4.x Registry: extension '%s'\n", fileExtension.get()));
|
||||
}
|
||||
}
|
||||
// If we found an extension for the type, do the lookup
|
||||
RefPtr<nsMIMEInfoWin> mi;
|
||||
|
||||
@@ -921,7 +921,7 @@ nsDataObj::GetDib(const nsACString& inFlavor,
|
||||
if ( image ) {
|
||||
nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
|
||||
|
||||
nsAutoString options;
|
||||
nsAutoString options(NS_LITERAL_STRING("bpp=32;"));
|
||||
if (aFormat.cfFormat == CF_DIBV5) {
|
||||
options.AppendLiteral("version=5");
|
||||
} else {
|
||||
@@ -1580,7 +1580,7 @@ HRESULT nsDataObj::DropImage(FORMATETC& aFE, STGMEDIUM& aSTG)
|
||||
nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
|
||||
nsCOMPtr<nsIInputStream> inputStream;
|
||||
rv = imgTools->EncodeImage(image, NS_LITERAL_CSTRING(IMAGE_BMP),
|
||||
NS_LITERAL_STRING("version=3"),
|
||||
NS_LITERAL_STRING("bpp=32;version=3"),
|
||||
getter_AddRefs(inputStream));
|
||||
if (NS_FAILED(rv) || !inputStream) {
|
||||
return E_FAIL;
|
||||
|
||||
Reference in new issue
Block a user