Google文档如何实现内容编辑? [英] How does Google Docs achieve content editing?
问题描述
在检查google文档页面的DOM时,找不到具有 contentEditable
属性集的任何元素。我什至尝试遍历DOM,查看 isContentEditable
...都设置为 false
。
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
.
有什么用? google文档如何实现可编辑性?
What gives? How is google docs achieving editability?
推荐答案
Google文档使用其自己的编辑界面而不是可编辑的界面。它绘制自己的选择和插入符号,并手动处理大多数键和鼠标事件。我认为它可能具有用于内容收集的隐藏式iframe,用于收集用户输入,但我一直无法深入了解它。
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.
这里是Google博客发表相关信息:
Here's a Google blog post about it:
>://://drive.googleblog.com/2010/05/whats-different-about-new-google-docs.html
这篇关于Google文档如何实现内容编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!