Files
palemoon27/dom/webidl/Element.webidl
T
roytam1 2ddfe368e1 import changes from `dev' branch of rmottola/Arctic-Fox:
- bug 1215748 - use llvm-dsymutil for mac builds. r=mshal (a217006d89)
- warnings (31ea43d0d8)
- Bug 1175154 - Unit tests for IAC on 3.0. r=ferjm (12c424bab3)
- Bug 1219543 - Part 1: isRunningOnCompositor flag is now a member of AnimationProperty. r=bbirtles (85bc668501)
- Bug 1219543 - Part 2: Avoid the period that mIsRunningOnCompositor is false between restyling and building display list. r=bbirtles (597e46d479)
- Bug 1219543 - Part 3: MutationObserver should disconnect when the test is finished. r=bbirtles (70c26a266e)
- Bug 1214148 - patch 1 - propagation from the nested iframe back to the toplevel iframe, r=alwu (b42002f43a)
- Bug 1214148 - patch 2 - from toplevel iframe to the nested iframe, r=alwu (7b07fe5399)
- Bug 1214148 - patch 3 - correct window for nested iframes, r=alwu (27ee08caf1)
- Bug 1166910 - put referrer attribute behind pref in webidl, r=bz (93e421fa1b)
- Bug 1187357 - rename referrer attribute to referrerpolicy. r=hsivonen (70c67f5def)
- Bug 1187357 - Generated code for renaming referrer to referrerpolicy in html parser. r=hsivonen (738de3f278)
- Bug 1221341. Snap box shadow clip rect to device pixels. r=mstange (b63b783714)
- Bug 1228634 - Implement Element.getAttributeNames, r=peterv (4594d9c14c)
- Bug 1216193. Implement webkitMatchesSelector. r=khuey (39742b7e0b)
- Bug 1134648, handle dynamic changes to rel=dns-prefetch, r=bz (e27638080e)
- Bug 1229962 - use UniquePtr<T[]> instead of nsAutoArrayPtr<T> in parser/html/; r=hsivonen (75de6314f1)
- Bug 1226437 - Speculative CSP should set speculative referrer policy instead of actual referrer policy. r=sicking (f7dfd3fd18)
- Bug 1227554 - Default to NullPrincipal if doc is not available within expatdriver. r=bz (336a562965)
- Bug 1215781 - Use MOZ_UTF16 to generate sTagUnicodeTable. r=mrbkap (eca371a36b)
- Bug 1082598 - Part 5: Fix NPAPI for Skia update. r=jrmuizel (25c4d080ab)
- Bug 1183828 - Remove 'nsWindow::GetNativeData not implemented for this type' warning. r=roc (0a60404b57)
- Bug 1224445 - Add NS_NATIVE_OPENGL_CONTEXT handling to nsWindow::GetNativeData() r=mwu (ee35844be4)
- Bug 1179632 part.1 native IME context should not be stored in InputContext but should be able to retrieve with nsIWidget::GetNativeData() r=smaug (5f1804bb72)
- Bug 1179632 part.2 WidgetCompositionEvent should store NativeIMEContext which caused the event and PuppetWidget should store it for GetNativeIMEContext() r=smaug, sr=smaug (e00ca78e3f)
- Bug 1179632 part.3 TabParent::RecvEndIMEComposition() shouldn't return true with aNoCompositionEvent when there is no widget r=smaug (ee065ed491)
- Bug 1179632 part.4 Clean up the code to request IME to commit composition across process boundary r=smaug (9567c4dc57)
- Bug 1179632 part.5 WidgetCompositionEvent::mNativeIMEContext should be used at looking for a TextComposition instance for a WidgetCompositionEvent r=smaug (f4e27ec28c)
- Bug 1179632 part.6 KeyboardEvent.isComposing shouldn't expose IME state on different document r=smaug (ca8b8a6a02)
- Bug 1227544 - Scaling on 720p devices is broken. r=timdream (cb89af839f)
2023-06-13 15:52:32 +08:00

269 lines
9.0 KiB
Plaintext

/* -*- 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/#element and
* http://domparsing.spec.whatwg.org/ and
* http://dev.w3.org/csswg/cssom-view/ and
* http://www.w3.org/TR/selectors-api/
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface Element : Node {
/*
We haven't moved these from Node to Element like the spec wants.
[Throws]
readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix;
readonly attribute DOMString localName;
*/
// Not [Constant] because it depends on which document we're in
[Pure]
readonly attribute DOMString tagName;
[Pure]
attribute DOMString id;
[Pure]
attribute DOMString className;
[Constant]
readonly attribute DOMTokenList classList;
[SameObject]
readonly attribute NamedNodeMap attributes;
[Pure]
sequence<DOMString> getAttributeNames();
[Pure]
DOMString? getAttribute(DOMString name);
[Pure]
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
[Throws]
boolean toggleAttribute(DOMString name, optional boolean force);
[Throws]
void setAttribute(DOMString name, DOMString value);
[Throws]
void setAttributeNS(DOMString? namespace, DOMString name, DOMString value);
[Throws]
void removeAttribute(DOMString name);
[Throws]
void removeAttributeNS(DOMString? namespace, DOMString localName);
[Pure]
boolean hasAttribute(DOMString name);
[Pure]
boolean hasAttributeNS(DOMString? namespace, DOMString localName);
[Pure]
boolean hasAttributes();
[Throws, Pure]
Element? closest(DOMString selector);
[Throws, Pure]
boolean matches(DOMString selector);
[Throws, Pure, BinaryName="matches"]
boolean webkitMatchesSelector(DOMString selector);
[Pure]
HTMLCollection getElementsByTagName(DOMString localName);
[Throws, Pure]
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
[Pure]
HTMLCollection getElementsByClassName(DOMString classNames);
[Throws, Pure]
Element? insertAdjacentElement(DOMString where, Element element); // historical
[Throws]
void insertAdjacentText(DOMString where, DOMString data); // historical
/**
* The ratio of font-size-inflated text font size to computed font
* size for this element. This will query the element for its primary frame,
* and then use this to get font size inflation information about the frame.
* This will be 1.0 if font size inflation is not enabled, and -1.0 if an
* error occurred during the retrieval of the font size inflation.
*
* @note The font size inflation ratio that is returned is actually the
* font size inflation data for the element's _primary frame_, not the
* element itself, but for most purposes, this should be sufficient.
*/
[ChromeOnly]
readonly attribute float fontSizeInflation;
// Mozilla specific stuff
[Pure]
attribute EventHandler onwheel;
// Selectors API
/**
* Returns whether this element would be selected by the given selector
* string.
*
* See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
*/
[Throws, Pure, BinaryName="matches"]
boolean mozMatchesSelector(DOMString selector);
// Pointer events methods.
[Throws, Pref="dom.w3c_pointer_events.enabled", UnsafeInPrerendering]
void setPointerCapture(long pointerId);
[Throws, Pref="dom.w3c_pointer_events.enabled"]
void releasePointerCapture(long pointerId);
// Proprietary extensions
/**
* Set this during a mousedown event to grab and retarget all mouse events
* to this element until the mouse button is released or releaseCapture is
* called. If retargetToElement is true, then all events are targetted at
* this element. If false, events can also fire at descendants of this
* element.
*
*/
void setCapture(optional boolean retargetToElement = false);
/**
* If this element has captured the mouse, release the capture. If another
* element has captured the mouse, this method has no effect.
*/
void releaseCapture();
// Mozilla extensions
/**
* Requests that this element be made the full-screen element, as per the DOM
* full-screen api.
*
* The options parameter is non-standard. In Gecko, it can be:
* a RequestFullscreenOptions object
*
* @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
*/
[Throws, UnsafeInPrerendering]
void mozRequestFullScreen(optional any options);
/**
* Requests that this element be made the pointer-locked element, as per the DOM
* pointer lock api.
*
* @see <http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html>
*/
[UnsafeInPrerendering]
void mozRequestPointerLock();
// Obsolete methods.
Attr? getAttributeNode(DOMString name);
[Throws]
Attr? setAttributeNode(Attr newAttr);
[Throws]
Attr? removeAttributeNode(Attr oldAttr);
Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
[Throws]
Attr? setAttributeNodeNS(Attr newAttr);
[ChromeOnly]
/**
* Scrolls the element by (dx, dy) CSS pixels without doing any
* layout flushing.
*/
boolean scrollByNoFlush(long dx, long dy);
};
// http://dev.w3.org/csswg/cssom-view/
enum ScrollLogicalPosition { "start", "end" };
dictionary ScrollIntoViewOptions : ScrollOptions {
ScrollLogicalPosition block = "start";
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
partial interface Element {
DOMRectList getClientRects();
DOMRect getBoundingClientRect();
// scrolling
void scrollIntoView(boolean top);
void scrollIntoView(optional ScrollIntoViewOptions options);
// None of the CSSOM attributes are [Pure], because they flush
attribute long scrollTop; // scroll on setting
attribute long scrollLeft; // scroll on setting
readonly attribute long scrollWidth;
readonly attribute long scrollHeight;
void scroll(unrestricted double x, unrestricted double y);
void scroll(optional ScrollToOptions options);
void scrollTo(unrestricted double x, unrestricted double y);
void scrollTo(optional ScrollToOptions options);
void scrollBy(unrestricted double x, unrestricted double y);
void scrollBy(optional ScrollToOptions options);
// mozScrollSnap is used by chrome to perform scroll snapping after the
// user performs actions that may affect scroll position
// mozScrollSnap is deprecated, to be replaced by a web accessible API, such
// as an extension to the ScrollOptions dictionary. See bug 1137937.
[ChromeOnly] void mozScrollSnap();
readonly attribute long clientTop;
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://dvcs.w3.org/hg/undomanager/raw-file/tip/undomanager.html
partial interface Element {
[Pref="dom.undo_manager.enabled"]
readonly attribute UndoManager? undoManager;
[SetterThrows,Pref="dom.undo_manager.enabled"]
attribute boolean undoScope;
};
// http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface
partial interface Element {
[Pure,SetterThrows,TreatNullAs=EmptyString]
attribute DOMString innerHTML;
[Pure,SetterThrows,TreatNullAs=EmptyString]
attribute DOMString outerHTML;
[Throws]
void insertAdjacentHTML(DOMString position, DOMString text);
};
// http://www.w3.org/TR/selectors-api/#interface-definitions
partial interface Element {
[Throws, Pure]
Element? querySelector(DOMString selectors);
[Throws, Pure]
NodeList querySelectorAll(DOMString selectors);
};
// http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-interface
partial interface Element {
[Throws,Func="nsDocument::IsWebComponentsEnabled"]
ShadowRoot createShadowRoot();
[Func="nsDocument::IsWebComponentsEnabled"]
NodeList getDestinationInsertionPoints();
[Func="nsDocument::IsWebComponentsEnabled"]
readonly attribute ShadowRoot? shadowRoot;
};
Element implements ChildNode;
Element implements NonDocumentTypeChildNode;
Element implements ParentNode;
Element implements Animatable;
Element implements GeometryUtils;
// non-standard: allows passing options to Element.requestFullScreen
dictionary RequestFullscreenOptions {
// Which HMDVRDevice to go full screen on; also enables VR rendering.
// If null, normal fullscreen is entered.
HMDVRDevice? vrDisplay = null;
};