Bug 1682030 - Clean up NPAPI plugin fallback behavior. r=jmathies,emilio

Similifies use of EventStates and ObjectType/FallbackType enums since most states they represented are no longer valid with the removal of NPAPI plugins.  The state machine for (unsupported) plugin elements is now much simpler but still distinguishes between HTML fallbacks, fallbacks leading to a "BROKEN" state (e.g. failing to load the image the element refers to), and fallbacks that would simply lead the element to occupy an empty region.  The last type of fallback is behind a pref "layout.use-plugin-fallback" and is disabled by default.

Simplifying the state machine allows us to clean up nsObjectLoadingContent.  We also update many of the enums which refered to plugins, which would otherwise get confusing.

Differential Revision: https://phabricator.services.mozilla.com/D107158
This commit is contained in:
David Parks
2021-04-06 19:28:18 +00:00
parent 2ff174e21e
commit 4694dbea8d
20 changed files with 143 additions and 961 deletions

View File

@@ -29,11 +29,11 @@ interface nsIWebNavigationInfo : nsISupports
const unsigned long IMAGE = 1;
/**
* Returned by isTypeSupported to indicate that a type is supported via an
* NPAPI ("Netscape 4 API") plug-in. This is not the value returned for
* "XPCOM plug-ins".
* Returned by isTypeSupported to indicate that a type is a special NPAPI
* plugin that render as a transparent region (we do not support NPAPI
* plugins).
*/
const unsigned long PLUGIN = 2;
const unsigned long FALLBACK = 2;
/**
* @note Other return types may be added here in the future as they become

View File

@@ -64,8 +64,8 @@ uint32_t nsWebNavigationInfo::IsTypeSupportedInternal(const nsCString& aType) {
case nsContentUtils::TYPE_UNSUPPORTED:
return nsIWebNavigationInfo::UNSUPPORTED;
case nsContentUtils::TYPE_PLUGIN:
return nsIWebNavigationInfo::PLUGIN;
case nsContentUtils::TYPE_FALLBACK:
return nsIWebNavigationInfo::FALLBACK;
case nsContentUtils::TYPE_UNKNOWN:
return nsIWebNavigationInfo::OTHER;

View File

@@ -2239,8 +2239,6 @@ Document::~Document() {
mPendingTitleChangeEvent.Revoke();
mPlugins.Clear();
MOZ_ASSERT(mDOMMediaQueryLists.isEmpty(),
"must not have media query lists left");
@@ -13014,15 +13012,6 @@ mozilla::dom::ImageTracker* Document::ImageTracker() {
return mImageTracker;
}
void Document::GetPlugins(nsTArray<nsIObjectLoadingContent*>& aPlugins) {
aPlugins.AppendElements(ToArray(mPlugins));
auto recurse = [&aPlugins](Document& aSubDoc) {
aSubDoc.GetPlugins(aPlugins);
return CallState::Continue;
};
EnumerateSubDocuments(recurse);
}
void Document::ScheduleSVGUseElementShadowTreeUpdate(
SVGUseElement& aUseElement) {
MOZ_ASSERT(aUseElement.IsInComposedDoc());

View File

@@ -3096,24 +3096,6 @@ class Document : public nsINode,
dom::ImageTracker* ImageTracker();
// AddPlugin adds a plugin-related element to mPlugins when the element is
// added to the tree.
void AddPlugin(nsIObjectLoadingContent* aPlugin) {
MOZ_ASSERT(aPlugin);
mPlugins.Insert(aPlugin);
}
// RemovePlugin removes a plugin-related element to mPlugins when the
// element is removed from the tree.
void RemovePlugin(nsIObjectLoadingContent* aPlugin) {
MOZ_ASSERT(aPlugin);
mPlugins.Remove(aPlugin);
}
// GetPlugins returns the plugin-related elements from
// the frame and any subframes.
void GetPlugins(nsTArray<nsIObjectLoadingContent*>& aPlugins);
// Adds an element to mResponsiveContent when the element is
// added to the tree.
void AddResponsiveContent(HTMLImageElement* aContent) {
@@ -5115,9 +5097,6 @@ class Document : public nsINode,
// A set of responsive images keyed by address pointer.
nsTHashSet<HTMLImageElement*> mResponsiveContent;
// Tracking for plugins in the document.
nsTHashSet<nsIObjectLoadingContent*> mPlugins;
RefPtr<DocumentTimeline> mDocumentTimeline;
LinkedList<DocumentTimeline> mTimelines;

View File

@@ -6620,7 +6620,7 @@ nsContentUtils::FindInternalContentViewer(const nsACString& aType,
if (contractID.EqualsLiteral(CONTENT_DLF_CONTRACTID))
*aLoaderType = TYPE_CONTENT;
else if (contractID.EqualsLiteral(PLUGIN_DLF_CONTRACTID))
*aLoaderType = TYPE_PLUGIN;
*aLoaderType = TYPE_FALLBACK;
else
*aLoaderType = TYPE_UNKNOWN;
}
@@ -9758,7 +9758,7 @@ static bool HtmlObjectContentSupportsDocument(const nsCString& aMimeType,
if (supported != nsIWebNavigationInfo::UNSUPPORTED) {
// Don't want to support plugins as documents
return supported != nsIWebNavigationInfo::PLUGIN;
return supported != nsIWebNavigationInfo::FALLBACK;
}
// Try a stream converter
@@ -9811,11 +9811,10 @@ uint32_t nsContentUtils::HtmlObjectContentTypeForMIMEType(
return nsIObjectLoadingContent::TYPE_DOCUMENT;
}
bool isPlugin = nsPluginHost::GetSpecialType(aMIMEType) !=
bool isSpecialPlugin = nsPluginHost::GetSpecialType(aMIMEType) !=
nsPluginHost::eSpecialType_None;
if (isPlugin) {
// ShouldPlay will handle checking for disabled plugins
return nsIObjectLoadingContent::TYPE_PLUGIN;
if (isSpecialPlugin) {
return nsIObjectLoadingContent::TYPE_FALLBACK;
}
return nsIObjectLoadingContent::TYPE_NULL;

View File

@@ -2510,7 +2510,7 @@ class nsContentUtils {
enum ContentViewerType {
TYPE_UNSUPPORTED,
TYPE_CONTENT,
TYPE_PLUGIN,
TYPE_FALLBACK,
TYPE_UNKNOWN
};

View File

@@ -3490,18 +3490,6 @@ nsDOMWindowUtils::GetPaintingSuppressed(bool* aPaintingSuppressed) {
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetPlugins(JSContext* cx,
JS::MutableHandle<JS::Value> aPlugins) {
nsCOMPtr<Document> doc = GetDocument();
NS_ENSURE_STATE(doc);
nsTArray<nsIObjectLoadingContent*> plugins;
doc->GetPlugins(plugins);
return ToJSValue(cx, plugins, aPlugins) ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsDOMWindowUtils::SetVisualViewportSize(float aWidth, float aHeight) {
if (!(aWidth >= 0.0 && aHeight >= 0.0)) {

View File

@@ -28,41 +28,13 @@ interface nsIObjectLoadingContent : nsISupports
*/
const unsigned long TYPE_LOADING = 0;
const unsigned long TYPE_IMAGE = 1;
const unsigned long TYPE_PLUGIN = 2;
const unsigned long TYPE_FALLBACK = 2;
const unsigned long TYPE_FAKE_PLUGIN = 3;
const unsigned long TYPE_DOCUMENT = 4;
const unsigned long TYPE_NULL = 5;
const unsigned long PLUGIN_ACTIVE = 0xFF;
// The content type is not supported (e.g. plugin not installed)
const unsigned long PLUGIN_UNSUPPORTED = 0;
// Showing alternate content
const unsigned long PLUGIN_ALTERNATE = 1;
// The plugin exists, but is disabled
const unsigned long PLUGIN_DISABLED = 2;
// The plugin is blocklisted and disabled
const unsigned long PLUGIN_BLOCKLISTED = 3;
// The plugin is considered outdated, but not disabled
const unsigned long PLUGIN_OUTDATED = 4;
// The plugin has crashed
const unsigned long PLUGIN_CRASHED = 5;
/// ** All values >= PLUGIN_CLICK_TO_PLAY are plugin placeholder types that
/// would be replaced by a real plugin if activated (playPlugin())
/// ** Furthermore, values >= PLUGIN_CLICK_TO_PLAY and
/// <= PLUGIN_CLICK_TO_PLAY_QUIET are click-to-play types.
// The plugin is disabled until the user clicks on it
const unsigned long PLUGIN_CLICK_TO_PLAY = 8;
// The plugin is vulnerable (update available)
const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
// The plugin is vulnerable (no update available)
const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
// The plugin is click-to-play, but the user won't see overlays
const unsigned long PLUGIN_CLICK_TO_PLAY_QUIET = 11;
// Plugins are no longer supported. The plugin should not load and should
// be represented by a transparent element.
const unsigned long PLUGIN_BLOCK_ALL = 12;
// Plugins-specific permission indicating that we want to prompt the user
// to decide whether they want to allow a plugin, but to do so in a less
// intrusive way than PROMPT_ACTION would entail. At the time of writing,
@@ -85,19 +57,10 @@ interface nsIObjectLoadingContent : nsISupports
/**
* Gets the content type that corresponds to the give MIME type. See the
* constants above for the list of possible values. If nothing else fits,
* TYPE_NULL will be returned.
* TYPE_FALLBACK will be returned.
*/
unsigned long getContentTypeForMIMEType(in AUTF8String aMimeType);
/**
/*
* Notifications from pluginhost that our instance crashed or was destroyed.
*/
[noscript] void pluginDestroyed();
[noscript] void pluginCrashed(in nsIPluginTag pluginTag,
in AString pluginDumpID,
in boolean submittedCrashReport);
/**
* Forces a re-evaluation and reload of the tag, optionally invalidating its
* click-to-play state. This can be used when the MIME type that provides a
@@ -106,13 +69,6 @@ interface nsIObjectLoadingContent : nsISupports
*/
void reload(in boolean aClearActivation);
/**
* This attribute will return true if the current content type has been
* activated, either explicitly or by passing checks that would have it be
* click-to-play.
*/
readonly attribute boolean activated;
[noscript] void stopPluginInstance();
[noscript] void syncStartPluginInstance();

