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-02-18 15:29:33 +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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_HTMLFrameElement_h
|
|
|
|
#define mozilla_dom_HTMLFrameElement_h
|
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-02-18 15:29:33 +04:00
|
|
|
#include "nsGenericHTMLFrameElement.h"
|
|
|
|
#include "nsGkAtoms.h"
|
|
|
|
|
2022-05-09 23:41:07 +03:00
|
|
|
namespace mozilla::dom {
|
2013-02-18 15:29:33 +04:00
|
|
|
|
2017-09-29 05:06:14 +03:00
|
|
|
class HTMLFrameElement final : public nsGenericHTMLFrameElement {
|
2013-02-18 15:29:33 +04:00
|
|
|
public:
|
2013-02-26 21:02:32 +04:00
|
|
|
using nsGenericHTMLFrameElement::SwapFrameLoaders;
|
|
|
|
|
2018-09-21 23:45:49 +03:00
|
|
|
explicit HTMLFrameElement(
|
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
2014-09-02 04:49:25 +04:00
|
|
|
FromParser aFromParser = NOT_FROM_PARSER);
|
2013-02-18 15:29:33 +04:00
|
|
|
|
|
|
|
// nsISupports
|
2018-02-12 23:44:40 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLFrameElement,
|
|
|
|
nsGenericHTMLFrameElement)
|
2013-02-18 15:29:33 +04:00
|
|
|
|
2018-03-22 00:39:04 +03:00
|
|
|
NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLFrameElement, frame)
|
2013-02-18 15:29:33 +04:00
|
|
|
|
|
|
|
// nsIContent
|
2023-06-22 20:22:03 +03:00
|
|
|
bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
|
|
|
const nsAString& aValue,
|
|
|
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
|
|
|
nsAttrValue& aResult) override;
|
|
|
|
nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
2013-02-18 15:29:43 +04:00
|
|
|
|
|
|
|
// WebIDL API
|
2017-09-29 05:06:14 +03:00
|
|
|
void GetFrameBorder(DOMString& aFrameBorder) const {
|
|
|
|
GetHTMLAttr(nsGkAtoms::frameborder, aFrameBorder);
|
|
|
|
}
|
2013-02-18 15:29:43 +04:00
|
|
|
void SetFrameBorder(const nsAString& aFrameBorder, ErrorResult& aError) {
|
|
|
|
SetHTMLAttr(nsGkAtoms::frameborder, aFrameBorder, aError);
|
|
|
|
}
|
|
|
|
|
2017-09-29 05:06:14 +03:00
|
|
|
void GetLongDesc(nsAString& aLongDesc) const {
|
|
|
|
GetURIAttr(nsGkAtoms::longdesc, nullptr, aLongDesc);
|
|
|
|
}
|
2013-02-18 15:29:43 +04:00
|
|
|
void SetLongDesc(const nsAString& aLongDesc, ErrorResult& aError) {
|
2018-02-24 22:20:23 +03:00
|
|
|
SetHTMLAttr(nsGkAtoms::longdesc, aLongDesc);
|
2013-02-18 15:29:43 +04:00
|
|
|
}
|
|
|
|
|
2017-09-29 05:06:14 +03:00
|
|
|
void GetMarginHeight(DOMString& aMarginHeight) const {
|
|
|
|
GetHTMLAttr(nsGkAtoms::marginheight, aMarginHeight);
|
|
|
|
}
|
2013-02-18 15:29:43 +04:00
|
|
|
void SetMarginHeight(const nsAString& aMarginHeight, ErrorResult& aError) {
|
|
|
|
SetHTMLAttr(nsGkAtoms::marginheight, aMarginHeight, aError);
|
|
|
|
}
|
|
|
|
|
2017-09-29 05:06:14 +03:00
|
|
|
void GetMarginWidth(DOMString& aMarginWidth) const {
|
|
|
|
GetHTMLAttr(nsGkAtoms::marginwidth, aMarginWidth);
|
|
|
|
}
|
2013-02-18 15:29:43 +04:00
|
|
|
void SetMarginWidth(const nsAString& aMarginWidth, ErrorResult& aError) {
|
|
|
|
SetHTMLAttr(nsGkAtoms::marginwidth, aMarginWidth, aError);
|
|
|
|
}
|
|
|
|
|
2017-09-29 05:06:14 +03:00
|
|
|
void GetName(DOMString& aName) const { GetHTMLAttr(nsGkAtoms::name, aName); }
|
2013-02-18 15:29:43 +04:00
|
|
|
void SetName(const nsAString& aName, ErrorResult& aError) {
|
|
|
|
SetHTMLAttr(nsGkAtoms::name, aName, aError);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool NoResize() const { return GetBoolAttr(nsGkAtoms::noresize); }
|
|
|
|
void SetNoResize(bool& aNoResize, ErrorResult& aError) {
|
|
|
|
SetHTMLBoolAttr(nsGkAtoms::noresize, aNoResize, aError);
|
|
|
|
}
|
|
|
|
|
2017-09-29 05:06:14 +03:00
|
|
|
void GetScrolling(DOMString& aScrolling) const {
|
|
|
|
GetHTMLAttr(nsGkAtoms::scrolling, aScrolling);
|
|
|
|
}
|
2013-02-18 15:29:43 +04:00
|
|
|
void SetScrolling(const nsAString& aScrolling, ErrorResult& aError) {
|
|
|
|
SetHTMLAttr(nsGkAtoms::scrolling, aScrolling, aError);
|
|
|
|
}
|
|
|
|
|
2017-09-29 05:06:14 +03:00
|
|
|
void GetSrc(nsString& aSrc) { GetURIAttr(nsGkAtoms::src, nullptr, aSrc); }
|
2017-12-21 01:43:18 +03:00
|
|
|
void SetSrc(const nsAString& aSrc, nsIPrincipal* aTriggeringPrincipal,
|
|
|
|
ErrorResult& aError) {
|
2017-10-05 08:59:44 +03:00
|
|
|
SetHTMLAttr(nsGkAtoms::src, aSrc, aTriggeringPrincipal, aError);
|
2013-02-18 15:29:43 +04:00
|
|
|
}
|
|
|
|
|
2013-03-01 00:28:32 +04:00
|
|
|
using nsGenericHTMLFrameElement::GetContentDocument;
|
|
|
|
using nsGenericHTMLFrameElement::GetContentWindow;
|
2013-02-18 15:29:43 +04:00
|
|
|
|
|
|
|
protected:
|
2014-07-09 01:23:16 +04:00
|
|
|
virtual ~HTMLFrameElement();
|
|
|
|
|
2023-06-22 20:22:03 +03:00
|
|
|
JSObject* WrapNode(JSContext*, JS::Handle<JSObject*> aGivenProto) override;
|
2013-02-18 15:29:33 +04:00
|
|
|
};
|
|
|
|
|
2022-05-09 23:41:07 +03:00
|
|
|
} // namespace mozilla::dom
|
2013-02-18 15:29:33 +04:00
|
|
|
|
|
|
|
#endif // mozilla_dom_HTMLFrameElement_h
|