mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge mozilla-central into services-central
This commit is contained in:
commit
1f258052f2
@ -11,7 +11,7 @@
|
||||
],
|
||||
"zip_files": [
|
||||
["{workdir}/out/target/product/otoro/*.img", "out/target/product/otoro/"],
|
||||
"{workdir}/boot.img",
|
||||
["{workdir}/boot.img", "out/target/product/otoro/"],
|
||||
"{workdir}/flash.sh",
|
||||
"{workdir}/load-config.sh",
|
||||
"{workdir}/.config",
|
||||
|
@ -12,7 +12,7 @@
|
||||
],
|
||||
"zip_files": [
|
||||
["{workdir}/out/target/product/unagi/*.img", "out/target/product/unagi/"],
|
||||
"{workdir}/boot.img",
|
||||
["{workdir}/boot.img", "out/target/product/unagi/"],
|
||||
"{workdir}/flash.sh",
|
||||
"{workdir}/load-config.sh",
|
||||
"{workdir}/.config",
|
||||
|
@ -31,11 +31,8 @@ DEFINES += \
|
||||
-DNEWWINDOW_ICO=\"$(DIST)/branding/newwindow.ico\" \
|
||||
-DNEWTAB_ICO=\"$(DIST)/branding/newtab.ico\" \
|
||||
-DPBMODE_ICO=\"$(DIST)/branding/pbmode.ico\" \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZILLA_OFFICIAL
|
||||
DEFINES += -DMOZILLA_OFFICIAL
|
||||
endif
|
||||
$(NULL)
|
||||
|
||||
ifdef LIBXUL_SDK #{
|
||||
PREF_JS_EXPORTS += $(srcdir)/profile/channel-prefs.js
|
||||
|
@ -734,12 +734,6 @@ pref("browser.safebrowsing.reportMalwareErrorURL", "http://%LOCALE%.malware-erro
|
||||
pref("browser.safebrowsing.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/phishing-protection/");
|
||||
pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
|
||||
|
||||
#ifdef MOZILLA_OFFICIAL
|
||||
// Normally the "client ID" sent in updates is appinfo.name, but for
|
||||
// official Firefox releases from Mozilla we use a special identifier.
|
||||
pref("browser.safebrowsing.id", "navclient-auto-ffox");
|
||||
#endif
|
||||
|
||||
// Name of the about: page contributed by safebrowsing to handle display of error
|
||||
// pages on phishing/malware hits. (bug 399233)
|
||||
pref("urlclassifier.alternate_error_page", "blocked");
|
||||
|
@ -14,7 +14,7 @@ function test()
|
||||
];
|
||||
|
||||
function setLocation(i, url) {
|
||||
gBrowser.getBrowserForTab(tabs[i]).contentWindow.location.assign(url);
|
||||
gBrowser.getBrowserForTab(tabs[i]).contentWindow.location = url;
|
||||
}
|
||||
function moveTabTo(a, b) {
|
||||
gBrowser.swapBrowsersAndCloseOther(gBrowser.tabs[b], gBrowser.tabs[a]);
|
||||
|
@ -166,13 +166,13 @@ function test() {
|
||||
// navigating back maintains the focus in the urlbar.
|
||||
browser1.addEventListener("pageshow", _browser_tabfocus_navigation_test_eventOccured, true);
|
||||
button1.focus();
|
||||
browser1.contentWindow.location.assign(testPage3);
|
||||
browser1.contentWindow.location = testPage3;
|
||||
}
|
||||
|
||||
browser1.addEventListener("load", check, true);
|
||||
browser2.addEventListener("load", check, true);
|
||||
browser1.contentWindow.location.assign(testPage1);
|
||||
browser2.contentWindow.location.assign(testPage2);
|
||||
browser1.contentWindow.location = testPage1;
|
||||
browser2.contentWindow.location = testPage2;
|
||||
}
|
||||
|
||||
var _browser_tabfocus_test_lastfocus;
|
||||
|
@ -3056,9 +3056,7 @@ let SessionStoreInternal = {
|
||||
if (!tabData.entries || tabData.entries.length == 0) {
|
||||
// make sure to blank out this tab's content
|
||||
// (just purging the tab's history won't be enough)
|
||||
browser.loadURIWithFlags("about:blank",
|
||||
Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY,
|
||||
null, null, null);
|
||||
browser.contentDocument.location = "about:blank";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2658,3 +2658,13 @@ chatbox[minimized="true"] {
|
||||
.center-item-button {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
%ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
#main-window[privatebrowsingmode=temporary] #TabsToolbar::before {
|
||||
display: -moz-box;
|
||||
content: "";
|
||||
background: url("chrome://browser/skin/privatebrowsing-mask.png") center no-repeat;
|
||||
width: 40px;
|
||||
}
|
||||
%endif
|
||||
|
||||
|
@ -36,6 +36,7 @@ browser.jar:
|
||||
skin/classic/browser/page-livemarks.png
|
||||
skin/classic/browser/Privacy-16.png
|
||||
skin/classic/browser/Privacy-48.png
|
||||
skin/classic/browser/privatebrowsing-mask.png
|
||||
skin/classic/browser/searchbar.css
|
||||
skin/classic/browser/Secure.png
|
||||
skin/classic/browser/Security-broken.png
|
||||
|
BIN
browser/themes/gnomestripe/privatebrowsing-mask.png
Normal file
BIN
browser/themes/gnomestripe/privatebrowsing-mask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -24,7 +24,8 @@
|
||||
}
|
||||
|
||||
#PersonalToolbar:-moz-lwtheme,
|
||||
#nav-bar:-moz-lwtheme {
|
||||
#nav-bar:-moz-lwtheme,
|
||||
#main-window[privatebrowsingmode=temporary] #nav-bar[tabsontop=false] {
|
||||
-moz-appearance: none !important;
|
||||
background: none !important;
|
||||
/* Switching to a lightweight theme shouldn't move the content area,
|
||||
|
@ -15,12 +15,9 @@ MOZ_ARG_WITH_STRING(android-toolchain,
|
||||
location of the android toolchain],
|
||||
android_toolchain=$withval)
|
||||
|
||||
dnl default gnu compiler version is 4.4.3
|
||||
android_gnu_compiler_version=4.4.3
|
||||
|
||||
MOZ_ARG_WITH_STRING(android-gnu-compiler-version,
|
||||
[ --with-android-gnu-compiler-version=VER
|
||||
gnu compiler version to use, default 4.4.3],
|
||||
gnu compiler version to use],
|
||||
android_gnu_compiler_version=$withval)
|
||||
|
||||
MOZ_ARG_ENABLE_BOOL(android-libstdcxx,
|
||||
@ -75,23 +72,32 @@ case "$target" in
|
||||
|
||||
kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
|
||||
|
||||
case "$target_cpu" in
|
||||
arm)
|
||||
target_name=arm-linux-androideabi-$android_gnu_compiler_version
|
||||
;;
|
||||
i?86)
|
||||
target_name=x86-$android_gnu_compiler_version
|
||||
;;
|
||||
mipsel)
|
||||
target_name=mipsel-linux-android-$android_gnu_compiler_version
|
||||
;;
|
||||
esac
|
||||
android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
|
||||
for version in $android_gnu_compiler_version 4.6 4.4.3 ; do
|
||||
case "$target_cpu" in
|
||||
arm)
|
||||
target_name=arm-linux-androideabi-$version
|
||||
;;
|
||||
i?86)
|
||||
target_name=x86-$version
|
||||
;;
|
||||
mipsel)
|
||||
target_name=mipsel-linux-android-$version
|
||||
;;
|
||||
esac
|
||||
android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
|
||||
|
||||
if test -d "$android_toolchain" ; then
|
||||
AC_MSG_RESULT([$android_toolchain])
|
||||
else
|
||||
if test -d "$android_toolchain" ; then
|
||||
android_gnu_compiler_version=$version
|
||||
break
|
||||
elif test -n "$android_gnu_compiler_version" ; then
|
||||
AC_MSG_ERROR([not found. Your --with-android-gnu-compiler-version may be wrong.])
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$android_gnu_compiler_version" ; then
|
||||
AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
|
||||
else
|
||||
AC_MSG_RESULT([$android_toolchain])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -4568,6 +4568,7 @@ cairo-qt)
|
||||
TK_LIBS='$(MOZ_QT_LIBS)'
|
||||
AC_DEFINE(MOZ_WIDGET_QT)
|
||||
MOZ_PDF_PRINTING=1
|
||||
AC_DEFINE(QT_NO_KEYWORDS)
|
||||
;;
|
||||
|
||||
cairo-os2)
|
||||
|
@ -843,6 +843,9 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
bool oldProcessingScriptTag = context->GetProcessingScriptTag();
|
||||
context->SetProcessingScriptTag(true);
|
||||
|
||||
// Update our current script.
|
||||
nsCOMPtr<nsIScriptElement> oldCurrent = mCurrentScript;
|
||||
mCurrentScript = aRequest->mElement;
|
||||
@ -863,6 +866,10 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
|
||||
// Put the old script back in case it wants to do anything else.
|
||||
mCurrentScript = oldCurrent;
|
||||
|
||||
JSContext *cx = nullptr; // Initialize this to keep GCC happy.
|
||||
cx = context->GetNativeContext();
|
||||
JSAutoRequest ar(cx);
|
||||
context->SetProcessingScriptTag(oldProcessingScriptTag);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1414,6 +1414,16 @@ nsDocShell::LoadURI(nsIURI * aURI,
|
||||
}
|
||||
} // parent
|
||||
} //parentDS
|
||||
else {
|
||||
// This is the root docshell. If we got here while
|
||||
// executing an onLoad Handler,this load will not go
|
||||
// into session history.
|
||||
bool inOnLoadHandler=false;
|
||||
GetIsExecutingOnLoadHandler(&inOnLoadHandler);
|
||||
if (inOnLoadHandler) {
|
||||
loadType = LOAD_NORMAL_REPLACE;
|
||||
}
|
||||
}
|
||||
} // !shEntry
|
||||
|
||||
if (shEntry) {
|
||||
@ -6519,7 +6529,7 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
|
||||
nsCOMPtr<nsIDocShell> kungFuDeathGrip(this);
|
||||
|
||||
// Notify the ContentViewer that the Document has finished loading. This
|
||||
// will cause any OnLoad(...) handlers to fire.
|
||||
// will cause any OnLoad(...) and PopState(...) handlers to fire.
|
||||
if (!mEODForCurrentDocument && mContentViewer) {
|
||||
mIsExecutingOnLoadHandler = true;
|
||||
mContentViewer->LoadComplete(aStatus);
|
||||
@ -10492,13 +10502,11 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, nsIChannel * aChannel,
|
||||
NS_ASSERTION(entry == newEntry, "The new session history should be in the new entry");
|
||||
}
|
||||
|
||||
int32_t index = 0;
|
||||
mSessionHistory->GetIndex(&index);
|
||||
|
||||
// This is the root docshell
|
||||
if (-1 != index &&
|
||||
LOAD_TYPE_HAS_FLAGS(mLoadType, LOAD_FLAGS_REPLACE_HISTORY)) {
|
||||
if (LOAD_TYPE_HAS_FLAGS(mLoadType, LOAD_FLAGS_REPLACE_HISTORY)) {
|
||||
// Replace current entry in session history.
|
||||
int32_t index = 0;
|
||||
mSessionHistory->GetIndex(&index);
|
||||
nsCOMPtr<nsISHistoryInternal> shPrivate(do_QueryInterface(mSessionHistory));
|
||||
// Replace the current entry with the new entry
|
||||
if (shPrivate)
|
||||
@ -10509,7 +10517,7 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, nsIChannel * aChannel,
|
||||
nsCOMPtr<nsISHistoryInternal>
|
||||
shPrivate(do_QueryInterface(mSessionHistory));
|
||||
NS_ENSURE_TRUE(shPrivate, NS_ERROR_FAILURE);
|
||||
mPreviousTransIndex = index;
|
||||
mSessionHistory->GetIndex(&mPreviousTransIndex);
|
||||
rv = shPrivate->AddEntry(entry, shouldPersist);
|
||||
mSessionHistory->GetIndex(&mLoadedTransIndex);
|
||||
#ifdef DEBUG_PAGE_CACHE
|
||||
|
@ -32,7 +32,6 @@ MOCHITEST_BROWSER_FILES = \
|
||||
browser_bug670318.js \
|
||||
file_bug670318.html \
|
||||
browser_bug673467.js \
|
||||
browser_bug808035.js \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
@ -1,33 +0,0 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test for bug 808035.
|
||||
// When we open a new tab, the initial URI is the transient <about:blank> and
|
||||
// then requested URI would be loaded. When the URI's shceme is "javascript:",
|
||||
// we can *replace* the transient <about:blank> with an actual requet
|
||||
// through <javascript:location.replace("http://example.org/")>.
|
||||
//
|
||||
// There's no session history entry corresponding to the transient
|
||||
// <about:blank>. But we should make sure there exists a session history entry
|
||||
// for <http://example.org>.
|
||||
|
||||
function test() {
|
||||
const NEW_URI = "http://test1.example.org/";
|
||||
const REQUESTED_URI = "javascript:void(location.replace('" + NEW_URI +
|
||||
"'))";
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
let tab = gBrowser.addTab(REQUESTED_URI);
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
browser.addEventListener('load', function(aEvent) {
|
||||
browser.removeEventListener('load', arguments.callee, true);
|
||||
|
||||
is(browser.contentWindow.location.href, NEW_URI, "The URI is OK.");
|
||||
is(browser.contentWindow.history.length, 1, "There exists a SH entry.");
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
finish();
|
||||
}, true);
|
||||
}
|
@ -94,8 +94,6 @@ MOCHITEST_CHROME_FILES = \
|
||||
test_mozFrameType.xul \
|
||||
mozFrameType_window.xul \
|
||||
test_bug789773.xul \
|
||||
test_bug754029.xul \
|
||||
bug754029_window.xul \
|
||||
docshell_helpers.js \
|
||||
generic.html \
|
||||
$(NULL)
|
||||
|
@ -109,7 +109,7 @@ function step1B(aWebProgress, aRequest, aLocation, aFlags) {
|
||||
|
||||
function step2A() {
|
||||
gListener.callback = step2B;
|
||||
content.location.assign(kSecureURI);
|
||||
content.location = kSecureURI;
|
||||
}
|
||||
|
||||
function step2B(aWebProgress, aRequest, aLocation, aFlags) {
|
||||
@ -139,7 +139,7 @@ function step2B(aWebProgress, aRequest, aLocation, aFlags) {
|
||||
|
||||
function step3A() {
|
||||
gListener.callback = step3B;
|
||||
content.location.assign("#foo");
|
||||
content.location += "#foo";
|
||||
}
|
||||
|
||||
function step3B(aWebProgress, aRequest, aLocation, aFlags) {
|
||||
|
@ -1,307 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
|
||||
<window id="754029Test"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
width="600"
|
||||
height="600"
|
||||
onload="startup();"
|
||||
title="bug 754029 test">
|
||||
|
||||
<script type="application/javascript" src="docshell_helpers.js"></script>
|
||||
<script type="application/javascript"><![CDATA[
|
||||
|
||||
const _kDocshellTestNavURI =
|
||||
"http://test1.example.org:80/tests/docshell/test/navigation/";
|
||||
|
||||
const kBlankURI = _kDocshellTestNavURI + "blank.html";
|
||||
const kRedirectURI = _kDocshellTestNavURI + "file_bug754029.html";
|
||||
|
||||
function startup() {
|
||||
var browser = document.getElementById("content");
|
||||
browser.addEventListener("load", contentOnLoad, true);
|
||||
content.location.href = kBlankURI + "?start";
|
||||
}
|
||||
|
||||
function contentOnLoad(aEvent) {
|
||||
is(aEvent.originalTarget.nodeName, "#document", "Loading a document.");
|
||||
var browser = document.getElementById("content");
|
||||
var sessionHistory = browser.sessionHistory;
|
||||
|
||||
var _contentLoadURI = function (aHref) {content.location.href = aHref;}
|
||||
|
||||
function contentLoadURI(aHref) {
|
||||
setTimeout(_contentLoadURI, 0, aHref);
|
||||
}
|
||||
|
||||
function indexToSearch(aSessionHistory, aIndex) {
|
||||
return "?" + aSessionHistory.getEntryAtIndex(aIndex, false)
|
||||
.URI
|
||||
.QueryInterface(Components.interfaces.nsIURL)
|
||||
.query;
|
||||
}
|
||||
|
||||
switch(content.location.search) {
|
||||
case "?start":
|
||||
// Expected SH entries are:
|
||||
// 1 * <blank.html ?start>
|
||||
is(content.history.length, 1, "Initial <about:blank> is replaced.");
|
||||
|
||||
// Requesting <file_bug754029.html?test1>
|
||||
contentLoadURI(kRedirectURI + "?test1");
|
||||
break;
|
||||
|
||||
/*****************************************************************************
|
||||
* Test 1: Load a JS redirecting page; |location.href = ...| is directly in
|
||||
* <script></script> tag.
|
||||
*
|
||||
* Expected Result: The redirected page should replace the redirecting page's
|
||||
* session history.
|
||||
****************************************************************************/
|
||||
case "?test1":
|
||||
// We can't catch this onload, because redirection is earlier than
|
||||
// firing load event. That is OK.
|
||||
|
||||
// Expected SH entries are:
|
||||
// 0 <?start>
|
||||
// 1 * <?test1>
|
||||
break;
|
||||
|
||||
case "?result1":
|
||||
// Expected SH entries are:
|
||||
// 0 <?start>
|
||||
// x <?test1> // replaced.
|
||||
// 1 * <?result1>
|
||||
|
||||
is(sessionHistory.count, 2, "<?result1>: SH's length");
|
||||
is(sessionHistory.index, 1, "<?result1>: Current entry's index");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?result1",
|
||||
"Check if the current SH entry is <?result1>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?start",
|
||||
"Check if the previous SH entry is not <?test1> but <?start>");
|
||||
|
||||
// Requesting <file_bug754029.html?test2>
|
||||
contentLoadURI(kRedirectURI + "?test2");
|
||||
break;
|
||||
|
||||
/*****************************************************************************
|
||||
* Test 2: Load a JS redirecting page; |location.href = ...| is in
|
||||
* "load" event handler.
|
||||
*
|
||||
* Expected Result: Replace
|
||||
****************************************************************************/
|
||||
case "?test2":
|
||||
// Expected SH entries are:
|
||||
// 0 <?start>
|
||||
// x <?test1> // replaced.
|
||||
// 1 <?result1>
|
||||
// 2 * <?test2>
|
||||
|
||||
is(sessionHistory.count, 3, "<?test2>: SH's length");
|
||||
is(sessionHistory.index, 2, "<?test2>: Current entry's index");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?test2",
|
||||
"Check if the current SH entry is <?test2>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?result1",
|
||||
"Check if the previous SH entry is <?result1>");
|
||||
break;
|
||||
|
||||
case "?result2":
|
||||
// Expected SH entries are:
|
||||
// 0 <?start>
|
||||
// x <?test1> // replaced.
|
||||
// 1 <?result1>
|
||||
// x <?test2> // replaced.
|
||||
// 2 * <?result2>
|
||||
|
||||
is(sessionHistory.count, 3, "<?result2>: SH's length");
|
||||
is(sessionHistory.index, 2, "<?result2>: Current entry's index");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?result2",
|
||||
"Check if the current SH entry is <?result2>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?result1",
|
||||
"Check if the previous SH entry is not <?test2> but <?resutl1>");
|
||||
|
||||
contentLoadURI(kRedirectURI + "?test3");
|
||||
break;
|
||||
|
||||
/*****************************************************************************
|
||||
* Test 3: Load a JS redirecting page; |location.href = ...| is in
|
||||
* setTimeout(...)'s call back.
|
||||
*
|
||||
* Expected Result: Not replace
|
||||
****************************************************************************/
|
||||
case "?test3":
|
||||
// Expected SH entries are:
|
||||
// 0 <?start>
|
||||
// x <?test1> // replaced.
|
||||
// 1 <?result1>
|
||||
// x <?test2> // replaced.
|
||||
// 2 <?result2>
|
||||
// 3 * <?test3>
|
||||
|
||||
is(sessionHistory.count, 4, "<?test3>: SH's length");
|
||||
is(sessionHistory.index, 3, "<?test3>: Current entry's index");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?test3",
|
||||
"Check if the current SH entry is <?test3>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?result2",
|
||||
"Check if the previous SH entry is <?result2>");
|
||||
break;
|
||||
|
||||
case "?result3":
|
||||
// Expected SH entries are:
|
||||
// 0 <?start>
|
||||
// x <?test1> // replaced.
|
||||
// 1 <?result1>
|
||||
// x <?test2> // replaced.
|
||||
// 2 <?result2>
|
||||
// 3 <?test3> // not replaced.
|
||||
// 4 * <?result3>
|
||||
|
||||
is(sessionHistory.count, 5, "<?result3>: SH's length");
|
||||
is(sessionHistory.index, 4, "<?result3>: Current entry's index");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?result3",
|
||||
"Check if the current SH entry is <?result3>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?test3",
|
||||
"Check if <?test3> exists.");
|
||||
|
||||
contentLoadURI(kRedirectURI + "?test4");
|
||||
break;
|
||||
|
||||
/*****************************************************************************
|
||||
* Test 4: Load a JS redirecting page; setTimeout(...)'s callback
|
||||
* is inserting a new script element into the document. And the
|
||||
* inserted script contains |location.href = ...|.
|
||||
*
|
||||
* See also:
|
||||
* https://bugzilla.mozilla.org/attachment.cgi?id=622899
|
||||
*
|
||||
* Expected Result: Not replace
|
||||
****************************************************************************/
|
||||
case "?test4":
|
||||
// Expected SH entries are:
|
||||
// 0 <?start>
|
||||
// x <?test1> // replaced.
|
||||
// 1 <?result1>
|
||||
// x <?test2> // replaced.
|
||||
// 2 <?result2>
|
||||
// 3 <?test3> // not replaced
|
||||
// 4 <?result3>
|
||||
// 5 * <?test4>
|
||||
|
||||
is(sessionHistory.count, 6, "<?test4>: SH's length");
|
||||
is(sessionHistory.index, 5, "<?test4>: Current entry's index");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?test4",
|
||||
"Check if the current SH entry is <?test4>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?result3",
|
||||
"Check if the previous SH entry is <?result3>");
|
||||
|
||||
break;
|
||||
|
||||
case "?result4":
|
||||
// Expected SH entries are:
|
||||
// 0 <?start>
|
||||
// x <?test1> // replaced.
|
||||
// 1 <?result1>
|
||||
// x <?test2> // replaced.
|
||||
// 2 <?result2>
|
||||
// 3 <?test3> // not replaced.
|
||||
// 4 <?result3>
|
||||
// 5 <?test4> // not replaced.
|
||||
// 6 * <?result4>
|
||||
|
||||
is(sessionHistory.count, 7, "<?test4>: SH's length");
|
||||
is(sessionHistory.index, 6, "<?test4>: Current entry's index");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?result4",
|
||||
"Check if the current SH entry is <?test4>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?test4",
|
||||
"Check if <?test4> exists.");
|
||||
|
||||
contentLoadURI(kRedirectURI + "?testDOMContentLoaded");
|
||||
break;
|
||||
|
||||
/*****************************************************************************
|
||||
* Test 5: Setting location.href in onDOMContentLoaded() should REPLACE.
|
||||
****************************************************************************/
|
||||
case "?testDOMContentLoaded":
|
||||
break;
|
||||
case "?resultDOMContentLoaded":
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?resultDOMContentLoaded",
|
||||
"Check if the current SH entry is <?resultDOMContentLoaded>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?result4",
|
||||
"Check if the perevious entry is not <?testDOMContentLoaded> but " +
|
||||
"<?result4>.");
|
||||
|
||||
contentLoadURI(kRedirectURI + "?testPageshow");
|
||||
break;
|
||||
|
||||
/*****************************************************************************
|
||||
* Test 6: Setting location.href in onpageshow() should REPLACE.
|
||||
****************************************************************************/
|
||||
case "?testPageshow":
|
||||
break;
|
||||
case "?resultPageshow":
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?resultPageshow",
|
||||
"Check if the current SH entry is <?resultPageshow>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?resultDOMContentLoaded",
|
||||
"Check if the perevious entry is not <?testPageshow> but " +
|
||||
"<?resultDOMContentLoaded>.");
|
||||
|
||||
contentLoadURI(kRedirectURI + "?testReadystatechange");
|
||||
break;
|
||||
|
||||
/*****************************************************************************
|
||||
* Test 7: Setting location.href in onreadystatechange() should REPLACE.
|
||||
****************************************************************************/
|
||||
case "?testReadystatechange":
|
||||
break;
|
||||
case "?resultReadystatechange":
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index),
|
||||
"?resultReadystatechange",
|
||||
"Check if the current SH entry is <?resultReadystatechange>");
|
||||
|
||||
is(indexToSearch(sessionHistory, sessionHistory.index - 1),
|
||||
"?resultPageshow",
|
||||
"Check if the perevious entry is not <?testReadystatechange> but " +
|
||||
"<?resultPageshow>.");
|
||||
|
||||
finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
]]></script>
|
||||
|
||||
<browser type="content-primary" flex="1" id="content" src="about:blank"/>
|
||||
</window>
|
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=754029.xul
|
||||
-->
|
||||
<window title="Mozilla Bug 754029"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<title>Test for Bug 754029</title>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=754029">
|
||||
Mozilla Bug 754029</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<script class="testbody" type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
/** Test for Bug 754029 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug754029_window.xul", "bug754029",
|
||||
"chrome,width=600,height=600");
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
</window>
|
@ -46,7 +46,6 @@ MOCHITEST_FILES = \
|
||||
frame3.html \
|
||||
goback.html \
|
||||
file_bug534178.html \
|
||||
file_bug754029.html \
|
||||
$(NULL)
|
||||
|
||||
ifneq (mobile/android,$(MOZ_BUILD_APP))
|
||||
|
@ -12,15 +12,53 @@ function isActive(aWindow) {
|
||||
return docshell.isActive;
|
||||
}
|
||||
|
||||
function oneShotListener(aBrowser, aType, aCallback) {
|
||||
aBrowser.addEventListener(aType, function (evt) {
|
||||
if (evt.target != aBrowser.contentDocument)
|
||||
return;
|
||||
aBrowser.removeEventListener(aType, arguments.callee, true);
|
||||
aCallback();
|
||||
function oneShotListener(aElem, aType, aCallback) {
|
||||
aElem.addEventListener(aType, function () {
|
||||
aElem.removeEventListener(aType, arguments.callee, true);
|
||||
|
||||
// aCallback is executed asynchronously, which is handy because load
|
||||
// events fire before mIsDocumentLoaded is actually set to true. :(
|
||||
executeSoon(aCallback);
|
||||
}, true);
|
||||
}
|
||||
|
||||
// Returns a closure that iteratively (BFS) waits for all
|
||||
// of the descendant frames of aInitialWindow to finish loading,
|
||||
// then calls aFinalCallback.
|
||||
function frameLoadWaiter(aInitialWindow, aFinalCallback) {
|
||||
|
||||
// The window we're currently waiting on
|
||||
var curr = aInitialWindow;
|
||||
|
||||
// The windows we need to wait for
|
||||
var waitQueue = [];
|
||||
|
||||
// The callback to call when we're all done
|
||||
var finalCallback = aFinalCallback;
|
||||
|
||||
function frameLoadCallback() {
|
||||
|
||||
// Push any subframes of what we just got
|
||||
for (var i = 0; i < curr.frames.length; ++i)
|
||||
waitQueue.push(curr.frames[i]);
|
||||
|
||||
// Handle the next window in the queue
|
||||
if (waitQueue.length >= 1) {
|
||||
curr = waitQueue.shift();
|
||||
if (curr.document.readyState == "complete")
|
||||
frameLoadCallback();
|
||||
else
|
||||
oneShotListener(curr, "load", frameLoadCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, we're all done. Call the final callback
|
||||
finalCallback();
|
||||
}
|
||||
|
||||
return frameLoadCallback;
|
||||
}
|
||||
|
||||
// Entry point from Mochikit
|
||||
function test() {
|
||||
|
||||
@ -65,7 +103,7 @@ function step2() {
|
||||
ctx.tab2 = gBrowser.addTab(testPath + "bug343515_pg2.html");
|
||||
ctx.tab2Browser = gBrowser.getBrowserForTab(ctx.tab2);
|
||||
ctx.tab2Window = ctx.tab2Browser.contentWindow;
|
||||
oneShotListener(ctx.tab2Browser, "load", step3);
|
||||
oneShotListener(ctx.tab2Browser, "load", frameLoadWaiter(ctx.tab2Window, step3));
|
||||
}
|
||||
|
||||
function step3() {
|
||||
@ -81,12 +119,8 @@ function step3() {
|
||||
ok(!isActive(ctx.tab2Window.frames[1]), "Tab2 iframe 1 should be inactive");
|
||||
|
||||
// Navigate tab 2 to a different page
|
||||
// Note that we need to use setAttribute('src', ...) here rather than setting
|
||||
// window.location, because this function gets called in an onload handler, and
|
||||
// per spec setting window.location during onload is equivalent to calling
|
||||
// window.replace.
|
||||
ctx.tab2Browser.setAttribute('src', testPath + "bug343515_pg3.html");
|
||||
oneShotListener(ctx.tab2Browser, "load", step4);
|
||||
ctx.tab2Window.location = testPath + "bug343515_pg3.html";
|
||||
oneShotListener(ctx.tab2Browser, "load", frameLoadWaiter(ctx.tab2Window, step4));
|
||||
}
|
||||
|
||||
function step4() {
|
||||
@ -115,8 +149,8 @@ function step4() {
|
||||
ok(isActive(ctx.tab2Window.frames[1]), "Tab2 iframe 1 should be active");
|
||||
|
||||
// Go back
|
||||
oneShotListener(ctx.tab2Browser, "pageshow", step5);
|
||||
SimpleTest.executeSoon(function() {ctx.tab2Browser.goBack();});
|
||||
oneShotListener(ctx.tab2Browser, "pageshow", frameLoadWaiter(ctx.tab2Window, step5));
|
||||
ctx.tab2Browser.goBack();
|
||||
|
||||
}
|
||||
|
||||
@ -133,8 +167,8 @@ function step5() {
|
||||
gBrowser.selectedTab = ctx.tab1;
|
||||
|
||||
// Navigate to page 3
|
||||
ctx.tab1Browser.setAttribute('src', testPath + "bug343515_pg3.html");
|
||||
oneShotListener(ctx.tab1Browser, "load", step6);
|
||||
ctx.tab1Window.location = testPath + "bug343515_pg3.html";
|
||||
oneShotListener(ctx.tab1Browser, "load", frameLoadWaiter(ctx.tab1Window, step6));
|
||||
}
|
||||
|
||||
function step6() {
|
||||
@ -150,8 +184,10 @@ function step6() {
|
||||
ok(!isActive(ctx.tab2Window.frames[1]), "Tab2 iframe 1 should be inactive");
|
||||
|
||||
// Go forward on tab 2
|
||||
oneShotListener(ctx.tab2Browser, "pageshow", step7);
|
||||
SimpleTest.executeSoon(function() {ctx.tab2Browser.goForward();});
|
||||
oneShotListener(ctx.tab2Browser, "pageshow", frameLoadWaiter(ctx.tab2Window, step7));
|
||||
var tab2docshell = ctx.tab2Window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation);
|
||||
tab2docshell.goForward();
|
||||
}
|
||||
|
||||
function step7() {
|
||||
|
@ -1,84 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" Content="text/html; charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
// inline <script> tag redirection.
|
||||
function test1() {
|
||||
location.href = "blank.html?result1";
|
||||
}
|
||||
|
||||
// onload() handler redirection.
|
||||
function test2() {
|
||||
addEventListener("load",
|
||||
function(aEvent) {
|
||||
location.href = "blank.html?result2";
|
||||
},
|
||||
false);
|
||||
}
|
||||
|
||||
// setTimeout() 100 milisec redirection.
|
||||
function test3() {
|
||||
setTimeout(function() {
|
||||
location.href = "blank.html?result3";
|
||||
},
|
||||
100);
|
||||
}
|
||||
|
||||
// setTimeout() 100 milisec + inline <script> tag redirection.
|
||||
function test4() {
|
||||
setTimeout(function() {
|
||||
var ns = document.createElement("script");
|
||||
var nt = document.createTextNode(
|
||||
"location = 'blank.html?result4'"
|
||||
);
|
||||
ns.appendChild(nt);
|
||||
document.documentElement.appendChild(ns);
|
||||
},
|
||||
100);
|
||||
}
|
||||
|
||||
// DOMContentLoaded
|
||||
function testDOMContentLoaded() {
|
||||
addEventListener("DOMContentLoaded",
|
||||
function(aEvent) {
|
||||
location.href = "blank.html?resultDOMContentLoaded";
|
||||
},
|
||||
false);
|
||||
}
|
||||
|
||||
// pageshow
|
||||
function testPageshow() {
|
||||
addEventListener("pageshow",
|
||||
function(aEvent) {
|
||||
location.href = "blank.html?resultPageshow";
|
||||
},
|
||||
false);
|
||||
}
|
||||
|
||||
// readystatechange for "complete"
|
||||
function testReadystatechange() {
|
||||
document.onreadystatechange =
|
||||
function() {
|
||||
if ("complete" == document.readyState) {
|
||||
location.href = "blank.html?resultReadystatechange";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
switch(location.search) {
|
||||
case "?test1": test1(); break;
|
||||
case "?test2": test2(); break;
|
||||
case "?test3": test3(); break;
|
||||
case "?test4": test4(); break;
|
||||
case "?testDOMContentLoaded": testDOMContentLoaded(); break;
|
||||
case "?testPageshow" : testPageshow(); break;
|
||||
case "?testReadystatechange": testReadystatechange(); break;
|
||||
default: throw "Unexpected!";
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -45,8 +45,8 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContextPrincipal,
|
||||
NS_ISCRIPTCONTEXTPRINCIPAL_IID)
|
||||
|
||||
#define NS_ISCRIPTCONTEXT_IID \
|
||||
{ 0x95870c91, 0xe21d, 0x4499, \
|
||||
{ 0x9b, 0x61, 0x45, 0x79, 0x5f, 0x12, 0x0c, 0x98 } }
|
||||
{ 0xa842337f, 0x4332, 0x4221, \
|
||||
{ 0xa3, 0x8f, 0xca, 0x47, 0x0b, 0x78, 0xd0, 0x6d } }
|
||||
|
||||
/* This MUST match JSVERSION_DEFAULT. This version stuff if we don't
|
||||
know what language we have is a little silly... */
|
||||
@ -328,6 +328,12 @@ public:
|
||||
// SetProperty is suspect and jst believes should not be needed. Currenly
|
||||
// used only for "arguments".
|
||||
virtual nsresult SetProperty(JSObject* aTarget, const char* aPropName, nsISupports* aVal) = 0;
|
||||
/**
|
||||
* Called to set/get information if the script context is
|
||||
* currently processing a script tag
|
||||
*/
|
||||
virtual bool GetProcessingScriptTag() = 0;
|
||||
virtual void SetProcessingScriptTag(bool aResult) = 0;
|
||||
|
||||
/**
|
||||
* Called to find out if this script context might be executing script.
|
||||
|
@ -1135,6 +1135,7 @@ nsJSContext::nsJSContext(JSRuntime *aRuntime, bool aGCOnDestruction,
|
||||
mOperationCallbackTime = 0;
|
||||
mModalStateTime = 0;
|
||||
mModalStateDepth = 0;
|
||||
mProcessingScriptTag = false;
|
||||
}
|
||||
|
||||
nsJSContext::~nsJSContext()
|
||||
@ -2887,6 +2888,18 @@ nsJSContext::SetScriptsEnabled(bool aEnabled, bool aFireTimeouts)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
nsJSContext::GetProcessingScriptTag()
|
||||
{
|
||||
return mProcessingScriptTag;
|
||||
}
|
||||
|
||||
void
|
||||
nsJSContext::SetProcessingScriptTag(bool aFlag)
|
||||
{
|
||||
mProcessingScriptTag = aFlag;
|
||||
}
|
||||
|
||||
bool
|
||||
nsJSContext::GetExecutingScript()
|
||||
{
|
||||
|
@ -119,6 +119,9 @@ public:
|
||||
|
||||
virtual nsresult SetProperty(JSObject* aTarget, const char* aPropName, nsISupports* aVal);
|
||||
|
||||
virtual bool GetProcessingScriptTag();
|
||||
virtual void SetProcessingScriptTag(bool aResult);
|
||||
|
||||
virtual bool GetExecutingScript();
|
||||
|
||||
virtual nsresult InitClasses(JSObject* aGlobalObj);
|
||||
@ -282,6 +285,7 @@ private:
|
||||
bool mIsInitialized;
|
||||
bool mScriptsEnabled;
|
||||
bool mGCOnDestruction;
|
||||
bool mProcessingScriptTag;
|
||||
|
||||
uint32_t mExecuteDepth;
|
||||
uint32_t mDefaultJSOptions;
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include "nsJSUtils.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
@ -461,72 +460,8 @@ nsLocation::SetHref(const nsAString& aHref)
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
JSContext *cx = nsContentUtils::GetCurrentJSContext();
|
||||
|
||||
// According to HTML5 spec, |location.href = ...| must act as if
|
||||
// it were |location.replace(...)| before the page load finishes.
|
||||
//
|
||||
// http://www.w3.org/TR/2011/WD-html5-20110113/history.html#location
|
||||
//
|
||||
// > The href attribute must return the current address of the
|
||||
// > associated Document object, as an absolute URL.
|
||||
// >
|
||||
// > On setting, if the Location object's associated Document
|
||||
// > object has completely loaded, then the user agent must act
|
||||
// > as if the assign() method had been called with the new value
|
||||
// > as its argument. Otherwise, the user agent must act as if
|
||||
// > the replace() method had been called with the new value as its
|
||||
// > argument.
|
||||
//
|
||||
// Note: The spec says the condition is "Document object has completely
|
||||
// loaded", but that may break some websites. If the user was
|
||||
// willing to move from one page to another, and was able to do
|
||||
// so, we should not overwrite the session history entry even
|
||||
// if the loading has not finished yet.
|
||||
//
|
||||
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=17041
|
||||
//
|
||||
// See bug 39938, bug 72197, bug 178729 and bug 754029.
|
||||
// About other browsers:
|
||||
// http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-July/027372.html
|
||||
|
||||
bool replace = false;
|
||||
if (!nsEventStateManager::IsHandlingUserInput()) {
|
||||
// "completely loaded" is defined at:
|
||||
//
|
||||
// http://www.w3.org/TR/2012/WD-html5-20120329/the-end.html#completely-loaded
|
||||
//
|
||||
// > 7. document readiness to "complete", and fire "load".
|
||||
// >
|
||||
// > 8. "pageshow"
|
||||
// >
|
||||
// > 9. ApplicationCache
|
||||
// >
|
||||
// > 10. Print in the pending list.
|
||||
// >
|
||||
// > 12. Queue a task to mark the Document as completely loaded.
|
||||
//
|
||||
// Since Gecko doesn't (yet) have a flag corresponding to no. "12.
|
||||
// ... completely loaded", here the logic is a little tricky.
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mDocShell));
|
||||
nsCOMPtr<nsIDocument> document(do_GetInterface(docShell));
|
||||
if (document) {
|
||||
replace =
|
||||
nsIDocument::READYSTATE_COMPLETE != document->GetReadyStateEnum();
|
||||
|
||||
// nsIDocShell::isExecutingOnLoadHandler is true while
|
||||
// the document is handling "load", "pageshow",
|
||||
// "readystatechange" for "complete" and "beforeprint"/"afterprint".
|
||||
//
|
||||
// Maybe this API property needs a better name.
|
||||
if (!replace) {
|
||||
docShell->GetIsExecutingOnLoadHandler(&replace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cx) {
|
||||
rv = SetHrefWithContext(cx, aHref, replace);
|
||||
rv = SetHrefWithContext(cx, aHref, false);
|
||||
} else {
|
||||
rv = GetHref(oldHref);
|
||||
|
||||
@ -536,7 +471,7 @@ nsLocation::SetHref(const nsAString& aHref)
|
||||
rv = NS_NewURI(getter_AddRefs(oldUri), oldHref);
|
||||
|
||||
if (oldUri) {
|
||||
rv = SetHrefWithBase(aHref, oldUri, replace);
|
||||
rv = SetHrefWithBase(aHref, oldUri, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -567,6 +502,8 @@ nsLocation::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
|
||||
nsresult result;
|
||||
nsCOMPtr<nsIURI> newUri;
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mDocShell));
|
||||
|
||||
nsAutoCString docCharset;
|
||||
if (NS_SUCCEEDED(GetDocumentCharacterSetForURI(aHref, docCharset)))
|
||||
result = NS_NewURI(getter_AddRefs(newUri), aHref, docCharset.get(), aBase);
|
||||
@ -574,7 +511,34 @@ nsLocation::SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
|
||||
result = NS_NewURI(getter_AddRefs(newUri), aHref, nullptr, aBase);
|
||||
|
||||
if (newUri) {
|
||||
return SetURI(newUri, aReplace);
|
||||
/* Check with the scriptContext if it is currently processing a script tag.
|
||||
* If so, this must be a <script> tag with a location.href in it.
|
||||
* we want to do a replace load, in such a situation.
|
||||
* In other cases, for example if a event handler or a JS timer
|
||||
* had a location.href in it, we want to do a normal load,
|
||||
* so that the new url will be appended to Session History.
|
||||
* This solution is tricky. Hopefully it isn't going to bite
|
||||
* anywhere else. This is part of solution for bug # 39938, 72197
|
||||
*
|
||||
*/
|
||||
bool inScriptTag=false;
|
||||
JSContext *cx = nsContentUtils::GetCurrentJSContext();
|
||||
if (cx) {
|
||||
nsIScriptContext *scriptContext =
|
||||
nsJSUtils::GetDynamicScriptContext(cx);
|
||||
|
||||
if (scriptContext) {
|
||||
if (scriptContext->GetProcessingScriptTag()) {
|
||||
// Now check to make sure that the script is running in our window,
|
||||
// since we only want to replace if the location is set by a
|
||||
// <script> tag in the same window. See bug 178729.
|
||||
nsCOMPtr<nsIScriptGlobalObject> ourGlobal(do_GetInterface(docShell));
|
||||
inScriptTag = (ourGlobal == scriptContext->GetGlobalObject());
|
||||
}
|
||||
}
|
||||
} //cx
|
||||
|
||||
return SetURI(newUri, aReplace || inScriptTag);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -31,7 +31,7 @@ class MessagePumpQt : public QObject {
|
||||
virtual bool event (QEvent *e);
|
||||
void scheduleDelayedIfNeeded(const Time& delayed_work_time);
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void dispatchDelayed();
|
||||
|
||||
private:
|
||||
|
@ -15,12 +15,9 @@ MOZ_ARG_WITH_STRING(android-toolchain,
|
||||
location of the android toolchain],
|
||||
android_toolchain=$withval)
|
||||
|
||||
dnl default gnu compiler version is 4.4.3
|
||||
android_gnu_compiler_version=4.4.3
|
||||
|
||||
MOZ_ARG_WITH_STRING(android-gnu-compiler-version,
|
||||
[ --with-android-gnu-compiler-version=VER
|
||||
gnu compiler version to use, default 4.4.3],
|
||||
gnu compiler version to use],
|
||||
android_gnu_compiler_version=$withval)
|
||||
|
||||
MOZ_ARG_ENABLE_BOOL(android-libstdcxx,
|
||||
@ -75,23 +72,32 @@ case "$target" in
|
||||
|
||||
kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
|
||||
|
||||
case "$target_cpu" in
|
||||
arm)
|
||||
target_name=arm-linux-androideabi-$android_gnu_compiler_version
|
||||
;;
|
||||
i?86)
|
||||
target_name=x86-$android_gnu_compiler_version
|
||||
;;
|
||||
mipsel)
|
||||
target_name=mipsel-linux-android-$android_gnu_compiler_version
|
||||
;;
|
||||
esac
|
||||
android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
|
||||
for version in $android_gnu_compiler_version 4.6 4.4.3 ; do
|
||||
case "$target_cpu" in
|
||||
arm)
|
||||
target_name=arm-linux-androideabi-$version
|
||||
;;
|
||||
i?86)
|
||||
target_name=x86-$version
|
||||
;;
|
||||
mipsel)
|
||||
target_name=mipsel-linux-android-$version
|
||||
;;
|
||||
esac
|
||||
android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
|
||||
|
||||
if test -d "$android_toolchain" ; then
|
||||
AC_MSG_RESULT([$android_toolchain])
|
||||
else
|
||||
if test -d "$android_toolchain" ; then
|
||||
android_gnu_compiler_version=$version
|
||||
break
|
||||
elif test -n "$android_gnu_compiler_version" ; then
|
||||
AC_MSG_ERROR([not found. Your --with-android-gnu-compiler-version may be wrong.])
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$android_gnu_compiler_version" ; then
|
||||
AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
|
||||
else
|
||||
AC_MSG_RESULT([$android_toolchain])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -1704,10 +1704,11 @@ js::ion::GetElementCache(JSContext *cx, size_t cacheIndex, HandleObject obj, Han
|
||||
jsbytecode *pc;
|
||||
cache.getScriptedLocation(&script, &pc);
|
||||
RootedValue lval(cx, ObjectValue(*obj));
|
||||
|
||||
|
||||
if (cache.isDisabled()) {
|
||||
if (!GetElementOperation(cx, JSOp(*pc), lval, idval, res))
|
||||
return false;
|
||||
types::TypeScript::Monitor(cx, script, pc, res);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,9 @@ nsScriptError::InitWithWindowID(const nsAString& message,
|
||||
nsIDocShell* docShell = window->GetDocShell();
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(docShell);
|
||||
if (loadContext) {
|
||||
mIsFromPrivateWindow = loadContext->UsePrivateBrowsing();
|
||||
// Never suppress errors originated from chrome code
|
||||
mIsFromPrivateWindow = !nsContentUtils::IsCallerChrome() &&
|
||||
loadContext->UsePrivateBrowsing();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,6 @@ DEFINES += \
|
||||
-DAPP_NAME=$(MOZ_APP_NAME) \
|
||||
-DAPP_VERSION=$(MOZ_APP_VERSION) \
|
||||
-DMOZ_UPDATER=$(MOZ_UPDATER) \
|
||||
-DMOZ_APP_UA_NAME=$(MOZ_APP_UA_NAME) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_PKG_SPECIAL
|
||||
|
@ -573,8 +573,6 @@ pref("browser.safebrowsing.reportMalwareErrorURL", "http://%LOCALE%.malware-erro
|
||||
pref("browser.safebrowsing.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/phishing-protection/");
|
||||
pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
|
||||
|
||||
pref("browser.safebrowsing.id", "@MOZ_APP_UA_NAME@");
|
||||
|
||||
// Name of the about: page contributed by safebrowsing to handle display of error
|
||||
// pages on phishing/malware hits. (bug 399233)
|
||||
pref("urlclassifier.alternate_error_page", "blocked");
|
||||
|
@ -39,4 +39,14 @@ EXTRA_COMPONENTS = \
|
||||
BlocklistPrompt.js \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_SAFE_BROWSING
|
||||
DEFINES += \
|
||||
-DMOZ_APP_UA_NAME=$(MOZ_APP_UA_NAME) \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_PP_JS_MODULES = \
|
||||
SafeBrowsing.jsm \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
182
mobile/android/components/SafeBrowsing.jsm
Normal file
182
mobile/android/components/SafeBrowsing.jsm
Normal file
@ -0,0 +1,182 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["SafeBrowsing"];
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const phishingList = "goog-phish-shavar";
|
||||
const malwareList = "goog-malware-shavar";
|
||||
|
||||
var debug = false;
|
||||
|
||||
function log(...stuff) {
|
||||
if (!debug)
|
||||
return;
|
||||
|
||||
let msg = "SafeBrowsing: " + stuff.join(" ");
|
||||
Services.console.logStringMessage(msg);
|
||||
dump(msg + "\n");
|
||||
}
|
||||
|
||||
this.SafeBrowsing = {
|
||||
|
||||
init: function() {
|
||||
if (this.initialized) {
|
||||
log("Already initialized");
|
||||
return;
|
||||
}
|
||||
|
||||
Services.prefs.addObserver("browser.safebrowsing", this.readPrefs, false);
|
||||
this.readPrefs();
|
||||
|
||||
// Register our two types of tables, and add custom Mozilla entries
|
||||
let listManager = Cc["@mozilla.org/url-classifier/listmanager;1"].
|
||||
getService(Ci.nsIUrlListManager);
|
||||
listManager.registerTable(phishingList, false);
|
||||
listManager.registerTable(malwareList, false);
|
||||
this.addMozEntries();
|
||||
|
||||
this.controlUpdateChecking();
|
||||
this.initialized = true;
|
||||
|
||||
log("init() finished");
|
||||
},
|
||||
|
||||
|
||||
initialized: false,
|
||||
phishingEnabled: false,
|
||||
malwareEnabled: false,
|
||||
|
||||
updateURL: null,
|
||||
keyURL: null,
|
||||
gethashURL: null,
|
||||
|
||||
reportURL: null,
|
||||
reportGenericURL: null,
|
||||
reportErrorURL: null,
|
||||
reportPhishURL: null,
|
||||
reportMalwareURL: null,
|
||||
reportMalwareErrorURL: null,
|
||||
|
||||
|
||||
getReportURL: function(kind) {
|
||||
return this["report" + kind + "URL"];
|
||||
},
|
||||
|
||||
|
||||
readPrefs: function() {
|
||||
log("reading prefs");
|
||||
|
||||
debug = Services.prefs.getBoolPref("browser.safebrowsing.debug");
|
||||
this.phishingEnabled = Services.prefs.getBoolPref("browser.safebrowsing.enabled");
|
||||
this.malwareEnabled = Services.prefs.getBoolPref("browser.safebrowsing.malware.enabled");
|
||||
this.updateProviderURLs();
|
||||
|
||||
// XXX The listManager backend gets confused if this is called before the
|
||||
// lists are registered. So only call it here when a pref changes, and not
|
||||
// when doing initialization. I expect to refactor this later, so pardon the hack.
|
||||
if (this.initialized)
|
||||
this.controlUpdateChecking();
|
||||
},
|
||||
|
||||
|
||||
updateProviderURLs: function() {
|
||||
#ifdef USE_HISTORIC_SAFEBROWSING_ID
|
||||
let clientID = "navclient-auto-ffox";
|
||||
#else
|
||||
#expand let clientID = __MOZ_APP_UA_NAME__;
|
||||
#endif
|
||||
|
||||
log("initializing safe browsing URLs");
|
||||
let basePref = "browser.safebrowsing.";
|
||||
|
||||
// Urls to HTML report pages
|
||||
this.reportURL = Services.urlFormatter.formatURLPref(basePref + "reportURL");
|
||||
this.reportGenericURL = Services.urlFormatter.formatURLPref(basePref + "reportGenericURL");
|
||||
this.reportErrorURL = Services.urlFormatter.formatURLPref(basePref + "reportErrorURL");
|
||||
this.reportPhishURL = Services.urlFormatter.formatURLPref(basePref + "reportPhishURL");
|
||||
this.reportMalwareURL = Services.urlFormatter.formatURLPref(basePref + "reportMalwareURL");
|
||||
this.reportMalwareErrorURL = Services.urlFormatter.formatURLPref(basePref + "reportMalwareErrorURL");
|
||||
|
||||
// Urls used to update DB
|
||||
this.updateURL = Services.urlFormatter.formatURLPref(basePref + "updateURL");
|
||||
this.keyURL = Services.urlFormatter.formatURLPref(basePref + "keyURL");
|
||||
this.gethashURL = Services.urlFormatter.formatURLPref(basePref + "gethashURL");
|
||||
|
||||
this.updateURL = this.updateURL.replace("SAFEBROWSING_ID", clientID);
|
||||
this.keyURL = this.keyURL.replace("SAFEBROWSING_ID", clientID);
|
||||
this.gethashURL = this.gethashURL.replace("SAFEBROWSING_ID", clientID);
|
||||
|
||||
let listManager = Cc["@mozilla.org/url-classifier/listmanager;1"].
|
||||
getService(Ci.nsIUrlListManager);
|
||||
|
||||
listManager.setUpdateUrl(this.updateURL);
|
||||
// XXX Bug 779317 - setKeyUrl has the side effect of fetching a key from the server.
|
||||
// This shouldn't happen if anti-phishing/anti-malware is disabled.
|
||||
if (this.phishingEnabled || this.malwareEnabled)
|
||||
listManager.setKeyUrl(this.keyURL);
|
||||
listManager.setGethashUrl(this.gethashURL);
|
||||
},
|
||||
|
||||
|
||||
controlUpdateChecking: function() {
|
||||
log("phishingEnabled:", this.phishingEnabled, "malwareEnabled:", this.malwareEnabled);
|
||||
|
||||
let listManager = Cc["@mozilla.org/url-classifier/listmanager;1"].
|
||||
getService(Ci.nsIUrlListManager);
|
||||
|
||||
if (this.phishingEnabled)
|
||||
listManager.enableUpdate(phishingList);
|
||||
else
|
||||
listManager.disableUpdate(phishingList);
|
||||
|
||||
if (this.malwareEnabled)
|
||||
listManager.enableUpdate(malwareList);
|
||||
else
|
||||
listManager.disableUpdate(malwareList);
|
||||
},
|
||||
|
||||
|
||||
addMozEntries: function() {
|
||||
// Add test entries to the DB.
|
||||
// XXX bug 779008 - this could be done by DB itself?
|
||||
const phishURL = "mozilla.org/firefox/its-a-trap.html";
|
||||
const malwareURL = "mozilla.org/firefox/its-an-attack.html";
|
||||
|
||||
let update = "n:1000\ni:test-malware-simple\nad:1\n" +
|
||||
"a:1:32:" + malwareURL.length + "\n" +
|
||||
malwareURL;
|
||||
update += "n:1000\ni:test-phish-simple\nad:1\n" +
|
||||
"a:1:32:" + phishURL.length + "\n" +
|
||||
phishURL;
|
||||
log("addMozEntries:", update);
|
||||
|
||||
let db = Cc["@mozilla.org/url-classifier/dbservice;1"].
|
||||
getService(Ci.nsIUrlClassifierDBService);
|
||||
|
||||
// nsIUrlClassifierUpdateObserver
|
||||
let dummyListener = {
|
||||
updateUrlRequested: function() { },
|
||||
streamFinished: function() { },
|
||||
updateError: function() { },
|
||||
updateSuccess: function() { }
|
||||
};
|
||||
|
||||
try {
|
||||
db.beginUpdate(dummyListener, "test-malware-simple,test-phish-simple", "");
|
||||
db.beginStream("", "");
|
||||
db.updateStream(update);
|
||||
db.finishStream();
|
||||
db.finishUpdate();
|
||||
} catch(ex) {
|
||||
// beginUpdate will throw harmlessly if there's an existing update in progress, ignore failures.
|
||||
log("addMozEntries failed!", ex);
|
||||
}
|
||||
},
|
||||
};
|
@ -87,7 +87,7 @@ nsQtNetworkManager::openConnection(const QString& host)
|
||||
openSession();
|
||||
} else {
|
||||
// jump to mainthread and do the work there
|
||||
emit openConnectionSignal();
|
||||
Q_EMIT openConnectionSignal();
|
||||
}
|
||||
|
||||
// if its claiming its online -> send one resolve request ahead.
|
||||
|
@ -31,14 +31,14 @@ class nsQtNetworkManager : public QObject
|
||||
static void enableInstance();
|
||||
bool openConnection(const QString&);
|
||||
bool isOnline();
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void openConnectionSignal();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void closeSession();
|
||||
void onlineStateChanged(bool);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void openSession();
|
||||
|
||||
private:
|
||||
|
@ -496,6 +496,10 @@ class Marionette(object):
|
||||
elements.append(HTMLElement(self, x))
|
||||
return elements
|
||||
|
||||
def get_active_element(self):
|
||||
response = self._send_message('getActiveElement', 'value')
|
||||
return HTMLElement(self, response)
|
||||
|
||||
def log(self, msg, level=None):
|
||||
return self._send_message('log', 'ok', value=msg, level=level)
|
||||
|
||||
|
@ -137,6 +137,13 @@ class TestElements(MarionetteTestCase):
|
||||
found_els = nav_el.find_elements("css selector", "a")
|
||||
self.assertFalse(el.id in [found_el.id for found_el in found_els])
|
||||
|
||||
def test_finding_active_element_returns_element(self):
|
||||
test_html = self.marionette.absolute_url("test.html")
|
||||
self.marionette.navigate(test_html)
|
||||
fbody = self.marionette.find_element('tag name', 'body')
|
||||
abody = self.marionette.get_active_element()
|
||||
self.assertEqual(fbody, abody)
|
||||
|
||||
class TestElementsChrome(MarionetteTestCase):
|
||||
def setUp(self):
|
||||
MarionetteTestCase.setUp(self)
|
||||
|
@ -1320,9 +1320,17 @@ MarionetteDriverActor.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Return the active element on the page
|
||||
*/
|
||||
getActiveElement: function MDA_getActiveElement(){
|
||||
let command_id = this.command_id = this.getCommandId();
|
||||
this.sendAsync("getActiveElement", {command_id: command_id});
|
||||
},
|
||||
|
||||
/**
|
||||
* Send click event to element
|
||||
*
|
||||
*
|
||||
* @param object aRequest
|
||||
* 'element' member holds the reference id to
|
||||
* the element that will be clicked
|
||||
@ -2011,7 +2019,8 @@ MarionetteDriverActor.prototype.requestTypes = {
|
||||
"addCookie": MarionetteDriverActor.prototype.addCookie,
|
||||
"getAllCookies": MarionetteDriverActor.prototype.getAllCookies,
|
||||
"deleteAllCookies": MarionetteDriverActor.prototype.deleteAllCookies,
|
||||
"deleteCookie": MarionetteDriverActor.prototype.deleteCookie
|
||||
"deleteCookie": MarionetteDriverActor.prototype.deleteCookie,
|
||||
"getActiveElement": MarionetteDriverActor.prototype.getActiveElement
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -102,6 +102,7 @@ function startListeners() {
|
||||
addMessageListenerId("Marionette:refresh", refresh);
|
||||
addMessageListenerId("Marionette:findElementContent", findElementContent);
|
||||
addMessageListenerId("Marionette:findElementsContent", findElementsContent);
|
||||
addMessageListenerId("Marionette:getActiveElement", getActiveElement);
|
||||
addMessageListenerId("Marionette:clickElement", clickElement);
|
||||
addMessageListenerId("Marionette:getElementAttribute", getElementAttribute);
|
||||
addMessageListenerId("Marionette:getElementText", getElementText);
|
||||
@ -188,6 +189,7 @@ function deleteSession(msg) {
|
||||
removeMessageListenerId("Marionette:refresh", refresh);
|
||||
removeMessageListenerId("Marionette:findElementContent", findElementContent);
|
||||
removeMessageListenerId("Marionette:findElementsContent", findElementsContent);
|
||||
removeMessageListenerId("Marionette:getActiveElement", getActiveElement);
|
||||
removeMessageListenerId("Marionette:clickElement", clickElement);
|
||||
removeMessageListenerId("Marionette:getElementAttribute", getElementAttribute);
|
||||
removeMessageListenerId("Marionette:getElementTagName", getElementTagName);
|
||||
@ -655,6 +657,16 @@ function findElementsContent(msg) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find and return the active element on the page
|
||||
*/
|
||||
function getActiveElement(msg) {
|
||||
let command_id = msg.json.command_id;
|
||||
var element = curWindow.document.activeElement;
|
||||
var id = elementManager.addToKnownElements(element);
|
||||
sendResponse({value: id}, command_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send click event to element
|
||||
*/
|
||||
|
@ -18,6 +18,14 @@ LIBXUL_LIBRARY = 1
|
||||
FORCE_STATIC_LIB = 1
|
||||
FAIL_ON_WARNINGS = 1
|
||||
|
||||
# Normally the "client ID" sent in updates is appinfo.name, but for
|
||||
# official Firefox releases from Mozilla we use a special identifier.
|
||||
ifdef MOZILLA_OFFICIAL
|
||||
ifdef MOZ_PHOENIX
|
||||
DEFINES += -DUSE_HISTORIC_SAFEBROWSING_ID=1
|
||||
endif
|
||||
endif
|
||||
|
||||
XPIDLSRCS = \
|
||||
nsIUrlClassifierDBService.idl \
|
||||
nsIUrlClassifierHashCompleter.idl \
|
||||
@ -57,7 +65,7 @@ EXTRA_PP_COMPONENTS = \
|
||||
nsUrlClassifierListManager.js \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_JS_MODULES = \
|
||||
EXTRA_PP_JS_MODULES = \
|
||||
SafeBrowsing.jsm \
|
||||
$(NULL)
|
||||
|
||||
|
@ -10,8 +10,8 @@ const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const phishingList = "goog-phish-shavar";
|
||||
const malwareList = "goog-malware-shavar";
|
||||
const [phishingList, malwareList] =
|
||||
Services.prefs.getCharPref("urlclassifier.gethashtables").split(",").map(function(value) value.trim());
|
||||
|
||||
var debug = false;
|
||||
function log(...stuff) {
|
||||
@ -86,11 +86,11 @@ this.SafeBrowsing = {
|
||||
|
||||
|
||||
updateProviderURLs: function() {
|
||||
try {
|
||||
var clientID = Services.prefs.getCharPref("browser.safebrowsing.id");
|
||||
} catch(e) {
|
||||
var clientID = Services.appinfo.name;
|
||||
}
|
||||
#ifdef USE_HISTORIC_SAFEBROWSING_ID
|
||||
let clientID = "navclient-auto-ffox";
|
||||
#else
|
||||
let clientID = Services.appinfo.name;
|
||||
#endif
|
||||
|
||||
log("initializing safe browsing URLs");
|
||||
let basePref = "browser.safebrowsing.";
|
||||
|
@ -93,10 +93,6 @@ private:
|
||||
// uris on document loads.
|
||||
bool mCheckPhishing;
|
||||
|
||||
// TRUE if we randomize the prefixes/domains per client to prevent
|
||||
// simulatenous collisions for all Firefox users
|
||||
bool mPerClientRandomize;
|
||||
|
||||
// TRUE if a BeginUpdate() has been called without an accompanying
|
||||
// CancelUpdate()/FinishUpdate(). This is used to prevent competing
|
||||
// updates, not to determine whether an update is still being
|
||||
|
@ -23,7 +23,7 @@ static nsFastStartup* sFastStartup = NULL;
|
||||
void
|
||||
GeckoThread::run()
|
||||
{
|
||||
emit symbolsLoadingFinished(mFunc(mExecPath));
|
||||
Q_EMIT symbolsLoadingFinished(mFunc(mExecPath));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -66,7 +66,7 @@ public:
|
||||
// Final notification that Static UI show and painted
|
||||
void painted();
|
||||
|
||||
protected slots:
|
||||
protected Q_SLOTS:
|
||||
void symbolsLoadingFinished(bool);
|
||||
|
||||
private:
|
||||
|
@ -220,7 +220,7 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void CheckTopLevelSize()
|
||||
{
|
||||
if (mTopLevelWidget) {
|
||||
|
@ -60,7 +60,7 @@ MozQOrientationSensorFilter::filter(QOrientationReading* reading)
|
||||
}
|
||||
}
|
||||
#else
|
||||
emit orientationChanged();
|
||||
Q_EMIT orientationChanged();
|
||||
#endif
|
||||
|
||||
return true; // don't store the reading in the sensor
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
static int GetWindowRotationAngle();
|
||||
static QTransform& GetRotationTransform();
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void orientationChanged();
|
||||
|
||||
private:
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
virtual void SwitchToForeground();
|
||||
virtual void SwitchToBackground();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
static void showVKB();
|
||||
|
||||
#ifdef MOZ_ENABLE_QTMOBILITY
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
|
||||
int exec();
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void contentItemSelected(const QString& aItem);
|
||||
void contentItemsSelected(const QStringList& aItems);
|
||||
void backButtonClicked();
|
||||
|
Loading…
Reference in New Issue
Block a user