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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 { | 958 { |
959 // These checks are from DOM Core Level 2, createElementNS | 959 // These checks are from DOM Core Level 2, createElementNS |
960 // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-DocCrElNS | 960 // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-DocCrElNS |
961 if (!qName.prefix().isEmpty() && qName.namespaceURI().isNull()) // createEle
mentNS(null, "html:div") | 961 if (!qName.prefix().isEmpty() && qName.namespaceURI().isNull()) // createEle
mentNS(null, "html:div") |
962 return false; | 962 return false; |
963 if (qName.prefix() == xmlAtom && qName.namespaceURI() != XMLNames::xmlNamesp
aceURI) // createElementNS("http://www.example.com", "xml:lang") | 963 if (qName.prefix() == xmlAtom && qName.namespaceURI() != XMLNames::xmlNamesp
aceURI) // createElementNS("http://www.example.com", "xml:lang") |
964 return false; | 964 return false; |
965 | 965 |
966 // Required by DOM Level 3 Core and unspecified by DOM Level 2 Core: | 966 // Required by DOM Level 3 Core and unspecified by DOM Level 2 Core: |
967 // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocC
rElNS | 967 // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocC
rElNS |
968 // createElementNS("http://www.w3.org/2000/xmlns/", "foo:bar"), createElemen
tNS(null, "xmlns:bar") | 968 // createElementNS("http://www.w3.org/2000/xmlns/", "foo:bar"), createElemen
tNS(null, "xmlns:bar"), createElementNS(null, "xmlns") |
969 if ((qName.prefix() == xmlnsAtom && qName.namespaceURI() != XMLNSNames::xmln
sNamespaceURI) || (qName.prefix() != xmlnsAtom && qName.namespaceURI() == XMLNSN
ames::xmlnsNamespaceURI)) | 969 if (qName.prefix() == xmlnsAtom || (qName.prefix().isEmpty() && qName.localN
ame() == xmlnsAtom)) |
970 return false; | 970 return qName.namespaceURI() == XMLNSNames::xmlnsNamespaceURI; |
971 | 971 return qName.namespaceURI() != XMLNSNames::xmlnsNamespaceURI; |
972 return true; | |
973 } | 972 } |
974 | 973 |
975 bool Document::hasValidNamespaceForAttributes(const QualifiedName& qName) | 974 bool Document::hasValidNamespaceForAttributes(const QualifiedName& qName) |
976 { | 975 { |
977 // Spec: DOM Level 2 Core: http://www.w3.org/TR/DOM-Level-2-Core/core.html#I
D-ElSetAttrNS | |
978 if (qName.prefix().isEmpty() && qName.localName() == xmlnsAtom) { | |
979 // Note: The case of an "xmlns" qualified name with a namespace of | |
980 // xmlnsNamespaceURI is specifically allowed (See <http://www.w3.org/200
0/xmlns/>). | |
981 return qName.namespaceURI() == XMLNSNames::xmlnsNamespaceURI; | |
982 } | |
983 return hasValidNamespaceForElements(qName); | 976 return hasValidNamespaceForElements(qName); |
984 } | 977 } |
985 | 978 |
986 // FIXME: This should really be in a possible ElementFactory class | 979 // FIXME: This should really be in a possible ElementFactory class |
987 PassRefPtr<Element> Document::createElement(const QualifiedName& qName, bool cre
atedByParser) | 980 PassRefPtr<Element> Document::createElement(const QualifiedName& qName, bool cre
atedByParser) |
988 { | 981 { |
989 RefPtr<Element> e; | 982 RefPtr<Element> e; |
990 | 983 |
991 // FIXME: Use registered namespaces and look up in a hash to find the right
factory. | 984 // FIXME: Use registered namespaces and look up in a hash to find the right
factory. |
992 if (qName.namespaceURI() == xhtmlNamespaceURI) | 985 if (qName.namespaceURI() == xhtmlNamespaceURI) |
(...skipping 4272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5265 } | 5258 } |
5266 | 5259 |
5267 FastTextAutosizer* Document::fastTextAutosizer() | 5260 FastTextAutosizer* Document::fastTextAutosizer() |
5268 { | 5261 { |
5269 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable
d()) | 5262 if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnable
d()) |
5270 m_fastTextAutosizer = FastTextAutosizer::create(this); | 5263 m_fastTextAutosizer = FastTextAutosizer::create(this); |
5271 return m_fastTextAutosizer.get(); | 5264 return m_fastTextAutosizer.get(); |
5272 } | 5265 } |
5273 | 5266 |
5274 } // namespace WebCore | 5267 } // namespace WebCore |
OLD | NEW |