-
Notifications
You must be signed in to change notification settings - Fork 300
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
Add AbstractRange and StaticRange #589
Conversation
Given that there's no constructor I think the IDL test changes are sufficient. The other bits would need to be tested as part of https://w3c.github.io/input-events/index.html and other producers of these objects. So this is ready to land after review. |
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.
Things seem pretty good, although I wonder if there should be more explaining about how non-live ranges don't really obey the mental model you might expect? E.g. the note at https://whatpr.org/dom/589.html#boundary-points is not accurate for them, and https://whatpr.org/dom/589.html#introduction-to-dom-ranges might want to talk about a static range behaves or something, I dunno.
dom.bs
Outdated
@@ -3650,7 +3605,7 @@ be initialized to null. | |||
|
|||
<h4 id=garbage-collection>Garbage collection</h4> | |||
|
|||
<a>Nodes</a> have a strong reference to | |||
<a for=/>nodes</a> have a strong reference to |
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.
Should stay uppercase
dom.bs
Outdated
@@ -936,8 +936,8 @@ fields above, an <a>event listener</a> is a broader concept. | |||
which takes an <a>event</a> <var>event</var>, and returns an {{EventTarget}} object. Unless | |||
specified otherwise it returns null. | |||
|
|||
<p class="note no-backref"><a>Nodes</a>, <a for=/>shadow roots</a>, and <a>documents</a> override | |||
the <a>get the parent</a> algorithm. | |||
<p class="note no-backref"><a for=/>nodes</a>, <a for=/>shadow roots</a>, and <a>documents</a> |
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.
Should stay upppercase
dom.bs
Outdated
</ol> | ||
<p>A <a for=/>node</a> is | ||
<dfn export for="live range" id=partially-contained>partially contained</dfn> in a <a>live range</a> | ||
if its an <a for=tree>inclusive ancestor</a> of the <a>live range</a>'s <a for=range>start node</a> |
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.
"its" should be "it is" here
dom.bs
Outdated
@@ -9844,7 +9711,7 @@ These are the changes made to the features described in | |||
|
|||
{{Node}} now inherits from {{EventTarget}}. | |||
|
|||
<a>Nodes</a> are implicitly | |||
<a for=/>nodes</a> are implicitly |
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.
Should still be uppercase
dom.bs
Outdated
@@ -8896,29 +8763,29 @@ these steps: | |||
<ol> | |||
<li>Let <var>s</var> be the empty string. |
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.
This whole algorithm just says "start node" and "end node" a lot but should probably say "the context object's start node"/end node.
(Preexisting problem, though.)
This refactors large parts of the DOM Standard to reclassify Range objects as "live ranges" rather than "ranges". The bits shared between StaticRange and Range objects are put on a shared superclass named AbstractRange. This also introduces a "collapsed" definition and uses it throughout. It does not contain everything from https://w3c.github.io/staticrange/. I based this draft on the IDL present in implementations, coupled with the desire for a superclass. Extensions beyond this seem best addressed as follow-ups. Tests: ...
b3b2950
to
627ccf1
Compare
Yeah, I was thinking there should be more of an introduction at some point. But I'm not sure it makes much sense without the constructor as only input events can create these objects now and then I'd have to introduce those as well. I have updated the note to be a little more specific. |
…nge, a=testonly Automatic update from web-platform-testsIDL update for AbstractRange and StaticRange See whatwg/dom#589. -- remove obsolete IDL test wpt-commits: 1c64b7e7f769ac7ab726f4738677168a95d13ab2, 359dac15b0ae6099d47708ff0d3efb8b5bb0db26 wpt-pr: 9967 wpt-commits: 1c64b7e7f769ac7ab726f4738677168a95d13ab2, 359dac15b0ae6099d47708ff0d3efb8b5bb0db26 wpt-pr: 9967
I've just implemented this in Edge. It should be included in EdgeHTML 18 |
…nge, a=testonly Automatic update from web-platform-testsIDL update for AbstractRange and StaticRange See whatwg/dom#589. -- remove obsolete IDL test wpt-commits: 1c64b7e7f769ac7ab726f4738677168a95d13ab2, 359dac15b0ae6099d47708ff0d3efb8b5bb0db26 wpt-pr: 9967 wpt-commits: 1c64b7e7f769ac7ab726f4738677168a95d13ab2, 359dac15b0ae6099d47708ff0d3efb8b5bb0db26 wpt-pr: 9967 UltraBlame original commit: 88ae266890f10214842862a8c0a1f4f512a9f8e6
…nge, a=testonly Automatic update from web-platform-testsIDL update for AbstractRange and StaticRange See whatwg/dom#589. -- remove obsolete IDL test wpt-commits: 1c64b7e7f769ac7ab726f4738677168a95d13ab2, 359dac15b0ae6099d47708ff0d3efb8b5bb0db26 wpt-pr: 9967 wpt-commits: 1c64b7e7f769ac7ab726f4738677168a95d13ab2, 359dac15b0ae6099d47708ff0d3efb8b5bb0db26 wpt-pr: 9967 UltraBlame original commit: 88ae266890f10214842862a8c0a1f4f512a9f8e6
…nge, a=testonly Automatic update from web-platform-testsIDL update for AbstractRange and StaticRange See whatwg/dom#589. -- remove obsolete IDL test wpt-commits: 1c64b7e7f769ac7ab726f4738677168a95d13ab2, 359dac15b0ae6099d47708ff0d3efb8b5bb0db26 wpt-pr: 9967 wpt-commits: 1c64b7e7f769ac7ab726f4738677168a95d13ab2, 359dac15b0ae6099d47708ff0d3efb8b5bb0db26 wpt-pr: 9967 UltraBlame original commit: 88ae266890f10214842862a8c0a1f4f512a9f8e6
This refactors large parts of the DOM Standard to reclassify Range
objects as "live ranges" rather than "ranges". The bits shared
between StaticRange and Range objects are put on a shared superclass
named AbstractRange.
This also introduces a "collapsed" definition and uses it throughout.
It does not contain everything from
https://w3c.github.io/staticrange/. I based this draft on the IDL
present in implementations, coupled with the desire for a superclass.
Extensions beyond this seem best addressed as follow-ups.
Tests: ...
Preview | Diff