How does Google Docs achieve content editing?

无人久伴 提交于 2019-12-08 02:07:49

问题


Inspecting the DOM of a google docs page, I can't find any elements with the contentEditable attribute set. I even tried traversing the DOM, looking at isContentEditable... all set to false.

What gives? How is google docs achieving editability?


回答1:


Google Docs uses its own editing surface instead of contenteditable. It draws its own selection and caret and handles most key and mouse events manually. I think it may have a hidden contenteditable iframe that it uses to collect user input but I've never been able to get to the bottom of it.

Here's a Google blog post about it:

https://drive.googleblog.com/2010/05/whats-different-about-new-google-docs.html



来源:https://stackoverflow.com/questions/13147703/how-does-google-docs-achieve-content-editing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!