w3c / staticrange Goto Github PK
View Code? Open in Web Editor NEWMoved to https://dom.spec.whatwg.org/
Moved to https://dom.spec.whatwg.org/
This is a call for consensus on the proposition
The WebPlatform Working Group will publish a First Public Working Draft of Static Range based on the current spec.
Please respond before the end of Sunday 3 December.
Positive response is preferred (you can leave a "thumbs-up" on this comment"), silence will be taken as assent to the proposal, negative response should be acocmpanied by rationale - e.g. as a reply to htis comment.
From @bzbarsky on April 13, 2017 16:8
Things like:
If sr’s startOffset is greater than the size of the startContainer,
Presumably it means "the number of children of the startContainer". That's the terminology other specs use for this.
Copied from original issue: garykac/staticrange#7
DOM now has https://dom.spec.whatwg.org/#interface-staticrange
If that replaces this spec, should be be redirected?
From @bzbarsky on April 13, 2017 16:7
The step is:
If sr’s startOffset is less than 0 or sr’s endOffset is less than 0,
Offsets are unsigned, so they can't be less than 0.
Copied from original issue: garykac/staticrange#6
From @bzbarsky on April 13, 2017 16:14
This language is used in the "is less than" operation. What you probably want to use instead is https://dom.spec.whatwg.org/#concept-tree-preceding complete with link.
Copied from original issue: garykac/staticrange#10
Would you like time to update the WebPlat WG on this spec and/or discuss any relevant topics at TPAC? We have space on the WebPlat agenda on Thursday and Friday of TPAC week.
If yes, could you estimate the time you'd like/need (in 30 minute blocks)? Thanks
Per discussion in #2, we should throw rather than try to fix up invalid ranges.
With the changes made in #8 clarifying what https://w3c.github.io/staticrange/#staticrange-position-is-less-than does, I can now evaluate what https://w3c.github.io/staticrange/#staticrange-is-valid is doing. Consider a StaticRange whose endpoints are not in the same DOM tree. "sr’s end position is less than sr’s start position" will test false, because https://dom.spec.whatwg.org/#concept-tree-preceding returns false in this case. So the "is valid" algorithm will return true. This doesn't seem right.
From @choniong on May 5, 2016 15:6
According to the StaticRange.idl I found (not sure if that's the latest one) there are some duplicate methods with Range.
See @dtapuska comments below, do we still want to make it
interface Range : StaticRange
?BTW would it be better to have the an idl inside this explainer?
Here is the idl garykac/staticrange#2 (comment)
Copied from original issue: garykac/staticrange#1
From @bzbarsky on April 13, 2017 16:10
Step 5 says:
If sr’s collapsed is not equal to the result of calling is collapsed with sr,
But the return value of "collapsed" is defined to be the result of executing "is collapsed". So the two booleans are always the same, by definition...
Copied from original issue: garykac/staticrange#8
From @choniong on May 5, 2016 15:15
Also According to the StaticRange.idl I found there is an empty Constructor.
But since StaticRange is immutable shouldn't the constructor be something like Constructor(optional StaticRangeInit)
or Constructor(Node, unsigned long, Node, unsigned long)
?
Copied from original issue: garykac/staticrange#2
From @foolip on April 10, 2017 7:33
It's now immutable, but could still have a constructor:
dictionary StaticRangeInit {
required Node startContainer;
required unsigned long startOffset;
required Node endContainer;
required unsigned long endOffset;
};
[Constructor(StaticRangeInit initDict)]
interface StaticRange { ... };
If there's no use for invalid ranges, then it could throw if http://garykac.github.io/staticrange/index.html#to-is-valid does not hold.
Copied from original issue: garykac/staticrange#5
Needed for whatwg/webidl#365.
From @bzbarsky on April 13, 2017 16:13
The draft says:
Any StaticRange that is generated by the user agent MUST be valid.
But what does that mean in practice? What are black-box circumstances where one could tell that this constraint is violated? I haven't been able to come up with any off the top of my head so far...
Copied from original issue: garykac/staticrange#9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.