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

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

Issue 1420693006: Introduce a struct to store arguments of Element::focus(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 IsInCanvasSubtree = 1 << 2, 80 IsInCanvasSubtree = 1 << 2,
81 ContainsFullScreenElement = 1 << 3, 81 ContainsFullScreenElement = 1 << 3,
82 IsInTopLayer = 1 << 4, 82 IsInTopLayer = 1 << 4,
83 HasPendingResources = 1 << 5, 83 HasPendingResources = 1 << 5,
84 84
85 NumberOfElementFlags = 6, // Required size of bitfield used to store the fla gs. 85 NumberOfElementFlags = 6, // Required size of bitfield used to store the fla gs.
86 }; 86 };
87 87
88 enum class ShadowRootType; 88 enum class ShadowRootType;
89 89
90 enum class SelectionBehaviorOnFocus {
91 Reset,
92 Restore,
93 };
94
95 struct FocusParams {
96 STACK_ALLOCATED();
97
98 FocusParams() {}
99 FocusParams(SelectionBehaviorOnFocus selection, WebFocusType focusType, Inpu tDeviceCapabilities* capabilities)
100 : selectionBehavior(selection)
101 , type(focusType)
102 , sourceCapabilities(capabilities) {}
103
104 SelectionBehaviorOnFocus selectionBehavior = SelectionBehaviorOnFocus::Resto re;
105 WebFocusType type = WebFocusTypeNone;
106 Member<InputDeviceCapabilities> sourceCapabilities = nullptr;
107 };
108
90 typedef WillBeHeapVector<RefPtrWillBeMember<Attr>> AttrNodeList; 109 typedef WillBeHeapVector<RefPtrWillBeMember<Attr>> AttrNodeList;
91 110
92 class CORE_EXPORT Element : public ContainerNode { 111 class CORE_EXPORT Element : public ContainerNode {
93 DEFINE_WRAPPERTYPEINFO(); 112 DEFINE_WRAPPERTYPEINFO();
94 public: 113 public:
95 static PassRefPtrWillBeRawPtr<Element> create(const QualifiedName&, Document *); 114 static PassRefPtrWillBeRawPtr<Element> create(const QualifiedName&, Document *);
96 ~Element() override; 115 ~Element() override;
97 116
98 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); 117 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy);
99 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); 118 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 383
365 virtual bool isLiveLink() const { return false; } 384 virtual bool isLiveLink() const { return false; }
366 KURL hrefURL() const; 385 KURL hrefURL() const;
367 386
368 KURL getURLAttribute(const QualifiedName&) const; 387 KURL getURLAttribute(const QualifiedName&) const;
369 KURL getNonEmptyURLAttribute(const QualifiedName&) const; 388 KURL getNonEmptyURLAttribute(const QualifiedName&) const;
370 389
371 virtual const AtomicString imageSourceURL() const; 390 virtual const AtomicString imageSourceURL() const;
372 virtual Image* imageContents() { return nullptr; } 391 virtual Image* imageContents() { return nullptr; }
373 392
374 virtual void focus(bool restorePreviousSelection = true, WebFocusType = WebF ocusTypeNone, InputDeviceCapabilities* sourceCapabilities = nullptr); 393 virtual void focus(const FocusParams& = FocusParams());
375 virtual void updateFocusAppearance(bool restorePreviousSelection); 394 virtual void updateFocusAppearance(SelectionBehaviorOnFocus);
376 virtual void blur(); 395 virtual void blur();
377 396
378 void setDistributeScroll(ScrollStateCallback*, String nativeScrollBehavior); 397 void setDistributeScroll(ScrollStateCallback*, String nativeScrollBehavior);
379 void nativeDistributeScroll(ScrollState&); 398 void nativeDistributeScroll(ScrollState&);
380 void setApplyScroll(ScrollStateCallback*, String nativeScrollBehavior); 399 void setApplyScroll(ScrollStateCallback*, String nativeScrollBehavior);
381 void nativeApplyScroll(ScrollState&); 400 void nativeApplyScroll(ScrollState&);
382 401
383 void callDistributeScroll(ScrollState&); 402 void callDistributeScroll(ScrollState&);
384 void callApplyScroll(ScrollState&); 403 void callApplyScroll(ScrollState&);
385 404
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) 918 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&)
900 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 919 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
901 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document& document) \ 920 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document& document) \
902 { \ 921 { \
903 return adoptRefWillBeNoop(new T(tagName, document)); \ 922 return adoptRefWillBeNoop(new T(tagName, document)); \
904 } 923 }
905 924
906 } // namespace 925 } // namespace
907 926
908 #endif // Element_h 927 #endif // Element_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698