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 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) | 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) |
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 * | 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 229 } |
230 | 230 |
231 if (doctype) | 231 if (doctype) |
232 doc->appendChild(doctype); | 232 doc->appendChild(doctype); |
233 if (documentElement) | 233 if (documentElement) |
234 doc->appendChild(documentElement.release()); | 234 doc->appendChild(documentElement.release()); |
235 | 235 |
236 return doc.release(); | 236 return doc.release(); |
237 } | 237 } |
238 | 238 |
239 PassRefPtrWillBeRawPtr<CSSStyleSheet> DOMImplementation::createCSSStyleSheet(con
st String&, const String& media) | |
240 { | |
241 // FIXME: Title should be set. | |
242 // FIXME: Media could have wrong syntax, in which case we should generate an
exception. | |
243 RefPtrWillBeRawPtr<CSSStyleSheet> sheet = CSSStyleSheet::create(StyleSheetCo
ntents::create(strictCSSParserContext())); | |
244 sheet->setMediaQueries(MediaQuerySet::create(media)); | |
245 return sheet; | |
246 } | |
247 | |
248 bool DOMImplementation::isXMLMIMEType(const String& mimeType) | 239 bool DOMImplementation::isXMLMIMEType(const String& mimeType) |
249 { | 240 { |
250 if (equalIgnoringCase(mimeType, "text/xml") | 241 if (equalIgnoringCase(mimeType, "text/xml") |
251 || equalIgnoringCase(mimeType, "application/xml") | 242 || equalIgnoringCase(mimeType, "application/xml") |
252 || equalIgnoringCase(mimeType, "text/xsl")) | 243 || equalIgnoringCase(mimeType, "text/xsl")) |
253 return true; | 244 return true; |
254 | 245 |
255 // Per RFCs 3023 and 2045, an XML MIME type is of the form: | 246 // Per RFCs 3023 and 2045, an XML MIME type is of the form: |
256 // ^[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]+/[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]+\+xml
$ | 247 // ^[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]+/[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]+\+xml
$ |
257 | 248 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 return TextDocument::create(init); | 380 return TextDocument::create(init); |
390 if (type == "image/svg+xml") | 381 if (type == "image/svg+xml") |
391 return SVGDocument::create(init); | 382 return SVGDocument::create(init); |
392 if (isXMLMIMEType(type)) | 383 if (isXMLMIMEType(type)) |
393 return XMLDocument::create(init); | 384 return XMLDocument::create(init); |
394 | 385 |
395 return HTMLDocument::create(init); | 386 return HTMLDocument::create(init); |
396 } | 387 } |
397 | 388 |
398 } | 389 } |
OLD | NEW |