1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/dom/HTMLFrameElement.h"
8 #include "mozilla/dom/HTMLFrameElementBinding.h"
10 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Frame
)
15 HTMLFrameElement::HTMLFrameElement(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
,
16 FromParser aFromParser
)
17 : nsGenericHTMLFrameElement(std::move(aNodeInfo
), aFromParser
)
21 HTMLFrameElement::~HTMLFrameElement()
26 NS_IMPL_ELEMENT_CLONE(HTMLFrameElement
)
29 HTMLFrameElement::ParseAttribute(int32_t aNamespaceID
,
31 const nsAString
& aValue
,
32 nsIPrincipal
* aMaybeScriptedPrincipal
,
35 if (aNamespaceID
== kNameSpaceID_None
) {
36 if (aAttribute
== nsGkAtoms::bordercolor
) {
37 return aResult
.ParseColor(aValue
);
39 if (aAttribute
== nsGkAtoms::frameborder
) {
40 return ParseFrameborderValue(aValue
, aResult
);
42 if (aAttribute
== nsGkAtoms::marginwidth
) {
43 return aResult
.ParseSpecialIntValue(aValue
);
45 if (aAttribute
== nsGkAtoms::marginheight
) {
46 return aResult
.ParseSpecialIntValue(aValue
);
48 if (aAttribute
== nsGkAtoms::scrolling
) {
49 return ParseScrollingValue(aValue
, aResult
);
53 return nsGenericHTMLFrameElement::ParseAttribute(aNamespaceID
, aAttribute
,
54 aValue
, aMaybeScriptedPrincipal
, aResult
);
58 HTMLFrameElement::WrapNode(JSContext
* aCx
, JS::Handle
<JSObject
*> aGivenProto
)
60 return HTMLFrameElement_Binding::Wrap(aCx
, this, aGivenProto
);
64 } // namespace mozilla