Figure out if node is focusable without requiring renderer
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Dec 2013 18:51:04 +0000 (18:51 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Dec 2013 18:51:04 +0000 (18:51 +0000)
commitd1d6b9e17d3f764c5d991bf7ddfbf246d8012f23
tree93e5d275254978c1cddf9baea7e86edec74de3e8
parentd321ab89632afbb001ebe3be21c03ea2b77a37c8
Figure out if node is focusable without requiring renderer
https://bugs.webkit.org/show_bug.cgi?id=126118

Reviewed by Andreas Kling.

* dom/Element.cpp:
(WebCore::Element::computedStyle):

    Use inDocument() test instead of the attached() test. We can compute style for anything that
    is in document.

* dom/Node.cpp:
(WebCore::Node::isContentEditable):
(WebCore::Node::isContentRichlyEditable):
(WebCore::Node::hasEditableStyle):

    Use computedStyle instead of getting the style from renderer. Computed style gets constructed
    on demand if renderer does not exist. If it does then the existing style is used.

(WebCore::Node::isEditableToAccessibility):
(WebCore::Node::canStartSelection):
(WebCore::Node::isRootEditableElement):
(WebCore::Node::rootEditableElement):
* dom/Node.h:
(WebCore::Node::hasEditableStyle):
(WebCore::Node::hasRichlyEditableStyle):

    Renamed from rendererIsEditable since these no longer require renderer.

(WebCore::HTMLElement::supportsFocus):

    Stop calling updateStyleIfNeeded() and forcing render tree construction.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
51 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityTable.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/Position.cpp
Source/WebCore/dom/PositionIterator.cpp
Source/WebCore/editing/AppendNodeCommand.cpp
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/DeleteButtonController.cpp
Source/WebCore/editing/DeleteFromTextNodeCommand.cpp
Source/WebCore/editing/DeleteSelectionCommand.cpp
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/FormatBlockCommand.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/editing/IndentOutdentCommand.cpp
Source/WebCore/editing/InsertIntoTextNodeCommand.cpp
Source/WebCore/editing/InsertNodeBeforeCommand.cpp
Source/WebCore/editing/MergeIdenticalElementsCommand.cpp
Source/WebCore/editing/RemoveNodeCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/editing/SplitElementCommand.cpp
Source/WebCore/editing/SplitTextNodeCommand.cpp
Source/WebCore/editing/SplitTextNodeContainingElementCommand.cpp
Source/WebCore/editing/VisiblePosition.cpp
Source/WebCore/editing/VisibleSelection.cpp
Source/WebCore/editing/VisibleSelection.h
Source/WebCore/editing/VisibleUnits.cpp
Source/WebCore/editing/WrapContentsInDummySpanCommand.cpp
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderButton.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderTextFragment.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/svg/SVGAElement.cpp