Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Scrolling inside ace-element hangs Chrome #15

Open
enyo opened this issue Nov 14, 2013 · 5 comments
Open

Scrolling inside ace-element hangs Chrome #15

enyo opened this issue Nov 14, 2013 · 5 comments

Comments

@enyo
Copy link

enyo commented Nov 14, 2013

I've tried the ace-element implementation and chrome completely freezes when scrolling inside the editor. I haven't been able to figure out why yet.

I played around a bit, and found out that ace always hangs on scroll, when polymer is included in the page.

@dfreedm
Copy link
Contributor

dfreedm commented Dec 16, 2013

This seems to only happen when ShadowDOMPolyfill is in use.

@dfreedm
Copy link
Contributor

dfreedm commented Dec 17, 2013

There's some sort of infinite loop happening where nodes are being added and removed.

I managed to capture a profile from dev tools, so I'll start from there.

@arv, @ajklein I may reach out to you two for help in processing the profile :)

@dfreedm
Copy link
Contributor

dfreedm commented Dec 17, 2013

Found it: ace/layer/text $renderLinesFragement depends on childNodes being a live nodelist.

https://github.com/ajaxorg/ace/blob/master/lib/ace/layer/text.js#L367

Because container.childNodes is not live, the while(lines.length) will inf-loop.

@arv Any thoughts?

@arv
Copy link

arv commented Dec 17, 2013

We could make length a getter that triggers invalidation every time.

If that gets too slow I would have a dirty bit on the parent node and set that any time a child is added or removed.

@KarstenB
Copy link

If I replace the while loop with: fragment.appendChild(container); it appears to be working, and the only down side that I can see is that it actually inserts the <div> instead of just the children, which does not appear to cause anything bad to happen. Or am I missing a better workaround?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants