summaryrefslogtreecommitdiffstats
path: root/WebCore/xml
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/xml')
-rw-r--r--WebCore/xml/XMLHttpRequest.cpp18
-rw-r--r--WebCore/xml/XMLHttpRequest.h2
-rw-r--r--WebCore/xml/XPathExpressionNode.h2
-rw-r--r--WebCore/xml/XPathNodeSet.h2
-rw-r--r--WebCore/xml/XPathStep.cpp10
-rw-r--r--WebCore/xml/XPathStep.h2
6 files changed, 22 insertions, 14 deletions
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index 87a6540..f1a7969 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -59,7 +59,7 @@ namespace WebCore {
static WTF::RefCountedLeakCounter xmlHttpRequestCounter("XMLHttpRequest");
#endif
-struct XMLHttpRequestStaticData {
+struct XMLHttpRequestStaticData : Noncopyable {
XMLHttpRequestStaticData();
String m_proxyHeaderPrefix;
String m_secHeaderPrefix;
@@ -253,27 +253,30 @@ void XMLHttpRequest::callReadyStateChangeListener()
#if ENABLE(INSPECTOR)
InspectorTimelineAgent* timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext());
- if (timelineAgent)
+ bool callTimelineAgentOnReadyStateChange = timelineAgent && hasEventListeners(eventNames().readystatechangeEvent);
+ if (callTimelineAgentOnReadyStateChange)
timelineAgent->willChangeXHRReadyState(m_url.string(), m_state);
#endif
dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().readystatechangeEvent));
#if ENABLE(INSPECTOR)
- if (timelineAgent)
+ if (callTimelineAgentOnReadyStateChange && (timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext())))
timelineAgent->didChangeXHRReadyState();
#endif
if (m_state == DONE && !m_error) {
#if ENABLE(INSPECTOR)
- if (timelineAgent)
+ timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext());
+ bool callTimelineAgentOnLoad = timelineAgent && hasEventListeners(eventNames().loadEvent);
+ if (callTimelineAgentOnLoad)
timelineAgent->willLoadXHR(m_url.string());
#endif
dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadEvent));
#if ENABLE(INSPECTOR)
- if (timelineAgent)
+ if (callTimelineAgentOnLoad && (timelineAgent = InspectorTimelineAgent::retrieve(scriptExecutionContext())))
timelineAgent->didLoadXHR();
#endif
}
@@ -629,8 +632,9 @@ void XMLHttpRequest::dropProtection()
// out. But it is protected from GC while loading, so this
// can't be recouped until the load is done, so only
// report the extra cost at that point.
- if (DOMObject* wrapper = getCachedDOMObjectWrapper(*scriptExecutionContext()->globalData(), this))
- JSC::Heap::heap(wrapper)->reportExtraMemoryCost(m_responseText.size() * 2);
+ JSC::JSGlobalData* globalData = scriptExecutionContext()->globalData();
+ if (hasCachedDOMObjectWrapper(globalData, this))
+ globalData->heap.reportExtraMemoryCost(m_responseText.size() * 2);
#endif
unsetPendingActivity(this);
diff --git a/WebCore/xml/XMLHttpRequest.h b/WebCore/xml/XMLHttpRequest.h
index c7e0192..69019a5 100644
--- a/WebCore/xml/XMLHttpRequest.h
+++ b/WebCore/xml/XMLHttpRequest.h
@@ -35,7 +35,7 @@ namespace WebCore {
class Document;
class File;
-struct ResourceRequest;
+class ResourceRequest;
class TextResourceDecoder;
class ThreadableLoader;
diff --git a/WebCore/xml/XPathExpressionNode.h b/WebCore/xml/XPathExpressionNode.h
index 74b134e..38070b9 100644
--- a/WebCore/xml/XPathExpressionNode.h
+++ b/WebCore/xml/XPathExpressionNode.h
@@ -39,7 +39,7 @@ namespace WebCore {
namespace XPath {
- struct EvaluationContext {
+ struct EvaluationContext : FastAllocBase {
RefPtr<Node> node;
unsigned long size;
unsigned long position;
diff --git a/WebCore/xml/XPathNodeSet.h b/WebCore/xml/XPathNodeSet.h
index 1130488..d5c47be 100644
--- a/WebCore/xml/XPathNodeSet.h
+++ b/WebCore/xml/XPathNodeSet.h
@@ -37,7 +37,7 @@ namespace WebCore {
namespace XPath {
- class NodeSet {
+ class NodeSet : public FastAllocBase {
public:
NodeSet() : m_isSorted(true), m_subtreesAreDisjoint(false) { }
diff --git a/WebCore/xml/XPathStep.cpp b/WebCore/xml/XPathStep.cpp
index 411b616..e5f2048 100644
--- a/WebCore/xml/XPathStep.cpp
+++ b/WebCore/xml/XPathStep.cpp
@@ -193,9 +193,13 @@ static inline bool nodeMatchesBasicTest(Node* node, Step::Axis axis, const Step:
if (name == starAtom)
return namespaceURI.isEmpty() || namespaceURI == node->namespaceURI();
- if (node->isHTMLElement() && node->document()->isHTMLDocument()) {
- // Paths without namespaces should match HTML elements in HTML documents despite those having an XHTML namespace. Names are compared case-insensitively.
- return equalIgnoringCase(static_cast<Element*>(node)->localName(), name) && (namespaceURI.isNull() || namespaceURI == node->namespaceURI());
+ if (node->document()->isHTMLDocument()) {
+ if (node->isHTMLElement()) {
+ // Paths without namespaces should match HTML elements in HTML documents despite those having an XHTML namespace. Names are compared case-insensitively.
+ return equalIgnoringCase(static_cast<Element*>(node)->localName(), name) && (namespaceURI.isNull() || namespaceURI == node->namespaceURI());
+ }
+ // An expression without any prefix shouldn't match no-namespace nodes (because HTML5 says so).
+ return static_cast<Element*>(node)->hasLocalName(name) && namespaceURI == node->namespaceURI() && !namespaceURI.isNull();
}
return static_cast<Element*>(node)->hasLocalName(name) && namespaceURI == node->namespaceURI();
}
diff --git a/WebCore/xml/XPathStep.h b/WebCore/xml/XPathStep.h
index 11612e9..ec022b3 100644
--- a/WebCore/xml/XPathStep.h
+++ b/WebCore/xml/XPathStep.h
@@ -49,7 +49,7 @@ namespace WebCore {
SelfAxis
};
- class NodeTest {
+ class NodeTest : public FastAllocBase {
public:
enum Kind {
TextNodeTest, CommentNodeTest, ProcessingInstructionNodeTest, AnyNodeTest, NameTest