Compare commits

...
Author SHA1 Message Date
wolfbeast 9ffed6e8bf Simplify some alias sets in IonMonkey. 2019-03-26 18:33:15 +01:00
wolfbeast 98bd23c78f Add SSUAO for polyfill.io
Financial Times' polyfill.io service horribly breaks when it finds
anything but a short list of predefined UA strings. We have to send
them a strict Firefox UA or other sites relying on it will break too
(including PayPal!).

An issue has been raised on their repo.
2019-03-23 14:43:20 +01:00
wolfbeast a5b2695841 Version bump 2019-03-23 14:43:00 +01:00
sotaro 724368467b Check if CopyData succeeded. 2019-03-23 13:57:02 +01:00
wolfbeast cee1324f0f Disallow getUserMedia on null principals. 2019-03-23 13:56:48 +01:00
wolfbeast b4a65a3e01 Check for osint argument when checking for greomni and appomni arguments.
Specifying both is invalid and unsupported.
2019-03-23 13:56:32 +01:00
Brian Grinstead 3be7cb940e Escape '!' to '\041' in posix strings ($'...') 2019-03-23 13:56:15 +01:00
wolfbeast 1af286ffef Convert UI-dictating FTP errors to console errors. 2019-03-23 13:56:01 +01:00
wolfbeast cc53748228 Grab caching capturing content with local variable. 2019-03-23 13:55:38 +01:00
Nicolas B. Pierron 9e3ca2878d Restrict ExtractLinearSum to monotonous operation in infinite math space.
Thanks to Bruno Keith & Niklas Baumstark from the phoenhex team for
finding this issue and reporting it with a proper analysis.
2019-03-23 13:55:18 +01:00
wolfbeast 2ae457f21e Extend origin-clean algorithm (DiD). 2019-03-23 02:12:57 +01:00
wolfbeast 6478daf298 Implement origin-clean algorithm for ImageBitmap.
This resolves #973.
2019-03-23 02:12:38 +01:00
wolfbeast 181cb5210e Add nullcheck for frames in FindNearestCommonAncestorFrame
This resolves #978.
2019-03-23 02:05:06 +01:00
wolfbeast aabb3573ea Clean up nsOSHelperAppService.
About time we stopped looking at Netscape 4.x entries in the registry ;)
Also, assume the application association API is present in Windows
and use that instead of reading from the registry directly.
2019-03-23 02:01:07 +01:00
Brian Birtles 9d01447a21 Check child container count in NotifyRefreshDriverCreated. 2019-03-23 02:00:53 +01:00
wolfbeast f8c7e321a5 Check for dead wrappers in CallerGetterImpl/CallerSetterImpl.
This also removes code duplication by making CallerSetterImpl call
CallerGetterImpl.
2019-03-23 02:00:40 +01:00
Nicolas B. Pierron 5ec124cf03 Force expected crashes on unexpected magic values. 2019-03-23 02:00:27 +01:00
wolfbeast 80dfca4577 Pref the use of unboxed plain objects in JS and disable by default.
This should be all that's needed for #1017, but verification of
impact is definitely desired.
2019-03-23 02:00:13 +01:00
Olli Pettay 90a44b312f Remove harmless assertions by using IgnoredErrorResult. 2019-03-23 01:59:35 +01:00
JustOff 38986a488b [PALEMOON] Add SSUAO override for firefox.com (native mode) 2019-03-23 01:59:09 +01:00
wolfbeast 932ecf52b6 Remove unused SSL errorReporting prefs
Resolves #1003.
2019-03-23 01:58:40 +01:00
wolfbeast 9676ebdced [Palemoon] Disable Microsoft Family Safety support (Windows 8.1).
This is basically a https MitM setup that is unwanted for Pale Moon.
Resolves #1000.
2019-03-23 01:58:25 +01:00
wolfbeast 333c64ef30 Prevent loading of document subresources over FTP. 2019-03-23 01:57:55 +01:00
wolfbeast ae971bfe8e Add hover state arrow images.
This fixes #981
2019-03-23 01:56:59 +01:00
wolfbeast 915ae7981a Don't trust convexity when applying transforms.
In theory, a convex shape transformed by an affine matrix should still
be convex. However, due to numerical imprecision of floats, when we try
to determine if something is convex, we can get different answers pre
and post a transformation (think of two line segments nearly co-linear).

Convex paths take a faster scan converter, but it is only well behaved
if the path is, in fact, convex. Thus we have to be conservative about
which paths we mark as convex, and cant's trust transformed paths to
retain their convexity. We re-calculate when a transform is applied.
2019-02-18 11:50:13 +01:00
wolfbeast 33420c43a2 Skia: Validate allocation size in GrBufferAllocPool using SkSafeMath.
Upstream port of commit 7469a9341afab19271b8ef07af5c16a0f2c4ccc1
2019-02-17 22:16:02 +01:00
wolfbeast ce9d45fc59 Skia: Be consistent about int for incReserve.
Upstream port.
2019-02-17 22:15:47 +01:00
wolfbeast f29d7ff617 Revert "Port several Skia upstream fixes."
This reverts commit 260b06c1c9.

This fixes #976
2019-02-17 14:55:26 +01:00
Andrew Osmond cdc5daf5da BMPs from the clipboard may include extra padding.
In the original Windows clipboard BMP decoder implementation in
nsImageFromClipboard::ConvertColorBitMap, if the bitmap used bitfields
compression, it always adjusted the offset to the RGB data by 12 bytes.
It did this even for newer BMP header formats which explicitly include
space for the bitfields in their header sizes. This patch updates our
BMP decoder to do the same for clipboard BMPs, since we have observed
pasted BMPs using bitfield compression appearing incorrectly. To the
user this appears as if we read a color mask; completely red, blue,
green pixels at the start of the last row, causing all of the other rows
to start with the last three pixels of the previous row.
2019-02-16 20:35:50 +01:00
wolfbeast b1de755d0f Stop using hard-coded URL for "get more devtools" 2019-02-16 12:55:56 +01:00
Matt A. Tobin da9d7b4362 Conform Pale Moon AM preferences to actual locations
Uplift is NOT required
2019-02-16 10:30:50 +01:00
wolfbeast 6efbf737e5 Treat aContext as a bitfield in openURI.
Potential fix for #971
2019-02-15 14:07:47 +01:00
JustOff f97c06d435 [PALEMOON] Link dictionaries to addons.palemoon.org 2019-02-15 14:00:10 +01:00
wolfbeast 1f058d19ef Preserve transparency when copying a DIB to/from the clipboard.
In order to get the alpha channel when encoding BMP images from a
surface, we need to supply bmp=32 in the encoder options.
2019-02-14 22:43:32 +01:00
wolfbeast 260b06c1c9 Port several Skia upstream fixes. 2019-02-14 17:00:46 +01:00
wolfbeast c4ed602e3f Update browse URL for AM search to Phoebus 2.0 2019-02-14 12:18:22 +01:00
wolfbeast ed290ba09d Use C++11 thread-safe statics with MSVC. (js) 2019-02-14 12:01:20 +01:00
wolfbeast e746ec8441 Use C++11 thread-safe statics with MSVC. 2019-02-14 11:53:59 +01:00
wolfbeast 48d8e28fe6 Move "No proxy for" control down to clarify it is a global effect.
Follow-up to the behavior change in commit
6567bb631a
2019-02-14 01:56:02 +01:00
wolfbeast cdfe2e11c8 Allow empty string on location.search setter.
Fixes #970.
2019-02-12 11:07:12 +01:00
wolfbeast ed9341c4a4 Version bump for release 2019-02-12 01:27:29 +01:00
wolfbeast 263d8500ce Merge branch 'master' into Pale_Moon-release
# Conflicts:
#	application/palemoon/components/preferences/advanced.xul
#	application/palemoon/config/version.txt
#	modules/libpref/init/all.js
2019-02-12 01:25:43 +01:00
wolfbeast b06821da15 Version bump for release. 2019-01-23 11:47:08 +01:00
wolfbeast b578943a42 Disable IntersectionObserver API on release.
See #935
2019-01-19 08:02:11 +01:00
wolfbeast b4edb88144 Add isIntersecting property to IntersectionObserverEntry. (uplift)
Per updated spec.

