Diff
Modified: trunk/Source/WebCore/ChangeLog (150709 => 150710)
--- trunk/Source/WebCore/ChangeLog 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/ChangeLog 2013-05-26 09:39:24 UTC (rev 150710)
@@ -1,5 +1,53 @@
2013-05-25 Andreas Kling <akl...@apple.com>
+ Move Node::supportsFocus() to Element.
+ <http://webkit.org/b/116778>
+
+ Reviewed by Antti Koivisto.
+
+ Node never supports focus, so move supportsFocus() to Element instead.
+
+ * dom/Element.h:
+ * dom/Node.cpp:
+ * dom/Node.h:
+
+ Removed Node::supportsFocus(), it always returned false anyway.
+
+ * accessibility/AccessibilityNodeObject.cpp:
+ (WebCore::AccessibilityNodeObject::canSetFocusAttribute):
+
+ Check that the underlying Node is an Element before asking if it supports focus.
+
+ * html/HTMLAnchorElement.h:
+ * html/HTMLAreaElement.h:
+ * html/HTMLBodyElement.h:
+ * html/HTMLElement.h:
+ * html/HTMLFieldSetElement.h:
+ * html/HTMLFormControlElement.h:
+ * html/HTMLFrameElementBase.h:
+ * html/HTMLMediaElement.h:
+ * html/HTMLOptGroupElement.h:
+ * html/HTMLOptionElement.h:
+ * html/HTMLOutputElement.h:
+ * svg/SVGAElement.h:
+ * svg/SVGCircleElement.h:
+ * svg/SVGEllipseElement.h:
+ * svg/SVGGElement.h:
+ * svg/SVGImageElement.h:
+ * svg/SVGLineElement.h:
+ * svg/SVGPathElement.h:
+ * svg/SVGPolyElement.h:
+ * svg/SVGRectElement.h:
+ * svg/SVGSVGElement.h:
+ * svg/SVGSwitchElement.h:
+ * svg/SVGSymbolElement.h:
+ * svg/SVGTextElement.h:
+ * svg/SVGUseElement.h:
+
+ OVERRIDE ALL THE THINGS!
+
+2013-05-25 Andreas Kling <akl...@apple.com>
+
Move Node::isFocusable() to Element.
<http://webkit.org/b/116777>
Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (150709 => 150710)
--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp 2013-05-26 09:39:24 UTC (rev 150710)
@@ -1785,10 +1785,15 @@
if (!node)
return false;
- if (isDisabledFormControl(node))
+ if (!node->isElementNode())
return false;
- return node->supportsFocus();
+ Element* element = toElement(node);
+
+ if (element->isDisabledFormControl())
+ return false;
+
+ return element->supportsFocus();
}
AccessibilityRole AccessibilityNodeObject::determineAriaRoleAttribute() const
Modified: trunk/Source/WebCore/dom/Element.h (150709 => 150710)
--- trunk/Source/WebCore/dom/Element.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/dom/Element.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -432,6 +432,7 @@
virtual void setHovered(bool flag = true);
virtual void setFocus(bool flag);
+ virtual bool supportsFocus() const;
virtual bool isFocusable() const;
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
virtual bool isMouseFocusable() const;
@@ -655,7 +656,6 @@
void clearTabIndexExplicitlyIfNeeded();
void setTabIndexExplicitly(short);
- virtual bool supportsFocus() const OVERRIDE;
PassRefPtr<HTMLCollection> ensureCachedHTMLCollection(CollectionType);
HTMLCollection* cachedHTMLCollection(CollectionType);
Modified: trunk/Source/WebCore/dom/Node.cpp (150709 => 150710)
--- trunk/Source/WebCore/dom/Node.cpp 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/dom/Node.cpp 2013-05-26 09:39:24 UTC (rev 150710)
@@ -845,11 +845,6 @@
markAncestorsWithChildNeedsStyleRecalc();
}
-bool Node::supportsFocus() const
-{
- return false;
-}
-
unsigned Node::nodeIndex() const
{
Node *_tempNode = previousSibling();
Modified: trunk/Source/WebCore/dom/Node.h (150709 => 150710)
--- trunk/Source/WebCore/dom/Node.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/dom/Node.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -399,10 +399,6 @@
virtual void setActive(bool flag = true, bool pause = false);
- // Whether this kind of node can receive focus by default. Most nodes are
- // not focusable but some elements, such as form controls and links, are.
- virtual bool supportsFocus() const;
-
enum UserSelectAllTreatment {
UserSelectAllDoesNotAffectEditability,
UserSelectAllIsAlwaysNonEditable
Modified: trunk/Source/WebCore/html/HTMLAnchorElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLAnchorElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -108,7 +108,7 @@
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
private:
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual bool isMouseFocusable() const OVERRIDE;
virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
virtual void defaultEventHandler(Event*);
Modified: trunk/Source/WebCore/html/HTMLAreaElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLAreaElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLAreaElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -51,7 +51,7 @@
HTMLAreaElement(const QualifiedName&, Document*);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual String target() const;
virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
virtual bool isMouseFocusable() const OVERRIDE;
Modified: trunk/Source/WebCore/html/HTMLBodyElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLBodyElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLBodyElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -79,7 +79,7 @@
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual int scrollLeft();
virtual void setScrollLeft(int scrollLeft);
Modified: trunk/Source/WebCore/html/HTMLElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -65,7 +65,7 @@
void insertAdjacentText(const String& where, const String& text, ExceptionCode&);
virtual bool hasCustomFocusLogic() const;
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
String contentEditable() const;
void setContentEditable(const String&, ExceptionCode&);
Modified: trunk/Source/WebCore/html/HTMLFieldSetElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLFieldSetElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLFieldSetElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -49,7 +49,7 @@
HTMLFieldSetElement(const QualifiedName&, Document*, HTMLFormElement*);
virtual bool isEnumeratable() const { return true; }
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual const AtomicString& formControlType() const;
virtual bool recalcWillValidate() const { return false; }
Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLFormControlElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -115,7 +115,7 @@
virtual void removedFrom(ContainerNode*) OVERRIDE;
virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE;
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
virtual bool isMouseFocusable() const OVERRIDE;
Modified: trunk/Source/WebCore/html/HTMLFrameElementBase.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLFrameElementBase.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLFrameElementBase.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -55,7 +55,7 @@
virtual void attach();
private:
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual void setFocus(bool) OVERRIDE;
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -430,7 +430,7 @@
virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
virtual bool hasCustomFocusLogic() const OVERRIDE;
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual bool isMouseFocusable() const OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
Modified: trunk/Source/WebCore/html/HTMLOptGroupElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLOptGroupElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLOptGroupElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -43,8 +43,8 @@
HTMLOptGroupElement(const QualifiedName&, Document*);
virtual const AtomicString& formControlType() const;
- virtual bool supportsFocus() const;
- virtual bool isFocusable() const;
+ virtual bool supportsFocus() const OVERRIDE;
+ virtual bool isFocusable() const OVERRIDE;
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
virtual void attach();
Modified: trunk/Source/WebCore/html/HTMLOptionElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLOptionElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLOptionElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -69,7 +69,7 @@
private:
HTMLOptionElement(const QualifiedName&, Document*);
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual bool isFocusable() const OVERRIDE;
virtual bool rendererIsNeeded(const NodeRenderingContext&) { return false; }
virtual void attach();
Modified: trunk/Source/WebCore/html/HTMLOutputElement.h (150709 => 150710)
--- trunk/Source/WebCore/html/HTMLOutputElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/html/HTMLOutputElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -59,7 +59,7 @@
virtual const AtomicString& formControlType() const;
virtual bool isEnumeratable() const { return true; }
virtual bool supportLabels() const OVERRIDE { return true; }
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual void childrenChanged(bool createdByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
virtual void reset();
Modified: trunk/Source/WebCore/svg/SVGAElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGAElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGAElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -56,7 +56,7 @@
virtual void defaultEventHandler(Event*);
- virtual bool supportsFocus() const;
+ virtual bool supportsFocus() const OVERRIDE;
virtual bool isMouseFocusable() const OVERRIDE;
virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE;
virtual bool isFocusable() const OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGCircleElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGCircleElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGCircleElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -42,7 +42,7 @@
SVGCircleElement(const QualifiedName&, Document*);
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGEllipseElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGEllipseElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGEllipseElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -42,7 +42,7 @@
SVGEllipseElement(const QualifiedName&, Document*);
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGGElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGGElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGGElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -44,7 +44,7 @@
private:
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGImageElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGImageElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGImageElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -46,7 +46,7 @@
SVGImageElement(const QualifiedName&, Document*);
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGLineElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGLineElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGLineElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -42,7 +42,7 @@
SVGLineElement(const QualifiedName&, Document*);
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGPathElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGPathElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGPathElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -106,7 +106,7 @@
SVGPathElement(const QualifiedName&, Document*);
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGPolyElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGPolyElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGPolyElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -49,7 +49,7 @@
private:
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGRectElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGRectElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGRectElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -42,7 +42,7 @@
SVGRectElement(const QualifiedName&, Document*);
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGSVGElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGSVGElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGSVGElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -55,7 +55,7 @@
using SVGStyledTransformableElement::deref;
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
// 'SVGSVGElement' functions
const AtomicString& contentScriptType() const;
Modified: trunk/Source/WebCore/svg/SVGSwitchElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGSwitchElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGSwitchElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -41,7 +41,7 @@
SVGSwitchElement(const QualifiedName&, Document*);
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const;
Modified: trunk/Source/WebCore/svg/SVGSymbolElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGSymbolElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGSymbolElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -42,7 +42,7 @@
private:
SVGSymbolElement(const QualifiedName&, Document*);
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGTextElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGTextElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGTextElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -44,7 +44,7 @@
private:
SVGTextElement(const QualifiedName&, Document*);
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
bool isSupportedAttribute(const QualifiedName&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
Modified: trunk/Source/WebCore/svg/SVGUseElement.h (150709 => 150710)
--- trunk/Source/WebCore/svg/SVGUseElement.h 2013-05-26 05:05:37 UTC (rev 150709)
+++ trunk/Source/WebCore/svg/SVGUseElement.h 2013-05-26 09:39:24 UTC (rev 150710)
@@ -59,7 +59,7 @@
SVGUseElement(const QualifiedName&, Document*, bool wasInsertedByParser);
virtual bool isValid() const { return SVGTests::isValid(); }
- virtual bool supportsFocus() const { return true; }
+ virtual bool supportsFocus() const OVERRIDE { return true; }
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void removedFrom(ContainerNode*) OVERRIDE;