| 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) 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 {onwheelAttr, EventTypeNames::wheel}, | 419 {onwheelAttr, EventTypeNames::wheel}, |
| 420 }; | 420 }; |
| 421 | 421 |
| 422 for (const auto& name : attrToEventNames) | 422 for (const auto& name : attrToEventNames) |
| 423 attributeNameToEventNameMap.set(name.attr.localName(), name.event); | 423 attributeNameToEventNameMap.set(name.attr.localName(), name.event); |
| 424 } | 424 } |
| 425 | 425 |
| 426 return attributeNameToEventNameMap.get(attrName.localName()); | 426 return attributeNameToEventNameMap.get(attrName.localName()); |
| 427 } | 427 } |
| 428 | 428 |
| 429 void HTMLElement::attributeChanged(const QualifiedName& name, |
| 430 const AtomicString& oldValue, |
| 431 const AtomicString& newValue, |
| 432 AttributeModificationReason reason) { |
| 433 Element::attributeChanged(name, oldValue, newValue, reason); |
| 434 if (reason != AttributeModificationReason::kDirectly) |
| 435 return; |
| 436 if (adjustedFocusedElementInTreeScope() != this) |
| 437 return; |
| 438 if (name == hiddenAttr && !newValue.isNull()) { |
| 439 blur(); |
| 440 } else if (name == contenteditableAttr) { |
| 441 // supportsFocus() behavior depends on element classes. It's hard to avoid |
| 442 // to call it, and it needs up-to-date style. |
| 443 document().updateStyleAndLayoutTreeForNode(this); |
| 444 if (!supportsFocus()) |
| 445 blur(); |
| 446 } |
| 447 } |
| 448 |
| 429 void HTMLElement::parseAttribute(const QualifiedName& name, | 449 void HTMLElement::parseAttribute(const QualifiedName& name, |
| 430 const AtomicString& oldValue, | 450 const AtomicString& oldValue, |
| 431 const AtomicString& value) { | 451 const AtomicString& value) { |
| 432 if (name == tabindexAttr || name == XMLNames::langAttr) | 452 if (name == tabindexAttr || name == XMLNames::langAttr) |
| 433 return Element::parseAttribute(name, oldValue, value); | 453 return Element::parseAttribute(name, oldValue, value); |
| 434 | 454 |
| 435 if (name == dirAttr) { | 455 if (name == dirAttr) { |
| 436 dirAttributeChanged(value); | 456 dirAttributeChanged(value); |
| 437 } else if (name == langAttr) { | 457 } else if (name == langAttr) { |
| 438 pseudoStateChanged(CSSSelector::PseudoLang); | 458 pseudoStateChanged(CSSSelector::PseudoLang); |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 | 1212 |
| 1193 #ifndef NDEBUG | 1213 #ifndef NDEBUG |
| 1194 | 1214 |
| 1195 // For use in the debugger | 1215 // For use in the debugger |
| 1196 void dumpInnerHTML(blink::HTMLElement*); | 1216 void dumpInnerHTML(blink::HTMLElement*); |
| 1197 | 1217 |
| 1198 void dumpInnerHTML(blink::HTMLElement* element) { | 1218 void dumpInnerHTML(blink::HTMLElement* element) { |
| 1199 printf("%s\n", element->innerHTML().ascii().data()); | 1219 printf("%s\n", element->innerHTML().ascii().data()); |
| 1200 } | 1220 } |
| 1201 #endif | 1221 #endif |
| OLD | NEW |