WebDOMHTMLDocumentCustom.cpp [plain text]
#include "config.h"
#include "WebDOMHTMLDocument.h"
#include "HTMLDocument.h"
#include "SegmentedString.h"
#include "WebExceptionHandler.h"
#include <wtf/Forward.h>
#include <wtf/unicode/CharacterNames.h>
static inline void documentWrite(const WebDOMString& text, WebCore::HTMLDocument* document, bool addNewline)
{
WebCore::SegmentedString segmentedString = WTF::String(text);
if (addNewline)
segmentedString.append(WebCore::SegmentedString(WTF::String(&WTF::Unicode::newlineCharacter)));
document->write(segmentedString);
}
void WebDOMHTMLDocument::write(const WebDOMString& text)
{
if (!impl())
return;
documentWrite(text, impl(), false);
}
void WebDOMHTMLDocument::writeln(const WebDOMString& text)
{
if (!impl())
return;
documentWrite(text, impl(), true);
}