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 "CachedResourceClient.h"
28 #include <wtf/HashCountedSet.h>
29 #include <wtf/text/AtomicStringHash.h>
36 class HTMLDocument : public Document, public CachedResourceClient {
38 static PassRefPtr<HTMLDocument> create(Frame* frame, const KURL& url)
40 return adoptRef(new HTMLDocument(frame, url));
42 virtual ~HTMLDocument();
48 void setDir(const String&);
50 String designMode() const;
51 void setDesignMode(const String&);
53 virtual void setCompatibilityModeFromDoctype();
55 Element* activeElement();
59 void setBgColor(const String&);
61 void setFgColor(const String&);
63 void setAlinkColor(const String&);
65 void setLinkColor(const String&);
67 void setVlinkColor(const String&);
74 void addNamedItem(const AtomicString& name);
75 void removeNamedItem(const AtomicString& name);
76 bool hasNamedItem(AtomicStringImpl* name);
78 void addExtraNamedItem(const AtomicString& name);
79 void removeExtraNamedItem(const AtomicString& name);
80 bool hasExtraNamedItem(AtomicStringImpl* name);
83 HTMLDocument(Frame*, const KURL&);
86 virtual PassRefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&);
88 virtual bool isFrameSet() const;
89 virtual PassRefPtr<DocumentParser> createParser();
91 void addItemToMap(HashCountedSet<AtomicStringImpl*>&, const AtomicString&);
92 void removeItemFromMap(HashCountedSet<AtomicStringImpl*>&, const AtomicString&);
94 HashCountedSet<AtomicStringImpl*> m_namedItemCounts;
95 HashCountedSet<AtomicStringImpl*> m_extraNamedItemCounts;
98 inline bool HTMLDocument::hasNamedItem(AtomicStringImpl* name)
101 return m_namedItemCounts.contains(name);
104 inline bool HTMLDocument::hasExtraNamedItem(AtomicStringImpl* name)
107 return m_extraNamedItemCounts.contains(name);
110 } // namespace WebCore
112 #endif // HTMLDocument_h