summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Iacovitti <aiacovitti@libero.it>2012-06-25 05:47:42 (GMT)
committerAndrea Iacovitti <aiacovitti@libero.it>2012-06-25 05:47:42 (GMT)
commit48b3b2d63026e9f9a145304d73194af3327d38ff (patch)
treedf42ec282019da5ee7cf51adc95d6ed367f5f0b5
parent1e0a72e82d4ed53e39277196e7081ded2055e53c (diff)
Fix DOMHashChangeEvent c&p error.
Correctly initialize hashchangeevent with complete old/new urls.
-rw-r--r--khtml/ecma/kjs_events.cpp14
-rw-r--r--khtml/ecma/kjs_events.h2
-rw-r--r--khtml/ecma/kjs_html.cpp4
-rw-r--r--khtml/khtml_part.cpp6
-rw-r--r--khtml/xml/dom2_eventsimpl.cpp4
-rw-r--r--khtml/xml/dom2_eventsimpl.h8
6 files changed, 19 insertions, 19 deletions
diff --git a/khtml/ecma/kjs_events.cpp b/khtml/ecma/kjs_events.cpp
index 48e983f..4aa82f9 100644
--- a/khtml/ecma/kjs_events.cpp
+++ b/khtml/ecma/kjs_events.cpp
@@ -1112,11 +1112,11 @@ JSValue *DOMMessageEventProtoFunc::callAsFunction(ExecState *exec, JSObject *thi
const ClassInfo DOMHashChangeEvent::info = { "HashChangeEvent", &DOMEvent::info, &DOMHashChangeEventTable, 0 };
/*
@begin DOMHashChangeEventTable 2
- data DOMHashChangeEvent::OldUrl DontDelete|ReadOnly
- origin DOMHashChangeEvent::NewUrl DontDelete|ReadOnly
+ oldURL DOMHashChangeEvent::OldURL DontDelete|ReadOnly
+ newURL DOMHashChangeEvent::NewURL DontDelete|ReadOnly
@end
@begin DOMHashChangeEventProtoTable 1
- initMessageEvent DOMHashChangeEvent::InitHashChangeEvent DontDelete|Function 5
+ initHashChangeEvent DOMHashChangeEvent::InitHashChangeEvent DontDelete|Function 5
@end
*/
KJS_DEFINE_PROTOTYPE(DOMHashChangeEventProto)
@@ -1137,10 +1137,10 @@ JSValue *DOMHashChangeEvent::getValueProperty(ExecState *exec, int token) const
{
DOM::HashChangeEventImpl& event = *impl();
switch (token) {
- case NewUrl:
- return jsString(event.newUrl());
- case OldUrl:
- return jsString(event.oldUrl());
+ case NewURL:
+ return jsString(event.newURL());
+ case OldURL:
+ return jsString(event.oldURL());
default:
kDebug(6070) << "WARNING: Unhandled token in DOMHashChangeEvent::getValueProperty : " << token;
return jsUndefined();
diff --git a/khtml/ecma/kjs_events.h b/khtml/ecma/kjs_events.h
index 1df010e..d54c6f0 100644
--- a/khtml/ecma/kjs_events.h
+++ b/khtml/ecma/kjs_events.h
@@ -285,7 +285,7 @@ namespace KJS {
// no put - all read-only
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
- enum { NewUrl, OldUrl, InitHashChangeEvent };
+ enum { NewURL, OldURL, InitHashChangeEvent };
DOM::HashChangeEventImpl* impl() const { return static_cast<DOM::HashChangeEventImpl*>(m_impl.get()); }
};
DEFINE_PSEUDO_CONSTRUCTOR(HashChangeEventPseudoCtor)
diff --git a/khtml/ecma/kjs_html.cpp b/khtml/ecma/kjs_html.cpp
index b269250..9f8f6d0 100644
--- a/khtml/ecma/kjs_html.cpp
+++ b/khtml/ecma/kjs_html.cpp
@@ -2508,10 +2508,10 @@ void KJS::HTMLElement::putValueProperty(ExecState *exec, int token, JSValue *val
break;
case BodyOnMessage:
setWindowListener(exec, DOM::EventImpl::MESSAGE_EVENT, value);
- break;
+ break;
case BodyOnHashChange:
setWindowListener(exec, DOM::EventImpl::HASHCHANGE_EVENT, value);
- break;
+ break;
}
}
case ID_FRAMESET: {
diff --git a/khtml/khtml_part.cpp b/khtml/khtml_part.cpp
index 98b2b2b..086b356 100644
--- a/khtml/khtml_part.cpp
+++ b/khtml/khtml_part.cpp
@@ -635,15 +635,15 @@ void KHTMLPartPrivate::executeAnchorJump( const KUrl& url, bool lockHistory )
if (!lockHistory)
emit m_extension->openUrlNotify();
- const QString &oldRef = m_workingURL.ref();
+ const QString &oldRef = q->url().ref();
const QString &newRef = url.ref();
if (oldRef != newRef) {
DOM::HashChangeEventImpl *evImpl = new DOM::HashChangeEventImpl();
evImpl->initHashChangeEvent("hashchange",
true, //bubble
false, //cancelable
- oldRef,
- newRef
+ q->url().url(), //oldURL
+ url.url() //newURL
);
m_doc->dispatchWindowEvent(evImpl);
}
diff --git a/khtml/xml/dom2_eventsimpl.cpp b/khtml/xml/dom2_eventsimpl.cpp
index 107342c..0cbe605 100644
--- a/khtml/xml/dom2_eventsimpl.cpp
+++ b/khtml/xml/dom2_eventsimpl.cpp
@@ -1118,6 +1118,6 @@ bool HashChangeEventImpl::isHashChangeEvent() const
void HashChangeEventImpl::initHashChangeEvent(const DOMString& eventTypeArg, bool canBubbleArg, bool cancelableArg, const DOMString& oldURL, const DOMString& newURL)
{
EventImpl::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
- m_oldUrl = oldURL;
- m_newUrl = newURL;
+ m_oldURL = oldURL;
+ m_newURL = newURL;
}
diff --git a/khtml/xml/dom2_eventsimpl.h b/khtml/xml/dom2_eventsimpl.h
index 6ceb0e9..99b6fb2 100644
--- a/khtml/xml/dom2_eventsimpl.h
+++ b/khtml/xml/dom2_eventsimpl.h
@@ -619,8 +619,8 @@ private:
class HashChangeEventImpl : public EventImpl {
public:
- const DOMString &oldUrl() const { return m_oldUrl; }
- const DOMString &newUrl() const { return m_newUrl; }
+ const DOMString &oldURL() const { return m_oldURL; }
+ const DOMString &newURL() const { return m_newURL; }
HashChangeEventImpl();
@@ -632,8 +632,8 @@ public:
);
virtual bool isHashChangeEvent() const;
private:
- DOMString m_oldUrl;
- DOMString m_newUrl;
+ DOMString m_oldURL;
+ DOMString m_newURL;
};
} //namespace