Commit 40c68764 authored by Andrea Iacovitti's avatar Andrea Iacovitti

Allow scrolling to the top of document also in strict mode, it's in the standard now.

parent c80098c4
......@@ -2710,8 +2710,7 @@ bool KHTMLPart::gotoAnchor( const QString &name )
if (!d->m_doc)
return false;
HTMLCollectionImpl *anchors =
new HTMLCollectionImpl( d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
HTMLCollectionImpl *anchors = new HTMLCollectionImpl(d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
NodeImpl *n = anchors->namedItem(name);
......@@ -2722,10 +2721,10 @@ bool KHTMLPart::gotoAnchor( const QString &name )
d->m_doc->setCSSTarget(n); // Setting to null will clear the current target.
// Implement the rule that "" and "top" both mean top of page as in other browsers.
bool quirkyName = !n && !d->m_doc->inStrictMode() && (name.isEmpty() || name.toLower() == "top");
// Implement the rule that "" and "top" both mean top of page.
bool top = !n && (name.isEmpty() || name.toLower() == "top");
if (quirkyName) {
if (top) {
d->m_view->setContentsPos( d->m_view->contentsX(), 0);
return true;
} else if (!n) {
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