2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2013-03-17 18:42:01 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2014-04-03 08:18:36 +04:00
|
|
|
#include "mozilla/EventStates.h"
|
2019-05-31 17:33:33 +03:00
|
|
|
#include "mozilla/dom/BindContext.h"
|
2017-07-29 07:35:43 +03:00
|
|
|
#include "mozilla/dom/HTMLEmbedElement.h"
|
2013-03-17 18:42:05 +04:00
|
|
|
#include "mozilla/dom/HTMLEmbedElementBinding.h"
|
2013-10-03 00:09:18 +04:00
|
|
|
#include "mozilla/dom/ElementInlines.h"
|
2013-03-17 18:42:01 +04:00
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
#include "mozilla/dom/Document.h"
|
2013-03-17 18:42:01 +04:00
|
|
|
#include "nsIPluginDocument.h"
|
|
|
|
#include "nsThreadUtils.h"
|
|
|
|
#include "nsIScriptError.h"
|
|
|
|
#include "nsIWidget.h"
|
|
|
|
#include "nsContentUtils.h"
|
2015-02-20 19:37:02 +03:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
# include "mozilla/EventDispatcher.h"
|
|
|
|
# include "mozilla/dom/Event.h"
|
2016-04-29 00:48:14 +03:00
|
|
|
#endif
|
2016-04-29 00:57:34 +03:00
|
|
|
#include "mozilla/dom/HTMLObjectElement.h"
|
2013-03-17 18:42:01 +04:00
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Embed)
|
2013-03-17 18:42:01 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-09-21 23:45:49 +03:00
|
|
|
HTMLEmbedElement::HTMLEmbedElement(
|
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
2017-07-29 07:35:43 +03:00
|
|
|
FromParser aFromParser)
|
2018-09-21 23:45:49 +03:00
|
|
|
: nsGenericHTMLElement(std::move(aNodeInfo)) {
|
2014-06-19 06:09:35 +04:00
|
|
|
RegisterActivityObserver();
|
2013-03-17 18:42:01 +04:00
|
|
|
SetIsNetworkCreated(aFromParser == FROM_PARSER_NETWORK);
|
|
|
|
|
|
|
|
// By default we're in the loading state
|
|
|
|
AddStatesSilently(NS_EVENT_STATE_LOADING);
|
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
HTMLEmbedElement::~HTMLEmbedElement() {
|
2015-03-25 01:02:52 +03:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
HTMLObjectElement::OnFocusBlurPlugin(this, false);
|
|
|
|
#endif
|
2014-06-19 06:09:35 +04:00
|
|
|
UnregisterActivityObserver();
|
2013-03-17 18:42:01 +04:00
|
|
|
DestroyImageLoadingContent();
|
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLEmbedElement)
|
2013-03-17 18:42:01 +04:00
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLEmbedElement,
|
2013-03-17 18:42:01 +04:00
|
|
|
nsGenericHTMLElement)
|
2017-07-29 07:35:43 +03:00
|
|
|
nsObjectLoadingContent::Traverse(tmp, cb);
|
2013-03-17 18:42:01 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
|
2017-08-16 23:14:11 +03:00
|
|
|
NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(
|
|
|
|
HTMLEmbedElement, nsGenericHTMLElement, nsIRequestObserver,
|
2019-02-16 01:20:53 +03:00
|
|
|
nsIStreamListener, nsFrameLoaderOwner, nsIObjectLoadingContent,
|
2017-08-16 23:14:11 +03:00
|
|
|
imgINotificationObserver, nsIImageLoadingContent, nsIChannelEventSink)
|
2013-03-17 18:42:01 +04:00
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
NS_IMPL_ELEMENT_CLONE(HTMLEmbedElement)
|
2013-03-17 18:42:01 +04:00
|
|
|
|
2015-02-20 19:37:02 +03:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2017-07-29 07:35:43 +03:00
|
|
|
HTMLEmbedElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
2015-02-20 19:37:02 +03:00
|
|
|
HTMLObjectElement::HandleFocusBlurPlugin(this, aVisitor.mEvent);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // #ifdef XP_MACOSX
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
void HTMLEmbedElement::AsyncEventRunning(AsyncEventDispatcher* aEvent) {
|
2016-10-06 07:30:35 +03:00
|
|
|
nsImageLoadingContent::AsyncEventRunning(aEvent);
|
|
|
|
}
|
|
|
|
|
Bug 1555216 - Change the signature of BindToTree to be (BindContext&, nsINode& aParentNode). r=bzbarsky
BindContext was going to have way more information at first, but then I realized
that most of the things I wanted to know were basically a flag away using the
parent node.
Still I think it's worth it, now experimenting with BindToTree will only mean
adding a field to a struct that's included from a couple cpp files, instead of a
massive pain.
I also think this is clearer, and doing this highlights quite a few
inconsistencies in our code which I've left untouched, but commented with
FIXMEs.
Steps are:
$ for file in $(rg 'nsresult BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsresult BindToTree(Document\* aDocument, nsIContent\* aParent,#nsresult BindToTree(BindContext\&, nsINode\& aParent)#g' $file; done
$ for file in $(rg 'nsresult BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's# nsIContent\* aBindingParent) override#override#g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(Document\* aDocument, nsIContent\* aParent,#::BindToTree(BindContext\& aContext, nsINode\& aParent)#g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsIContent\* aBindingParent)##g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(aDocument, aParent, aBindingParent)#::BindToTree(aContext, aParent)#g' $file; done
$ ./mach clang-format
Then manual fixups.
Depends on D32948
Differential Revision: https://phabricator.services.mozilla.com/D32949
2019-05-29 07:27:04 +03:00
|
|
|
nsresult HTMLEmbedElement::BindToTree(BindContext& aContext, nsINode& aParent) {
|
|
|
|
nsresult rv = nsGenericHTMLElement::BindToTree(aContext, aParent);
|
2013-03-17 18:42:01 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
Bug 1555216 - Change the signature of BindToTree to be (BindContext&, nsINode& aParentNode). r=bzbarsky
BindContext was going to have way more information at first, but then I realized
that most of the things I wanted to know were basically a flag away using the
parent node.
Still I think it's worth it, now experimenting with BindToTree will only mean
adding a field to a struct that's included from a couple cpp files, instead of a
massive pain.
I also think this is clearer, and doing this highlights quite a few
inconsistencies in our code which I've left untouched, but commented with
FIXMEs.
Steps are:
$ for file in $(rg 'nsresult BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsresult BindToTree(Document\* aDocument, nsIContent\* aParent,#nsresult BindToTree(BindContext\&, nsINode\& aParent)#g' $file; done
$ for file in $(rg 'nsresult BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's# nsIContent\* aBindingParent) override#override#g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(Document\* aDocument, nsIContent\* aParent,#::BindToTree(BindContext\& aContext, nsINode\& aParent)#g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#nsIContent\* aBindingParent)##g' $file; done
$ for file in $(rg '::BindToTree\(' | cut -d : -f 1 | sort | uniq); do sed -i 's#::BindToTree(aDocument, aParent, aBindingParent)#::BindToTree(aContext, aParent)#g' $file; done
$ ./mach clang-format
Then manual fixups.
Depends on D32948
Differential Revision: https://phabricator.services.mozilla.com/D32949
2019-05-29 07:27:04 +03:00
|
|
|
rv = nsObjectLoadingContent::BindToTree(aContext, aParent);
|
2013-03-17 18:42:01 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2019-05-31 17:33:33 +03:00
|
|
|
if (IsInComposedDoc()) {
|
|
|
|
// Don't kick off load from being bound to a plugin document - the plugin
|
2019-06-08 11:26:37 +03:00
|
|
|
// document will call nsObjectLoadingContent::InitializeFromChannel() for
|
|
|
|
// the initial load.
|
2019-05-31 17:33:33 +03:00
|
|
|
nsCOMPtr<nsIPluginDocument> pluginDoc =
|
|
|
|
do_QueryInterface(&aContext.OwnerDoc());
|
|
|
|
if (!pluginDoc) {
|
|
|
|
void (HTMLEmbedElement::*start)() = &HTMLEmbedElement::StartObjectLoad;
|
|
|
|
nsContentUtils::AddScriptRunner(
|
|
|
|
NewRunnableMethod("dom::HTMLEmbedElement::BindToTree", this, start));
|
|
|
|
}
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2019-05-29 01:47:08 +03:00
|
|
|
void HTMLEmbedElement::UnbindFromTree(bool aNullParent) {
|
2015-03-25 01:02:52 +03:00
|
|
|
#ifdef XP_MACOSX
|
2019-01-02 16:05:23 +03:00
|
|
|
// When a page is reloaded (when an Document's content is removed), the
|
2015-09-02 09:08:00 +03:00
|
|
|
// focused element isn't necessarily sent an eBlur event. See
|
2015-03-25 01:02:52 +03:00
|
|
|
// nsFocusManager::ContentRemoved(). This means that a widget may think it
|
|
|
|
// still contains a focused plugin when it doesn't -- which in turn can
|
|
|
|
// disable text input in the browser window. See bug 1137229.
|
|
|
|
HTMLObjectElement::OnFocusBlurPlugin(this, false);
|
|
|
|
#endif
|
2019-05-29 01:47:08 +03:00
|
|
|
nsObjectLoadingContent::UnbindFromTree(aNullParent);
|
|
|
|
nsGenericHTMLElement::UnbindFromTree(aNullParent);
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
nsresult HTMLEmbedElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
|
2017-07-29 07:35:43 +03:00
|
|
|
const nsAttrValue* aValue,
|
|
|
|
const nsAttrValue* aOldValue,
|
2017-10-10 00:33:38 +03:00
|
|
|
nsIPrincipal* aSubjectPrincipal,
|
2017-07-29 07:35:43 +03:00
|
|
|
bool aNotify) {
|
2017-06-07 20:28:20 +03:00
|
|
|
if (aValue) {
|
|
|
|
nsresult rv = AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
|
|
|
|
|
|
|
return nsGenericHTMLElement::AfterSetAttr(
|
2017-10-10 00:33:38 +03:00
|
|
|
aNamespaceID, aName, aValue, aOldValue, aSubjectPrincipal, aNotify);
|
2017-06-07 20:28:20 +03:00
|
|
|
}
|
2013-03-17 18:42:01 +04:00
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
nsresult HTMLEmbedElement::OnAttrSetButNotChanged(
|
|
|
|
int32_t aNamespaceID, nsAtom* aName, const nsAttrValueOrString& aValue,
|
|
|
|
bool aNotify) {
|
2017-06-07 20:28:20 +03:00
|
|
|
nsresult rv = AfterMaybeChangeAttr(aNamespaceID, aName, aNotify);
|
2013-03-17 18:42:01 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2017-06-07 20:28:20 +03:00
|
|
|
return nsGenericHTMLElement::OnAttrSetButNotChanged(aNamespaceID, aName,
|
|
|
|
aValue, aNotify);
|
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
nsresult HTMLEmbedElement::AfterMaybeChangeAttr(int32_t aNamespaceID,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* aName, bool aNotify) {
|
2017-06-07 20:28:20 +03:00
|
|
|
if (aNamespaceID == kNameSpaceID_None) {
|
2017-07-11 02:00:30 +03:00
|
|
|
if (aName == nsGkAtoms::src) {
|
2017-06-07 20:28:20 +03:00
|
|
|
// If aNotify is false, we are coming from the parser or some such place;
|
|
|
|
// we'll get bound after all the attributes have been set, so we'll do the
|
2017-07-29 07:35:43 +03:00
|
|
|
// object load from BindToTree.
|
2017-06-07 20:28:20 +03:00
|
|
|
// Skip the LoadObject call in that case.
|
|
|
|
// We also don't want to start loading the object when we're not yet in
|
|
|
|
// a document, just in case that the caller wants to set additional
|
|
|
|
// attributes before inserting the node into the document.
|
|
|
|
if (aNotify && IsInComposedDoc() && !BlockEmbedOrObjectContentLoading()) {
|
|
|
|
nsresult rv = LoadObject(aNotify, true);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
|
|
|
}
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
bool HTMLEmbedElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable,
|
|
|
|
int32_t* aTabIndex) {
|
|
|
|
// Has plugin content: let the plugin decide what to do in terms of
|
|
|
|
// internal focus from mouse clicks
|
|
|
|
if (aTabIndex) {
|
|
|
|
*aTabIndex = TabIndex();
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
*aIsFocusable = true;
|
|
|
|
|
|
|
|
// Let the plugin decide, so override.
|
|
|
|
return true;
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
nsIContent::IMEState HTMLEmbedElement::GetDesiredIMEState() {
|
2013-03-17 18:42:01 +04:00
|
|
|
if (Type() == eType_Plugin) {
|
|
|
|
return IMEState(IMEState::PLUGIN);
|
|
|
|
}
|
2017-07-06 15:00:35 +03:00
|
|
|
|
2013-03-17 18:42:01 +04:00
|
|
|
return nsGenericHTMLElement::GetDesiredIMEState();
|
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
int32_t HTMLEmbedElement::TabIndexDefault() { return -1; }
|
2013-03-17 18:42:01 +04:00
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
bool HTMLEmbedElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
|
|
|
const nsAString& aValue,
|
2017-11-02 06:35:52 +03:00
|
|
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
2017-07-29 07:35:43 +03:00
|
|
|
nsAttrValue& aResult) {
|
2013-03-17 18:42:01 +04:00
|
|
|
if (aNamespaceID == kNameSpaceID_None) {
|
|
|
|
if (aAttribute == nsGkAtoms::align) {
|
|
|
|
return ParseAlignValue(aValue, aResult);
|
|
|
|
}
|
Bug 1562257 part 5. Fix style mapping of border attribues to more closely match the spec. r=mccr8
Per spec, "border" is parsed as a non-negative integer, only mapped if nonzero
(though this is not observably different from mapping even if 0, except if user
or UA stylesheets style the border), and supported on img, object,
<input type="image">, but NOT embed, iframe, or marquee.
This matches the Chrome and Safari behavior, as far as I can tell. The
substantive change here is that we are removing mapping for the <embed border>
case.
Differential Revision: https://phabricator.services.mozilla.com/D36376
--HG--
extra : moz-landing-system : lando
2019-06-29 02:55:38 +03:00
|
|
|
if (aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height ||
|
|
|
|
aAttribute == nsGkAtoms::hspace || aAttribute == nsGkAtoms::vspace) {
|
|
|
|
return aResult.ParseHTMLDimension(aValue);
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
2017-11-02 06:35:52 +03:00
|
|
|
aMaybeScriptedPrincipal, aResult);
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
2013-07-11 18:39:18 +04:00
|
|
|
static void MapAttributesIntoRuleBase(const nsMappedAttributes* aAttributes,
|
2018-06-22 19:48:42 +03:00
|
|
|
MappedDeclarations& aDecls) {
|
|
|
|
nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aDecls);
|
|
|
|
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aDecls);
|
|
|
|
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aDecls);
|
2013-07-11 18:39:18 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void MapAttributesIntoRuleExceptHidden(
|
|
|
|
const nsMappedAttributes* aAttributes, MappedDeclarations& aDecls) {
|
2018-06-22 19:48:42 +03:00
|
|
|
MapAttributesIntoRuleBase(aAttributes, aDecls);
|
|
|
|
nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(aAttributes,
|
|
|
|
aDecls);
|
2013-07-11 18:39:18 +04:00
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
void HTMLEmbedElement::MapAttributesIntoRule(
|
|
|
|
const nsMappedAttributes* aAttributes, MappedDeclarations& aDecls) {
|
2018-06-22 19:48:42 +03:00
|
|
|
MapAttributesIntoRuleBase(aAttributes, aDecls);
|
|
|
|
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(bool)
|
2017-10-03 01:05:19 +03:00
|
|
|
HTMLEmbedElement::IsAttributeMapped(const nsAtom* aAttribute) const {
|
2013-03-17 18:42:01 +04:00
|
|
|
static const MappedAttributeEntry* const map[] = {
|
|
|
|
sCommonAttributeMap,
|
|
|
|
sImageMarginSizeAttributeMap,
|
|
|
|
sImageBorderAttributeMap,
|
|
|
|
sImageAlignAttributeMap,
|
|
|
|
};
|
|
|
|
|
|
|
|
return FindAttributeDependence(aAttribute, map);
|
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
nsMapRuleToAttributesFunc HTMLEmbedElement::GetAttributeMappingFunction()
|
|
|
|
const {
|
|
|
|
return &MapAttributesIntoRuleExceptHidden;
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
void HTMLEmbedElement::StartObjectLoad(bool aNotify, bool aForceLoad) {
|
2013-03-17 18:42:01 +04:00
|
|
|
// BindToTree can call us asynchronously, and we may be removed from the tree
|
|
|
|
// in the interim
|
2016-04-11 20:58:08 +03:00
|
|
|
if (!IsInComposedDoc() || !OwnerDoc()->IsActive() ||
|
2017-02-09 02:19:01 +03:00
|
|
|
BlockEmbedOrObjectContentLoading()) {
|
2013-03-17 18:42:01 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-04-29 00:57:34 +03:00
|
|
|
LoadObject(aNotify, aForceLoad);
|
2013-03-17 18:42:01 +04:00
|
|
|
SetIsNetworkCreated(false);
|
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
EventStates HTMLEmbedElement::IntrinsicState() const {
|
2013-03-17 18:42:01 +04:00
|
|
|
return nsGenericHTMLElement::IntrinsicState() | ObjectState();
|
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
uint32_t HTMLEmbedElement::GetCapabilities() const {
|
|
|
|
return eSupportPlugins | eAllowPluginSkipChannel | eSupportImages |
|
|
|
|
eSupportDocuments;
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
void HTMLEmbedElement::DestroyContent() {
|
2013-03-17 18:42:01 +04:00
|
|
|
nsObjectLoadingContent::DestroyContent();
|
|
|
|
nsGenericHTMLElement::DestroyContent();
|
|
|
|
}
|
|
|
|
|
2018-08-09 02:58:44 +03:00
|
|
|
nsresult HTMLEmbedElement::CopyInnerTo(HTMLEmbedElement* aDest) {
|
|
|
|
nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
|
2013-03-17 18:42:01 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
2018-08-09 02:58:44 +03:00
|
|
|
CreateStaticClone(aDest);
|
2013-03-17 18:42:01 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
JSObject* HTMLEmbedElement::WrapNode(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) {
|
2013-03-17 18:42:05 +04:00
|
|
|
JSObject* obj;
|
2018-06-26 00:20:54 +03:00
|
|
|
obj = HTMLEmbedElement_Binding::Wrap(aCx, this, aGivenProto);
|
2017-07-11 02:00:30 +03:00
|
|
|
|
2013-03-17 18:42:05 +04:00
|
|
|
if (!obj) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2013-05-02 13:12:45 +04:00
|
|
|
JS::Rooted<JSObject*> rootedObj(aCx, obj);
|
|
|
|
SetupProtoChain(aCx, rootedObj);
|
|
|
|
return rootedObj;
|
2013-03-17 18:42:05 +04:00
|
|
|
}
|
|
|
|
|
2017-07-29 07:35:43 +03:00
|
|
|
nsContentPolicyType HTMLEmbedElement::GetContentPolicyType() const {
|
2017-07-29 02:44:39 +03:00
|
|
|
return nsIContentPolicy::TYPE_INTERNAL_EMBED;
|
2015-07-18 18:51:00 +03:00
|
|
|
}
|
|
|
|
|
2013-03-17 18:42:01 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|