Coder Social home page Coder Social logo

Comments (6)

kentaromiura avatar kentaromiura commented on June 1, 2024

The things that fooled me, is that I don't use setAttribute, but I use the style property, so I didn't expect to trigger the attribute change.

Thank you for helping me understanding of this issue that I suppose it was also the cause of the performance problem, I ll revert those changes too since it shouldn't gc anymore when this is fixed.

from transform-3d.

WebReflection avatar WebReflection commented on June 1, 2024

Changing node.style.cssText reflects in the inline style property.

var div = document.createElement('div');
div.style.cssText = 'color: red;';
alert(div.getAttribute('style'));
// color: red;

I also wasn't expecting DOMAttrModified, used in Firefox, to fire after such operation but if you thin about it, it makes sense.

Please let me know when you have filtered operations by style and put my polyfill back instead since right now the demo does not work for me with other browsers but Chrome.

Thanks

from transform-3d.

kentaromiura avatar kentaromiura commented on June 1, 2024

I don't change cssText, only the transform property (unprefixed or not): https://github.com/kentaromiura/transform-3d/blob/master/Source/transform.js#L6

Anyway, a simple check with an early return fixed this for me, I'll upload the new version later.

from transform-3d.

WebReflection avatar WebReflection commented on June 1, 2024

it does not matter … whatever you do at the style property reflects to its attribute

every engine has a setter for the style, how would these trigger repaints otherwise ?

from transform-3d.

WebReflection avatar WebReflection commented on June 1, 2024

once again, from DOMAttrModified prospective this makes sense. I'll try to figure out if there's any way I can prevent that trigger but the logic improvement applies regardless.

from transform-3d.

WebReflection avatar WebReflection commented on June 1, 2024

In order to avoid future problems and be more consistent with current native behavior, I've updated my polyfill to version 0.1.1 and I've described the issue in the README.md

from transform-3d.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.