diff --git a/dom.bs b/dom.bs index 6dd773de..e0491282 100644 --- a/dom.bs +++ b/dom.bs @@ -4121,7 +4121,7 @@ dictionary MutationObserverInit { or omitted. -
observer . {{disconnect()}}
+ observer . {{MutationObserver/disconnect()}}
[Exposed=Window]
interface AbstractRange {
- readonly attribute Node startContainer;
+ readonly attribute Node? startContainer;
readonly attribute unsigned long startOffset;
- readonly attribute Node endContainer;
+ readonly attribute Node? endContainer;
readonly attribute unsigned long endOffset;
readonly attribute boolean collapsed;
};
@@ -8688,6 +8688,12 @@ interface AbstractRange {
start and
end.
+A range has an associated is
+opaque boolean, initially false.
+
+
{{OpaqueRange}} objects have is opaque set to true; when it is true,
+the {{AbstractRange/startContainer}} and {{AbstractRange/endContainer}} getters return null.
+
For convenience, a range's
start node is its start's
node, its
@@ -8698,6 +8704,11 @@ interface AbstractRange {
end offset is its end's
offset.
+
A range has an associated is opaque
+flag, initially false. When true, the {{AbstractRange/startContainer}} and
+{{AbstractRange/endContainer}} getters return null. Only {{OpaqueRange}} objects have this flag set
+to true.
+
A range is collapsed if its start node is its
end node and its start offset is its end offset.
@@ -8723,7 +8734,8 @@ interface AbstractRange {
The
startContainer
-getter steps are to return this's start node.
+getter steps are to return null if this's is opaque flag is true; otherwise
+this's start node.
@@ -8733,7 +8745,8 @@ getter steps are to return this's start offset.
The endContainer
-getter steps are to return this's end node.
+getter steps are to return null if this's is opaque flag is true; otherwise
+this's end node.
@@ -9982,6 +9995,96 @@ and {{Range/getBoundingClientRect()}} methods are defined in other specification
[[CSSOM-VIEW]]
+Interface {{OpaqueRange}}
+
+
+[Exposed=Window]
+interface OpaqueRange : AbstractRange {
+ undefined disconnect();
+ DOMRectList getClientRects();
+ DOMRect getBoundingClientRect();
+};
+
+
+Objects implementing the {{OpaqueRange}} interface are known as {{OpaqueRange}} objects.
+{{OpaqueRange}} objects cannot be constructed directly; they are created by specifications defining
+elements that support opaque ranges.
+
+
An {{OpaqueRange}} has an
+associated element (an {{Element}} or null), initially null. It is
+set by the specification that creates the {{OpaqueRange}}.
+
+
+ range . {{OpaqueRange/disconnect()}}
+ - Disconnects the range from its element and stops live updates. Afterwards, the range's
+ {{AbstractRange/startOffset}} and {{AbstractRange/endOffset}} are 0, and
+ {{OpaqueRange/getClientRects()}} and {{OpaqueRange/getBoundingClientRect()}} return empty results.
+ Calling this method on a range that is already disconnected has no effect.
+
+
rects = range . {{OpaqueRange/getClientRects()}}
+ - Returns a {{DOMRectList}} of client rectangles that enclose the selected portion of the range.
+ If the user agent cannot compute geometry for the range (e.g. because the element it was created
+ from is not connected or has computed
display of none), or if the
+ range is {{AbstractRange/collapsed}} with no visible caret, returns an empty list.
+
+ rect = range . {{OpaqueRange/getBoundingClientRect()}}
+ - Returns a {{DOMRect}} that is the union of the rectangles from
+ {{OpaqueRange/getClientRects()}}. For a {{AbstractRange/collapsed}} range with a visible caret,
+ returns a rectangle of zero width whose height equals the line height at the caret position. If
+ the user agent cannot compute geometry for the range (e.g. because the element it was created
+ from is not connected or has computed
display of none), returns
+ a rectangle with zero width and height.
+
+
+
+The disconnect() method steps are:
+
+
+ Let element be this's associated element.
+
+
-
+
If element is not null:
+
+
+ Run the opaque range disconnect steps given element and this.
+
+
Set this's associated element to null.
+
+
+ Set this's start offset to 0.
+
+
Set this's end offset to 0.
+
+
+
+The {{OpaqueRange/getClientRects()}} and {{OpaqueRange/getBoundingClientRect()}} methods are
+defined in [[CSSOM-VIEW]].
+
+
An {{OpaqueRange}} is a range whose is opaque flag is true.
+
+
An {{Element}}
+supports opaque ranges if its specification defines that
+it does. In HTML, this includes certain {{HTMLInputElement}} types and {{HTMLTextAreaElement}}.
+
+
Other specifications can designate additional elements, including custom elements.
+
+
An {{OpaqueRange}} is live, meaning its offsets are automatically updated when the underlying
+content changes. Specifications that define elements supporting opaque ranges must specify:
+
+
+ the internal container nodes used,
+
+
how {{OpaqueRange}} objects are created and detached, and
+
+
opaque range update steps to run when the underlying content changes
+ (e.g., when text is inserted or deleted). These steps should adjust offsets following the same
+ principles as the live range adjustments in the insert, remove,
+ replace data, and split algorithms.
+
+
opaque range disconnect steps, given an element and an
+ {{OpaqueRange}}, to run when {{OpaqueRange/disconnect()}} is called.
+
+
Traversal