Commit 5159d9c2 authored by hyatt's avatar hyatt

Move text measurement and layout beyond onload. This

	shoudl speed up i-bench substantially and morrison's
	PLT test slightly.

	Also allow <table>s as children of <p> and <h1>-<h6>.
	This fixes floats on slashdot.org (the left side) and
	the floating tables in articles on wired.com.

        * khtml/html/dtd.cpp:
        (DOM::checkChild):
        * khtml/html/html_documentimpl.cpp:
        (HTMLDocumentImpl::HTMLDocumentImpl):
        (HTMLDocumentImpl::close):
        * khtml/html/html_documentimpl.h:
        * khtml/html/htmlparser.cpp:
        (KHTMLParser::insertNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 852d80b2
2002-11-14 David Hyatt <hyatt@apple.com>
Move text measurement and layout beyond onload. This
shoudl speed up i-bench substantially and morrison's
PLT test slightly.
Also allow <table>s as children of <p> and <h1>-<h6>.
This fixes floats on slashdot.org (the left side) and
the floating tables in articles on wired.com.
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::HTMLDocumentImpl):
(HTMLDocumentImpl::close):
* khtml/html/html_documentimpl.h:
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode):
2002-11-14 Richard Williamson <rjw@apple.com>
Fixed 3099505. With the recent white space changes, multiple slaves may
......
2002-11-14 David Hyatt <hyatt@apple.com>
Move text measurement and layout beyond onload. This
shoudl speed up i-bench substantially and morrison's
PLT test slightly.
Also allow <table>s as children of <p> and <h1>-<h6>.
This fixes floats on slashdot.org (the left side) and
the floating tables in articles on wired.com.
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::HTMLDocumentImpl):
(HTMLDocumentImpl::close):
* khtml/html/html_documentimpl.h:
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode):
2002-11-14 Richard Williamson <rjw@apple.com>
Fixed 3099505. With the recent white space changes, multiple slaves may
......
2002-11-14 David Hyatt <hyatt@apple.com>
Move text measurement and layout beyond onload. This
shoudl speed up i-bench substantially and morrison's
PLT test slightly.
Also allow <table>s as children of <p> and <h1>-<h6>.
This fixes floats on slashdot.org (the left side) and
the floating tables in articles on wired.com.
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::HTMLDocumentImpl):
(HTMLDocumentImpl::close):
* khtml/html/html_documentimpl.h:
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode):
2002-11-14 Richard Williamson <rjw@apple.com>
Fixed 3099505. With the recent white space changes, multiple slaves may
......
......@@ -591,6 +591,10 @@ bool DOM::checkChild(ushort tagID, ushort childID)
case ID_SUB:
case ID_SUP:
case ID_BDO:
case ID_Q:
case ID_LEGEND:
// _0 *
return check_array(childID, tag_list_0);
case ID_P:
case ID_H1:
case ID_H2:
......@@ -598,9 +602,7 @@ bool DOM::checkChild(ushort tagID, ushort childID)
case ID_H4:
case ID_H5:
case ID_H6:
case ID_Q:
case ID_LEGEND:
// _0 *
if (childID == ID_TABLE) return true;
return check_array(childID, tag_list_0);
case ID_BASEFONT:
case ID_BR:
......
......@@ -30,6 +30,7 @@
#include "khtmlview.h"
#include "khtml_part.h"
#include "khtmlpart_p.h"
#include "khtml_settings.h"
#include "misc/htmlattrs.h"
#include "misc/htmlhashes.h"
......@@ -79,6 +80,7 @@ HTMLDocumentImpl::HTMLDocumentImpl(DOMImplementationImpl *_implementation, KHTML
*/
connect( KHTMLFactory::vLinks(), SIGNAL( cleared()),
SLOT( slotHistoryChanged() ));
m_startTime.restart();
}
HTMLDocumentImpl::~HTMLDocumentImpl()
......@@ -296,13 +298,25 @@ void HTMLDocumentImpl::close()
{
// First fire the onload.
bool doload = !parsing() && m_tokenizer;
bool notRedirecting = view()->part()->d->m_redirectURL.isNull() ||
view()->part()->d->m_redirectURL.isEmpty();
if (body() && doload)
body()->dispatchWindowEvent(EventImpl::LOAD_EVENT, false, false);
// Make sure both the initial layout and reflow happen after the onload
// fires. This will improve onload scores, and other browsers do it.
// If they wanna cheat, we can too. -dwh
if (doload && notRedirecting && !view()->part()->d->m_redirectURL.isNull() &&
!view()->part()->d->m_redirectURL.isEmpty() &&
view()->part()->d->m_delayRedirect == 0 &&
m_startTime.elapsed() < 1000) {
delete m_tokenizer; m_tokenizer = 0;
view()->unscheduleRelayout();
return; // Just bail out. During the onload we were shifted to another page.
// i-Bench does this. When this happens don't bother painting or laying out.
}
// The initial layout happens here.
DocumentImpl::close();
......
......@@ -28,6 +28,7 @@
#include "misc/loader_client.h"
#include <qmap.h>
#include <qdatetime.h>
class KHTMLView;
class QString;
......@@ -91,6 +92,8 @@ protected slots:
void slotHistoryChanged();
private:
mutable DOMString m_domain;
QTime m_startTime;
#if APPLE_CHANGES
DOMString m_policyBaseURL;
#endif
......
......@@ -350,10 +350,6 @@ bool KHTMLParser::insertNode(NodeImpl *n, bool flat)
#endif
}
#if SPEED_DEBUG < 1
if(tagPriority[id] == 0 && n->renderer())
n->renderer()->calcMinMaxWidth();
#endif
return true;
} else {
#ifdef PARSER_DEBUG
......
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