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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
751 | 751 |
752 return &domWindow()->location(); | 752 return &domWindow()->location(); |
753 } | 753 } |
754 | 754 |
755 void Document::childrenChanged(const ChildrenChange& change) | 755 void Document::childrenChanged(const ChildrenChange& change) |
756 { | 756 { |
757 ContainerNode::childrenChanged(change); | 757 ContainerNode::childrenChanged(change); |
758 m_documentElement = ElementTraversal::firstWithin(*this); | 758 m_documentElement = ElementTraversal::firstWithin(*this); |
759 } | 759 } |
760 | 760 |
761 AtomicString Document::localNameForHTMLDocument(const AtomicString& name) | |
762 { | |
763 return Document::isHTMLDocument() ? name.lower() : name; | |
esprehn
2014/08/13 07:01:10
No need to add Document:: to call a method. This p
deepak.sa
2014/08/13 12:44:38
Done.
| |
764 } | |
765 | |
761 PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& name , ExceptionState& exceptionState) | 766 PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& name , ExceptionState& exceptionState) |
762 { | 767 { |
763 if (!isValidName(name)) { | 768 if (!isValidName(name)) { |
764 exceptionState.throwDOMException(InvalidCharacterError, "The tag name pr ovided ('" + name + "') is not a valid name."); | 769 exceptionState.throwDOMException(InvalidCharacterError, "The tag name pr ovided ('" + name + "') is not a valid name."); |
765 return nullptr; | 770 return nullptr; |
766 } | 771 } |
767 | 772 |
768 if (isXHTMLDocument() || isHTMLDocument()) | 773 if (isXHTMLDocument() || isHTMLDocument()) |
769 return HTMLElementFactory::createHTMLElement(isHTMLDocument() ? name.low er() : name, *this, 0, false); | 774 return HTMLElementFactory::createHTMLElement(localNameForHTMLDocument(na me), *this, 0, false); |
770 | 775 |
771 return Element::create(QualifiedName(nullAtom, name, nullAtom), this); | 776 return Element::create(QualifiedName(nullAtom, name, nullAtom), this); |
772 } | 777 } |
773 | 778 |
774 PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& loca lName, const AtomicString& typeExtension, ExceptionState& exceptionState) | 779 PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& loca lName, const AtomicString& typeExtension, ExceptionState& exceptionState) |
775 { | 780 { |
776 if (!isValidName(localName)) { | 781 if (!isValidName(localName)) { |
777 exceptionState.throwDOMException(InvalidCharacterError, "The tag name pr ovided ('" + localName + "') is not a valid name."); | 782 exceptionState.throwDOMException(InvalidCharacterError, "The tag name pr ovided ('" + localName + "') is not a valid name."); |
778 return nullptr; | 783 return nullptr; |
779 } | 784 } |
780 | 785 |
781 RefPtrWillBeRawPtr<Element> element; | 786 RefPtrWillBeRawPtr<Element> element; |
782 | 787 |
783 if (CustomElement::isValidName(localName) && registrationContext()) { | 788 if (CustomElement::isValidName(localName) && registrationContext()) { |
784 element = registrationContext()->createCustomTagElement(*this, Qualified Name(nullAtom, localName, xhtmlNamespaceURI)); | 789 element = registrationContext()->createCustomTagElement(*this, Qualified Name(nullAtom, localNameForHTMLDocument(localName), xhtmlNamespaceURI)); |
785 } else { | 790 } else { |
786 element = createElement(localName, exceptionState); | 791 element = createElement(localName, exceptionState); |
787 if (exceptionState.hadException()) | 792 if (exceptionState.hadException()) |
788 return nullptr; | 793 return nullptr; |
789 } | 794 } |
790 | 795 |
791 if (!typeExtension.isEmpty()) | 796 if (!typeExtension.isEmpty()) |
792 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension); | 797 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension); |
793 | 798 |
794 return element.release(); | 799 return element.release(); |
(...skipping 5107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5902 using namespace blink; | 5907 using namespace blink; |
5903 void showLiveDocumentInstances() | 5908 void showLiveDocumentInstances() |
5904 { | 5909 { |
5905 WeakDocumentSet& set = liveDocumentSet(); | 5910 WeakDocumentSet& set = liveDocumentSet(); |
5906 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5911 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5907 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { | 5912 for (WeakDocumentSet::const_iterator it = set.begin(); it != set.end(); ++it ) { |
5908 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); | 5913 fprintf(stderr, "- Document %p URL: %s\n", *it, (*it)->url().string().ut f8().data()); |
5909 } | 5914 } |
5910 } | 5915 } |
5911 #endif | 5916 #endif |
OLD | NEW |