2010-11-08 James Simonsen <simonjam@chromium.org>

        Reviewed by Dimitri Glazkov.

        [Web Timing] Split domContentLoaded into start/end
        https://bugs.webkit.org/show_bug.cgi?id=48920

        * fast/dom/script-tests/webtiming.js:
        (checkTimingBeforeLoad):
        (checkTimingWhileDeferred):
        (checkWebTimingOnDOMContentLoaded): Added.
        (checkWebTimingWhileAsync):
        (checkWebTimingOnLoad):
        (checkWebTimingAfterLoad):
        * fast/dom/webtiming-document-open-expected.txt:
        * fast/dom/webtiming-expected.txt:
2010-11-08  James Simonsen  <simonjam@chromium.org>

        Reviewed by Dimitri Glazkov.

        [Web Timing] Split domContentLoaded into start/end
        https://bugs.webkit.org/show_bug.cgi?id=48920

        * dom/Document.cpp:
        (WebCore::Document::finishedParsing):
        * dom/DocumentTiming.h:
        (WebCore::DocumentTiming::DocumentTiming):
        * page/Timing.cpp:
        (WebCore::Timing::domContentLoadedStart):
        (WebCore::Timing::domContentLoadedEnd):
        * page/Timing.h:
        * page/Timing.idl:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 67de2e55
