| Index: third_party/WebKit/Source/core/dom/Element.h
|
| diff --git a/third_party/WebKit/Source/core/dom/Element.h b/third_party/WebKit/Source/core/dom/Element.h
|
| index 240ec279fd27930c3ebc18d8a715b73653b1d06e..604565dcb07440546cc8cace39a82e2efc43b1bc 100644
|
| --- a/third_party/WebKit/Source/core/dom/Element.h
|
| +++ b/third_party/WebKit/Source/core/dom/Element.h
|
| @@ -410,11 +410,15 @@ public:
|
| // layoutObjectIsFocusable(), this method may be called when layout is not up to
|
| // date, so it must not use the layoutObject to determine focusability.
|
| virtual bool supportsFocus() const;
|
| - // Whether the node can actually be focused.
|
| + // isFocusable(), isKeyboardFocusable(), and isMouseFocusable() check
|
| + // whether the element can actually be focused. Callers should ensure
|
| + // ComputedStyle is up to date;
|
| + // e.g. by calling Document::updateLayoutTreeIgnorePendingStylesheets().
|
| bool isFocusable() const;
|
| - bool isFocusedElementInDocument() const;
|
| virtual bool isKeyboardFocusable() const;
|
| virtual bool isMouseFocusable() const;
|
| + bool isFocusedElementInDocument() const;
|
| +
|
| virtual void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType, InputDeviceCapabilities* sourceCapabilities = nullptr);
|
| virtual void dispatchBlurEvent(Element* newFocusedElement, WebFocusType, InputDeviceCapabilities* sourceCapabilities = nullptr);
|
| virtual void dispatchFocusInEvent(const AtomicString& eventType, Element* oldFocusedElement, WebFocusType, InputDeviceCapabilities* sourceCapabilities = nullptr);
|
| @@ -583,11 +587,13 @@ protected:
|
|
|
| void clearTabIndexExplicitlyIfNeeded();
|
| void setTabIndexExplicitly(short);
|
| - // Subclasses may override this method to affect focusability. Unlike
|
| - // supportsFocus, this method must be called on an up-to-date layout, so it
|
| - // may use the layoutObject to reason about focusability. This method cannot be
|
| - // moved to LayoutObject because some focusable nodes don't have layoutObjects,
|
| - // e.g., HTMLOptionElement.
|
| + // Subclasses may override this method to affect focusability. This method
|
| + // must be called on an up-to-date ComputedStyle, so it may use existence of
|
| + // layoutObject and the LayoutObject::style() to reason about focusability.
|
| + // However, it must not retrieve layout information like position and size.
|
| + // This method cannot be moved to LayoutObject because some focusable nodes
|
| + // don't have layoutObjects. e.g., HTMLOptionElement.
|
| + // TODO(tkent): Rename this to isFocusableStyle.
|
| virtual bool layoutObjectIsFocusable() const;
|
|
|
| // classAttributeChanged() exists to share code between
|
|
|