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 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 15 matching lines...) Expand all Loading... |
26 #ifndef Document_h | 26 #ifndef Document_h |
27 #define Document_h | 27 #define Document_h |
28 | 28 |
29 #include "Attr.h" | 29 #include "Attr.h" |
30 #include "CheckedRadioButtons.h" | 30 #include "CheckedRadioButtons.h" |
31 #include "Color.h" | 31 #include "Color.h" |
32 #include "DocumentMarker.h" | 32 #include "DocumentMarker.h" |
33 #include "HTMLCollection.h" | 33 #include "HTMLCollection.h" |
34 #include "ScriptExecutionContext.h" | 34 #include "ScriptExecutionContext.h" |
35 #include "Timer.h" | 35 #include "Timer.h" |
36 #include <wtf/HashCountedSet.h> | 36 #include <wtf/HashCountedSet.h> |
37 #include "unicode/uscript.h" | |
38 | 37 |
39 // FIXME: We should move Mac off of the old Frame-based user stylesheet loading | 38 // FIXME: We should move Mac off of the old Frame-based user stylesheet loading |
40 // code and onto the new code in Page. We can't do that until the code in Page | 39 // code and onto the new code in Page. We can't do that until the code in Page |
41 // supports non-file: URLs, however. | 40 // supports non-file: URLs, however. |
42 #if PLATFORM(MAC) || PLATFORM(QT) | 41 #if PLATFORM(MAC) || PLATFORM(QT) |
43 #define FRAME_LOADS_USER_STYLESHEET 1 | 42 #define FRAME_LOADS_USER_STYLESHEET 1 |
44 #else | 43 #else |
45 #define FRAME_LOADS_USER_STYLESHEET 0 | 44 #define FRAME_LOADS_USER_STYLESHEET 0 |
46 #endif | 45 #endif |
47 | 46 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 String readyState() const; | 238 String readyState() const; |
240 | 239 |
241 String defaultCharset() const; | 240 String defaultCharset() const; |
242 | 241 |
243 // Synonyms backing similar DOM attributes. Use Document::encoding() to avoi
d virtual dispatch. | 242 // Synonyms backing similar DOM attributes. Use Document::encoding() to avoi
d virtual dispatch. |
244 String inputEncoding() const { return Document::encoding(); } | 243 String inputEncoding() const { return Document::encoding(); } |
245 String charset() const { return Document::encoding(); } | 244 String charset() const { return Document::encoding(); } |
246 String characterSet() const { return Document::encoding(); } | 245 String characterSet() const { return Document::encoding(); } |
247 | 246 |
248 void setCharset(const String&); | 247 void setCharset(const String&); |
249 UScriptCode dominantScript() const; | |
250 | 248 |
251 String contentLanguage() const { return m_contentLanguage; } | 249 String contentLanguage() const { return m_contentLanguage; } |
252 void setContentLanguage(const String& lang) { m_contentLanguage = lang; } | 250 void setContentLanguage(const String& lang) { m_contentLanguage = lang; } |
253 | 251 |
254 String xmlEncoding() const { return m_xmlEncoding; } | 252 String xmlEncoding() const { return m_xmlEncoding; } |
255 String xmlVersion() const { return m_xmlVersion; } | 253 String xmlVersion() const { return m_xmlVersion; } |
256 bool xmlStandalone() const { return m_xmlStandalone; } | 254 bool xmlStandalone() const { return m_xmlStandalone; } |
257 | 255 |
258 void setXMLEncoding(const String& encoding) { m_xmlEncoding = encoding; } //
read-only property, only to be set from XMLTokenizer | 256 void setXMLEncoding(const String& encoding) { m_xmlEncoding = encoding; } //
read-only property, only to be set from XMLTokenizer |
259 void setXMLVersion(const String&, ExceptionCode&); | 257 void setXMLVersion(const String&, ExceptionCode&); |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 HashSet<Node*> m_disconnectedNodesWithEventListeners; | 936 HashSet<Node*> m_disconnectedNodesWithEventListeners; |
939 | 937 |
940 int m_docID; // A unique document identifier used for things like document-s
pecific mapped attributes. | 938 int m_docID; // A unique document identifier used for things like document-s
pecific mapped attributes. |
941 | 939 |
942 String m_xmlEncoding; | 940 String m_xmlEncoding; |
943 String m_xmlVersion; | 941 String m_xmlVersion; |
944 bool m_xmlStandalone; | 942 bool m_xmlStandalone; |
945 | 943 |
946 String m_contentLanguage; | 944 String m_contentLanguage; |
947 | 945 |
948 // UScriptCode can be derived from non-Unicode charsets and help us select a
fallback | |
949 // font. Because it's derived from charset, it's a document-wide constant. | |
950 // For instance, it'll be Latin, SimplifiedHan, TraditionalHan, Hiragana, | |
951 // Hangul, Arabic and Hebrew for documents in ISO-8859-1, GBK, Big5, Shift_J
IS, | |
952 // EUC-KR, Windows-1256 and Windows-1255, respectively. In case of Japanese
encodings, | |
953 // either Hiragana or Katakana should work but Han does not because it does
not | |
954 // uniquely identify Japanese and as a result does not help the font selecti
on. | |
955 // Obviously, this does not work well for Unicode-encoded documents. In the
meantime, | |
956 // we can resort to the 'dominant' script of the current UI language. | |
957 // In the future, we should refer to the value of xml:lang and lang to infer
| |
958 // this value for invididual text nodes. CSSStyleSelector might be a good pl
ace for that. | |
959 // Moreover, the value of m_contentLanguage should be utilized as well. | |
960 mutable UScriptCode m_dominantScript; | |
961 | |
962 public: | 946 public: |
963 bool inPageCache() const { return m_inPageCache; } | 947 bool inPageCache() const { return m_inPageCache; } |
964 void setInPageCache(bool flag); | 948 void setInPageCache(bool flag); |
965 | 949 |
966 // Elements can register themselves for the "documentWillBecomeInactive()" a
nd | 950 // Elements can register themselves for the "documentWillBecomeInactive()" a
nd |
967 // "documentDidBecomeActive()" callbacks | 951 // "documentDidBecomeActive()" callbacks |
968 void registerForDocumentActivationCallbacks(Element*); | 952 void registerForDocumentActivationCallbacks(Element*); |
969 void unregisterForDocumentActivationCallbacks(Element*); | 953 void unregisterForDocumentActivationCallbacks(Element*); |
970 void documentWillBecomeInactive(); | 954 void documentWillBecomeInactive(); |
971 void documentDidBecomeActive(); | 955 void documentDidBecomeActive(); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 } | 1105 } |
1122 | 1106 |
1123 inline bool Node::isDocumentNode() const | 1107 inline bool Node::isDocumentNode() const |
1124 { | 1108 { |
1125 return this == m_document.get(); | 1109 return this == m_document.get(); |
1126 } | 1110 } |
1127 | 1111 |
1128 } // namespace WebCore | 1112 } // namespace WebCore |
1129 | 1113 |
1130 #endif // Document_h | 1114 #endif // Document_h |
1131 | |
1132 | |
1133 | |
OLD | NEW |