2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2006, 2007, 2008 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"
34 class HTMLDocument
: public Document
, public CachedResourceClient
{
36 static PassRefPtr
<HTMLDocument
> create(Frame
* frame
)
38 return new HTMLDocument(frame
);
40 virtual ~HTMLDocument();
46 void setDir(const String
&);
48 String
designMode() const;
49 void setDesignMode(const String
&);
51 String
compatMode() const;
53 Element
* activeElement();
57 void setBgColor(const String
&);
59 void setFgColor(const String
&);
61 void setAlinkColor(const String
&);
63 void setLinkColor(const String
&);
65 void setVlinkColor(const String
&);
72 virtual bool childAllowed(Node
*);
74 virtual PassRefPtr
<Element
> createElement(const AtomicString
& tagName
, ExceptionCode
&);
76 void addNamedItem(const AtomicString
& name
);
77 void removeNamedItem(const AtomicString
& name
);
78 bool hasNamedItem(AtomicStringImpl
* name
);
80 void addExtraNamedItem(const AtomicString
& name
);
81 void removeExtraNamedItem(const AtomicString
& name
);
82 bool hasExtraNamedItem(AtomicStringImpl
* name
);
84 typedef HashMap
<AtomicStringImpl
*, int> NameCountMap
;
90 virtual bool isHTMLDocument() const { return true; }
91 virtual Tokenizer
* createTokenizer();
92 virtual void determineParseMode();
94 NameCountMap m_namedItemCounts
;
95 NameCountMap 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
);