2010-11-08 James Simonsen <simonjam@chromium.org>
Reviewed by Dimitri Glazkov.
[Web Timing] Split domContentLoaded into start/end
https://bugs.webkit.org/show_bug.cgi?id=48920
* fast/dom/script-tests/webtiming.js:
(checkTimingBeforeLoad):
(checkTimingWhileDeferred):
(checkWebTimingOnDOMContentLoaded): Added.
(checkWebTimingWhileAsync):
(checkWebTimingOnLoad):
(checkWebTimingAfterLoad):
* fast/dom/webtiming-document-open-expected.txt:
* fast/dom/webtiming-expected.txt:
2010-11-08 Chang Shu <chang.shu@nokia.com>
Reviewed by Antonio Gomes.
......@@ -40,7 +40,8 @@ function checkTimingBeforeLoad()
shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart");
shouldBe("timing.domInteractive", "0");
shouldBe("timing.domContentLoaded", "0");
shouldBe("timing.domContentLoadedStart", "0");
shouldBe("timing.domContentLoadedEnd", "0");
shouldBe("timing.domComplete", "0");
shouldBe("timing.loadEventStart", "0");
......@@ -72,7 +73,42 @@ function checkTimingWhileDeferred()
shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart");
shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.domLoading");
shouldBe("timing.domContentLoaded", "0");
shouldBe("timing.domContentLoadedStart", "0");
shouldBe("timing.domContentLoadedEnd", "0");
shouldBe("timing.domComplete", "0");
shouldBe("timing.loadEventStart", "0");
shouldBe("timing.loadEventEnd", "0");
window.addEventListener("DOMContentLoaded", checkWebTimingOnDOMContentLoaded, false);
}
function checkWebTimingOnDOMContentLoaded() {
shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC");
shouldBeGreaterThanOrEqual("timing.unloadEventEnd", "timing.navigationStart");
shouldBe("timing.redirectStart", "0");
shouldBe("timing.redirectEnd", "0");
shouldBe("navigation.redirectCount", "0");
shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart");
shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart");
shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart");
shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd");
shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart");
shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd");
shouldBeGreaterThanOrEqual("timing.requestEnd", "timing.requestStart");
shouldBe("timing.responseStart", "timing.requestEnd");
shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart");
shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.domLoading");
shouldBeGreaterThanOrEqual("timing.domContentLoadedStart", "timing.domInteractive");
shouldBe("timing.domContentLoadedEnd", "0");
shouldBe("timing.domComplete", "0");
shouldBe("timing.loadEventStart", "0");
......@@ -111,7 +147,8 @@ function checkWebTimingWhileAsync()
shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart");
shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.responseEnd");
shouldBeGreaterThanOrEqual("timing.domContentLoaded", "timing.domInteractive");
shouldBeGreaterThanOrEqual("timing.domContentLoadedStart", "timing.domInteractive");
shouldBeGreaterThanOrEqual("timing.domContentLoadedEnd", "timing.domContentLoadedStart");
shouldBe("timing.domComplete", "0");
shouldBe("timing.loadEventStart", "0");
......@@ -146,8 +183,9 @@ function checkWebTimingOnLoad()
shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart");
shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.responseEnd");
shouldBeGreaterThanOrEqual("timing.domContentLoaded", "timing.domInteractive");
shouldBeGreaterThanOrEqual("timing.domComplete", "timing.domContentLoaded");
shouldBeGreaterThanOrEqual("timing.domContentLoadedStart", "timing.domInteractive");
shouldBeGreaterThanOrEqual("timing.domContentLoadedEnd", "timing.domContentLoadedStart");
shouldBeGreaterThanOrEqual("timing.domComplete", "timing.domContentLoadedEnd");
shouldBeGreaterThanOrEqual("timing.loadEventStart", "timing.responseEnd");
shouldBe("timing.loadEventEnd", "0");
......@@ -181,8 +219,9 @@ function checkWebTimingAfterLoad()
shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart");
shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.responseEnd");
shouldBeGreaterThanOrEqual("timing.domContentLoaded", "timing.domInteractive");
shouldBeGreaterThanOrEqual("timing.domComplete", "timing.domContentLoaded");
shouldBeGreaterThanOrEqual("timing.domContentLoadedStart", "timing.domInteractive");
shouldBeGreaterThanOrEqual("timing.domContentLoadedEnd", "timing.domContentLoadedStart");
shouldBeGreaterThanOrEqual("timing.domComplete", "timing.domContentLoadedEnd");
shouldBeGreaterThanOrEqual("timing.loadEventStart", "timing.responseEnd");
shouldBeGreaterThanOrEqual("timing.loadEventEnd", "timing.loadEventStart + 50");
......
......@@ -6,7 +6,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS timing.connectEnd is originalTiming.connectEnd
PASS timing.connectStart is originalTiming.connectStart
PASS timing.domComplete is originalTiming.domComplete
PASS timing.domContentLoaded is originalTiming.domContentLoaded
PASS timing.domContentLoadedEnd is originalTiming.domContentLoadedEnd
PASS timing.domContentLoadedStart is originalTiming.domContentLoadedStart
PASS timing.domInteractive is originalTiming.domInteractive
PASS timing.domLoading is originalTiming.domLoading
PASS timing.domainLookupEnd is originalTiming.domainLookupEnd
......
......@@ -18,7 +18,8 @@ PASS timing.requestEnd is >= timing.requestStart
PASS timing.responseStart is timing.requestEnd
PASS timing.domLoading is >= timing.fetchStart
PASS timing.domInteractive is 0
PASS timing.domContentLoaded is 0
PASS timing.domContentLoadedStart is 0
PASS timing.domContentLoadedEnd is 0
PASS timing.domComplete is 0
PASS timing.loadEventStart is 0
PASS timing.loadEventEnd is 0
......@@ -37,7 +38,28 @@ PASS timing.requestEnd is >= timing.requestStart
PASS timing.responseStart is timing.requestEnd
PASS timing.domLoading is >= timing.fetchStart
PASS timing.domInteractive is >= timing.domLoading
PASS timing.domContentLoaded is 0
PASS timing.domContentLoadedStart is 0
PASS timing.domContentLoadedEnd is 0
PASS timing.domComplete is 0
PASS timing.loadEventStart is 0
PASS timing.loadEventEnd is 0
PASS timing.navigationStart is >= oneHourAgoUTC
PASS timing.unloadEventEnd is >= timing.navigationStart
PASS timing.redirectStart is 0
PASS timing.redirectEnd is 0
PASS navigation.redirectCount is 0
PASS timing.fetchStart is >= timing.navigationStart
PASS timing.domainLookupStart is >= timing.fetchStart
PASS timing.domainLookupEnd is >= timing.domainLookupStart
PASS timing.connectStart is >= timing.domainLookupEnd
PASS timing.connectEnd is >= timing.connectStart
PASS timing.requestStart is >= timing.connectEnd
PASS timing.requestEnd is >= timing.requestStart
PASS timing.responseStart is timing.requestEnd
PASS timing.domLoading is >= timing.fetchStart
PASS timing.domInteractive is >= timing.domLoading
PASS timing.domContentLoadedStart is >= timing.domInteractive
PASS timing.domContentLoadedEnd is 0
PASS timing.domComplete is 0
PASS timing.loadEventStart is 0
PASS timing.loadEventEnd is 0
......@@ -56,7 +78,8 @@ PASS timing.requestEnd is >= timing.requestStart
PASS timing.responseStart is timing.requestEnd
PASS timing.domLoading is >= timing.fetchStart
PASS timing.domInteractive is >= timing.responseEnd
PASS timing.domContentLoaded is >= timing.domInteractive
PASS timing.domContentLoadedStart is >= timing.domInteractive
PASS timing.domContentLoadedEnd is >= timing.domContentLoadedStart
PASS timing.domComplete is 0
PASS timing.loadEventStart is 0
PASS timing.loadEventEnd is 0
......@@ -76,8 +99,9 @@ PASS timing.responseStart is timing.requestEnd
PASS timing.responseEnd is >= timing.responseStart
PASS timing.domLoading is >= timing.fetchStart
PASS timing.domInteractive is >= timing.responseEnd
PASS timing.domContentLoaded is >= timing.domInteractive
PASS timing.domComplete is >= timing.domContentLoaded
PASS timing.domContentLoadedStart is >= timing.domInteractive
PASS timing.domContentLoadedEnd is >= timing.domContentLoadedStart
PASS timing.domComplete is >= timing.domContentLoadedEnd
PASS timing.loadEventStart is >= timing.responseEnd
PASS timing.loadEventEnd is 0
PASS timing.navigationStart is >= oneHourAgoUTC
......@@ -96,8 +120,9 @@ PASS timing.responseStart is timing.requestEnd
PASS timing.responseEnd is >= timing.responseStart
PASS timing.domLoading is >= timing.fetchStart
PASS timing.domInteractive is >= timing.responseEnd
PASS timing.domContentLoaded is >= timing.domInteractive
PASS timing.domComplete is >= timing.domContentLoaded
PASS timing.domContentLoadedStart is >= timing.domInteractive
PASS timing.domContentLoadedEnd is >= timing.domContentLoadedStart
PASS timing.domComplete is >= timing.domContentLoadedEnd
PASS timing.loadEventStart is >= timing.responseEnd
PASS timing.loadEventEnd is >= timing.loadEventStart + 50
PASS successfullyParsed is true
......
2010-11-08 James Simonsen <simonjam@chromium.org>
Reviewed by Dimitri Glazkov.
[Web Timing] Split domContentLoaded into start/end
https://bugs.webkit.org/show_bug.cgi?id=48920
* dom/Document.cpp:
(WebCore::Document::finishedParsing):
* dom/DocumentTiming.h:
(WebCore::DocumentTiming::DocumentTiming):
* page/Timing.cpp:
(WebCore::Timing::domContentLoadedStart):
(WebCore::Timing::domContentLoadedEnd):
* page/Timing.h:
* page/Timing.idl:
2010-11-08 Nate Chapin <japhet@chromium.org>
Reviewed by Adam Barth.
......@@ -4191,9 +4191,11 @@ void Document::finishedParsing()
ASSERT(!scriptableDocumentParser() || !m_parser->isParsing());
ASSERT(!scriptableDocumentParser() || m_readyState != Loading);
setParsing(false);
if (!m_documentTiming.domContentLoaded)
m_documentTiming.domContentLoaded = currentTime();
if (!m_documentTiming.domContentLoadedStart)
m_documentTiming.domContentLoadedStart = currentTime();
dispatchEvent(Event::create(eventNames().DOMContentLoadedEvent, true, false));
if (!m_documentTiming.domContentLoadedEnd)
m_documentTiming.domContentLoadedEnd = currentTime();
if (Frame* f = frame()) {
// FrameLoader::finishedParsing() might end up calling Document::implicitClose() if all
......
......@@ -32,14 +32,16 @@ struct DocumentTiming {
DocumentTiming()
: domLoading(0.0)
, domInteractive(0.0)
, domContentLoaded(0.0)
, domContentLoadedStart(0.0)
, domContentLoadedEnd(0.0)
, domComplete(0.0)
{
}
double domLoading;
double domInteractive;
double domContentLoaded;
double domContentLoadedStart;
double domContentLoadedEnd;
double domComplete;
};
......
......@@ -265,13 +265,22 @@ unsigned long long Timing::domInteractive() const
return toIntegerMilliseconds(timing->domInteractive);
}
unsigned long long Timing::domContentLoaded() const
unsigned long long Timing::domContentLoadedStart() const
{
const DocumentTiming* timing = documentTiming();
if (!timing)
return 0;
return toIntegerMilliseconds(timing->domContentLoaded);
return toIntegerMilliseconds(timing->domContentLoadedStart);
}
unsigned long long Timing::domContentLoadedEnd() const
{
const DocumentTiming* timing = documentTiming();
if (!timing)
return 0;
return toIntegerMilliseconds(timing->domContentLoadedEnd);
}
unsigned long long Timing::domComplete() const
......
......@@ -66,7 +66,8 @@ public:
unsigned long long responseEnd() const;
unsigned long long domLoading() const;
unsigned long long domInteractive() const;
unsigned long long domContentLoaded() const;
unsigned long long domContentLoadedStart() const;
unsigned long long domContentLoadedEnd() const;
unsigned long long domComplete() const;
unsigned long long loadEventStart() const;
unsigned long long loadEventEnd() const;
......
......@@ -47,7 +47,8 @@ module window {
readonly attribute unsigned long long responseEnd;
readonly attribute unsigned long long domLoading;
readonly attribute unsigned long long domInteractive;
readonly attribute unsigned long long domContentLoaded;
readonly attribute unsigned long long domContentLoadedStart;
readonly attribute unsigned long long domContentLoadedEnd;
readonly attribute unsigned long long domComplete;
readonly attribute unsigned long long loadEventStart;
readonly attribute unsigned long long loadEventEnd;
......
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