| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef CustomElementUpgradeCandidateMap_h | 31 #ifndef CustomElementUpgradeCandidateMap_h |
| 32 #define CustomElementUpgradeCandidateMap_h | 32 #define CustomElementUpgradeCandidateMap_h |
| 33 | 33 |
| 34 #include "core/dom/CustomElementDefinition.h" | 34 #include "core/dom/CustomElementDefinition.h" |
| 35 #include "core/dom/Element.h" | 35 #include "core/dom/Element.h" |
| 36 #include "wtf/HashMap.h" | 36 #include "wtf/HashMap.h" |
| 37 #include "wtf/HashSet.h" | 37 #include "wtf/HashSet.h" |
| 38 #include "wtf/Noncopyable.h" | 38 #include "wtf/Noncopyable.h" |
| 39 #include "wtf/Vector.h" |
| 39 #include "wtf/text/AtomicString.h" | 40 #include "wtf/text/AtomicString.h" |
| 40 #include "wtf/text/AtomicStringHash.h" | 41 #include "wtf/text/AtomicStringHash.h" |
| 41 | 42 |
| 42 namespace WebCore { | 43 namespace WebCore { |
| 43 | 44 |
| 44 class CustomElementUpgradeCandidateMap { | 45 class CustomElementUpgradeCandidateMap { |
| 45 WTF_MAKE_NONCOPYABLE(CustomElementUpgradeCandidateMap); | 46 WTF_MAKE_NONCOPYABLE(CustomElementUpgradeCandidateMap); |
| 46 public: | 47 public: |
| 47 CustomElementUpgradeCandidateMap() { } | 48 CustomElementUpgradeCandidateMap() { } |
| 48 | 49 |
| 49 typedef HashSet<Element*> ElementSet; | |
| 50 | |
| 51 void add(CustomElementDefinition::CustomElementKind, const AtomicString& typ
e, Element*); | 50 void add(CustomElementDefinition::CustomElementKind, const AtomicString& typ
e, Element*); |
| 52 bool contains(Element*) const; | |
| 53 void remove(Element*); | 51 void remove(Element*); |
| 54 ElementSet takeUpgradeCandidatesFor(CustomElementDefinition*); | 52 Vector<Element*> takeUpgradeCandidatesFor(CustomElementDefinition*); |
| 55 | 53 |
| 56 private: | 54 private: |
| 57 typedef std::pair<CustomElementDefinition::CustomElementKind, AtomicString>
RequiredDefinition; | 55 typedef std::pair<CustomElementDefinition::CustomElementKind, AtomicString>
RequiredDefinition; |
| 58 typedef HashMap<Element*, RequiredDefinition> UnresolvedElementMap; | 56 typedef HashMap<Element*, RequiredDefinition> UpgradeCandidateMap; |
| 57 typedef HashSet<Element*> ElementSet; |
| 59 typedef HashMap<AtomicString, ElementSet> UnresolvedDefinitionMap; | 58 typedef HashMap<AtomicString, ElementSet> UnresolvedDefinitionMap; |
| 60 | 59 |
| 61 bool matches(CustomElementDefinition*, Element*); | 60 bool matches(CustomElementDefinition*, Element*); |
| 62 | 61 |
| 63 UnresolvedElementMap m_unresolvedElements; | 62 UpgradeCandidateMap m_upgradeCandidates; |
| 64 UnresolvedDefinitionMap m_unresolvedDefinitions; | 63 UnresolvedDefinitionMap m_unresolvedDefinitions; |
| 65 }; | 64 }; |
| 66 | 65 |
| 67 } | 66 } |
| 68 | 67 |
| 69 #endif // CustomElementUpgradeCandidateMap_h | 68 #endif // CustomElementUpgradeCandidateMap_h |
| 70 | 69 |
| OLD | NEW |