File diff suppressed because it is too large Load Diff

View File

@@ -63,50 +63,21 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
eType_Loading = TYPE_LOADING,
// Content is a *non-svg* image
eType_Image = TYPE_IMAGE,
// Content is a plugin
eType_Plugin = TYPE_PLUGIN,
// Content is a "special" plugin. Plugins are removed but these MIME
// types display an transparent region in their place.
// (Special plugins that have an HTML fallback are eType_Null)
eType_Fallback = TYPE_FALLBACK,
// Content is a fake plugin, which loads as a document but behaves as a
// plugin (see nsPluginHost::CreateFakePlugin)
// plugin (see nsPluginHost::CreateFakePlugin). Currently only used for
// pdf.js.
eType_FakePlugin = TYPE_FAKE_PLUGIN,
// Content is a subdocument, possibly SVG
eType_Document = TYPE_DOCUMENT,
// No content loaded (fallback). May be showing alternate content or
// a custom error handler - *including* click-to-play dialogs
// Content is unknown and should be represented by an empty element,
// unless an HTML fallback is available.
eType_Null = TYPE_NULL
};
enum FallbackType {
// The content type is not supported (e.g. plugin not installed)
eFallbackUnsupported = nsIObjectLoadingContent::PLUGIN_UNSUPPORTED,
// Showing alternate content
eFallbackAlternate = nsIObjectLoadingContent::PLUGIN_ALTERNATE,
// The plugin exists, but is disabled
eFallbackDisabled = nsIObjectLoadingContent::PLUGIN_DISABLED,
// The plugin is blocklisted and disabled
eFallbackBlocklisted = nsIObjectLoadingContent::PLUGIN_BLOCKLISTED,
// The plugin is considered outdated, but not disabled
eFallbackOutdated = nsIObjectLoadingContent::PLUGIN_OUTDATED,
// The plugin has crashed
eFallbackCrashed = nsIObjectLoadingContent::PLUGIN_CRASHED,
/// ** All values >= eFallbackClickToPlay are plugin placeholder types
/// that would be replaced by a real plugin if activated (PlayPlugin())
/// ** Furthermore, values >= eFallbackClickToPlay and
/// <= eFallbackClickToPlayQuiet are click-to-play types.
// The plugin is disabled until the user clicks on it
eFallbackClickToPlay = nsIObjectLoadingContent::PLUGIN_CLICK_TO_PLAY,
// The plugin is vulnerable (update available)
eFallbackVulnerableUpdatable =
nsIObjectLoadingContent::PLUGIN_VULNERABLE_UPDATABLE,
// The plugin is vulnerable (no update available)
eFallbackVulnerableNoUpdate =
nsIObjectLoadingContent::PLUGIN_VULNERABLE_NO_UPDATE,
// The plugin is click-to-play, but the user won't see overlays
eFallbackClickToPlayQuiet =
nsIObjectLoadingContent::PLUGIN_CLICK_TO_PLAY_QUIET,
// Plugins are no longer supported. Content is just a transparent rect.
eFallbackBlockAllPlugins = nsIObjectLoadingContent::PLUGIN_BLOCK_ALL,
};
nsObjectLoadingContent();
virtual ~nsObjectLoadingContent();
@@ -179,22 +150,11 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
uint32_t GetContentTypeForMIMEType(const nsAString& aMIMEType) {
return GetTypeOfContent(NS_ConvertUTF16toUTF8(aMIMEType), false);
}
void PlayPlugin(mozilla::dom::SystemCallerGuarantee,
mozilla::ErrorResult& aRv);
void Reload(bool aClearActivation, mozilla::ErrorResult& aRv) {
aRv = Reload(aClearActivation);
}
bool Activated() const { return mActivated; }
nsIURI* GetSrcURI() const { return mURI; }
/**
* The default state that this plugin would be without manual activation.
* @returns PLUGIN_ACTIVE if the default state would be active.
*/
uint32_t DefaultFallbackType();
uint32_t PluginFallbackType() const { return mFallbackType; }
// FIXME rename this
void SkipFakePlugins(mozilla::ErrorResult& aRv) { aRv = SkipFakePlugins(); }
void SwapFrameLoaders(mozilla::dom::HTMLIFrameElement& aOtherLoaderOwner,
@@ -308,7 +268,10 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
void CreateStaticClone(nsObjectLoadingContent* aDest) const;
nsresult BindToTree(mozilla::dom::BindContext&, nsINode& aParent);
nsresult BindToTree(mozilla::dom::BindContext& aCxt, nsINode& aParent) {
nsImageLoadingContent::BindToTree(aCxt, aParent);
return NS_OK;
}
void UnbindFromTree(bool aNullParent = true);
/**
@@ -367,13 +330,9 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
[[nodiscard]] nsresult BuildParametersArray();
/**
* Loads fallback content with the specified FallbackType
*
* @param aType FallbackType value for type of fallback we're loading
* @param aNotify Send notifications and events. If false, caller is
* responsible for doing so
* Configure fallback for deprecated plugin and broken elements.
*/
void LoadFallback(FallbackType aType, bool aNotify);
void ConfigureFallback();
/**
* Internal version of LoadObject that should only be used by this class
@@ -384,7 +343,7 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
nsIRequest* aLoadingChannel);
/**
* Introspects the object and sets the following member variables:
* Inspects the object and sets the following member variables:
* - mOriginalContentType : This is the type attribute on the element
* - mOriginalURI : The src or data attribute on the element
* - mURI : The final URI, considering mChannel if
@@ -427,33 +386,6 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
*/
bool ShouldBlockContent();
/**
* If this object is allowed to play plugin content, or if it would display
* click-to-play instead.
* NOTE that this does not actually check if the object is a loadable plugin
* NOTE This ignores the current activated state. The caller should check
* this if appropriate.
*/
bool ShouldPlay(FallbackType& aReason);
/**
* This method tells if the fallback content should be attempted to be used
* over the original object content.
* It will look at prefs and this plugin's CTP state to make a decision.
*
* NOTE that this doesn't say whether the fallback _will_ be used, only
* whether we should look into it to possibly use it. The final answer will be
* given by the PreferFallback method.
*
* @param aIsPluginClickToPlay Whether this object instance is CTP.
*/
bool FavorFallbackMode(bool aIsPluginClickToPlay);
/**
* Whether the page has provided good fallback content to this object.
*/
bool HasGoodFallback();
/**
* This method tells the final answer on whether this object's fallback
* content should be used instead of the original plugin content.
@@ -481,12 +413,6 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
*/
bool CheckProcessPolicy(int16_t* aContentPolicy);
/**
* Gets the plugin instance and creates a plugin stream listener, assigning
* it to mFinalListener
*/
bool MakePluginListener();
void SetupFrameLoader(int32_t aJSPluginId);
/**
@@ -513,12 +439,9 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
* this method is called. This method is cheap if the type and state didn't
* actually change.
*
* @param aSync If a synchronous frame construction is required. If false,
* the construction may either be sync or async.
* @param aNotify if false, only need to update the state of our element.
*/
void NotifyStateChanged(ObjectType aOldType, mozilla::EventStates aOldState,
FallbackType aOldFallbackType, bool aSync,
bool aNotify);
/**
@@ -599,8 +522,6 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
// Type of the currently-loaded content.
ObjectType mType : 8;
// The type of fallback content we're showing (see ObjectState())
FallbackType mFallbackType : 8;
uint32_t mRunID;
bool mHasRunID : 1;
@@ -619,10 +540,6 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
// it may lose the flag.
bool mNetworkCreated : 1;
// Used to keep track of whether or not a plugin has been explicitly
// activated by PlayPlugin(). (see ShouldPlay())
bool mActivated : 1;
// Whether content blocking is enabled or not for this object.
bool mContentBlockingEnabled : 1;
@@ -645,11 +562,6 @@ class nsObjectLoadingContent : public nsImageLoadingContent,
// videos.
bool mRewrittenYoutubeEmbed : 1;
// Cache the answer of PreferFallback() because ShouldPlay is called several
// times during the load process.
bool mPreferFallback : 1;
bool mPreferFallbackKnown : 1;
nsTArray<mozilla::dom::MozPluginParameter> mCachedAttributes;
nsTArray<mozilla::dom::MozPluginParameter> mCachedParameters;

View File

@@ -282,9 +282,6 @@ class EventStates {
#define NS_EVENT_STATE_MOZINERT NS_DEFINE_EVENT_STATE_MACRO(54)
// Topmost Modal <dialog> element in top layer
#define NS_EVENT_STATE_TOPMOST_MODAL_DIALOG NS_DEFINE_EVENT_STATE_MACRO(55)
// Handler for empty element that represents plugin instances in builds
// where plugin support is removed..
#define NS_EVENT_STATE_HANDLER_NOPLUGINS NS_DEFINE_EVENT_STATE_MACRO(56)
/**
* NOTE: do not go over 63 without updating EventStates::InternalType!
*/

View File

@@ -139,9 +139,8 @@ nsresult HTMLEmbedElement::AfterMaybeChangeAttr(int32_t aNamespaceID,
bool HTMLEmbedElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable,
int32_t* aTabIndex) {
// If we have decided that this is a blocked plugin then do not allow focus.
if ((Type() == eType_Null) &&
(PluginFallbackType() == eFallbackBlockAllPlugins)) {
// Plugins that show the empty fallback should not accept focus.
if (Type() == eType_Fallback) {
if (aTabIndex) {
*aTabIndex = -1;
}

View File

@@ -166,9 +166,8 @@ bool HTMLObjectElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable,
return false;
}
// If we have decided that this is a blocked plugin then do not allow focus.
if ((Type() == eType_Null) &&
(PluginFallbackType() == eFallbackBlockAllPlugins)) {
// Plugins that show the empty fallback should not accept focus.
if (Type() == eType_Fallback) {
if (aTabIndex) {
*aTabIndex = -1;
}

View File

@@ -41,7 +41,6 @@ class nsHTMLDocument : public mozilla::dom::Document {
using NotNull = mozilla::NotNull<T>;
public:
using Document::GetPlugins;
using Document::SetDocumentURI;
nsHTMLDocument();

View File

@@ -1768,16 +1768,6 @@ interface nsIDOMWindowUtils : nsISupports {
*/
readonly attribute boolean paintingSuppressed;
/**
* Returns an array of plugins on the page for opt-in activation.
*
* Cannot be accessed from unprivileged context (not content-accessible).
* Will throw a DOM security error if called without chrome privileges.
*
*/
[implicit_jscontext]
readonly attribute jsval plugins;
/**
* Set the viewport size for the purposes of clamping scroll positions for
* the root scroll frame of this document to be (aWidth,aHeight) in CSS pixels.

View File

@@ -88,7 +88,7 @@ interface mixin MozObjectLoadingContent {
[ChromeOnly]
const unsigned long TYPE_IMAGE = 1;
[ChromeOnly]
const unsigned long TYPE_PLUGIN = 2;
const unsigned long TYPE_FALLBACK = 2;
[ChromeOnly]
const unsigned long TYPE_FAKE_PLUGIN = 3;
[ChromeOnly]
@@ -96,38 +96,6 @@ interface mixin MozObjectLoadingContent {
[ChromeOnly]
const unsigned long TYPE_NULL = 5;
// The content type is not supported (e.g. plugin not installed)
[ChromeOnly]
const unsigned long PLUGIN_UNSUPPORTED = 0;
// Showing alternate content
[ChromeOnly]
const unsigned long PLUGIN_ALTERNATE = 1;
// The plugin exists, but is disabled
[ChromeOnly]
const unsigned long PLUGIN_DISABLED = 2;
// The plugin is blocklisted and disabled
[ChromeOnly]
const unsigned long PLUGIN_BLOCKLISTED = 3;
// The plugin is considered outdated, but not disabled
[ChromeOnly]
const unsigned long PLUGIN_OUTDATED = 4;
// The plugin has crashed
[ChromeOnly]
const unsigned long PLUGIN_CRASHED = 5;
/// ** All values >= PLUGIN_CLICK_TO_PLAY are plugin placeholder types that
/// would be replaced by a real plugin if activated (playPlugin())
/// ** Furthermore, values >= PLUGIN_CLICK_TO_PLAY and
/// <= PLUGIN_VULNERABLE_NO_UPDATE are click-to-play types.
// The plugin is disabled until the user clicks on it
[ChromeOnly]
const unsigned long PLUGIN_CLICK_TO_PLAY = 8;
// The plugin is vulnerable (update available)
[ChromeOnly]
const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
// The plugin is vulnerable (no update available)
[ChromeOnly]
const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
/**
* The actual mime type (the one we got back from the network
* request) for the element.
@@ -157,13 +125,6 @@ interface mixin MozObjectLoadingContent {
[ChromeOnly]
sequence<MozPluginParameter> getPluginParameters();
/**
* This method will play a plugin that has been stopped by the click-to-play
* feature.
*/
[ChromeOnly, Throws, NeedsCallerType]
void playPlugin();
/**
* Forces a re-evaluation and reload of the tag, optionally invalidating its
* click-to-play state. This can be used when the MIME type that provides a
@@ -173,14 +134,6 @@ interface mixin MozObjectLoadingContent {
[ChromeOnly, Throws]
void reload(boolean aClearActivation);
/**
* This attribute will return true if the current content type has been
* activated, either explicitly or by passing checks that would have it be
* click-to-play.
*/
[ChromeOnly]
readonly attribute boolean activated;
/**
* The URL of the data/src loaded in the object. This may be null (i.e.
* an <embed> with no src).
@@ -188,12 +141,6 @@ interface mixin MozObjectLoadingContent {
[ChromeOnly]
readonly attribute URI? srcURI;
[ChromeOnly]
readonly attribute unsigned long defaultFallbackType;
[ChromeOnly]
readonly attribute unsigned long pluginFallbackType;
/**
* Disable the use of fake plugins and reload the tag if necessary
*/

View File

@@ -121,15 +121,6 @@ nsresult nsXULPopupListener::HandleEvent(Event* aEvent) {
bool eventEnabled =
Preferences::GetBool("dom.event.contextmenu.enabled", true);
if (!eventEnabled) {
// If the target node is for plug-in, we should not open XUL context
// menu on windowless plug-ins.
nsCOMPtr<nsIObjectLoadingContent> olc = do_QueryInterface(targetContent);
uint32_t type;
if (olc && NS_SUCCEEDED(olc->GetDisplayedType(&type)) &&
type == nsIObjectLoadingContent::TYPE_PLUGIN) {
return NS_OK;
}
// The user wants his contextmenus. Let's make sure that this is a
// website and not chrome since there could be places in chrome which
// don't want contextmenus.

View File

@@ -3475,9 +3475,16 @@ nsCSSFrameConstructor::FindObjectData(const Element& aElement,
objContent->GetDisplayedType(&type);
}
if (type == nsIObjectLoadingContent::TYPE_FALLBACK &&
!StaticPrefs::layout_use_plugin_fallback()) {
type = nsIObjectLoadingContent::TYPE_NULL;
}
static const FrameConstructionDataByInt sObjectData[] = {
SIMPLE_INT_CREATE(nsIObjectLoadingContent::TYPE_LOADING,
NS_NewEmptyFrame),
SIMPLE_INT_CREATE(nsIObjectLoadingContent::TYPE_FALLBACK,
NS_NewBlockFrame),
SIMPLE_INT_CREATE(nsIObjectLoadingContent::TYPE_IMAGE, NS_NewImageFrame),
SIMPLE_INT_CREATE(nsIObjectLoadingContent::TYPE_DOCUMENT,
NS_NewSubDocumentFrame),

View File

@@ -7218,6 +7218,13 @@
value: false
mirror: always
# Should deprecated plugin behavior fallback to normal behavior or use
# the experimental design.
- name: layout.use-plugin-fallback
type: bool
value: false
mirror: always
#---------------------------------------------------------------------------
# Prefs starting with "mathml."
#---------------------------------------------------------------------------

View File

@@ -132,8 +132,6 @@ bitflags! {
const IN_MOZINERT_STATE = 1 << 54;
/// State for the topmost dialog element in top layer
const IN_TOPMOST_MODAL_DIALOG_STATE = 1 << 55;
/// Non-standard & undocumented.
const IN_HANDLER_NOPLUGINS = 1 << 56;
}
}