Skip to content

Commit

Permalink
Merge m-c to fx-team a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
KWierso committed Oct 25, 2014
2 parents fcfe9ab + 81ebe54 commit 6abc627
Show file tree
Hide file tree
Showing 211 changed files with 4,628 additions and 1,689 deletions.
2 changes: 1 addition & 1 deletion b2g/config/dolphin/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/emulator-ics/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/emulator-jb/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="be8b952fde51d8c83748b41ce232f02b2218451d"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/emulator-kk/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/emulator/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
Expand Down
8 changes: 4 additions & 4 deletions b2g/config/flame-kk/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
Expand Down Expand Up @@ -138,13 +138,13 @@
<project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="30b96dfca99cb384bf520a16b81f3aba56f09907"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="5b71e40213f650459e95d35b6f14af7e88d8ab62"/>
<project name="platform_external_libnfc-nci" path="external/libnfc-nci" remote="t2m" revision="4186bdecb4dae911b39a8202252cc2310d91b0be"/>
<project name="platform/frameworks/av" path="frameworks/av" revision="ea2f399b3ca0a23524d2828f85f69902caefc22e"/>
<project name="platform/frameworks/av" path="frameworks/av" revision="c00de33ebfad57ae79ad5f93c2819ee2c40c8bcd"/>
<project name="platform/frameworks/base" path="frameworks/base" revision="6b58ab45e3e56c1fc20708cc39fa2264c52558df"/>
<project name="platform/frameworks/native" path="frameworks/native" revision="a46a9f1ac0ed5662d614c277cbb14eb3f332f365"/>
<project name="platform/hardware/libhardware" path="hardware/libhardware" revision="7196881a0e9dd7bfbbcf0af64c8064e70f0fa094"/>
<project name="platform/hardware/qcom/audio" path="hardware/qcom/audio" revision="8d7676dfb68ee0cd069affedd5d1e97316a184ba"/>
<project name="platform/hardware/qcom/camera" path="hardware/qcom/camera" revision="2a1ded216a91bf62a72b1640cf01ab4998f37028"/>
<project name="platform/hardware/qcom/display" path="hardware/qcom/display" revision="e5a971282719907f73fb1da964ca40aad67a3be0"/>
<project name="platform/hardware/qcom/display" path="hardware/qcom/display" revision="f8bec8a61dc0f2581fa72a31d4144084b47ef7cf"/>
<project name="platform/hardware/qcom/gps" path="hardware/qcom/gps" revision="9883ea57b0668d8f60dba025d4522dfa69a1fbfa"/>
<project name="platform/hardware/qcom/media" path="hardware/qcom/media" revision="a558dc844bf5144fc38603fd8f4df8d9557052a5"/>
<project name="platform/hardware/qcom/wlan" path="hardware/qcom/wlan" revision="57ee1320ed7b4a1a1274d8f3f6c177cd6b9becb2"/>
Expand All @@ -154,5 +154,5 @@
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="a28a47cf4de9cc676e8a14d58826f7927d77f5d5"/>
<project name="platform/system/qcom" path="system/qcom" revision="63e3f6f176caad587d42bba4c16b66d953fb23c2"/>
<project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="d8952a42771045fca73ec600e2b42a4c7129d723"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="7704e16da545f4207812e593743d6743e1afb9c5"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="018b44e52b2bac5d3631d559550e88a4b68c6e67"/>
</manifest>
2 changes: 1 addition & 1 deletion b2g/config/flame/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="be8b952fde51d8c83748b41ce232f02b2218451d"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/gaia.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "0c0da681fe770f53931524f32098a3bbd62ddc39",
"revision": "bdc73f56907e3a1e80441e0a287029edaa93df3c",
"repo_path": "/integration/gaia-central"
}
2 changes: 1 addition & 1 deletion b2g/config/hamachi/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/helix/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/nexus-4/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="be8b952fde51d8c83748b41ce232f02b2218451d"/>
Expand Down
2 changes: 1 addition & 1 deletion b2g/config/wasabi/sources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="bd7a73c1f1d8211deb95543e9e14a5eeef36d5e1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="649d0ace7360a0740ef71fbffde91a52c8ea4c81"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
Expand Down
46 changes: 46 additions & 0 deletions content/base/crashtests/828903-iframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<html>
<script>
function start() {
try{o33=document.documentElement;}catch(e){}
try{o1.appendChild;}catch(e){}
try{tmp = document.createElement('iframe');}catch(e){}
try{tmp.id = 'id36'}catch(e){}
try{o33.ownerDocument.documentElement.appendChild(tmp);}catch(e){}
try{o51=o33.ownerDocument.getElementById('id36').contentDocument;}catch(e){}
try{o579=document.documentElement;}catch(e){}
try{tmp.id = 'id421'}catch(e){}
try{o619=document.getElementById('id421').contentDocument;}catch(e){}
try{o622=window.document.getElementById('id421').contentWindow.document;}catch(e){}
try{o875.setAttributeNS(null,'letter-spacing','normal');}catch(e){}
try{o884=document.createElementNS('http://www.w3.org/2000/svg','set');;}catch(e){}
try{o887=document.createElementNS('http://www.w3.org/2000/svg','desc');;}catch(e){}
try{o884.appendChild(o887);}catch(e){}
try{o887=document.documentElement;}catch(e){}
try{o1041=o622.createElement('bdi');;}catch(e){}
window.setTimeout('start2()',100);
}
function start2() {
try{o1042=document.createElement('input');;}catch(e){}
try{o1043=o51.createElement('input');;}catch(e){}
try{o884.appendChild(o1043);}catch(e){}
try{o1053=o1043.previousElementSibling;}catch(e){}
try{o1067=o619.createElement('blockquote');;}catch(e){}
try{o1062.appendChild(o1067);}catch(e){}
try{o1074=o619.createElement('ruby');;}catch(e){}
try{o1067.appendChild(o1074);}catch(e){}
try{document.body.appendChild(o1041);}catch(e){}
try{o1041.appendChild(o1042);}catch(e){}
try{o1095=o51.createTextNode(unescape('%uff0f%u017f%u0390%ufffa%u2073%uff4d%uDF53%u0261'));;}catch(e){}
try{o1053.appendChild(o1095);}catch(e){}
try{o1041.appendChild(o1043.parentNode);}catch(e){}
try{o1042.appendChild(o1067);}catch(e){}
try{o1053=null;}catch(e){}
try{o1095=null;}catch(e){}
try{for(var xrn in o884.childNodes) o884.removeChild(o884.childNodes[xrn]);}catch(e){}
//fuzzer.gc();
location.reload();
}
</script>
<body onload="start()">
</body>
</html>
28 changes: 28 additions & 0 deletions content/base/crashtests/828903.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE HTML>
<html class="reftest-wait"><head>
<meta charset="utf-8">
<title>Testcase for bug 828903</title>
<script>
function reload() {
this.location.reload();
}
// Run the test for 2 seconds
setTimeout(function() {
document.documentElement.removeChild(document.body);
document.documentElement.className = "";
}, 2000);
</script>
</head>
<body onload="document.body.getBoundingClientRect()">