This resolves the issue raised in #249.
2019-01-17 19:08:48 +01:00
wolfbeast f84f1961bc Improve toolbar icons for all DPIs (uplift)
Tag #576.

- Redraw toolbar SVG images, pixel-aligning them as best as possible
  with manual node placement on the pixel grid.
- Reintroduce PNG versions for < 1.33 dppx (with added glow arrow)
- Make the css adaptive around the 1.33 dppx border, using PNG below
  that threshold and SVG above it.
2019-01-17 17:26:23 +01:00
wolfbeast 3aac951411 [PALEMOON] Add captive portal preference to the UI. (uplift)
Tag #860
2019-01-16 02:08:16 +01:00
wolfbeast 1a6159363f [PALEMOON] Move Advanced prefs l10n strings to their proper place 2019-01-16 02:07:36 +01:00
wolfbeast 814e0bca31 Align Element.ScrollIntoView() with the spec. (uplift)
This also removes the (unused) shadow alias from nsIDOMHTMLElement
which used the different calling convention.

This resolves #927
2019-01-08 17:42:01 +01:00
wolfbeast 29b9d4496a Fix library window reference to SVG toolbar image.
Tag #576.
This needs uplift to the relbranch.
2019-01-07 14:19:54 +01:00
wolfbeast cc6a935ce5 Merge branch 'master' into Pale_Moon-release
# Conflicts:
#	application/palemoon/components/feeds/FeedWriter.js
#	application/palemoon/config/version.txt
#	security/manager/ssl/nsSTSPreloadList.errors
#	security/manager/ssl/nsSTSPreloadList.inc
2019-01-06 15:14:54 +01:00
wolfbeast d129c900c9 Version bump for point release 2018-12-04 20:09:52 +01:00
wolfbeast de2c8419c6 Fix typo for Firefox compatmode prefs.
Fixes regression from ec2e3bc027
2018-12-04 20:05:14 +01:00
JustOff f6137449b6 Revert "[PALEMOON] Sanitize - "Form and search history" sanitize also the Findbar text and history (Ctrl-Z)"
This reverts commit a97887a677.
2018-12-04 20:04:58 +01:00
Matt A. Tobin 020248c6e3 [TychoAM] Give the second <hbox> an ID so it can be targeted in extensions.xul 2018-12-04 20:04:32 +01:00
trav90 e0a09e1aaf Update HSTS preload list
Tag #447
2018-12-04 20:04:16 +01:00
wolfbeast 4af3ad5dfe Fix debug assertion.
See: https://github.com/MoonchildProductions/UXP/commit/622098073e132995994fac4d61e3629d08ee1801#commitcomment-31390051
2018-12-04 20:03:58 +01:00
wolfbeast ff66da9af4 Fix blank pixel color for truncated GIFs 2018-12-04 20:03:25 +01:00
wolfbeast c2e358c520 Split out FrameTimeout into its own header file for re-use. 2018-12-04 20:03:12 +01:00
wolfbeast d185071acf Unrefactor mRawVeggies back to mVBuffMeat ;P
(mRawSurface -> mVBuf)
2018-12-04 20:02:59 +01:00
wolfbeast e517e70eb1 Fix pasta error 2018-12-04 20:02:46 +01:00
wolfbeast 0a6db54d86 Bug 1462355 - Part 1c. Make individual image decoders to use updated Decoder/SurfacePipe methods.
Extend this change to nsWebPDecoder.cpp
2018-12-04 20:02:29 +01:00
wolfbeast c5d5a28f76 Bug 1462355 - Part 1b. Update Decoder and SurfacePipe plumbing to use updated imgFrame methods. 2018-12-04 20:02:14 +01:00
wolfbeast a0e20005ef Bug 1462355 - Part 1a. Make imgFrame animation parameters threadsafe.
We currently choose to set the animation parameters (blend method, blend
rect, disposal method, timeout) in imgFrame::Finish instead of
imgFrame::InitForDecoder. The decoders themselves already have access to
the necessary information at the time InitForDecoder is called, so there
is no reason to do this. Moving the configuration to initialization will
allow us to relax the mutex protection on these parameters.

