summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/dom
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/dom')
-rw-r--r--src/3rdparty/webkit/WebCore/dom/CharacterData.cpp8
-rw-r--r--src/3rdparty/webkit/WebCore/dom/Element.cpp17
-rw-r--r--src/3rdparty/webkit/WebCore/dom/Element.h4
-rw-r--r--src/3rdparty/webkit/WebCore/dom/Text.cpp2
4 files changed, 25 insertions, 6 deletions
diff --git a/src/3rdparty/webkit/WebCore/dom/CharacterData.cpp b/src/3rdparty/webkit/WebCore/dom/CharacterData.cpp
index 3c3dc37..cb12184 100644
--- a/src/3rdparty/webkit/WebCore/dom/CharacterData.cpp
+++ b/src/3rdparty/webkit/WebCore/dom/CharacterData.cpp
@@ -46,15 +46,15 @@ void CharacterData::setData(const String& data, ExceptionCode&)
int oldLength = length();
RefPtr<StringImpl> oldStr = m_data;
m_data = dataImpl;
-
+
if ((!renderer() || !rendererIsNeeded(renderer()->style())) && attached()) {
detach();
attach();
} else if (renderer())
- toRenderText(renderer())->setText(m_data);
-
+ toRenderText(renderer())->setTextWithOffset(m_data, 0, oldLength);
+
dispatchModifiedEvent(oldStr.get());
-
+
document()->textRemoved(this, 0, oldLength);
}
diff --git a/src/3rdparty/webkit/WebCore/dom/Element.cpp b/src/3rdparty/webkit/WebCore/dom/Element.cpp
index a02bb4c..4c93020 100644
--- a/src/3rdparty/webkit/WebCore/dom/Element.cpp
+++ b/src/3rdparty/webkit/WebCore/dom/Element.cpp
@@ -1311,8 +1311,12 @@ void Element::focus(bool restorePreviousSelection)
return;
}
- if (Page* page = doc->page())
+ RefPtr<Node> protect;
+ if (Page* page = doc->page()) {
+ // Focus and change event handlers can cause us to lose our last ref.
+ protect = this;
page->focusController()->setFocusedNode(this, doc->frame());
+ }
// Setting the focused node above might have invalidated the layout due to scripts.
doc->updateLayoutIgnorePendingStylesheets();
@@ -1535,4 +1539,15 @@ const QualifiedName& Element::rareIDAttributeName() const
return rareData()->m_idAttributeName;
}
+#if ENABLE(SVG)
+bool Element::childShouldCreateRenderer(Node* child) const
+{
+ // Only create renderers for SVG elements whose parents are SVG elements, or for proper <svg xmlns="svgNS"> subdocuments.
+ if (child->isSVGElement())
+ return child->hasTagName(SVGNames::svgTag) || isSVGElement();
+
+ return Node::childShouldCreateRenderer(child);
+}
+#endif
+
} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/dom/Element.h b/src/3rdparty/webkit/WebCore/dom/Element.h
index 348ed1c..36c4f1b 100644
--- a/src/3rdparty/webkit/WebCore/dom/Element.h
+++ b/src/3rdparty/webkit/WebCore/dom/Element.h
@@ -270,6 +270,10 @@ public:
virtual void dispatchFormControlChangeEvent() { }
+#if ENABLE(SVG)
+ virtual bool childShouldCreateRenderer(Node*) const;
+#endif
+
protected:
Element(const QualifiedName&, Document*, ConstructionType);
diff --git a/src/3rdparty/webkit/WebCore/dom/Text.cpp b/src/3rdparty/webkit/WebCore/dom/Text.cpp
index 1ce074a..229fa88 100644
--- a/src/3rdparty/webkit/WebCore/dom/Text.cpp
+++ b/src/3rdparty/webkit/WebCore/dom/Text.cpp
@@ -77,7 +77,7 @@ PassRefPtr<Text> Text::splitText(unsigned offset, ExceptionCode& ec)
document()->textNodeSplit(this);
if (renderer())
- toRenderText(renderer())->setText(dataImpl());
+ toRenderText(renderer())->setTextWithOffset(dataImpl(), 0, oldStr->length());
return newText.release();
}