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 4409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4420 { | 4420 { |
4421 if (m_contextDocument) | 4421 if (m_contextDocument) |
4422 return m_contextDocument; | 4422 return m_contextDocument; |
4423 if (m_frame) | 4423 if (m_frame) |
4424 return m_weakFactory.createWeakPtr(); | 4424 return m_weakFactory.createWeakPtr(); |
4425 return WeakPtr<Document>(nullptr); | 4425 return WeakPtr<Document>(nullptr); |
4426 } | 4426 } |
4427 | 4427 |
4428 PassRefPtr<Attr> Document::createAttribute(const AtomicString& name, ExceptionSt
ate& exceptionState) | 4428 PassRefPtr<Attr> Document::createAttribute(const AtomicString& name, ExceptionSt
ate& exceptionState) |
4429 { | 4429 { |
| 4430 return createAttributeNS(nullAtom, name, exceptionState, true); |
| 4431 } |
| 4432 |
| 4433 PassRefPtr<Attr> Document::createAttributeNS(const AtomicString& namespaceURI, c
onst AtomicString& qualifiedName, ExceptionState& exceptionState, bool shouldIgn
oreNamespaceChecks) |
| 4434 { |
4430 AtomicString prefix, localName; | 4435 AtomicString prefix, localName; |
4431 if (!parseQualifiedName(name, prefix, localName, exceptionState)) | 4436 if (!parseQualifiedName(qualifiedName, prefix, localName, exceptionState)) |
4432 return nullptr; | 4437 return nullptr; |
4433 | 4438 |
4434 QualifiedName qName(prefix, localName, nullAtom); | 4439 QualifiedName qName(prefix, localName, namespaceURI); |
| 4440 |
| 4441 if (!shouldIgnoreNamespaceChecks && !hasValidNamespaceForAttributes(qName))
{ |
| 4442 exceptionState.throwDOMException(NamespaceError, "The namespace URI prov
ided ('" + namespaceURI + "') is not valid for the qualified name provided ('" +
qualifiedName + "')."); |
| 4443 return nullptr; |
| 4444 } |
4435 | 4445 |
4436 return Attr::create(*this, qName, emptyAtom); | 4446 return Attr::create(*this, qName, emptyAtom); |
4437 } | 4447 } |
4438 | 4448 |
4439 const SVGDocumentExtensions* Document::svgExtensions() | 4449 const SVGDocumentExtensions* Document::svgExtensions() |
4440 { | 4450 { |
4441 return m_svgExtensions.get(); | 4451 return m_svgExtensions.get(); |
4442 } | 4452 } |
4443 | 4453 |
4444 SVGDocumentExtensions& Document::accessSVGExtensions() | 4454 SVGDocumentExtensions& Document::accessSVGExtensions() |
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5581 (*it)->invalidateCache(attrName); | 5591 (*it)->invalidateCache(attrName); |
5582 } | 5592 } |
5583 | 5593 |
5584 void Document::trace(Visitor* visitor) | 5594 void Document::trace(Visitor* visitor) |
5585 { | 5595 { |
5586 Supplementable<Document>::trace(visitor); | 5596 Supplementable<Document>::trace(visitor); |
5587 ContainerNode::trace(visitor); | 5597 ContainerNode::trace(visitor); |
5588 } | 5598 } |
5589 | 5599 |
5590 } // namespace WebCore | 5600 } // namespace WebCore |
OLD | NEW |