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

Unified Diff: Source/core/html/HTMLDocument.cpp

Issue 59693007: Get rid of custom code for HTMLDocument.write() / writeln() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Extend layout test Created 7 years, 1 month 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 | « Source/core/html/HTMLDocument.h ('k') | Source/core/html/HTMLDocument.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLDocument.cpp
diff --git a/Source/core/html/HTMLDocument.cpp b/Source/core/html/HTMLDocument.cpp
index 39952ae77cef0917b3706411e8e115ee680b1a23..ee9cb2434940a2bb51a4d59818ae24110c29277d 100644
--- a/Source/core/html/HTMLDocument.cpp
+++ b/Source/core/html/HTMLDocument.cpp
@@ -55,12 +55,14 @@
#include "HTMLNames.h"
#include "bindings/v8/ScriptController.h"
+#include "core/frame/DOMWindow.h"
+#include "core/frame/Frame.h"
+#include "core/frame/FrameView.h"
#include "core/html/HTMLBodyElement.h"
#include "core/page/FocusController.h"
-#include "core/frame/Frame.h"
#include "core/page/FrameTree.h"
-#include "core/frame/FrameView.h"
#include "core/page/Page.h"
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
@@ -326,4 +328,22 @@ void HTMLDocument::clear()
// But I do see it in the documentation for Mozilla.
}
+void HTMLDocument::write(DOMWindow* activeWindow, const Vector<String>& text)
+{
+ ASSERT(activeWindow);
+ StringBuilder builder;
+ for (size_t i = 0; i < text.size(); ++i)
+ builder.append(text[i]);
+ write(builder.toString(), activeWindow->document());
+}
+
+void HTMLDocument::writeln(DOMWindow* activeWindow, const Vector<String>& text)
+{
+ ASSERT(activeWindow);
+ StringBuilder builder;
+ for (size_t i = 0; i < text.size(); ++i)
+ builder.append(text[i]);
+ writeln(builder.toString(), activeWindow->document());
+}
+
}
« no previous file with comments | « Source/core/html/HTMLDocument.h ('k') | Source/core/html/HTMLDocument.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698