summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/dom
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-13 16:23:25 +0100
committerBen Murdoch <benm@google.com>2011-05-16 11:35:02 +0100
commit65f03d4f644ce73618e5f4f50dd694b26f55ae12 (patch)
treef478babb801e720de7bfaee23443ffe029f58731 /Source/WebCore/dom
parent47de4a2fb7262c7ebdb9cd133ad2c54c187454d0 (diff)
downloadexternal_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.zip
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.gz
external_webkit-65f03d4f644ce73618e5f4f50dd694b26f55ae12.tar.bz2
Merge WebKit at r75993: Initial merge by git.
Change-Id: I602bbdc3974787a3b0450456a30a7868286921c3
Diffstat (limited to 'Source/WebCore/dom')
-rw-r--r--Source/WebCore/dom/BeforeLoadEvent.h1
-rw-r--r--Source/WebCore/dom/Document.cpp39
-rw-r--r--Source/WebCore/dom/Document.h6
-rw-r--r--Source/WebCore/dom/Document.idl2
-rw-r--r--Source/WebCore/dom/Element.cpp2
-rw-r--r--Source/WebCore/dom/Element.h6
-rw-r--r--Source/WebCore/dom/Event.cpp1
-rw-r--r--Source/WebCore/dom/Event.h2
-rw-r--r--Source/WebCore/dom/EventQueue.cpp14
-rw-r--r--Source/WebCore/dom/EventQueue.h8
-rw-r--r--Source/WebCore/dom/ExceptionCode.cpp6
-rw-r--r--Source/WebCore/dom/Node.cpp64
-rw-r--r--Source/WebCore/dom/Node.h3
-rw-r--r--Source/WebCore/dom/Range.cpp7
-rw-r--r--Source/WebCore/dom/ScriptExecutionContext.h6
-rw-r--r--Source/WebCore/dom/StyleElement.cpp15
-rw-r--r--Source/WebCore/dom/StyleElement.h2
-rw-r--r--Source/WebCore/dom/StyledElement.cpp3
-rw-r--r--Source/WebCore/dom/StyledElement.h2
-rw-r--r--Source/WebCore/dom/TouchEvent.cpp3
-rw-r--r--Source/WebCore/dom/XMLDocumentParser.cpp8
21 files changed, 126 insertions, 74 deletions
diff --git a/Source/WebCore/dom/BeforeLoadEvent.h b/Source/WebCore/dom/BeforeLoadEvent.h
index f60e438..fc5814a 100644
--- a/Source/WebCore/dom/BeforeLoadEvent.h
+++ b/Source/WebCore/dom/BeforeLoadEvent.h
@@ -28,6 +28,7 @@
#define BeforeLoadEvent_h
#include "Event.h"
+#include "EventNames.h"
namespace WebCore {
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index 0c865c9..1787b52 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -92,7 +92,6 @@
#include "HitTestRequest.h"
#include "HitTestResult.h"
#include "ImageLoader.h"
-#include "InspectorController.h"
#include "InspectorInstrumentation.h"
#include "KeyboardEvent.h"
#include "Logging.h"
@@ -938,9 +937,8 @@ PassRefPtr<Node> Document::adoptNode(PassRefPtr<Node> source, ExceptionCode& ec)
if (source->parentNode())
source->parentNode()->removeChild(source.get(), ec);
}
-
- for (Node* node = source.get(); node; node = node->traverseNextNode(source.get()))
- node->setDocument(this);
+
+ source->setDocumentRecursively(this);
return source;
}
@@ -1196,6 +1194,16 @@ KURL Document::baseURI() const
return m_baseURL;
}
+void Document::setContent(const String& content)
+{
+ removeAllChildren();
+
+ open();
+ m_parser->append(content);
+ m_parser->finish();
+ close();
+}
+
// FIXME: We need to discuss the DOM API here at some point. Ideas:
// * making it receive a rect as parameter, i.e. nodesFromRect(x, y, w, h);
// * making it receive the expading size of each direction separately,
@@ -3451,11 +3459,13 @@ void Document::nodeWillBeRemoved(Node* n)
ASSERT(n);
if (n->contains(m_fullScreenElement.get())) {
ASSERT(n != documentElement());
+
+ if (m_fullScreenRenderer)
+ m_fullScreenRenderer->remove();
+
setFullScreenRenderer(0);
m_fullScreenElement = documentElement();
- m_fullScreenElement->setNeedsStyleRecalc();
- m_fullScreenElement->detach();
- updateStyleIfNeeded();
+ recalcStyle(Force);
m_fullScreenChangeDelayTimer.startOneShot(0);
}
#endif
@@ -4309,13 +4319,7 @@ void Document::finishedParsing()
f->loader()->finishedParsing();
-#if ENABLE(INSPECTOR)
- if (!page())
- return;
-
- if (InspectorController* controller = page()->inspectorController())
- controller->mainResourceFiredDOMContentEvent(f->loader()->documentLoader(), url());
-#endif
+ InspectorInstrumentation::mainResourceFiredDOMContentEvent(f, url());
}
}
@@ -4866,13 +4870,6 @@ bool Document::isXHTMLMPDocument() const
}
#endif
-#if ENABLE(INSPECTOR)
-InspectorController* Document::inspectorController() const
-{
- return page() ? page()->inspectorController() : 0;
-}
-#endif
-
#if ENABLE(FULLSCREEN_API)
void Document::webkitRequestFullScreenForElement(Element* element, unsigned short flags)
{
diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h
index e114385..e70063a 100644
--- a/Source/WebCore/dom/Document.h
+++ b/Source/WebCore/dom/Document.h
@@ -91,7 +91,6 @@ class HTMLInputElement;
class HTMLMapElement;
class HitTestRequest;
class HitTestResult;
-class InspectorController;
class IntPoint;
class DOMWrapperWorld;
class JSNode;
@@ -349,6 +348,8 @@ public:
void setCharset(const String&);
+ void setContent(const String&);
+
String contentLanguage() const { return m_contentLanguage; }
void setContentLanguage(const String& lang) { m_contentLanguage = lang; }
@@ -500,9 +501,6 @@ public:
Frame* frame() const { return m_frame; } // can be NULL
Page* page() const; // can be NULL
Settings* settings() const; // can be NULL
-#if ENABLE(INSPECTOR)
- virtual InspectorController* inspectorController() const; // can be NULL
-#endif
PassRefPtr<Range> createRange();
diff --git a/Source/WebCore/dom/Document.idl b/Source/WebCore/dom/Document.idl
index 89f53ec..8d7a71b 100644
--- a/Source/WebCore/dom/Document.idl
+++ b/Source/WebCore/dom/Document.idl
@@ -333,7 +333,7 @@ module core {
in long ScreenX,
in long screenY)
raises (DOMException);
- [ReturnsNew, EnabledAtRuntime] TouchList createTouchList()
+ [ReturnsNew, EnabledAtRuntime, Custom] TouchList createTouchList()
raises (DOMException);
#endif
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 4c10a32..5d91db7 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -1497,7 +1497,7 @@ void Element::updateFocusAppearance(bool /*restorePreviousSelection*/)
return;
// FIXME: We should restore the previous selection if there is one.
- VisibleSelection newSelection = VisibleSelection(Position(this, 0), DOWNSTREAM);
+ VisibleSelection newSelection = VisibleSelection(firstPositionInNode(this), DOWNSTREAM);
if (frame->selection()->shouldChangeSelection(newSelection)) {
frame->selection()->setSelection(newSelection);
diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h
index e552376..5e6c047 100644
--- a/Source/WebCore/dom/Element.h
+++ b/Source/WebCore/dom/Element.h
@@ -230,6 +230,7 @@ public:
Node* shadowRoot();
void setShadowRoot(PassRefPtr<Node>);
+ virtual AtomicString shadowPseudoId() const;
RenderStyle* computedStyle(PseudoId = NOPSEUDO);
@@ -507,6 +508,11 @@ inline void Element::setIdAttribute(const AtomicString& value)
setAttribute(document()->idAttributeName(), value);
}
+inline AtomicString Element::shadowPseudoId() const
+{
+ return AtomicString();
+}
+
} // namespace
#endif
diff --git a/Source/WebCore/dom/Event.cpp b/Source/WebCore/dom/Event.cpp
index a949fd5..0a1538b 100644
--- a/Source/WebCore/dom/Event.cpp
+++ b/Source/WebCore/dom/Event.cpp
@@ -22,6 +22,7 @@
#include "config.h"
#include "Event.h"
+#include "EventTarget.h"
#include "UserGestureIndicator.h"
#include <wtf/CurrentTime.h>
diff --git a/Source/WebCore/dom/Event.h b/Source/WebCore/dom/Event.h
index f05d36c..8562cad 100644
--- a/Source/WebCore/dom/Event.h
+++ b/Source/WebCore/dom/Event.h
@@ -25,13 +25,13 @@
#define Event_h
#include "DOMTimeStamp.h"
-#include "EventTarget.h"
#include <wtf/RefCounted.h>
#include <wtf/text/AtomicString.h>
namespace WebCore {
class Clipboard;
+ class EventTarget;
class Event : public RefCounted<Event> {
public:
diff --git a/Source/WebCore/dom/EventQueue.cpp b/Source/WebCore/dom/EventQueue.cpp
index 27cd802..a43929e 100644
--- a/Source/WebCore/dom/EventQueue.cpp
+++ b/Source/WebCore/dom/EventQueue.cpp
@@ -48,12 +48,26 @@ void EventQueue::enqueueEvent(PassRefPtr<Event> event)
m_pendingEventTimer.startOneShot(0);
}
+void EventQueue::enqueueScrollEvent(PassRefPtr<Node> target, ScrollEventTargetType targetType)
+{
+ if (!m_nodesWithQueuedScrollEvents.add(target.get()).second)
+ return;
+
+ // Per the W3C CSSOM View Module, scroll events fired at the document should bubble, others should not.
+ bool canBubble = targetType == ScrollEventDocumentTarget;
+ RefPtr<Event> scrollEvent = Event::create(eventNames().scrollEvent, canBubble, false /* non cancelleable */);
+ scrollEvent->setTarget(target);
+ enqueueEvent(scrollEvent.release());
+}
+
void EventQueue::pendingEventTimerFired(Timer<EventQueue>*)
{
ASSERT(!m_pendingEventTimer.isActive());
Vector<RefPtr<Event> > queuedEvents;
queuedEvents.swap(m_queuedEvents);
+
+ m_nodesWithQueuedScrollEvents.clear();
for (size_t i = 0; i < queuedEvents.size(); i++)
dispatchEvent(queuedEvents[i].release());
diff --git a/Source/WebCore/dom/EventQueue.h b/Source/WebCore/dom/EventQueue.h
index 8dd7ec9..7f8d5fb 100644
--- a/Source/WebCore/dom/EventQueue.h
+++ b/Source/WebCore/dom/EventQueue.h
@@ -28,6 +28,7 @@
#define EventQueue_h
#include "Timer.h"
+#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
@@ -41,9 +42,15 @@ class EventQueue {
WTF_MAKE_NONCOPYABLE(EventQueue);
public:
+ enum ScrollEventTargetType {
+ ScrollEventDocumentTarget,
+ ScrollEventElementTarget
+ };
+
EventQueue();
void enqueueEvent(PassRefPtr<Event>);
+ void enqueueScrollEvent(PassRefPtr<Node>, ScrollEventTargetType);
private:
void pendingEventTimerFired(Timer<EventQueue>*);
@@ -51,6 +58,7 @@ private:
Timer<EventQueue> m_pendingEventTimer;
Vector<RefPtr<Event> > m_queuedEvents;
+ HashSet<Node*> m_nodesWithQueuedScrollEvents;
};
}
diff --git a/Source/WebCore/dom/ExceptionCode.cpp b/Source/WebCore/dom/ExceptionCode.cpp
index 7e7e0c9..1118a1a 100644
--- a/Source/WebCore/dom/ExceptionCode.cpp
+++ b/Source/WebCore/dom/ExceptionCode.cpp
@@ -222,7 +222,8 @@ static const char* const idbDatabaseExceptionNames[] = {
"RECOVERABLE_ERR",
"TRANSIENT_ERR",
"TIMEOUT_ERR",
- "DEADLOCK_ERR"
+ "DEADLOCK_ERR",
+ "READ_ONLY_ERR"
};
static const char* const idbDatabaseExceptionDescriptions[] = {
@@ -236,7 +237,8 @@ static const char* const idbDatabaseExceptionDescriptions[] = {
"RECOVERABLE_ERR", // FIXME: This isn't even used.
"TRANSIENT_ERR", // FIXME: This isn't even used.
"TIMEOUT_ERR", // This can't be thrown.
- "DEADLOCK_ERR" // This can't be thrown.
+ "DEADLOCK_ERR", // This can't be thrown.
+ "Write operations cannot be preformed on a read-only transaction."
};
#endif
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index 8c12285..1998c8c 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -756,6 +756,21 @@ bool Node::hasNonEmptyBoundingBox() const
return false;
}
+void Node::setDocumentRecursively(Document* document)
+{
+ // FIXME: To match Gecko, we should do this for nodes that are already in the document as well.
+ if (this->document() == document || this->inDocument())
+ return;
+
+ for (Node* node = this; node; node = node->traverseNextNode(this)) {
+ node->setDocument(document);
+ if (!node->isElementNode())
+ continue;
+ if (Node* shadow = toElement(node)->shadowRoot())
+ shadow->setDocumentRecursively(document);
+ }
+}
+
inline void Node::setStyleChange(StyleChangeType changeType)
{
m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType;
@@ -998,7 +1013,7 @@ void Node::removeCachedLabelsNodeList(DynamicNodeList* list)
data->m_labelsNodeListCache = 0;
}
-Node *Node::traverseNextNode(const Node *stayWithin) const
+Node* Node::traverseNextNode(const Node* stayWithin) const
{
if (firstChild())
return firstChild();
@@ -1014,7 +1029,7 @@ Node *Node::traverseNextNode(const Node *stayWithin) const
return 0;
}
-Node *Node::traverseNextSibling(const Node *stayWithin) const
+Node* Node::traverseNextSibling(const Node* stayWithin) const
{
if (this == stayWithin)
return 0;
@@ -1038,7 +1053,7 @@ Node* Node::traverseNextNodePostOrder() const
return next;
}
-Node *Node::traversePreviousNode(const Node *stayWithin) const
+Node* Node::traversePreviousNode(const Node* stayWithin) const
{
if (this == stayWithin)
return 0;
@@ -1051,7 +1066,7 @@ Node *Node::traversePreviousNode(const Node *stayWithin) const
return parentNode();
}
-Node *Node::traversePreviousNodePostOrder(const Node *stayWithin) const
+Node* Node::traversePreviousNodePostOrder(const Node* stayWithin) const
{
if (lastChild())
return lastChild();
@@ -1163,15 +1178,6 @@ static void checkAcceptChild(Node* newParent, Node* newChild, ExceptionCode& ec)
}
}
-static void transferOwnerDocument(Document* newDocument, Node* root)
-{
- // FIXME: To match Gecko, we should do this for nodes that are already in the document as well.
- if (root->document() != newDocument && !root->inDocument()) {
- for (Node* node = root; node; node = node->traverseNextNode(root))
- node->setDocument(newDocument);
- }
-}
-
void Node::checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode& ec)
{
checkAcceptChild(this, newChild, ec);
@@ -1183,7 +1189,7 @@ void Node::checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode& ec)
return;
}
- transferOwnerDocument(document(), newChild);
+ newChild->setDocumentRecursively(document());
}
void Node::checkAddChild(Node *newChild, ExceptionCode& ec)
@@ -1197,7 +1203,7 @@ void Node::checkAddChild(Node *newChild, ExceptionCode& ec)
return;
}
- transferOwnerDocument(document(), newChild);
+ newChild->setDocumentRecursively(document());
}
bool Node::isDescendantOf(const Node *other) const
@@ -1379,8 +1385,10 @@ void Node::createRendererIfNeeded()
document()->setFullScreenRenderer(fullscreenRenderer);
}
#endif
-
- if (parentRenderer && parentRenderer->canHaveChildren() && parent->childShouldCreateRenderer(this)) {
+
+ // FIXME: Ignoreing canHaveChildren() in a case of isShadowRoot() might be wrong.
+ // See https://bugs.webkit.org/show_bug.cgi?id=52423
+ if (parentRenderer && (parentRenderer->canHaveChildren() || isShadowRoot()) && parent->childShouldCreateRenderer(this)) {
RefPtr<RenderStyle> style = styleForRenderer();
if (rendererIsNeeded(style.get())) {
if (RenderObject* r = createRenderer(document()->renderArena(), style.get())) {
@@ -1617,7 +1625,7 @@ PassRefPtr<Element> Node::querySelector(const String& selectors, ExceptionCode&
CSSSelectorList querySelectorList;
p.parseSelector(selectors, document(), querySelectorList);
- if (!querySelectorList.first()) {
+ if (!querySelectorList.first() || querySelectorList.hasUnknownPseudoElements()) {
ec = SYNTAX_ERR;
return 0;
}
@@ -1664,7 +1672,7 @@ PassRefPtr<NodeList> Node::querySelectorAll(const String& selectors, ExceptionCo
CSSSelectorList querySelectorList;
p.parseSelector(selectors, document(), querySelectorList);
- if (!querySelectorList.first()) {
+ if (!querySelectorList.first() || querySelectorList.hasUnknownPseudoElements()) {
ec = SYNTAX_ERR;
return 0;
}
@@ -2685,6 +2693,22 @@ static const EventContext* topEventContext(const Vector<EventContext>& ancestors
return ancestors.isEmpty() ? 0 : &ancestors.last();
}
+static EventDispatchBehavior determineDispatchBehavior(Event* event)
+{
+ // Per XBL 2.0 spec, mutation events should never cross shadow DOM boundary:
+ // http://dev.w3.org/2006/xbl2/#event-flow-and-targeting-across-shadow-s
+ if (event->isMutationEvent())
+ return StayInsideShadowDOM;
+
+ // WebKit never allowed selectstart event to cross the the shadow DOM boundary.
+ // Changing this breaks existing sites.
+ // See https://bugs.webkit.org/show_bug.cgi?id=52195 for details.
+ if (event->type() == eventNames().selectstartEvent)
+ return StayInsideShadowDOM;
+
+ return RetargetEvent;
+}
+
bool Node::dispatchGenericEvent(PassRefPtr<Event> prpEvent)
{
RefPtr<Event> event(prpEvent);
@@ -2699,7 +2723,7 @@ bool Node::dispatchGenericEvent(PassRefPtr<Event> prpEvent)
RefPtr<Node> thisNode(this);
RefPtr<EventTarget> originalTarget = event->target();
Vector<EventContext> ancestors;
- getEventAncestors(ancestors, originalTarget.get(), event->isMutationEvent() ? StayInsideShadowDOM : RetargetEvent);
+ getEventAncestors(ancestors, originalTarget.get(), determineDispatchBehavior(event.get()));
WindowEventContext windowContext(event.get(), this, topEventContext(ancestors));
diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h
index 31a4a65..bc33e22 100644
--- a/Source/WebCore/dom/Node.h
+++ b/Source/WebCore/dom/Node.h
@@ -372,7 +372,7 @@ public:
// argument is non-null, the traversal will stop once the specified node is reached.
// This can be used to restrict traversal to a particular sub-tree.
Node* traverseNextNode(const Node* stayWithin = 0) const;
-
+
// Like traverseNextNode, but skips children and starts with the next sibling.
Node* traverseNextSibling(const Node* stayWithin = 0) const;
@@ -656,6 +656,7 @@ private:
void markCachedNodeListsSlow(JSC::MarkStack&, JSC::JSGlobalData&);
#endif
+ void setDocumentRecursively(Document*);
void setStyleChange(StyleChangeType);
// Used to share code between lazyAttach and setNeedsStyleRecalc.
diff --git a/Source/WebCore/dom/Range.cpp b/Source/WebCore/dom/Range.cpp
index 1f15f26..a41fc49 100644
--- a/Source/WebCore/dom/Range.cpp
+++ b/Source/WebCore/dom/Range.cpp
@@ -794,13 +794,8 @@ PassRefPtr<DocumentFragment> Range::processContents(ActionType action, Exception
Node* n = m_end.container()->firstChild();
if (n && m_end.offset()) {
NodeVector nodes;
- int i = 0;
- do {
+ for (int i = 0; i < m_end.offset() && n; i++, n = n->nextSibling())
nodes.append(n);
- if (!n->nextSibling())
- break;
- n = n->nextSibling();
- } while (i + 1 < m_end.offset());
for (int i = nodes.size() - 1; i >= 0; i--) {
n = nodes[i].get();
if (action == EXTRACT_CONTENTS)
diff --git a/Source/WebCore/dom/ScriptExecutionContext.h b/Source/WebCore/dom/ScriptExecutionContext.h
index 12eb776..e473a4b 100644
--- a/Source/WebCore/dom/ScriptExecutionContext.h
+++ b/Source/WebCore/dom/ScriptExecutionContext.h
@@ -57,9 +57,6 @@ namespace WebCore {
#endif
class MessagePort;
class SecurityOrigin;
-#if ENABLE(INSPECTOR)
- class InspectorController;
-#endif
class ScriptExecutionContext {
public:
@@ -87,9 +84,6 @@ namespace WebCore {
virtual String userAgent(const KURL&) const = 0;
SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }
-#if ENABLE(INSPECTOR)
- virtual InspectorController* inspectorController() const { return 0; }
-#endif
virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL) = 0;
virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL) = 0;
diff --git a/Source/WebCore/dom/StyleElement.cpp b/Source/WebCore/dom/StyleElement.cpp
index e9878a6..8f37275 100644
--- a/Source/WebCore/dom/StyleElement.cpp
+++ b/Source/WebCore/dom/StyleElement.cpp
@@ -30,6 +30,13 @@
namespace WebCore {
+static bool isValidStyleChild(Node* node)
+{
+ ASSERT(node);
+ Node::NodeType nodeType = node->nodeType();
+ return nodeType == Node::TEXT_NODE || nodeType == Node::CDATA_SECTION_NODE;
+}
+
StyleElement::StyleElement(Document* document, bool createdByParser)
: m_createdByParser(createdByParser)
, m_loading(false)
@@ -94,6 +101,7 @@ void StyleElement::process(Element* e)
unsigned resultLength = 0;
for (Node* c = e->firstChild(); c; c = c->nextSibling()) {
+<<<<<<< HEAD
Node::NodeType nodeType = c->nodeType();
if (nodeType == Node::TEXT_NODE || nodeType == Node::CDATA_SECTION_NODE || nodeType == Node::COMMENT_NODE) {
unsigned length = c->nodeValue().length();
@@ -101,14 +109,17 @@ void StyleElement::process(Element* e)
CRASH();
resultLength += length;
}
+=======
+ if (isValidStyleChild(c))
+ resultLength += c->nodeValue().length();
+>>>>>>> WebKit.org @ r75993
}
UChar* text;
String sheetText = String::createUninitialized(resultLength, text);
UChar* p = text;
for (Node* c = e->firstChild(); c; c = c->nextSibling()) {
- Node::NodeType nodeType = c->nodeType();
- if (nodeType == Node::TEXT_NODE || nodeType == Node::CDATA_SECTION_NODE || nodeType == Node::COMMENT_NODE) {
+ if (isValidStyleChild(c)) {
String nodeValue = c->nodeValue();
unsigned nodeLength = nodeValue.length();
memcpy(p, nodeValue.characters(), nodeLength * sizeof(UChar));
diff --git a/Source/WebCore/dom/StyleElement.h b/Source/WebCore/dom/StyleElement.h
index 05c07c5..4356c17 100644
--- a/Source/WebCore/dom/StyleElement.h
+++ b/Source/WebCore/dom/StyleElement.h
@@ -37,7 +37,7 @@ protected:
virtual const AtomicString& type() const = 0;
virtual const AtomicString& media() const = 0;
- StyleSheet* sheet() { return m_sheet.get(); }
+ StyleSheet* sheet() const { return m_sheet.get(); }
bool isLoading() const;
bool sheetLoaded(Document*);
diff --git a/Source/WebCore/dom/StyledElement.cpp b/Source/WebCore/dom/StyledElement.cpp
index 9a7c9c8..d6a532f 100644
--- a/Source/WebCore/dom/StyledElement.cpp
+++ b/Source/WebCore/dom/StyledElement.cpp
@@ -25,10 +25,11 @@
#include "StyledElement.h"
#include "Attribute.h"
-#include "ClassList.h"
+#include "CSSMutableStyleDeclaration.h"
#include "CSSStyleSelector.h"
#include "CSSStyleSheet.h"
#include "CSSValueKeywords.h"
+#include "ClassList.h"
#include "DOMTokenList.h"
#include "Document.h"
#include "HTMLNames.h"
diff --git a/Source/WebCore/dom/StyledElement.h b/Source/WebCore/dom/StyledElement.h
index 8040dbf..32fc4c2 100644
--- a/Source/WebCore/dom/StyledElement.h
+++ b/Source/WebCore/dom/StyledElement.h
@@ -25,7 +25,6 @@
#ifndef StyledElement_h
#define StyledElement_h
-#include "CSSMutableStyleDeclaration.h"
#include "Element.h"
#include "MappedAttributeEntry.h"
@@ -33,6 +32,7 @@ namespace WebCore {
class Attribute;
class CSSMappedAttributeDeclaration;
+class CSSMutableStyleDeclaration;
class StyledElement : public Element {
public:
diff --git a/Source/WebCore/dom/TouchEvent.cpp b/Source/WebCore/dom/TouchEvent.cpp
index 88d3e6f..225e3ae 100644
--- a/Source/WebCore/dom/TouchEvent.cpp
+++ b/Source/WebCore/dom/TouchEvent.cpp
@@ -61,6 +61,9 @@ void TouchEvent::initTouchEvent(TouchList* touches, TouchList* targetTouches,
initUIEvent(type, true, true, view, 0);
+ m_touches = touches;
+ m_targetTouches = targetTouches;
+ m_changedTouches = changedTouches;
m_screenX = screenX;
m_screenY = screenY;
m_ctrlKey = ctrlKey;
diff --git a/Source/WebCore/dom/XMLDocumentParser.cpp b/Source/WebCore/dom/XMLDocumentParser.cpp
index 68c8dd9..a5d3c08 100644
--- a/Source/WebCore/dom/XMLDocumentParser.cpp
+++ b/Source/WebCore/dom/XMLDocumentParser.cpp
@@ -116,13 +116,9 @@ void XMLDocumentParser::clearCurrentNodeStack()
}
}
-void XMLDocumentParser::insert(const SegmentedString& source)
+void XMLDocumentParser::insert(const SegmentedString&)
{
- // FIXME: This is a hack to work around the fact that XMLHttpRequest
- // responseXML() calls Document::write() which in turn calls insert(). In
- // HTML, that's correct, as insert() implies a synchronous parse. For XML,
- // all parsing is synchronous but document.write shouldn't be supported.
- append(source);
+ ASSERT_NOT_REACHED();
}
void XMLDocumentParser::append(const SegmentedString& s)