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

Side by Side Diff: Source/core/html/HTMLFormControlElement.cpp

Issue 660273002: Use style invalidation sets for :-webkit-autofill. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/master
Patch Set: Created 6 years, 2 months 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 * (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
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
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
OLDNEW
« Source/core/css/RuleFeature.cpp ('K') | « Source/core/css/RuleFeature.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698