зеркало из https://github.com/mozilla/gecko-dev.git
Add flush before we find our pres context, to fix media queries tests on ringmark. (Bug 753777) r=bzbarsky
This commit is contained in:
Родитель
88843c851b
Коммит
5f644a10e6
|
@ -3967,6 +3967,14 @@ nsGlobalWindow::MatchMedia(const nsAString& aMediaQueryList,
|
|||
|
||||
*aResult = nsnull;
|
||||
|
||||
// We need this now to ensure that we have a non-null |presContext|
|
||||
// when we ought to.
|
||||
// This is similar to EnsureSizeUpToDate, but only flushes frames.
|
||||
nsGlobalWindow *parent = static_cast<nsGlobalWindow*>(GetPrivateParent());
|
||||
if (parent) {
|
||||
parent->FlushPendingNotifications(Flush_Frames);
|
||||
}
|
||||
|
||||
if (!mDocShell)
|
||||
return NS_OK;
|
||||
|
||||
|
|
|
@ -280,6 +280,19 @@ function run() {
|
|||
mql.removeListener(null);
|
||||
})();
|
||||
|
||||
/* Bug 753777: test that things work in a freshly-created iframe */
|
||||
(function() {
|
||||
var iframe = document.createElement("iframe");
|
||||
document.body.appendChild(iframe);
|
||||
|
||||
is(iframe.contentWindow.matchMedia("(min-width: 1px)").matches, true,
|
||||
"(min-width: 1px) should match in newly-created iframe");
|
||||
is(iframe.contentWindow.matchMedia("(max-width: 1px)").matches, false,
|
||||
"(max-width: 1px) should not match in newly-created iframe");
|
||||
|
||||
document.body.removeChild(iframe);
|
||||
})();
|
||||
|
||||
/* Bug 716751: listeners lost due to GC */
|
||||
var gc_received = [];
|
||||
(function() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче