2011-03-25 Chang Shu <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        rename Node::isContentEditable and all call sites to rendererIsEditable
        https://bugs.webkit.org/show_bug.cgi?id=54290

        This is part of the effort to separate JS API HTMLElement isContentEditable from
        internal Node::rendererIsEditable.

        Code refactoring. No new tests.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::isReadOnly):
        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
        * dom/Document.cpp:
        (WebCore::acceptsEditingFocus):
        * dom/Node.cpp:
        (WebCore::Node::rendererIsEditable):
        (WebCore::Node::shouldUseInputMethod):
        (WebCore::Node::canStartSelection):
        (WebCore::Node::rootEditableElement):
        * dom/Node.h:
        (WebCore::Node::isContentEditable):
        (WebCore::Node::rendererIsEditable):
        (WebCore::Node::rendererIsRichlyEditable):
        * dom/Position.cpp:
        (WebCore::nextRenderedEditable):
        (WebCore::previousRenderedEditable):
        (WebCore::Position::atEditingBoundary):
        (WebCore::Position::parentEditingBoundary):
        (WebCore::Position::upstream):
        (WebCore::Position::downstream):
        (WebCore::Position::isCandidate):
        * dom/PositionIterator.cpp:
        (WebCore::PositionIterator::isCandidate):
        * editing/AppendNodeCommand.cpp:
        (WebCore::AppendNodeCommand::AppendNodeCommand):
        (WebCore::AppendNodeCommand::doApply):
        (WebCore::AppendNodeCommand::doUnapply):
        * editing/ApplyStyleCommand.cpp:
        (WebCore::containsNonEditableRegion):
        (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
        (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
        * editing/DeleteButtonController.cpp:
        (WebCore::isDeletableElement):
        (WebCore::enclosingDeletableElement):
        * editing/DeleteFromTextNodeCommand.cpp:
        (WebCore::DeleteFromTextNodeCommand::doApply):
        (WebCore::DeleteFromTextNodeCommand::doUnapply):
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::removeNode):
        * editing/Editor.cpp:
        (WebCore::Editor::canDeleteRange):
        (WebCore::Editor::markMisspellingsOrBadGrammar):
        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
        * editing/EditorCommand.cpp:
        (WebCore::verticalScrollDistance):
        * editing/FormatBlockCommand.cpp:
        (WebCore::enclosingBlockToSplitTreeTo):
        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::outdentParagraph):
        * editing/InsertIntoTextNodeCommand.cpp:
        (WebCore::InsertIntoTextNodeCommand::doApply):
        (WebCore::InsertIntoTextNodeCommand::doUnapply):
        * editing/InsertNodeBeforeCommand.cpp:
        (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
        (WebCore::InsertNodeBeforeCommand::doApply):
        (WebCore::InsertNodeBeforeCommand::doUnapply):
        * editing/JoinTextNodesCommand.cpp:
        (WebCore::JoinTextNodesCommand::doApply):
        (WebCore::JoinTextNodesCommand::doUnapply):
        * editing/MergeIdenticalElementsCommand.cpp:
        (WebCore::MergeIdenticalElementsCommand::doApply):
        (WebCore::MergeIdenticalElementsCommand::doUnapply):
        * editing/RemoveNodeCommand.cpp:
        (WebCore::RemoveNodeCommand::doApply):
        (WebCore::RemoveNodeCommand::doUnapply):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplacementFragment::ReplacementFragment):
        * editing/SelectionController.cpp:
        (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
        (WebCore::SelectionController::setSelectionFromNone):
        * editing/SplitElementCommand.cpp:
        (WebCore::SplitElementCommand::executeApply):
        (WebCore::SplitElementCommand::doUnapply):
        * editing/SplitTextNodeCommand.cpp:
        (WebCore::SplitTextNodeCommand::doApply):
        (WebCore::SplitTextNodeCommand::doUnapply):
        (WebCore::SplitTextNodeCommand::doReapply):
        * editing/SplitTextNodeContainingElementCommand.cpp:
        (WebCore::SplitTextNodeContainingElementCommand::doApply):
        * editing/VisiblePosition.cpp:
        (WebCore::VisiblePosition::canonicalPosition):
        * editing/WrapContentsInDummySpanCommand.cpp:
        (WebCore::WrapContentsInDummySpanCommand::doUnapply):
        (WebCore::WrapContentsInDummySpanCommand::doReapply):
        * editing/htmlediting.cpp:
        (WebCore::highestEditableRoot):
        (WebCore::lowestEditableAncestor):
        (WebCore::isEditablePosition):
        (WebCore::isRichlyEditablePosition):
        (WebCore::firstEditablePositionAfterPositionInRoot):
        (WebCore::extendRangeToWrappingNodes):
        (WebCore::enclosingNodeWithTag):
        (WebCore::enclosingNodeOfType):
        (WebCore::highestEnclosingNodeOfType):
        (WebCore::canMergeLists):
        * editing/visible_units.cpp:
        (WebCore::previousLeafWithSameEditability):
        (WebCore::previousLinePosition):
        (WebCore::nextLeafWithSameEditability):
        (WebCore::nextLinePosition):
        (WebCore::startOfParagraph):
        (WebCore::endOfParagraph):
        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::supportsFocus):
        (WebCore::HTMLAnchorElement::defaultEventHandler):
        (WebCore::HTMLAnchorElement::setActive):
        (WebCore::HTMLAnchorElement::canStartSelection):
        (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::supportsFocus):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::supportsFocus):
        (WebCore::HTMLElement::isContentEditable):
        (WebCore::HTMLElement::contentEditable):
        * html/HTMLElement.h:
        * page/DragController.cpp:
        (WebCore::DragController::operationForLoad):
        (WebCore::DragController::canProcessDrag):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::handleMouseReleaseEvent):
        (WebCore::EventHandler::selectCursor):
        * page/FocusController.cpp:
        (WebCore::relinquishesEditingFocus):
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::isContentEditable):
        * rendering/RenderBlock.cpp:
        (WebCore::positionForPointRespectingEditingBoundaries):
        (WebCore::RenderBlock::hasLineIfEmpty):
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlock::addOverflowFromInlineChildren):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::canBeProgramaticallyScrolled):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::createVisiblePosition):
        * rendering/RootInlineBox.cpp:
        (WebCore::isEditableLeaf):
        * svg/SVGAElement.cpp:
        (WebCore::SVGAElement::supportsFocus):
