mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 839022 - Convert HTMLSourceElement to WebIDL. r=Ms2ger
This commit is contained in:
parent
af40b2d946
commit
06e54c8580
@ -5,6 +5,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/dom/HTMLSourceElement.h"
|
||||
#include "mozilla/dom/HTMLSourceElementBinding.h"
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Source)
|
||||
DOMCI_NODE_DATA(HTMLSourceElement, mozilla::dom::HTMLSourceElement)
|
||||
@ -15,6 +16,7 @@ namespace dom {
|
||||
HTMLSourceElement::HTMLSourceElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
HTMLSourceElement::~HTMLSourceElement()
|
||||
@ -75,5 +77,12 @@ HTMLSourceElement::BindToTree(nsIDocument *aDocument,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
HTMLSourceElement::WrapNode(JSContext* aCx, JSObject* aScope,
|
||||
bool* aTriedToWrap)
|
||||
{
|
||||
return HTMLSourceElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -36,18 +36,50 @@ public:
|
||||
// nsIDOMHTMLSourceElement
|
||||
NS_DECL_NSIDOMHTMLSOURCEELEMENT
|
||||
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
virtual nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
|
||||
|
||||
// Override BindToTree() so that we can trigger a load when we add a
|
||||
// child source element.
|
||||
virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
|
||||
nsIContent *aBindingParent,
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
bool aCompileEventHandlers);
|
||||
|
||||
virtual nsXPCClassInfo* GetClassInfo();
|
||||
|
||||
virtual nsIDOMNode* AsDOMNode() { return this; }
|
||||
|
||||
// WebIDL
|
||||
void GetSrc(nsString& aSrc)
|
||||
{
|
||||
GetURIAttr(nsGkAtoms::src, nullptr, aSrc);
|
||||
}
|
||||
void SetSrc(const nsAString& aSrc, mozilla::ErrorResult& rv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::src, aSrc, rv);
|
||||
}
|
||||
|
||||
void GetType(nsString& aType)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::type, aType);
|
||||
}
|
||||
void SetType(const nsAString& aType, ErrorResult& rv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::type, aType, rv);
|
||||
}
|
||||
|
||||
void GetMedia(nsString& aMedia)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::media, aMedia);
|
||||
}
|
||||
void SetMedia(const nsAString& aMedia, mozilla::ErrorResult& rv)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::media, aMedia, rv);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual JSObject* WrapNode(JSContext* aCx, JSObject* aScope,
|
||||
bool* aTriedToWrap) MOZ_OVERRIDE;
|
||||
|
||||
protected:
|
||||
virtual void GetItemValueText(nsAString& text);
|
||||
virtual void SetItemValueText(const nsAString& text);
|
||||
|
@ -60,7 +60,6 @@ function reflectString(aParameters)
|
||||
form: [ "acceptCharset", "name", "target" ],
|
||||
input: [ "accept", "alt", "formTarget", "max", "min", "name", "pattern", "placeholder", "step", "defaultValue" ],
|
||||
link: [ "crossOrigin" ],
|
||||
source: [ "media" ],
|
||||
textarea: [ "name", "placeholder" ]
|
||||
};
|
||||
if (!(element.localName in todoAttrs) || todoAttrs[element.localName].indexOf(idlAttr) == -1) {
|
||||
|
@ -470,6 +470,10 @@ DOMInterfaces = {
|
||||
'hasInstanceInterface': 'nsIDOMHTMLScriptElement',
|
||||
},
|
||||
|
||||
'HTMLSourceElement': {
|
||||
'hasInstanceInterface': 'nsIDOMHTMLSourceElement',
|
||||
},
|
||||
|
||||
'HTMLTableCellElement': {
|
||||
'hasInstanceInterface': 'nsIDOMHTMLTableCellElement'
|
||||
},
|
||||
|
21
dom/webidl/HTMLSourceElement.webidl
Normal file
21
dom/webidl/HTMLSourceElement.webidl
Normal file
@ -0,0 +1,21 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/#the-source-element
|
||||
*
|
||||
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
|
||||
* Opera Software ASA. You are granted a license to use, reproduce
|
||||
* and create derivative works of this document.
|
||||
*/
|
||||
|
||||
interface HTMLSourceElement : HTMLElement {
|
||||
[SetterThrows]
|
||||
attribute DOMString src;
|
||||
[SetterThrows]
|
||||
attribute DOMString type;
|
||||
[SetterThrows]
|
||||
attribute DOMString media;
|
||||
};
|
@ -196,6 +196,12 @@ webidl_files = \
|
||||
XULElement.webidl \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_MEDIA
|
||||
webidl_files += \
|
||||
HTMLSourceElement.webidl \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifdef MOZ_WEBGL
|
||||
webidl_files += \
|
||||
WebGLRenderingContext.webidl \
|
||||
|
Loading…
Reference in New Issue
Block a user