mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 694612. Hook up the performance timing APIs even inside an <object>. r=bzbarsky
This commit is contained in:
parent
e851f37192
commit
d1283e88fa
@ -665,6 +665,11 @@ DispatchPings(nsIContent *content, nsIURI *referrer)
|
||||
static nsDOMPerformanceNavigationType
|
||||
ConvertLoadTypeToNavigationType(PRUint32 aLoadType)
|
||||
{
|
||||
// Not initialized, assume it's normal load.
|
||||
if (aLoadType == 0) {
|
||||
aLoadType = LOAD_NORMAL;
|
||||
}
|
||||
|
||||
nsDOMPerformanceNavigationType result = nsIDOMPerformanceNavigation::TYPE_RESERVED;
|
||||
switch (aLoadType) {
|
||||
case LOAD_NORMAL:
|
||||
@ -5874,12 +5879,7 @@ nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest,
|
||||
channel->GetURI(getter_AddRefs(uri));
|
||||
nsCAutoString aURI;
|
||||
uri->GetAsciiSpec(aURI);
|
||||
// If load type is not set, this is not a 'normal' load.
|
||||
// No need to collect timing.
|
||||
if (mLoadType == 0) {
|
||||
mTiming = nsnull;
|
||||
}
|
||||
else if (this == aProgress){
|
||||
if (this == aProgress){
|
||||
rv = MaybeInitTiming();
|
||||
if (mTiming) {
|
||||
mTiming->NotifyFetchStart(uri, ConvertLoadTypeToNavigationType(mLoadType));
|
||||
|
@ -124,6 +124,7 @@ _TEST_FILES = \
|
||||
file_bug680257.html \
|
||||
test_bug691547.html \
|
||||
bug691547_frame.html \
|
||||
test_bug694612.html \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
||||
|
27
docshell/test/test_bug694612.html
Normal file
27
docshell/test/test_bug694612.html
Normal file
@ -0,0 +1,27 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=694612
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 694612</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=694612">Mozilla Bug 694612</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
/** Test for Bug 694612 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
||||
<object type="text/html"
|
||||
data="data:text/html,<script>parent.isnot(performance, null, 'should have performance API in an <object>'); parent.SimpleTest.finish();</script>">
|
||||
</object>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user