Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: Source/core/dom/CustomElement.h

Issue 23009004: Process Custom Elements in post-order. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Less fragile. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 static void allowTagName(const AtomicString& localName); 55 static void allowTagName(const AtomicString& localName);
56 56
57 // API for registration contexts 57 // API for registration contexts
58 static void define(Element*, PassRefPtr<CustomElementDefinition>); 58 static void define(Element*, PassRefPtr<CustomElementDefinition>);
59 59
60 // API for wrapper creation, which uses a definition as a key 60 // API for wrapper creation, which uses a definition as a key
61 static CustomElementDefinition* definitionFor(Element*); 61 static CustomElementDefinition* definitionFor(Element*);
62 62
63 // API for Element to kick off changes 63 // API for Element to kick off changes
64 64
65 static void didFinishParsingChildren(Element*);
65 static void attributeDidChange(Element*, const AtomicString& name, const Ato micString& oldValue, const AtomicString& newValue); 66 static void attributeDidChange(Element*, const AtomicString& name, const Ato micString& oldValue, const AtomicString& newValue);
66 static void didEnterDocument(Element*, Document*); 67 static void didEnterDocument(Element*, Document*);
67 static void didLeaveDocument(Element*, Document*); 68 static void didLeaveDocument(Element*, Document*);
68 static void wasDestroyed(Element*); 69 static void wasDestroyed(Element*);
69 70
70 private: 71 private:
71 CustomElement(); 72 CustomElement();
72 73
73 static Vector<AtomicString>& allowedCustomTagNames(); 74 static Vector<AtomicString>& allowedCustomTagNames();
74 75
75 // Maps resolved elements to their definitions 76 // Maps resolved elements to their definitions
76 77
77 class DefinitionMap { 78 class DefinitionMap {
78 WTF_MAKE_NONCOPYABLE(DefinitionMap); 79 WTF_MAKE_NONCOPYABLE(DefinitionMap);
79 public: 80 public:
80 DefinitionMap() { } 81 DefinitionMap() { }
81 ~DefinitionMap() { } 82 ~DefinitionMap() { }
82 83
83 void add(Element*, PassRefPtr<CustomElementDefinition>); 84 void add(Element*, PassRefPtr<CustomElementDefinition>);
84 void remove(Element*); 85 void remove(Element* element) { m_definitions.remove(element); }
85 CustomElementDefinition* get(Element*); 86 CustomElementDefinition* get(Element* element) { return m_definitions.ge t(element); }
dglazkov 2013/08/14 20:22:34 is this a const function?
86 87
87 private: 88 private:
88 typedef HashMap<Element*, RefPtr<CustomElementDefinition> > ElementDefin itionHashMap; 89 typedef HashMap<Element*, RefPtr<CustomElementDefinition> > ElementDefin itionHashMap;
89 ElementDefinitionHashMap m_definitions; 90 ElementDefinitionHashMap m_definitions;
90 }; 91 };
91 static DefinitionMap& definitions(); 92 static DefinitionMap& definitions();
92 }; 93 };
93 94
94 } 95 }
95 96
96 #endif // CustomElement_h 97 #endif // CustomElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698