Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions cssom-view-1/Overview.bs
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorporate internal node containers

Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:cssom-view-1; type:dfn; for:MediaQueryList; text:media
spec:webdriver-bidi; type:dfn;
text:WebDriver BiDi emulated available screen area
text:WebDriver BiDi emulated total screen area
spec:dom; type:interface; text:OpaqueRange
spec:dom; type:dfn; text:opaque range string
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

</pre>

<style>
Expand Down Expand Up @@ -2081,6 +2083,49 @@ Note: The {{DOMRect}} object returned by {{Range/getBoundingClientRect()}} is no
range-bounding-client-rect-with-display-contents.html
</wpt>

<h2 id=extensions-to-the-opaquerange-interface>Extensions to the {{OpaqueRange}} Interface</h2>

This section defines {{OpaqueRange/getClientRects()}} and {{OpaqueRange/getBoundingClientRect()}} for
{{OpaqueRange}}. These mirror {{Range}}'s {{Range/getClientRects()}} and
{{Range/getBoundingClientRect()}}, but operate over the selected portion of the opaque range string
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

(as defined by the relevant specification for the element the range was created from), as rendered.

The <dfn method for=OpaqueRange>getClientRects()</dfn> method, when invoked, must run these steps:

1. Let <var>element</var> be the element the range was created from.
1. If the user agent cannot compute geometry for the range (e.g. because <var>element</var> is not
<a>connected</a> or its computed <code>display</code> is <code>none</code>), return an empty
{{DOMRectList}}.
1. Update style and layout for <var>element</var>.
1. Let <var>start</var> be <a>this</a>'s <a for=OpaqueRange>start offset</a>, and let <var>end</var>
be <a>this</a>'s <a for=OpaqueRange>end offset</a>.
1. If <var>start</var> equals <var>end</var>, then:
1. If no visible caret would be rendered for <var>element</var> at offset <var>start</var>,
return an empty {{DOMRectList}}.
1. Return a {{DOMRectList}} containing a single {{DOMRect}} describing the caret rectangle for
<var>element</var> at offset <var>start</var>.
1. Return a {{DOMRectList}} containing the client rectangles that enclose the rendered text
corresponding to the substring of <var>element</var>'s <a>opaque range string</a> starting at
<var>start</var> (inclusive) and ending at <var>end</var> (exclusive).

The <dfn method for=OpaqueRange>getBoundingClientRect()</dfn> method, when invoked, must return the
result of the following algorithm:

1. Let <var>list</var> be the result of invoking {{OpaqueRange/getClientRects()}} on the same range
this method was invoked on.
1. If <var>list</var> is empty return a {{DOMRect}} object whose {{DOMRect/x}}, {{DOMRect/y}},
{{DOMRect/width}} and {{DOMRect/height}} members are zero.
1. If all rectangles in <var>list</var> have zero width or height, return the first rectangle in
<var>list</var>.
1. Otherwise, return a {{DOMRect}} object describing the smallest rectangle that includes all of the
rectangles in <var>list</var> of which the height or width is not zero.

<wpt>
OpaqueRange-geometry-basic.html
OpaqueRange-geometry-complexity-and-visibility.html
OpaqueRange-geometry-multiline-and-mutations.html
</wpt>

<h2 id=extensions-to-the-mouseevent-interface>Extensions to the {{MouseEvent}} Interface</h2>

Issue: The object IDL fragment redefines some members. Can we resolve this somehow?
Expand Down