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 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 { | 199 { |
200 return fastHasAttribute(autofocusAttr) && supportsAutofocus(); | 200 return fastHasAttribute(autofocusAttr) && supportsAutofocus(); |
201 } | 201 } |
202 | 202 |
203 void HTMLFormControlElement::setAutofilled(bool autofilled) | 203 void HTMLFormControlElement::setAutofilled(bool autofilled) |
204 { | 204 { |
205 if (autofilled == m_isAutofilled) | 205 if (autofilled == m_isAutofilled) |
206 return; | 206 return; |
207 | 207 |
208 m_isAutofilled = autofilled; | 208 m_isAutofilled = autofilled; |
209 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(
StyleChangeReason::ControlValue)); | 209 pseudoStateChanged(CSSSelector::PseudoAutofill); |
210 } | 210 } |
211 | 211 |
212 static bool shouldAutofocusOnAttach(const HTMLFormControlElement* element) | 212 static bool shouldAutofocusOnAttach(const HTMLFormControlElement* element) |
213 { | 213 { |
214 if (!element->isAutofocusable()) | 214 if (!element->isAutofocusable()) |
215 return false; | 215 return false; |
216 if (element->document().isSandboxed(SandboxAutomaticFeatures)) { | 216 if (element->document().isSandboxed(SandboxAutomaticFeatures)) { |
217 // FIXME: This message should be moved off the console once a solution t
o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. | 217 // FIXME: This message should be moved off the console once a solution t
o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. |
218 element->document().addConsoleMessage(ConsoleMessage::create(SecurityMes
sageSource, ErrorMessageLevel, "Blocked autofocusing on a form control because t
he form's frame is sandboxed and the 'allow-scripts' permission is not set.")); | 218 element->document().addConsoleMessage(ConsoleMessage::create(SecurityMes
sageSource, ErrorMessageLevel, "Blocked autofocusing on a form control because t
he form's frame is sandboxed and the 'allow-scripts' permission is not set.")); |
219 return false; | 219 return false; |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 | 574 |
575 void HTMLFormControlElement::setFocus(bool flag) | 575 void HTMLFormControlElement::setFocus(bool flag) |
576 { | 576 { |
577 LabelableElement::setFocus(flag); | 577 LabelableElement::setFocus(flag); |
578 | 578 |
579 if (!flag && wasChangedSinceLastFormControlChangeEvent()) | 579 if (!flag && wasChangedSinceLastFormControlChangeEvent()) |
580 dispatchFormControlChangeEvent(); | 580 dispatchFormControlChangeEvent(); |
581 } | 581 } |
582 | 582 |
583 } // namespace blink | 583 } // namespace blink |
OLD | NEW |