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"
32 class HTMLBodyElement
;
34 class CORE_EXPORT HTMLDocument
: public Document
, public ResourceClient
{
35 DEFINE_WRAPPERTYPEINFO();
37 static PassRefPtrWillBeRawPtr
<HTMLDocument
> create(const DocumentInit
& initializer
= DocumentInit())
39 return adoptRefWillBeNoop(new HTMLDocument(initializer
));
41 ~HTMLDocument() override
;
43 const AtomicString
& bgColor() const;
44 void setBgColor(const AtomicString
&);
45 const AtomicString
& fgColor() const;
46 void setFgColor(const AtomicString
&);
47 const AtomicString
& alinkColor() const;
48 void setAlinkColor(const AtomicString
&);
49 const AtomicString
& linkColor() const;
50 void setLinkColor(const AtomicString
&);
51 const AtomicString
& vlinkColor() const;
52 void setVlinkColor(const AtomicString
&);
56 void captureEvents() { }
57 void releaseEvents() { }
59 void addNamedItem(const AtomicString
& name
);
60 void removeNamedItem(const AtomicString
& name
);
61 bool hasNamedItem(const AtomicString
& name
);
63 void addExtraNamedItem(const AtomicString
& name
);
64 void removeExtraNamedItem(const AtomicString
& name
);
65 bool hasExtraNamedItem(const AtomicString
& name
);
67 static bool isCaseSensitiveAttribute(const QualifiedName
&);
69 PassRefPtrWillBeRawPtr
<Document
> cloneDocumentWithoutChildren() final
;
72 HTMLDocument(const DocumentInit
&, DocumentClassFlags extendedDocumentClasses
= DefaultDocumentClass
);
75 HTMLBodyElement
* htmlBodyElement() const;
77 const AtomicString
& bodyAttributeValue(const QualifiedName
&) const;
78 void setBodyAttribute(const QualifiedName
&, const AtomicString
&);
80 void addItemToMap(HashCountedSet
<AtomicString
>&, const AtomicString
&);
81 void removeItemFromMap(HashCountedSet
<AtomicString
>&, const AtomicString
&);
83 HashCountedSet
<AtomicString
> m_namedItemCounts
;
84 HashCountedSet
<AtomicString
> m_extraNamedItemCounts
;
87 inline bool HTMLDocument::hasNamedItem(const AtomicString
& name
)
89 return m_namedItemCounts
.contains(name
);
92 inline bool HTMLDocument::hasExtraNamedItem(const AtomicString
& name
)
94 return m_extraNamedItemCounts
.contains(name
);
97 DEFINE_DOCUMENT_TYPE_CASTS(HTMLDocument
);
101 #endif // HTMLDocument_h