-
Notifications
You must be signed in to change notification settings - Fork 297
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
moveBefore() cosmetic concerns #1335
Comments
I think that treating |
I'm not sure, but my impression of |
For For returning a node: I feel somewhat strongly that we shouldn't introduce new methods that return information already known to the caller. It prevents us from returning new information in the future. For the name: I can't think of a better name. |
I don't feel strongly about it, happy to hear from others.
Likewise. I think it's ok to keep the name. |
Not using I only feel a little strongly about whether we return the node operated on or not. Personally I prefer as much consistency with |
We should probably close this issue as part of the commit message of the PR. That makes it easier to find it in the future. As "pre-move" is now gone, I think "ensure pre-move validity" can be folded into "move". This also reminded me that "ensure pre-insert validity" is not the only algorithm we have that concerns itself with those things. It's just the only one that's abstracted (and it has reason to be abstracted). https://dom.spec.whatwg.org/#concept-node-replace has a similar set of steps. I don't think there's any room for reasonable abstracting between these three sets, so we probably have to live with the duplication. And separately it seems some notes should be fixed, such as "The above statements differ from the pre-insert algorithm." which wants to point at "ensure pre-insert validity" today. |
Done! (by linking to the issue from "Closes" in the PR OP).
OK. I've folded them into the move algorithm (i.e., not directly into the
I see. I guess we can fix this up separately, since that's in the replace algorithm and unrelated to the move before PR? Either way, I think we're ready for a re-review! |
See discussion in whatwg/dom#1335. [email protected] Bug: 40150299 Change-Id: I50aeafb913abb4b63480be4532254f367abf37b7
See discussion in whatwg/dom#1335. [email protected] Bug: 40150299 Change-Id: I50aeafb913abb4b63480be4532254f367abf37b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6097561 Reviewed-by: Noam Rosenthal <[email protected]> Commit-Queue: Dominic Farolino <[email protected]> Cr-Commit-Position: refs/heads/main@{#1397950}
See discussion in whatwg/dom#1335. [email protected] Bug: 40150299 Change-Id: I50aeafb913abb4b63480be4532254f367abf37b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6097561 Reviewed-by: Noam Rosenthal <[email protected]> Commit-Queue: Dominic Farolino <[email protected]> Cr-Commit-Position: refs/heads/main@{#1397950}
See discussion in whatwg/dom#1335. [email protected] Bug: 40150299 Change-Id: I50aeafb913abb4b63480be4532254f367abf37b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6097561 Reviewed-by: Noam Rosenthal <[email protected]> Commit-Queue: Dominic Farolino <[email protected]> Cr-Commit-Position: refs/heads/main@{#1397950}
…, a=testonly Automatic update from web-platform-tests DOM: Move moveBefore() returns undefined See discussion in whatwg/dom#1335. [email protected] Bug: 40150299 Change-Id: I50aeafb913abb4b63480be4532254f367abf37b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6097561 Reviewed-by: Noam Rosenthal <[email protected]> Commit-Queue: Dominic Farolino <[email protected]> Cr-Commit-Position: refs/heads/main@{#1397950} -- wpt-commits: 37cad0c49e62655850799c6f6ee165b3ceacebdd wpt-pr: 49758
While addressing some more nits in #1307 I realized that
moveBefore()
returning a node is a pattern we generally don't follow for new APIs: w3ctag/design-principles#286.I'm not sure if that deviates it enough from
insertBefore()
to warrant a new name.I'm also wondering if it should be
[Unscopable]
. I think we generally agreed to do that for new APIs, but it's been hit or miss as to whether we remember. E.g.,getRootNode()
does not have this. (This is probably why it should have been an inverted flag from the beginning.)cc @domfarolino @noamr @domenic @smaug----
The text was updated successfully, but these errors were encountered: