| OLD | NEW |
| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 : Document(initializer, HTMLDocumentClass | extendedDocumentClasses) | 72 : Document(initializer, HTMLDocumentClass | extendedDocumentClasses) |
| 73 { | 73 { |
| 74 ScriptWrappable::init(this); | 74 ScriptWrappable::init(this); |
| 75 clearXMLVersion(); | 75 clearXMLVersion(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 HTMLDocument::~HTMLDocument() | 78 HTMLDocument::~HTMLDocument() |
| 79 { | 79 { |
| 80 } | 80 } |
| 81 | 81 |
| 82 String HTMLDocument::designMode() const | |
| 83 { | |
| 84 return inDesignMode() ? "on" : "off"; | |
| 85 } | |
| 86 | |
| 87 void HTMLDocument::setDesignMode(const String& value) | |
| 88 { | |
| 89 InheritedBool mode; | |
| 90 if (equalIgnoringCase(value, "on")) | |
| 91 mode = on; | |
| 92 else if (equalIgnoringCase(value, "off")) | |
| 93 mode = off; | |
| 94 else | |
| 95 mode = inherit; | |
| 96 Document::setDesignMode(mode); | |
| 97 } | |
| 98 | |
| 99 HTMLBodyElement* HTMLDocument::htmlBodyElement() const | 82 HTMLBodyElement* HTMLDocument::htmlBodyElement() const |
| 100 { | 83 { |
| 101 HTMLElement* body = this->body(); | 84 HTMLElement* body = this->body(); |
| 102 return isHTMLBodyElement(body) ? toHTMLBodyElement(body) : 0; | 85 return isHTMLBodyElement(body) ? toHTMLBodyElement(body) : 0; |
| 103 } | 86 } |
| 104 | 87 |
| 105 const AtomicString& HTMLDocument::bodyAttributeValue(const QualifiedName& name)
const | 88 const AtomicString& HTMLDocument::bodyAttributeValue(const QualifiedName& name)
const |
| 106 { | 89 { |
| 107 if (HTMLBodyElement* body = htmlBodyElement()) | 90 if (HTMLBodyElement* body = htmlBodyElement()) |
| 108 return body->fastGetAttribute(name); | 91 return body->fastGetAttribute(name); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 void HTMLDocument::writeln(DOMWindow* callingWindow, const Vector<String>& text) | 280 void HTMLDocument::writeln(DOMWindow* callingWindow, const Vector<String>& text) |
| 298 { | 281 { |
| 299 ASSERT(callingWindow); | 282 ASSERT(callingWindow); |
| 300 StringBuilder builder; | 283 StringBuilder builder; |
| 301 for (size_t i = 0; i < text.size(); ++i) | 284 for (size_t i = 0; i < text.size(); ++i) |
| 302 builder.append(text[i]); | 285 builder.append(text[i]); |
| 303 writeln(builder.toString(), callingWindow->document()); | 286 writeln(builder.toString(), callingWindow->document()); |
| 304 } | 287 } |
| 305 | 288 |
| 306 } | 289 } |
| OLD | NEW |