Cloning a node does not return an exact copy
See original GitHub issueWe need to change node#clone
to produce an exact copy of a node. Otherwise plugin authors are going to keep extracting out what should be parser methods into their own repositories (https://github.com/ben-eb/postcss-merge-rules/blob/master/lib/clone.js, https://github.com/postcss/autoprefixer-core/blob/master/lib/prefixer.coffee#L6-L21), or worse, not realising that:
String(node) !== String(node.clone())
Please, let’s end this fragmentation.
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
select - Javascript clone node is not copying all values from ...
Just imagine an ordinary object being cloned. Expectation would be that the new object would be an exact copy of the source, but...
Read more >Node.cloneNode() - Web APIs - MDN Web Docs
Cloning a node copies all of its attributes and their values, including intrinsic (inline) listeners. It does not copy event listeners added ...
Read more >Node.cloneNode( ): duplicate a node and, optionally, all of its ...
The cloneNode( ) method makes and returns a copy of the node on which it is called. If passed the argument true ,...
Read more >3 Ways to Clone Objects in JavaScript | SamanthaMing.com
Because objects in JavaScript are references values, you can't simply just copy using the = . But no worries, here are 3 ways...
Read more >CloneNode() method in JavaScript? - Tutorialspoint
It continuously clones all of the node's children if the parameter is true. If not, it simply copies the node itself and not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done b84cdb1
@ben-eb maybe we should release 6.0 in next week? Remove deprecated code and fix
clone
?