| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 void setTypeExtension(Element*, const AtomicString& typeExtension); | 51 void setTypeExtension(Element*, const AtomicString& typeExtension); |
| 52 | 52 |
| 53 class CustomElementRegistry : public RefCounted<CustomElementRegistry>, public C
ontextLifecycleObserver { | 53 class CustomElementRegistry : public RefCounted<CustomElementRegistry>, public C
ontextLifecycleObserver { |
| 54 WTF_MAKE_NONCOPYABLE(CustomElementRegistry); WTF_MAKE_FAST_ALLOCATED; | 54 WTF_MAKE_NONCOPYABLE(CustomElementRegistry); WTF_MAKE_FAST_ALLOCATED; |
| 55 public: | 55 public: |
| 56 explicit CustomElementRegistry(Document*); | 56 explicit CustomElementRegistry(Document*); |
| 57 virtual ~CustomElementRegistry() { } | 57 virtual ~CustomElementRegistry() { } |
| 58 | 58 |
| 59 void registerElement(CustomElementConstructorBuilder*, const AtomicString& n
ame, ExceptionCode&); | 59 void registerElement(CustomElementConstructorBuilder*, const AtomicString& n
ame, ExceptionCode&); |
| 60 | 60 |
| 61 bool isUnresolved(Element*) const; | |
| 62 PassRefPtr<CustomElementDefinition> findFor(Element*) const; | 61 PassRefPtr<CustomElementDefinition> findFor(Element*) const; |
| 63 | 62 |
| 64 PassRefPtr<Element> createCustomTagElement(const QualifiedName& localName); | 63 PassRefPtr<Element> createCustomTagElement(const QualifiedName& localName); |
| 65 | 64 |
| 66 Document* document() const; | 65 Document* document() const; |
| 67 | 66 |
| 68 void didGiveTypeExtension(Element*, const AtomicString&); | 67 void didGiveTypeExtension(Element*, const AtomicString&); |
| 69 void customElementWasDestroyed(Element*); | 68 void customElementWasDestroyed(Element*); |
| 70 | 69 |
| 71 static bool isCustomTagName(const AtomicString& name) { return isValidName(n
ame); } | 70 static bool isCustomTagName(const AtomicString& name) { return isValidName(n
ame); } |
| 72 | 71 |
| 73 private: | 72 private: |
| 74 typedef HashMap<AtomicString, RefPtr<CustomElementDefinition> > DefinitionMa
p; | 73 typedef HashMap<AtomicString, RefPtr<CustomElementDefinition> > DefinitionMa
p; |
| 75 static bool isValidName(const AtomicString&); | 74 static bool isValidName(const AtomicString&); |
| 76 | 75 |
| 77 PassRefPtr<CustomElementDefinition> findAndCheckNamespace(const AtomicString
& type, const AtomicString& namespaceURI) const; | 76 PassRefPtr<CustomElementDefinition> findAndCheckNamespace(const AtomicString
& type, const AtomicString& namespaceURI) const; |
| 78 | 77 |
| 79 void didCreateCustomTagElement(CustomElementDefinition*, Element*); | 78 void didCreateCustomTagElement(CustomElementDefinition*, Element*); |
| 80 void didCreateUnresolvedElement(CustomElementDefinition::CustomElementKind,
const AtomicString& type, Element*); | 79 void didCreateUnresolvedElement(CustomElementDefinition::CustomElementKind,
const AtomicString& type, Element*); |
| 81 | 80 |
| 82 DefinitionMap m_definitions; | 81 DefinitionMap m_definitions; |
| 83 CustomElementUpgradeCandidateMap m_candidates; | 82 CustomElementUpgradeCandidateMap m_candidates; |
| 84 }; | 83 }; |
| 85 | 84 |
| 86 } // namespace WebCore | 85 } // namespace WebCore |
| 87 | 86 |
| 88 #endif | 87 #endif |
| OLD | NEW |