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

Side by Side Diff: sky/engine/core/dom/Element.h

Issue 790673006: Delete focused by mouse code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | sky/engine/core/dom/Element.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void blur(); 236 void blur();
237 // Whether this element can receive focus at all. Most elements are not 237 // Whether this element can receive focus at all. Most elements are not
238 // focusable but some elements, such as form controls and links, are. Unlike 238 // focusable but some elements, such as form controls and links, are. Unlike
239 // rendererIsFocusable(), this method may be called when layout is not up to 239 // rendererIsFocusable(), this method may be called when layout is not up to
240 // date, so it must not use the renderer to determine focusability. 240 // date, so it must not use the renderer to determine focusability.
241 virtual bool supportsFocus() const; 241 virtual bool supportsFocus() const;
242 // Whether the node can actually be focused. 242 // Whether the node can actually be focused.
243 bool isFocusable() const; 243 bool isFocusable() const;
244 bool isKeyboardFocusable() const; 244 bool isKeyboardFocusable() const;
245 bool isMouseFocusable() const; 245 bool isMouseFocusable() const;
246 virtual void willCallDefaultEventHandler(const Event&) override final;
247 void dispatchFocusEvent(Element* oldFocusedElement, FocusType); 246 void dispatchFocusEvent(Element* oldFocusedElement, FocusType);
248 void dispatchBlurEvent(Element* newFocusedElement); 247 void dispatchBlurEvent(Element* newFocusedElement);
249 void dispatchFocusInEvent(const AtomicString& eventType, Element* oldFocused Element); 248 void dispatchFocusInEvent(const AtomicString& eventType, Element* oldFocused Element);
250 void dispatchFocusOutEvent(const AtomicString& eventType, Element* newFocuse dElement); 249 void dispatchFocusOutEvent(const AtomicString& eventType, Element* newFocuse dElement);
251 250
252 String title() const; 251 String title() const;
253 252
254 bool matches(const String& selectors, ExceptionState&); 253 bool matches(const String& selectors, ExceptionState&);
255 254
256 DOMTokenList& classList(); 255 DOMTokenList& classList();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 311
313 void clearTabIndexExplicitlyIfNeeded(); 312 void clearTabIndexExplicitlyIfNeeded();
314 void setTabIndexExplicitly(short); 313 void setTabIndexExplicitly(short);
315 // Subclasses may override this method to affect focusability. Unlike 314 // Subclasses may override this method to affect focusability. Unlike
316 // supportsFocus, this method must be called on an up-to-date layout, so it 315 // supportsFocus, this method must be called on an up-to-date layout, so it
317 // may use the renderer to reason about focusability. This method cannot be 316 // may use the renderer to reason about focusability. This method cannot be
318 // moved to RenderObject because some focusable nodes don't have renderers, 317 // moved to RenderObject because some focusable nodes don't have renderers,
319 // e.g., HTMLOptionElement. 318 // e.g., HTMLOptionElement.
320 virtual bool rendererIsFocusable() const; 319 virtual bool rendererIsFocusable() const;
321 320
322 // These methods are overridden by subclasses whose default focus appearance should not remain hidden on mouse focus.
323 virtual bool wasFocusedByMouse() const { return false; }
324 virtual void setWasFocusedByMouse(bool) { }
325
326 // classAttributeChanged() exists to share code between 321 // classAttributeChanged() exists to share code between
327 // parseAttribute (called via setAttribute()) and 322 // parseAttribute (called via setAttribute()) and
328 // svgAttributeChanged (called when element.className.baseValue is set) 323 // svgAttributeChanged (called when element.className.baseValue is set)
329 void classAttributeChanged(const AtomicString& newClassString); 324 void classAttributeChanged(const AtomicString& newClassString);
330 325
331 private: 326 private:
332 void attributeChanged(const QualifiedName&, const AtomicString&, AttributeMo dificationReason = ModifiedDirectly); 327 void attributeChanged(const QualifiedName&, const AtomicString&, AttributeMo dificationReason = ModifiedDirectly);
333 328
334 bool classChangeNeedsStyleRecalc(const SpaceSplitString& oldClasses, const S paceSplitString& newClasses); 329 bool classChangeNeedsStyleRecalc(const SpaceSplitString& oldClasses, const S paceSplitString& newClasses);
335 330
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 static PassRefPtr<T> create(const QualifiedName&, Document&) 595 static PassRefPtr<T> create(const QualifiedName&, Document&)
601 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 596 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
602 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \ 597 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \
603 { \ 598 { \
604 return adoptRef(new T(tagName, document)); \ 599 return adoptRef(new T(tagName, document)); \
605 } 600 }
606 601
607 } // namespace 602 } // namespace
608 603
609 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_ 604 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698