-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implement Ranges and Traversal #317
Comments
ugh, that spec made my eyes bleed |
yeah, I'd be pretty afraid to implement it without a w3c test suite |
What I found out so far:
|
This looks promising: https://github.com/w3c/web-platform-tests/tree/master/dom |
Note that those test the "versionless DOM" at http://dom.spec.whatwg.org/ and not level 2 specifically. But, they're more likely to reflect real browsers. |
I’m basically done with the main functionality, but I have quite some problems keeping the ranges live. I need to tap into basically every DOM mutation and I’m not sure about the best way to do that. In some cases I used the mutation events, in other cases I wrapped the corresponding methods on the prototype. Right now I’m wondering about how to do node removal. With |
@adrianlang that's awesome! It seems like this is related to our long-standing desire to move away from using mutation events internally, and instead have a private protocol that can never be disabled. See #295. I know it's a lot to ask, but fixing that might be the way to go for this? |
Spam +1 comments cause features to get moved to the back of the backlog. Please use the voting buttons instead. Deleting the recent +1s. |
I'm still there, btw, as is my half-finished code. I hope to get this done eventually. |
@adrianheine Does the TreeWalker implementation which landed help you get any closer to finishing your implementation? |
Closes half of jsdom#317.
I use sometimes so I ended up doing this for tests global.document.createRange = () => ({
createContextualFragment: str => JSDOM.fragment(str)
}); But all the Range API would be a lot more |
@domenic I think what @acusti was asking is what are the next steps to get this verified? I am trying to use this: Can someone recommend an alternative path? I like the idea of having a highlighted diff and syntax highlighting with Prism. Might even come out better than Github's highlighter. I'd be willing to https://www.patreon.com/ for one more reason to never use SourceTree again. |
@adrianheine I might be interested in helping out if you share your WIP. |
Got errors in jest tests.
Find link here |
Hello, any progress from this? |
When will it be released? So jest could upgrade to the newest version. |
http://www.w3.org/TR/DOM-Level-2-Traversal-Range/We will need to find/write a test suite.
The text was updated successfully, but these errors were encountered: