Commit db2240fb authored by Andrea Iacovitti's avatar Andrea Iacovitti

Set default to false for lockHistory parameter in goURL() and small cleanups.

parent 7eba557c
......@@ -455,7 +455,7 @@ void KJS::HTMLDocument::putValueProperty(ExecState *exec, int token, JSValue *va
{
KHTMLPart *part = doc.part();
if ( part )
Window::retrieveWindow(part)->goURL(exec, value->toString(exec).qstring(), false /*don't lock history*/);
Window::retrieveWindow(part)->goURL(exec, value->toString(exec).qstring());
return;
}
case DesignMode:
......
......@@ -1349,18 +1349,16 @@ void Window::put(ExecState* exec, const Identifier &propertyName, JSValue *value
}
const HashEntry* entry = Lookup::findEntry(&WindowTable, propertyName);
if (entry && !m_frame.isNull() && !m_frame->m_part.isNull())
if (entry)
{
#ifdef KJS_VERBOSE
kDebug(6070) << "Window("<<this<<")::put " << propertyName.qstring();
#endif
switch( entry->value) {
case _Location:
goURL(exec, value->toString(exec).qstring(), false /*don't lock history*/);
return;
default:
break;
if (entry->value == _Location) {
goURL(exec, value->toString(exec).qstring());
return;
}
KHTMLPart *part = qobject_cast<KHTMLPart*>(m_frame->m_part);
if (part) {
switch( entry->value ) {
......@@ -1729,9 +1727,7 @@ void Window::goURL(ExecState* exec, const QString& url, bool lockHistory)
// check if we're allowed to inject javascript
if ( !KHTMLPartPrivate::isJavaScriptURL(dstUrl) || isSafeScript(exec) )
part->scheduleRedirection(-1,
dstUrl,
lockHistory);
part->scheduleRedirection(-1, dstUrl, lockHistory);
} else if (!part && m_frame->m_partContainerElement) {
KParts::BrowserExtension *b = KParts::BrowserExtension::childObject(m_frame->m_part);
if (b)
......@@ -1993,24 +1989,24 @@ JSValue *Window::executeOpenWindow(ExecState *exec, const KUrl& url, const QStri
{
while ( p->parentPart() )
p = p->parentPart();
Window::retrieveWindow(p)->goURL(exec, url.url(), false /*don't lock history*/);
Window::retrieveWindow(p)->goURL(exec, url.url());
return Window::retrieve(p);
}
if ( browserArgs.frameName.toLower() == "_parent" )
{
if ( p->parentPart() )
p = p->parentPart();
Window::retrieveWindow(p)->goURL(exec, url.url(), false /*don't lock history*/);
Window::retrieveWindow(p)->goURL(exec, url.url());
return Window::retrieve(p);
}
if ( browserArgs.frameName.toLower() == "_self")
{
Window::retrieveWindow(p)->goURL(exec, url.url(), false /*don't lock history*/);
Window::retrieveWindow(p)->goURL(exec, url.url());
return Window::retrieve(p);
}
if ( browserArgs.frameName.toLower() == "replace" )
{
Window::retrieveWindow(p)->goURL(exec, url.url(), true /*lock history*/);
Window::retrieveWindow(p)->goURL(exec, url.url(), true/*lock history*/);
return Window::retrieve(p);
}
args.setMimeType("text/html");
......@@ -2224,7 +2220,7 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
return new KJS::DOMSelection(exec, part->xmlDocImpl());
case Window::Navigate:
window->goURL(exec, args[0]->toString(exec).qstring(), false /*don't lock history*/);
window->goURL(exec, args[0]->toString(exec).qstring());
return jsUndefined();
case Window::Focus: {
KHTMLSettings::KJSWindowFocusPolicy policy =
......@@ -2919,7 +2915,7 @@ void Location::put(ExecState *exec, const Identifier &p, JSValue *v, int attr)
if (m_frame.isNull() || m_frame->m_part.isNull())
return;
const Window* window = Window::retrieveWindow( m_frame->m_part );
Window* window = Window::retrieveWindow( m_frame->m_part );
if ( !window )
return;
......@@ -2987,7 +2983,7 @@ void Location::put(ExecState *exec, const Identifier &p, JSValue *v, int attr)
return;
}
Window::retrieveWindow(m_frame->m_part)->goURL(exec, url.url(), false /* don't lock history*/ );
window->goURL(exec, url.url());
}
JSValue *Location::toPrimitive(ExecState *exec, JSType) const
......@@ -3033,9 +3029,10 @@ JSValue *LocationFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const
switch (id) {
case Location::Assign:
window->goURL(exec, args[0]->toString(exec).qstring());
break;
case Location::Replace:
Window::retrieveWindow(part)->goURL(exec, args[0]->toString(exec).qstring(),
id == Location::Replace);
window->goURL(exec, args[0]->toString(exec).qstring(), true/*lock history*/);
break;
case Location::Reload: {
KHTMLPart *khtmlpart = qobject_cast<KHTMLPart*>(part);
......
......@@ -137,7 +137,7 @@ namespace KJS {
void closeNow();
void delayedGoHistory(int steps);
void goHistory(int steps);
void goURL(ExecState* exec, const QString& url, bool lockHistory);
void goURL(ExecState* exec, const QString& url, bool lockHistory = false);
static bool targetIsExistingWindow(KHTMLPart* part, const QString& frameName);
JSValue* openWindow(ExecState *exec, const List &args);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment