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 4310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4321 { | 4321 { |
4322 if (m_contextDocument) | 4322 if (m_contextDocument) |
4323 return m_contextDocument; | 4323 return m_contextDocument; |
4324 if (m_frame) | 4324 if (m_frame) |
4325 return m_weakFactory.createWeakPtr(); | 4325 return m_weakFactory.createWeakPtr(); |
4326 return WeakPtr<Document>(nullptr); | 4326 return WeakPtr<Document>(nullptr); |
4327 } | 4327 } |
4328 | 4328 |
4329 PassRefPtr<Attr> Document::createAttribute(const AtomicString& name, ExceptionSt
ate& exceptionState) | 4329 PassRefPtr<Attr> Document::createAttribute(const AtomicString& name, ExceptionSt
ate& exceptionState) |
4330 { | 4330 { |
| 4331 return createAttributeNS(nullAtom, name, exceptionState, true); |
| 4332 } |
| 4333 |
| 4334 PassRefPtr<Attr> Document::createAttributeNS(const AtomicString& namespaceURI, c
onst AtomicString& qualifiedName, ExceptionState& exceptionState, bool shouldIgn
oreNamespaceChecks) |
| 4335 { |
4331 AtomicString prefix, localName; | 4336 AtomicString prefix, localName; |
4332 if (!parseQualifiedName(name, prefix, localName, exceptionState)) | 4337 if (!parseQualifiedName(qualifiedName, prefix, localName, exceptionState)) |
4333 return nullptr; | 4338 return nullptr; |
4334 | 4339 |
4335 QualifiedName qName(prefix, localName, nullAtom); | 4340 QualifiedName qName(prefix, localName, namespaceURI); |
| 4341 |
| 4342 if (!shouldIgnoreNamespaceChecks && !hasValidNamespaceForAttributes(qName))
{ |
| 4343 exceptionState.throwDOMException(NamespaceError, "The namespace URI prov
ided ('" + namespaceURI + "') is not valid for the qualified name provided ('" +
qualifiedName + "')."); |
| 4344 return nullptr; |
| 4345 } |
4336 | 4346 |
4337 return Attr::create(*this, qName, emptyAtom); | 4347 return Attr::create(*this, qName, emptyAtom); |
4338 } | 4348 } |
4339 | 4349 |
4340 const SVGDocumentExtensions* Document::svgExtensions() | 4350 const SVGDocumentExtensions* Document::svgExtensions() |
4341 { | 4351 { |
4342 return m_svgExtensions.get(); | 4352 return m_svgExtensions.get(); |
4343 } | 4353 } |
4344 | 4354 |
4345 SVGDocumentExtensions& Document::accessSVGExtensions() | 4355 SVGDocumentExtensions& Document::accessSVGExtensions() |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5486 } | 5496 } |
5487 | 5497 |
5488 void Document::invalidateNodeListCaches(const QualifiedName* attrName) | 5498 void Document::invalidateNodeListCaches(const QualifiedName* attrName) |
5489 { | 5499 { |
5490 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end(
); | 5500 HashSet<LiveNodeListBase*>::iterator end = m_listsInvalidatedAtDocument.end(
); |
5491 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument.
begin(); it != end; ++it) | 5501 for (HashSet<LiveNodeListBase*>::iterator it = m_listsInvalidatedAtDocument.
begin(); it != end; ++it) |
5492 (*it)->invalidateCache(attrName); | 5502 (*it)->invalidateCache(attrName); |
5493 } | 5503 } |
5494 | 5504 |
5495 } // namespace WebCore | 5505 } // namespace WebCore |
OLD | NEW |