This commit is contained in:
Brian Hackett 2011-11-14 09:13:33 -08:00
Родитель af628c7201 2d26cc32f0
Коммит 3b10c64bdc
436 изменённых файлов: 8956 добавлений и 2344 удалений

Просмотреть файл

@ -65,7 +65,7 @@ tier_base_dirs = \
$(NULL)
ifndef LIBXUL_SDK
ifeq ($(OS_TARGET),Android)
ifeq (android,$(MOZ_WIDGET_TOOLKIT))
tier_base_dirs += other-licenses/android
endif

Просмотреть файл

@ -238,7 +238,8 @@ nsAccDocManager::OnProgressChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP
nsAccDocManager::OnLocationChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsIURI *aLocation)
nsIRequest *aRequest, nsIURI *aLocation,
PRUint32 aFlags)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;

Просмотреть файл

@ -4586,7 +4586,7 @@ var XULBrowserWindow = {
}
},
onLocationChange: function (aWebProgress, aRequest, aLocationURI) {
onLocationChange: function (aWebProgress, aRequest, aLocationURI, aFlags) {
var location = aLocationURI ? aLocationURI.spec : "";
this._hostChanged = true;
@ -5052,7 +5052,8 @@ var TabsProgressListener = {
}
},
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI) {
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI,
aFlags) {
// Filter out any sub-frame loads
if (aBrowser.contentWindow == aWebProgress.DOMWindow)
FullZoom.onLocationChange(aLocationURI, false, aBrowser);

Просмотреть файл

@ -608,7 +608,8 @@
this.mStatus = aStatus;
},
onLocationChange: function (aWebProgress, aRequest, aLocation) {
onLocationChange: function (aWebProgress, aRequest, aLocation,
aFlags) {
// OnLocationChange is called for both the top-level content
// and the subframes.
let topLevel = aWebProgress.DOMWindow == this.mBrowser.contentWindow;
@ -641,7 +642,8 @@
if (!this.mBlank) {
this._callProgressListeners("onLocationChange",
[aWebProgress, aRequest, aLocation]);
[aWebProgress, aRequest, aLocation,
aFlags]);
}
if (topLevel)
@ -890,7 +892,8 @@
var securityUI = this.mCurrentBrowser.securityUI;
this._callProgressListeners(null, "onLocationChange",
[webProgress, null, loc], true, false);
[webProgress, null, loc, 0], true,
false);
if (securityUI) {
this._callProgressListeners(null, "onSecurityChange",

Просмотреть файл

@ -17,7 +17,7 @@ var gFrontProgressListener = {
gFrontNotificationsPos++;
},
onLocationChange: function (aWebProgress, aRequest, aLocationURI) {
onLocationChange: function (aWebProgress, aRequest, aLocationURI, aFlags) {
var state = "onLocationChange";
info("FrontProgress: " + state + " " + aLocationURI.spec);
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
@ -53,7 +53,8 @@ var gAllProgressListener = {
}
},
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI) {
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI,
aFlags) {
var state = "onLocationChange";
info("AllProgress: " + state + " " + aLocationURI.spec);
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");

Просмотреть файл

@ -32,7 +32,13 @@ function test() {
testVal("http://mozilla.org/sub/", "mozilla.org/sub/");
testVal("http://ftp.mozilla.org/", "http://ftp.mozilla.org");
testVal("http://ftp1.mozilla.org/", "http://ftp1.mozilla.org");
testVal("http://ftp42.mozilla.org/", "http://ftp42.mozilla.org");
testVal("http://ftpx.mozilla.org/", "ftpx.mozilla.org");
testVal("ftp://ftp.mozilla.org/", "ftp://ftp.mozilla.org");
testVal("ftp://ftp1.mozilla.org/", "ftp://ftp1.mozilla.org");
testVal("ftp://ftp42.mozilla.org/", "ftp://ftp42.mozilla.org");
testVal("ftp://ftpx.mozilla.org/", "ftp://ftpx.mozilla.org");
testVal("https://user:pass@mozilla.org/", "https://user:pass@mozilla.org");
testVal("http://user:pass@mozilla.org/", "http://user:pass@mozilla.org");

Просмотреть файл

@ -635,8 +635,10 @@ function openPrefsHelp() {
}
function trimURL(aURL) {
// This function must not modify the given URL such that calling
// nsIURIFixup::createFixupURI with the result will produce a different URI.
return aURL /* remove single trailing slash for http/https/ftp URLs */
.replace(/^((?:http|https|ftp):\/\/[^/]+)\/$/, "$1")
/* remove http:// unless the host starts with "ftp." or contains "@" */
.replace(/^http:\/\/((?!ftp\.)[^\/@]+(?:\/|$))/, "$1");
/* remove http:// unless the host starts with "ftp\d*\." or contains "@" */
.replace(/^http:\/\/((?!ftp\d*\.)[^\/@]+(?:\/|$))/, "$1");
}

Просмотреть файл

@ -72,7 +72,7 @@ var panelProgressListener = {
}
,
onLocationChange : function(aWebProgress, aRequest, aLocation) {
onLocationChange : function(aWebProgress, aRequest, aLocation, aFlags) {
UpdateBackForwardCommands(getPanelBrowser().webNavigation);
},

Просмотреть файл

@ -44,7 +44,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = browserabout
LIBRARY_NAME = browserabout_s
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1
ifndef MOZ_MEMORY
USE_STATIC_LIBS = 1
endif

Просмотреть файл

@ -50,7 +50,6 @@ DIRS = tests
endif
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1
# Because we are an application component, link against the CRT statically
# (on Windows, but only if we're not building our own CRT for jemalloc)

Просмотреть файл

@ -44,7 +44,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = browser_feeds
LIBRARY_NAME = browser_feeds_s
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1
ifndef MOZ_MEMORY
USE_STATIC_LIBS = 1
endif

Просмотреть файл

@ -44,7 +44,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = migration
LIBRARY_NAME = migration_s
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1
ifndef MOZ_MEMORY
USE_STATIC_LIBS = 1
endif

Просмотреть файл

@ -64,7 +64,8 @@ var gTabsListener = {
"Tab has been opened in current browser window");
},
onLocationChange: function(aBrowser, aWebProgress, aRequest, aLocationURI) {
onLocationChange: function(aBrowser, aWebProgress, aRequest, aLocationURI,
aFlags) {
var spec = aLocationURI.spec;
ok(true, spec);
// When a new tab is opened, location is first set to "about:blank", so

Просмотреть файл

@ -45,7 +45,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = privatebrowsing
LIBRARY_NAME = privatebrowsing_s
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1
ifndef MOZ_MEMORY
USE_STATIC_LIBS = 1
endif

Просмотреть файл

@ -2305,7 +2305,7 @@ SessionStoreService.prototype = {
if (aEntry.children) {
aEntry.children.forEach(function(entry) {
this._extractHostsForCookies(entry, aHosts, aCheckPrivacy, aIsPinned);
this._extractHostsForCookiesFromEntry(entry, aHosts, aCheckPrivacy, aIsPinned);
}, this);
}
},

Просмотреть файл

@ -44,7 +44,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = shellservice
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1
ifndef MOZ_MEMORY
USE_STATIC_LIBS = 1
endif

Просмотреть файл

@ -235,7 +235,8 @@ nsMacShellService::OnProgressChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
nsMacShellService::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI* aLocation)
nsIURI* aLocation,
PRUint32 aFlags)
{
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,12 @@
export INCLUDE=/d/msvs10/vc/include:/d/msvs10/vc/atlmfc/include:/d/sdks/v7.0/include:/d/sdks/v7.0/include/atl:/d/msvs8/VC/PlatformSDK/include:/d/sdks/dx10/include
export LIBPATH=/d/msvs10/vc/lib:/d/msvs10/vc/atlmfc/lib:/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727
export LIB=/d/msvs10/vc/lib:/d/msvs10/vc/atlmfc/lib:/d/sdks/v7.0/lib:/d/msvs8/VC/PlatformSDK/lib:/d/msvs8/SDK/v2.0/lib:/d/mozilla-build/atlthunk_compat:/d/sdks/dx10/lib/x86
export PATH="/d/msvs10/VSTSDB/Deploy:/d/msvs10/Common7/IDE/:/d/msvs10/VC/BIN:/d/msvs10/Common7/Tools:/d/msvs10/VC/VCPackages:${PATH}"
export WIN32_REDIST_DIR=/d/msvs10/VC/redist/x86/Microsoft.VC100.CRT
mk_add_options "export LIB=$LIB"
mk_add_options "export LIBPATH=$LIBPATH"
mk_add_options "export PATH=$PATH"
mk_add_options "export INCLUDE=$INCLUDE"
mk_add_options "export WIN32_REDIST_DIR=$WIN32_REDIST_DIR"

Просмотреть файл

@ -56,7 +56,7 @@ endif
DIRS += pgo
ifdef ENABLE_TESTS
ifeq (Android,$(OS_TARGET))
ifeq (android,$(MOZ_WIDGET_TOOLKIT))
DIRS += mobile/sutagent/android \
mobile/sutagent/android/watcher \
mobile/sutagent/android/ffxcp \

Просмотреть файл

@ -46,7 +46,6 @@ MODULE = chrome
LIBRARY_NAME = chrome_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1
EXPORTS_NAMESPACES = mozilla/chrome

Просмотреть файл

@ -289,6 +289,56 @@ arm-android-eabi)
;;
esac
MOZ_ARG_WITH_STRING(gonk,
[ --with-gonk=DIR
location of gonk dir],
gonkdir=$withval)
if test -n "$gonkdir" ; then
kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
gonk_toolchain="$gonkdir"/prebuilt/$kernel_name-x86/toolchain/arm-eabi-4.4.3
dnl set up compilers
AS="$gonk_toolchain"/bin/"$android_tool_prefix"-as
CC="$gonk_toolchain"/bin/"$android_tool_prefix"-gcc
CXX="$gonk_toolchain"/bin/"$android_tool_prefix"-g++
CPP="$gonk_toolchain"/bin/"$android_tool_prefix"-cpp
LD="$gonk_toolchain"/bin/"$android_tool_prefix"-ld
AR="$gonk_toolchain"/bin/"$android_tool_prefix"-ar
RANLIB="$gonk_toolchain"/bin/"$android_tool_prefix"-ranlib
STRIP="$gonk_toolchain"/bin/"$android_tool_prefix"-strip
STLPORT_CPPFLAGS="-I$gonkdir/ndk/sources/cxx-stl/stlport/stlport/"
STLPORT_LIBS="-lstlport"
CPPFLAGS="-DANDROID -I$gonkdir/bionic/libc/include/ -I$gonkdir/bionic/libc/kernel/common -I$gonkdir/bionic/libc/arch-arm/include -I$gonkdir/bionic/libc/kernel/arch-arm -I$gonkdir/bionic/libm/include -I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/hardware/libhardware/include -I$gonkdir/system/core/include -I$gonkdir/bionic -I$gonkdir/frameworks/base/include $STLPORT_CPPFLAGS $CPPFLAGS"
CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions $CXXFLAGS"
LIBS="$LIBS $STLPORT_LIBS"
dnl Add -llog by default, since we use it all over the place.
LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ -llog $LDFLAGS"
dnl prevent cross compile section from using these flags as host flags
if test -z "$HOST_CPPFLAGS" ; then
HOST_CPPFLAGS=" "
fi
if test -z "$HOST_CFLAGS" ; then
HOST_CFLAGS=" "
fi
if test -z "$HOST_CXXFLAGS" ; then
HOST_CXXFLAGS=" "
fi
if test -z "$HOST_LDFLAGS" ; then
HOST_LDFLAGS=" "
fi
AC_DEFINE(ANDROID)
CROSS_COMPILE=1
MOZ_CHROME_FILE_FORMAT=omni
ZLIB_DIR=yes
direct_nspr_config=1
else
case "$target" in
*-android*|*-linuxandroid*)
if test -z "$android_ndk" ; then
@ -419,6 +469,8 @@ case "$target" in
;;
esac
fi
AC_SUBST(ANDROID_NDK)
AC_SUBST(ANDROID_TOOLCHAIN)
AC_SUBST(ANDROID_PLATFORM)
@ -1708,6 +1760,48 @@ fi # CPU_ARCH = arm
AC_SUBST(HAVE_ARM_SIMD)
AC_SUBST(HAVE_ARM_NEON)
dnl =================================================================
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
dnl which is bad when cross compiling.
dnl =================================================================
if test "$COMPILE_ENVIRONMENT"; then
configure_static_assert_macros='
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
'
dnl test that the macros actually work:
AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
[AC_LANG_SAVE
AC_LANG_C
ac_cv_static_assertion_macros_work="yes"
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(1)],
,
ac_cv_static_assertion_macros_work="no")
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(0)],
ac_cv_static_assertion_macros_work="no",
)
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(1)],
,
ac_cv_static_assertion_macros_work="no")
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(0)],
ac_cv_static_assertion_macros_work="no",
)
AC_LANG_RESTORE
])
AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
if test "$ac_cv_static_assertion_macros_work" = "no"; then
AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
fi
fi # COMPILE_ENVIRONMENT
dnl ========================================================
dnl Android libstdc++, placed here so it can use MOZ_ARCH
dnl computed above.
@ -1854,6 +1948,27 @@ if test "$GNU_CXX"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions"
fi
AC_CACHE_CHECK(whether the compiler supports -Wno-extended-offsetof,
ac_has_wno_extended_offsetof,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-extended-offsetof"
AC_TRY_COMPILE([$configure_static_assert_macros
#ifndef __has_warning
#define __has_warning(x) 0
#endif],
[CONFIGURE_STATIC_ASSERT(__has_warning("-Wextended-offsetof"))],
ac_has_wno_extended_offsetof="yes",
ac_has_wno_extended_offsetof="no")
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_has_wno_extended_offsetof" = "yes"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-extended-offsetof"
fi
AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
ac_has_wno_invalid_offsetof,
[
@ -1952,48 +2067,6 @@ LOOP_INPUT
fi # GNU_CC
fi # COMPILE_ENVIRONMENT
dnl =================================================================
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
dnl which is bad when cross compiling.
dnl =================================================================
if test "$COMPILE_ENVIRONMENT"; then
configure_static_assert_macros='
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
'
dnl test that the macros actually work:
AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
[AC_LANG_SAVE
AC_LANG_C
ac_cv_static_assertion_macros_work="yes"
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(1)],
,
ac_cv_static_assertion_macros_work="no")
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(0)],
ac_cv_static_assertion_macros_work="no",
)
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(1)],
,
ac_cv_static_assertion_macros_work="no")
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(0)],
ac_cv_static_assertion_macros_work="no",
)
AC_LANG_RESTORE
])
AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
if test "$ac_cv_static_assertion_macros_work" = "no"; then
AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
fi
fi # COMPILE_ENVIRONMENT
dnl ========================================================
dnl Checking for 64-bit OS
dnl ========================================================
@ -2386,7 +2459,11 @@ ia64*-hpux*)
*-android*|*-linuxandroid*)
AC_DEFINE(NO_PW_GECOS)
no_x=yes
_PLATFORM_DEFAULT_TOOLKIT=cairo-android
if test -n "$gonkdir"; then
_PLATFORM_DEFAULT_TOOLKIT=cairo-gonk
else
_PLATFORM_DEFAULT_TOOLKIT=cairo-android
fi
TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
MOZ_GFX_OPTIMIZE_MOBILE=1
@ -4772,7 +4849,8 @@ MOZ_ARG_HEADER(Toolkit Options)
-o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
-o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
-o "$_DEFAULT_TOOLKIT" = "cairo-uikit" \
-o "$_DEFAULT_TOOLKIT" = "cairo-android"
-o "$_DEFAULT_TOOLKIT" = "cairo-android" \
-o "$_DEFAULT_TOOLKIT" = "cairo-gonk"
then
dnl nglayout only supports building with one toolkit,
dnl so ignore everything after the first comma (",").
@ -4895,6 +4973,15 @@ cairo-android)
MOZ_INSTRUMENT_EVENT_LOOP=1
;;
cairo-gonk)
AC_DEFINE(MOZ_WIDGET_GONK)
MOZ_WIDGET_TOOLKIT=gonk
TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
TK_LIBS='$(MOZ_CAIRO_LIBS)'
MOZ_WEBGL=1
MOZ_PDF_PRINTING=1
;;
esac
AC_SUBST(MOZ_PDF_PRINTING)
@ -7175,7 +7262,9 @@ dnl We need to wrap dlopen and related functions on Android because we use
dnl our own linker.
if test "$OS_TARGET" = Android; then
WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozutils"
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
if test "$MOZ_WIDGET_TOOLKIT" = android; then
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
fi
fi
dnl ========================================================
@ -7227,6 +7316,17 @@ if test -n "$MOZ_TRACEVIS"; then
AC_DEFINE(MOZ_TRACEVIS)
fi
dnl ========================================================
dnl = Use incremental GC
dnl ========================================================
JSGC_INCREMENTAL=1
MOZ_ARG_DISABLE_BOOL(gcincremental,
[ --disable-gcincremental Disable incremental GC],
JSGC_INCREMENTAL= )
if test -n "$JSGC_INCREMENTAL"; then
AC_DEFINE(JSGC_INCREMENTAL)
fi
dnl ========================================================
dnl ETW - Event Tracing for Windows
dnl ========================================================
@ -7715,7 +7815,7 @@ MOZ_ARG_DISABLE_BOOL(pedantic,
_PEDANTIC= )
if test "$_PEDANTIC"; then
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-pedantic ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
AC_TRY_COMPILE([$configure_static_assert_macros],
[CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
@ -7725,8 +7825,8 @@ if test "$_PEDANTIC"; then
case "$result" in
no)
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
_WARNINGS_CFLAGS="${_COMPILER_PREFIX}-pedantic ${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
_WARNINGS_CXXFLAGS="${_COMPILER_PREFIX}-pedantic ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
;;
yes)
AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
@ -8845,20 +8945,22 @@ if test "$MOZ_TREE_FREETYPE"; then
AC_OUTPUT_SUBDIRS(modules/freetype2)
fi
dnl ========================================================
dnl = Setup a nice relatively clean build environment for
dnl = sub-configures.
dnl ========================================================
CC="$_SUBDIR_CC"
CXX="$_SUBDIR_CXX"
CFLAGS="$_SUBDIR_CFLAGS"
CPPFLAGS="$_SUBDIR_CPPFLAGS"
CXXFLAGS="$_SUBDIR_CXXFLAGS"
LDFLAGS="$_SUBDIR_LDFLAGS"
HOST_CC="$_SUBDIR_HOST_CC"
HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
RC=
if test -z "$direct_nspr_config"; then
dnl ========================================================
dnl = Setup a nice relatively clean build environment for
dnl = sub-configures.
dnl ========================================================
CC="$_SUBDIR_CC"
CXX="$_SUBDIR_CXX"
CFLAGS="$_SUBDIR_CFLAGS"
CPPFLAGS="$_SUBDIR_CPPFLAGS"
CXXFLAGS="$_SUBDIR_CXXFLAGS"
LDFLAGS="$_SUBDIR_LDFLAGS"
HOST_CC="$_SUBDIR_HOST_CC"
HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
RC=
fi
unset MAKEFILES
unset CONFIG_FILES
@ -8907,6 +9009,23 @@ if test -z "$MOZ_NATIVE_NSPR"; then
rm -f config/autoconf.mk.bak
fi
if test -n "$direct_nspr_config"; then
dnl ========================================================
dnl = Setup a nice relatively clean build environment for
dnl = sub-configures.
dnl ========================================================
CC="$_SUBDIR_CC"
CXX="$_SUBDIR_CXX"
CFLAGS="$_SUBDIR_CFLAGS"
CPPFLAGS="$_SUBDIR_CPPFLAGS"
CXXFLAGS="$_SUBDIR_CXXFLAGS"
LDFLAGS="$_SUBDIR_LDFLAGS"
HOST_CC="$_SUBDIR_HOST_CC"
HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
RC=
fi
# Run the SpiderMonkey 'configure' script.
dist=$MOZ_BUILD_ROOT/dist
ac_configure_args="$_SUBDIR_CONFIG_ARGS"

