| 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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 return isHTMLDocument() ? name.lower() : name; | 695 return isHTMLDocument() ? name.lower() : name; |
| 696 } | 696 } |
| 697 | 697 |
| 698 PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& name
, ExceptionState& exceptionState) | 698 PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& name
, ExceptionState& exceptionState) |
| 699 { | 699 { |
| 700 if (!isValidName(name)) { | 700 if (!isValidName(name)) { |
| 701 exceptionState.throwDOMException(InvalidCharacterError, "The tag name pr
ovided ('" + name + "') is not a valid name."); | 701 exceptionState.throwDOMException(InvalidCharacterError, "The tag name pr
ovided ('" + name + "') is not a valid name."); |
| 702 return nullptr; | 702 return nullptr; |
| 703 } | 703 } |
| 704 | 704 |
| 705 if (isXHTMLDocument() || isHTMLDocument()) | 705 if (isXHTMLDocument() || isHTMLDocument()) { |
| 706 return HTMLElementFactory::createHTMLElement(convertLocalName(name), *th
is, 0, false); | 706 auto el = HTMLElementFactory::createHTMLElement(convertLocalName(name),
*this, 0, false); |
| 707 el->taintElementIfFromIsolatedWorld(); |
| 708 return el; |
| 709 } |
| 707 | 710 |
| 708 return Element::create(QualifiedName(nullAtom, name, nullAtom), this); | 711 return Element::create(QualifiedName(nullAtom, name, nullAtom), this); |
| 709 } | 712 } |
| 710 | 713 |
| 711 PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& loca
lName, const AtomicString& typeExtension, ExceptionState& exceptionState) | 714 PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& loca
lName, const AtomicString& typeExtension, ExceptionState& exceptionState) |
| 712 { | 715 { |
| 713 if (!isValidName(localName)) { | 716 if (!isValidName(localName)) { |
| 714 exceptionState.throwDOMException(InvalidCharacterError, "The tag name pr
ovided ('" + localName + "') is not a valid name."); | 717 exceptionState.throwDOMException(InvalidCharacterError, "The tag name pr
ovided ('" + localName + "') is not a valid name."); |
| 715 return nullptr; | 718 return nullptr; |
| 716 } | 719 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 745 | 748 |
| 746 return qName; | 749 return qName; |
| 747 } | 750 } |
| 748 | 751 |
| 749 PassRefPtrWillBeRawPtr<Element> Document::createElementNS(const AtomicString& na
mespaceURI, const AtomicString& qualifiedName, ExceptionState& exceptionState) | 752 PassRefPtrWillBeRawPtr<Element> Document::createElementNS(const AtomicString& na
mespaceURI, const AtomicString& qualifiedName, ExceptionState& exceptionState) |
| 750 { | 753 { |
| 751 QualifiedName qName(createQualifiedName(namespaceURI, qualifiedName, excepti
onState)); | 754 QualifiedName qName(createQualifiedName(namespaceURI, qualifiedName, excepti
onState)); |
| 752 if (qName == QualifiedName::null()) | 755 if (qName == QualifiedName::null()) |
| 753 return nullptr; | 756 return nullptr; |
| 754 | 757 |
| 755 return createElement(qName, false); | 758 auto el = createElement(qName, false); |
| 759 el->taintElementIfFromIsolatedWorld(); |
| 760 return el; |
| 756 } | 761 } |
| 757 | 762 |
| 758 PassRefPtrWillBeRawPtr<Element> Document::createElementNS(const AtomicString& na
mespaceURI, const AtomicString& qualifiedName, const AtomicString& typeExtension
, ExceptionState& exceptionState) | 763 PassRefPtrWillBeRawPtr<Element> Document::createElementNS(const AtomicString& na
mespaceURI, const AtomicString& qualifiedName, const AtomicString& typeExtension
, ExceptionState& exceptionState) |
| 759 { | 764 { |
| 760 QualifiedName qName(createQualifiedName(namespaceURI, qualifiedName, excepti
onState)); | 765 QualifiedName qName(createQualifiedName(namespaceURI, qualifiedName, excepti
onState)); |
| 761 if (qName == QualifiedName::null()) | 766 if (qName == QualifiedName::null()) |
| 762 return nullptr; | 767 return nullptr; |
| 763 | 768 |
| 764 RefPtrWillBeRawPtr<Element> element; | 769 RefPtrWillBeRawPtr<Element> element; |
| 765 if (CustomElement::isValidName(qName.localName()) && registrationContext()) | 770 if (CustomElement::isValidName(qName.localName()) && registrationContext()) |
| (...skipping 5115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5881 #ifndef NDEBUG | 5886 #ifndef NDEBUG |
| 5882 using namespace blink; | 5887 using namespace blink; |
| 5883 void showLiveDocumentInstances() | 5888 void showLiveDocumentInstances() |
| 5884 { | 5889 { |
| 5885 Document::WeakDocumentSet& set = Document::liveDocumentSet(); | 5890 Document::WeakDocumentSet& set = Document::liveDocumentSet(); |
| 5886 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5891 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 5887 for (Document* document : set) | 5892 for (Document* document : set) |
| 5888 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5893 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
| 5889 } | 5894 } |
| 5890 #endif | 5895 #endif |
| OLD | NEW |