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"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
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;
|
|
|
|
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit HTMLFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
|
|
|
|
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
|
|
|
|
virtual bool ParseAttribute(int32_t aNamespaceID,
|
2017-10-03 01:05:19 +03:00
|
|
|
nsAtom* aAttribute,
|
2013-02-18 15:29:33 +04:00
|
|
|
const nsAString& aValue,
|
2017-11-02 06:35:52 +03:00
|
|
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsAttrValue& aResult) override;
|
2017-04-20 22:57:48 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
|
|
|
bool aPreallocateChildren) 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-12-06 00:03:18 +03:00
|
|
|
void GetSrc(nsString& aSrc)
|
2017-09-29 05:06:14 +03:00
|
|
|
{
|
|
|
|
GetURIAttr(nsGkAtoms::src, nullptr, aSrc);
|
|
|
|
}
|
2017-12-21 01:43:18 +03:00
|
|
|
void SetSrc(const nsAString& aSrc, nsIPrincipal* aTriggeringPrincipal, ErrorResult& aError)
|
2013-02-18 15:29:43 +04:00
|
|
|
{
|
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();
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-11-19 23:21:29 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
2017-01-27 00:39:13 +03:00
|
|
|
GenericSpecifiedValues* aGenericData);
|
2013-02-18 15:29:33 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_HTMLFrameElement_h
|