<iframe onload="this.contentWindow.setTimeout(reload,1113)" src="828903-iframe.html"></iframe>
<iframe onload="this.contentWindow.setTimeout(reload,1233)" src="828903-iframe.html"></iframe>
<iframe onload="this.contentWindow.setTimeout(reload,1313)" src="828903-iframe.html"></iframe>
<iframe onload="this.contentWindow.setTimeout(reload,1433)" src="828903-iframe.html"></iframe>
<iframe onload="this.contentWindow.setTimeout(reload,1113)" src="828903-iframe.html"></iframe>
<iframe onload="this.contentWindow.setTimeout(reload,1233)" src="828903-iframe.html"></iframe>
<iframe onload="this.contentWindow.setTimeout(reload,1313)" src="828903-iframe.html"></iframe>
<iframe onload="this.contentWindow.setTimeout(reload,1433)" src="828903-iframe.html"></iframe>

</body>
</html>
1 change: 1 addition & 0 deletions content/base/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ load 822723.html
load 824719.html
load 827190.html
load 828054.html
load 828903.html
load 829428.html
load 830098.html
load 831287.html
Expand Down
1 change: 1 addition & 0 deletions content/base/public/nsContentPolicyUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ NS_CP_ContentTypeName(uint32_t contentType)
CASE_RETURN( TYPE_XSLT );
CASE_RETURN( TYPE_BEACON );
CASE_RETURN( TYPE_FETCH );
CASE_RETURN( TYPE_IMAGESET );
default:
return "<Unknown Type>";
}
Expand Down
18 changes: 13 additions & 5 deletions content/base/public/nsContentUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "mozilla/dom/AutocompleteInfoBinding.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/FloatingPoint.h"
#include "nsIContentPolicy.h"

