Source/WebCore: Remove Node::attached()
https://bugs.webkit.org/show_bug.cgi?id=126276
Reviewed by Sam Weinig.
Node::attached() is poorly defined. Replace it with renderer() and inRenderedDocument() tests as appropriate.
Also remove some unnecessary explicit attachRenderTree/detachRenderTree calls from the tree builders.
LayoutTests: Remove Node::attached()
https://bugs.webkit.org/show_bug.cgi?id=126276
Reviewed by Sam Weinig.
* platform/mac/fast/table/dynamic-caption-add-before-child-expected.png:
* platform/mac/fast/table/dynamic-caption-add-before-child-expected.txt:
This test result change is a progression. Dynamic captions are now correctly in document order.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/editing/AppendNodeCommand.cpp b/Source/WebCore/editing/AppendNodeCommand.cpp
index 15a5233..25c596a 100644
--- a/Source/WebCore/editing/AppendNodeCommand.cpp
+++ b/Source/WebCore/editing/AppendNodeCommand.cpp
@@ -29,6 +29,7 @@
#include "AXObjectCache.h"
#include "Document.h"
#include "ExceptionCodePlaceholder.h"
+#include "RenderElement.h"
#include "htmlediting.h"
namespace WebCore {
@@ -42,7 +43,7 @@
ASSERT(m_node);
ASSERT(!m_node->parentNode());
- ASSERT(m_parent->hasEditableStyle() || !m_parent->attached());
+ ASSERT(m_parent->hasEditableStyle() || !m_parent->renderer());
}
static void sendAXTextChangedIgnoringLineBreaks(Node* node, AXObjectCache::AXTextChange textChange)
@@ -58,7 +59,7 @@
void AppendNodeCommand::doApply()
{
- if (!m_parent->hasEditableStyle() && m_parent->attached())
+ if (!m_parent->hasEditableStyle() && m_parent->renderer())
return;
m_parent->appendChild(m_node.get(), IGNORE_EXCEPTION);