2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef HTMLDocument_h
24 #define HTMLDocument_h
26 #include "core/dom/Document.h"
27 #include "core/fetch/ResourceClient.h"
28 #include "wtf/HashCountedSet.h"
33 class HTMLBodyElement;
36 class HTMLDocument : public Document, public ResourceClient {
37 DEFINE_WRAPPERTYPEINFO();
39 static PassRefPtrWillBeRawPtr<HTMLDocument> create(const DocumentInit& initializer = DocumentInit())
41 return adoptRefWillBeNoop(new HTMLDocument(initializer));
43 virtual ~HTMLDocument();
45 const AtomicString& bgColor() const;
46 void setBgColor(const AtomicString&);
47 const AtomicString& fgColor() const;
48 void setFgColor(const AtomicString&);
49 const AtomicString& alinkColor() const;
50 void setAlinkColor(const AtomicString&);
51 const AtomicString& linkColor() const;
52 void setLinkColor(const AtomicString&);
53 const AtomicString& vlinkColor() const;
54 void setVlinkColor(const AtomicString&);
58 void captureEvents() { }
59 void releaseEvents() { }
61 void addNamedItem(const AtomicString& name);
62 void removeNamedItem(const AtomicString& name);
63 bool hasNamedItem(const AtomicString& name);
65 void addExtraNamedItem(const AtomicString& name);
66 void removeExtraNamedItem(const AtomicString& name);
67 bool hasExtraNamedItem(const AtomicString& name);
69 using Document::write;
70 using Document::writeln;
71 void write(LocalDOMWindow*, const Vector<String>& text, ExceptionState&);
72 void writeln(LocalDOMWindow*, const Vector<String>& text, ExceptionState&);
74 static bool isCaseSensitiveAttribute(const QualifiedName&);
76 virtual PassRefPtrWillBeRawPtr<Document> cloneDocumentWithoutChildren() OVERRIDE FINAL;
79 HTMLDocument(const DocumentInit&, DocumentClassFlags extendedDocumentClasses = DefaultDocumentClass);
82 HTMLBodyElement* htmlBodyElement() const;
84 const AtomicString& bodyAttributeValue(const QualifiedName&) const;
85 void setBodyAttribute(const QualifiedName&, const AtomicString&);
87 void addItemToMap(HashCountedSet<AtomicString>&, const AtomicString&);
88 void removeItemFromMap(HashCountedSet<AtomicString>&, const AtomicString&);
90 HashCountedSet<AtomicString> m_namedItemCounts;
91 HashCountedSet<AtomicString> m_extraNamedItemCounts;
94 inline bool HTMLDocument::hasNamedItem(const AtomicString& name)
96 return m_namedItemCounts.contains(name);
99 inline bool HTMLDocument::hasExtraNamedItem(const AtomicString& name)
101 return m_extraNamedItemCounts.contains(name);
104 DEFINE_DOCUMENT_TYPE_CASTS(HTMLDocument);
108 #endif // HTMLDocument_h