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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.h

Issue 2586143004: Blur immediately if an attribute change made an element unfocasable. (Closed)
Patch Set: rebase Created 4 years 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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. 6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved.
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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 virtual bool isPresentationAttribute(const QualifiedName&) const { 349 virtual bool isPresentationAttribute(const QualifiedName&) const {
350 return false; 350 return false;
351 } 351 }
352 virtual void collectStyleForPresentationAttribute(const QualifiedName&, 352 virtual void collectStyleForPresentationAttribute(const QualifiedName&,
353 const AtomicString&, 353 const AtomicString&,
354 MutableStylePropertySet*) {} 354 MutableStylePropertySet*) {}
355 355
356 // For exposing to DOM only. 356 // For exposing to DOM only.
357 NamedNodeMap* attributesForBindings() const; 357 NamedNodeMap* attributesForBindings() const;
358 358
359 enum AttributeModificationReason { ModifiedDirectly, ModifiedByCloning }; 359 enum class AttributeModificationReason { kDirectly, kByParser, kByCloning };
360 360
361 // This method is called whenever an attribute is added, changed or removed. 361 // |attributeChanged| is called whenever an attribute is added, changed or
362 // removed. It handles very common attributes such as id, class, name, style,
363 // and slot.
364 //
365 // While the owner document is parsed, this function is called after all
366 // attributes in a start tag were added to the element.
362 virtual void attributeChanged(const QualifiedName&, 367 virtual void attributeChanged(const QualifiedName&,
363 const AtomicString& oldValue, 368 const AtomicString& oldValue,
364 const AtomicString& newValue, 369 const AtomicString& newValue,
365 AttributeModificationReason = ModifiedDirectly); 370 AttributeModificationReason);
371
372 // |parseAttribute| is called by |attributeChanged|. If an element
373 // implementation needs to check an attribute update, we should override this
kochi 2016/12/21 05:58:09 nit: avoid "we" and just "override this function"
tkent 2016/12/21 06:51:15 Will do.
374 // function.
375 //
376 // While the owner document is parsed, this function is called after all
377 // attributes in a start tag were added to the element.
366 virtual void parseAttribute(const QualifiedName&, 378 virtual void parseAttribute(const QualifiedName&,
367 const AtomicString& oldValue, 379 const AtomicString& oldValue,
368 const AtomicString& newValue); 380 const AtomicString& newValue);
369 381
370 virtual bool hasLegalLinkAttribute(const QualifiedName&) const; 382 virtual bool hasLegalLinkAttribute(const QualifiedName&) const;
371 virtual const QualifiedName& subResourceAttributeName() const; 383 virtual const QualifiedName& subResourceAttributeName() const;
372 384
373 // Only called by the parser immediately after element construction. 385 // Only called by the parser immediately after element construction.
374 void parserSetAttributes(const Vector<Attribute>&); 386 void parserSetAttributes(const Vector<Attribute>&);
375 387
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 1186 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
1175 static T* create(const QualifiedName&, Document&) 1187 static T* create(const QualifiedName&, Document&)
1176 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 1188 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
1177 T* T::create(const QualifiedName& tagName, Document& document) { \ 1189 T* T::create(const QualifiedName& tagName, Document& document) { \
1178 return new T(tagName, document); \ 1190 return new T(tagName, document); \
1179 } 1191 }
1180 1192
1181 } // namespace blink 1193 } // namespace blink
1182 1194
1183 #endif // Element_h 1195 #endif // Element_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698