Chromium Code Reviews| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 423 void HTMLElement::attributeChanged(const AttributeModificationParams& params) { | 423 void HTMLElement::attributeChanged(const AttributeModificationParams& params) { |
| 424 Element::attributeChanged(params); | 424 Element::attributeChanged(params); |
| 425 if (params.reason != AttributeModificationReason::kDirectly) | 425 if (params.reason != AttributeModificationReason::kDirectly) |
| 426 return; | 426 return; |
| 427 // adjustedFocusedElementInTreeScope() is not trivial. We should check | 427 // adjustedFocusedElementInTreeScope() is not trivial. We should check |
| 428 // attribute names, then call adjustedFocusedElementInTreeScope(). | 428 // attribute names, then call adjustedFocusedElementInTreeScope(). |
| 429 if (params.name == hiddenAttr && !params.newValue.isNull()) { | 429 if (params.name == hiddenAttr && !params.newValue.isNull()) { |
| 430 if (adjustedFocusedElementInTreeScope() == this) | 430 if (adjustedFocusedElementInTreeScope() == this) |
| 431 blur(); | 431 blur(); |
| 432 } else if (params.name == contenteditableAttr) { | 432 } else if (params.name == contenteditableAttr) { |
| 433 if (document().frame()) { | 433 if (document().frame()) |
| 434 document().frame()->spellChecker().removeSpellingAndGrammarMarkers( | 434 document().frame()->spellChecker().cancelCheck(); |
|
Xiaocheng
2017/03/03 18:24:06
SpellChecker::cancelCheck is not the right functio
| |
| 435 *this, SpellChecker::ElementsType::kOnlyNonEditable); | |
| 436 } | |
| 437 if (adjustedFocusedElementInTreeScope() != this) | 435 if (adjustedFocusedElementInTreeScope() != this) |
| 438 return; | 436 return; |
| 439 // The attribute change may cause supportsFocus() to return false | 437 // The attribute change may cause supportsFocus() to return false |
| 440 // for the element which had focus. | 438 // for the element which had focus. |
| 441 // | 439 // |
| 442 // TODO(tkent): We should avoid updating style. We'd like to check only | 440 // TODO(tkent): We should avoid updating style. We'd like to check only |
| 443 // DOM-level focusability here. | 441 // DOM-level focusability here. |
| 444 document().updateStyleAndLayoutTreeForNode(this); | 442 document().updateStyleAndLayoutTreeForNode(this); |
| 445 if (!supportsFocus()) | 443 if (!supportsFocus()) |
| 446 blur(); | 444 blur(); |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1179 | 1177 |
| 1180 #ifndef NDEBUG | 1178 #ifndef NDEBUG |
| 1181 | 1179 |
| 1182 // For use in the debugger | 1180 // For use in the debugger |
| 1183 void dumpInnerHTML(blink::HTMLElement*); | 1181 void dumpInnerHTML(blink::HTMLElement*); |
| 1184 | 1182 |
| 1185 void dumpInnerHTML(blink::HTMLElement* element) { | 1183 void dumpInnerHTML(blink::HTMLElement* element) { |
| 1186 printf("%s\n", element->innerHTML().ascii().data()); | 1184 printf("%s\n", element->innerHTML().ascii().data()); |
| 1187 } | 1185 } |
| 1188 #endif | 1186 #endif |
| OLD | NEW |