| 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) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 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 17 matching lines...) Expand all Loading... |
| 28 #include <wtf/HashCountedSet.h> | 28 #include <wtf/HashCountedSet.h> |
| 29 #include <wtf/text/AtomicStringHash.h> | 29 #include <wtf/text/AtomicStringHash.h> |
| 30 | 30 |
| 31 namespace WebCore { | 31 namespace WebCore { |
| 32 | 32 |
| 33 class FrameView; | 33 class FrameView; |
| 34 class HTMLElement; | 34 class HTMLElement; |
| 35 | 35 |
| 36 class HTMLDocument : public Document, public CachedResourceClient { | 36 class HTMLDocument : public Document, public CachedResourceClient { |
| 37 public: | 37 public: |
| 38 static PassRefPtr<HTMLDocument> create(Frame* frame, const KURL& url) | 38 static PassRefPtr<HTMLDocument> create(Frame* frame, const KURL& url, const
KURL& baseURL = KURL()) |
| 39 { | 39 { |
| 40 return adoptRef(new HTMLDocument(frame, url)); | 40 return adoptRef(new HTMLDocument(frame, url, baseURL)); |
| 41 } | 41 } |
| 42 virtual ~HTMLDocument(); | 42 virtual ~HTMLDocument(); |
| 43 | 43 |
| 44 int width(); | 44 int width(); |
| 45 int height(); | 45 int height(); |
| 46 | 46 |
| 47 String dir(); | 47 String dir(); |
| 48 void setDir(const String&); | 48 void setDir(const String&); |
| 49 | 49 |
| 50 String designMode() const; | 50 String designMode() const; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 74 | 74 |
| 75 void addNamedItem(const AtomicString& name); | 75 void addNamedItem(const AtomicString& name); |
| 76 void removeNamedItem(const AtomicString& name); | 76 void removeNamedItem(const AtomicString& name); |
| 77 bool hasNamedItem(AtomicStringImpl* name); | 77 bool hasNamedItem(AtomicStringImpl* name); |
| 78 | 78 |
| 79 void addExtraNamedItem(const AtomicString& name); | 79 void addExtraNamedItem(const AtomicString& name); |
| 80 void removeExtraNamedItem(const AtomicString& name); | 80 void removeExtraNamedItem(const AtomicString& name); |
| 81 bool hasExtraNamedItem(AtomicStringImpl* name); | 81 bool hasExtraNamedItem(AtomicStringImpl* name); |
| 82 | 82 |
| 83 protected: | 83 protected: |
| 84 HTMLDocument(Frame*, const KURL&); | 84 HTMLDocument(Frame* frame, const KURL& url, const KURL& baseURL = KURL()); |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 virtual PassRefPtr<Element> createElement(const AtomicString& tagName, Excep
tionCode&); | 87 virtual PassRefPtr<Element> createElement(const AtomicString& tagName, Excep
tionCode&); |
| 88 | 88 |
| 89 virtual bool isFrameSet() const; | 89 virtual bool isFrameSet() const; |
| 90 virtual PassRefPtr<DocumentParser> createParser(); | 90 virtual PassRefPtr<DocumentParser> createParser(); |
| 91 | 91 |
| 92 void addItemToMap(HashCountedSet<AtomicStringImpl*>&, const AtomicString&); | 92 void addItemToMap(HashCountedSet<AtomicStringImpl*>&, const AtomicString&); |
| 93 void removeItemFromMap(HashCountedSet<AtomicStringImpl*>&, const AtomicStrin
g&); | 93 void removeItemFromMap(HashCountedSet<AtomicStringImpl*>&, const AtomicStrin
g&); |
| 94 | 94 |
| 95 HashCountedSet<AtomicStringImpl*> m_namedItemCounts; | 95 HashCountedSet<AtomicStringImpl*> m_namedItemCounts; |
| 96 HashCountedSet<AtomicStringImpl*> m_extraNamedItemCounts; | 96 HashCountedSet<AtomicStringImpl*> m_extraNamedItemCounts; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 inline bool HTMLDocument::hasNamedItem(AtomicStringImpl* name) | 99 inline bool HTMLDocument::hasNamedItem(AtomicStringImpl* name) |
| 100 { | 100 { |
| 101 ASSERT(name); | 101 ASSERT(name); |
| 102 return m_namedItemCounts.contains(name); | 102 return m_namedItemCounts.contains(name); |
| 103 } | 103 } |
| 104 | 104 |
| 105 inline bool HTMLDocument::hasExtraNamedItem(AtomicStringImpl* name) | 105 inline bool HTMLDocument::hasExtraNamedItem(AtomicStringImpl* name) |
| 106 { | 106 { |
| 107 ASSERT(name); | 107 ASSERT(name); |
| 108 return m_extraNamedItemCounts.contains(name); | 108 return m_extraNamedItemCounts.contains(name); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace WebCore | 111 } // namespace WebCore |
| 112 | 112 |
| 113 #endif // HTMLDocument_h | 113 #endif // HTMLDocument_h |
| OLD | NEW |