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, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 #include "core/dom/ProcessingInstruction.h" | 87 #include "core/dom/ProcessingInstruction.h" |
88 #include "core/dom/RequestAnimationFrameCallback.h" | 88 #include "core/dom/RequestAnimationFrameCallback.h" |
89 #include "core/dom/ScriptRunner.h" | 89 #include "core/dom/ScriptRunner.h" |
90 #include "core/dom/ScriptedAnimationController.h" | 90 #include "core/dom/ScriptedAnimationController.h" |
91 #include "core/dom/SelectorQuery.h" | 91 #include "core/dom/SelectorQuery.h" |
92 #include "core/dom/StyleEngine.h" | 92 #include "core/dom/StyleEngine.h" |
93 #include "core/dom/TouchList.h" | 93 #include "core/dom/TouchList.h" |
94 #include "core/dom/TransformSource.h" | 94 #include "core/dom/TransformSource.h" |
95 #include "core/dom/TreeWalker.h" | 95 #include "core/dom/TreeWalker.h" |
96 #include "core/dom/VisitedLinkState.h" | 96 #include "core/dom/VisitedLinkState.h" |
| 97 #include "core/dom/XMLDocument.h" |
97 #include "core/dom/custom/CustomElementRegistrationContext.h" | 98 #include "core/dom/custom/CustomElementRegistrationContext.h" |
98 #include "core/dom/shadow/ElementShadow.h" | 99 #include "core/dom/shadow/ElementShadow.h" |
99 #include "core/dom/shadow/ShadowRoot.h" | 100 #include "core/dom/shadow/ShadowRoot.h" |
100 #include "core/editing/Editor.h" | 101 #include "core/editing/Editor.h" |
101 #include "core/editing/FrameSelection.h" | 102 #include "core/editing/FrameSelection.h" |
102 #include "core/editing/SpellChecker.h" | 103 #include "core/editing/SpellChecker.h" |
103 #include "core/events/BeforeUnloadEvent.h" | 104 #include "core/events/BeforeUnloadEvent.h" |
104 #include "core/events/Event.h" | 105 #include "core/events/Event.h" |
105 #include "core/events/EventFactory.h" | 106 #include "core/events/EventFactory.h" |
106 #include "core/events/EventListener.h" | 107 #include "core/events/EventListener.h" |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 // not implemented for the XML parser as it's normally synonymous with | 1196 // not implemented for the XML parser as it's normally synonymous with |
1196 // document.write(). append() will end up yielding, but close() will | 1197 // document.write(). append() will end up yielding, but close() will |
1197 // pump the tokenizer syncrhonously and finish the parse. | 1198 // pump the tokenizer syncrhonously and finish the parse. |
1198 m_parser->pinToMainThread(); | 1199 m_parser->pinToMainThread(); |
1199 m_parser->append(content.impl()); | 1200 m_parser->append(content.impl()); |
1200 close(); | 1201 close(); |
1201 } | 1202 } |
1202 | 1203 |
1203 String Document::suggestedMIMEType() const | 1204 String Document::suggestedMIMEType() const |
1204 { | 1205 { |
1205 if (isXHTMLDocument()) | 1206 if (isXMLDocument()) { |
1206 return "application/xhtml+xml"; | 1207 if (isXHTMLDocument()) |
1207 if (isSVGDocument()) | 1208 return "application/xhtml+xml"; |
1208 return "image/svg+xml"; | 1209 if (isSVGDocument()) |
| 1210 return "image/svg+xml"; |
| 1211 return "application/xml"; |
| 1212 } |
1209 if (xmlStandalone()) | 1213 if (xmlStandalone()) |
1210 return "text/xml"; | 1214 return "text/xml"; |
1211 if (isHTMLDocument()) | 1215 if (isHTMLDocument()) |
1212 return "text/html"; | 1216 return "text/html"; |
1213 | 1217 |
1214 if (DocumentLoader* documentLoader = loader()) | 1218 if (DocumentLoader* documentLoader = loader()) |
1215 return documentLoader->responseMIMEType(); | 1219 return documentLoader->responseMIMEType(); |
1216 return String(); | 1220 return String(); |
1217 } | 1221 } |
1218 | 1222 |
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3153 RefPtr<Document> clone = cloneDocumentWithoutChildren(); | 3157 RefPtr<Document> clone = cloneDocumentWithoutChildren(); |
3154 clone->cloneDataFromDocument(*this); | 3158 clone->cloneDataFromDocument(*this); |
3155 if (deep) | 3159 if (deep) |
3156 cloneChildNodes(clone.get()); | 3160 cloneChildNodes(clone.get()); |
3157 return clone.release(); | 3161 return clone.release(); |
3158 } | 3162 } |
3159 | 3163 |
3160 PassRefPtr<Document> Document::cloneDocumentWithoutChildren() | 3164 PassRefPtr<Document> Document::cloneDocumentWithoutChildren() |
3161 { | 3165 { |
3162 DocumentInit init(url()); | 3166 DocumentInit init(url()); |
3163 if (isXHTMLDocument()) | 3167 if (isXMLDocument()) { |
3164 return createXHTML(init.withRegistrationContext(registrationContext())); | 3168 if (isXHTMLDocument()) |
| 3169 return XMLDocument::createXHTML(init.withRegistrationContext(registr
ationContext())); |
| 3170 return XMLDocument::create(init); |
| 3171 } |
3165 return create(init); | 3172 return create(init); |
3166 } | 3173 } |
3167 | 3174 |
3168 void Document::cloneDataFromDocument(const Document& other) | 3175 void Document::cloneDataFromDocument(const Document& other) |
3169 { | 3176 { |
3170 setCompatibilityMode(other.compatibilityMode()); | 3177 setCompatibilityMode(other.compatibilityMode()); |
3171 setEncodingData(other.m_encodingData); | 3178 setEncodingData(other.m_encodingData); |
3172 setContextFeatures(other.contextFeatures()); | 3179 setContextFeatures(other.contextFeatures()); |
3173 setSecurityOrigin(other.securityOrigin()->isolatedCopy()); | 3180 setSecurityOrigin(other.securityOrigin()->isolatedCopy()); |
3174 } | 3181 } |
(...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5333 if (!page->focusController().isActive() || !page->focusController().isFocuse
d()) | 5340 if (!page->focusController().isActive() || !page->focusController().isFocuse
d()) |
5334 return false; | 5341 return false; |
5335 if (Frame* focusedFrame = page->focusController().focusedFrame()) { | 5342 if (Frame* focusedFrame = page->focusController().focusedFrame()) { |
5336 if (focusedFrame->tree().isDescendantOf(frame())) | 5343 if (focusedFrame->tree().isDescendantOf(frame())) |
5337 return true; | 5344 return true; |
5338 } | 5345 } |
5339 return false; | 5346 return false; |
5340 } | 5347 } |
5341 | 5348 |
5342 } // namespace WebCore | 5349 } // namespace WebCore |
OLD | NEW |