| 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 // -------------------------------------------------------------------------- | 164 // -------------------------------------------------------------------------- |
| 165 // not part of the DOM | 165 // not part of the DOM |
| 166 // -------------------------------------------------------------------------- | 166 // -------------------------------------------------------------------------- |
| 167 | 167 |
| 168 void HTMLDocument::addItemToMap(HashCountedSet<AtomicString>& map, const AtomicS
tring& name) | 168 void HTMLDocument::addItemToMap(HashCountedSet<AtomicString>& map, const AtomicS
tring& name) |
| 169 { | 169 { |
| 170 if (name.isEmpty()) | 170 if (name.isEmpty()) |
| 171 return; | 171 return; |
| 172 map.add(name); | 172 map.add(name); |
| 173 if (LocalFrame* f = frame()) | |
| 174 f->script().namedItemAdded(this, name); | |
| 175 } | 173 } |
| 176 | 174 |
| 177 void HTMLDocument::removeItemFromMap(HashCountedSet<AtomicString>& map, const At
omicString& name) | 175 void HTMLDocument::removeItemFromMap(HashCountedSet<AtomicString>& map, const At
omicString& name) |
| 178 { | 176 { |
| 179 if (name.isEmpty()) | 177 if (name.isEmpty()) |
| 180 return; | 178 return; |
| 181 map.remove(name); | 179 map.remove(name); |
| 182 if (LocalFrame* f = frame()) | |
| 183 f->script().namedItemRemoved(this, name); | |
| 184 } | 180 } |
| 185 | 181 |
| 186 void HTMLDocument::addNamedItem(const AtomicString& name) | 182 void HTMLDocument::addNamedItem(const AtomicString& name) |
| 187 { | 183 { |
| 188 addItemToMap(m_namedItemCounts, name); | 184 addItemToMap(m_namedItemCounts, name); |
| 189 } | 185 } |
| 190 | 186 |
| 191 void HTMLDocument::removeNamedItem(const AtomicString& name) | 187 void HTMLDocument::removeNamedItem(const AtomicString& name) |
| 192 { | 188 { |
| 193 removeItemFromMap(m_namedItemCounts, name); | 189 removeItemFromMap(m_namedItemCounts, name); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 } | 229 } |
| 234 | 230 |
| 235 bool HTMLDocument::isCaseSensitiveAttribute(const QualifiedName& attributeName) | 231 bool HTMLDocument::isCaseSensitiveAttribute(const QualifiedName& attributeName) |
| 236 { | 232 { |
| 237 static HashSet<StringImpl*>* htmlCaseInsensitiveAttributesSet = createHtmlCa
seInsensitiveAttributesSet(); | 233 static HashSet<StringImpl*>* htmlCaseInsensitiveAttributesSet = createHtmlCa
seInsensitiveAttributesSet(); |
| 238 bool isPossibleHTMLAttr = !attributeName.hasPrefix() && (attributeName.names
paceURI() == nullAtom); | 234 bool isPossibleHTMLAttr = !attributeName.hasPrefix() && (attributeName.names
paceURI() == nullAtom); |
| 239 return !isPossibleHTMLAttr || !htmlCaseInsensitiveAttributesSet->contains(at
tributeName.localName().impl()); | 235 return !isPossibleHTMLAttr || !htmlCaseInsensitiveAttributesSet->contains(at
tributeName.localName().impl()); |
| 240 } | 236 } |
| 241 | 237 |
| 242 } // namespace blink | 238 } // namespace blink |
| OLD | NEW |