| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 doc->appendChild(documentElement.release()); | 288 doc->appendChild(documentElement.release()); |
| 289 | 289 |
| 290 return doc.release(); | 290 return doc.release(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 PassRefPtr<CSSStyleSheet> DOMImplementation::createCSSStyleSheet(const String&,
const String& media) | 293 PassRefPtr<CSSStyleSheet> DOMImplementation::createCSSStyleSheet(const String&,
const String& media) |
| 294 { | 294 { |
| 295 // FIXME: Title should be set. | 295 // FIXME: Title should be set. |
| 296 // FIXME: Media could have wrong syntax, in which case we should generate an
exception. | 296 // FIXME: Media could have wrong syntax, in which case we should generate an
exception. |
| 297 RefPtr<CSSStyleSheet> sheet = CSSStyleSheet::create(StyleSheetContents::crea
te()); | 297 RefPtr<CSSStyleSheet> sheet = CSSStyleSheet::create(StyleSheetContents::crea
te()); |
| 298 sheet->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(media)
); | 298 sheet->setMediaQueries(MediaQuerySet::create(media)); |
| 299 return sheet; | 299 return sheet; |
| 300 } | 300 } |
| 301 | 301 |
| 302 bool DOMImplementation::isXMLMIMEType(const String& mimeType) | 302 bool DOMImplementation::isXMLMIMEType(const String& mimeType) |
| 303 { | 303 { |
| 304 if (mimeType == "text/xml" || mimeType == "application/xml" || mimeType == "
text/xsl") | 304 if (mimeType == "text/xml" || mimeType == "application/xml" || mimeType == "
text/xsl") |
| 305 return true; | 305 return true; |
| 306 | 306 |
| 307 // Per RFCs 3023 and 2045 a mime type is of the form: | 307 // Per RFCs 3023 and 2045 a mime type is of the form: |
| 308 // ^[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]+/[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]+\+xml
$ | 308 // ^[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]+/[0-9a-zA-Z_\\-+~!$\\^{}|.%'`#&*]+\+xml
$ |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 return TextDocument::create(frame, url); | 418 return TextDocument::create(frame, url); |
| 419 if (type == "image/svg+xml") | 419 if (type == "image/svg+xml") |
| 420 return SVGDocument::create(frame, url); | 420 return SVGDocument::create(frame, url); |
| 421 if (isXMLMIMEType(type)) | 421 if (isXMLMIMEType(type)) |
| 422 return Document::create(frame, url); | 422 return Document::create(frame, url); |
| 423 | 423 |
| 424 return HTMLDocument::create(frame, url); | 424 return HTMLDocument::create(frame, url); |
| 425 } | 425 } |
| 426 | 426 |
| 427 } | 427 } |
| OLD | NEW |