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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLDocument.h ('k') | Source/core/html/HTMLDocument.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 * other provisions required by the MPL or the GPL, as the case may be. 48 * other provisions required by the MPL or the GPL, as the case may be.
49 * If you do not delete the provisions above, a recipient may use your 49 * If you do not delete the provisions above, a recipient may use your
50 * version of this file under any of the LGPL, the MPL or the GPL. 50 * version of this file under any of the LGPL, the MPL or the GPL.
51 */ 51 */
52 52
53 #include "config.h" 53 #include "config.h"
54 #include "core/html/HTMLDocument.h" 54 #include "core/html/HTMLDocument.h"
55 55
56 #include "HTMLNames.h" 56 #include "HTMLNames.h"
57 #include "bindings/v8/ScriptController.h" 57 #include "bindings/v8/ScriptController.h"
58 #include "core/frame/DOMWindow.h"
59 #include "core/frame/Frame.h"
60 #include "core/frame/FrameView.h"
58 #include "core/html/HTMLBodyElement.h" 61 #include "core/html/HTMLBodyElement.h"
59 #include "core/page/FocusController.h" 62 #include "core/page/FocusController.h"
60 #include "core/frame/Frame.h"
61 #include "core/page/FrameTree.h" 63 #include "core/page/FrameTree.h"
62 #include "core/frame/FrameView.h"
63 #include "core/page/Page.h" 64 #include "core/page/Page.h"
65 #include "wtf/text/StringBuilder.h"
64 66
65 namespace WebCore { 67 namespace WebCore {
66 68
67 using namespace HTMLNames; 69 using namespace HTMLNames;
68 70
69 HTMLDocument::HTMLDocument(const DocumentInit& initializer, DocumentClassFlags e xtendedDocumentClasses) 71 HTMLDocument::HTMLDocument(const DocumentInit& initializer, DocumentClassFlags e xtendedDocumentClasses)
70 : Document(initializer, HTMLDocumentClass | extendedDocumentClasses) 72 : Document(initializer, HTMLDocumentClass | extendedDocumentClasses)
71 { 73 {
72 ScriptWrappable::init(this); 74 ScriptWrappable::init(this);
73 clearXMLVersion(); 75 clearXMLVersion();
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 return !isPossibleHTMLAttr || !htmlCaseInsensitiveAttributesSet->contains(at tributeName.localName().impl()); 321 return !isPossibleHTMLAttr || !htmlCaseInsensitiveAttributesSet->contains(at tributeName.localName().impl());
320 } 322 }
321 323
322 void HTMLDocument::clear() 324 void HTMLDocument::clear()
323 { 325 {
324 // FIXME: This does nothing, and that seems unlikely to be correct. 326 // FIXME: This does nothing, and that seems unlikely to be correct.
325 // We've long had a comment saying that IE doesn't support this. 327 // We've long had a comment saying that IE doesn't support this.
326 // But I do see it in the documentation for Mozilla. 328 // But I do see it in the documentation for Mozilla.
327 } 329 }
328 330
331 void HTMLDocument::write(DOMWindow* activeWindow, const Vector<String>& text)
332 {
333 ASSERT(activeWindow);
334 StringBuilder builder;
335 for (size_t i = 0; i < text.size(); ++i)
336 builder.append(text[i]);
337 write(builder.toString(), activeWindow->document());
329 } 338 }
339
340 void HTMLDocument::writeln(DOMWindow* activeWindow, const Vector<String>& text)
341 {
342 ASSERT(activeWindow);
343 StringBuilder builder;
344 for (size_t i = 0; i < text.size(); ++i)
345 builder.append(text[i]);
346 writeln(builder.toString(), activeWindow->document());
347 }
348
349 }
OLDNEW
« 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