Просмотреть файл

@ -51,7 +51,7 @@ class nsIDocument;
[ptr] native nsINodePtr(nsINode);
[ptr] native nsIDocumentPtr(nsIDocument);
[scriptable, uuid(c0da5b87-0ba7-4d7c-8cb3-fcb02af4253d)]
[scriptable, uuid(82adaeca-63ee-44eb-830a-e1678bb8745e)]
interface nsIDocumentEncoderNodeFixup : nsISupports
{
/**
@ -272,6 +272,7 @@ interface nsIDocumentEncoder : nsISupports
* @param aNode The node to encode.
*/
void setNode(in nsIDOMNode aNode);
[noscript] void setNativeNode(in nsINodePtr aNode);
/**
* If the container is set to a non-null value, then its

Просмотреть файл

@ -301,6 +301,14 @@ nsDocumentEncoder::SetNode(nsIDOMNode* aNode)
return NS_OK;
}
NS_IMETHODIMP
nsDocumentEncoder::SetNativeNode(nsINode* aNode)
{
mNodeIsContainer = false;
mNode = aNode;
return NS_OK;
}
NS_IMETHODIMP
nsDocumentEncoder::SetContainerNode(nsIDOMNode *aContainer)
{

Просмотреть файл

@ -120,6 +120,7 @@
#include "nsPLDOMEvent.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/FromParser.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -665,15 +666,13 @@ nsGenericHTMLElement::GetOffsetParent(nsIDOMElement** aOffsetParent)
return NS_OK;
}
NS_IMETHODIMP
nsGenericHTMLElement::GetInnerHTML(nsAString& aInnerHTML)
nsresult
nsGenericHTMLElement::GetMarkup(bool aIncludeSelf, nsAString& aMarkup)
{
aInnerHTML.Truncate();
aMarkup.Truncate();
nsIDocument* doc = OwnerDoc();
nsresult rv = NS_OK;
nsAutoString contentType;
if (IsInHTMLDocument()) {
contentType.AssignLiteral("text/html");
@ -698,21 +697,37 @@ nsGenericHTMLElement::GetInnerHTML(nsAString& aInnerHTML)
NS_ENSURE_TRUE(docEncoder, NS_ERROR_FAILURE);
rv = docEncoder->NativeInit(doc, contentType,
nsIDocumentEncoder::OutputEncodeBasicEntities |
// Output DOM-standard newlines
nsIDocumentEncoder::OutputLFLineBreak |
// Don't do linebreaking that's not present in
// the source
nsIDocumentEncoder::OutputRaw);
nsresult rv = docEncoder->NativeInit(doc, contentType,
nsIDocumentEncoder::OutputEncodeBasicEntities |
// Output DOM-standard newlines
nsIDocumentEncoder::OutputLFLineBreak |
// Don't do linebreaking that's not present in
// the source
nsIDocumentEncoder::OutputRaw);
NS_ENSURE_SUCCESS(rv, rv);
docEncoder->SetNativeContainerNode(this);
rv = docEncoder->EncodeToString(aInnerHTML);
doc->SetCachedEncoder(docEncoder.forget());
if (aIncludeSelf) {
docEncoder->SetNativeNode(this);
} else {
docEncoder->SetNativeContainerNode(this);
}
rv = docEncoder->EncodeToString(aMarkup);
if (!aIncludeSelf) {
doc->SetCachedEncoder(docEncoder.forget());
}
return rv;
}
nsresult
nsGenericHTMLElement::GetInnerHTML(nsAString& aInnerHTML) {
return GetMarkup(false, aInnerHTML);
}
NS_IMETHODIMP
nsGenericHTMLElement::GetOuterHTML(nsAString& aOuterHTML) {
return GetMarkup(true, aOuterHTML);
}
void
nsGenericHTMLElement::FireMutationEventsForDirectParsing(nsIDocument* aDoc,
nsIContent* aDest,
@ -740,8 +755,6 @@ nsGenericHTMLElement::SetInnerHTML(const nsAString& aInnerHTML)
{
nsIDocument* doc = OwnerDoc();
nsresult rv = NS_OK;
// Batch possible DOMSubtreeModified events.
mozAutoSubtreeModified subtree(doc, nsnull);
@ -758,8 +771,7 @@ nsGenericHTMLElement::SetInnerHTML(const nsAString& aInnerHTML)
nsAutoScriptLoaderDisabler sld(doc);
nsCOMPtr<nsIDOMDocumentFragment> df;
nsresult rv = NS_OK;
if (doc->IsHTML()) {
PRInt32 oldChildCount = GetChildCount();
rv = nsContentUtils::ParseFragmentHTML(aInnerHTML,
@ -772,6 +784,7 @@ nsGenericHTMLElement::SetInnerHTML(const nsAString& aInnerHTML)
// HTML5 parser has notified, but not fired mutation events.
FireMutationEventsForDirectParsing(doc, this, oldChildCount);
} else {
nsCOMPtr<nsIDOMDocumentFragment> df;
rv = nsContentUtils::CreateContextualFragment(this, aInnerHTML,
true,
getter_AddRefs(df));
@ -789,6 +802,71 @@ nsGenericHTMLElement::SetInnerHTML(const nsAString& aInnerHTML)
return rv;
}
NS_IMETHODIMP
nsGenericHTMLElement::SetOuterHTML(const nsAString& aOuterHTML)
{
nsINode* parent = GetNodeParent();
if (!parent) {
return NS_OK;
}
if (parent->NodeType() == nsIDOMNode::DOCUMENT_NODE) {
return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR;
}
if (OwnerDoc()->IsHTML()) {
nsIAtom* localName;
PRInt32 namespaceID;
if (parent->IsElement()) {
localName = static_cast<nsIContent*>(parent)->Tag();
namespaceID = static_cast<nsIContent*>(parent)->GetNameSpaceID();
} else {
NS_ASSERTION(parent->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE,
"How come the parent isn't a document, a fragment or an element?");
localName = nsGkAtoms::body;
namespaceID = kNameSpaceID_XHTML;
}
nsCOMPtr<nsIDOMDocumentFragment> df;
nsresult rv = NS_NewDocumentFragment(getter_AddRefs(df),
OwnerDoc()->NodeInfoManager());
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIContent> fragment = do_QueryInterface(df);
nsContentUtils::ParseFragmentHTML(aOuterHTML,
fragment,
localName,
namespaceID,
OwnerDoc()->GetCompatibilityMode() ==
eCompatibility_NavQuirks,
PR_TRUE);
parent->ReplaceChild(fragment, this, &rv);
return rv;
}
nsCOMPtr<nsINode> context;
if (parent->IsElement()) {
context = parent;
} else {
NS_ASSERTION(parent->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE,
"How come the parent isn't a document, a fragment or an element?");
nsCOMPtr<nsINodeInfo> info =
OwnerDoc()->NodeInfoManager()->GetNodeInfo(nsGkAtoms::body,
nsnull,
kNameSpaceID_XHTML,
nsIDOMNode::ELEMENT_NODE);
context = NS_NewHTMLBodyElement(info.forget(), FROM_PARSER_FRAGMENT);
}
nsCOMPtr<nsIDOMDocumentFragment> df;
nsresult rv = nsContentUtils::CreateContextualFragment(context,
aOuterHTML,
PR_TRUE,
getter_AddRefs(df));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsINode> fragment = do_QueryInterface(df);
parent->ReplaceChild(fragment, this, &rv);
return rv;
}
enum nsAdjacentPosition {
eBeforeBegin,
eAfterBegin,

Просмотреть файл

@ -132,6 +132,8 @@ public:
nsresult GetOffsetParent(nsIDOMElement** aOffsetParent);
NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML);
NS_IMETHOD SetInnerHTML(const nsAString& aInnerHTML);
NS_IMETHOD GetOuterHTML(nsAString& aOuterHTML);
NS_IMETHOD SetOuterHTML(const nsAString& aOuterHTML);
NS_IMETHOD InsertAdjacentHTML(const nsAString& aPosition,
const nsAString& aText);
nsresult ScrollIntoView(bool aTop, PRUint8 optional_argc);
@ -161,6 +163,10 @@ public:
nsresult ClearDataset();
nsresult GetContextMenu(nsIDOMHTMLMenuElement** aContextMenu);
protected:
nsresult GetMarkup(bool aIncludeSelf, nsAString& aMarkup);
public:
// Implementation for nsIContent
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
@ -1571,6 +1577,12 @@ protected:
NS_SCRIPTABLE NS_IMETHOD SetSpellcheck(bool aSpellcheck) { \
return _to SetSpellcheck(aSpellcheck); \
} \
NS_SCRIPTABLE NS_IMETHOD GetOuterHTML(nsAString& aOuterHTML) { \
return _to GetOuterHTML(aOuterHTML); \
} \
NS_SCRIPTABLE NS_IMETHOD SetOuterHTML(const nsAString& aOuterHTML) { \
return _to SetOuterHTML(aOuterHTML); \
} \
NS_SCRIPTABLE NS_IMETHOD InsertAdjacentHTML(const nsAString& position, const nsAString& text) { \
return _to InsertAdjacentHTML(position, text); \
} \

Просмотреть файл

@ -501,8 +501,8 @@ nsHTMLCanvasElement::GetContext(const nsAString& aContextId,
JSObject *opts = JSVAL_TO_OBJECT(aContextOptions);
JSIdArray *props = JS_Enumerate(cx, opts);
for (int i = 0; props && i < props->length; ++i) {
jsid propid = props->vector[i];
for (int i = 0; props && i < JS_IdArrayLength(cx, props); ++i) {
jsid propid = JS_IdArrayGet(cx, props, i);
jsval propname, propval;
if (!JS_IdToValue(cx, propid, &propname) ||
!JS_GetPropertyById(cx, opts, propid, &propval))

Просмотреть файл

@ -395,7 +395,8 @@ nsHTMLDNSPrefetch::nsDeferrals::OnProgressChange(nsIWebProgress *aProgress,
NS_IMETHODIMP
nsHTMLDNSPrefetch::nsDeferrals::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location)
nsIURI *location,
PRUint32 aFlags)
{
return NS_OK;
}

Просмотреть файл

@ -1843,7 +1843,8 @@ nsHTMLFormElement::OnProgressChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
nsHTMLFormElement::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI* location)
nsIURI* location,
PRUint32 aFlags)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;

Просмотреть файл

@ -109,10 +109,7 @@ public:
// XXX These should go away eventually.
#define TxObject txObject
typedef txDouble Double;
typedef bool MBool;
#define MB_TRUE true
#define MB_FALSE false
// XXX
#endif

Просмотреть файл

@ -63,7 +63,7 @@ const dpun Double::NEGATIVE_INFINITY = {{0, DOUBLE_HI32_EXPMASK | DOUBLE_HI32_SI
* Determines whether the given double represents positive or negative
* inifinity
*/
MBool Double::isInfinite(double aDbl)
bool Double::isInfinite(double aDbl)
{
return ((DOUBLE_HI32(aDbl) & ~DOUBLE_HI32_SIGNBIT) == DOUBLE_HI32_EXPMASK &&
!DOUBLE_LO32(aDbl));
@ -72,7 +72,7 @@ MBool Double::isInfinite(double aDbl)
/*
* Determines whether the given double is NaN
*/
MBool Double::isNaN(double aDbl)
bool Double::isNaN(double aDbl)
{
return DOUBLE_IS_NaN(aDbl);
}
@ -80,7 +80,7 @@ MBool Double::isNaN(double aDbl)
/*
* Determines whether the given double is negative
*/
MBool Double::isNeg(double aDbl)
bool Double::isNeg(double aDbl)
{
return (DOUBLE_HI32(aDbl) & DOUBLE_HI32_SIGNBIT) != 0;
}

Просмотреть файл

@ -95,7 +95,7 @@ protected:
{
}
MBool next()
bool next()
{
return ++mCurrentPos < mMap.mItems.Length();
}

Просмотреть файл

@ -243,7 +243,7 @@ void txList::clear()
txListIterator::txListIterator(txList* list) {
this->list = list;
currentItem = 0;
atEndOfList = MB_FALSE;
atEndOfList = false;
} //-- txListIterator
/**
@ -276,11 +276,11 @@ nsresult txListIterator::addBefore(void* objPtr)
/**
* Returns true if a successful call to the next() method can be made
* @return MB_TRUE if a successful call to the next() method can be made,
* otherwise MB_FALSE
* @return true if a successful call to the next() method can be made,
* otherwise false
**/
MBool txListIterator::hasNext() {
MBool hasNext = MB_FALSE;
bool txListIterator::hasNext() {
bool hasNext = false;
if (currentItem)
hasNext = (currentItem->nextItem != 0);
else if (!atEndOfList)
@ -291,11 +291,11 @@ MBool txListIterator::hasNext() {
/**
* Returns true if a successful call to the previous() method can be made
* @return MB_TRUE if a successful call to the previous() method can be made,
* otherwise MB_FALSE
* @return true if a successful call to the previous() method can be made,
* otherwise false
**/
MBool txListIterator::hasPrevious() {
MBool hasPrevious = MB_FALSE;
bool txListIterator::hasPrevious() {
bool hasPrevious = false;
if (currentItem)
hasPrevious = (currentItem->prevItem != 0);
else if (atEndOfList)
@ -318,7 +318,7 @@ void* txListIterator::next() {
if (currentItem)
obj = currentItem->objPtr;
else
atEndOfList = MB_TRUE;
atEndOfList = true;
return obj;
} //-- next
@ -338,7 +338,7 @@ void* txListIterator::previous() {
if (currentItem)
obj = currentItem->objPtr;
atEndOfList = MB_FALSE;
atEndOfList = false;
return obj;
} //-- previous
@ -379,7 +379,7 @@ void* txListIterator::advance(int i) {
for (; currentItem && i < 0; i++)
currentItem = currentItem->prevItem;
atEndOfList = MB_FALSE;
atEndOfList = false;
}
if (currentItem)
@ -409,7 +409,7 @@ void* txListIterator::remove() {
* Resets the current location within the txList to the beginning of the txList
**/
void txListIterator::reset() {
atEndOfList = MB_FALSE;
atEndOfList = false;
currentItem = 0;
} //-- reset
@ -417,6 +417,6 @@ void txListIterator::reset() {
* Move the iterator to right after the last element
**/
void txListIterator::resetToEnd() {
atEndOfList = MB_TRUE;
atEndOfList = true;
currentItem = 0;
} //-- moveToEnd

Просмотреть файл

@ -161,17 +161,17 @@ public:
/**
* Returns true if a successful call to the next() method can be made
* @return MB_TRUE if a successful call to the next() method can be made,
* otherwise MB_FALSE
* @return true if a successful call to the next() method can be made,
* otherwise false
**/
MBool hasNext();
bool hasNext();
/**
* Returns true if a successful call to the previous() method can be made
* @return MB_TRUE if a successful call to the previous() method can be made,
* otherwise MB_FALSE
* @return true if a successful call to the previous() method can be made,
* otherwise false
**/
MBool hasPrevious();
bool hasPrevious();
/**
* Returns the next Object pointer from the list
@ -218,7 +218,7 @@ private:
txList* list;
//-- we've moved off the end of the list
MBool atEndOfList;
bool atEndOfList;
};
typedef txList List;

Просмотреть файл

@ -116,7 +116,7 @@ class Node : public TxObject
//Node manipulation functions
virtual Node* appendChild(Node* newChild) = 0;
virtual MBool hasChildNodes() const = 0;
virtual bool hasChildNodes() const = 0;
//From DOM3 26-Jan-2001 WD
virtual nsresult getBaseURI(nsAString& aURI) = 0;
@ -125,7 +125,7 @@ class Node : public TxObject
virtual nsresult getNamespaceURI(nsAString& aNSURI) = 0;
//txXPathNode functions
virtual MBool getLocalName(nsIAtom** aLocalName) = 0;
virtual bool getLocalName(nsIAtom** aLocalName) = 0;
virtual PRInt32 getNamespaceID() = 0;
virtual Node* getXPathParent() = 0;
virtual PRInt32 compareDocumentPosition(Node* aOther) = 0;
@ -156,7 +156,7 @@ class NodeDefinition : public Node
//Child node manipulation functions
virtual Node* appendChild(Node* newChild);
MBool hasChildNodes() const;
bool hasChildNodes() const;
//From DOM3 26-Jan-2001 WD
virtual nsresult getBaseURI(nsAString& aURI);
@ -165,7 +165,7 @@ class NodeDefinition : public Node
nsresult getNamespaceURI(nsAString& aNSURI);
//txXPathNode functions
virtual MBool getLocalName(nsIAtom** aLocalName);
virtual bool getLocalName(nsIAtom** aLocalName);
virtual PRInt32 getNamespaceID();
virtual Node* getXPathParent();
virtual PRInt32 compareDocumentPosition(Node* aOther);
@ -299,10 +299,10 @@ class Element : public NodeDefinition
//txXPathNode functions override
nsresult getNodeName(nsAString& aName) const;
MBool getLocalName(nsIAtom** aLocalName);
bool getLocalName(nsIAtom** aLocalName);
PRInt32 getNamespaceID();
MBool getAttr(nsIAtom* aLocalName, PRInt32 aNSID, nsAString& aValue);
MBool hasAttr(nsIAtom* aLocalName, PRInt32 aNSID);
bool getAttr(nsIAtom* aLocalName, PRInt32 aNSID, nsAString& aValue);
bool hasAttr(nsIAtom* aLocalName, PRInt32 aNSID);
// ID getter
bool getIDValue(nsAString& aValue);
@ -337,7 +337,7 @@ class Attr : public NodeDefinition
//txXPathNode functions override
nsresult getNodeName(nsAString& aName) const;
MBool getLocalName(nsIAtom** aLocalName);
bool getLocalName(nsIAtom** aLocalName);
PRInt32 getNamespaceID();
Node* getXPathParent();
bool equals(nsIAtom *aLocalName, PRInt32 aNamespaceID)
@ -373,7 +373,7 @@ class ProcessingInstruction : public NodeDefinition
{
public:
//txXPathNode functions override
MBool getLocalName(nsIAtom** aLocalName);
bool getLocalName(nsIAtom** aLocalName);
private:
friend class Document;
@ -415,15 +415,15 @@ public:
return NS_OK;
}
static MBool init()
static bool init()
{
NS_ASSERTION(!mNamespaces,
"called without matching shutdown()");
if (mNamespaces)
return MB_TRUE;
return true;
mNamespaces = new nsStringArray();
if (!mNamespaces)
return MB_FALSE;
return false;
/*
* Hardwiring some Namespace IDs.
* no Namespace is 0
@ -435,10 +435,10 @@ public:
!mNamespaces->AppendString(NS_LITERAL_STRING("http://www.w3.org/1999/XSL/Transform"))) {
delete mNamespaces;
mNamespaces = 0;
return MB_FALSE;
return false;
}
return MB_TRUE;
return true;
}
static void shutdown()

Просмотреть файл

@ -51,7 +51,7 @@
nsresult
txExpandedName::init(const nsAString& aQName, txNamespaceMap* aResolver,
MBool aUseDefault)
bool aUseDefault)
{
const nsAFlatString& qName = PromiseFlatString(aQName);
const PRUnichar* colon;
@ -230,7 +230,7 @@ void XMLUtils::normalizePIValue(nsAString& piValue)
}
//static
MBool XMLUtils::getXMLSpacePreserve(const txXPathNode& aNode)
bool XMLUtils::getXMLSpacePreserve(const txXPathNode& aNode)
{
nsAutoString value;
txXPathTreeWalker walker(aNode);

Просмотреть файл

@ -75,7 +75,7 @@ public:
}
nsresult init(const nsAString& aQName, txNamespaceMap* aResolver,
MBool aUseDefault);
bool aUseDefault);
void reset()
{
@ -95,13 +95,13 @@ public:
return *this;
}
MBool operator == (const txExpandedName& rhs) const
bool operator == (const txExpandedName& rhs) const
{
return ((mLocalName == rhs.mLocalName) &&
(mNamespaceID == rhs.mNamespaceID));
}
MBool operator != (const txExpandedName& rhs) const
bool operator != (const txExpandedName& rhs) const
{
return ((mLocalName != rhs.mLocalName) ||
(mNamespaceID != rhs.mNamespaceID));
@ -124,7 +124,7 @@ public:
/*
* Returns true if the given character is whitespace.
*/
static MBool isWhitespace(const PRUnichar& aChar)
static bool isWhitespace(const PRUnichar& aChar)
{
return (aChar <= ' ' &&
(aChar == ' ' || aChar == '\r' ||
@ -173,7 +173,7 @@ public:
* Walks up the document tree and returns true if the closest xml:space
* attribute is "preserve"
*/
static MBool getXMLSpacePreserve(const txXPathNode& aNode);
static bool getXMLSpacePreserve(const txXPathNode& aNode);
};
#endif

Просмотреть файл

@ -196,9 +196,9 @@ nsXPathExpression::EvalContextImpl::getVariable(PRInt32 aNamespace,
return NS_ERROR_INVALID_ARG;
}
MBool nsXPathExpression::EvalContextImpl::isStripSpaceAllowed(const txXPathNode& aNode)
bool nsXPathExpression::EvalContextImpl::isStripSpaceAllowed(const txXPathNode& aNode)
{
return MB_FALSE;
return false;
}
void* nsXPathExpression::EvalContextImpl::getPrivateContext()

Просмотреть файл

@ -43,8 +43,8 @@
#include "txExprResult.h"
/**
* Creates a new BooleanResult with the value of the given MBool parameter
* @param boolean the MBool to use for initialization of this BooleanResult's value
* Creates a new BooleanResult with the value of the given bool parameter
* @param boolean the bool to use for initialization of this BooleanResult's value
**/
BooleanResult::BooleanResult(bool boolean)
: txAExprResult(nsnull)
@ -80,7 +80,7 @@ BooleanResult::stringValuePointer()
return nsnull;
}
MBool BooleanResult::booleanValue() {
bool BooleanResult::booleanValue() {
return this->value;
} //-- toBoolean

Просмотреть файл

@ -303,23 +303,23 @@ txCoreFunctionCall::evaluate(txIEvalContext* aContext, txAExprResult** aResult)
rv = aContext->recycler()->getStringResult(getter_AddRefs(strRes));
NS_ENSURE_SUCCESS(rv, rv);
MBool addSpace = MB_FALSE;
MBool first = MB_TRUE;
bool addSpace = false;
bool first = true;
strRes->mValue.SetCapacity(resultStr.Length());
PRUnichar c;
PRUint32 src;
for (src = 0; src < resultStr.Length(); src++) {
c = resultStr.CharAt(src);
if (XMLUtils::isWhitespace(c)) {
addSpace = MB_TRUE;
addSpace = true;
}
else {
if (addSpace && !first)
strRes->mValue.Append(PRUnichar(' '));
strRes->mValue.Append(c);
addSpace = MB_FALSE;
first = MB_FALSE;
addSpace = false;
first = false;
}
}
*aResult = strRes;

Просмотреть файл

@ -302,7 +302,7 @@ txExprParser::createExpr(txExprLexer& lexer, txIParseContext* aContext,
*aResult = nsnull;
nsresult rv = NS_OK;
MBool done = MB_FALSE;
bool done = false;
nsAutoPtr<Expr> expr;

Просмотреть файл

@ -122,7 +122,7 @@ protected:
static nsresult resolveQName(const nsAString& aQName, nsIAtom** aPrefix,
txIParseContext* aContext,
nsIAtom** aLocalName, PRInt32& aNamespace,
bool aIsNameTest = MB_FALSE);
bool aIsNameTest = false);
/**
* Using the given lexer, parses the tokens if they represent a

Просмотреть файл

@ -104,10 +104,10 @@ public:
virtual const nsString* stringValuePointer() = 0;
/**
* Converts this ExprResult to a Boolean (MBool) value
* Converts this ExprResult to a Boolean (bool) value
* @return the Boolean value
**/
virtual MBool booleanValue() = 0;
virtual bool booleanValue() = 0;
/**
* Converts this ExprResult to a Number (double) value
@ -131,12 +131,12 @@ private:
class BooleanResult : public txAExprResult {
public:
BooleanResult(MBool aValue);
BooleanResult(bool aValue);
TX_DECL_EXPRRESULT
private:
MBool value;
bool value;
};
class NumberResult : public txAExprResult {

Просмотреть файл

@ -63,7 +63,7 @@ nsresult txForwardContext::getVariable(PRInt32 aNamespace, nsIAtom* aLName,
return mInner->getVariable(aNamespace, aLName, aResult);
}
MBool txForwardContext::isStripSpaceAllowed(const txXPathNode& aNode)
bool txForwardContext::isStripSpaceAllowed(const txXPathNode& aNode)
{
NS_ASSERTION(mInner, "mInner is null!!!");
return mInner->isStripSpaceAllowed(aNode);

Просмотреть файл

@ -113,7 +113,7 @@ public:
* Is whitespace stripping allowed for the given node?
* See http://www.w3.org/TR/xslt#strip
*/
virtual MBool isStripSpaceAllowed(const txXPathNode& aNode) = 0;
virtual bool isStripSpaceAllowed(const txXPathNode& aNode) = 0;
/**
* Returns a pointer to the private context
@ -131,7 +131,7 @@ public:
#define TX_DECL_MATCH_CONTEXT \
nsresult getVariable(PRInt32 aNamespace, nsIAtom* aLName, \
txAExprResult*& aResult); \
MBool isStripSpaceAllowed(const txXPathNode& aNode); \
bool isStripSpaceAllowed(const txXPathNode& aNode); \
void* getPrivateContext(); \
txResultRecycler* recycler(); \
void receiveError(const nsAString& aMsg, nsresult aRes)

Просмотреть файл

@ -69,18 +69,18 @@ bool txNameTest::matches(const txXPathNode& aNode, txIMatchContext* aContext)
// Totally wild?
if (mLocalName == nsGkAtoms::_asterix && !mPrefix)
return MB_TRUE;
return true;
// Compare namespaces
if (mNamespace != txXPathNodeUtils::getNamespaceID(aNode)
&& !(mNamespace == kNameSpaceID_None &&
txXPathNodeUtils::isHTMLElementInHTMLDocument(aNode))
)
return MB_FALSE;
return false;
// Name wild?
if (mLocalName == nsGkAtoms::_asterix)
return MB_TRUE;
return true;
// Compare local-names
return txXPathNodeUtils::localNameEquals(aNode, mLocalName);

Просмотреть файл

@ -62,7 +62,7 @@ nsresult txNodeSetContext::getVariable(PRInt32 aNamespace, nsIAtom* aLName,
return mInner->getVariable(aNamespace, aLName, aResult);
}
MBool txNodeSetContext::isStripSpaceAllowed(const txXPathNode& aNode)
bool txNodeSetContext::isStripSpaceAllowed(const txXPathNode& aNode)
{
NS_ASSERTION(mInner, "mInner is null!!!");
return mInner->isStripSpaceAllowed(aNode);

Просмотреть файл

@ -52,7 +52,7 @@ public:
}
// Iteration over the given NodeSet
MBool hasNext()
bool hasNext()
{
return mPosition < size();
}

Просмотреть файл

@ -76,11 +76,11 @@ NumberResult::stringValuePointer()
return nsnull;
}
MBool NumberResult::booleanValue() {
bool NumberResult::booleanValue() {
// OG+
// As per the XPath spec, the boolean value of a number is true if and only if
// it is neither positive 0 nor negative 0 nor NaN
return (MBool)(value != 0.0 && !Double::isNaN(value));
return (bool)(value != 0.0 && !Double::isNaN(value));
// OG-
} //-- booleanValue

Просмотреть файл

@ -193,7 +193,7 @@ PathExpr::evalDescendants(Expr* aStep, const txXPathNode& aNode,
resNodes->addAndTransfer(newSet);
MBool filterWS = aContext->isStripSpaceAllowed(aNode);
bool filterWS = aContext->isStripSpaceAllowed(aNode);
txXPathTreeWalker walker(aNode);
if (!walker.moveToFirstChild()) {

Просмотреть файл

@ -59,7 +59,7 @@ public:
return mInner->getVariable(aNamespace, aLName, aResult);
}
MBool isStripSpaceAllowed(const txXPathNode& aNode)
bool isStripSpaceAllowed(const txXPathNode& aNode)
{
NS_ASSERTION(mInner, "mInner is null!!!");
return mInner->isStripSpaceAllowed(aNode);

Просмотреть файл

@ -79,7 +79,7 @@ StringResult::stringValuePointer()
return &mValue;
}
MBool StringResult::booleanValue() {
bool StringResult::booleanValue() {
return !mValue.IsEmpty();
} //-- booleanValue

Просмотреть файл

@ -121,7 +121,7 @@ DocumentFunctionCall::evaluate(txIEvalContext* aContext,
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString baseURI;
MBool baseURISet = MB_FALSE;
bool baseURISet = false;
if (mParams.Length() == 2) {
// We have 2 arguments, get baseURI from the first node
@ -134,7 +134,7 @@ DocumentFunctionCall::evaluate(txIEvalContext* aContext,
// Make this true, even if nodeSet2 is empty. For relative URLs,
// we'll fail to load the document with an empty base URI, and for
// absolute URLs, the base URI doesn't matter
baseURISet = MB_TRUE;
baseURISet = true;
if (!nodeSet2->isEmpty()) {
txXPathNodeUtils::getBaseURI(nodeSet2->get(0), baseURI);

Просмотреть файл

@ -96,7 +96,7 @@ txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext,
rv = mParams[2]->evaluateToString(aContext, formatQName);
NS_ENSURE_SUCCESS(rv, rv);
rv = formatName.init(formatQName, mMappings, MB_FALSE);
rv = formatName.init(formatQName, mMappings, false);
NS_ENSURE_SUCCESS(rv, rv);
}
@ -139,10 +139,10 @@ txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext,
PRUint32 pos = 0;
PRUint32 formatLen = formatStr.Length();
MBool inQuote;
bool inQuote;
// Get right subexpression
inQuote = MB_FALSE;
inQuote = false;
if (Double::isNeg(value)) {
while (pos < formatLen &&
(inQuote ||
@ -162,7 +162,7 @@ txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext,
// Parse the format string
FormatParseState pState = Prefix;
inQuote = MB_FALSE;
inQuote = false;
PRUnichar c = 0;
while (pos < formatLen && pState != Finished) {
@ -327,8 +327,8 @@ txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext,
(intDigits-1)/groupSize); // group separators
PRInt32 i = bufIntDigits + maxFractionSize - 1;
MBool carry = (i+1 < buflen) && (buf[i+1] >= '5');
MBool hasFraction = MB_FALSE;
bool carry = (i+1 < buflen) && (buf[i+1] >= '5');
bool hasFraction = false;
PRUint32 resPos = res.Length()-1;
@ -348,7 +348,7 @@ txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext,
}
if (hasFraction || digit != 0 || i < bufIntDigits+minFractionSize) {
hasFraction = MB_TRUE;
hasFraction = true;
res.SetCharAt((PRUnichar)(digit + format->mZeroDigit),
resPos--);
}
@ -448,7 +448,7 @@ txDecimalFormat::txDecimalFormat() : mInfinity(NS_LITERAL_STRING("Infinity")),
mPatternSeparator = ';';
}
MBool txDecimalFormat::isEqual(txDecimalFormat* other)
bool txDecimalFormat::isEqual(txDecimalFormat* other)
{
return mDecimalSeparator == other->mDecimalSeparator &&
mGroupingSeparator == other->mGroupingSeparator &&

Просмотреть файл

@ -78,14 +78,14 @@ txNodeSorter::addSortElement(Expr* aSelectExpr, Expr* aLangExpr,
key->mExpr = aSelectExpr;
// Order
MBool ascending = MB_TRUE;
bool ascending = true;
if (aOrderExpr) {
nsAutoString attrValue;
rv = aOrderExpr->evaluateToString(aContext, attrValue);
NS_ENSURE_SUCCESS(rv, rv);
if (TX_StringEqualsAtom(attrValue, nsGkAtoms::descending)) {
ascending = MB_FALSE;
ascending = false;
}
else if (!TX_StringEqualsAtom(attrValue, nsGkAtoms::ascending)) {
// XXX ErrorReport: unknown value for order attribute
@ -112,7 +112,7 @@ txNodeSorter::addSortElement(Expr* aSelectExpr, Expr* aLangExpr,
}
// Case-order
MBool upperFirst = false;
bool upperFirst = false;
if (aCaseOrderExpr) {
nsAutoString attrValue;

Просмотреть файл

@ -139,21 +139,21 @@ nsresult txPatternParser::createLocPathPattern(txExprLexer& aLexer,
{
nsresult rv = NS_OK;
MBool isChild = MB_TRUE;
MBool isAbsolute = MB_FALSE;
bool isChild = true;
bool isAbsolute = false;
txPattern* stepPattern = 0;
txLocPathPattern* pathPattern = 0;
Token::Type type = aLexer.peek()->mType;
switch (type) {
case Token::ANCESTOR_OP:
isChild = MB_FALSE;
isAbsolute = MB_TRUE;
isChild = false;
isAbsolute = true;
aLexer.nextToken();
break;
case Token::PARENT_OP:
aLexer.nextToken();
isAbsolute = MB_TRUE;
isAbsolute = true;
if (aLexer.peek()->mType == Token::END ||
aLexer.peek()->mType == Token::UNION_OP) {
aPattern = new txRootPattern();
@ -299,11 +299,11 @@ nsresult txPatternParser::createStepPattern(txExprLexer& aLexer,
txPattern*& aPattern)
{
nsresult rv = NS_OK;
MBool isAttr = MB_FALSE;
bool isAttr = false;
Token* tok = aLexer.peek();
if (tok->mType == Token::AXIS_IDENTIFIER) {
if (TX_StringEqualsAtom(tok->Value(), nsGkAtoms::attribute)) {
isAttr = MB_TRUE;
isAttr = true;
}
else if (!TX_StringEqualsAtom(tok->Value(), nsGkAtoms::child)) {
// all done already for CHILD_AXIS, for all others
@ -314,7 +314,7 @@ nsresult txPatternParser::createStepPattern(txExprLexer& aLexer,
}
else if (tok->mType == Token::AT_SIGN) {
aLexer.nextToken();
isAttr = MB_TRUE;
isAttr = true;
}
tok = aLexer.nextToken();

Просмотреть файл

@ -192,17 +192,17 @@ private:
class txStripSpaceTest {
public:
txStripSpaceTest(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID,
MBool stripSpace)
bool stripSpace)
: mNameTest(aPrefix, aLocalName, aNSID, txXPathNodeType::ELEMENT_NODE),
mStrips(stripSpace)
{
}
MBool matches(const txXPathNode& aNode, txIMatchContext* aContext) {
bool matches(const txXPathNode& aNode, txIMatchContext* aContext) {
return mNameTest.matches(aNode, aContext);
}
MBool stripsSpace() {
bool stripsSpace() {
return mStrips;
}
@ -212,7 +212,7 @@ public:
protected:
txNameTest mNameTest;
MBool mStrips;
bool mStrips;
};
/**

Просмотреть файл

@ -1367,7 +1367,7 @@ txFnText(const nsAString& aStr, txStylesheetCompilerState& aState)
{
TX_RETURN_IF_WHITESPACE(aStr, aState);
nsAutoPtr<txInstruction> instr(new txText(aStr, MB_FALSE));
nsAutoPtr<txInstruction> instr(new txText(aStr, false));
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
nsresult rv = aState.addInstruction(instr);
@ -2413,7 +2413,7 @@ txFnStartText(PRInt32 aNamespaceID,
static nsresult
txFnEndText(txStylesheetCompilerState& aState)
{
aState.mDOE = MB_FALSE;
aState.mDOE = false;
aState.popHandlerTable();
return NS_OK;
}
@ -3044,7 +3044,7 @@ txHandlerTable::find(PRInt32 aNamespaceID, nsIAtom* aLocalName)
gTx##_name##Handler = nsnull
// static
MBool
bool
txHandlerTable::init()
{
nsresult rv = NS_OK;
@ -3066,7 +3066,7 @@ txHandlerTable::init()
INIT_HANDLER_WITH_ELEMENT_HANDLERS(AttributeSet);
INIT_HANDLER_WITH_ELEMENT_HANDLERS(Fallback);
return MB_TRUE;
return true;
}
// static

Просмотреть файл

@ -75,7 +75,7 @@ public:
const HandleTextFn mTextHandler;
const txElementHandler* const mLREHandler;
static MBool init();
static bool init();
static void shutdown();
private:

Просмотреть файл

@ -227,10 +227,10 @@ txStylesheetCompiler::startElementInternal(PRInt32 aNamespaceID,
NS_ENSURE_SUCCESS(rv, rv);
if (TX_StringEqualsAtom(attr->mValue, nsGkAtoms::preserve)) {
mElementContext->mPreserveWhitespace = MB_TRUE;
mElementContext->mPreserveWhitespace = true;
}
else if (TX_StringEqualsAtom(attr->mValue, nsGkAtoms::_default)) {
mElementContext->mPreserveWhitespace = MB_FALSE;
mElementContext->mPreserveWhitespace = false;
}
else {
return NS_ERROR_XSLT_PARSE_FAILURE;
@ -291,20 +291,20 @@ txStylesheetCompiler::startElementInternal(PRInt32 aNamespaceID,
NS_ENSURE_SUCCESS(rv, rv);
if (attr->mValue.EqualsLiteral("1.0")) {
mElementContext->mForwardsCompatibleParsing = MB_FALSE;
mElementContext->mForwardsCompatibleParsing = false;
}
else {
mElementContext->mForwardsCompatibleParsing = MB_TRUE;
mElementContext->mForwardsCompatibleParsing = true;
}
}
}
// Find the right elementhandler and execute it
MBool isInstruction = MB_FALSE;
bool isInstruction = false;
PRInt32 count = mElementContext->mInstructionNamespaces.Length();
for (i = 0; i < count; ++i) {
if (mElementContext->mInstructionNamespaces[i] == aNamespaceID) {
isInstruction = MB_TRUE;
isInstruction = true;
break;
}
}

Просмотреть файл

@ -39,7 +39,7 @@
#include "txTextHandler.h"
#include "nsAString.h"
txTextHandler::txTextHandler(MBool aOnlyText) : mLevel(0),
txTextHandler::txTextHandler(bool aOnlyText) : mLevel(0),
mOnlyText(aOnlyText)
{
}

Просмотреть файл

@ -45,7 +45,7 @@
class txTextHandler : public txAXMLEventHandler
{
public:
txTextHandler(MBool aOnlyText);
txTextHandler(bool aOnlyText);
TX_DECL_TXAXMLEVENTHANDLER
@ -53,7 +53,7 @@ public:
private:
PRUint32 mLevel;
MBool mOnlyText;
bool mOnlyText;
};
#endif

Просмотреть файл

@ -50,8 +50,8 @@
#define kAscending (1<<0)
#define kUpperFirst (1<<1)
txResultStringComparator::txResultStringComparator(MBool aAscending,
MBool aUpperFirst,
txResultStringComparator::txResultStringComparator(bool aAscending,
bool aUpperFirst,
const nsAFlatString& aLanguage)
{
mSorting = 0;
@ -215,7 +215,7 @@ txResultStringComparator::StringValue::~StringValue()
delete (nsString*)mCaseKey;
}
txResultNumberComparator::txResultNumberComparator(MBool aAscending)
txResultNumberComparator::txResultNumberComparator(bool aAscending)
{
mAscending = aAscending ? 1 : -1;
}

Просмотреть файл

@ -77,7 +77,7 @@ public:
class txResultStringComparator : public txXPathResultComparator
{
public:
txResultStringComparator(MBool aAscending, MBool aUpperFirst,
txResultStringComparator(bool aAscending, bool aUpperFirst,
const nsAFlatString& aLanguage);
int compareValues(TxObject* aVal1, TxObject* aVal2);
@ -110,7 +110,7 @@ private:
class txResultNumberComparator : public txXPathResultComparator
{
public:
txResultNumberComparator(MBool aAscending);
txResultNumberComparator(bool aAscending);
int compareValues(TxObject* aVal1, TxObject* aVal2);
nsresult createSortableValue(Expr *aExpr, txIEvalContext *aContext,

Просмотреть файл

@ -127,7 +127,7 @@ public:
* default values
*/
txDecimalFormat();
MBool isEqual(txDecimalFormat* other);
bool isEqual(txDecimalFormat* other);
PRUnichar mDecimalSeparator;
PRUnichar mGroupingSeparator;

Просмотреть файл

@ -76,7 +76,7 @@ nsresult txXSLTNumber::createNumber(Expr* aValueExpr, txPattern* aCountPattern,
// Create resulting string
aResult = head;
MBool first = MB_TRUE;
bool first = true;
txListIterator valueIter(&values);
txListIterator counterIter(&counters);
valueIter.resetToEnd();
@ -92,7 +92,7 @@ nsresult txXSLTNumber::createNumber(Expr* aValueExpr, txPattern* aCountPattern,
}
counter->appendNumber(value, aResult);
first = MB_FALSE;
first = false;
}
aResult.Append(tail);
@ -136,13 +136,13 @@ txXSLTNumber::getValueList(Expr* aValueExpr, txPattern* aCountPattern,
// Otherwise use count/from/level
txPattern* countPattern = aCountPattern;
MBool ownsCountPattern = MB_FALSE;
bool ownsCountPattern = false;
const txXPathNode& currNode = aContext->getContextNode();
// Parse count- and from-attributes
if (!aCountPattern) {
ownsCountPattern = MB_TRUE;
ownsCountPattern = true;
txNodeTest* nodeTest;
PRUint16 nodeType = txXPathNodeUtils::getNodeType(currNode);
switch (nodeType) {
@ -191,7 +191,7 @@ txXSLTNumber::getValueList(Expr* aValueExpr, txPattern* aCountPattern,
}
NS_ENSURE_TRUE(nodeTest, NS_ERROR_OUT_OF_MEMORY);
countPattern = new txStepPattern(nodeTest, MB_FALSE);
countPattern = new txStepPattern(nodeTest, false);
if (!countPattern) {
// XXX error reporting
delete nodeTest;
@ -239,12 +239,12 @@ txXSLTNumber::getValueList(Expr* aValueExpr, txPattern* aCountPattern,
else if (aLevel == eLevelMultiple) {
// find all ancestor-or-selfs that matches count until...
txXPathTreeWalker walker(currNode);
MBool matchedFrom = MB_FALSE;
bool matchedFrom = false;
do {
if (aFromPattern && !walker.isOnNode(currNode) &&
aFromPattern->matches(walker.getCurrentPosition(), aContext)) {
//... we find one that matches from
matchedFrom = MB_TRUE;
matchedFrom = true;
break;
}
@ -264,13 +264,13 @@ txXSLTNumber::getValueList(Expr* aValueExpr, txPattern* aCountPattern,
// level = "any"
else if (aLevel == eLevelAny) {
PRInt32 value = 0;
MBool matchedFrom = MB_FALSE;
bool matchedFrom = false;
txXPathTreeWalker walker(currNode);
do {
if (aFromPattern && !walker.isOnNode(currNode) &&
aFromPattern->matches(walker.getCurrentPosition(), aContext)) {
matchedFrom = MB_TRUE;
matchedFrom = true;
break;
}
@ -450,12 +450,12 @@ txXSLTNumber::getPrevInDocumentOrder(txXPathTreeWalker& aWalker)
return aWalker.moveToParent();
}
#define TX_CHAR_RANGE(ch, a, b) if (ch < a) return MB_FALSE; \
if (ch <= b) return MB_TRUE
#define TX_MATCH_CHAR(ch, a) if (ch < a) return MB_FALSE; \
if (ch == a) return MB_TRUE
#define TX_CHAR_RANGE(ch, a, b) if (ch < a) return false; \
if (ch <= b) return true
#define TX_MATCH_CHAR(ch, a) if (ch < a) return false; \
if (ch == a) return true
MBool txXSLTNumber::isAlphaNumeric(PRUnichar ch)
bool txXSLTNumber::isAlphaNumeric(PRUnichar ch)
{
TX_CHAR_RANGE(ch, 0x0030, 0x0039);
TX_CHAR_RANGE(ch, 0x0041, 0x005A);
@ -747,5 +747,5 @@ MBool txXSLTNumber::isAlphaNumeric(PRUnichar ch)
TX_CHAR_RANGE(ch, 0xFFC2, 0xFFC7);
TX_CHAR_RANGE(ch, 0xFFCA, 0xFFCF);
TX_CHAR_RANGE(ch, 0xFFD2, 0xFFD7);
return MB_FALSE;
return false;
}

Просмотреть файл

@ -85,7 +85,7 @@ private:
static bool getPrevInDocumentOrder(txXPathTreeWalker& aWalker);
static MBool isAlphaNumeric(PRUnichar ch);
static bool isAlphaNumeric(PRUnichar ch);
};
class txFormattedCounter {

Просмотреть файл

@ -71,7 +71,7 @@ private:
class txRomanCounter : public txFormattedCounter {
public:
txRomanCounter(MBool aUpper) : mTableOffset(aUpper ? 30 : 0)
txRomanCounter(bool aUpper) : mTableOffset(aUpper ? 30 : 0)
{
}

Просмотреть файл

@ -63,15 +63,15 @@ double txUnionPattern::getDefaultPriority()
* This should be called on the simple patterns for xsl:template,
* but is fine for xsl:key and xsl:number
*/
MBool txUnionPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
bool txUnionPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
{
PRUint32 i, len = mLocPathPatterns.Length();
for (i = 0; i < len; ++i) {
if (mLocPathPatterns[i]->matches(aNode, aContext)) {
return MB_TRUE;
return true;
}
}
return MB_FALSE;
return false;
}
txPattern::Type
@ -134,7 +134,7 @@ nsresult txLocPathPattern::addStep(txPattern* aPattern, bool isChild)
return NS_OK;
}
MBool txLocPathPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
bool txLocPathPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
{
NS_ASSERTION(mSteps.Length() > 1, "Internal error");
@ -153,17 +153,17 @@ MBool txLocPathPattern::matches(const txXPathNode& aNode, txIMatchContext* aCont
PRUint32 pos = mSteps.Length();
Step* step = &mSteps[--pos];
if (!step->pattern->matches(aNode, aContext))
return MB_FALSE;
return false;
txXPathTreeWalker walker(aNode);
bool hasParent = walker.moveToParent();
while (step->isChild) {
if (!pos)
return MB_TRUE; // all steps matched
return true; // all steps matched
step = &mSteps[--pos];
if (!hasParent || !step->pattern->matches(walker.getCurrentPosition(), aContext))
return MB_FALSE; // no more ancestors or no match
return false; // no more ancestors or no match
hasParent = walker.moveToParent();
}
@ -174,7 +174,7 @@ MBool txLocPathPattern::matches(const txXPathNode& aNode, txIMatchContext* aCont
while (pos) {
if (!hasParent)
return MB_FALSE; // There are more steps in the current block
return false; // There are more steps in the current block
// than ancestors of the tested node
step = &mSteps[--pos];
@ -195,7 +195,7 @@ MBool txLocPathPattern::matches(const txXPathNode& aNode, txIMatchContext* aCont
}
}
return MB_TRUE;
return true;
} // txLocPathPattern::matches
double txLocPathPattern::getDefaultPriority()
@ -249,7 +249,7 @@ txLocPathPattern::toString(nsAString& aDest)
* a txPattern matching the document node, or '/'
*/
MBool txRootPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
bool txRootPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
{
return txXPathNodeUtils::isRoot(aNode);
}
@ -295,7 +295,7 @@ txIdPattern::txIdPattern(const nsSubstring& aString)
}
}
MBool txIdPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
bool txIdPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
{
if (!txXPathNodeUtils::isElement(aNode)) {
return false;
@ -351,7 +351,7 @@ txIdPattern::toString(nsAString& aDest)
* argument.
*/
MBool txKeyPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
bool txKeyPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
{
txExecutionState* es = (txExecutionState*)aContext->getPrivateContext();
nsAutoPtr<txXPathNode> contextDoc(txXPathNodeUtils::getOwnerDocument(aNode));
@ -404,21 +404,21 @@ txKeyPattern::toString(nsAString& aDest)
* a txPattern to hold the NodeTest and the Predicates of a StepPattern
*/
MBool txStepPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
bool txStepPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext)
{
NS_ASSERTION(mNodeTest, "Internal error");
if (!mNodeTest->matches(aNode, aContext))
return MB_FALSE;
return false;
txXPathTreeWalker walker(aNode);
if ((!mIsAttr &&
txXPathNodeUtils::isAttribute(walker.getCurrentPosition())) ||
!walker.moveToParent()) {
return MB_FALSE;
return false;
}
if (isEmpty()) {
return MB_TRUE;
return true;
}
/*
@ -431,7 +431,7 @@ MBool txStepPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext
* if the result is a number, check the context position,
* otherwise convert to bool
* if result is true, copy node to newNodes
* if aNode is not member of newNodes, return MB_FALSE
* if aNode is not member of newNodes, return false
* nodes = newNodes
*
* For the last Predicate, evaluate Predicate with aNode as
@ -442,7 +442,7 @@ MBool txStepPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext
// Create the context node set for evaluating the predicates
nsRefPtr<txNodeSet> nodes;
nsresult rv = aContext->recycler()->getNodeSet(getter_AddRefs(nodes));
NS_ENSURE_SUCCESS(rv, MB_FALSE);
NS_ENSURE_SUCCESS(rv, false);
bool hasNext = mIsAttr ? walker.moveToFirstAttribute() :
walker.moveToFirstChild();
@ -457,12 +457,12 @@ MBool txStepPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext
Expr* predicate = mPredicates[0];
nsRefPtr<txNodeSet> newNodes;
rv = aContext->recycler()->getNodeSet(getter_AddRefs(newNodes));
NS_ENSURE_SUCCESS(rv, MB_FALSE);
NS_ENSURE_SUCCESS(rv, false);
PRUint32 i, predLen = mPredicates.Length();
for (i = 1; i < predLen; ++i) {
newNodes->clear();
MBool contextIsInPredicate = MB_FALSE;
bool contextIsInPredicate = false;
txNodeSetContext predContext(nodes, aContext);
while (predContext.hasNext()) {
predContext.next();
@ -477,7 +477,7 @@ MBool txStepPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext
exprResult->numberValue()) {
const txXPathNode& tmp = predContext.getContextNode();
if (tmp == aNode)
contextIsInPredicate = MB_TRUE;
contextIsInPredicate = true;
newNodes->append(tmp);
}
break;
@ -485,7 +485,7 @@ MBool txStepPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext
if (exprResult->booleanValue()) {
const txXPathNode& tmp = predContext.getContextNode();
if (tmp == aNode)
contextIsInPredicate = MB_TRUE;
contextIsInPredicate = true;
newNodes->append(tmp);
}
break;
@ -495,7 +495,7 @@ MBool txStepPattern::matches(const txXPathNode& aNode, txIMatchContext* aContext
nodes->clear();
nodes->append(*newNodes);
if (!contextIsInPredicate) {
return MB_FALSE;
return false;
}
predicate = mPredicates[i];
}

Просмотреть файл

@ -59,7 +59,7 @@ public:
/*
* Determines whether this Pattern matches the given node.
*/
virtual MBool matches(const txXPathNode& aNode,
virtual bool matches(const txXPathNode& aNode,
txIMatchContext* aContext) = 0;
/*
@ -119,7 +119,7 @@ public:
};
#define TX_DECL_PATTERN_BASE \
MBool matches(const txXPathNode& aNode, txIMatchContext* aContext); \
bool matches(const txXPathNode& aNode, txIMatchContext* aContext); \
double getDefaultPriority(); \
virtual Expr* getSubExprAt(PRUint32 aPos); \
virtual void setSubExprAt(PRUint32 aPos, Expr* aExpr); \

Просмотреть файл

@ -48,19 +48,19 @@
TX_LG_IMPL
/* static */
MBool
bool
txXSLTProcessor::init()
{
TX_LG_CREATE;
if (!txHandlerTable::init())
return MB_FALSE;
return false;
extern bool TX_InitEXSLTFunction();
if (!TX_InitEXSLTFunction())
return MB_FALSE;
return false;
return MB_TRUE;
return true;
}
/* static */

Просмотреть файл

@ -48,7 +48,7 @@ public:
* Initialisation and shutdown routines. Initilizes and cleansup all
* dependant classes
*/
static MBool init();
static bool init();
static void shutdown();

Просмотреть файл

@ -221,7 +221,7 @@ runItem.prototype =
onProgressChange: function(aProg, b,c,d,e,f)
{
},
onLocationChange: function(aProg, aRequest, aURI)
onLocationChange: function(aProg, aRequest, aURI, aFlags)
{
},
onStatusChange: function(aProg, aRequest, aStatus, aMessage)

Просмотреть файл

@ -79,7 +79,6 @@ endif # WINNT
LOCAL_INCLUDES = -I$(srcdir)/../include
FORCE_STATIC_LIB = 1
FORCE_USE_PIC = 1
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -1770,17 +1770,19 @@ nsDocShell::GetChromeEventHandler(nsIDOMEventTarget** aChromeEventHandler)
return NS_OK;
}
/* [noscript] void setCurrentURI (in nsIURI uri); */
/* void setCurrentURI (in nsIURI uri); */
NS_IMETHODIMP
nsDocShell::SetCurrentURI(nsIURI *aURI)
{
SetCurrentURI(aURI, nsnull, true);
// Note that securityUI will set STATE_IS_INSECURE, even if
// the scheme of |aURI| is "https".
SetCurrentURI(aURI, nsnull, true, 0);
return NS_OK;
}
bool
nsDocShell::SetCurrentURI(nsIURI *aURI, nsIRequest *aRequest,
bool aFireOnLocationChange)
bool aFireOnLocationChange, PRUint32 aLocationFlags)
{
#ifdef PR_LOGGING
if (gDocShellLeakLog && PR_LOG_TEST(gDocShellLeakLog, PR_LOG_DEBUG)) {
@ -1824,7 +1826,7 @@ nsDocShell::SetCurrentURI(nsIURI *aURI, nsIRequest *aRequest,
}
if (aFireOnLocationChange) {
FireOnLocationChange(this, aRequest, aURI);
FireOnLocationChange(this, aRequest, aURI, aLocationFlags);
}
return !aFireOnLocationChange;
}
@ -5928,7 +5930,7 @@ nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest,
// a new DOM here.
rv = AddToSessionHistory(uri, wcwgChannel, nsnull, false,
getter_AddRefs(mLSHE));
SetCurrentURI(uri, aRequest, true);
SetCurrentURI(uri, aRequest, true, 0);
// Save history state of the previous page
rv = PersistLayoutHistoryState();
// We'll never get an Embed() for this load, so just go ahead
@ -5984,8 +5986,8 @@ nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest,
}
NS_IMETHODIMP
nsDocShell::OnLocationChange(nsIWebProgress * aProgress,
nsIRequest * aRequest, nsIURI * aURI)
nsDocShell::OnLocationChange(nsIWebProgress * aProgress, nsIRequest * aRequest,
nsIURI * aURI, PRUint32 aFlags)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
@ -6515,7 +6517,7 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
viewer->SetContainer(static_cast<nsIContentViewerContainer *>(this));
Embed(viewer, "", 0);
SetCurrentURI(blankDoc->GetDocumentURI(), nsnull, true);
SetCurrentURI(blankDoc->GetDocumentURI(), nsnull, true, 0);
rv = mIsBeingDestroyed ? NS_ERROR_NOT_AVAILABLE : NS_OK;
}
}
@ -7166,7 +7168,7 @@ nsDocShell::RestoreFromHistory()
// is still mLSHE or whether it's now mOSHE.
nsCOMPtr<nsIURI> uri;
origLSHE->GetURI(getter_AddRefs(uri));
SetCurrentURI(uri, document->GetChannel(), true);
SetCurrentURI(uri, document->GetChannel(), true, 0);
}
// This is the end of our CreateContentViewer() replacement.
@ -7505,7 +7507,7 @@ nsDocShell::CreateContentViewer(const char *aContentType,
}
if (onLocationChangeNeeded) {
FireOnLocationChange(this, request, mCurrentURI);
FireOnLocationChange(this, request, mCurrentURI, 0);
}
return NS_OK;
@ -8365,6 +8367,11 @@ nsDocShell::InternalLoad(nsIURI * aURI,
// Pass true for aCloneSHChildren, since we're not
// changing documents here, so all of our subframes are
// still relevant to the new session history entry.
//
// It also makes OnNewURI(...) set LOCATION_CHANGE_SAME_DOCUMENT
// flag on firing onLocationChange(...).
// Anyway, aCloneSHChildren param is simply reflecting
// doShortCircuitedLoad in this scope.
OnNewURI(aURI, nsnull, owner, mLoadType, true, true, true);
nsCOMPtr<nsIInputStream> postData;
@ -9418,8 +9425,14 @@ nsDocShell::OnNewURI(nsIURI * aURI, nsIChannel * aChannel, nsISupports* aOwner,
#endif
}
}
// aCloneSHChildren exactly means "we are not loading a new document".
PRUint32 locationFlags = aCloneSHChildren?
PRUint32(LOCATION_CHANGE_SAME_DOCUMENT) : 0;
bool onLocationChangeNeeded = SetCurrentURI(aURI, aChannel,
aFireOnLocationChange);
aFireOnLocationChange,
locationFlags);
// Make sure to store the referrer from the channel, if any
SetupReferrerFromChannel(aChannel);
return onLocationChangeNeeded;
@ -9727,8 +9740,14 @@ nsDocShell::AddState(nsIVariant *aData, const nsAString& aTitle,
// gets updated and the back button is enabled, but we only need to
// explicitly call FireOnLocationChange if we're not calling SetCurrentURI,
// since SetCurrentURI will call FireOnLocationChange for us.
//
// Both SetCurrentURI(...) and FireDummyOnLocationChange() pass
// nsnull for aRequest param to FireOnLocationChange(...). Such an update
// notification is allowed only when we know docshell is not loading a new
// document and it requires LOCATION_CHANGE_SAME_DOCUMENT flag. Otherwise,
// FireOnLocationChange(...) breaks security UI.
if (!equalURIs) {
SetCurrentURI(newURI, nsnull, true);
SetCurrentURI(newURI, nsnull, true, LOCATION_CHANGE_SAME_DOCUMENT);
document->SetDocumentURI(newURI);
AddURIVisit(newURI, oldURI, oldURI, 0);

Просмотреть файл

@ -269,10 +269,12 @@ public:
friend class OnLinkClickEvent;
// We need dummy OnLocationChange in some cases to update the UI.
// We need dummy OnLocationChange in some cases to update the UI without
// updating security info.
void FireDummyOnLocationChange()
{
FireOnLocationChange(this, nsnull, mCurrentURI);
FireOnLocationChange(this, nsnull, mCurrentURI,
LOCATION_CHANGE_SAME_DOCUMENT);
}
nsresult HistoryTransactionRemoved(PRInt32 aIndex);
@ -593,7 +595,8 @@ protected:
// FireOnLocationChange is called.
// In all other cases false is returned.
bool SetCurrentURI(nsIURI *aURI, nsIRequest *aRequest,
bool aFireOnLocationChange);
bool aFireOnLocationChange,
PRUint32 aLocationFlags);
// The following methods deal with saving and restoring content viewers
// in session history.

Просмотреть файл

@ -57,10 +57,10 @@
#ifdef MOZ_ENABLE_DBUS
#include "nsDBusHandlerApp.h"
#endif
#if defined(ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
#include "nsExternalSharingAppService.h"
#endif
#if defined(ANDROID)
#if defined(MOZ_WIDGET_ANDROID)
#include "nsExternalURLHandlerService.h"
#endif
@ -118,10 +118,10 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(PlatformLocalHandlerApp_t)
#ifdef MOZ_ENABLE_DBUS
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDBusHandlerApp)
#endif
#if defined(ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalSharingAppService)
#endif
#if defined(ANDROID)
#if defined(MOZ_WIDGET_ANDROID)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalURLHandlerService)
#endif
@ -148,10 +148,10 @@ NS_DEFINE_NAMED_CID(NS_LOCALHANDLERAPP_CID);
#ifdef MOZ_ENABLE_DBUS
NS_DEFINE_NAMED_CID(NS_DBUSHANDLERAPP_CID);
#endif
#if defined(ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
NS_DEFINE_NAMED_CID(NS_EXTERNALSHARINGAPPSERVICE_CID);
#endif
#if defined(ANDROID)
#if defined(MOZ_WIDGET_ANDROID)
NS_DEFINE_NAMED_CID(NS_EXTERNALURLHANDLERSERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_SHENTRY_CID);
@ -178,10 +178,10 @@ const mozilla::Module::CIDEntry kDocShellCIDs[] = {
#ifdef MOZ_ENABLE_DBUS
{ &kNS_DBUSHANDLERAPP_CID, false, NULL, nsDBusHandlerAppConstructor },
#endif
#if defined(ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
{ &kNS_EXTERNALSHARINGAPPSERVICE_CID, false, NULL, nsExternalSharingAppServiceConstructor },
#endif
#if defined(ANDROID)
#if defined(MOZ_WIDGET_ANDROID)
{ &kNS_EXTERNALURLHANDLERSERVICE_CID, false, NULL, nsExternalURLHandlerServiceConstructor },
#endif
{ &kNS_SHENTRY_CID, false, NULL, nsSHEntryConstructor },
@ -227,10 +227,10 @@ const mozilla::Module::ContractIDEntry kDocShellContracts[] = {
#ifdef MOZ_ENABLE_DBUS
{ NS_DBUSHANDLERAPP_CONTRACTID, &kNS_DBUSHANDLERAPP_CID },
#endif
#if defined(ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_ENABLE_MEEGOTOUCHSHARE)
{ NS_EXTERNALSHARINGAPPSERVICE_CONTRACTID, &kNS_EXTERNALSHARINGAPPSERVICE_CID },
#endif
#if defined(ANDROID)
#if defined(MOZ_WIDGET_ANDROID)
{ NS_EXTERNALURLHANDLERSERVICE_CONTRACTID, &kNS_EXTERNALURLHANDLERSERVICE_CID },
#endif
{ NS_SHENTRY_CONTRACTID, &kNS_SHENTRY_CID },

Просмотреть файл

@ -122,6 +122,8 @@ _TEST_FILES = \
662200c.html \
test_bug690056.xul \
bug690056_window.xul \
test_bug311007.xul \
bug311007_window.xul \
$(NULL)
_DOCSHELL_SUBHARNESS = \

Просмотреть файл

@ -0,0 +1,186 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window id="311007Test"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="600"
height="600"
onload="startup();"
title="bug 311007 test">
<script type="application/javascript" src="docshell_helpers.js"></script>
<script type="application/javascript"><![CDATA[
/*
Regression test for bug 283733 and bug 307027.
Bug 283733
"accessing a relative anchor in a secure page removes the
locked icon and yellow background UI"
Bug 307027
"Going back from secure page to error page does not clear yellow bar"
*/
const kDNSErrorURI = "https://example/err.html";
const kSecureURI =
"https://example.com/tests/docshell/test/navigation/blank.html";
/*
Step 1: load a network error page. <err.html> Not Secure
Step 2: load a secure page. <blank.html> Secure
Step 3: a secure page + hashchange. <blank.html#foo> Secure (bug 283733)
Step 4: go back to the error page. <err.html> Not Secure (bug 307027)
*/
var gListener = null;
function WebProgressListener() {
this._callback = null;
}
WebProgressListener.prototype = {
QueryInterface: function(aIID) {
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupports))
return this;
throw Components.results.NS_NOINTERFACE;
},
onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
setTimeout(this._callback, 0, aWebProgress, aRequest, aLocation, aFlags);
},
set callback(aVal) {
this._callback = aVal;
}
};
function startup() {
gListener = new WebProgressListener();
document.getElementById("content")
.webProgress
.addProgressListener(gListener,
Components.interfaces.nsIWebProgress
.NOTIFY_LOCATION);
setTimeout(step1A, 0);
}
/******************************************************************************
* Step 1: Load an error page, and confirm UA knows it's insecure.
******************************************************************************/
function step1A() {
gListener.callback = step1B;
content.location = kDNSErrorURI;
}
function step1B(aWebProgress, aRequest, aLocation, aFlags) {
/* XXX Here we receive 2 notifications, due to bug 673752. */
if (!aRequest) {
return;
}
is(aLocation.spec, kDNSErrorURI, "Error page's URI (1)");
ok(!(aFlags & Components.interfaces.nsIWebProgressListener
.LOCATION_CHANGE_SAME_DOCUMENT),
"DocShell loaded a document (1)");
ok(!(aWebProgress.QueryInterface(Components.interfaces.nsIDocShell)
.securityUI.state &
Components.interfaces.nsIWebProgressListener.STATE_IS_SECURE),
"This is not a secure page (1)");
/* Go to step 2. */
setTimeout(step2A, 0);
}
/******************************************************************************
* Step 2: Load a HTTPS page, and confirm it's secure.
******************************************************************************/
function step2A() {
gListener.callback = step2B;
content.location = kSecureURI;
}
function step2B(aWebProgress, aRequest, aLocation, aFlags) {
is(aLocation.spec, kSecureURI, "A URI on HTTPS (2)");
ok(!(aFlags & Components.interfaces.nsIWebProgressListener
.LOCATION_CHANGE_SAME_DOCUMENT),
"DocShell loaded a document (2)");
ok((aWebProgress.QueryInterface(Components.interfaces.nsIDocShell)
.securityUI.state &
Components.interfaces.nsIWebProgressListener.STATE_IS_SECURE),
"This is a secure page (2)");
/* Go to step 3. */
setTimeout(step3A, 0);
}
/*****************************************************************************
* Step 3: Trigger hashchange within a secure page, and confirm UA knows
* it's secure. (Bug 283733)
*****************************************************************************/
function step3A() {
gListener.callback = step3B;
content.location += "#foo";
}
function step3B(aWebProgress, aRequest, aLocation, aFlags) {
is(aLocation.spec, kSecureURI + "#foo", "hashchange on HTTPS (3)");
ok((aFlags & Components.interfaces.nsIWebProgressListener
.LOCATION_CHANGE_SAME_DOCUMENT),
"We are in the same document as before (3)");
ok((aWebProgress.QueryInterface(Components.interfaces.nsIDocShell)
.securityUI.state &
Components.interfaces.nsIWebProgressListener.STATE_IS_SECURE),
"This is a secure page (3)");
/* Go to step 4. */
setTimeout(step4A, 0);
}
/*****************************************************************************
* Step 4: Go back from a secure page to an error page, and confirm UA knows
* it's not secure. (Bug 307027)
*****************************************************************************/
function step4A() {
gListener.callback = step4B;
content.history.go(-2);
}
function step4B(aWebProgress, aRequest, aLocation, aFlags) {
if (!aRequest) // See step1B(...) and bug 673752.
return;
is(aLocation.spec, kDNSErrorURI, "Go back to the error URI (4)");
ok(!(aFlags & Components.interfaces.nsIWebProgressListener
.LOCATION_CHANGE_SAME_DOCUMENT),
"DocShell loaded a document (4)");
ok(!(aWebProgress.QueryInterface(Components.interfaces.nsIDocShell)
.securityUI.state &
Components.interfaces.nsIWebProgressListener.STATE_IS_SECURE),
"This is not a secure page (4)");
/* End. */
aWebProgress.removeProgressListener(gListener);
delete(gListener);
finish();
}
]]></script>
<browser type="content-primary" flex="1" id="content" src="about:blank"/>
</window>

Просмотреть файл

@ -0,0 +1,43 @@
<?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=311007.xul
-->
<window title="Mozilla Bug 311007"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<title>Test for Bug 311007</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=311007">
Mozilla Bug 311007</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 311007 **/
SimpleTest.waitForExplicitFinish();
window.open("bug311007_window.xul", "bug311007",
"chrome,width=600,height=600");
]]>
</script>
</window>

Просмотреть файл

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window id="303267Test"
<window id="{BUGNUMBER}Test"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="600"
height="600"

Просмотреть файл

@ -465,6 +465,19 @@ nsFocusManager::SetFocus(nsIDOMElement* aElement, PRUint32 aFlags)
return NS_OK;
}
NS_IMETHODIMP
nsFocusManager::ElementIsFocusable(nsIDOMElement* aElement, PRUint32 aFlags,
bool* aIsFocusable)
{
NS_ENSURE_TRUE(aElement, NS_ERROR_INVALID_ARG);
nsCOMPtr<nsIContent> aContent = do_QueryInterface(aElement);
*aIsFocusable = CheckIfFocusable(aContent, aFlags) != nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsFocusManager::MoveFocus(nsIDOMWindow* aWindow, nsIDOMElement* aStartElement,
PRUint32 aType, PRUint32 aFlags, nsIDOMElement** aElement)

Просмотреть файл

@ -166,6 +166,11 @@ interface nsIFocusManager : nsISupports
*/
void moveCaretToFocus(in nsIDOMWindow aWindow);
/***
* Check if given element is focusable.
*/
boolean elementIsFocusable(in nsIDOMElement aElement, in unsigned long aFlags);
/*
* Raise the window when switching focus
*/

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(2da904fa-83da-426d-a320-a6868192583e)]
[scriptable, uuid(bcb54394-d9f8-4bcb-bbbb-eca9826cdbca)]
interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
{
attribute DOMString href;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(c874e500-a185-4d69-96dd-474d1137e21f)]
[scriptable, uuid(a06bca18-791f-474e-a031-bf6c2bd14994)]
interface nsIDOMHTMLAppletElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(d88c8515-5a27-4955-8ca5-18c908433cfd)]
[scriptable, uuid(7e607c36-aecc-4dee-a93a-95e22a374bfb)]
interface nsIDOMHTMLAreaElement : nsIDOMHTMLElement
{
attribute DOMString alt;

Просмотреть файл

@ -52,7 +52,7 @@
* @status UNDER_DEVELOPMENT
*/
[scriptable, uuid(f4115c13-bc51-4c3b-a5c0-9106af9f7368)]
[scriptable, uuid(756e2792-b937-4a70-bd1f-9d6820473e7e)]
interface nsIDOMHTMLAudioElement : nsIDOMHTMLMediaElement
{
// Setup the audio stream for writing

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(a4f319d7-442d-4154-8c60-b9acdca87523)]
[scriptable, uuid(7eefd466-7c4d-499a-a076-e33204e69dc3)]
interface nsIDOMHTMLBRElement : nsIDOMHTMLElement
{
attribute DOMString clear;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(1ba4957f-629e-4410-b5fd-64f2b7eeb32c)]
[scriptable, uuid(e55cd224-b603-4976-892a-20b11d469394)]
interface nsIDOMHTMLBaseElement : nsIDOMHTMLElement
{
attribute DOMString href;

Просмотреть файл

@ -54,7 +54,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(dcf343a9-fa7f-4e16-b122-0ece0d8bdea9)]
[scriptable, uuid(6c377d44-a5d1-4f0f-860a-9858d2cb5679)]
interface nsIDOMHTMLBodyElement : nsIDOMHTMLElement
{
attribute DOMString aLink;

Просмотреть файл

@ -52,7 +52,7 @@
interface nsIDOMValidityState;
[scriptable, uuid(4b48e075-a05b-480f-9e37-fcd88e7aebdd)]
[scriptable, uuid(79f034f0-5c13-4101-9598-412e1eac1986)]
interface nsIDOMHTMLButtonElement : nsIDOMHTMLElement
{
attribute boolean autofocus;

Просмотреть файл

@ -55,7 +55,7 @@
interface nsIDOMFile;
interface nsIVariant;
[scriptable, uuid(e1ea26e6-4141-487f-a9cf-d7e9344b571c)]
[scriptable, uuid(dbbeeba1-3c20-4d9d-ac82-98b69fd819a9)]
interface nsIDOMHTMLCanvasElement : nsIDOMHTMLElement
{
attribute unsigned long width;

Просмотреть файл

@ -46,7 +46,7 @@
* @status UNDER_DEVELOPMENT
*/
[scriptable, uuid(4c466da8-5c6d-427f-95f5-bba96ab99c96)]
[scriptable, uuid(13032f74-4150-4768-ab5e-51f4de39a300)]
interface nsIDOMHTMLCommandElement : nsIDOMHTMLElement
{
attribute DOMString type;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(f3e65e2b-e079-4970-bb5d-f96ac9cd18c5)]
[scriptable, uuid(50e9ff30-0982-4074-bc65-313f41be8624)]
interface nsIDOMHTMLDListElement : nsIDOMHTMLElement
{
attribute boolean compact;

Просмотреть файл

@ -49,7 +49,7 @@
interface nsIDOMHTMLCollection;
[scriptable, uuid(312ed7c1-8c62-4d80-bbd9-99d7ea4377e6)]
[scriptable, uuid(3bace78b-9eca-4990-a5d6-9c2b8c32cc8a)]
interface nsIDOMHTMLDataListElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLCollection options;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(1e04cd43-edc0-4658-bd77-d67661af6c9c)]
[scriptable, uuid(a99e86ae-7761-4145-b8a4-5a91186051f1)]
interface nsIDOMHTMLDirectoryElement : nsIDOMHTMLElement
{
attribute boolean compact;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(771be9ee-b883-4556-bf90-2d7c904fe94d)]
[scriptable, uuid(6815b902-8e04-49dd-977b-0a8785e5ffaf)]
interface nsIDOMHTMLDivElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -53,7 +53,7 @@ interface nsIDOMHTMLMenuElement;
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(0a21bb68-d8bd-4b2a-a3db-048a02e81c62)]
[scriptable, uuid(4eccf8a3-8bf5-43f3-a728-f5b632f7db3a)]
interface nsIDOMHTMLElement : nsIDOMElement
{
// metadata attributes
@ -86,6 +86,7 @@ interface nsIDOMHTMLElement : nsIDOMElement
// DOM Parsing and Serialization
attribute DOMString innerHTML;
attribute DOMString outerHTML;
void insertAdjacentHTML(in DOMString position,
in DOMString text);

Просмотреть файл

@ -47,7 +47,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/#the-embed-element
*/
[scriptable, uuid(d6309fc7-e9d2-4087-b452-490ed84f2dc2)]
[scriptable, uuid(940a15c2-0d48-4186-b4d8-067fa1ce5675)]
interface nsIDOMHTMLEmbedElement : nsIDOMHTMLElement
{
attribute DOMString align;

Просмотреть файл

@ -52,7 +52,7 @@
interface nsIDOMValidityState;
[scriptable, uuid(e153c20e-7a3d-4184-865c-ee7c6d9b65df)]
[scriptable, uuid(781ae103-b030-4aad-b2d5-96e5c2317dec)]
interface nsIDOMHTMLFieldSetElement : nsIDOMHTMLElement
{
attribute boolean disabled;

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(8a205975-86cb-44db-b20e-df7f2d200580)]
[scriptable, uuid(1c9778ee-a49c-40ee-9b93-c0ff15630431)]
interface nsIDOMHTMLFontElement : nsIDOMHTMLElement
{
attribute DOMString color;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше