Bug 922159 - Rename Creator WebIDL extended attribute to NewObject. r=bz.

--HG--
extra : rebase_source : 2c09c54f42a111d27b0d57346ca7d80f440eca09
This commit is contained in:
Peter Van der Beken 2013-09-30 18:32:22 +02:00
parent d7969ebe81
commit 2833cfc42b
27 changed files with 187 additions and 186 deletions

View File

@ -3933,7 +3933,7 @@ class CGArgumentConverter(CGThing):
sequenceWrapLevel = 0
def getWrapTemplateForType(type, descriptorProvider, result, successCode,
isCreator, exceptionCode, typedArraysAreStructs):
returnsNewObject, exceptionCode, typedArraysAreStructs):
"""
Reflect a C++ value stored in "result", of IDL type "type" into JS. The
"successCode" is the code to run once we have successfully done the
@ -4020,7 +4020,7 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
# Nullable sequences are Nullable< nsTArray<T> >
(recTemplate, recInfall) = getWrapTemplateForType(type.inner, descriptorProvider,
"%s.Value()" % result, successCode,
isCreator, exceptionCode,
returnsNewObject, exceptionCode,
typedArraysAreStructs)
return ("""
if (%s.IsNull()) {
@ -4042,7 +4042,7 @@ if (%s.IsNull()) {
'successCode': "break;",
'jsvalRef': "tmp",
'jsvalHandle': "&tmp",
'isCreator': isCreator,
'returnsNewObject': returnsNewObject,
'exceptionCode': exceptionCode,
'obj': "returnArray"
}
@ -4089,8 +4089,8 @@ if (!returnArray) {
assert descriptor.nativeOwnership != 'owned'
wrapMethod = "WrapNewBindingObject"
else:
if not isCreator:
raise MethodNotCreatorError(descriptor.interface.identifier.name)
if not returnsNewObject:
raise MethodNotNewObjectError(descriptor.interface.identifier.name)
if descriptor.nativeOwnership == 'owned':
wrapMethod = "WrapNewBindingNonWrapperCachedOwnedObject"
else:
@ -4203,7 +4203,7 @@ if (!returnArray) {
if type.nullable():
(recTemplate, recInfal) = getWrapTemplateForType(type.inner, descriptorProvider,
"%s.Value()" % result, successCode,
isCreator, exceptionCode,
returnsNewObject, exceptionCode,
typedArraysAreStructs)
return ("if (%s.IsNull()) {\n" % result +
CGIndenter(CGGeneric(setValue("JSVAL_NULL"))).define() + "\n" +
@ -4276,8 +4276,9 @@ def wrapForType(type, descriptorProvider, templateValues):
more of the conversion template will be
executed (e.g. by doing a 'return' or 'break'
as appropriate).
* 'isCreator' (optional): If true, we're wrapping for the return value of
a [Creator] method. Assumed false if not set.
* 'returnsNewObject' (optional): If true, we're wrapping for the return
value of a [NewObject] method. Assumed
false if not set.
* 'exceptionCode' (optional): Code to run when a JS exception is thrown.
The default is "return false;". The code
passed here must return.
@ -4285,7 +4286,7 @@ def wrapForType(type, descriptorProvider, templateValues):
wrap = getWrapTemplateForType(type, descriptorProvider,
templateValues.get('result', 'result'),
templateValues.get('successCode', None),
templateValues.get('isCreator', False),
templateValues.get('returnsNewObject', False),
templateValues.get('exceptionCode',
"return false;"),
templateValues.get('typedArraysAreStructs',
@ -4297,8 +4298,8 @@ def wrapForType(type, descriptorProvider, templateValues):
def infallibleForMember(member, type, descriptorProvider):
"""
Determine the fallibility of changing a C++ value of IDL type "type" into
JS for the given attribute. Apart from isCreator, all the defaults are used,
since the fallbility does not change based on the boolean values,
JS for the given attribute. Apart from returnsNewObject, all the defaults
are used, since the fallbility does not change based on the boolean values,
and the template will be discarded.
CURRENT ASSUMPTIONS:
@ -4306,7 +4307,7 @@ def infallibleForMember(member, type, descriptorProvider):
failure conditions.
"""
return getWrapTemplateForType(type, descriptorProvider, 'result', None,\
memberIsCreator(member), "return false;",
memberReturnsNewObject(member), "return false;",
False)[1]
def leafTypeNeedsCx(type, retVal):
@ -4584,7 +4585,7 @@ def getUnionMemberName(type):
return str(type)
return type.name
class MethodNotCreatorError(Exception):
class MethodNotNewObjectError(Exception):
def __init__(self, typename):
self.typename = typename
@ -4858,11 +4859,11 @@ if (!${obj}) {
return not 'infallible' in self.extendedAttributes
def wrap_return_value(self):
isCreator = memberIsCreator(self.idlNode)
if isCreator:
returnsNewObject = memberReturnsNewObject(self.idlNode)
if returnsNewObject:
# We better be returning addrefed things!
assert(isResultAlreadyAddRefed(self.extendedAttributes) or
# Creators can return raw pointers to owned objects
# NewObject can return raw pointers to owned objects
(self.returnType.isGeckoInterface() and
self.descriptor.getDescriptor(self.returnType.unroll().inner.identifier.name).nativeOwnership == 'owned') or
# Workers use raw pointers for new-object return
@ -4871,13 +4872,13 @@ if (!${obj}) {
resultTemplateValues = { 'jsvalRef': 'args.rval()',
'jsvalHandle': 'args.rval()',
'isCreator': isCreator}
'returnsNewObject': returnsNewObject}
try:
return wrapForType(self.returnType, self.descriptor,
resultTemplateValues)
except MethodNotCreatorError, err:
assert not isCreator
raise TypeError("%s being returned from non-creator method or property %s.%s" %
except MethodNotNewObjectError, err:
assert not returnsNewObject
raise TypeError("%s being returned from non-NewObject method or property %s.%s" %
(err.typename,
self.descriptor.interface.identifier.name,
self.idlNode.identifier.name))
@ -5794,8 +5795,8 @@ if (!v.isObject()) {
return JS_SetProperty(cx, &v.toObject(), "%s", args[0]);""" % (attrName, self.descriptor.interface.identifier.name, attrName, forwardToAttrName))).define()
def memberIsCreator(member):
return member.getExtendedAttribute("Creator") is not None
def memberReturnsNewObject(member):
return member.getExtendedAttribute("NewObject") is not None
class CGMemberJITInfo(CGThing):
"""
@ -8538,7 +8539,7 @@ if (""",
"break;" % propDef),
'jsvalRef': "temp",
'jsvalHandle': "&temp",
'isCreator': False,
'returnsNewObject': False,
'obj': "parentObject",
'typedArraysAreStructs': True
})
@ -9134,7 +9135,7 @@ class CGNativeMember(ClassMethod):
holder = "nsRefPtr"
else:
holder = "already_AddRefed"
if memberIsCreator(self.member):
if memberReturnsNewObject(self.member):
warning = ""
else:
warning = "// Mark this as resultNotAddRefed to return raw pointers\n"
@ -10099,10 +10100,10 @@ class FakeMember():
def isMethod(self):
return False
def getExtendedAttribute(self, name):
# Claim to be a [Creator] so we can avoid the "mark this
# Claim to be a [NewObject] so we can avoid the "mark this
# resultNotAddRefed" comments CGNativeMember codegen would
# otherwise stick in.
if name == "Creator":
if name == "NewObject":
return True
return None
@ -10258,7 +10259,7 @@ class CallbackMember(CGNativeMember):
# really... It's OK to use CallbackPreserveColor because
# CallSetup already handled the unmark-gray bits for us.
'obj' : 'CallbackPreserveColor()',
'isCreator': False,
'returnsNewObject': False,
'exceptionCode' : self.exceptionCode
})
if arg.variadic:

View File

@ -924,12 +924,12 @@ class IDLInterface(IDLObjectWithScope):
method = IDLMethod(self.location, methodIdentifier, retType,
args, static=True)
# Constructors are always Creators and are always
# Constructors are always NewObject and are always
# assumed to be able to throw (since there's no way to
# indicate otherwise) and never have any other
# extended attributes.
method.addExtendedAttributes(
[IDLExtendedAttribute(self.location, ("Creator",)),
[IDLExtendedAttribute(self.location, ("NewObject",)),
IDLExtendedAttribute(self.location, ("Throws",))])
@ -2760,7 +2760,7 @@ class IDLAttribute(IDLInterfaceMember):
identifier == "SameObject" or
identifier == "Constant" or
identifier == "Func" or
identifier == "Creator"):
identifier == "NewObject"):
# Known attributes that we don't need to do anything with here
pass
else:
@ -3308,7 +3308,7 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
"restricted float type arguments",
[attr.location, self.location])
elif (identifier == "Throws" or
identifier == "Creator" or
identifier == "NewObject" or
identifier == "ChromeOnly" or
identifier == "Pref" or
identifier == "Func" or

View File

@ -233,17 +233,17 @@ interface TestInterface {
void passOptionalSelfWithDefault(optional TestInterface? arg = null);
// Non-wrapper-cache interface types
[Creator]
[NewObject]
TestNonWrapperCacheInterface receiveNonWrapperCacheInterface();
[Creator]
[NewObject]
TestNonWrapperCacheInterface? receiveNullableNonWrapperCacheInterface();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface> receiveNonWrapperCacheInterfaceSequence();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface?> receiveNullableNonWrapperCacheInterfaceSequence();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface>? receiveNonWrapperCacheInterfaceNullableSequence();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface?>? receiveNullableNonWrapperCacheInterfaceNullableSequence();
// Non-castable interface types

View File

@ -129,17 +129,17 @@ interface TestExampleInterface {
void passOptionalSelfWithDefault(optional TestInterface? arg = null);
// Non-wrapper-cache interface types
[Creator]
[NewObject]
TestNonWrapperCacheInterface receiveNonWrapperCacheInterface();
[Creator]
[NewObject]
TestNonWrapperCacheInterface? receiveNullableNonWrapperCacheInterface();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface> receiveNonWrapperCacheInterfaceSequence();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface?> receiveNullableNonWrapperCacheInterfaceSequence();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface>? receiveNonWrapperCacheInterfaceNullableSequence();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface?>? receiveNullableNonWrapperCacheInterfaceNullableSequence();
// Non-castable interface types

View File

@ -145,18 +145,18 @@ interface TestJSImplInterface {
void passOptionalSelfWithDefault(optional TestJSImplInterface? arg = null);
// Non-wrapper-cache interface types
[Creator]
[NewObject]
TestNonWrapperCacheInterface receiveNonWrapperCacheInterface();
[Creator]
[NewObject]
TestNonWrapperCacheInterface? receiveNullableNonWrapperCacheInterface();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface> receiveNonWrapperCacheInterfaceSequence();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface?> receiveNullableNonWrapperCacheInterfaceSequence();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface>? receiveNonWrapperCacheInterfaceNullableSequence();
[Creator]
[NewObject]
sequence<TestNonWrapperCacheInterface?>? receiveNullableNonWrapperCacheInterfaceNullableSequence();
// Non-castable interface types

View File

@ -21,7 +21,7 @@ interface AudioContext : EventTarget {
readonly attribute double currentTime;
readonly attribute AudioListener listener;
[Creator, Throws]
[NewObject, Throws]
AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long length, float sampleRate);
void decodeAudioData(ArrayBuffer audioData,
@ -29,47 +29,47 @@ interface AudioContext : EventTarget {
optional DecodeErrorCallback errorCallback);
// AudioNode creation
[Creator]
[NewObject]
AudioBufferSourceNode createBufferSource();
[Creator, Throws]
[NewObject, Throws]
MediaStreamAudioDestinationNode createMediaStreamDestination();
[Creator, Throws]
[NewObject, Throws]
ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0,
optional unsigned long numberOfInputChannels = 2,
optional unsigned long numberOfOutputChannels = 2);
[Creator]
[NewObject]
AnalyserNode createAnalyser();
[Creator, Throws]
[NewObject, Throws]
MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
[Creator, Throws]
[NewObject, Throws]
MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
[Creator]
[NewObject]
GainNode createGain();
[Creator, Throws]
[NewObject, Throws]
DelayNode createDelay(optional double maxDelayTime = 1);
[Creator]
[NewObject]
BiquadFilterNode createBiquadFilter();
[Creator]
[NewObject]
WaveShaperNode createWaveShaper();
[Creator]
[NewObject]
PannerNode createPanner();
[Creator]
[NewObject]
ConvolverNode createConvolver();
[Creator, Throws]
[NewObject, Throws]
ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6);
[Creator, Throws]
[NewObject, Throws]
ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs = 6);
[Creator]
[NewObject]
DynamicsCompressorNode createDynamicsCompressor();
[Creator]
[NewObject]
OscillatorNode createOscillator();
[Creator, Throws]
[NewObject, Throws]
PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag);
};
@ -80,19 +80,19 @@ interface AudioContext : EventTarget {
*/
[PrefControlled]
partial interface AudioContext {
[Creator, Throws]
[NewObject, Throws]
AudioBuffer? createBuffer(ArrayBuffer buffer, boolean mixToMono);
// Same as createGain()
[Creator,Pref="media.webaudio.legacy.AudioContext"]
[NewObject,Pref="media.webaudio.legacy.AudioContext"]
GainNode createGainNode();
// Same as createDelay()
[Creator, Throws, Pref="media.webaudio.legacy.AudioContext"]
[NewObject, Throws, Pref="media.webaudio.legacy.AudioContext"]
DelayNode createDelayNode(optional double maxDelayTime = 1);
// Same as createScriptProcessor()
[Creator, Throws, Pref="media.webaudio.legacy.AudioContext"]
[NewObject, Throws, Pref="media.webaudio.legacy.AudioContext"]
ScriptProcessorNode createJavaScriptNode(optional unsigned long bufferSize = 0,
optional unsigned long numberOfInputChannels = 2,
optional unsigned long numberOfOutputChannels = 2);

View File

@ -65,29 +65,29 @@ interface BluetoothAdapter : EventTarget {
// Fired when remote devices query current media play status
attribute EventHandler onrequestmediaplaystatus;
[Creator, Throws]
[NewObject, Throws]
DOMRequest setName(DOMString name);
[Creator, Throws]
[NewObject, Throws]
DOMRequest setDiscoverable(boolean discoverable);
[Creator, Throws]
[NewObject, Throws]
DOMRequest setDiscoverableTimeout(unsigned long timeout);
[Creator, Throws]
[NewObject, Throws]
DOMRequest startDiscovery();
[Creator, Throws]
[NewObject, Throws]
DOMRequest stopDiscovery();
[Creator, Throws]
[NewObject, Throws]
DOMRequest pair(BluetoothDevice device);
[Creator, Throws]
[NewObject, Throws]
DOMRequest unpair(BluetoothDevice device);
[Creator, Throws]
[NewObject, Throws]
DOMRequest getPairedDevices();
[Creator, Throws]
[NewObject, Throws]
DOMRequest getConnectedDevices(unsigned short serviceUuid);
[Creator, Throws]
[NewObject, Throws]
DOMRequest setPinCode(DOMString deviceAddress, DOMString pinCode);
[Creator, Throws]
[NewObject, Throws]
DOMRequest setPasskey(DOMString deviceAddress, unsigned long passkey);
[Creator, Throws]
[NewObject, Throws]
DOMRequest setPairingConfirmation(DOMString deviceAddress, boolean confirmation);
/**
@ -107,26 +107,26 @@ interface BluetoothAdapter : EventTarget {
* @param device Remote device
* @param profile 2-octets service UUID. This is optional.
*/
[Creator, Throws]
[NewObject, Throws]
DOMRequest connect(BluetoothDevice device, optional unsigned short serviceUuid);
[Creator, Throws]
[NewObject, Throws]
DOMRequest disconnect(BluetoothDevice device, optional unsigned short serviceUuid);
// One device can only send one file at a time
[Creator, Throws]
[NewObject, Throws]
DOMRequest sendFile(DOMString deviceAddress, Blob blob);
[Creator, Throws]
[NewObject, Throws]
DOMRequest stopSendingFile(DOMString deviceAddress);
[Creator, Throws]
[NewObject, Throws]
DOMRequest confirmReceivingFile(DOMString deviceAddress, boolean confirmation);
// Connect/Disconnect SCO (audio) connection
[Creator, Throws]
[NewObject, Throws]
DOMRequest connectSco();
[Creator, Throws]
[NewObject, Throws]
DOMRequest disconnectSco();
[Creator, Throws]
[NewObject, Throws]
DOMRequest isScoConnected();
/**
@ -147,8 +147,8 @@ interface BluetoothAdapter : EventTarget {
DOMRequest toggleCalls();
// AVRCP 1.3 methods
[Creator,Throws]
[NewObject,Throws]
DOMRequest sendMediaMetaData(optional MediaMetaData mediaMetaData);
[Creator,Throws]
[NewObject,Throws]
DOMRequest sendMediaPlayStatus(optional MediaPlayStatus mediaPlayStatus);
};

View File

@ -13,6 +13,6 @@ interface BluetoothManager : EventTarget {
[Throws]
boolean isConnected(unsigned short aProfile);
[Creator, Throws]
[NewObject, Throws]
DOMRequest? getDefaultAdapter();
};

View File

@ -48,11 +48,11 @@ interface CanvasRenderingContext2D {
// colors and styles (see also the CanvasDrawingStyles interface)
attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
[Creator]
[NewObject]
CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
[Creator, Throws]
[NewObject, Throws]
CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
[Creator, Throws]
[NewObject, Throws]
CanvasPattern createPattern((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, [TreatNullAs=EmptyString] DOMString repetition);
// shadows
@ -96,7 +96,7 @@ interface CanvasRenderingContext2D {
void fillText(DOMString text, double x, double y, optional double maxWidth);
[Throws, LenientFloat]
void strokeText(DOMString text, double x, double y, optional double maxWidth);
[Creator, Throws]
[NewObject, Throws]
TextMetrics measureText(DOMString text);
// drawing images
@ -112,11 +112,11 @@ interface CanvasRenderingContext2D {
// NOT IMPLEMENTED void addHitRegion(HitRegionOptions options);
// pixel manipulation
[Creator, Throws]
[NewObject, Throws]
ImageData createImageData(double sw, double sh);
[Creator, Throws]
[NewObject, Throws]
ImageData createImageData(ImageData imagedata);
[Creator, Throws]
[NewObject, Throws]
ImageData getImageData(double sx, double sy, double sw, double sh);
[Throws]
void putImageData(ImageData imagedata, double dx, double dy);

View File

@ -23,19 +23,19 @@ enum SupportedType {
Constructor(Principal? prin, optional URI? documentURI = null,
optional URI? baseURI = null)]
interface DOMParser {
[Creator, Throws]
[NewObject, Throws]
Document parseFromString(DOMString str, SupportedType type);
// Mozilla-specific stuff
// Throws if the passed-in length is greater than the actual sequence length
[Creator, Throws, ChromeOnly]
[NewObject, Throws, ChromeOnly]
Document parseFromBuffer(sequence<octet> buf, unsigned long bufLen,
SupportedType type);
// Throws if the passed-in length is greater than the actual typed array length
[Creator, Throws, ChromeOnly]
[NewObject, Throws, ChromeOnly]
Document parseFromBuffer(Uint8Array buf, unsigned long bufLen,
SupportedType type);
[Creator, Throws, ChromeOnly]
[NewObject, Throws, ChromeOnly]
Document parseFromStream(InputStream stream, DOMString? charset,
long contentLength, SupportedType type);
[Throws, ChromeOnly]

View File

@ -9,7 +9,7 @@ interface MozObserver;
[HeaderFile="mozilla/dom/DesktopNotification.h"]
interface DesktopNotificationCenter
{
[Creator]
[NewObject]
DesktopNotification createNotification(DOMString title,
DOMString description,
optional DOMString iconURL = "");

View File

@ -40,17 +40,17 @@ interface Document : Node {
HTMLCollection getElementsByClassName(DOMString classNames);
Element? getElementById(DOMString elementId);
[Creator, Throws]
[NewObject, Throws]
Element createElement(DOMString localName);
[Creator, Throws]
[NewObject, Throws]
Element createElementNS(DOMString? namespace, DOMString qualifiedName);
[Creator]
[NewObject]
DocumentFragment createDocumentFragment();
[Creator]
[NewObject]
Text createTextNode(DOMString data);
[Creator]
[NewObject]
Comment createComment(DOMString data);
[Creator, Throws]
[NewObject, Throws]
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
[Throws]
@ -58,16 +58,16 @@ interface Document : Node {
[Throws]
Node adoptNode(Node node);
[Creator, Throws]
[NewObject, Throws]
Event createEvent(DOMString interface);
[Creator, Throws]
[NewObject, Throws]
Range createRange();
// NodeFilter.SHOW_ALL = 0xFFFFFFFF
[Creator, Throws]
[NewObject, Throws]
NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
[Creator, Throws]
[NewObject, Throws]
TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
// NEW
@ -77,11 +77,11 @@ interface Document : Node {
// These are not in the spec, but leave them for now for backwards compat.
// So sort of like Gecko extensions
[Creator, Throws]
[NewObject, Throws]
CDATASection createCDATASection(DOMString data);
[Creator, Throws]
[NewObject, Throws]
Attr createAttribute(DOMString name);
[Creator, Throws]
[NewObject, Throws]
Attr createAttributeNS(DOMString? namespace, DOMString name);
readonly attribute DOMString? inputEncoding;
};
@ -290,7 +290,7 @@ partial interface Document {
// nsIDOMDocumentTouch
// XXXbz I can't find the sane spec for this stuff, so just cribbing
// from our xpidl for now.
[Creator, Func="nsGenericHTMLElement::TouchEventsEnabled"]
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
Touch createTouch(optional Window? view = null,
optional EventTarget? target = null,
optional long identifier = 0,
@ -308,14 +308,14 @@ partial interface Document {
// distinguishing arguments yet. Once this hack is removed. we can also
// remove the corresponding overload on nsIDocument, since Touch... and
// sequence<Touch> look the same in the C++.
[Creator, Func="nsGenericHTMLElement::TouchEventsEnabled"]
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
TouchList createTouchList(Touch touch, Touch... touches);
// XXXbz and another hack for the fact that we can't usefully have optional
// distinguishing arguments but need a working zero-arg form of
// createTouchList().
[Creator, Func="nsGenericHTMLElement::TouchEventsEnabled"]
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
TouchList createTouchList();
[Creator, Func="nsGenericHTMLElement::TouchEventsEnabled"]
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
TouchList createTouchList(sequence<Touch> touches);
[ChromeOnly]

View File

@ -30,7 +30,7 @@ interface HTMLMediaElement : HTMLElement {
readonly attribute unsigned short networkState;
[SetterThrows]
attribute DOMString preload;
[Creator]
[NewObject]
readonly attribute TimeRanges buffered;
void load();
DOMString canPlayType(DOMString type);
@ -55,9 +55,9 @@ interface HTMLMediaElement : HTMLElement {
attribute double defaultPlaybackRate;
[SetterThrows]
attribute double playbackRate;
[Creator]
[NewObject]
readonly attribute TimeRanges played;
[Creator]
[NewObject]
readonly attribute TimeRanges seekable;
readonly attribute boolean ended;
[SetterThrows]

View File

@ -48,6 +48,6 @@ partial interface HTMLVideoElement {
// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
partial interface HTMLVideoElement {
[Pref="media.mediasource.enabled", Creator]
[Pref="media.mediasource.enabled", NewObject]
VideoPlaybackQuality getVideoPlaybackQuality();
};

View File

@ -18,12 +18,12 @@ interface IDBKeyRange {
readonly attribute boolean lowerOpen;
[Constant]
readonly attribute boolean upperOpen;
[Creator, Throws]
[NewObject, Throws]
static IDBKeyRange only (any value);
[Creator, Throws]
[NewObject, Throws]
static IDBKeyRange lowerBound (any lower, optional boolean open = false);
[Creator, Throws]
[NewObject, Throws]
static IDBKeyRange upperBound (any upper, optional boolean open = false);
[Creator, Throws]
[NewObject, Throws]
static IDBKeyRange bound (any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
};

View File

@ -28,7 +28,7 @@ interface MediaSource : EventTarget {
readonly attribute MediaSourceReadyState readyState;
[SetterThrows]
attribute unrestricted double duration;
[Creator, Throws]
[NewObject, Throws]
SourceBuffer addSourceBuffer(DOMString type);
[Throws]
void removeSourceBuffer(SourceBuffer sourceBuffer);

View File

@ -111,7 +111,7 @@ Navigator implements NavigatorBattery;
// https://wiki.mozilla.org/WebAPI/DataStore
[NoInterfaceObject]
interface NavigatorDataStore {
[Throws, Creator, Pref="dom.datastore.enabled"]
[Throws, NewObject, Pref="dom.datastore.enabled"]
Promise getDataStores(DOMString name);
};
Navigator implements NavigatorDataStore;

View File

@ -22,15 +22,15 @@ interface Promise {
// the proto of a promise object or someone screws up and manages to create a
// Promise object in this scope without having resolved the interface object
// first.
[Creator, Throws, Func="mozilla::dom::Promise::EnabledForScope"]
[NewObject, Throws, Func="mozilla::dom::Promise::EnabledForScope"]
static Promise resolve(any value); // same as any(value)
[Creator, Throws, Func="mozilla::dom::Promise::EnabledForScope"]
[NewObject, Throws, Func="mozilla::dom::Promise::EnabledForScope"]
static Promise reject(any value);
[Creator]
[NewObject]
Promise then([TreatUndefinedAs=Missing] optional AnyCallback fulfillCallback,
[TreatUndefinedAs=Missing] optional AnyCallback rejectCallback);
[Creator]
[NewObject]
Promise catch([TreatUndefinedAs=Missing] optional AnyCallback rejectCallback);
};

View File

@ -16,7 +16,7 @@ interface SVGGraphicsElement : SVGElement {
readonly attribute SVGElement? nearestViewportElement;
readonly attribute SVGElement? farthestViewportElement;
[Creator, Throws]
[NewObject, Throws]
SVGRect getBBox();
// Not implemented
// SVGRect getStrokeBBox();

View File

@ -25,27 +25,27 @@ interface SVGMatrix {
[SetterThrows]
attribute float f;
[Creator]
[NewObject]
SVGMatrix multiply(SVGMatrix secondMatrix);
[Creator, Throws]
[NewObject, Throws]
SVGMatrix inverse();
[Creator]
[NewObject]
SVGMatrix translate(float x, float y);
[Creator]
[NewObject]
SVGMatrix scale(float scaleFactor);
[Creator]
[NewObject]
SVGMatrix scaleNonUniform(float scaleFactorX, float scaleFactorY);
[Creator]
[NewObject]
SVGMatrix rotate(float angle);
[Creator, Throws]
[NewObject, Throws]
SVGMatrix rotateFromVector(float x, float y);
[Creator]
[NewObject]
SVGMatrix flipX();
[Creator]
[NewObject]
SVGMatrix flipY();
[Creator, Throws]
[NewObject, Throws]
SVGMatrix skewX(float angle);
[Creator, Throws]
[NewObject, Throws]
SVGMatrix skewY(float angle);
};

View File

@ -15,46 +15,46 @@ interface SVGPathElement : SVGGraphicsElement {
[Throws]
float getTotalLength();
[Creator, Throws]
[NewObject, Throws]
SVGPoint getPointAtLength(float distance);
unsigned long getPathSegAtLength(float distance);
[Creator]
[NewObject]
SVGPathSegClosePath createSVGPathSegClosePath();
[Creator]
[NewObject]
SVGPathSegMovetoAbs createSVGPathSegMovetoAbs(float x, float y);
[Creator]
[NewObject]
SVGPathSegMovetoRel createSVGPathSegMovetoRel(float x, float y);
[Creator]
[NewObject]
SVGPathSegLinetoAbs createSVGPathSegLinetoAbs(float x, float y);
[Creator]
[NewObject]
SVGPathSegLinetoRel createSVGPathSegLinetoRel(float x, float y);
[Creator]
[NewObject]
SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2);
[Creator]
[NewObject]
SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2);
[Creator]
[NewObject]
SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1);
[Creator]
[NewObject]
SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1);
[Creator]
[NewObject]
SVGPathSegArcAbs createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag);
[Creator]
[NewObject]
SVGPathSegArcRel createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag);
[Creator]
[NewObject]
SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs(float x);
[Creator]
[NewObject]
SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel(float x);
[Creator]
[NewObject]
SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs(float y);
[Creator]
[NewObject]
SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel(float y);
[Creator]
[NewObject]
SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2);
[Creator]
[NewObject]
SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2);
[Creator]
[NewObject]
SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
[Creator]
[NewObject]
SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
};

View File

@ -17,7 +17,7 @@ interface SVGPoint {
[SetterThrows]
attribute float y;
[Creator]
[NewObject]
SVGPoint matrixTransform(SVGMatrix matrix);
};

View File

@ -43,21 +43,21 @@ interface SVGSVGElement : SVGGraphicsElement {
// boolean checkIntersection(SVGElement element, SVGRect rect);
// boolean checkEnclosure(SVGElement element, SVGRect rect);
void deselectAll();
[Creator]
[NewObject]
SVGNumber createSVGNumber();
[Creator]
[NewObject]
SVGLength createSVGLength();
[Creator]
[NewObject]
SVGAngle createSVGAngle();
[Creator]
[NewObject]
SVGPoint createSVGPoint();
[Creator]
[NewObject]
SVGMatrix createSVGMatrix();
[Creator]
[NewObject]
SVGRect createSVGRect();
[Creator]
[NewObject]
SVGTransform createSVGTransform();
[Creator]
[NewObject]
SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
[Throws]
Element? getElementById(DOMString elementId);

View File

@ -28,7 +28,7 @@ interface SVGTextContentElement : SVGGraphicsElement {
SVGPoint getStartPositionOfChar(unsigned long charnum);
[Throws]
SVGPoint getEndPositionOfChar(unsigned long charnum);
[Creator, Throws]
[NewObject, Throws]
SVGRect getExtentOfChar(unsigned long charnum);
[Throws]
float getRotationOfChar(unsigned long charnum);

View File

@ -20,7 +20,7 @@ interface SourceBuffer : EventTarget {
[SetterThrows]
attribute SourceBufferAppendMode mode;
readonly attribute boolean updating;
[Creator, Throws]
[NewObject, Throws]
readonly attribute TimeRanges buffered;
[SetterThrows]
attribute double timestampOffset;

View File

@ -589,9 +589,9 @@ interface WebGLRenderingContext {
void generateMipmap(GLenum target);
[Creator]
[NewObject]
WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index);
[Creator]
[NewObject]
WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index);
sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);
@ -612,7 +612,7 @@ interface WebGLRenderingContext {
any getRenderbufferParameter(GLenum target, GLenum pname);
any getShaderParameter(WebGLShader? shader, GLenum pname);
[Creator]
[NewObject]
WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
DOMString? getShaderInfoLog(WebGLShader? shader);
@ -624,7 +624,7 @@ interface WebGLRenderingContext {
[Throws]
any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
[Creator]
[NewObject]
WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name);
[Throws]

View File

@ -11,10 +11,10 @@ interface XPathResult;
[Constructor]
interface XPathEvaluator {
// Based on nsIDOMXPathEvaluator
[Creator, Throws]
[NewObject, Throws]
XPathExpression createExpression(DOMString expression,
XPathNSResolver? resolver);
[Creator, Throws]
[NewObject, Throws]
XPathNSResolver createNSResolver(Node? nodeResolver);
[Throws]
XPathResult evaluate(DOMString expression, Node? contextNode,