-
Notifications
You must be signed in to change notification settings - Fork 789
[cssom-view-1] Define OpaqueRange geometry APIs (getClientRects/getBoundingClientRect) #12904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
stephanieyzhang
wants to merge
6
commits into
w3c:main
Choose a base branch
from
stephanieyzhang:stzhang/fcr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+45
−0
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d4a94e8
initial changes
stephanieyzhang 09c8acb
updates
stephanieyzhang fd9d120
remove unnecessary sections and add links
stephanieyzhang 898a78e
Update Overview.bs
stephanieyzhang ea8961d
rename to OpaqueRange + cleanup formatting
stephanieyzhang 48b2cab
Merge branch 'main' into stzhang/fcr
stephanieyzhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| </pre> | ||
|
|
||
| <style> | ||
|
|
@@ -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 | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incorporate internal node containers