2011-03-25  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        rename Node::isContentEditable and all call sites to rendererIsEditable
        https://bugs.webkit.org/show_bug.cgi?id=54290

        This is part of the effort to separate JS API HTMLElement isContentEditable from
        internal Node::rendererIsEditable.

        * src/WebNode.cpp:
        (WebKit::WebNode::isContentEditable):
        * src/WebViewImpl.cpp:
        (WebKit::WebViewImpl::setFocus):
        (WebKit::WebViewImpl::setComposition):
        (WebKit::WebViewImpl::confirmComposition):
2011-03-25  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        rename Node::isContentEditable and all call sites to rendererIsEditable
        https://bugs.webkit.org/show_bug.cgi?id=54290

        This is part of the effort to separate JS API HTMLElement isContentEditable from
        internal Node::rendererIsEditable.

        * WebCoreSupport/EditorClientHaiku.cpp:
        (WebCore::EditorClientHaiku::handleKeyboardEvent):
2011-03-25  Chang Shu  <cshu@webkit.org>

        Reviewed by Ryosuke Niwa.

        rename Node::isContentEditable and all call sites to rendererIsEditable
        https://bugs.webkit.org/show_bug.cgi?id=54290

        This is part of the effort to separate JS API HTMLElement isContentEditable from
        internal Node::rendererIsEditable.

        * WebCoreSupport/EditorClientQt.cpp:
        (WebCore::EditorClientQt::handleKeyboardEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 658bbbad
2011-03-25 Chang Shu <cshu@webkit.org>
Reviewed by Ryosuke Niwa.
rename Node::isContentEditable and all call sites to rendererIsEditable
https://bugs.webkit.org/show_bug.cgi?id=54290
This is part of the effort to separate JS API HTMLElement isContentEditable from
internal Node::rendererIsEditable.
Code refactoring. No new tests.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isReadOnly):
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
* dom/Document.cpp:
(WebCore::acceptsEditingFocus):
* dom/Node.cpp:
(WebCore::Node::rendererIsEditable):
(WebCore::Node::shouldUseInputMethod):
(WebCore::Node::canStartSelection):
(WebCore::Node::rootEditableElement):
* dom/Node.h:
(WebCore::Node::isContentEditable):
(WebCore::Node::rendererIsEditable):
(WebCore::Node::rendererIsRichlyEditable):
* dom/Position.cpp:
(WebCore::nextRenderedEditable):
(WebCore::previousRenderedEditable):
(WebCore::Position::atEditingBoundary):
(WebCore::Position::parentEditingBoundary):
(WebCore::Position::upstream):
(WebCore::Position::downstream):
(WebCore::Position::isCandidate):
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate):
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::AppendNodeCommand):
(WebCore::AppendNodeCommand::doApply):
(WebCore::AppendNodeCommand::doUnapply):
* editing/ApplyStyleCommand.cpp:
(WebCore::containsNonEditableRegion):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
(WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
* editing/DeleteButtonController.cpp:
(WebCore::isDeletableElement):
(WebCore::enclosingDeletableElement):
* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::doApply):
(WebCore::DeleteFromTextNodeCommand::doUnapply):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::removeNode):
* editing/Editor.cpp:
(WebCore::Editor::canDeleteRange):
(WebCore::Editor::markMisspellingsOrBadGrammar):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
* editing/EditorCommand.cpp:
(WebCore::verticalScrollDistance):
* editing/FormatBlockCommand.cpp:
(WebCore::enclosingBlockToSplitTreeTo):
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::outdentParagraph):
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doApply):
(WebCore::InsertIntoTextNodeCommand::doUnapply):
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
(WebCore::InsertNodeBeforeCommand::doApply):
(WebCore::InsertNodeBeforeCommand::doUnapply):
* editing/JoinTextNodesCommand.cpp:
(WebCore::JoinTextNodesCommand::doApply):
(WebCore::JoinTextNodesCommand::doUnapply):
* editing/MergeIdenticalElementsCommand.cpp:
(WebCore::MergeIdenticalElementsCommand::doApply):
(WebCore::MergeIdenticalElementsCommand::doUnapply):
* editing/RemoveNodeCommand.cpp:
(WebCore::RemoveNodeCommand::doApply):
(WebCore::RemoveNodeCommand::doUnapply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment):
* editing/SelectionController.cpp:
(WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
(WebCore::SelectionController::setSelectionFromNone):
* editing/SplitElementCommand.cpp:
(WebCore::SplitElementCommand::executeApply):
(WebCore::SplitElementCommand::doUnapply):
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doApply):
(WebCore::SplitTextNodeCommand::doUnapply):
(WebCore::SplitTextNodeCommand::doReapply):
* editing/SplitTextNodeContainingElementCommand.cpp:
(WebCore::SplitTextNodeContainingElementCommand::doApply):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::canonicalPosition):
* editing/WrapContentsInDummySpanCommand.cpp:
(WebCore::WrapContentsInDummySpanCommand::doUnapply):
(WebCore::WrapContentsInDummySpanCommand::doReapply):
* editing/htmlediting.cpp:
(WebCore::highestEditableRoot):
(WebCore::lowestEditableAncestor):
(WebCore::isEditablePosition):
(WebCore::isRichlyEditablePosition):
(WebCore::firstEditablePositionAfterPositionInRoot):
(WebCore::extendRangeToWrappingNodes):
(WebCore::enclosingNodeWithTag):
(WebCore::enclosingNodeOfType):
(WebCore::highestEnclosingNodeOfType):
(WebCore::canMergeLists):
* editing/visible_units.cpp:
(WebCore::previousLeafWithSameEditability):
(WebCore::previousLinePosition):
(WebCore::nextLeafWithSameEditability):
(WebCore::nextLinePosition):
(WebCore::startOfParagraph):
(WebCore::endOfParagraph):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::supportsFocus):
(WebCore::HTMLAnchorElement::defaultEventHandler):
(WebCore::HTMLAnchorElement::setActive):
(WebCore::HTMLAnchorElement::canStartSelection):
(WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::supportsFocus):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::supportsFocus):
(WebCore::HTMLElement::isContentEditable):
(WebCore::HTMLElement::contentEditable):
* html/HTMLElement.h:
* page/DragController.cpp:
(WebCore::DragController::operationForLoad):
(WebCore::DragController::canProcessDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::selectCursor):
* page/FocusController.cpp:
(WebCore::relinquishesEditingFocus):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::isContentEditable):
* rendering/RenderBlock.cpp:
(WebCore::positionForPointRespectingEditingBoundaries):
(WebCore::RenderBlock::hasLineIfEmpty):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::addOverflowFromInlineChildren):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::canBeProgramaticallyScrolled):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::createVisiblePosition):
* rendering/RootInlineBox.cpp:
(WebCore::isEditableLeaf):
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::supportsFocus):
2011-03-25 Maciej Stachowiak <mjs@apple.com>
Reviewed by Antti Koivisto.
......@@ -661,10 +661,10 @@ bool AccessibilityRenderObject::isReadOnly() const
return true;
HTMLElement* body = document->body();
if (body && body->isContentEditable())
if (body && body->rendererIsEditable())
return false;
return !document->isContentEditable();
return !document->rendererIsEditable();
}
if (m_renderer->isBoxModelObject()) {
......@@ -675,7 +675,7 @@ bool AccessibilityRenderObject::isReadOnly() const
return static_cast<HTMLTextAreaElement*>(box->node())->readOnly();
}
return !m_renderer->node() || !m_renderer->node()->isContentEditable();
return !m_renderer->node() || !m_renderer->node()->rendererIsEditable();
}
bool AccessibilityRenderObject::isOffScreen() const
......@@ -1829,7 +1829,7 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
return false;
// Anything that is content editable should not be ignored.
// However, one cannot just call node->isContentEditable() since that will ask if its parents
// However, one cannot just call node->rendererIsEditable() since that will ask if its parents
// are also editable. Only the top level content editable region should be exposed.
if (node && node->isElementNode()) {
Element* element = static_cast<Element*>(node);
......
......@@ -319,7 +319,7 @@ static Widget* widgetForNode(Node* focusedNode)
static bool acceptsEditingFocus(Node* node)
{
ASSERT(node);
ASSERT(node->isContentEditable());
ASSERT(node->rendererIsEditable());
Node* root = node->rootEditableElement();
Frame* frame = node->document()->frame();
......
......@@ -711,7 +711,7 @@ void Node::deprecatedParserAddChild(PassRefPtr<Node>)
{
}
bool Node::isContentEditable(EditableLevel editableLevel) const
bool Node::rendererIsEditable(EditableLevel editableLevel) const
{
if (document()->inDesignMode() || (document()->frame() && document()->frame()->page() && document()->frame()->page()->isEditable()))
return true;
......@@ -740,7 +740,7 @@ bool Node::isContentEditable(EditableLevel editableLevel) const
bool Node::shouldUseInputMethod() const
{
return isContentEditable();
return rendererIsEditable();
}
RenderBox* Node::renderBox() const
......@@ -1514,7 +1514,7 @@ int Node::maxCharacterOffset() const
// is obviously misplaced.
bool Node::canStartSelection() const
{
if (isContentEditable())
if (rendererIsEditable())
return true;
if (renderer()) {
......@@ -1592,7 +1592,7 @@ Element *Node::enclosingBlockFlowElement() const
Element* Node::rootEditableElement() const
{
Element* result = 0;
for (Node* n = const_cast<Node*>(this); n && n->isContentEditable(); n = n->parentNode()) {
for (Node* n = const_cast<Node*>(this); n && n->rendererIsEditable(); n = n->parentNode()) {
if (n->isElementNode())
result = static_cast<Element*>(n);
if (n->hasTagName(bodyTag))
......
......@@ -319,8 +319,12 @@ public:
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
virtual bool isMouseFocusable() const;
bool isContentEditable() const { return isContentEditable(Editable); }
bool isContentRichlyEditable() const { return isContentEditable(RichlyEditable); }
#if PLATFORM(MAC)
// Objective-C extensions
bool isContentEditable() const { return rendererIsEditable(Editable); }
#endif
bool rendererIsEditable() const { return rendererIsEditable(Editable); }
bool rendererIsRichlyEditable() const { return rendererIsEditable(RichlyEditable); }
virtual bool shouldUseInputMethod() const;
virtual IntRect getRect() const;
IntRect renderRect(bool* isReplaced);
......@@ -651,7 +655,7 @@ private:
#endif
enum EditableLevel { Editable, RichlyEditable };
bool isContentEditable(EditableLevel) const;
bool rendererIsEditable(EditableLevel) const;
void setStyleChange(StyleChangeType);
......
......@@ -46,7 +46,7 @@ using namespace HTMLNames;
static Node* nextRenderedEditable(Node* node)
{
while ((node = node->nextLeafNode())) {
if (!node->isContentEditable())
if (!node->rendererIsEditable())
continue;
RenderObject* renderer = node->renderer();
if (!renderer)
......@@ -60,7 +60,7 @@ static Node* nextRenderedEditable(Node* node)
static Node* previousRenderedEditable(Node* node)
{
while ((node = node->previousLeafNode())) {
if (!node->isContentEditable())
if (!node->rendererIsEditable())
continue;
RenderObject* renderer = node->renderer();
if (!renderer)
......@@ -345,15 +345,15 @@ bool Position::atLastEditingPositionForNode() const
bool Position::atEditingBoundary() const
{
Position nextPosition = downstream(CanCrossEditingBoundary);
if (atFirstEditingPositionForNode() && nextPosition.isNotNull() && !nextPosition.deprecatedNode()->isContentEditable())
if (atFirstEditingPositionForNode() && nextPosition.isNotNull() && !nextPosition.deprecatedNode()->rendererIsEditable())
return true;
Position prevPosition = upstream(CanCrossEditingBoundary);
if (atLastEditingPositionForNode() && prevPosition.isNotNull() && !prevPosition.deprecatedNode()->isContentEditable())
if (atLastEditingPositionForNode() && prevPosition.isNotNull() && !prevPosition.deprecatedNode()->rendererIsEditable())
return true;
return nextPosition.isNotNull() && !nextPosition.deprecatedNode()->isContentEditable()
&& prevPosition.isNotNull() && !prevPosition.deprecatedNode()->isContentEditable();
return nextPosition.isNotNull() && !nextPosition.deprecatedNode()->rendererIsEditable()
&& prevPosition.isNotNull() && !prevPosition.deprecatedNode()->rendererIsEditable();
}
Node* Position::parentEditingBoundary() const
......@@ -366,7 +366,7 @@ Node* Position::parentEditingBoundary() const
return 0;
Node* boundary = m_anchorNode.get();
while (boundary != documentElement && boundary->parentNode() && m_anchorNode->isContentEditable() == boundary->parentNode()->isContentEditable())
while (boundary != documentElement && boundary->parentNode() && m_anchorNode->rendererIsEditable() == boundary->parentNode()->rendererIsEditable())
boundary = boundary->parentNode();
return boundary;
......@@ -525,17 +525,17 @@ Position Position::upstream(EditingBoundaryCrossingRule rule) const
// FIXME: PositionIterator should respect Before and After positions.
PositionIterator lastVisible = m_anchorType == PositionIsAfterAnchor ? Position(m_anchorNode, caretMaxOffset(m_anchorNode.get())) : *this;
PositionIterator currentPos = lastVisible;
bool startEditable = startNode->isContentEditable();
bool startEditable = startNode->rendererIsEditable();
Node* lastNode = startNode;
bool boundaryCrossed = false;
for (; !currentPos.atStart(); currentPos.decrement()) {
Node* currentNode = currentPos.node();
// Don't check for an editability change if we haven't moved to a different node,
// to avoid the expense of computing isContentEditable().
// to avoid the expense of computing rendererIsEditable().
if (currentNode != lastNode) {
// Don't change editability.
bool currentEditable = currentNode->isContentEditable();
bool currentEditable = currentNode->rendererIsEditable();
if (startEditable != currentEditable) {
if (rule == CannotCrossEditingBoundary)
break;
......@@ -647,17 +647,17 @@ Position Position::downstream(EditingBoundaryCrossingRule rule) const
// FIXME: PositionIterator should respect Before and After positions.
PositionIterator lastVisible = m_anchorType == PositionIsAfterAnchor ? Position(m_anchorNode, caretMaxOffset(m_anchorNode.get())) : *this;
PositionIterator currentPos = lastVisible;
bool startEditable = startNode->isContentEditable();
bool startEditable = startNode->rendererIsEditable();
Node* lastNode = startNode;
bool boundaryCrossed = false;
for (; !currentPos.atEnd(); currentPos.increment()) {
Node* currentNode = currentPos.node();
// Don't check for an editability change if we haven't moved to a different node,
// to avoid the expense of computing isContentEditable().
// to avoid the expense of computing rendererIsEditable().
if (currentNode != lastNode) {
// Don't change editability.
bool currentEditable = currentNode->isContentEditable();
bool currentEditable = currentNode->rendererIsEditable();
if (startEditable != currentEditable) {
if (rule == CannotCrossEditingBoundary)
break;
......@@ -799,10 +799,10 @@ bool Position::isCandidate() const
if (toRenderBlock(renderer)->height() || m_anchorNode->hasTagName(bodyTag)) {
if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer))
return atFirstEditingPositionForNode() && !Position::nodeIsUserSelectNone(deprecatedNode());
return m_anchorNode->isContentEditable() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
return m_anchorNode->rendererIsEditable() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
}
} else
return m_anchorNode->isContentEditable() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
return m_anchorNode->rendererIsEditable() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
return false;
}
......
......@@ -169,7 +169,7 @@ bool PositionIterator::isCandidate() const
if (toRenderBlock(renderer)->height() || m_anchorNode->hasTagName(bodyTag)) {
if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer))
return atStartOfNode() && !Position::nodeIsUserSelectNone(m_anchorNode);
return m_anchorNode->isContentEditable() && !Position::nodeIsUserSelectNone(m_anchorNode) && Position(*this).atEditingBoundary();
return m_anchorNode->rendererIsEditable() && !Position::nodeIsUserSelectNone(m_anchorNode) && Position(*this).atEditingBoundary();
}
}
......
......@@ -40,7 +40,7 @@ AppendNodeCommand::AppendNodeCommand(PassRefPtr<ContainerNode> parent, PassRefPt
ASSERT(m_node);
ASSERT(!m_node->parentNode());
ASSERT(m_parent->isContentEditable() || !m_parent->attached());
ASSERT(m_parent->rendererIsEditable() || !m_parent->attached());
}
static void sendAXTextChangedIgnoringLineBreaks(Node* node, AXObjectCache::AXTextChange textChange)
......@@ -56,7 +56,7 @@ static void sendAXTextChangedIgnoringLineBreaks(Node* node, AXObjectCache::AXTex
void AppendNodeCommand::doApply()
{
if (!m_parent->isContentEditable() && m_parent->attached())
if (!m_parent->rendererIsEditable() && m_parent->attached())
return;
ExceptionCode ec;
......@@ -68,7 +68,7 @@ void AppendNodeCommand::doApply()
void AppendNodeCommand::doUnapply()
{
if (!m_parent->isContentEditable())
if (!m_parent->rendererIsEditable())
return;
// Need to notify this before actually deleting the text
......
......@@ -1017,12 +1017,12 @@ void ApplyStyleCommand::fixRangeAndApplyInlineStyle(EditingStyle* style, const P
static bool containsNonEditableRegion(Node* node)
{
if (!node->isContentEditable())
if (!node->rendererIsEditable())
return true;
Node* sibling = node->traverseNextSibling();
for (Node* descendent = node->firstChild(); descendent && descendent != sibling; descendent = descendent->traverseNextNode()) {
if (!descendent->isContentEditable())
if (!descendent->rendererIsEditable())
return true;
}
......@@ -1037,10 +1037,10 @@ void ApplyStyleCommand::applyInlineStyleToNodeRange(EditingStyle* style, Node* n
for (RefPtr<Node> next; node && node != pastEndNode; node = next.get()) {
next = node->traverseNextNode();
if (!node->renderer() || !node->isContentEditable())
if (!node->renderer() || !node->rendererIsEditable())
continue;
if (!node->isContentRichlyEditable() && node->isHTMLElement()) {
if (!node->rendererIsRichlyEditable() && node->isHTMLElement()) {
// This is a plaintext-only region. Only proceed if it's fully selected.
// pastEndNode is the node after the last fully selected node, so if it's inside node then
// node isn't fully selected.
......@@ -1059,7 +1059,7 @@ void ApplyStyleCommand::applyInlineStyleToNodeRange(EditingStyle* style, Node* n
continue;
if (node->childNodeCount()) {
if (node->contains(pastEndNode) || containsNonEditableRegion(node) || !node->parentNode()->isContentEditable())
if (node->contains(pastEndNode) || containsNonEditableRegion(node) || !node->parentNode()->rendererIsEditable())
continue;
if (editingIgnoresContent(node)) {
next = node->traverseNextSibling();
......@@ -1134,7 +1134,7 @@ bool ApplyStyleCommand::removeInlineStyleFromElement(EditingStyle* style, PassRe
{
ASSERT(element);
if (!element->parentNode() || !element->parentNode()->isContentEditable())
if (!element->parentNode() || !element->parentNode()->rendererIsEditable())
return false;
if (isStyledInlineElementToRemove(element.get())) {
......@@ -1651,13 +1651,13 @@ void ApplyStyleCommand::surroundNodeRangeWithElement(PassRefPtr<Node> passedStar
RefPtr<Node> nextSibling = element->nextSibling();
RefPtr<Node> previousSibling = element->previousSibling();
if (nextSibling && nextSibling->isElementNode() && nextSibling->isContentEditable()
if (nextSibling && nextSibling->isElementNode() && nextSibling->rendererIsEditable()
&& areIdenticalElements(element.get(), static_cast<Element*>(nextSibling.get())))
mergeIdenticalElements(element.get(), static_cast<Element*>(nextSibling.get()));
if (previousSibling && previousSibling->isElementNode() && previousSibling->isContentEditable()) {
if (previousSibling && previousSibling->isElementNode() && previousSibling->rendererIsEditable()) {
Node* mergedElement = previousSibling->nextSibling();
if (mergedElement->isElementNode() && mergedElement->isContentEditable()
if (mergedElement->isElementNode() && mergedElement->rendererIsEditable()
&& areIdenticalElements(static_cast<Element*>(previousSibling.get()), static_cast<Element*>(mergedElement)))
mergeIdenticalElements(static_cast<Element*>(previousSibling.get()), static_cast<Element*>(mergedElement));
}
......
......@@ -1048,7 +1048,7 @@ bool CompositeEditCommand::breakOutOfEmptyListItem()
// FIXME: Can't we do something better when the immediate parent wasn't a list node?
if (!listNode
|| (!listNode->hasTagName(ulTag) && !listNode->hasTagName(olTag))
|| !listNode->isContentEditable()
|| !listNode->rendererIsEditable()
|| listNode == emptyListItem->rootEditableElement())
return false;
......
......@@ -63,7 +63,7 @@ DeleteButtonController::DeleteButtonController(Frame* frame)
static bool isDeletableElement(const Node* node)
{
if (!node || !node->isHTMLElement() || !node->inDocument() || !node->isContentEditable())
if (!node || !node->isHTMLElement() || !node->inDocument() || !node->rendererIsEditable())
return false;
// In general we want to only draw the UI around object of a certain area, but we still keep the min width/height to
......@@ -156,7 +156,7 @@ static HTMLElement* enclosingDeletableElement(const VisibleSelection& selection)
// The enclosingNodeOfType function only works on nodes that are editable
// (which is strange, given its name).
if (!container->isContentEditable())
if (!container->rendererIsEditable())
return 0;
Node* element = enclosingNodeOfType(firstPositionInNode(container), &isDeletableElement);
......
......@@ -46,7 +46,7 @@ void DeleteFromTextNodeCommand::doApply()
{
ASSERT(m_node);
if (!m_node->isContentEditable())
if (!m_node->rendererIsEditable())
return;
ExceptionCode ec = 0;
......@@ -65,7 +65,7 @@ void DeleteFromTextNodeCommand::doUnapply()
{
ASSERT(m_node);
if (!m_node->isContentEditable())
if (!m_node->rendererIsEditable())
return;
ExceptionCode ec;
......
......@@ -342,7 +342,7 @@ void DeleteSelectionCommand::removeNode(PassRefPtr<Node> node)
if (m_startRoot != m_endRoot && !(node->isDescendantOf(m_startRoot.get()) && node->isDescendantOf(m_endRoot.get()))) {
// If a node is not in both the start and end editable roots, remove it only if its inside an editable region.
if (!node->parentNode()->isContentEditable()) {
if (!node->parentNode()->rendererIsEditable()) {
// Don't remove non-editable atomic nodes.
if (!node->firstChild())
return;
......
......@@ -289,7 +289,7 @@ bool Editor::canDeleteRange(Range* range) const
if (!startContainer || !endContainer)
return false;
if (!startContainer->isContentEditable() || !endContainer->isContentEditable())
if (!startContainer->rendererIsEditable() || !endContainer->rendererIsEditable())
return false;
if (range->collapsed(ec)) {
......@@ -2159,7 +2159,7 @@ void Editor::markMisspellingsOrBadGrammar(const VisibleSelection& selection, boo
// If we're not in an editable node, bail.
Node* editableNode = searchRange->startContainer();
if (!editableNode || !editableNode->isContentEditable())
if (!editableNode || !editableNode->rendererIsEditable())
return;
if (!isSpellCheckingEnabledFor(editableNode))
......@@ -2224,7 +2224,7 @@ void Editor::markAllMisspellingsAndBadGrammarInRanges(TextCheckingOptions textCh
// If we're not in an editable node, bail.
Node* editableNode = spellingRange->startContainer();
if (!editableNode || !editableNode->isContentEditable())
if (!editableNode || !editableNode->rendererIsEditable())
return;
if (!isSpellCheckingEnabledFor(editableNode))
......
......@@ -254,7 +254,7 @@ static int verticalScrollDistance(Frame* frame)
RenderStyle* style = renderer->style();
if (!style)
return 0;
if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || focusedNode->isContentEditable()))
if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || focusedNode->rendererIsEditable()))
return 0;
int height = std::min<int>(toRenderBox(renderer)->clientHeight(),
frame->view()->visibleHeight());
......
......@@ -149,14 +149,14 @@ Node* enclosingBlockToSplitTreeTo(Node* startNode)
{
Node* lastBlock = startNode;
for (Node* n = startNode; n; n = n->parentNode()) {
if (!n->isContentEditable())
if (!n->rendererIsEditable())
return lastBlock;
if (isTableCell(n) || n->hasTagName(bodyTag) || !n->parentNode() || !n->parentNode()->isContentEditable() || isElementForFormatBlock(n))
if (isTableCell(n) || n->hasTagName(bodyTag) || !n->parentNode() || !n->parentNode()->rendererIsEditable() || isElementForFormatBlock(n))
return n;
if (isBlock(n))
lastBlock = n;
if (isListElement(n))
return n->parentNode()->isContentEditable() ? n->parentNode() : n;
return n->parentNode()->rendererIsEditable() ? n->parentNode() : n;
}
return lastBlock;
}
......
......@@ -120,7 +120,7 @@ void IndentOutdentCommand::outdentParagraph()
VisiblePosition visibleEndOfParagraph = endOfParagraph(visibleStartOfParagraph);
Node* enclosingNode = enclosingNodeOfType(visibleStartOfParagraph.deepEquivalent(), &isListOrIndentBlockquote);
if (!enclosingNode || !enclosingNode->parentNode()->isContentEditable()) // We can't outdent if there is no place to go!
if (!enclosingNode || !enclosingNode->parentNode()->rendererIsEditable()) // We can't outdent if there is no place to go!
return;
// Use InsertListCommand to remove the selection from the list
......@@ -151,7 +151,7 @@ void IndentOutdentCommand::outdentParagraph()
if (ContainerNode* splitPointParent = splitPoint->parentNode()) {
if (splitPointParent->hasTagName(blockquoteTag)
&& !splitPoint->hasTagName(blockquoteTag)
&& splitPointParent->parentNode()->isContentEditable()) // We can't outdent if there is no place to go!
&& splitPointParent->parentNode()->rendererIsEditable()) // We can't outdent if there is no place to go!
splitElement(static_cast<Element*>(splitPointParent), splitPoint);
}
}
......
......@@ -44,7 +44,7 @@ InsertIntoTextNodeCommand::InsertIntoTextNodeCommand(PassRefPtr<Text> node, unsi
void InsertIntoTextNodeCommand::doApply()
{
if (!m_node->isContentEditable())
if (!m_node->rendererIsEditable())
return;
ExceptionCode ec;
......@@ -56,7 +56,7 @@ void InsertIntoTextNodeCommand::doApply()
void InsertIntoTextNodeCommand::doUnapply()
{
if (!m_node->isContentEditable())
if (!m_node->rendererIsEditable())
return;
// Need to notify this before actually deleting the text
......
......@@ -41,13 +41,13 @@ InsertNodeBeforeCommand::InsertNodeBeforeCommand(PassRefPtr<Node> insertChild, P
ASSERT(m_refChild);
ASSERT(m_refChild->parentNode());
ASSERT(m_refChild->parentNode()->isContentEditable() || !m_refChild->parentNode()->attached());
ASSERT(m_refChild->parentNode()->rendererIsEditable() || !m_refChild->parentNode()->attached());
}
void InsertNodeBeforeCommand::doApply()
{
ContainerNode* parent = m_refChild->parentNode();
if (!parent || !parent->isContentEditable())
if (!parent || !parent->rendererIsEditable())
return;
ExceptionCode ec;
......@@ -59,7 +59,7 @@ void InsertNodeBeforeCommand::doApply()
void InsertNodeBeforeCommand::doUnapply()
{
if (!m_insertChild->isContentEditable())
if (!m_insertChild->rendererIsEditable())
return;
// Need to notify this before actually deleting the text
......
......@@ -46,7 +46,7 @@ void JoinTextNodesCommand::doApply()
return;
ContainerNode* parent = m_text2->parentNode();
if (!parent || !parent->isContentEditable())
if (!parent || !parent->rendererIsEditable())
return;
ExceptionCode ec = 0;
......@@ -63,7 +63,7 @@ void JoinTextNodesCommand::doUnapply()
return;
ContainerNode* parent = m_text2->parentNode();
if (!parent || !parent->isContentEditable())