Files
palemoon27/dom/html/HTMLIFrameElement.h
T
roytam1 2ddfe368e1 import changes from `dev' branch of rmottola/Arctic-Fox:
- bug 1215748 - use llvm-dsymutil for mac builds. r=mshal (a217006d89)
- warnings (31ea43d0d8)
- Bug 1175154 - Unit tests for IAC on 3.0. r=ferjm (12c424bab3)
- Bug 1219543 - Part 1: isRunningOnCompositor flag is now a member of AnimationProperty. r=bbirtles (85bc668501)
- Bug 1219543 - Part 2: Avoid the period that mIsRunningOnCompositor is false between restyling and building display list. r=bbirtles (597e46d479)
- Bug 1219543 - Part 3: MutationObserver should disconnect when the test is finished. r=bbirtles (70c26a266e)
- Bug 1214148 - patch 1 - propagation from the nested iframe back to the toplevel iframe, r=alwu (b42002f43a)
- Bug 1214148 - patch 2 - from toplevel iframe to the nested iframe, r=alwu (7b07fe5399)
- Bug 1214148 - patch 3 - correct window for nested iframes, r=alwu (27ee08caf1)
- Bug 1166910 - put referrer attribute behind pref in webidl, r=bz (93e421fa1b)
- Bug 1187357 - rename referrer attribute to referrerpolicy. r=hsivonen (70c67f5def)
- Bug 1187357 - Generated code for renaming referrer to referrerpolicy in html parser. r=hsivonen (738de3f278)
- Bug 1221341. Snap box shadow clip rect to device pixels. r=mstange (b63b783714)
- Bug 1228634 - Implement Element.getAttributeNames, r=peterv (4594d9c14c)
- Bug 1216193. Implement webkitMatchesSelector. r=khuey (39742b7e0b)
- Bug 1134648, handle dynamic changes to rel=dns-prefetch, r=bz (e27638080e)
- Bug 1229962 - use UniquePtr<T[]> instead of nsAutoArrayPtr<T> in parser/html/; r=hsivonen (75de6314f1)
- Bug 1226437 - Speculative CSP should set speculative referrer policy instead of actual referrer policy. r=sicking (f7dfd3fd18)
- Bug 1227554 - Default to NullPrincipal if doc is not available within expatdriver. r=bz (336a562965)
- Bug 1215781 - Use MOZ_UTF16 to generate sTagUnicodeTable. r=mrbkap (eca371a36b)
- Bug 1082598 - Part 5: Fix NPAPI for Skia update. r=jrmuizel (25c4d080ab)
- Bug 1183828 - Remove 'nsWindow::GetNativeData not implemented for this type' warning. r=roc (0a60404b57)
- Bug 1224445 - Add NS_NATIVE_OPENGL_CONTEXT handling to nsWindow::GetNativeData() r=mwu (ee35844be4)
- Bug 1179632 part.1 native IME context should not be stored in InputContext but should be able to retrieve with nsIWidget::GetNativeData() r=smaug (5f1804bb72)
- Bug 1179632 part.2 WidgetCompositionEvent should store NativeIMEContext which caused the event and PuppetWidget should store it for GetNativeIMEContext() r=smaug, sr=smaug (e00ca78e3f)
- Bug 1179632 part.3 TabParent::RecvEndIMEComposition() shouldn't return true with aNoCompositionEvent when there is no widget r=smaug (ee065ed491)
- Bug 1179632 part.4 Clean up the code to request IME to commit composition across process boundary r=smaug (9567c4dc57)
- Bug 1179632 part.5 WidgetCompositionEvent::mNativeIMEContext should be used at looking for a TextComposition instance for a WidgetCompositionEvent r=smaug (f4e27ec28c)
- Bug 1179632 part.6 KeyboardEvent.isComposing shouldn't expose IME state on different document r=smaug (ca8b8a6a02)
- Bug 1227544 - Scaling on 720p devices is broken. r=timdream (cb89af839f)
2023-06-13 15:52:32 +08:00

211 lines
6.6 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#ifndef mozilla_dom_HTMLIFrameElement_h
#define mozilla_dom_HTMLIFrameElement_h
#include "mozilla/Attributes.h"
#include "nsGenericHTMLFrameElement.h"
#include "nsIDOMHTMLIFrameElement.h"
#include "nsDOMSettableTokenList.h"
namespace mozilla {
namespace dom {
class HTMLIFrameElement final : public nsGenericHTMLFrameElement
, public nsIDOMHTMLIFrameElement
{
public:
explicit HTMLIFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLIFrameElement, iframe)
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// Element
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const override
{
return true;
}
// nsIDOMHTMLIFrameElement
NS_DECL_NSIDOMHTMLIFRAMEELEMENT
// nsIContent
virtual bool ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult) override;
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
const nsAString& aValue, bool aNotify)
{
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
}
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
nsIAtom* aPrefix, const nsAString& aValue,
bool aNotify) override;
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
const nsAttrValue* aValue,
bool aNotify) override;
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
bool aNotify) override;
uint32_t GetSandboxFlags();
// Web IDL binding methods
// The XPCOM GetSrc is fine for our purposes
void SetSrc(const nsAString& aSrc, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::src, aSrc, aError);
}
void GetSrcdoc(DOMString& aSrcdoc)
{
GetHTMLAttr(nsGkAtoms::srcdoc, aSrcdoc);
}
void SetSrcdoc(const nsAString& aSrcdoc, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::srcdoc, aSrcdoc, aError);
}
void GetName(DOMString& aName)
{
GetHTMLAttr(nsGkAtoms::name, aName);
}
void SetName(const nsAString& aName, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::name, aName, aError);
}
nsDOMSettableTokenList* Sandbox()
{
return GetTokenList(nsGkAtoms::sandbox);
}
bool AllowFullscreen() const
{
return GetBoolAttr(nsGkAtoms::allowfullscreen);
}
void SetAllowFullscreen(bool aAllow, ErrorResult& aError)
{
SetHTMLBoolAttr(nsGkAtoms::allowfullscreen, aAllow, aError);
}
void GetWidth(DOMString& aWidth)
{
GetHTMLAttr(nsGkAtoms::width, aWidth);
}
void SetWidth(const nsAString& aWidth, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::width, aWidth, aError);
}
void GetHeight(DOMString& aHeight)
{
GetHTMLAttr(nsGkAtoms::height, aHeight);
}
void SetHeight(const nsAString& aHeight, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::height, aHeight, aError);
}
using nsGenericHTMLFrameElement::GetContentDocument;
using nsGenericHTMLFrameElement::GetContentWindow;
void GetAlign(DOMString& aAlign)
{
GetHTMLAttr(nsGkAtoms::align, aAlign);
}
void SetAlign(const nsAString& aAlign, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
}
void GetScrolling(DOMString& aScrolling)
{
GetHTMLAttr(nsGkAtoms::scrolling, aScrolling);
}
void SetScrolling(const nsAString& aScrolling, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::scrolling, aScrolling, aError);
}
void GetFrameBorder(DOMString& aFrameBorder)
{
GetHTMLAttr(nsGkAtoms::frameborder, aFrameBorder);
}
void SetFrameBorder(const nsAString& aFrameBorder, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::frameborder, aFrameBorder, aError);
}
// The XPCOM GetLongDesc is fine
void SetLongDesc(const nsAString& aLongDesc, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::longdesc, aLongDesc, aError);
}
void GetMarginWidth(DOMString& aMarginWidth)
{
GetHTMLAttr(nsGkAtoms::marginwidth, aMarginWidth);
}
void SetMarginWidth(const nsAString& aMarginWidth, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::marginwidth, aMarginWidth, aError);
}
void GetMarginHeight(DOMString& aMarginHeight)
{
GetHTMLAttr(nsGkAtoms::marginheight, aMarginHeight);
}
void SetMarginHeight(const nsAString& aMarginHeight, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::marginheight, aMarginHeight, aError);
}
void SetReferrerPolicy(const nsAString& aReferrer, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer, aError);
}
void GetReferrerPolicy(nsAString& aReferrer)
{
GetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer);
}
nsIDocument* GetSVGDocument()
{
return GetContentDocument();
}
bool Mozbrowser() const
{
return GetBoolAttr(nsGkAtoms::mozbrowser);
}
void SetMozbrowser(bool aAllow, ErrorResult& aError)
{
SetHTMLBoolAttr(nsGkAtoms::mozbrowser, aAllow, aError);
}
using nsGenericHTMLFrameElement::SetMozbrowser;
// nsGenericHTMLFrameElement::GetFrameLoader is fine
// nsGenericHTMLFrameElement::GetAppManifestURL is fine
// The fullscreen flag is set to true only when requestFullscreen is
// explicitly called on this <iframe> element. In case this flag is
// set, the fullscreen state of this element will not be reverted
// automatically when its subdocument exits fullscreen.
bool FullscreenFlag() const { return mFullscreenFlag; }
void SetFullscreenFlag(bool aValue) { mFullscreenFlag = aValue; }
protected:
virtual ~HTMLIFrameElement();
virtual void GetItemValueText(DOMString& text) override;
virtual void SetItemValueText(const nsAString& text) override;
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
private:
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData);
};
} // namespace dom
} // namespace mozilla
#endif