Skip to content

Commit

Permalink
Merge pull request rustwasm#709 from fitzgen/webidl-and-logging
Browse files Browse the repository at this point in the history
Webidl and logging
  • Loading branch information
fitzgen authored Aug 15, 2018
2 parents 190b45d + ea137a9 commit 13fe2b4
Show file tree
Hide file tree
Showing 45 changed files with 60 additions and 1,846 deletions.
33 changes: 0 additions & 33 deletions crates/web-sys/webidls/enabled/BoxObject.webidl

This file was deleted.

16 changes: 0 additions & 16 deletions crates/web-sys/webidls/enabled/CanvasRenderingContext2D.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@ interface CanvasRenderingContext2D {
// associated with a canvas.
readonly attribute HTMLCanvasElement? canvas;

// Mozilla-specific stuff
// FIXME Bug 768048 mozCurrentTransform/mozCurrentTransformInverse should return a WebIDL array.
[Throws]
attribute object mozCurrentTransform; // [ m11, m12, m21, m22, dx, dy ], i.e. row major
[Throws]
attribute object mozCurrentTransformInverse;

[SetterThrows]
attribute DOMString mozTextStyle;

// image smoothing mode -- if disabled, images won't be smoothed
// if scaled.
[Deprecated="PrefixedImageSmoothingEnabled"]
attribute boolean mozImageSmoothingEnabled;

// Show the caret if appropriate when drawing
[Func="CanvasUtils::HasDrawWindowPrivilege"]
const unsigned long DRAWWINDOW_DRAW_CARET = 0x01;
Expand Down Expand Up @@ -140,7 +125,6 @@ CanvasRenderingContext2D implements CanvasTextDrawingStyles;
CanvasRenderingContext2D implements CanvasPathMethods;
CanvasRenderingContext2D implements CanvasHitRegions;


[NoInterfaceObject]
interface CanvasState {
// state
Expand Down
13 changes: 0 additions & 13 deletions crates/web-sys/webidls/enabled/ChromeNodeList.webidl

This file was deleted.

10 changes: 0 additions & 10 deletions crates/web-sys/webidls/enabled/CommandEvent.webidl

This file was deleted.

10 changes: 0 additions & 10 deletions crates/web-sys/webidls/enabled/DOMParser.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,13 @@ enum SupportedType {
"image/svg+xml"
};

// the latter is Mozilla-specific
[Constructor]
interface DOMParser {
[NewObject, Throws]
Document parseFromString(DOMString str, SupportedType type);

// Mozilla-specific stuff
[NewObject, Throws, ChromeOnly]
Document parseFromBuffer(sequence<octet> buf, SupportedType type);
[NewObject, Throws, ChromeOnly]
Document parseFromBuffer(Uint8Array buf, SupportedType type);
[NewObject, Throws, ChromeOnly]
Document parseFromStream(InputStream stream, DOMString? charset,
long contentLength, SupportedType type);
// Can be used to allow a DOMParser to parse XUL/XBL no matter what
// principal it's using for the document.
[ChromeOnly]
void forceEnableXULXBL();
};

139 changes: 0 additions & 139 deletions crates/web-sys/webidls/enabled/DataTransfer.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -37,142 +37,3 @@ partial interface DataTransfer {
[Throws, Pref="dom.input.dirpicker", NeedsSubjectPrincipal]
Promise<sequence<File>> getFiles(optional boolean recursiveFlag = false);
};

// Mozilla specific stuff
partial interface DataTransfer {
/*
* Set the drag source. Usually you would not change this, but it will
* affect which node the drag and dragend events are fired at. The
* default target is the node that was dragged.
*
* @param element drag source to use
* @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
*/
[Throws, UseCounter]
void addElement(Element element);

/**
* The number of items being dragged.
*/
[UseCounter]
readonly attribute unsigned long mozItemCount;

/**
* Sets the drag cursor state. Primarily used to control the cursor during
* tab drags, but could be expanded to other uses. XXX Currently implemented
* on Win32 only.
*
* Possible values:
* auto - use default system behavior.
* default - set the cursor to an arrow during the drag operation.
*
* Values other than 'default' are indentical to setting mozCursor to
* 'auto'.
*/
[UseCounter]
attribute DOMString mozCursor;

/**
* Holds a list of the format types of the data that is stored for an item
* at the specified index. If the index is not in the range from 0 to
* itemCount - 1, an empty string list is returned.
*/
[Throws, NeedsCallerType, UseCounter]
DOMStringList mozTypesAt(unsigned long index);

/**
* Remove the data associated with the given format for an item at the
* specified index. The index is in the range from zero to itemCount - 1.
*
* If the last format for the item is removed, the entire item is removed,
* reducing the itemCount by one.
*
* If format is empty, then the data associated with all formats is removed.
* If the format is not found, then this method has no effect.
*
* @param format the format to remove
* @throws NS_ERROR_DOM_INDEX_SIZE_ERR if index is greater or equal than itemCount
* @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
*/
[Throws, NeedsSubjectPrincipal, UseCounter]
void mozClearDataAt(DOMString format, unsigned long index);

/*
* A data transfer may store multiple items, each at a given zero-based
* index. setDataAt may only be called with an index argument less than
* itemCount in which case an existing item is modified, or equal to
* itemCount in which case a new item is added, and the itemCount is
* incremented by one.
*
* Data should be added in order of preference, with the most specific
* format added first and the least specific format added last. If data of
* the given format already exists, it is replaced in the same position as
* the old data.
*
* The data should be either a string, a primitive boolean or number type
* (which will be converted into a string) or an nsISupports.
*
* @param format the format to add
* @param data the data to add
* @throws NS_ERROR_NULL_POINTER if the data is null
* @throws NS_ERROR_DOM_INDEX_SIZE_ERR if index is greater than itemCount
* @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
*/
[Throws, NeedsSubjectPrincipal, UseCounter]
void mozSetDataAt(DOMString format, any data, unsigned long index);

/**
* Retrieve the data associated with the given format for an item at the
* specified index, or null if it does not exist. The index should be in the
* range from zero to itemCount - 1.
*
* @param format the format of the data to look up
* @returns the data of the given format, or null if it doesn't exist.
* @throws NS_ERROR_DOM_INDEX_SIZE_ERR if index is greater or equal than itemCount
*/
[Throws, NeedsSubjectPrincipal, UseCounter]
any mozGetDataAt(DOMString format, unsigned long index);

/**
* Update the drag image. Arguments are the same as setDragImage. This is only
* valid within the parent chrome process.
*/
[ChromeOnly]
void updateDragImage(Element image, long x, long y);

/**
* Will be true when the user has cancelled the drag (typically by pressing
* Escape) and when the drag has been cancelled unexpectedly. This will be
* false otherwise, including when the drop has been rejected by its target.
* This property is only relevant for the dragend event.
*/
[UseCounter]
readonly attribute boolean mozUserCancelled;

/**
* The node that the mouse was pressed over to begin the drag. For external
* drags, or if the caller cannot access this node, this will be null.
*/
[UseCounter]
readonly attribute Node? mozSourceNode;

/**
* The URI spec of the triggering principal. This may be different than
* sourceNode's principal when sourceNode is xul:browser and the drag is
* triggered in a browsing context inside it.
*/
[ChromeOnly]
readonly attribute DOMString mozTriggeringPrincipalURISpec;

/**
* Copy the given DataTransfer for the given event. Used by testing code for
* creating emulated Drag and Drop events in the UI.
*
* NOTE: Don't expose a DataTransfer produced with this method to the web or
* use this for non-testing purposes. It can easily be used to get the
* DataTransfer into an invalid state, and is an unstable implementation
* detail of EventUtils.synthesizeDrag.
*/
[Throws, ChromeOnly]
DataTransfer mozCloneForEvent(DOMString event);
};
96 changes: 0 additions & 96 deletions crates/web-sys/webidls/enabled/Document.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,6 @@ partial interface Document {
[Pref="dom.select_events.enabled"]
attribute EventHandler onselectionchange;

/**
* True if this document is synthetic : stand alone image, video, audio file,
* etc.
*/
/*Non standard
[Func="IsChromeOrXBL"] readonly attribute boolean mozSyntheticDocument;
*/
/**
* Returns the script element whose script is currently being processed.
*
Expand Down Expand Up @@ -361,85 +354,6 @@ partial interface Document {
readonly attribute SVGSVGElement? rootElement;
};

// Mozilla extensions of various sorts
partial interface Document {
// XBL support. Wish we could make these [ChromeOnly], but
// that would likely break bindings running with the page principal.
/*Non standard
[Func="IsChromeOrXBL"]
NodeList? getAnonymousNodes(Element elt);
[Func="IsChromeOrXBL"]
Element? getAnonymousElementByAttribute(Element elt, DOMString attrName,
DOMString attrValue);
[Func="IsChromeOrXBL"]
Element? getBindingParent(Node node);
[Throws, Func="IsChromeOrXBL", NeedsSubjectPrincipal]
void loadBindingDocument(DOMString documentURL);
*/

// Touch bits
// XXXbz I can't find the sane spec for this stuff, so just cribbing
// from our xpidl for now.
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
Touch createTouch(optional Window? view = null,
optional EventTarget? target = null,
optional long identifier = 0,
optional long pageX = 0,
optional long pageY = 0,
optional long screenX = 0,
optional long screenY = 0,
optional long clientX = 0,
optional long clientY = 0,
optional long radiusX = 0,
optional long radiusY = 0,
optional float rotationAngle = 0,
optional float force = 0);
// XXXbz a hack to get around the fact that we don't support variadics as
// 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++.
[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().
/*TODO
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
TouchList createTouchList();
[NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
TouchList createTouchList(sequence<Touch> touches);
*/

[ChromeOnly]
attribute boolean styleSheetChangeEventsEnabled;

[ChromeOnly, Throws]
void obsoleteSheet(URI sheetURI);
[ChromeOnly, Throws]
void obsoleteSheet(DOMString sheetURI);

[ChromeOnly] readonly attribute nsIDocShell? docShell;

[ChromeOnly] readonly attribute DOMString contentLanguage;

[ChromeOnly] readonly attribute nsILoadGroup? documentLoadGroup;

// Blocks the initial document parser until the given promise is settled.
[ChromeOnly, Throws]
Promise<any> blockParsing(Promise<any> promise,
optional BlockParsingOptions options);

// like documentURI, except that for error pages, it returns the URI we were
// trying to load when we hit an error, rather than the error page's own URI.
[ChromeOnly] readonly attribute URI? mozDocumentURIIfNotForErrorPages;

// A promise that is resolved, with this document itself, when we have both
// fired DOMContentLoaded and are ready to start layout. This is used for the
// "document_idle" webextension script injection point.
[ChromeOnly, Throws]
readonly attribute Promise<Document> documentReadyForIdle;
};

dictionary BlockParsingOptions {
/**
* If true, blocks script-created parsers (created via document.open()) in
Expand Down Expand Up @@ -507,16 +421,6 @@ partial interface Document {
void notifyUserGestureActivation();
};

// Extension to give chrome and XBL JS the ability to determine whether
// the document is sandboxed without permission to run scripts
// and whether inline scripts are blocked by the document's CSP.
/*Non standard
partial interface Document {
[Func="IsChromeOrXBL"] readonly attribute boolean hasScriptsBlockedBySandbox;
[Func="IsChromeOrXBL"] readonly attribute boolean inlineScriptAllowedByCSP;
};
*/

// For more information on Flash classification, see
// toolkit/components/url-classifier/flash-block-lists.rst
enum FlashClassification {
Expand Down
9 changes: 0 additions & 9 deletions crates/web-sys/webidls/enabled/Element.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,6 @@ partial interface Element {
readonly attribute long clientLeft;
readonly attribute long clientWidth;
readonly attribute long clientHeight;

// Mozilla specific stuff
/* The minimum/maximum offset that the element can be scrolled to
(i.e., the value that scrollLeft/scrollTop would be clamped to if they were
set to arbitrarily large values. */
[ChromeOnly] readonly attribute long scrollTopMin;
readonly attribute long scrollTopMax;
[ChromeOnly] readonly attribute long scrollLeftMin;
readonly attribute long scrollLeftMax;
};

// http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface
Expand Down
Loading

0 comments on commit 13fe2b4

Please sign in to comment.