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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLElement.cpp

Issue 2556043002: Avoid WTF::Vector::at() and operator[] in core/html. (Closed)
Patch Set: _ Created 4 years 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
OLDNEW
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) 2004-2008, 2013, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 {onwebkitanimationendAttr, EventTypeNames::webkitAnimationEnd}, 412 {onwebkitanimationendAttr, EventTypeNames::webkitAnimationEnd},
413 {onwebkitanimationiterationAttr, 413 {onwebkitanimationiterationAttr,
414 EventTypeNames::webkitAnimationIteration}, 414 EventTypeNames::webkitAnimationIteration},
415 {onwebkitanimationstartAttr, EventTypeNames::webkitAnimationStart}, 415 {onwebkitanimationstartAttr, EventTypeNames::webkitAnimationStart},
416 {onwebkitfullscreenchangeAttr, EventTypeNames::webkitfullscreenchange}, 416 {onwebkitfullscreenchangeAttr, EventTypeNames::webkitfullscreenchange},
417 {onwebkitfullscreenerrorAttr, EventTypeNames::webkitfullscreenerror}, 417 {onwebkitfullscreenerrorAttr, EventTypeNames::webkitfullscreenerror},
418 {onwebkittransitionendAttr, EventTypeNames::webkitTransitionEnd}, 418 {onwebkittransitionendAttr, EventTypeNames::webkitTransitionEnd},
419 {onwheelAttr, EventTypeNames::wheel}, 419 {onwheelAttr, EventTypeNames::wheel},
420 }; 420 };
421 421
422 for (size_t i = 0; i < WTF_ARRAY_LENGTH(attrToEventNames); i++) 422 for (const auto& name : attrToEventNames)
423 attributeNameToEventNameMap.set(attrToEventNames[i].attr.localName(), 423 attributeNameToEventNameMap.set(name.attr.localName(), name.event);
424 attrToEventNames[i].event);
425 } 424 }
426 425
427 return attributeNameToEventNameMap.get(attrName.localName()); 426 return attributeNameToEventNameMap.get(attrName.localName());
428 } 427 }
429 428
430 void HTMLElement::parseAttribute(const QualifiedName& name, 429 void HTMLElement::parseAttribute(const QualifiedName& name,
431 const AtomicString& oldValue, 430 const AtomicString& oldValue,
432 const AtomicString& value) { 431 const AtomicString& value) {
433 if (name == tabindexAttr || name == XMLNames::langAttr) 432 if (name == tabindexAttr || name == XMLNames::langAttr)
434 return Element::parseAttribute(name, oldValue, value); 433 return Element::parseAttribute(name, oldValue, value);
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 1192
1194 #ifndef NDEBUG 1193 #ifndef NDEBUG
1195 1194
1196 // For use in the debugger 1195 // For use in the debugger
1197 void dumpInnerHTML(blink::HTMLElement*); 1196 void dumpInnerHTML(blink::HTMLElement*);
1198 1197
1199 void dumpInnerHTML(blink::HTMLElement* element) { 1198 void dumpInnerHTML(blink::HTMLElement* element) {
1200 printf("%s\n", element->innerHTML().ascii().data()); 1199 printf("%s\n", element->innerHTML().ascii().data());
1201 } 1200 }
1202 #endif 1201 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698