| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // don't want to incur a style update each time. | 213 // don't want to incur a style update each time. |
| 214 if (bodyElement->vLink() != value) | 214 if (bodyElement->vLink() != value) |
| 215 bodyElement->setVLink(value); | 215 bodyElement->setVLink(value); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 // -------------------------------------------------------------------------- | 219 // -------------------------------------------------------------------------- |
| 220 // not part of the DOM | 220 // not part of the DOM |
| 221 // -------------------------------------------------------------------------- | 221 // -------------------------------------------------------------------------- |
| 222 | 222 |
| 223 void HTMLDocument::addItemToMap(HashCountedSet<AtomicStringImpl*>& map, const At
omicString& name) | 223 void HTMLDocument::addItemToMap(HashCountedSet<StringImpl*>& map, const AtomicSt
ring& name) |
| 224 { | 224 { |
| 225 if (name.isEmpty()) | 225 if (name.isEmpty()) |
| 226 return; | 226 return; |
| 227 map.add(name.impl()); | 227 map.add(name.impl()); |
| 228 if (Frame* f = frame()) | 228 if (Frame* f = frame()) |
| 229 f->script()->namedItemAdded(this, name); | 229 f->script()->namedItemAdded(this, name); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void HTMLDocument::removeItemFromMap(HashCountedSet<AtomicStringImpl*>& map, con
st AtomicString& name) | 232 void HTMLDocument::removeItemFromMap(HashCountedSet<StringImpl*>& map, const Ato
micString& name) |
| 233 { | 233 { |
| 234 if (name.isEmpty()) | 234 if (name.isEmpty()) |
| 235 return; | 235 return; |
| 236 map.remove(name.impl()); | 236 map.remove(name.impl()); |
| 237 if (Frame* f = frame()) | 237 if (Frame* f = frame()) |
| 238 f->script()->namedItemRemoved(this, name); | 238 f->script()->namedItemRemoved(this, name); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void HTMLDocument::addNamedItem(const AtomicString& name) | 241 void HTMLDocument::addNamedItem(const AtomicString& name) |
| 242 { | 242 { |
| 243 addItemToMap(m_namedItemCounts, name); | 243 addItemToMap(m_namedItemCounts, name); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void HTMLDocument::removeNamedItem(const AtomicString& name) | 246 void HTMLDocument::removeNamedItem(const AtomicString& name) |
| 247 { | 247 { |
| 248 removeItemFromMap(m_namedItemCounts, name); | 248 removeItemFromMap(m_namedItemCounts, name); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void HTMLDocument::addExtraNamedItem(const AtomicString& name) | 251 void HTMLDocument::addExtraNamedItem(const AtomicString& name) |
| 252 { | 252 { |
| 253 addItemToMap(m_extraNamedItemCounts, name); | 253 addItemToMap(m_extraNamedItemCounts, name); |
| 254 } | 254 } |
| 255 | 255 |
| 256 void HTMLDocument::removeExtraNamedItem(const AtomicString& name) | 256 void HTMLDocument::removeExtraNamedItem(const AtomicString& name) |
| 257 { | 257 { |
| 258 removeItemFromMap(m_extraNamedItemCounts, name); | 258 removeItemFromMap(m_extraNamedItemCounts, name); |
| 259 } | 259 } |
| 260 | 260 |
| 261 static void addLocalNameToSet(HashSet<AtomicStringImpl*>* set, const QualifiedNa
me& qName) | 261 static void addLocalNameToSet(HashSet<StringImpl*>* set, const QualifiedName& qN
ame) |
| 262 { | 262 { |
| 263 set->add(qName.localName().impl()); | 263 set->add(qName.localName().impl()); |
| 264 } | 264 } |
| 265 | 265 |
| 266 static HashSet<AtomicStringImpl*>* createHtmlCaseInsensitiveAttributesSet() | 266 static HashSet<StringImpl*>* createHtmlCaseInsensitiveAttributesSet() |
| 267 { | 267 { |
| 268 // This is the list of attributes in HTML 4.01 with values marked as "[CI]"
or case-insensitive | 268 // This is the list of attributes in HTML 4.01 with values marked as "[CI]"
or case-insensitive |
| 269 // Mozilla treats all other values as case-sensitive, thus so do we. | 269 // Mozilla treats all other values as case-sensitive, thus so do we. |
| 270 HashSet<AtomicStringImpl*>* attrSet = new HashSet<AtomicStringImpl*>; | 270 HashSet<StringImpl*>* attrSet = new HashSet<StringImpl*>; |
| 271 | 271 |
| 272 addLocalNameToSet(attrSet, accept_charsetAttr); | 272 addLocalNameToSet(attrSet, accept_charsetAttr); |
| 273 addLocalNameToSet(attrSet, acceptAttr); | 273 addLocalNameToSet(attrSet, acceptAttr); |
| 274 addLocalNameToSet(attrSet, alignAttr); | 274 addLocalNameToSet(attrSet, alignAttr); |
| 275 addLocalNameToSet(attrSet, alinkAttr); | 275 addLocalNameToSet(attrSet, alinkAttr); |
| 276 addLocalNameToSet(attrSet, axisAttr); | 276 addLocalNameToSet(attrSet, axisAttr); |
| 277 addLocalNameToSet(attrSet, bgcolorAttr); | 277 addLocalNameToSet(attrSet, bgcolorAttr); |
| 278 addLocalNameToSet(attrSet, charsetAttr); | 278 addLocalNameToSet(attrSet, charsetAttr); |
| 279 addLocalNameToSet(attrSet, checkedAttr); | 279 addLocalNameToSet(attrSet, checkedAttr); |
| 280 addLocalNameToSet(attrSet, clearAttr); | 280 addLocalNameToSet(attrSet, clearAttr); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 addLocalNameToSet(attrSet, typeAttr); | 313 addLocalNameToSet(attrSet, typeAttr); |
| 314 addLocalNameToSet(attrSet, valignAttr); | 314 addLocalNameToSet(attrSet, valignAttr); |
| 315 addLocalNameToSet(attrSet, valuetypeAttr); | 315 addLocalNameToSet(attrSet, valuetypeAttr); |
| 316 addLocalNameToSet(attrSet, vlinkAttr); | 316 addLocalNameToSet(attrSet, vlinkAttr); |
| 317 | 317 |
| 318 return attrSet; | 318 return attrSet; |
| 319 } | 319 } |
| 320 | 320 |
| 321 bool HTMLDocument::isCaseSensitiveAttribute(const QualifiedName& attributeName) | 321 bool HTMLDocument::isCaseSensitiveAttribute(const QualifiedName& attributeName) |
| 322 { | 322 { |
| 323 static HashSet<AtomicStringImpl*>* htmlCaseInsensitiveAttributesSet = create
HtmlCaseInsensitiveAttributesSet(); | 323 static HashSet<StringImpl*>* htmlCaseInsensitiveAttributesSet = createHtmlCa
seInsensitiveAttributesSet(); |
| 324 bool isPossibleHTMLAttr = !attributeName.hasPrefix() && (attributeName.names
paceURI() == nullAtom); | 324 bool isPossibleHTMLAttr = !attributeName.hasPrefix() && (attributeName.names
paceURI() == nullAtom); |
| 325 return !isPossibleHTMLAttr || !htmlCaseInsensitiveAttributesSet->contains(at
tributeName.localName().impl()); | 325 return !isPossibleHTMLAttr || !htmlCaseInsensitiveAttributesSet->contains(at
tributeName.localName().impl()); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void HTMLDocument::clear() | 328 void HTMLDocument::clear() |
| 329 { | 329 { |
| 330 // FIXME: This does nothing, and that seems unlikely to be correct. | 330 // FIXME: This does nothing, and that seems unlikely to be correct. |
| 331 // We've long had a comment saying that IE doesn't support this. | 331 // We've long had a comment saying that IE doesn't support this. |
| 332 // But I do see it in the documentation for Mozilla. | 332 // But I do see it in the documentation for Mozilla. |
| 333 } | 333 } |
| 334 | 334 |
| 335 } | 335 } |
| OLD | NEW |