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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
726 RefPtr<Element> element; | 726 RefPtr<Element> element; |
727 | 727 |
728 if (RuntimeEnabledFeatures::customElementsEnabled() && CustomElement::isVali dName(localName) && registrationContext()) { | 728 if (RuntimeEnabledFeatures::customElementsEnabled() && CustomElement::isVali dName(localName) && registrationContext()) { |
729 element = registrationContext()->createCustomTagElement(*this, Qualified Name(nullAtom, localName, xhtmlNamespaceURI)); | 729 element = registrationContext()->createCustomTagElement(*this, Qualified Name(nullAtom, localName, xhtmlNamespaceURI)); |
730 } else { | 730 } else { |
731 element = createElement(localName, exceptionState); | 731 element = createElement(localName, exceptionState); |
732 if (exceptionState.hadException()) | 732 if (exceptionState.hadException()) |
733 return 0; | 733 return 0; |
734 } | 734 } |
735 | 735 |
736 if (RuntimeEnabledFeatures::customElementsEnabled() && !typeExtension.isNull () && !typeExtension.isEmpty()) | 736 if (RuntimeEnabledFeatures::customElementsEnabled() && !typeExtension.isEmpt y()) |
737 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension); | 737 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension); |
738 | 738 |
739 return element; | 739 return element; |
740 } | 740 } |
741 | 741 |
742 PassRefPtr<Element> Document::createElementNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, const AtomicString& typeExtension, ExceptionS tate& exceptionState) | 742 PassRefPtr<Element> Document::createElementNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, const AtomicString& typeExtension, ExceptionS tate& exceptionState) |
743 { | 743 { |
744 AtomicString prefix, localName; | 744 AtomicString prefix, localName; |
745 if (!parseQualifiedName(qualifiedName, prefix, localName, exceptionState)) | 745 if (!parseQualifiedName(qualifiedName, prefix, localName, exceptionState)) |
746 return 0; | 746 return 0; |
747 | 747 |
748 QualifiedName qName(prefix, localName, namespaceURI); | 748 QualifiedName qName(prefix, localName, namespaceURI); |
749 if (!hasValidNamespaceForElements(qName)) { | 749 if (!hasValidNamespaceForElements(qName)) { |
750 exceptionState.throwDOMException(NamespaceError, "The namespace URI prov ided ('" + namespaceURI + "') is not valid for the qualified name provided ('" + qualifiedName + "')."); | 750 exceptionState.throwDOMException(NamespaceError, "The namespace URI prov ided ('" + namespaceURI + "') is not valid for the qualified name provided ('" + qualifiedName + "')."); |
751 return 0; | 751 return 0; |
752 } | 752 } |
753 | 753 |
754 RefPtr<Element> element; | 754 RefPtr<Element> element; |
755 if (CustomElement::isValidName(qName.localName()) && registrationContext()) { | 755 if (CustomElement::isValidName(qName.localName()) && registrationContext()) { |
756 element = registrationContext()->createCustomTagElement(*this, qName); | 756 element = registrationContext()->createCustomTagElement(*this, qName); |
757 } else { | 757 } else { |
758 element = createElementNS(namespaceURI, qualifiedName, exceptionState); | 758 element = createElementNS(namespaceURI, qualifiedName, exceptionState); |
759 if (exceptionState.hadException()) | 759 if (exceptionState.hadException()) |
760 return 0; | 760 return 0; |
761 } | 761 } |
762 | 762 |
763 if (!typeExtension.isNull() && !typeExtension.isEmpty()) | 763 if (!typeExtension.isEmpty()) |
dominicc (has gone to gerrit)
2014/01/30 03:14:40
What about CustomElementConstructorBuilder.cpp/con
| |
764 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension); | 764 CustomElementRegistrationContext::setIsAttributeAndTypeExtension(element .get(), typeExtension); |
765 | 765 |
766 return element; | 766 return element; |
767 } | 767 } |
768 | 768 |
769 ScriptValue Document::registerElement(WebCore::ScriptState* state, const AtomicS tring& name, ExceptionState& exceptionState) | 769 ScriptValue Document::registerElement(WebCore::ScriptState* state, const AtomicS tring& name, ExceptionState& exceptionState) |
770 { | 770 { |
771 return registerElement(state, name, Dictionary(), exceptionState); | 771 return registerElement(state, name, Dictionary(), exceptionState); |
772 } | 772 } |
773 | 773 |
(...skipping 4545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5319 if (!page->focusController().isActive() || !page->focusController().isFocuse d()) | 5319 if (!page->focusController().isActive() || !page->focusController().isFocuse d()) |
5320 return false; | 5320 return false; |
5321 if (Frame* focusedFrame = page->focusController().focusedFrame()) { | 5321 if (Frame* focusedFrame = page->focusController().focusedFrame()) { |
5322 if (focusedFrame->tree().isDescendantOf(frame())) | 5322 if (focusedFrame->tree().isDescendantOf(frame())) |
5323 return true; | 5323 return true; |
5324 } | 5324 } |
5325 return false; | 5325 return false; |
5326 } | 5326 } |
5327 | 5327 |
5328 } // namespace WebCore | 5328 } // namespace WebCore |
OLD | NEW |