| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/html/HTMLUnknownElement.h" | 5 #include "core/html/HTMLUnknownElement.h" |
| 6 | 6 |
| 7 #include "core/frame/UseCounter.h" | 7 #include "core/frame/UseCounter.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 HTMLUnknownElement::HTMLUnknownElement(const QualifiedName& tagName, | 11 HTMLUnknownElement::HTMLUnknownElement(const QualifiedName& tagName, |
| 12 Document& document) | 12 Document& document) |
| 13 : HTMLElement(tagName, document) { | 13 : HTMLElement(tagName, document) { |
| 14 if (tagName.localName() == "data") | 14 if (tagName.localName() == "data") |
| 15 UseCounter::count(document, UseCounter::DataElement); | 15 UseCounter::count(document, UseCounter::DataElement); |
| 16 else if (tagName.localName() == "time") | 16 else if (tagName.localName() == "time") |
| 17 UseCounter::count(document, UseCounter::TimeElement); | 17 UseCounter::count(document, UseCounter::TimeElement); |
| 18 else if (tagName.localName() == "menuitem") | 18 else if (tagName.localName() == "menuitem") |
| 19 UseCounter::count(document, UseCounter::MenuItemElement); | 19 UseCounter::count(document, UseCounter::MenuItemElement); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void HTMLUnknownElement::parseAttribute( |
| 23 const AttributeModificationParams& params) { |
| 24 if (params.name == HTMLNames::iconAttr && hasTagName(HTMLNames::menuitemTag)) |
| 25 UseCounter::count(document(), UseCounter::MenuItemElementIconAttribute); |
| 26 HTMLElement::parseAttribute(params); |
| 27 } |
| 28 |
| 22 } // namespace blink | 29 } // namespace blink |
| OLD | NEW |