This part simply reorganizes imgFrame, and subsequent parts will
introduce the necessary changes to SurfacePipe and decoders.
2018-12-04 20:01:58 +01:00
wolfbeast a3c1f180ce Port WebP decoder changes.
This breaks animated WebP for the moment, but adds QCMS color management and lexer changes.
Tag #831
2018-12-04 20:01:37 +01:00
wolfbeast cd4f7a1798 Add a nullcheck on pipelined HTTP connections' pushback. 2018-12-04 20:01:01 +01:00
JustOff 914294e570 [PALEMOON] Align the places component with the updated PlacesUtils API 2018-12-04 20:00:31 +01:00
Matt A. Tobin 831b9d8d9e [PALEMOON] Use generic application icon for external applications in about:feeds 2018-12-04 19:59:14 +01:00
Matt A. Tobin 6864a02d7b Issue #861 - The bookmark properties window should focus on the Name Picker text box on init 2018-11-14 13:42:16 +01:00
wolfbeast bffec09e66 Version bump for point release. 2018-11-14 10:42:57 +01:00
wolfbeast 51e5770962 Revert "[PALEMOON] Focus and select the first non-collapsed text element in the bookmark properties dialog"
This reverts commit e9a58eae57.

Tag #867
2018-11-14 09:59:06 +01:00
wolfbeast e1bfe33031 Version bump for release 28.2.0 2018-11-07 12:54:01 +01:00
wolfbeast 8240fb9c73 Merge branch 'master' into Pale_Moon-release
# Conflicts:
#	application/palemoon/config/version.txt
2018-11-07 12:47:12 +01:00
JustOff f9e04b54c2 [PALEMOON] Restore strings mistakenly removed by [8be0c16be6] 2018-09-21 10:26:41 +02:00
JustOff 775e800ca0 Use SessionStore.promiseInitialized() to avoid race condition in "about:home" (#774)
* Use SessionStore.promiseInitialized() to avoid race condition in "about:home"

* Improve code style of [d6c3adb91c9f29786f8ed8d93baa14c076494017]
2018-09-18 08:25:39 +02:00
wolfbeast 882aaf5b1f Merge branch 'master' into Pale_Moon-release
# Conflicts:
#	application/palemoon/config/version.txt
#	js/src/jit/x86-shared/AssemblerBuffer-x86-shared.h
#	toolkit/components/search/orginal/nsSearchService.js
2018-09-17 08:51:49 +02:00
wolfbeast 8ee235ca5d Version bump for minor bugfix release. 2018-08-30 16:59:46 +02:00
wolfbeast cc54bbe952 Revert "Bug 1388020. r=nical, a=RyanVM"
This reverts commit e7189e33f5.
2018-08-30 12:36:03 +02:00
wolfbeast 73b202b1e5 Revert "Bug 1444668 - Avoid allocating large AssemblerBuffers. r=luke, r=bbouvier, a=RyanVM"
This reverts commit 9472136272.
2018-08-30 12:33:56 +02:00
wolfbeast 21042963de Version bump for win rebuild with less aggressive build config. 2018-08-26 17:44:06 +02:00
wolfbeast d443656df5 Version bump for release builds. 2018-08-07 14:20:47 +02:00
Matt A. Tobin 29a8db7280 Fix include path 2018-08-06 18:02:27 +02:00
Matt A. Tobin daa52eef9a Add a slightly modified version of the gecko/44 search service and use it when building Pale Moon 2018-08-06 18:02:10 +02:00
Matt A. Tobin 95ce1f0d63 Move the "native" search service to a subdirectory 2018-08-06 18:01:49 +02:00
SpockMan02 4dadef2740 Restore some osx icons 2018-08-06 11:12:29 +02:00
SpockMan02 b5d8e6d28f Revert osx editBookmarkOverlay.css to osx version 2018-08-06 11:12:16 +02:00
adeshkp fc0477a98e Fix constructor in nsHtml5AtomTable.cpp
Follow up to 2bc00ef to fix build bustage
2018-08-06 11:10:24 +02:00
adeshkp 36d06b9e75 Improve nsHtml5AtomTable performance (#693)
* cpp change
* h change
2018-08-06 11:10:10 +02:00
wolfbeast 51bdd3efbc Make AC option for devtools (client) an enable_bool to align with the default. 2018-08-04 08:21:29 +02:00
janekptacijarabaci bc2584493a [PALEMOON] Bug 863773 - Changes the way plugin handlers are loaded at the preferences applications pane. Uses enabledPlugin attribute from each navigator.mimeTypes to find the actual plugin used to handle the mime type 2018-08-04 08:07:02 +02:00
janekptacijarabaci 0f38772573 [PALEMOON] Bug 1034043 - Fix remaining use of "awlaysAsk" attribute in applications pref pane 2018-08-04 08:06:49 +02:00
janekptacijarabaci ef81277925 [PALEMOON] Bug 480242 - "Always ask" doesn't work for Plugins 2018-08-04 08:06:36 +02:00
janekptacijarabaci 8b20931e12 [PALEMOON] Bug 757726 - Populate Preferences' Applications list using PluginHost 2018-08-04 08:06:24 +02:00
SpockMan02 b247982d37 Restore Mac bookmark doorhanger styling 2018-08-04 08:05:34 +02:00
56 changed files with 467 additions and 484 deletions

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;"
+19 -16
View File
@@ -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%&currentAppVersion=%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%&currentAppVersion=%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);
+7 -1
View File
@@ -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%&currentAppVersion=%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
View File
@@ -1 +1 @@
28.4.0a1
28.4.1
+2 -1
View File
@@ -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");
}
},
];
+1
View File
@@ -375,6 +375,7 @@ const CurlUtils = {
.replace(/\'/g, "\\\'")
.replace(/\n/g, "\\n")
.replace(/\r/g, "\\r")
.replace(/!/g, "\\041")
.replace(/[^\x20-\x7E]/g, escapeCharacter) + "'";
}
-4
View File
@@ -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;
+20 -4
View File
@@ -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)
+12
View File
@@ -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
View File
@@ -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;
}
+12
View File
@@ -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));
}
+2 -1
View File
@@ -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*) {
+20 -2
View File
@@ -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) {
+16 -7
View File
@@ -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([
+1 -1
View File
@@ -1000,7 +1000,7 @@ HTMLCanvasElement::GetSize()
}
bool
HTMLCanvasElement::IsWriteOnly()
HTMLCanvasElement::IsWriteOnly() const
{
return mWriteOnly;
}
+2 -2
View File
@@ -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.
+6 -9
View File
@@ -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());
}
}
+1 -1
View File
@@ -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”)
+10 -1
View File
@@ -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));
+7 -5
View File
@@ -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) {
+56
View File
@@ -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;
+1
View File
@@ -36,6 +36,7 @@ public:
private:
static nsresult CheckChannel(nsIChannel* aChannel);
static nsresult CheckFTPSubresourceLoad(nsIChannel* aChannel);
virtual ~nsContentSecurityManager() {}
+1 -1
View File
@@ -233,7 +233,7 @@ void
nsSMILAnimationController::NotifyRefreshDriverCreated(
nsRefreshDriver* aRefreshDriver)
{
if (!mPauseState) {
if (!mPauseState && mChildContainerTable.Count()) {
MaybeStartSampling(aRefreshDriver);
}
}
+1 -1
View File
@@ -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).
+5 -3
View File
@@ -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;
}
+8 -3
View File
@@ -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);
}
+32 -13
View File
@@ -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.
+4 -3
View File
@@ -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
View File
@@ -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 {
+2 -1
View File
@@ -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
+17 -4
View File
@@ -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);
}
+1 -1
View File
@@ -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
View File
@@ -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;
+3
View File
@@ -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
View File
@@ -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
View File
@@ -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;
}
-4
View File
@@ -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)
+4
View File
@@ -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()
+4
View File
@@ -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;
+5 -5
View File
@@ -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) {
+1
View File
@@ -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);
-4
View File
@@ -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);
+1 -40
View File
@@ -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;
+3 -78
View File
@@ -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) {
-5
View File
@@ -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
+2
View File
@@ -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

+10 -4
View File
@@ -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;
}
+57 -135
View File
@@ -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;
+2 -2
View File
@@ -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;