65 }; |
65 }; |
66 |
66 |
67 //typedef HashMap<MappedAttributeKey, CSSMappedAttributeDeclaration*, MappedAttributeHash, MappedAttributeKeyTraits> MappedAttributeDecls; |
67 //typedef HashMap<MappedAttributeKey, CSSMappedAttributeDeclaration*, MappedAttributeHash, MappedAttributeKeyTraits> MappedAttributeDecls; |
68 typedef MappedAttributeKey* MappedAttributeKeyPtr; |
68 typedef MappedAttributeKey* MappedAttributeKeyPtr; |
69 typedef HashMap<MappedAttributeKeyPtr, CSSMappedAttributeDeclaration*, MappedAttributeHash, MappedAttributeKeyTraits> MappedAttributeDecls; |
69 typedef HashMap<MappedAttributeKeyPtr, CSSMappedAttributeDeclaration*, MappedAttributeHash, MappedAttributeKeyTraits> MappedAttributeDecls; |
|
70 typedef HashMap<MappedAttributeKeyPtr, CSSMappedAttributeDeclaration*, MappedAttributeHash, MappedAttributeKeyTraits>::iterator MappedAttributeDeclsIterator; |
70 |
71 |
71 static MappedAttributeDecls* mappedAttributeDecls = 0; |
72 static MappedAttributeDecls* mappedAttributeDecls = 0; |
|
73 |
|
74 struct mappedAttributeCleaner { |
|
75 ~mappedAttributeCleaner() { |
|
76 if( mappedAttributeDecls ) { |
|
77 MappedAttributeDeclsIterator end = mappedAttributeDecls->end(); |
|
78 for (MappedAttributeDeclsIterator it = mappedAttributeDecls->begin(); it != end; ++it) |
|
79 { |
|
80 MappedAttributeKey* obj = (*it).first; |
|
81 delete obj; |
|
82 } |
|
83 mappedAttributeDecls->clear(); |
|
84 delete mappedAttributeDecls; |
|
85 mappedAttributeDecls = 0; |
|
86 } |
|
87 } |
|
88 }; |
|
89 struct mappedAttributeCleaner mappedAttribute; |
72 |
90 |
73 CSSMappedAttributeDeclaration* StyledElement::getMappedAttributeDecl(MappedAttributeEntry entryType, Attribute* attr) |
91 CSSMappedAttributeDeclaration* StyledElement::getMappedAttributeDecl(MappedAttributeEntry entryType, Attribute* attr) |
74 { |
92 { |
75 if (!mappedAttributeDecls) |
93 if (!mappedAttributeDecls) |
76 return 0; |
94 return 0; |