choojs / nanomorph

🚅 - Hyper fast diffing algorithm for real DOM nodes
MIT License
726 stars 58 forks source link

[bug] copyAttributeNS only works on DOM nodes created with min-document #38

Closed yoshuawuyts closed 7 years ago

yoshuawuyts commented 7 years ago
  var newAttrs = newNode._attributes
  var oldAttrs = oldNode._attributes
  var mergedAttrs = xtend(newAttrs, oldAttrs)

The _attributes value only exists on DOM nodes created with min-document / bel which is fine - but once we use yo-yoify or native DOM nodes this'll break down.

yoshuawuyts commented 7 years ago

.attributes should be available on DOM nodes in the browser, although it doesn't quite appear to be the same; it's a weird enumerable thing I think

yoshuawuyts commented 7 years ago

We might need to run both Node and browser tests for this one; possibly using https://github.com/juliangruber/tape-run. Not stoked about it, but yeah if implementations are different then we shouldn't risk it imo

kristoferjoseph commented 7 years ago

This hasn't been an issue for me because initial renders are made server-side.

A test case where this would break is creating a xlink:href dynamically in the browser. I'll add that with the tape-run test.

yoshuawuyts commented 7 years ago

neato!

On Tue, Jan 24, 2017 at 7:13 AM kj notifications@github.com wrote:

This hasn't been an issue for me because initial renders are made server-side.

A test case where this would break is creating a xlink:href dynamically in the browser. I'll add that with the tape-run test.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yoshuawuyts/nanomorph/issues/38#issuecomment-274718938, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlesDISbZGXOotRn4L-Xikfl-Ywq2iks5rVZaFgaJpZM4Lruj8 .