mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Backout b0359c684793 (Bug 926452) for causing bug 1213051 r=me
This commit is contained in:
parent
1b8ef32cef
commit
fef6066276
@ -1935,7 +1935,12 @@ BrowserElementChild.prototype = {
|
||||
}
|
||||
|
||||
if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
|
||||
sendAsyncMsg('loadend');
|
||||
let bgColor = 'transparent';
|
||||
try {
|
||||
bgColor = content.getComputedStyle(content.document.body)
|
||||
.getPropertyValue('background-color');
|
||||
} catch (e) {}
|
||||
sendAsyncMsg('loadend', {backgroundColor: bgColor});
|
||||
|
||||
switch (status) {
|
||||
case Cr.NS_OK :
|
||||
|
@ -22,7 +22,7 @@ function runTest() {
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('mozbrowser', 'true');
|
||||
iframe.id = 'iframe';
|
||||
iframe.src = browserElementTestHelpers.emptyPage1;
|
||||
iframe.src = 'http://example.com/tests/dom/browser-element/mochitest/file_browserElement_LoadEvents.html';
|
||||
|
||||
function loadstart(e) {
|
||||
ok(e.isTrusted, 'Event should be trusted.');
|
||||
@ -46,6 +46,7 @@ function runTest() {
|
||||
ok(seenLoadStart, 'loadend after loadstart.');
|
||||
ok(!seenLoadEnd, 'Just one loadend event.');
|
||||
ok(seenLocationChange, 'loadend after locationchange.');
|
||||
is(e.detail.backgroundColor, 'rgb(0, 128, 0)', 'Expected background color reported')
|
||||
seenLoadEnd = true;
|
||||
}
|
||||
|
||||
@ -99,6 +100,7 @@ function runTest2() {
|
||||
seenLoadEnd = true;
|
||||
ok(seenLoadStart, 'Load end after load start.');
|
||||
ok(seenLocationChange, 'Load end after location change.');
|
||||
is(e.detail.backgroundColor, 'transparent', 'Expected background color reported')
|
||||
});
|
||||
|
||||
iframe.src = browserElementTestHelpers.emptyPage2;
|
||||
|
@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<body style="background-color:green;">
|
||||
|
||||
<!-- Tests rely on the fact that there's an element in here called 'url' and
|
||||
that there's visible text on the page. -->
|
||||
|
||||
Aloha! My URL is <span id='url'></span>.
|
||||
|
||||
<script>
|
||||
document.getElementById('url').innerHTML = window.location;
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -96,6 +96,7 @@ support-files =
|
||||
file_browserElement_ExecuteScript.html
|
||||
file_browserElement_ForwardName.html
|
||||
file_browserElement_FrameWrongURI.html
|
||||
file_browserElement_LoadEvents.html
|
||||
file_browserElement_Metachange.sjs
|
||||
file_browserElement_NextPaint.html
|
||||
file_browserElement_Open1.html
|
||||
|
Loading…
Reference in New Issue
Block a user