#if defined(XP_WIN)
// Undefine LoadImage to prevent naming conflict with Windows.
Expand Down Expand Up @@ -591,6 +592,8 @@ class nsContentUtils
* @param aContext the context the image is loaded in (eg an element)
* @param aLoadingDocument the document we belong to
* @param aLoadingPrincipal the principal doing the load
* @param [aContentPolicyType=nsIContentPolicy::TYPE_IMAGE] (Optional)
* The CP content type to use
* @param aImageBlockingStatus the nsIContentPolicy blocking status for this
* image. This will be set even if a security check fails for the
* image, to some reasonable REJECT_* value. This out param will only
Expand All @@ -601,10 +604,12 @@ class nsContentUtils
* false is returned.
*/
static bool CanLoadImage(nsIURI* aURI,
nsISupports* aContext,
nsIDocument* aLoadingDocument,
nsIPrincipal* aLoadingPrincipal,
int16_t* aImageBlockingStatus = nullptr);
nsISupports* aContext,
nsIDocument* aLoadingDocument,
nsIPrincipal* aLoadingPrincipal,
int16_t* aImageBlockingStatus = nullptr,
uint32_t aContentPolicyType = nsIContentPolicy::TYPE_IMAGE);

/**
* Method to start an image load. This does not do any security checks.
* This method will attempt to make aURI immutable; a caller that wants to
Expand All @@ -616,6 +621,8 @@ class nsContentUtils
* @param aReferrer the referrer URI
* @param aObserver the observer for the image load
* @param aLoadFlags the load flags to use. See nsIRequest
* @param [aContentPolicyType=nsIContentPolicy::TYPE_IMAGE] (Optional)
* The CP content type to use
* @return the imgIRequest for the image load
*/
static nsresult LoadImage(nsIURI* aURI,
Expand All @@ -625,7 +632,8 @@ class nsContentUtils
imgINotificationObserver* aObserver,
int32_t aLoadFlags,
const nsAString& initiatorType,
imgRequestProxy** aRequest);
imgRequestProxy** aRequest,
uint32_t aContentPolicyType = nsIContentPolicy::TYPE_IMAGE);

/**
* Obtain an image loader that respects the given document/channel's privacy status.
Expand Down
12 changes: 11 additions & 1 deletion content/base/public/nsIContentPolicy.idl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ typedef unsigned long nsContentPolicyType;
* by launching a dialog to prompt the user for something).
*/

[scriptable,uuid(8afe3e5c-f916-48fd-8075-9579d3502e1d)]
[scriptable,uuid(94513f07-d559-480e-8879-6249852365ea)]
interface nsIContentPolicy : nsISupports
{
/**
* Indicates a unset or bogus policy type.
*/
const nsContentPolicyType TYPE_INVALID = 0;

/**
* Gecko/Firefox developers: Do not use TYPE_OTHER under any circumstances.
*
Expand Down Expand Up @@ -156,6 +161,11 @@ interface nsIContentPolicy : nsISupports
*/
const nsContentPolicyType TYPE_FETCH = 20;

/**
* Indicates a <img srcset> or <picture> request.
*/
const nsContentPolicyType TYPE_IMAGESET = 21;

/* When adding new content types, please update nsContentBlocker,
* NS_CP_ContentTypeName, nsCSPContext, all nsIContentPolicy
* implementations, and other things that are not listed here that are
Expand Down
18 changes: 15 additions & 3 deletions content/base/public/nsIDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -1736,14 +1736,26 @@ class nsIDocument : public nsINode
bool IsVisibleConsideringAncestors() const;

/**
* Return true when this document is active, i.e., the active document
* Return true when this document is active, i.e., an active document
* in a content viewer. Note that this will return true for bfcached
* documents, so this does NOT match the "active document" concept in
* the WHATWG spec. That would correspond to GetInnerWindow() &&
* GetInnerWindow()->IsCurrentInnerWindow().
* the WHATWG spec - see IsCurrentActiveDocument.
*/
bool IsActive() const { return mDocumentContainer && !mRemovedFromDocShell; }

/**
* Return true if this is the current active document for its
* docshell. Note that a docshell may have multiple active documents
* due to the bfcache -- this should be used when you need to
* differentiate the *current* active document from any active
* documents.
*/
bool IsCurrentActiveDocument() const
{
nsPIDOMWindow *inner = GetInnerWindow();
return inner && inner->IsCurrentInnerWindow() && inner->GetDoc() == this;
}

/**
* Register/Unregister the ActivityObserver into mActivityObservers to listen
* the document's activity changes such as OnPageHide, visibility, activity.
Expand Down
Loading

0 comments on commit 6abc627

Please sign in to comment.