diff options
38 files changed, 229 insertions, 87 deletions
diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 8ee732cca..8985863e8 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -1109,6 +1109,12 @@ class CGHeaders(CGWrapper): # Now find all the things we'll need as arguments because we # need to wrap or unwrap them. bindingHeaders = set() + + # KeyframeAnimationOptions.webidl is doing something VERY screwy and + # Unified Building really sucks so directly include this + if prefix == "KeyframeAnimationOptionsBinding": + bindingHeaders.add("mozilla/dom/PrimitiveConversions.h") + declareIncludes = set(declareIncludes) def addHeadersForType((t, dictionary)): diff --git a/dom/bindings/WebIDLGlobalNameHash.cpp b/dom/bindings/WebIDLGlobalNameHash.cpp index 7477b52e7..981a1a395 100644 --- a/dom/bindings/WebIDLGlobalNameHash.cpp +++ b/dom/bindings/WebIDLGlobalNameHash.cpp @@ -4,8 +4,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "jswrapper.h" #include "WebIDLGlobalNameHash.h" #include "js/GCAPI.h" +#include "XrayWrapper.h" +#include "XPCWrapper.h" +#include "mozilla/dom/Selection.h" #include "mozilla/HashFunctions.h" #include "mozilla/Maybe.h" #include "mozilla/dom/DOMJSProxyHandler.h" diff --git a/dom/bindings/WebIDLGlobalNameHash.h b/dom/bindings/WebIDLGlobalNameHash.h index bbe015395..cd7be2c69 100644 --- a/dom/bindings/WebIDLGlobalNameHash.h +++ b/dom/bindings/WebIDLGlobalNameHash.h @@ -8,6 +8,7 @@ #define mozilla_dom_WebIDLGlobalNameHash_h__ #include "js/RootingAPI.h" +#include "nsString.h" #include "nsTArray.h" namespace mozilla { diff --git a/dom/bindings/moz.build b/dom/bindings/moz.build index ed8a4d37e..ca82b48a8 100644 --- a/dom/bindings/moz.build +++ b/dom/bindings/moz.build @@ -89,7 +89,7 @@ LOCAL_INCLUDES += [ '/media/webrtc/signaling/src/peerconnection', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'BindingUtils.cpp', 'CallbackInterface.cpp', 'CallbackObject.cpp', diff --git a/dom/bindings/nsScriptError.h b/dom/bindings/nsScriptError.h index b8049d0a0..ac8099c1c 100644 --- a/dom/bindings/nsScriptError.h +++ b/dom/bindings/nsScriptError.h @@ -14,8 +14,13 @@ #include "jsapi.h" #include "js/RootingAPI.h" +#include "jswrapper.h" +#include "nsCOMArray.h" +#include "nsContentUtils.h" +#include "nsCycleCollectionParticipant.h" #include "nsIScriptError.h" #include "nsString.h" +#include "nsStringFwd.h" class nsScriptErrorNote final : public nsIScriptErrorNote { public: diff --git a/dom/bindings/nsScriptErrorWithStack.cpp b/dom/bindings/nsScriptErrorWithStack.cpp index 74c00999f..0a8df38b3 100644 --- a/dom/bindings/nsScriptErrorWithStack.cpp +++ b/dom/bindings/nsScriptErrorWithStack.cpp @@ -22,7 +22,7 @@ using namespace mozilla::dom; namespace { static nsCString -FormatStackString(JSContext* cx, HandleObject aStack) { +FormatStackString(JSContext* cx, JS::HandleObject aStack) { JS::RootedString formattedStack(cx); if (!JS::BuildStackString(cx, aStack, &formattedStack)) { @@ -111,7 +111,7 @@ nsScriptErrorWithStack::ToString(nsACString& /*UTF8*/ aResult) } JSContext* cx = jsapi.cx(); - RootedObject stack(cx, mStack); + JS::RootedObject stack(cx, mStack); nsCString stackString = FormatStackString(cx, stack); nsCString combined = message + NS_LITERAL_CSTRING("\n") + stackString; aResult.Assign(combined); diff --git a/dom/indexedDB/ActorsChild.cpp b/dom/indexedDB/ActorsChild.cpp index 30dc9b6da..85f876cdc 100644 --- a/dom/indexedDB/ActorsChild.cpp +++ b/dom/indexedDB/ActorsChild.cpp @@ -3291,6 +3291,10 @@ BackgroundCursorChild::HandleResponse( auto& responses = const_cast<nsTArray<ObjectStoreCursorResponse>&>(aResponses); + // If a new cursor is created, we need to keep a reference to it until the + // ResultHelper creates a DOM Binding. + RefPtr<IDBCursor> newCursor; + for (ObjectStoreCursorResponse& response : responses) { StructuredCloneReadInfo cloneReadInfo(Move(response.cloneInfo())); cloneReadInfo.mDatabase = mTransaction->Database(); @@ -3300,8 +3304,6 @@ BackgroundCursorChild::HandleResponse( nullptr, cloneReadInfo.mFiles); - RefPtr<IDBCursor> newCursor; - if (mCursor) { mCursor->Reset(Move(response.key()), Move(cloneReadInfo)); } else { diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp index d07ad7945..6d4f297d6 100644 --- a/dom/security/nsCSPUtils.cpp +++ b/dom/security/nsCSPUtils.cpp @@ -555,7 +555,21 @@ permitsPort(const nsAString& aEnforcementScheme, int32_t resourcePort; nsresult rv = aResourceURI->GetPort(&resourcePort); - NS_ENSURE_SUCCESS(rv, false); + if (NS_FAILED(rv) && aEnforcementPort.IsEmpty()) { + // If we cannot get a Port (e.g. because of an Custom Protocol handler) + // we need to check if a default port is associated with the Scheme + if (aEnforcementScheme.IsEmpty()) { + return false; + } + int defaultPortforScheme = + NS_GetDefaultPort(NS_ConvertUTF16toUTF8(aEnforcementScheme).get()); + + // If there is no default port associated with the Scheme ( + // defaultPortforScheme == -1) or it is an externally handled protocol ( + // defaultPortforScheme == 0 ) and the csp does not enforce a port - we can + // allow not having a port + return (defaultPortforScheme == -1 || defaultPortforScheme == 0); + } // Avoid unnecessary string creation/manipulation and don't block the // load if the resource to be loaded uses the default port for that diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index b342f1d18..8df7af4a8 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -555,6 +555,14 @@ void BufferTextureHost::DeallocateDeviceData() { if (mFirstSource && mFirstSource->NumCompositableRefs() > 0) { + // WrappingTextureSourceYCbCrBasic wraps YUV format BufferTextureHost. + // When BufferTextureHost is destroyed, data of + // WrappingTextureSourceYCbCrBasic becomes invalid. + if (mFirstSource->AsWrappingTextureSourceYCbCrBasic() && + mFirstSource->IsOwnedBy(this)) { + mFirstSource->SetOwner(nullptr); + mFirstSource->DeallocateDeviceData(); + } return; } diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index ea76f85f0..9e83a8729 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -712,6 +712,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt if (Omnijar::IsInitialized()) { // Make sure that child processes can find the omnijar // See XRE_InitCommandLine in nsAppRunner.cpp + newEnvVars["UXP_CUSTOM_OMNI"] = 1; nsAutoCString path; nsCOMPtr<nsIFile> file = Omnijar::GetPath(Omnijar::GRE); if (file && NS_SUCCEEDED(file->GetNativePath(path))) { diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 34cfc6b59..37cd3e45e 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -10882,6 +10882,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, // no? And if we cared we could look through the item list // instead of groveling through the framelist here.. nsStyleContext *frameStyleContext = aFrame->StyleContext(); +#ifdef DEBUG // Report a warning for non-GC frames, for chrome: if (!aFrame->IsGeneratedContentFrame() && mPresShell->GetPresContext()->IsChrome()) { @@ -10900,6 +10901,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, message, params, ArrayLength(params)); } +#endif RefPtr<nsStyleContext> blockSC = mPresShell->StyleSet()-> ResolveAnonymousBoxStyle(nsCSSAnonBoxes::mozXULAnonymousBlock, diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index a8309314f..556e35406 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -1056,6 +1056,7 @@ protected: bool ParseOneFamily(nsAString& aFamily, bool& aOneKeyword, bool& aQuoted); bool ParseFamily(nsCSSValue& aValue); bool ParseFontFeatureSettings(nsCSSValue& aValue); + bool ParseFontVariationSettings(nsCSSValue& aValue); bool ParseFontSrc(nsCSSValue& aValue); bool ParseFontSrcFormat(InfallibleTArray<nsCSSValue>& values); bool ParseFontRanges(nsCSSValue& aValue); @@ -12092,6 +12093,8 @@ CSSParserImpl::ParseSingleValuePropertyByFunction(nsCSSValue& aValue, return ParseFontVariantNumeric(aValue); case eCSSProperty_font_feature_settings: return ParseFontFeatureSettings(aValue); + case eCSSProperty_font_variation_settings: + return ParseFontVariationSettings(aValue); case eCSSProperty_font_weight: return ParseFontWeight(aValue); case eCSSProperty_image_orientation: @@ -15315,6 +15318,19 @@ CSSParserImpl::ParseFontFeatureSettings(nsCSSValue& aValue) return true; } +bool
+CSSParserImpl::ParseFontVariationSettings(nsCSSValue& aValue)
+{
+ // TODO: Actually implement this.
+
+ // This stub is here because websites insist on considering this
+ // very hardware-dependent and O.S.-variable low-level font-control
+ // as a "critical feature" which it isn't as there is 0 guarantee
+ // that font variation settings are supported or honored by any
+ // operating system used by the client.
+ return true;
+} + bool CSSParserImpl::ParseListStyle() { diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index 07db6d3dd..411f982a4 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -2037,6 +2037,20 @@ CSS_PROP_FONT( CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) CSS_PROP_FONT( + font-variation-settings, + font_variation_settings, + FontVariationSettings, + CSS_PROPERTY_PARSE_VALUE | + CSS_PROPERTY_VALUE_PARSER_FUNCTION | + CSS_PROPERTY_VALUE_LIST_USES_COMMAS | + CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | + CSS_PROPERTY_APPLIES_TO_PLACEHOLDER, + "layout.css.font-variations.stub", + 0, + nullptr, + CSS_PROP_NO_OFFSET, + eStyleAnimType_Discrete) +CSS_PROP_FONT( font-weight, font_weight, FontWeight, diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 647f7f6dc..910c1de8a 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -674,9 +674,9 @@ nsComputedDOMStyle::UpdateCurrentStyleSources(bool aNeedsLayoutFlush) mPresShell->GetPresContext()->GetRestyleGeneration(); if (mStyleContext) { - // We can't rely on the undisplayed restyle generation if mElement is
- // out-of-document, since that generation is not incremented for DOM changes
- // on out-of-document elements.
+ // We can't rely on the undisplayed restyle generation if mElement is + // out-of-document, since that generation is not incremented for DOM changes + // on out-of-document elements. if (mStyleContextGeneration == currentGeneration && mElement->IsInComposedDoc()) { // Our cached style context is still valid. @@ -1620,6 +1620,16 @@ nsComputedDOMStyle::DoGetFontFeatureSettings() } already_AddRefed<CSSValue> +nsComputedDOMStyle::DoGetFontVariationSettings() +{ + // TODO: This is still a stub, always returning "normal" + RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue; + + val->SetIdent(eCSSKeyword_normal); + return val.forget(); +} + +already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetFontKerning() { RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue; diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index 7fbf49afe..e94d8dbf6 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -251,6 +251,7 @@ private: already_AddRefed<CSSValue> DoGetColor(); already_AddRefed<CSSValue> DoGetFontFamily(); already_AddRefed<CSSValue> DoGetFontFeatureSettings(); + already_AddRefed<CSSValue> DoGetFontVariationSettings(); already_AddRefed<CSSValue> DoGetFontKerning(); already_AddRefed<CSSValue> DoGetFontLanguageOverride(); already_AddRefed<CSSValue> DoGetFontSize(); diff --git a/layout/style/nsComputedDOMStylePropertyList.h b/layout/style/nsComputedDOMStylePropertyList.h index 825976b58..557281810 100644 --- a/layout/style/nsComputedDOMStylePropertyList.h +++ b/layout/style/nsComputedDOMStylePropertyList.h @@ -144,6 +144,7 @@ COMPUTED_STYLE_PROP(font_variant_east_asian, FontVariantEastAsian) COMPUTED_STYLE_PROP(font_variant_ligatures, FontVariantLigatures) COMPUTED_STYLE_PROP(font_variant_numeric, FontVariantNumeric) COMPUTED_STYLE_PROP(font_variant_position, FontVariantPosition) +COMPUTED_STYLE_PROP(font_variation_settings, FontVariationSettings) COMPUTED_STYLE_PROP(font_weight, FontWeight) COMPUTED_STYLE_PROP(grid_auto_columns, GridAutoColumns) COMPUTED_STYLE_PROP(grid_auto_flow, GridAutoFlow) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 9adfb8918..6aa0111ef 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -2528,6 +2528,9 @@ pref("layout.css.image-orientation.enabled", true); // Is support for the font-display @font-face descriptor enabled? pref("layout.css.font-display.enabled", false); +// Enable the font variation stub code? +pref("layout.css.font-variations.stub", true); + // Are sets of prefixed properties supported? pref("layout.css.prefixes.border-image", true); pref("layout.css.prefixes.transforms", true); diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 0f4c94202..2691a2a77 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -199,7 +199,7 @@ nsHttpHandler::nsHttpHandler() , mLegacyAppVersion("5.0") , mProduct("Goanna") , mCompatFirefoxEnabled(false) - , mCompatFirefoxVersion("52.9") + , mCompatFirefoxVersion("68.9") , mUserAgentIsDirty(true) , mAcceptLanguagesIsDirty(true) , mPromptTempRedirect(true) diff --git a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java index d77715a3e..cc60f4c4b 100644 --- a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java +++ b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java @@ -717,8 +717,6 @@ public abstract class TreeBuilder<T> implements TokenHandler, tokenizer.setState(Tokenizer.DATA); } } - contextName = null; - contextNode = null; } else { mode = INITIAL; // If we are viewing XML source, put a foreign element permanently @@ -1627,6 +1625,8 @@ public abstract class TreeBuilder<T> implements TokenHandler, public final void endTokenization() throws SAXException { formPointer = null; headPointer = null; + contextName = null; + contextNode = null; deepTreeSurrogateParent = null; templateModeStack = null; if (stack != null) { diff --git a/parser/html/nsHtml5TreeBuilder.cpp b/parser/html/nsHtml5TreeBuilder.cpp index 050df1f94..efbc33967 100644 --- a/parser/html/nsHtml5TreeBuilder.cpp +++ b/parser/html/nsHtml5TreeBuilder.cpp @@ -141,8 +141,6 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self) tokenizer->setState(nsHtml5Tokenizer::DATA); } } - contextName = nullptr; - contextNode = nullptr; } else { mode = INITIAL; if (tokenizer->isViewingXmlSource()) { @@ -578,6 +576,8 @@ nsHtml5TreeBuilder::endTokenization() { formPointer = nullptr; headPointer = nullptr; + contextName = nullptr; + contextNode = nullptr; deepTreeSurrogateParent = nullptr; templateModeStack = nullptr; if (stack) { diff --git a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties index 370198f56..5e64e938a 100644 --- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties +++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties @@ -30,6 +30,8 @@ notification.blocked.link=More Information #LOCALIZATION NOTE (notification.softblocked) %1$S is the add-on name notification.softblocked=%1$S is known to cause issues. notification.softblocked.link=More Information +#LOCALIZATION NOTE (details.notification.compatibility) %1$S is the add-on name, %2$S is brand name +notification.compatibility=%1$S was not designed for %2$S. #LOCALIZATION NOTE (notification.outdated) %1$S is the add-on name notification.outdated=An important update is available for %1$S. notification.outdated.link=Update Now @@ -78,6 +80,8 @@ details.notification.incompatible=%1$S is incompatible with %2$S %3$S. #LOCALIZATION NOTE (details.notification.blocked) %1$S is the add-on name details.notification.blocked=%1$S has been disabled due to security or stability issues. details.notification.blocked.link=More Information +#LOCALIZATION NOTE (details.notification.compatibility) %1$S is the add-on name, %2$S is brand name +details.notification.compatibility=%1$S was not designed for %2$S. It may not function properly or cease to function. #LOCALIZATION NOTE (details.notification.softblocked) %1$S is the add-on name details.notification.softblocked=%1$S is known to cause issues. details.notification.softblocked.link=More Information diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js index 243db1c2f..90d38c90b 100644 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js @@ -638,6 +638,7 @@ nsUnknownContentTypeDialog.prototype = { // Returns true if opening the default application makes sense. openWithDefaultOK: function() { + // The checking is different on Windows... #ifdef XP_WIN // Windows presents some special cases. // We need to prevent use of "system default" when the file is @@ -675,7 +676,7 @@ nsUnknownContentTypeDialog.prototype = { // getPath: getPath: function (aFile) { #ifdef XP_MACOSX - return aFile.leafName || aFile.path; + return aFile.leafName || aFile.path; #else return aFile.path; #endif @@ -1007,11 +1008,13 @@ nsUnknownContentTypeDialog.prototype = { var otherHandler = this.dialogElement("otherHandler"); otherHandler.removeAttribute("hidden"); otherHandler.setAttribute("path", this.getPath(this.chosenApp.executable)); + #ifdef XP_WIN otherHandler.label = this.getFileDisplayName(this.chosenApp.executable); #else otherHandler.label = this.chosenApp.name; #endif + this.dialogElement("openHandler").selectedIndex = 1; this.dialogElement("openHandler").setAttribute("lastSelectedItemID", "otherHandler"); @@ -1069,43 +1072,42 @@ nsUnknownContentTypeDialog.prototype = { // Remember the file they chose to run. this.chosenApp = params.handlerApp; } -#else +#else // XP_WIN #if MOZ_WIDGET_GTK == 3 - var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser; - var appChooser = Components.classes["@mozilla.org/applicationchooser;1"] - .createInstance(nsIApplicationChooser); - appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle")); - var contentTypeDialogObj = this; - let appChooserCallback = function appChooserCallback_done(aResult) { - if (aResult) { - contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp); - } - contentTypeDialogObj.finishChooseApp(); - }; - appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); - // The finishChooseApp is called from appChooserCallback - return; -#else - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(this.mDialog, - this.dialogElement("strings").getString("chooseAppFilePickerTitle"), - nsIFilePicker.modeOpen); - - fp.appendFilters(nsIFilePicker.filterApps); - - if (fp.show() == nsIFilePicker.returnOK && fp.file) { - // Remember the file they chose to run. - var localHandlerApp = - Components.classes["@mozilla.org/uriloader/local-handler-app;1"]. - createInstance(Components.interfaces.nsILocalHandlerApp); - localHandlerApp.executable = fp.file; - this.chosenApp = localHandlerApp; + var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser; + var appChooser = Components.classes["@mozilla.org/applicationchooser;1"] + .createInstance(nsIApplicationChooser); + appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle")); + var contentTypeDialogObj = this; + let appChooserCallback = function appChooserCallback_done(aResult) { + if (aResult) { + contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp); } + contentTypeDialogObj.finishChooseApp(); + }; + appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); + // The finishChooseApp is called from appChooserCallback + return; +#else // MOZ_WIDGET_GTK == 3 + var nsIFilePicker = Components.interfaces.nsIFilePicker; + var fp = Components.classes["@mozilla.org/filepicker;1"] + .createInstance(nsIFilePicker); + fp.init(this.mDialog, + this.dialogElement("strings").getString("chooseAppFilePickerTitle"), + nsIFilePicker.modeOpen); + + fp.appendFilters(nsIFilePicker.filterApps); + + if (fp.show() == nsIFilePicker.returnOK && fp.file) { + // Remember the file they chose to run. + var localHandlerApp = + Components.classes["@mozilla.org/uriloader/local-handler-app;1"]. + createInstance(Components.interfaces.nsILocalHandlerApp); + localHandlerApp.executable = fp.file; + this.chosenApp = localHandlerApp; + } #endif // MOZ_WIDGET_GTK == 3 #endif // XP_WIN - } this.finishChooseApp(); }, diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 9576e9a3b..782fca303 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -3059,6 +3059,15 @@ var gDetailView = { warning.textContent = gStrings.ext.formatStringFromName("details.notification.gmpPending", [this._addon.name], 1); +#ifdef MOZ_PHOENIX_EXTENSIONS + } else if (this._addon.native == false) { + this.node.setAttribute("notification", "warning"); + this.node.setAttribute("native", "false"); + document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName( + "details.notification.compatibility", + [this._addon.name, gStrings.brandShortName], 2 + ); +#endif } else { this.node.removeAttribute("notification"); } diff --git a/toolkit/mozapps/extensions/content/extensions.xml b/toolkit/mozapps/extensions/content/extensions.xml index 9c8fda8ed..513807e78 100644 --- a/toolkit/mozapps/extensions/content/extensions.xml +++ b/toolkit/mozapps/extensions/content/extensions.xml @@ -858,8 +858,8 @@ xbl:inherits="value=name,tooltiptext=name"/> <xul:label anonid="version" class="version"/> #ifdef MOZ_PHOENIX_EXTENSIONS - <xul:label class="nativeIndicator nativeAddon" value="●" tooltiptext="&addon.nativeAddon;"/> - <xul:label class="nativeIndicator compatAddon" value="●" tooltiptext="&addon.compatAddon;"/> + <xul:label class="nativeIndicator nativeAddon" value="" tooltiptext="&addon.nativeAddon;"/> + <xul:label class="nativeIndicator compatAddon" value="⚠️" tooltiptext="&addon.compatAddon;"/> #endif <xul:label class="disabled-postfix" value="&addon.disabled.postfix;"/> <xul:label class="update-postfix" value="&addon.update.postfix;"/> @@ -1359,8 +1359,16 @@ } else { this.removeAttribute("notification"); #ifdef MOZ_PHOENIX_EXTENSIONS - if (this.mAddon.type == "extension") + if (this.mAddon.type == "extension") { this.setAttribute("native", this.mAddon.native); + if (this.mAddon.native == false) { + this.setAttribute("notification", "warning"); + this._warning.textContent = gStrings.ext.formatStringFromName( + "notification.compatibility", + [this.mAddon.name, gStrings.brandShortName], 2 + ); + } + } #endif } } diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 600ec2ff5..2f298a934 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -6472,8 +6472,8 @@ AddonInternal.prototype = { } else if (app.id == FIREFOX_ID) { version = FIREFOX_APPCOMPATVERSION; - if (this.type == "locale") - //Never allow language packs in Firefox compatibility mode + if (this.type != "extension") + //Only allow extensions in Firefox compatibility mode return false; #endif } diff --git a/toolkit/themes/linux/mozapps/extensions/extensions.css b/toolkit/themes/linux/mozapps/extensions/extensions.css index 5c642fbbf..b21a65520 100644 --- a/toolkit/themes/linux/mozapps/extensions/extensions.css +++ b/toolkit/themes/linux/mozapps/extensions/extensions.css @@ -517,6 +517,13 @@ background-repeat: repeat-x; } +.addon-view[notification="warning"][native="false"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"), + linear-gradient(rgba(255, 128, 0, 0.04), + rgba(255, 128, 0, 0)); + background-repeat: repeat-x; +} + .addon-view[notification="error"] { background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"), linear-gradient(rgba(255, 0, 0, 0.04), diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png Binary files differnew file mode 100644 index 000000000..dee75516b --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-error.png b/toolkit/themes/linux/mozapps/extensions/stripes-error.png Binary files differnew file mode 100644 index 000000000..1dc2d8504 --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-error.png diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png b/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png Binary files differnew file mode 100644 index 000000000..901ab1ec2 --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png b/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png Binary files differnew file mode 100644 index 000000000..370ceec0f --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-warning.png b/toolkit/themes/linux/mozapps/extensions/stripes-warning.png Binary files differnew file mode 100644 index 000000000..69463fb1a --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-warning.png diff --git a/toolkit/themes/linux/mozapps/jar.mn b/toolkit/themes/linux/mozapps/jar.mn index 0931d1823..27b647308 100644 --- a/toolkit/themes/linux/mozapps/jar.mn +++ b/toolkit/themes/linux/mozapps/jar.mn @@ -26,6 +26,11 @@ toolkit.jar: skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png) skin/classic/mozapps/extensions/themeGeneric-16.png (extensions/themeGeneric-16.png) skin/classic/mozapps/extensions/localeGeneric.png (extensions/localeGeneric.png) + skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png) + skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png) + skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png) + skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png) + skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png) skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css) skin/classic/mozapps/extensions/selectAddons.css (extensions/selectAddons.css) skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png) diff --git a/toolkit/themes/osx/mozapps/extensions/extensions.css b/toolkit/themes/osx/mozapps/extensions/extensions.css index 9614967a4..474cb12d1 100644 --- a/toolkit/themes/osx/mozapps/extensions/extensions.css +++ b/toolkit/themes/osx/mozapps/extensions/extensions.css @@ -659,6 +659,13 @@ background-repeat: repeat-x; } +.addon-view[notification="warning"][native="false"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"), + linear-gradient(rgba(255, 128, 0, 0.04), + rgba(255, 128, 0, 0)); + background-repeat: repeat-x; +} + .addon-view[notification="error"] { background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"), linear-gradient(rgba(255, 0, 0, 0.04), diff --git a/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png Binary files differnew file mode 100644 index 000000000..dee75516b --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png diff --git a/toolkit/themes/windows/mozapps/extensions/extensions.css b/toolkit/themes/windows/mozapps/extensions/extensions.css index f350f7ca6..96ea1b46c 100644 --- a/toolkit/themes/windows/mozapps/extensions/extensions.css +++ b/toolkit/themes/windows/mozapps/extensions/extensions.css @@ -648,6 +648,13 @@ background-repeat: repeat-x; } +.addon-view[notification="warning"][native="false"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"), + linear-gradient(rgba(255, 128, 0, 0.04), + rgba(255, 128, 0, 0)); + background-repeat: repeat-x; +} + .addon-view[notification="error"] { background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"), linear-gradient(rgba(255, 0, 0, 0.04), diff --git a/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png Binary files differnew file mode 100644 index 000000000..dee75516b --- /dev/null +++ b/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png diff --git a/toolkit/themes/windows/mozapps/jar.mn b/toolkit/themes/windows/mozapps/jar.mn index 9f7562995..5ca886051 100644 --- a/toolkit/themes/windows/mozapps/jar.mn +++ b/toolkit/themes/windows/mozapps/jar.mn @@ -39,6 +39,7 @@ toolkit.jar: skin/classic/mozapps/extensions/heart.png (extensions/heart.png) skin/classic/mozapps/extensions/navigation.png (extensions/navigation.png) skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png) + skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png) skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png) skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png) skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png) diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index b27e46697..d8f95c2a8 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -4131,45 +4131,49 @@ XRE_InitCommandLine(int aArgc, char* aArgv[]) delete[] canonArgs; #endif - const char *path = nullptr; - ArgResult ar = CheckArg("greomni", true, &path); - if (ar == ARG_BAD) { - 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; - } + if (PR_GetEnv("UXP_CUSTOM_OMNI")) { + // Process CLI parameters for specifying custom omnijars + const char *path = nullptr; + ArgResult ar = CheckArg("greomni", true, &path); + if (ar == ARG_BAD) { + 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; + } - if (!path) - return rv; + if (!path) + return rv; - nsCOMPtr<nsIFile> greOmni; - rv = XRE_GetFileFromPath(path, getter_AddRefs(greOmni)); - if (NS_FAILED(rv)) { - PR_fprintf(PR_STDERR, "Error: argument --greomni requires a valid path\n"); - return rv; - } + nsCOMPtr<nsIFile> greOmni; + rv = XRE_GetFileFromPath(path, getter_AddRefs(greOmni)); + if (NS_FAILED(rv)) { + PR_fprintf(PR_STDERR, "Error: argument --greomni requires a valid path\n"); + return rv; + } - ar = CheckArg("appomni", true, &path); - if (ar == ARG_BAD) { - 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; - } + ar = CheckArg("appomni", true, &path); + if (ar == ARG_BAD) { + 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; + } - nsCOMPtr<nsIFile> appOmni; - if (path) { - rv = XRE_GetFileFromPath(path, getter_AddRefs(appOmni)); - if (NS_FAILED(rv)) { - PR_fprintf(PR_STDERR, "Error: argument --appomni requires a valid path\n"); - return rv; - } - } + nsCOMPtr<nsIFile> appOmni; + if (path) { + rv = XRE_GetFileFromPath(path, getter_AddRefs(appOmni)); + if (NS_FAILED(rv)) { + PR_fprintf(PR_STDERR, "Error: argument --appomni requires a valid path\n"); + return rv; + } + } + + mozilla::Omnijar::Init(greOmni, appOmni); + } // UXP_CUSTOM_OMNI - mozilla::Omnijar::Init(greOmni, appOmni); return rv; } |