Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 2147123003: Editing: Add a TODO comment to tidyUpHTMLStructure(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index 34cc660cf18758c42e0651a6a694cc37ce4dbbfc..a80cb34fd6b5581e5220097e0a93f74716ffe2e0 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -1378,6 +1378,9 @@ void Editor::toggleOverwriteModeEnabled()
frame().selection().setShouldShowBlockCursor(m_overwriteModeEnabled);
}
+// TODO(tkent): This is a workaround of some crash bugs in the editing code,
+// which assumes a document has a valid HTML structure. We should make the
+// editing code more robust, and should remove this hack. crbug.com/580941.
void Editor::tidyUpHTMLStructure(Document& document)
{
// hasEditableStyle() needs up-to-date ComputedStyle.
@@ -1403,6 +1406,7 @@ void Editor::tidyUpHTMLStructure(Document& document)
// non-<html> root elements under <body>, and the <body> works as
// rootEditableElement.
document.addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "document.execCommand() doesn't work with an invalid HTML structure. It is corrected automatically."));
+ UseCounter::count(document, UseCounter::ExecCommandAltersHTMLStructure);
Element* root = HTMLHtmlElement::create(document);
if (existingHead)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698