Merge remote-tracking branch 'origin/master' into HEAD

Conflicts:
	src/components/script/dom/bindings/proxyhandler.rs
	src/components/script/dom/bindings/text.rs
This commit is contained in:
Brian Anderson 2013-08-29 15:22:17 -07:00
commit 9624148f18
58 changed files with 2099 additions and 862 deletions

View file

@ -230,6 +230,12 @@ DOMInterfaces = {
'pointerType': '',
},
'HTMLFormElement': {
'nativeType': 'AbstractNode<ScriptView>',
'pointerType': '',
'register': False
},
'HTMLOptionsCollection': [
{
'nativeType': 'nsHTMLOptionCollection',
@ -361,12 +367,6 @@ DOMInterfaces = {
'resultNotAddRefed': [ 'getItem' ]
}],
'Text': {
'nativeType': 'AbstractNode<ScriptView>',
'concreteType': 'Text',
'pointerType': ''
},
'UIEvent': {
},
@ -542,12 +542,17 @@ def addExternalIface(iface, nativeType=None, headerFile=None, pointerType=None):
domInterface['pointerType'] = pointerType
DOMInterfaces[iface] = domInterface
def addHTMLElement(element):
def addHTMLElement(element, concrete=None):
DOMInterfaces[element] = {
'nativeType': 'AbstractNode<ScriptView>',
'pointerType': ''
'pointerType': '',
'concreteType': concrete if concrete else element
}
addHTMLElement('Comment')
addHTMLElement('DocumentType', concrete='DocumentType<ScriptView>')
addHTMLElement('Text')
addHTMLElement('HTMLAnchorElement')
addHTMLElement('HTMLAppletElement')
addHTMLElement('HTMLAreaElement')
@ -579,11 +584,19 @@ addHTMLElement('HTMLLIElement')
addHTMLElement('HTMLLinkElement')
addHTMLElement('HTMLMapElement')
addHTMLElement('HTMLMetaElement')
addHTMLElement('HTMLMeterElement')
addHTMLElement('HTMLModElement')
addHTMLElement('HTMLObjectElement')
addHTMLElement('HTMLOListElement')
addHTMLElement('HTMLOptGroupElement')
addHTMLElement('HTMLOptionElement')
addHTMLElement('HTMLOutputElement')
addHTMLElement('HTMLParagraphElement')
addHTMLElement('HTMLParamElement')
addHTMLElement('HTMLProgressElement')
addHTMLElement('HTMLQuoteElement')
addHTMLElement('HTMLScriptElement')
addHTMLElement('HTMLSelectElement')
addHTMLElement('HTMLSourceElement')
addHTMLElement('HTMLSpanElement')
addHTMLElement('HTMLStyleElement')
@ -597,6 +610,7 @@ addHTMLElement('HTMLTextAreaElement')
addHTMLElement('HTMLTimeElement')
addHTMLElement('HTMLTitleElement')
addHTMLElement('HTMLUListElement')
addHTMLElement('HTMLUnknownElement')
# If you add one of these, you need to make sure nsDOMQS.h has the relevant
# macros added for it
@ -605,8 +619,6 @@ def addExternalHTMLElement(element):
addExternalIface(element, nativeType=nativeElement,
headerFile=nativeElement + '.h')
addExternalHTMLElement('HTMLOptionElement')
addExternalHTMLElement('HTMLOptGroupElement')
addExternalHTMLElement('HTMLVideoElement')
addExternalIface('CanvasGradient', headerFile='nsIDOMCanvasRenderingContext2D.h')
addExternalIface('CanvasPattern', headerFile='nsIDOMCanvasRenderingContext2D.h')

View file

@ -92,7 +92,7 @@ class CastableObjectUnwrapper():
codeOnFailure is the code to run if unwrapping fails.
"""
def __init__(self, descriptor, source, target, codeOnFailure):
def __init__(self, descriptor, source, target, codeOnFailure, isOptional=False):
assert descriptor.castable
self.substitution = { "type" : descriptor.nativeType,
@ -101,7 +101,8 @@ class CastableObjectUnwrapper():
"protoID" : "PrototypeList::id::" + descriptor.name + " as uint",
"source" : source,
"target" : target,
"codeOnFailure" : CGIndenter(CGGeneric(codeOnFailure), 4).define() }
"codeOnFailure" : CGIndenter(CGGeneric(codeOnFailure), 4).define(),
"unwrapped_val" : "Some(val)" if isOptional else "val" }
if descriptor.hasXPConnectImpls:
# We don't use xpc_qsUnwrapThis because it will always throw on
# unwrap failure, whereas we want to control whether we throw or
@ -123,7 +124,7 @@ class CastableObjectUnwrapper():
def __str__(self):
return string.Template(
"""match unwrap_object(${source}, ${prototype}, ${depth}) {
Ok(val) => ${target} = val,
Ok(val) => ${target} = ${unwrapped_val},
Err(()) => {
${codeOnFailure}
}
@ -141,10 +142,11 @@ class FailureFatalCastableObjectUnwrapper(CastableObjectUnwrapper):
"""
As CastableObjectUnwrapper, but defaulting to throwing if unwrapping fails
"""
def __init__(self, descriptor, source, target):
def __init__(self, descriptor, source, target, isOptional):
CastableObjectUnwrapper.__init__(self, descriptor, source, target,
"return 0; //XXXjdm return Throw<%s>(cx, rv);" %
toStringBool(not descriptor.workers))
toStringBool(not descriptor.workers),
isOptional)
class CGThing():
"""
@ -229,9 +231,10 @@ class CGMethodCall(CGThing):
argCountCases.append(
CGCase(str(argCount), None, True))
else:
pass
sigIndex = signatures.index(signature)
argCountCases.append(
CGCase(str(argCount), getPerSignatureCall(signature)))
CGCase(str(argCount), getPerSignatureCall(signature,
signatureIndex=sigIndex)))
continue
distinguishingIndex = method.distinguishingIndexForArgCount(argCount)
@ -302,7 +305,7 @@ class CGMethodCall(CGThing):
# above.
caseBody.append(CGGeneric("if JSVAL_IS_OBJECT(%s) {" %
(distinguishingArg)))
for sig in interfacesSigs:
for idx, sig in enumerate(interfacesSigs):
caseBody.append(CGIndenter(CGGeneric("loop {")));
type = sig[1][distinguishingIndex].type
@ -326,7 +329,7 @@ class CGMethodCall(CGThing):
# distinguishingIndex + 1, since we already converted
# distinguishingIndex.
caseBody.append(CGIndenter(
getPerSignatureCall(sig, distinguishingIndex + 1), 4))
getPerSignatureCall(sig, distinguishingIndex + 1, idx), 4))
caseBody.append(CGIndenter(CGGeneric("}")))
caseBody.append(CGGeneric("}"))
@ -926,12 +929,14 @@ for (uint32_t i = 0; i < length; ++i) {
descriptor,
"JSVAL_TO_OBJECT(${val})",
"${declName}",
failureCode))
failureCode,
isOptional or argIsPointer or type.nullable()))
else:
templateBody += str(FailureFatalCastableObjectUnwrapper(
descriptor,
"JSVAL_TO_OBJECT(${val})",
"${declName}"))
"${declName}",
isOptional or argIsPointer or type.nullable()))
elif descriptor.interface.isCallback() and False:
#XXXjdm unfinished
templateBody += str(CallbackObjectUnwrapper(
@ -3536,8 +3541,8 @@ class CGProxySpecialOperation(CGPerSignatureCall):
templateValues = {
"declName": argument.identifier.name,
"holderName": argument.identifier.name + "_holder",
"val": "desc->value",
"valPtr": "&desc->value"
"val": "(*desc).value",
"valPtr": "&(*desc).value"
}
self.cgRoot.prepend(instantiateJSToNativeConversionTemplate(template, templateValues))
elif operation.isGetter():
@ -3640,7 +3645,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
if not 'IndexedCreator' in self.descriptor.operations:
# FIXME need to check that this is a 'supported property index'
assert False
setOrIndexedGet += (" FillPropertyDescriptor(&mut *desc, proxy, JSVAL_VOID, false);\n" +
setOrIndexedGet += (" FillPropertyDescriptor(&mut *desc, proxy, false);\n" +
" return 1;\n" +
" }\n")
if self.descriptor.operations['NamedSetter']:
@ -3648,7 +3653,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
if not 'NamedCreator' in self.descriptor.operations:
# FIXME need to check that this is a 'supported property name'
assert False
setOrIndexedGet += (" FillPropertyDescriptor(&mut *desc, proxy, JSVAL_VOID, false);\n" +
setOrIndexedGet += (" FillPropertyDescriptor(&mut *desc, proxy, false);\n" +
" return 1;\n" +
" }\n")
setOrIndexedGet += "}"
@ -3714,7 +3719,7 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
args = [Argument('*JSContext', 'cx'), Argument('*JSObject', 'proxy'),
Argument('jsid', 'id'),
Argument('*JSPropertyDescriptor', 'desc')]
CGAbstractExternMethod.__init__(self, descriptor, "defineProperty", "bool", args)
CGAbstractExternMethod.__init__(self, descriptor, "defineProperty", "JSBool", args)
self.descriptor = descriptor
def getBody(self):
set = ""
@ -3726,10 +3731,10 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
set += ("let index = GetArrayIndexFromId(cx, id);\n" +
"if index.is_some() {\n" +
" let index = index.unwrap();\n" +
" let this: *%s = UnwrapProxy(proxy);\n" +
" let this: *mut %s = UnwrapProxy(proxy) as *mut %s;\n" +
CGIndenter(CGProxyIndexedSetter(self.descriptor)).define() +
" return 1;\n" +
"}\n") % (self.descriptor.concreteType)
"}\n") % (self.descriptor.concreteType, self.descriptor.concreteType)
elif self.descriptor.operations['IndexedGetter']:
set += ("if GetArrayIndexFromId(cx, id).is_some() {\n" +
" return 0;\n" +
@ -3775,7 +3780,7 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
" }\n" +
" return 1;\n"
"}\n") % (self.descriptor.concreteType, self.descriptor.name)
return set + """return proxyhandler::defineProperty(%s);""" % ", ".join(a.name for a in self.args)
return set + """return proxyhandler::defineProperty_(%s);""" % ", ".join(a.name for a in self.args)
def definition_body(self):
return self.getBody()
@ -4617,75 +4622,16 @@ class CGBindingRoot(CGThing):
'js::jsapi::*',
'js::jsfriendapi::bindgen::*',
'js::glue::*',
'dom::characterdata::CharacterData', #XXXjdm
'dom::node::{AbstractNode, Node, Text}', #XXXjdm
'dom::document::{Document, AbstractDocument}', #XXXjdm
'dom::element::{Element, HTMLHeadElement, HTMLHtmlElement}', #XXXjdm
'dom::element::{HTMLDivElement, HTMLSpanElement, HTMLParagraphElement}', #XXXjdm
'dom::htmlanchorelement::HTMLAnchorElement', #XXXjdm
'dom::htmlappletelement::HTMLAppletElement', #XXXjune0cho
'dom::htmlareaelement::HTMLAreaElement', #XXXjune0cho
'dom::htmlbaseelement::HTMLBaseElement', #XXXjune0cho
'dom::htmlbodyelement::HTMLBodyElement', #XXXjune0cho
'dom::htmlbrelement::HTMLBRElement', #XXXrecrack
'dom::htmlbuttonelement::HTMLButtonElement', #XXXjdm
'dom::htmlcanvaselement::HTMLCanvasElement',
'dom::htmldataelement::HTMLDataElement', #XXXjune0cho
'dom::htmldatalistelement::HTMLDataListElement',
'dom::htmldlistelement::HTMLDListElement',
'dom::htmldirectoryelement::HTMLDirectoryElement',
'dom::htmlelement::HTMLElement', #XXXjdm
'dom::htmlembedelement::HTMLEmbedElement', #XXXjdm
'dom::htmlfieldsetelement::HTMLFieldSetElement', #XXXjdm
'dom::htmlfontelement::HTMLFontElement', #XXXjdm
'dom::htmlframeelement::HTMLFrameElement', #XXXjdm
'dom::htmlframesetelement::HTMLFrameSetElement', #XXXjdm
'dom::htmldocument::HTMLDocument', #XXXjdm
'dom::htmlheadingelement::HTMLHeadingElement',
'dom::htmlhrelement::HTMLHRElement',
'dom::htmliframeelement::HTMLIFrameElement', #XXXjdm
'dom::htmlimageelement::HTMLImageElement', #XXXjdm
'dom::htmlinputelement::HTMLInputElement',
'dom::htmllielement::HTMLLIElement',
'dom::htmllinkelement::HTMLLinkElement', #XXXrecrack
'dom::htmlmapelement::HTMLMapElement',
'dom::htmlmetaelement::HTMLMetaElement',
'dom::htmlolistelement::HTMLOListElement',
'dom::htmlprogresselement::HTMLProgressElement',
'dom::htmlquoteelement::HTMLQuoteElement',
'dom::htmlscriptelement::HTMLScriptElement',
'dom::htmlsourceelement::HTMLSourceElement',
'dom::htmlstyleelement::HTMLStyleElement',
'dom::htmltablecaptionelement::HTMLTableCaptionElement',
'dom::htmltableelement::HTMLTableElement',
'dom::htmltablecellelement::HTMLTableCellElement',
'dom::htmltablecolelement::HTMLTableColElement',
'dom::htmltablerowelement::HTMLTableRowElement',
'dom::htmltablesectionelement::HTMLTableSectionElement',
'dom::htmltextareaelement::HTMLTextAreaElement',
'dom::htmltimeelement::HTMLTimeElement',
'dom::htmltitleelement::HTMLTitleElement', #XXXyusukesuzuki
'dom::htmlulistelement::HTMLUListElement',
'dom::types::*',
'dom::bindings::utils::*',
'dom::bindings::conversions::*',
'dom::blob::*', #XXXjdm
'dom::clientrect::*', #XXXjdm
'dom::clientrectlist::*', #XXXjdm
'dom::htmlcollection::*', #XXXjdm
'dom::bindings::proxyhandler::*',
'dom::domparser::*', #XXXjdm
'dom::event::*', #XXXjdm
'dom::eventtarget::*', #XXXjdm
'dom::formdata::*', #XXXjdm
'dom::mouseevent::*', #XXXjdm
'dom::uievent::*', #XXXjdm
'dom::validitystate::*', #XXXjdm
'dom::windowproxy::*', #XXXjdm
'dom::window::Window', #XXXjdm
'dom::bindings::codegen::*', #XXXjdm
'script_task::{JSPageInfo, page_from_context}',
'dom::bindings::utils::EnumEntry',
'dom::node::ScriptView',
'dom::bindings::proxyhandler',
'dom::bindings::proxyhandler::*',
'dom::document::AbstractDocument',
'dom::node::{AbstractNode, ScriptView}',
'servo_util::vec::zip_copies',
'std::cast',
'std::libc',
@ -4787,3 +4733,18 @@ class GlobalGenRoots():
# Done.
return curr
@staticmethod
def InterfaceTypes(config):
descriptors = [d.name for d in config.getDescriptors(register=True)]
curr = CGList([CGGeneric(declare="pub use dom::%s::%s;\n" % (name.lower(), name)) for name in descriptors])
curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT)
return curr
@staticmethod
def BindingDeclarations(config):
descriptors = [d.name for d in config.getDescriptors(register=True)]
curr = CGList([CGGeneric(declare="pub mod %sBinding;\n" % name) for name in descriptors])
curr = CGWrapper(curr, pre=AUTOGENERATED_WARNING_COMMENT)
return curr

View file

@ -0,0 +1,15 @@
/* -*- 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://dom.spec.whatwg.org/#comment
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
[Constructor(optional DOMString data = "")]
interface Comment : CharacterData {
};

View file

@ -0,0 +1,22 @@
/* -*- 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://dom.spec.whatwg.org/#documenttype
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface DocumentType : Node {
readonly attribute DOMString name;
readonly attribute DOMString publicId;
readonly attribute DOMString systemId;
// Mozilla extension
//readonly attribute DOMString? internalSubset;
};
//DocumentType implements ChildNode;

View file

@ -80,6 +80,12 @@ def main():
# Generate the common code.
generate_file(config, 'RegisterBindings', 'declare+define')
# Generate the type list.
generate_file(config, 'InterfaceTypes', 'declare+define')
# Generate the module declarations.
generate_file(config, 'BindingDeclarations', 'declare+define')
#XXXjdm No union support yet
#generate_file(config, 'UnionTypes', 'declare')
#generate_file(config, 'UnionConversions', 'declare')

View file

@ -10,7 +10,8 @@
* and create derivative works of this document.
*/
interface HTMLFormElement;
// FIXME: servo#707
//interface HTMLFormElement;
// http://www.whatwg.org/specs/web-apps/current-work/#the-button-element
interface HTMLButtonElement : HTMLElement {

View file

@ -0,0 +1,48 @@
/* -*- 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/#htmlformelement
*
* ⓒ 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.
*/
[OverrideBuiltins]
interface HTMLFormElement : HTMLElement {
[Pure, SetterThrows]
attribute DOMString acceptCharset;
[Pure, SetterThrows]
attribute DOMString action;
[Pure, SetterThrows]
attribute DOMString autocomplete;
[Pure, SetterThrows]
attribute DOMString enctype;
[Pure, SetterThrows]
attribute DOMString encoding;
[Pure, SetterThrows]
attribute DOMString method;
[Pure, SetterThrows]
attribute DOMString name;
[Pure, SetterThrows]
attribute boolean noValidate;
[Pure, SetterThrows]
attribute DOMString target;
[Constant]
readonly attribute HTMLCollection elements;
[Pure]
readonly attribute long length;
getter Element (unsigned long index);
// TODO this should be: getter (RadioNodeList or HTMLInputElement or HTMLImageElement) (DOMString name);
// getter nsISupports (DOMString name);
[Throws]
void submit();
void reset();
boolean checkValidity();
};

View file

@ -0,0 +1,33 @@
/* -*- 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-meter-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.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-meter-element
interface HTMLMeterElement : HTMLElement {
[SetterThrows]
attribute double value;
[SetterThrows]
attribute double min;
[SetterThrows]
attribute double max;
[SetterThrows]
attribute double low;
[SetterThrows]
attribute double high;
[SetterThrows]
attribute double optimum;
/**
* The labels attribute will be done with bug 556743.
*/
//readonly attribute NodeList labels;
};

View file

@ -0,0 +1,19 @@
/* -*- 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/#attributes-common-to-ins-and-del-elements
* © 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.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#attributes-common-to-ins-and-del-elements
interface HTMLModElement : HTMLElement {
[SetterThrows, Pure]
attribute DOMString cite;
[SetterThrows, Pure]
attribute DOMString dateTime;
};

View file

@ -0,0 +1,201 @@
/* -*- 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-object-element
* http://www.whatwg.org/specs/web-apps/current-work/#HTMLObjectElement-partial
*
* © 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.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-object-element
[NeedNewResolve]
interface HTMLObjectElement : HTMLElement {
[Pure, SetterThrows]
attribute DOMString data;
[Pure, SetterThrows]
attribute DOMString type;
// attribute boolean typeMustMatch;
[Pure, SetterThrows]
attribute DOMString name;
[Pure, SetterThrows]
attribute DOMString useMap;
[Pure]
readonly attribute HTMLFormElement? form;
[Pure, SetterThrows]
attribute DOMString width;
[Pure, SetterThrows]
attribute DOMString height;
// Not pure: can trigger about:blank instantiation
readonly attribute Document? contentDocument;
// Not pure: can trigger about:blank instantiation
readonly attribute WindowProxy? contentWindow;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);
/*[Throws]
legacycaller any (any... arguments);*/
};
// http://www.whatwg.org/specs/web-apps/current-work/#HTMLObjectElement-partial
partial interface HTMLObjectElement {
[Pure, SetterThrows]
attribute DOMString align;
[Pure, SetterThrows]
attribute DOMString archive;
[Pure, SetterThrows]
attribute DOMString code;
[Pure, SetterThrows]
attribute boolean declare;
[Pure, SetterThrows]
attribute unsigned long hspace;
[Pure, SetterThrows]
attribute DOMString standby;
[Pure, SetterThrows]
attribute unsigned long vspace;
[Pure, SetterThrows]
attribute DOMString codeBase;
[Pure, SetterThrows]
attribute DOMString codeType;
[TreatNullAs=EmptyString, Pure, SetterThrows]
attribute DOMString border;
};
partial interface HTMLObjectElement {
// GetSVGDocument
Document? getSVGDocument();
};
/*[NoInterfaceObject]
interface MozObjectLoadingContent {
// Mirrored chrome-only scriptable nsIObjectLoadingContent methods. Please
// make sure to update this list if nsIObjectLoadingContent changes. Also,
// make sure everything on here is [ChromeOnly].
[ChromeOnly]
const unsigned long TYPE_LOADING = 0;
[ChromeOnly]
const unsigned long TYPE_IMAGE = 1;
[ChromeOnly]
const unsigned long TYPE_PLUGIN = 2;
[ChromeOnly]
const unsigned long TYPE_DOCUMENT = 3;
[ChromeOnly]
const unsigned long TYPE_NULL = 4;
// The content type is not supported (e.g. plugin not installed)
[ChromeOnly]
const unsigned long PLUGIN_UNSUPPORTED = 0;
// Showing alternate content
[ChromeOnly]
const unsigned long PLUGIN_ALTERNATE = 1;
// The plugin exists, but is disabled
[ChromeOnly]
const unsigned long PLUGIN_DISABLED = 2;
// The plugin is blocklisted and disabled
[ChromeOnly]
const unsigned long PLUGIN_BLOCKLISTED = 3;
// The plugin is considered outdated, but not disabled
[ChromeOnly]
const unsigned long PLUGIN_OUTDATED = 4;
// The plugin has crashed
[ChromeOnly]
const unsigned long PLUGIN_CRASHED = 5;
// Suppressed by security policy
[ChromeOnly]
const unsigned long PLUGIN_SUPPRESSED = 6;
// Blocked by content policy
[ChromeOnly]
const unsigned long PLUGIN_USER_DISABLED = 7;
/// ** All values >= PLUGIN_CLICK_TO_PLAY are plugin placeholder types that
/// would be replaced by a real plugin if activated (playPlugin())
/// ** Furthermore, values >= PLUGIN_CLICK_TO_PLAY and
/// <= PLUGIN_VULNERABLE_NO_UPDATE are click-to-play types.
// The plugin is disabled until the user clicks on it
[ChromeOnly]
const unsigned long PLUGIN_CLICK_TO_PLAY = 8;
// The plugin is vulnerable (update available)
[ChromeOnly]
const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
// The plugin is vulnerable (no update available)
[ChromeOnly]
const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
// The plugin is in play preview mode
[ChromeOnly]
const unsigned long PLUGIN_PLAY_PREVIEW = 11;*/
/**
* The actual mime type (the one we got back from the network
* request) for the element.
*/
/*[ChromeOnly]
readonly attribute DOMString actualType;*/
/**
* Gets the type of the content that's currently loaded. See
* the constants above for the list of possible values.
*/
/*[ChromeOnly]
readonly attribute unsigned long displayedType;*/
/**
* Gets the content type that corresponds to the give MIME type. See the
* constants above for the list of possible values. If nothing else fits,
* TYPE_NULL will be returned.
*/
/*[ChromeOnly]
unsigned long getContentTypeForMIMEType(DOMString aMimeType);*/
/**
* This method will play a plugin that has been stopped by the
* click-to-play plugins or play-preview features.
*/
/*[ChromeOnly, Throws]
void playPlugin();*/
/**
* This attribute will return true if the current content type has been
* activated, either explicitly or by passing checks that would have it be
* click-to-play or play-preview.
*/
/*[ChromeOnly]
readonly attribute boolean activated;*/
/**
* The URL of the data/src loaded in the object. This may be null (i.e.
* an <embed> with no src).
*/
/*[ChromeOnly]
readonly attribute URI? srcURI;
[ChromeOnly]
readonly attribute unsigned long defaultFallbackType;
[ChromeOnly]
readonly attribute unsigned long pluginFallbackType;*/
/**
* If this object currently owns a running plugin, regardless of whether or
* not one is pending spawn/despawn.
*/
/*[ChromeOnly]
readonly attribute boolean hasRunningPlugin;*/
/**
* This method will disable the play-preview plugin state.
*/
/*[ChromeOnly, Throws]
void cancelPlayPreview();*/
//};
/*HTMLObjectElement implements MozImageLoadingContent;
HTMLObjectElement implements MozFrameLoaderOwner;
HTMLObjectElement implements MozObjectLoadingContent;*/

View file

@ -0,0 +1,19 @@
/* -*- 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-optgroup-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 HTMLOptGroupElement : HTMLElement {
[SetterThrows]
attribute boolean disabled;
[SetterThrows]
attribute DOMString label;
};

View file

@ -0,0 +1,31 @@
/* -*- 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-option-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.
*/
[NamedConstructor=Option(optional DOMString text, optional DOMString value, optional boolean defaultSelected, optional boolean selected)]
interface HTMLOptionElement : HTMLElement {
[SetterThrows]
attribute boolean disabled;
readonly attribute HTMLFormElement? form;
[SetterThrows]
attribute DOMString label;
[SetterThrows]
attribute boolean defaultSelected;
[SetterThrows]
attribute boolean selected;
[SetterThrows]
attribute DOMString value;
[SetterThrows]
attribute DOMString text;
readonly attribute long index;
};

View file

@ -0,0 +1,37 @@
/* -*- 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-output-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.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
interface HTMLOutputElement : HTMLElement {
/*[PutForwards=value, Constant]
readonly attribute DOMSettableTokenList htmlFor;*/
readonly attribute HTMLFormElement? form;
[SetterThrows, Pure]
attribute DOMString name;
[Constant]
readonly attribute DOMString type;
[SetterThrows, Pure]
attribute DOMString defaultValue;
[SetterThrows, Pure]
attribute DOMString value;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);
// Not yet implemented (bug 556743).
// readonly attribute NodeList labels;
};

View file

@ -0,0 +1,29 @@
/* -*- 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-param-element
* http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
*
* © 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.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-param-element
interface HTMLParamElement : HTMLElement {
[SetterThrows, Pure]
attribute DOMString name;
[SetterThrows, Pure]
attribute DOMString value;
};
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLParamElement {
[SetterThrows, Pure]
attribute DOMString type;
[SetterThrows, Pure]
attribute DOMString valueType;
};

View file

@ -0,0 +1,57 @@
/* -*- 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/html/#the-select-element
*/
interface HTMLSelectElement : HTMLElement {
[SetterThrows, Pure]
attribute boolean autofocus;
[SetterThrows, Pure]
attribute boolean disabled;
[Pure]
readonly attribute HTMLFormElement? form;
[SetterThrows, Pure]
attribute boolean multiple;
[SetterThrows, Pure]
attribute DOMString name;
[SetterThrows, Pure]
attribute boolean required;
[SetterThrows, Pure]
attribute unsigned long size;
[Pure]
readonly attribute DOMString type;
/*[Constant]
readonly attribute HTMLOptionsCollection options;*/
[SetterThrows, Pure]
attribute unsigned long length;
getter Element? item(unsigned long index);
HTMLOptionElement? namedItem(DOMString name);
/*[Throws]
void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);*/
void remove(long index);
[Throws]
setter creator void (unsigned long index, HTMLOptionElement? option);
// NYI: readonly attribute HTMLCollection selectedOptions;
[SetterThrows, Pure]
attribute long selectedIndex;
[Pure]
attribute DOMString value;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);
// NYI: readonly attribute NodeList labels;
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=20720
void remove();
};

View file

@ -0,0 +1,16 @@
/* -*- 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/ and
* http://dev.w3.org/csswg/cssom-view/
*
* © 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 HTMLUnknownElement : HTMLElement {
};