Compare commits

..
Author SHA1 Message Date
Moonchild 610e44320c Issue #2342: Remove MOZ_MUST_USE macro 2023-11-05 12:38:11 +01:00
Moonchild 10476e27da Issue #2342: Use [[nodiscard]] in /mfbt 2023-11-05 12:37:04 +01:00
Moonchild a4777b1c21 Issue #2342: Use [[nodiscard]] in /xpcom and xpidl parser 2023-11-05 10:41:52 +01:00
Moonchild 9f6e448f78 Issue #2342: Use [[nodiscard]] in /uriloader /widget
Also a few misc low-volume places.
2023-11-05 00:59:31 +01:00
Moonchild 19a21bac1b Issue #2342: Use [[nodiscard]] in /netwerk 2023-11-04 23:42:53 +01:00
Moonchild c7867ce130 Issue #2342: Use [[nodiscard]] in /memory and remove Sun Studio hack 2023-11-04 22:57:30 +01:00
Moonchild 34c068e611 Issue #2342: Use [[nodiscard]] in /media 2023-11-04 22:28:58 +01:00
Moonchild a48e621048 Issue #2342: Use [[nodiscard]] in /js 2023-11-04 20:06:50 +01:00
Moonchild de5d3b1034 Issue #2342: Use [[nodiscard]] in IPDL generation and fix warnings
DOM plugin code had two warning in IPC caught by [[nodiscard]], these
were fixed in one go.
2023-11-04 01:24:20 +01:00
Moonchild f8737bbf4f Issue #2342: Use [[nodiscard]] in /ipc 2023-11-04 01:22:37 +01:00
Moonchild d9c70eaba2 Issue #2342: Use [[nodiscard]] in /hal /image and /intl 2023-11-04 01:21:57 +01:00
Moonchild 9308c63ce6 Issue #2281 - Remove the use of non-standard namespace std::tr1 in
Google's WebRTC gtest code
2023-11-04 00:13:32 +01:00
Moonchild 6314e01691 Issue #2342: Use [[nodiscard]] in /accessible and /caps 2023-11-03 12:17:29 +01:00
Moonchild b7b2f1de84 Issue #2342: Use [[nodiscard]] in /gfx and /layout 2023-11-03 00:34:37 +01:00
Moonchild b838d6634c Issue #2342: Use [[nodiscard]] in /dom 2023-11-03 00:17:31 +01:00
Moonchild dc4ea7f680 Merge branch 'master' into c++17-work 2023-11-02 12:20:37 +01:00
Moonchild 0e427867e3 Issue #2281 - Force clobber
Without a clobber, mozconfigure doesn't properly pick up the /std:c++17
or -std=gnu++17 compiler switches needed to put them into C++17 mode.
2023-10-18 14:40:16 +02:00
Moonchild 8137a4e122 Issue #2281 - Add some deduction guides for class template arguments.
This is necessary if we want to start using Span() constructors
instead of the MakeSpan() kludge.
2023-10-18 14:35:59 +02:00
Moonchild 46138995f6 Issue #2281 - Default to C++17 when building.
Configure the toolchain to default to C++17 language standard with
optional gnu extensions (if on GCC)
2023-10-15 15:12:23 +02:00
Moonchild aeb9de40a5 Issue #2281 - Avoid class-static constexpr in TypedArrayObject 2023-10-15 01:54:25 +02:00
Moonchild 3d693801f9 Issue #2281 - Build LZ4 as C instead of including it as C++. 2023-10-15 00:19:13 +02:00
Moonchild 14fa712b8c Issue #2281 - The 'register' storage class is no longer a thing in c++17 2023-10-13 23:12:37 +02:00
Moonchild 7d93034fd0 Issue #2281 - Mark mozalloc new() as noexcept to aligh with what the VC
runtime expects.

Currently spams warnings but may actually error out if not fixed, or
result in undefined behaviour if mismatching signatures are treated as
redeclarations with different exception specifications.
2023-10-13 23:12:00 +02:00
Moonchild 1769e74839 Issue #2281 - Replace std::iterator inheritance with iterator traits
definitions (as required by C++17).
2023-10-13 23:07:22 +02:00
2897 changed files with 779983 additions and 121993 deletions

No files matched your search

-4
View File
@@ -7,10 +7,6 @@
* ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule)
*/
#ifndef NSAccessibilityCellRole
#define NSAccessibilityCellRole NSAccessibilityUnknownRole
#endif
ROLE(NOTHING,
"nothing",
ATK_ROLE_UNKNOWN,
+1 -9
View File
@@ -44,9 +44,7 @@
#ifdef XP_WIN
#include "mozilla/a11y/Compatibility.h"
#include "mozilla/dom/ContentChild.h"
#ifdef MOZ_ENABLE_NPAPI
#include "HTMLWin32ObjectAccessible.h"
#endif
#include "mozilla/StaticPtr.h"
#endif
@@ -57,9 +55,7 @@
#include "nsImageFrame.h"
#include "nsIObserverService.h"
#include "nsLayoutUtils.h"
#ifdef MOZ_ENABLE_NPAPI
#include "nsPluginFrame.h"
#endif
#include "nsSVGPathGeometryFrame.h"
#include "nsTreeBodyFrame.h"
#include "nsTreeColumns.h"
@@ -83,7 +79,7 @@
#include "XULTabAccessible.h"
#include "XULTreeGridAccessibleWrap.h"
#if (defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)) && defined(MOZ_ENABLE_NPAPI)
#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
#include "nsNPAPIPluginInstance.h"
#endif
@@ -435,7 +431,6 @@ private:
NS_IMPL_ISUPPORTS(PluginTimerCallBack, nsITimerCallback)
#endif
#ifdef MOZ_ENABLE_NPAPI
already_AddRefed<Accessible>
nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
nsIContent* aContent,
@@ -498,7 +493,6 @@ nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
return nullptr;
}
#endif // MOZ_ENABLE_NPAPI
void
nsAccessibilityService::DeckPanelSwitched(nsIPresShell* aPresShell,
@@ -1644,13 +1638,11 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
case eOuterDocType:
newAcc = new OuterDocAccessible(aContent, document);
break;
#ifdef MOZ_ENABLE_NPAPI
case ePluginType: {
nsPluginFrame* pluginFrame = do_QueryFrame(aFrame);
newAcc = CreatePluginAccessible(pluginFrame, aContent, aContext);
break;
}
#endif
case eTextLeafType:
newAcc = new TextLeafAccessibleWrap(aContent, document);
break;
-4
View File
@@ -20,9 +20,7 @@
class nsImageFrame;
class nsIArray;
class nsIPersistentProperties;
#ifdef MOZ_ENABLE_NPAPI
class nsPluginFrame;
#endif
class nsITreeView;
namespace mozilla {
@@ -89,11 +87,9 @@ public:
Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
bool aCanCreate);
#ifdef MOZ_ENABLE_NPAPI
already_AddRefed<Accessible>
CreatePluginAccessible(nsPluginFrame* aFrame, nsIContent* aContent,
Accessible* aContext);
#endif
/**
* Adds/remove ATK root accessible for gtk+ native window to/from children
+1 -2
View File
@@ -486,14 +486,13 @@ DocAccessibleParent::SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy)
IAccessibleHolder holder(Move(ptr));
Unused << SendParentCOMProxy(holder);
}
#ifdef MOZ_ENABLE_NPAPI
bool
DocAccessibleParent::RecvGetWindowedPluginIAccessible(
const WindowsHandle& aHwnd, IAccessibleHolder* aPluginCOMProxy)
{
return false;
}
#endif
#endif // defined(XP_WIN)
+2 -3
View File
@@ -143,11 +143,10 @@ public:
#if defined(XP_WIN)
void SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy);
#ifdef MOZ_ENABLE_NPAPI
virtual bool RecvGetWindowedPluginIAccessible(
const WindowsHandle& aHwnd, IAccessibleHolder* aPluginCOMProxy) override;
#endif // MOZ_ENABLE_NPAPI
#endif // XP_WIN
#endif
private:
-2
View File
@@ -61,10 +61,8 @@ parent:
*/
async BindChildDoc(PDocAccessible aChildDoc, uint64_t aID);
#ifdef MOZ_ENABLE_NPAPI
sync GetWindowedPluginIAccessible(WindowsHandle aHwnd)
returns (IAccessibleHolder aPluginCOMProxy);
#endif
child:
async ParentCOMProxy(IAccessibleHolder aParentCOMProxy);
+1 -1
View File
@@ -8,7 +8,7 @@ if CONFIG['COMPILE_ENVIRONMENT']:
# With --disable-accessibility, we need to compile PDocAccessible.ipdl (which
# also depends on COMPtrTypes.h), but not the C++.
PREPROCESSED_IPDL_SOURCES += ['PDocAccessible.ipdl']
IPDL_SOURCES += ['PDocAccessible.ipdl']
EXPORTS.mozilla.a11y += ['COMPtrTypes.h']
if CONFIG['ACCESSIBILITY']:
-2
View File
@@ -295,7 +295,6 @@ enum CheckboxValue {
@implementation mozPaneAccessible
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
- (NSUInteger)accessibilityArrayAttributeCount:(NSString*)attribute
{
AccessibleWrap* accWrap = [self getGeckoAccessible];
@@ -314,7 +313,6 @@ enum CheckboxValue {
return [super accessibilityArrayAttributeCount:attribute];
}
#endif
- (NSArray*)children
{
+4 -34
View File
@@ -47,24 +47,6 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
return nativeArray;
}
// Convert to an object without @ syntax
static inline id
ConvertToId(NSInteger val)
{
return [NSString stringWithFormat:@"%i", val];
}
// Missing from SDK 10.5
#if !defined(MAC_OS_X_VERSION_10_6) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
#define __IntToNSString(x) ([NSString stringWithFormat:@"%i", x])
#define NSAccessibilityRowIndexRangeAttribute @"AXRowIndexRange"
#define NSAccessibilityColumnIndexRangeAttribute @"AXColumnIndexRange"
#define NSAccessibilityRowHeaderUIElementsAttribute @"AXRowHeaderUIElements"
#define NSAccessibilityColumnHeaderUIElementsAttribute @"AXColumnHeaderUIElements"
#define NSAccessibilityRowCountAttribute @"AXRowCount"
#define NSAccessibilityColumnCountAttribute @"AXColumnCount"
#endif
@implementation mozTablePartAccessible
- (BOOL)isLayoutTablePart;
{
@@ -101,14 +83,10 @@ ConvertToId(NSInteger val)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
NSArray* additionalAttributes = [super additionalAccessibilityAttributeNames];
if ([self isLayoutTablePart]) {
return additionalAttributes;
}
#else
NSArray* additionalAttributes = [[NSArray alloc] init];
#endif
static NSArray* tableAttrs = nil;
if (!tableAttrs) {
@@ -130,9 +108,9 @@ ConvertToId(NSInteger val)
if (AccessibleWrap* accWrap = [self getGeckoAccessible]) {
TableAccessible* table = accWrap->AsTable();
if ([attribute isEqualToString:NSAccessibilityRowCountAttribute])
return ConvertToId(table->RowCount());
return @(table->RowCount());
if ([attribute isEqualToString:NSAccessibilityColumnCountAttribute])
return ConvertToId(table->ColCount());
return @(table->ColCount());
if ([attribute isEqualToString:NSAccessibilityRowsAttribute]) {
// Create a new array with the list of table rows.
NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
@@ -149,9 +127,9 @@ ConvertToId(NSInteger val)
}
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
if ([attribute isEqualToString:NSAccessibilityRowCountAttribute])
return ConvertToId(proxy->TableRowCount());
return @(proxy->TableRowCount());
if ([attribute isEqualToString:NSAccessibilityColumnCountAttribute])
return ConvertToId(proxy->TableColumnCount());
return @(proxy->TableColumnCount());
if ([attribute isEqualToString:NSAccessibilityRowsAttribute]) {
// Create a new array with the list of table rows.
NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
@@ -177,14 +155,10 @@ ConvertToId(NSInteger val)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
NSArray* additionalAttributes = [super additionalAccessibilityAttributeNames];
if ([self isLayoutTablePart]) {
return additionalAttributes;
}
#else
NSArray* additionalAttributes = [[NSArray alloc] init];
#endif
static NSArray* tableRowAttrs = nil;
if (!tableRowAttrs) {
@@ -240,14 +214,10 @@ ConvertToId(NSInteger val)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
NSArray* additionalAttributes = [super additionalAccessibilityAttributeNames];
if ([self isLayoutTablePart]) {
return additionalAttributes;
}
#else
NSArray* additionalAttributes = [[NSArray alloc] init];
#endif
static NSArray* tableCellAttrs = nil;
if (!tableCellAttrs) {
-7
View File
@@ -38,13 +38,6 @@ SOURCES += [
'XULTreeGridAccessibleWrap.cpp',
]
if CONFIG['MOZ_ENABLE_NPAPI']:
SOURCES += [
'HTMLWin32ObjectAccessible.cpp',
]
LOCAL_INCLUDES += [
'/accessible/base',
'/accessible/generic',
File diff suppressed because it is too large. Load diff
-80
View File
@@ -1,80 +0,0 @@
dnl Map old names of Autoconf macros to new regularized names.
dnl This file is part of Autoconf.
dnl Copyright (C) 1994 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl General macros.
dnl
define(AC_WARN, [indir([AC_MSG_WARN], $@)])dnl
define(AC_ERROR, [indir([AC_MSG_ERROR], $@)])dnl
AC_DEFUN(AC_PROGRAM_CHECK, [indir([AC_CHECK_PROG], $@)])dnl
AC_DEFUN(AC_PROGRAM_PATH, [indir([AC_PATH_PROG], $@)])dnl
AC_DEFUN(AC_PROGRAMS_CHECK, [indir([AC_CHECK_PROGS], $@)])dnl
AC_DEFUN(AC_PROGRAMS_PATH, [indir([AC_PATH_PROGS], $@)])dnl
AC_DEFUN(AC_PREFIX, [indir([AC_PREFIX_PROGRAM], $@)])dnl
AC_DEFUN(AC_HEADER_EGREP, [indir([AC_EGREP_HEADER], $@)])dnl
AC_DEFUN(AC_PROGRAM_EGREP, [indir([AC_EGREP_CPP], $@)])dnl
AC_DEFUN(AC_TEST_PROGRAM, [indir([AC_TRY_RUN], $@)])dnl
AC_DEFUN(AC_TEST_CPP, [indir([AC_TRY_CPP], $@)])dnl
AC_DEFUN(AC_HEADER_CHECK, [indir([AC_CHECK_HEADER], $@)])dnl
AC_DEFUN(AC_FUNC_CHECK, [indir([AC_CHECK_FUNC], $@)])dnl
AC_DEFUN(AC_HAVE_FUNCS, [indir([AC_CHECK_FUNCS], $@)])dnl
AC_DEFUN(AC_HAVE_HEADERS, [indir([AC_CHECK_HEADERS], $@)])dnl
AC_DEFUN(AC_SIZEOF_TYPE, [indir([AC_CHECK_SIZEOF], $@)])dnl
dnl
dnl Specific macros.
dnl
AC_DEFUN(AC_GCC_TRADITIONAL, [indir([AC_PROG_GCC_TRADITIONAL])])dnl
AC_DEFUN(AC_MINUS_C_MINUS_O, [indir([AC_PROG_CC_C_O])])dnl
AC_DEFUN(AC_SET_MAKE, [indir([AC_PROG_MAKE_SET])])dnl
AC_DEFUN(AC_YYTEXT_POINTER, [indir([AC_DECL_YYTEXT])])dnl
AC_DEFUN(AC_LN_S, [indir([AC_PROG_LN_S])])dnl
AC_DEFUN(AC_STDC_HEADERS, [indir([AC_HEADER_STDC])])dnl
AC_DEFUN(AC_MAJOR_HEADER, [indir([AC_HEADER_MAJOR])])dnl
AC_DEFUN(AC_STAT_MACROS_BROKEN, [indir([AC_HEADER_STAT])])dnl
AC_DEFUN(AC_SYS_SIGLIST_DECLARED, [indir([AC_DECL_SYS_SIGLIST])])dnl
AC_DEFUN(AC_GETGROUPS_T, [indir([AC_TYPE_GETGROUPS])])dnl
AC_DEFUN(AC_UID_T, [indir([AC_TYPE_UID_T])])dnl
AC_DEFUN(AC_SIZE_T, [indir([AC_TYPE_SIZE_T])])dnl
AC_DEFUN(AC_PID_T, [indir([AC_TYPE_PID_T])])dnl
AC_DEFUN(AC_OFF_T, [indir([AC_TYPE_OFF_T])])dnl
AC_DEFUN(AC_MODE_T, [indir([AC_TYPE_MODE_T])])dnl
AC_DEFUN(AC_RETSIGTYPE, [indir([AC_TYPE_SIGNAL])])dnl
AC_DEFUN(AC_MMAP, [indir([AC_FUNC_MMAP])])dnl
AC_DEFUN(AC_VPRINTF, [indir([AC_FUNC_VPRINTF])])dnl
AC_DEFUN(AC_VFORK, [indir([AC_FUNC_VFORK])])dnl
AC_DEFUN(AC_WAIT3, [indir([AC_FUNC_WAIT3])])dnl
AC_DEFUN(AC_ALLOCA, [indir([AC_FUNC_ALLOCA])])dnl
AC_DEFUN(AC_GETLOADAVG, [indir([AC_FUNC_GETLOADAVG])])dnl
AC_DEFUN(AC_UTIME_NULL, [indir([AC_FUNC_UTIME_NULL])])dnl
AC_DEFUN(AC_STRCOLL, [indir([AC_FUNC_STRCOLL])])dnl
AC_DEFUN(AC_SETVBUF_REVERSED, [indir([AC_FUNC_SETVBUF_REVERSED])])dnl
AC_DEFUN(AC_TIME_WITH_SYS_TIME, [indir([AC_HEADER_TIME])])dnl
AC_DEFUN(AC_TIMEZONE, [indir([AC_STRUCT_TIMEZONE])])dnl
AC_DEFUN(AC_ST_BLOCKS, [indir([AC_STRUCT_ST_BLOCKS])])dnl
AC_DEFUN(AC_ST_BLKSIZE, [indir([AC_STRUCT_ST_BLKSIZE])])dnl
AC_DEFUN(AC_ST_RDEV, [indir([AC_STRUCT_ST_RDEV])])dnl
AC_DEFUN(AC_CROSS_CHECK, [indir([AC_C_CROSS])])dnl
AC_DEFUN(AC_CHAR_UNSIGNED, [indir([AC_C_CHAR_UNSIGNED])])dnl
AC_DEFUN(AC_LONG_DOUBLE, [indir([AC_C_LONG_DOUBLE])])dnl
AC_DEFUN(AC_WORDS_BIGENDIAN, [indir([AC_C_BIGENDIAN])])dnl
AC_DEFUN(AC_INLINE, [indir([AC_C_INLINE])])dnl
AC_DEFUN(AC_CONST, [indir([AC_C_CONST])])dnl
AC_DEFUN(AC_LONG_FILE_NAMES, [indir([AC_SYS_LONG_FILE_NAMES])])dnl
AC_DEFUN(AC_RESTARTABLE_SYSCALLS, [indir([AC_SYS_RESTARTABLE_SYSCALLS])])dnl
AC_DEFUN(AC_FIND_X, [indir([AC_PATH_X])])dnl
AC_DEFUN(AC_FIND_XTRA, [indir([AC_PATH_XTRA])])dnl
File diff suppressed because it is too large. Load diff
-28
View File
@@ -1,28 +0,0 @@
dnl Driver that loads the Autoconf macro files.
dnl Requires GNU m4.
dnl This file is part of Autoconf.
dnl Copyright (C) 1994 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl Written by David MacKenzie.
dnl
include(acgeneral.m4)dnl
builtin(include, acspecific.m4)dnl
builtin(include, acoldnames.m4)dnl
dnl Do not sinclude acsite.m4 here, because it may not be installed
dnl yet when Autoconf is frozen.
dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
-159
View File
@@ -1,159 +0,0 @@
#! @SHELL@
# autoconf -- create `configure' using m4 macros
# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# If given no args, create `configure' from template file `configure.in'.
# With one arg, create a configure script on standard output from
# the given template file.
usage="\
Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir]
[-l dir] [--localdir=dir] [--version] [template-file]"
# NLS nuisances.
# Only set these to C if already set. These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
: ${AC_MACRODIR=@datadir@}
: ${M4=@M4@}
: ${AWK=@AWK@}
case "${M4}" in
/*) # Handle the case that m4 has moved since we were configured.
# It may have been found originally in a build directory.
test -f "${M4}" || M4=m4 ;;
esac
: ${TMPDIR=/tmp}
tmpout=${TMPDIR}/acout.$$
localdir=
show_version=no
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* )
echo "${usage}" 1>&2; exit 0 ;;
--localdir=* | --l*=* )
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
shift ;;
-l | --localdir | --l*)
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
localdir="${1}"
shift ;;
--macrodir=* | --m*=* )
AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
shift ;;
-m | --macrodir | --m* )
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
AC_MACRODIR="${1}"
shift ;;
--version | --v* )
show_version=yes; shift ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "${usage}" 1>&2; exit 1 ;;
* )
break ;;
esac
done
if test $show_version = yes; then
version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
$AC_MACRODIR/acgeneral.m4`
echo "Autoconf version $version"
exit 0
fi
case $# in
0) infile=configure.in ;;
1) infile="$1" ;;
*) echo "$usage" >&2; exit 1 ;;
esac
trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15
tmpin=${TMPDIR}/acin.$$ # Always set this, to avoid bogus errors from some rm's.
if test z$infile = z-; then
infile=$tmpin
cat > $infile
elif test ! -r "$infile"; then
echo "autoconf: ${infile}: No such file or directory" >&2
exit 1
fi
if test -n "$localdir"; then
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
else
use_localdir=
fi
# Use the frozen version of Autoconf if available.
r= f=
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
case `$M4 --help < /dev/null 2>&1` in
*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
*traditional*) ;;
*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
esac
$M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout ||
{ rm -f $tmpin $tmpout; exit 2; }
# You could add your own prefixes to pattern if you wanted to check for
# them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do
# alternation.
pattern="AC_"
status=0
if grep "^[^#]*${pattern}" $tmpout > /dev/null 2>&1; then
echo "autoconf: Undefined macros:" >&2
sed -n "s/^[^#]*\\(${pattern}[_A-Za-z0-9]*\\).*/\\1/p" $tmpout |
while read macro; do
grep -n "^[^#]*$macro" $infile /dev/null
test $? -eq 1 && echo >&2 "***BUG in Autoconf--please report*** $macro"
done | sort -u >&2
status=1
fi
if test $# -eq 0; then
exec 4> configure; chmod +x configure
else
exec 4>&1
fi
# Put the real line numbers into configure to make config.log more helpful.
$AWK '
/__oline__/ { printf "%d:", NR + 1 }
{ print }
' $tmpout | sed '
/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/
' >&4
rm -f $tmpout
exit $status
+7 -9
View File
@@ -179,12 +179,10 @@ if test "$GNU_CC"; then
CFLAGS="$CFLAGS -fno-math-errno -pipe"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno -pipe"
case "${host_cpu}" in
i*86)
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
;;
esac
if test "$CPU_ARCH" = "x86" -o "$CPU_ARCH" = "x86_64"; then
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
fi
if test -z "$CLANG_CC"; then
case "$CC_VERSION" in
@@ -192,9 +190,9 @@ if test "$GNU_CC"; then
AC_MSG_ERROR([Unsupported GCC version.])
;;
*)
# Lifetime Dead Store Elimination level 2 (default in GCC) breaks Goanna.
# Instead of completely disabling this optimization, we force level 1
# optimization instead with -flifetime-dse=1.
# Lifetime Dead Store Elimination level 2 (default in GCC6+) breaks Gecko.
# Instead of completely disabling this optimization on newer GCC's,
# we'll force them to use level 1 optimization with -flifetime-dse=1.
# Add it first so that a mozconfig can override by setting CFLAGS/CXXFLAGS.
CFLAGS="-flifetime-dse=1 $CFLAGS"
CXXFLAGS="-flifetime-dse=1 $CXXFLAGS"
+3 -2
View File
@@ -28,7 +28,9 @@ if test -n "$USE_ICU"; then
fi
MOZ_ICU_VERSION="$version"
ICU_DATA_FILE_BIG="icudt${version}b.dat"
# TODO: the l is actually endian-dependent
# We could make this set as 'l' or 'b' for little or big, respectively,
# but we'd need to check in a big-endian version of the file.
ICU_DATA_FILE="icudt${version}l.dat"
dnl We won't build ICU data as a separate file when building
@@ -44,7 +46,6 @@ fi
AC_SUBST(MOZ_ICU_VERSION)
AC_SUBST(USE_ICU)
AC_SUBST(ICU_DATA_FILE_BIG)
AC_SUBST(ICU_DATA_FILE)
AC_SUBST(MOZ_ICU_DATA_ARCHIVE)
AC_SUBST(MOZ_SHARED_ICU)
+7
View File
@@ -33,3 +33,10 @@ endif
# correctly. Note that the binary produced here is a host tool and doesn't need
# to be distributed.
MACOSX_DEPLOYMENT_TARGET :=
# Temporarily relax the requirements for libstdc++ symbol versions on static
# analysis plugin in order to use a recent clang by accepting libstdc++ from
# gcc 4.4.0 (GLIBCXX_3.4.11).
ifdef CHECK_STDCXX
CHECK_STDCXX = $(call CHECK_SYMBOLS,$(1),GLIBCXX,libstdc++,v[1] > 3 || (v[1] == 3 && v[2] == 4 && v[3] > 11))
endif
+2 -12
View File
@@ -499,14 +499,6 @@ set_config('INTEL_ARCHITECTURE', delayed_getattr(target_variables,
'INTEL_ARCHITECTURE'))
set_config('TARGET_CPU', delayed_getattr(target, 'raw_cpu'))
set_config('TARGET_OS', delayed_getattr(target, 'raw_os'))
set_config('TARGET_ENDIANNESS', delayed_getattr(target, 'endianness'))
@depends(target)
def target_is_big_endian(target):
if target.endianness == 'big':
return True
set_define('TARGET_ENDIAN_BIG', target_is_big_endian)
@depends(host)
@@ -599,9 +591,7 @@ imply_option('--enable-project', application)
@depends(check_build_environment, '--help')
def default_project(build_env, help):
if build_env.topobjdir.endswith('/js/src'):
return 'js'
return 'xulrunner'
return 'js'
option('--enable-project', nargs=1, default=default_project,
help='Project to build')
@@ -648,7 +638,7 @@ def build_project(noncomm_build, project, external_source_dir, build_env, help):
build_app = project[0]
if not external_source_dir and build_app not in ('xulrunner', 'js'):
if not external_source_dir and build_app not in ('js'):
if noncomm_build:
log.info("=====WARNING WARNING WARNING=====")
log.info("UNSUPPORTED NONCOMM-BUILD: Application code SHOULD NOT be put inside the platform tree, and doing so may have unforseen consequences if/when platform code is changed.")
+55 -26
View File
@@ -10,28 +10,66 @@ def encoded_open(path, mode):
return codecs.open(path, mode, encoding)
m4 = check_prog(
"M4",
(
"gm4",
"m4",
),
)
option(env='AUTOCONF', nargs=1, help='Path to autoconf 2.13')
@depends('OLD_CONFIGURE', mozconfig, awk, m4, check_build_environment, shell,
@depends(mozconfig, 'AUTOCONF')
@checking('for autoconf')
@imports(_from='os.path', _import='exists')
@imports('re')
def autoconf(mozconfig, autoconf):
mozconfig_autoconf = None
if mozconfig['path']:
make_extra = mozconfig['make_extra']
if make_extra:
for assignment in make_extra:
m = re.match('(?:export\s+)?AUTOCONF\s*:?=\s*(.+)$',
assignment)
if m:
mozconfig_autoconf = m.group(1)
autoconf = autoconf[0] if autoconf else None
for ac in (mozconfig_autoconf, autoconf, 'autoconf-2.13', 'autoconf2.13',
'autoconf213'):
if ac:
autoconf = find_program(ac)
if autoconf:
break
else:
fink = find_program('fink')
if fink:
autoconf = os.path.normpath(os.path.join(
fink, '..', '..', 'lib', 'autoconf2.13', 'bin', 'autoconf'))
else:
brew = find_program('brew')
if brew:
autoconf = os.path.normpath(os.path.join(
brew, '..', '..', 'Cellar', 'autoconf213', '2.13', 'bin',
'autoconf213'))
if not autoconf:
die('Could not find autoconf 2.13')
if not exists(autoconf):
die('Could not find autoconf 2.13 at %s', autoconf)
return autoconf
set_config('AUTOCONF', autoconf)
@depends('OLD_CONFIGURE', mozconfig, autoconf, check_build_environment, shell,
old_configure_assignments, build_project)
@imports(_from='__builtin__', _import='open')
@imports(_from='__builtin__', _import='print')
@imports('glob')
@imports('sys')
@imports('itertools')
@imports('subprocess')
# Import getmtime without overwriting the sandbox os.path.
@imports(_from='os.path', _import='getmtime')
@imports(_from='os.path', _import='exists')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='os', _import='environ')
def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
old_configure_assignments, build_project):
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
# which is actually necessary because this path actually ends up literally
@@ -60,22 +98,11 @@ def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
refresh = False
if refresh:
autoconf = os.path.join(build_env.topsrcdir, 'build', 'autoconf', 'autoconf.sh')
log.info('Refreshing %s with %s', old_configure, autoconf)
env = dict(environ)
env['M4'] = m4
env['AWK'] = awk
env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
my_env = env
# Handle Python 2.7 not allowing unicode in the environment on Windows
if sys.platform == 'win32':
my_env = dict()
for e in env:
my_env[e.encode('ascii','ignore')] = env[e].encode('ascii','ignore')
script = subprocess.check_output([
shell, autoconf,
'--localdir=%s' % os.path.dirname(old_configure),
old_configure + '.in'], env=my_env)
old_configure + '.in'])
# Make old-configure append to config.log, where we put our own log.
# This could be done with a m4 macro, but it's way easier this way
@@ -100,6 +127,10 @@ def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
for key in mozconfig[t]['removed'].keys():
inject("unset %s" % key)
# Autoconf is special, because it might be passed from
# mozconfig['make_extra'], which we don't pass automatically above.
inject('export AUTOCONF=%s' % quote(autoconf))
for assignment in old_configure_assignments:
inject(assignment)
@@ -176,7 +207,6 @@ def old_configure_options(*options):
'--enable-necko-wifi',
'--enable-negotiateauth',
'--enable-nfc',
'--enable-npapi',
'--enable-nspr-build',
'--enable-official-branding',
'--enable-official-vendor',
@@ -205,6 +235,7 @@ def old_configure_options(*options):
'--enable-small-chunk-size',
'--enable-startup-notification',
'--enable-startupcache',
'--enable-stdcxx-compat',
'--enable-strip',
'--enable-synth-pico',
'--enable-system-cairo',
@@ -268,7 +299,6 @@ def old_configure_options(*options):
'--with-thumb-interwork',
'--with-unify-dist',
'--with-user-appdir',
'--with-xulrunner-stub-name',
'--x-includes',
'--x-libraries',
@@ -281,7 +311,6 @@ def old_configure_options(*options):
'--enable-incomplete-external-linkage',
'--enable-mailnews',
'--enable-mailnews-oauth2',
'--enable-classic-account-wizard',
# Below are configure flags used by Pale Moon
'--disable-browser-statusbar',
+21
View File
@@ -8,6 +8,9 @@ def Binary():
'''Generic template for target binaries. Meant to be used by other
templates.'''
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
USE_LIBS += ['stdc++compat']
# Ideally, we'd support not adding this to the LIB_IS_C_ONLY case,
# but that variable is actually only set in db/sqlite/src, which
# doesn't build a shared library on the relevant platforms anyways.
@@ -74,11 +77,27 @@ def Framework(name):
IS_FRAMEWORK = True
@template
def HostStdCppCompat():
'''Template for libstdc++ compatibility for host binaries.'''
if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
HOST_USE_LIBS += ['host_stdc++compat']
@template
def HostProgram(name, c_only=False):
'''Template for build tools executables.'''
HOST_PROGRAM = name
# With context-based templates, this won't be needed anymore, and will
# work better than relying on the caller setting it, but at the moment,
# this is the best we have. And it doesn't matter /that/ much, so there's
# really only one place using this, where it does matter to avoid the
# extra dependency (because it creates a circular one).
if not c_only:
HostStdCppCompat()
@template
def HostSimplePrograms(names, ext='.cpp'):
@@ -90,6 +109,8 @@ def HostSimplePrograms(names, ext='.cpp'):
HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
for name in names]
HostStdCppCompat()
@template
def HostLibrary(name):
+3
View File
@@ -3,6 +3,9 @@
# 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/.
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION'] or CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
DIRS += ['stdc++compat']
if CONFIG['USE_ELF_HACK']:
DIRS += ['elfhack']
+15
View File
@@ -0,0 +1,15 @@
# Avoid dependency on libstdc++ 4.7
ac_add_options --enable-stdcxx-compat
TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
if [ -f "$TOOLTOOL_DIR/clang/lib/libstdc++.so" ]; then
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/clang/lib
elif [ -f "$TOOLTOOL_DIR/gcc/lib/libstdc++.so" ]; then
# We put both 32-bits and 64-bits library path in LD_LIBRARY_PATH: ld.so
# will prefer the files in the 32-bits path when loading 32-bits executables,
# and the files in the 64-bits path when loading 64-bits executables.
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/gcc/lib64:$TOOLTOOL_DIR/gcc/lib
fi
mk_add_options "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
+2
View File
@@ -30,3 +30,5 @@ ac_add_options --enable-pie
ac_add_options --disable-install-strip
# -gline-tables-only results in significantly smaller binaries.
ac_add_options --enable-debug-symbols="-gline-tables-only"
. "$topsrcdir/build/unix/mozconfig.stdcxx"
+7
View File
@@ -0,0 +1,7 @@
# 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/.
ENABLE_CLANG_PLUGIN :=
include $(topsrcdir)/config/rules.mk
+23
View File
@@ -0,0 +1,23 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# 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/.
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
Library('stdc++compat')
SOURCES += ['stdc++compat.cpp']
if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
HostLibrary('host_stdc++compat')
HOST_SOURCES += [
'stdc++compat.cpp',
]
FORCE_STATIC_LIB = True
NO_PGO = True
DISABLE_STL_WRAPPING = True
DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']
HOST_DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']
+78
View File
@@ -0,0 +1,78 @@
/* 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/. */
#include <ostream>
#include <istream>
#include <string>
#include <stdarg.h>
#include <stdio.h>
#include <mozilla/Assertions.h>
/* GLIBCXX_3.4.8 is from gcc 4.1.1 (111691)
GLIBCXX_3.4.9 is from gcc 4.2.0 (111690)
GLIBCXX_3.4.10 is from gcc 4.3.0 (126287)
GLIBCXX_3.4.11 is from gcc 4.4.0 (133006)
GLIBCXX_3.4.12 is from gcc 4.4.1 (147138)
GLIBCXX_3.4.13 is from gcc 4.4.2 (151127)
GLIBCXX_3.4.14 is from gcc 4.5.0 (151126)
GLIBCXX_3.4.15 is from gcc 4.6.0 (160071)
GLIBCXX_3.4.16 is from gcc 4.6.1 (172240)
GLIBCXX_3.4.17 is from gcc 4.7.0 (174383)
GLIBCXX_3.4.18 is from gcc 4.8.0 (190787)
GLIBCXX_3.4.19 is from gcc 4.8.1 (199309)
GLIBCXX_3.4.20 is from gcc 4.9.0 (199307)
GLIBCXX_3.4.21 is from gcc 5.0 (210290)
This file adds the necessary compatibility tricks to avoid symbols with
version GLIBCXX_3.4.16 and bigger, keeping binary compatibility with
libstdc++ 4.6.1.
*/
#define GLIBCXX_VERSION(a, b, c) (((a) << 16) | ((b) << 8) | (c))
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 20)
namespace std {
/* We shouldn't be throwing exceptions at all, but it sadly turns out
we call STL (inline) functions that do. */
void __throw_out_of_range_fmt(char const* fmt, ...)
{
va_list ap;
char buf[1024]; // That should be big enough.
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
buf[sizeof(buf) - 1] = 0;
va_end(ap);
__throw_range_error(buf);
}
}
#endif
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 20)
/* Technically, this symbol is not in GLIBCXX_3.4.20, but in CXXABI_1.3.8,
but that's equivalent, version-wise. Those calls are added by the compiler
itself on `new Class[n]` calls. */
extern "C" void
__cxa_throw_bad_array_new_length()
{
MOZ_CRASH();
}
#endif
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 21)
/* While we generally don't build with exceptions, we have some host tools
* that do use them. libstdc++ from GCC 5.0 added exception constructors with
* char const* argument. Older versions only have a constructor with
* std::string. */
namespace std {
runtime_error::runtime_error(char const* s)
: runtime_error(std::string(s))
{
}
}
#endif
+5 -18
View File
@@ -535,8 +535,7 @@ NS_IMPL_ISUPPORTS(nsScriptSecurityManager,
///////////////// Security Checks /////////////////
bool
nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx,
JS::HandleValue aValue)
nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
{
MOZ_ASSERT(cx == nsContentUtils::GetCurrentJSContext());
nsCOMPtr<nsIPrincipal> subjectPrincipal = nsContentUtils::SubjectPrincipal();
@@ -559,23 +558,12 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx,
}
if (reportViolation) {
JS::Rooted<JSString*> jsString(cx, JS::ToString(cx, aValue));
if (NS_WARN_IF(!jsString)) {
JS_ClearPendingException(cx);
return false;
}
nsAutoJSString scriptSample;
if (NS_WARN_IF(!scriptSample.init(cx, jsString))) {
JS_ClearPendingException(cx);
return false;
}
JS::AutoFilename scriptFilename;
nsAutoString fileName;
unsigned lineNum = 0;
unsigned columnNum = 0;
if (JS::DescribeScriptedCaller(cx, &scriptFilename, &lineNum, &columnNum)) {
NS_NAMED_LITERAL_STRING(scriptSample, "call to eval() or related function blocked by CSP");
JS::AutoFilename scriptFilename;
if (JS::DescribeScriptedCaller(cx, &scriptFilename, &lineNum)) {
if (const char *file = scriptFilename.get()) {
CopyUTF8toUTF16(nsDependentCString(file), fileName);
}
@@ -586,7 +574,6 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx,
fileName,
scriptSample,
lineNum,
columnNum,
EmptyString(),
EmptyString());
}
+1 -1
View File
@@ -91,7 +91,7 @@ private:
// Decides, based on CSP, whether or not eval() and stuff can be executed.
static bool
ContentSecurityPolicyPermitsJSAction(JSContext *cx, JS::HandleValue aValue);
ContentSecurityPolicyPermitsJSAction(JSContext *cx);
static bool
JSPrincipalsSubsume(JSPrincipals *first, JSPrincipals *second);
+33 -5
View File
@@ -526,17 +526,45 @@ EXPAND_MKSHLIB_ARGS += --symbol-order $(SYMBOL_ORDER)
endif
EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) $(EXPAND_MKSHLIB_ARGS) -- $(MKSHLIB)
ifeq ($(OS_ARCH),SunOS)
ELF_TEST = elfdump -N .dynamic $(1)
else
ELF_TEST = $(TOOLCHAIN_PREFIX)readelf -d $(1)
# $(call CHECK_SYMBOLS,lib,PREFIX,dep_name,test)
# Checks that the given `lib` doesn't contain dependency on symbols with a
# version starting with `PREFIX`_ and matching the `test`. `dep_name` is only
# used for the error message.
# `test` is an awk expression using the information in the variable `v` which
# contains a list of version items ([major, minor, ...]).
define CHECK_SYMBOLS
@$(TOOLCHAIN_PREFIX)readelf -sW $(1) | \
awk '$$8 ~ /@$(2)_/ { \
split($$8,a,"@"); \
split(a[2],b,"_"); \
split(b[2],v,"."); \
if ($(4)) { \
if (!found) { \
print "TEST-UNEXPECTED-FAIL | check_stdcxx | We do not want these $(3) symbol versions to be used:" \
} \
print " ",$$8; \
found=1 \
} \
} \
END { \
if (found) { \
exit(1) \
} \
}'
endef
ifneq (,$(MOZ_LIBSTDCXX_TARGET_VERSION)$(MOZ_LIBSTDCXX_HOST_VERSION))
CHECK_STDCXX = $(call CHECK_SYMBOLS,$(1),GLIBCXX,libstdc++,v[1] > 3 || (v[1] == 3 && v[2] == 4 && v[3] > 16))
CHECK_GLIBC = $(call CHECK_SYMBOLS,$(1),GLIBC,libc,v[1] > 2 || (v[1] == 2 && v[2] > 12))
endif
ifeq (,$(filter $(OS_TARGET),WINNT Darwin))
CHECK_TEXTREL = @$(ELF_TEST) | grep TEXTREL > /dev/null && echo 'TEST-UNEXPECTED-FAIL | check_textrel | We do not want text relocations in libraries and programs' || true
CHECK_TEXTREL = @$(TOOLCHAIN_PREFIX)readelf -d $(1) | grep TEXTREL > /dev/null && echo 'TEST-UNEXPECTED-FAIL | check_textrel | We do not want text relocations in libraries and programs' || true
endif
define CHECK_BINARY
$(call CHECK_GLIBC,$(1))
$(call CHECK_STDCXX,$(1))
$(call CHECK_TEXTREL,$(1))
$(call LOCAL_CHECKS,$(1))
$(call CHECK_MOZGLUE_ORDER,$(1))
@@ -2,11 +2,11 @@
# 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/.
include('/toolkit/toolkit.mozbuild')
ifdef MOZ_TREE_FREETYPE
if CONFIG['MOZ_EXTENSIONS']:
DIRS += ['/extensions']
include $(topsrcdir)/config/config.mk
DIRS += [
'/xulrunner',
]
$(STATIC_LIBS):
$(MAKE) -C $(DEPTH)/modules/freetype2
endif
+13
View File
@@ -0,0 +1,13 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# 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/.
Library('freetype')
if CONFIG['MOZ_TREE_FREETYPE']:
USE_LIBS += [
'static:/modules/freetype2/.libs/freetype',
]
else:
OS_LIBS += CONFIG['FT2_LIBS']
-2
View File
@@ -15,5 +15,3 @@ LOCAL_INCLUDES += ['/intl/icu/source/i18n']
include('../defs.mozbuild')
include('sources.mozbuild')
SOURCES += sources
+29 -30
View File
@@ -1,5 +1,5 @@
# THIS FILE IS GENERATED BY /intl/icu_sources_data.py DO NOT EDIT
sources = [
SOURCES += [
'/intl/icu/source/common/appendable.cpp',
'/intl/icu/source/common/bmpset.cpp',
'/intl/icu/source/common/brkeng.cpp',
@@ -8,12 +8,15 @@ sources = [
'/intl/icu/source/common/bytestream.cpp',
'/intl/icu/source/common/bytestrie.cpp',
'/intl/icu/source/common/bytestriebuilder.cpp',
'/intl/icu/source/common/bytestrieiterator.cpp',
'/intl/icu/source/common/caniter.cpp',
'/intl/icu/source/common/characterproperties.cpp',
'/intl/icu/source/common/chariter.cpp',
'/intl/icu/source/common/charstr.cpp',
'/intl/icu/source/common/cmemory.cpp',
'/intl/icu/source/common/cstr.cpp',
'/intl/icu/source/common/cstring.cpp',
'/intl/icu/source/common/cwchar.cpp',
'/intl/icu/source/common/dictbe.cpp',
'/intl/icu/source/common/dictionarydata.cpp',
'/intl/icu/source/common/dtintrv.cpp',
@@ -21,6 +24,8 @@ sources = [
'/intl/icu/source/common/errorcode.cpp',
'/intl/icu/source/common/filteredbrk.cpp',
'/intl/icu/source/common/filterednormalizer2.cpp',
'/intl/icu/source/common/icudataver.cpp',
'/intl/icu/source/common/icuplug.cpp',
'/intl/icu/source/common/loadednormalizer2impl.cpp',
'/intl/icu/source/common/locavailable.cpp',
'/intl/icu/source/common/locbased.cpp',
@@ -37,7 +42,9 @@ sources = [
'/intl/icu/source/common/normlzr.cpp',
'/intl/icu/source/common/parsepos.cpp',
'/intl/icu/source/common/patternprops.cpp',
'/intl/icu/source/common/pluralmap.cpp',
'/intl/icu/source/common/propname.cpp',
'/intl/icu/source/common/propsvec.cpp',
'/intl/icu/source/common/punycode.cpp',
'/intl/icu/source/common/putil.cpp',
'/intl/icu/source/common/rbbi.cpp',
@@ -50,6 +57,7 @@ sources = [
'/intl/icu/source/common/rbbistbl.cpp',
'/intl/icu/source/common/rbbitblb.cpp',
'/intl/icu/source/common/resbund.cpp',
'/intl/icu/source/common/resbund_cnv.cpp',
'/intl/icu/source/common/resource.cpp',
'/intl/icu/source/common/ruleiter.cpp',
'/intl/icu/source/common/schriter.cpp',
@@ -69,11 +77,13 @@ sources = [
'/intl/icu/source/common/ubidi.cpp',
'/intl/icu/source/common/ubidi_props.cpp',
'/intl/icu/source/common/ubidiln.cpp',
'/intl/icu/source/common/ubiditransform.cpp',
'/intl/icu/source/common/ubidiwrt.cpp',
'/intl/icu/source/common/ubrk.cpp',
'/intl/icu/source/common/ucase.cpp',
'/intl/icu/source/common/ucasemap.cpp',
'/intl/icu/source/common/ucasemap_titlecase_brkiter.cpp',
'/intl/icu/source/common/ucat.cpp',
'/intl/icu/source/common/uchar.cpp',
'/intl/icu/source/common/ucharstrie.cpp',
'/intl/icu/source/common/ucharstriebuilder.cpp',
@@ -82,18 +92,28 @@ sources = [
'/intl/icu/source/common/ucln_cmn.cpp',
'/intl/icu/source/common/ucmndata.cpp',
'/intl/icu/source/common/ucnv.cpp',
'/intl/icu/source/common/ucnv2022.cpp',
'/intl/icu/source/common/ucnv_bld.cpp',
'/intl/icu/source/common/ucnv_cb.cpp',
'/intl/icu/source/common/ucnv_cnv.cpp',
'/intl/icu/source/common/ucnv_ct.cpp',
'/intl/icu/source/common/ucnv_err.cpp',
'/intl/icu/source/common/ucnv_ext.cpp',
'/intl/icu/source/common/ucnv_io.cpp',
'/intl/icu/source/common/ucnv_lmb.cpp',
'/intl/icu/source/common/ucnv_set.cpp',
'/intl/icu/source/common/ucnv_u16.cpp',
'/intl/icu/source/common/ucnv_u32.cpp',
'/intl/icu/source/common/ucnv_u7.cpp',
'/intl/icu/source/common/ucnv_u8.cpp',
'/intl/icu/source/common/ucnvbocu.cpp',
'/intl/icu/source/common/ucnvdisp.cpp',
'/intl/icu/source/common/ucnvhz.cpp',
'/intl/icu/source/common/ucnvisci.cpp',
'/intl/icu/source/common/ucnvlat1.cpp',
'/intl/icu/source/common/ucnvmbcs.cpp',
'/intl/icu/source/common/ucnvscsu.cpp',
'/intl/icu/source/common/ucnvsel.cpp',
'/intl/icu/source/common/ucol_swp.cpp',
'/intl/icu/source/common/ucptrie.cpp',
'/intl/icu/source/common/ucurr.cpp',
@@ -103,6 +123,7 @@ sources = [
'/intl/icu/source/common/uenum.cpp',
'/intl/icu/source/common/uhash.cpp',
'/intl/icu/source/common/uhash_us.cpp',
'/intl/icu/source/common/uidna.cpp',
'/intl/icu/source/common/uinit.cpp',
'/intl/icu/source/common/uinvchar.cpp',
'/intl/icu/source/common/uiter.cpp',
@@ -128,20 +149,25 @@ sources = [
'/intl/icu/source/common/unistr_cnv.cpp',
'/intl/icu/source/common/unistr_props.cpp',
'/intl/icu/source/common/unistr_titlecase_brkiter.cpp',
'/intl/icu/source/common/unorm.cpp',
'/intl/icu/source/common/unormcmp.cpp',
'/intl/icu/source/common/uobject.cpp',
'/intl/icu/source/common/uprops.cpp',
'/intl/icu/source/common/ures_cnv.cpp',
'/intl/icu/source/common/uresbund.cpp',
'/intl/icu/source/common/uresdata.cpp',
'/intl/icu/source/common/usc_impl.cpp',
'/intl/icu/source/common/uscript.cpp',
'/intl/icu/source/common/uscript_props.cpp',
'/intl/icu/source/common/uset.cpp',
'/intl/icu/source/common/uset_props.cpp',
'/intl/icu/source/common/usetiter.cpp',
'/intl/icu/source/common/ushape.cpp',
'/intl/icu/source/common/usprep.cpp',
'/intl/icu/source/common/ustack.cpp',
'/intl/icu/source/common/ustr_cnv.cpp',
'/intl/icu/source/common/ustr_titlecase_brkiter.cpp',
'/intl/icu/source/common/ustr_wcs.cpp',
'/intl/icu/source/common/ustrcase.cpp',
'/intl/icu/source/common/ustrcase_locale.cpp',
'/intl/icu/source/common/ustrenum.cpp',
@@ -151,6 +177,7 @@ sources = [
'/intl/icu/source/common/utext.cpp',
'/intl/icu/source/common/utf_impl.cpp',
'/intl/icu/source/common/util.cpp',
'/intl/icu/source/common/util_props.cpp',
'/intl/icu/source/common/utrace.cpp',
'/intl/icu/source/common/utrie.cpp',
'/intl/icu/source/common/utrie2.cpp',
@@ -163,35 +190,7 @@ sources = [
'/intl/icu/source/common/uvectr64.cpp',
'/intl/icu/source/common/wintz.cpp',
]
other_sources = [
'/intl/icu/source/common/bytestrieiterator.cpp',
'/intl/icu/source/common/cstr.cpp',
'/intl/icu/source/common/cwchar.cpp',
'/intl/icu/source/common/icudataver.cpp',
'/intl/icu/source/common/icuplug.cpp',
'/intl/icu/source/common/pluralmap.cpp',
'/intl/icu/source/common/propsvec.cpp',
'/intl/icu/source/common/resbund_cnv.cpp',
'/intl/icu/source/common/ubiditransform.cpp',
'/intl/icu/source/common/ucat.cpp',
'/intl/icu/source/common/ucnv2022.cpp',
'/intl/icu/source/common/ucnv_ct.cpp',
'/intl/icu/source/common/ucnv_ext.cpp',
'/intl/icu/source/common/ucnv_lmb.cpp',
'/intl/icu/source/common/ucnv_set.cpp',
'/intl/icu/source/common/ucnvdisp.cpp',
'/intl/icu/source/common/ucnvhz.cpp',
'/intl/icu/source/common/ucnvisci.cpp',
'/intl/icu/source/common/ucnvmbcs.cpp',
'/intl/icu/source/common/ucnvsel.cpp',
'/intl/icu/source/common/uidna.cpp',
'/intl/icu/source/common/unorm.cpp',
'/intl/icu/source/common/ures_cnv.cpp',
'/intl/icu/source/common/usc_impl.cpp',
'/intl/icu/source/common/ushape.cpp',
'/intl/icu/source/common/ustr_wcs.cpp',
'/intl/icu/source/common/util_props.cpp',
]
EXPORTS.unicode += [
'/intl/icu/source/common/unicode/appendable.h',
'/intl/icu/source/common/unicode/brkiter.h',
+5 -14
View File
@@ -3,6 +3,10 @@
# 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/.
if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
# Copy the pre-built ICU data file to dist/bin.
FINAL_TARGET_FILES += [CONFIG['ICU_DATA_FILE']]
# Build a library containing the ICU data for use in the JS shell, so that
# JSAPI consumers don't have to deal with setting ICU's data path.
Library('icudata')
@@ -13,13 +17,8 @@ if CONFIG['OS_ARCH'] == 'WINNT':
elif CONFIG['OS_ARCH'] == 'Darwin':
ASFLAGS += ['-DPREFIX']
data_file = {
'little': 'icudt%sl.dat' % CONFIG['MOZ_ICU_VERSION'],
'big': 'icudt%sb.dat' % CONFIG['MOZ_ICU_VERSION'],
}
ASFLAGS += [
'-DICU_DATA_FILE="%s"' % data_file[CONFIG['TARGET_ENDIANNESS']],
'-DICU_DATA_FILE="%s"' % CONFIG['ICU_DATA_FILE'],
'-DICU_DATA_SYMBOL=icudt%s_dat' % CONFIG['MOZ_ICU_VERSION'],
]
LOCAL_INCLUDES += ['.']
@@ -27,13 +26,5 @@ LOCAL_INCLUDES += ['.']
if CONFIG['HAVE_YASM']:
USE_YASM = True
SOURCES += ['icudata.s']
elif CONFIG['OS_ARCH'] == 'Darwin':
if CONFIG['CPU_ARCH'] != 'ppc':
SOURCES += ['icudata_gas.S']
elif CONFIG['GNU_AS']:
SOURCES += ['icudata_gas.S']
if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
# Copy the pre-built ICU data file to dist/bin.
FINAL_TARGET_FILES += [data_file[CONFIG['TARGET_ENDIANNESS']]]
-3
View File
@@ -12,6 +12,3 @@ LOCAL_INCLUDES += ['/intl/icu/source/common']
include('../defs.mozbuild')
include('sources.mozbuild')
SOURCES += sources
+57 -58
View File
@@ -1,10 +1,14 @@
# THIS FILE IS GENERATED BY /intl/icu_sources_data.py DO NOT EDIT
sources = [
SOURCES += [
'/intl/icu/source/i18n/alphaindex.cpp',
'/intl/icu/source/i18n/anytrans.cpp',
'/intl/icu/source/i18n/astro.cpp',
'/intl/icu/source/i18n/basictz.cpp',
'/intl/icu/source/i18n/bocsu.cpp',
'/intl/icu/source/i18n/brktrans.cpp',
'/intl/icu/source/i18n/buddhcal.cpp',
'/intl/icu/source/i18n/calendar.cpp',
'/intl/icu/source/i18n/casetrn.cpp',
'/intl/icu/source/i18n/cecal.cpp',
'/intl/icu/source/i18n/chnsecal.cpp',
'/intl/icu/source/i18n/choicfmt.cpp',
@@ -31,6 +35,15 @@ sources = [
'/intl/icu/source/i18n/collationweights.cpp',
'/intl/icu/source/i18n/compactdecimalformat.cpp',
'/intl/icu/source/i18n/coptccal.cpp',
'/intl/icu/source/i18n/cpdtrans.cpp',
'/intl/icu/source/i18n/csdetect.cpp',
'/intl/icu/source/i18n/csmatch.cpp',
'/intl/icu/source/i18n/csr2022.cpp',
'/intl/icu/source/i18n/csrecog.cpp',
'/intl/icu/source/i18n/csrmbcs.cpp',
'/intl/icu/source/i18n/csrsbcs.cpp',
'/intl/icu/source/i18n/csrucode.cpp',
'/intl/icu/source/i18n/csrutf8.cpp',
'/intl/icu/source/i18n/curramt.cpp',
'/intl/icu/source/i18n/currfmt.cpp',
'/intl/icu/source/i18n/currpinf.cpp',
@@ -55,15 +68,20 @@ sources = [
'/intl/icu/source/i18n/dtptngen.cpp',
'/intl/icu/source/i18n/dtrule.cpp',
'/intl/icu/source/i18n/erarules.cpp',
'/intl/icu/source/i18n/esctrn.cpp',
'/intl/icu/source/i18n/ethpccal.cpp',
'/intl/icu/source/i18n/fmtable.cpp',
'/intl/icu/source/i18n/fmtable_cnv.cpp',
'/intl/icu/source/i18n/format.cpp',
'/intl/icu/source/i18n/fphdlimp.cpp',
'/intl/icu/source/i18n/fpositer.cpp',
'/intl/icu/source/i18n/funcrepl.cpp',
'/intl/icu/source/i18n/gender.cpp',
'/intl/icu/source/i18n/gregocal.cpp',
'/intl/icu/source/i18n/gregoimp.cpp',
'/intl/icu/source/i18n/hebrwcal.cpp',
'/intl/icu/source/i18n/indiancal.cpp',
'/intl/icu/source/i18n/inputext.cpp',
'/intl/icu/source/i18n/islamcal.cpp',
'/intl/icu/source/i18n/japancal.cpp',
'/intl/icu/source/i18n/listformatter.cpp',
@@ -71,10 +89,13 @@ sources = [
'/intl/icu/source/i18n/measunit.cpp',
'/intl/icu/source/i18n/measure.cpp',
'/intl/icu/source/i18n/msgfmt.cpp',
'/intl/icu/source/i18n/name2uni.cpp',
'/intl/icu/source/i18n/nfrs.cpp',
'/intl/icu/source/i18n/nfrule.cpp',
'/intl/icu/source/i18n/nfsubs.cpp',
'/intl/icu/source/i18n/nortrans.cpp',
'/intl/icu/source/i18n/nounit.cpp',
'/intl/icu/source/i18n/nultrans.cpp',
'/intl/icu/source/i18n/number_affixutils.cpp',
'/intl/icu/source/i18n/number_asformat.cpp',
'/intl/icu/source/i18n/number_capi.cpp',
@@ -117,13 +138,27 @@ sources = [
'/intl/icu/source/i18n/persncal.cpp',
'/intl/icu/source/i18n/plurfmt.cpp',
'/intl/icu/source/i18n/plurrule.cpp',
'/intl/icu/source/i18n/quant.cpp',
'/intl/icu/source/i18n/quantityformatter.cpp',
'/intl/icu/source/i18n/rbnf.cpp',
'/intl/icu/source/i18n/rbt.cpp',
'/intl/icu/source/i18n/rbt_data.cpp',
'/intl/icu/source/i18n/rbt_pars.cpp',
'/intl/icu/source/i18n/rbt_rule.cpp',
'/intl/icu/source/i18n/rbt_set.cpp',
'/intl/icu/source/i18n/rbtz.cpp',
'/intl/icu/source/i18n/regexcmp.cpp',
'/intl/icu/source/i18n/regeximp.cpp',
'/intl/icu/source/i18n/regexst.cpp',
'/intl/icu/source/i18n/regextxt.cpp',
'/intl/icu/source/i18n/region.cpp',
'/intl/icu/source/i18n/reldatefmt.cpp',
'/intl/icu/source/i18n/reldtfmt.cpp',
'/intl/icu/source/i18n/rematch.cpp',
'/intl/icu/source/i18n/remtrans.cpp',
'/intl/icu/source/i18n/repattrn.cpp',
'/intl/icu/source/i18n/rulebasedcollator.cpp',
'/intl/icu/source/i18n/scientificnumberformatter.cpp',
'/intl/icu/source/i18n/scriptset.cpp',
'/intl/icu/source/i18n/search.cpp',
'/intl/icu/source/i18n/selfmt.cpp',
@@ -133,12 +168,20 @@ sources = [
'/intl/icu/source/i18n/smpdtfst.cpp',
'/intl/icu/source/i18n/sortkey.cpp',
'/intl/icu/source/i18n/standardplural.cpp',
'/intl/icu/source/i18n/strmatch.cpp',
'/intl/icu/source/i18n/strrepl.cpp',
'/intl/icu/source/i18n/stsearch.cpp',
'/intl/icu/source/i18n/taiwncal.cpp',
'/intl/icu/source/i18n/timezone.cpp',
'/intl/icu/source/i18n/titletrn.cpp',
'/intl/icu/source/i18n/tmunit.cpp',
'/intl/icu/source/i18n/tmutamt.cpp',
'/intl/icu/source/i18n/tmutfmt.cpp',
'/intl/icu/source/i18n/tolowtrn.cpp',
'/intl/icu/source/i18n/toupptrn.cpp',
'/intl/icu/source/i18n/translit.cpp',
'/intl/icu/source/i18n/transreg.cpp',
'/intl/icu/source/i18n/tridpars.cpp',
'/intl/icu/source/i18n/tzfmt.cpp',
'/intl/icu/source/i18n/tzgnames.cpp',
'/intl/icu/source/i18n/tznames.cpp',
@@ -151,86 +194,42 @@ sources = [
'/intl/icu/source/i18n/ucol_res.cpp',
'/intl/icu/source/i18n/ucol_sit.cpp',
'/intl/icu/source/i18n/ucoleitr.cpp',
'/intl/icu/source/i18n/ucsdet.cpp',
'/intl/icu/source/i18n/udat.cpp',
'/intl/icu/source/i18n/udateintervalformat.cpp',
'/intl/icu/source/i18n/udatpg.cpp',
'/intl/icu/source/i18n/ufieldpositer.cpp',
'/intl/icu/source/i18n/uitercollationiterator.cpp',
'/intl/icu/source/i18n/ulistformatter.cpp',
'/intl/icu/source/i18n/ulocdata.cpp',
'/intl/icu/source/i18n/umsg.cpp',
'/intl/icu/source/i18n/unesctrn.cpp',
'/intl/icu/source/i18n/uni2name.cpp',
'/intl/icu/source/i18n/unum.cpp',
'/intl/icu/source/i18n/unumsys.cpp',
'/intl/icu/source/i18n/upluralrules.cpp',
'/intl/icu/source/i18n/uregex.cpp',
'/intl/icu/source/i18n/uregexc.cpp',
'/intl/icu/source/i18n/uregion.cpp',
'/intl/icu/source/i18n/usearch.cpp',
'/intl/icu/source/i18n/uspoof.cpp',
'/intl/icu/source/i18n/uspoof_build.cpp',
'/intl/icu/source/i18n/uspoof_conf.cpp',
'/intl/icu/source/i18n/uspoof_impl.cpp',
'/intl/icu/source/i18n/utf16collationiterator.cpp',
'/intl/icu/source/i18n/utf8collationiterator.cpp',
'/intl/icu/source/i18n/utmscale.cpp',
'/intl/icu/source/i18n/utrans.cpp',
'/intl/icu/source/i18n/vtzone.cpp',
'/intl/icu/source/i18n/vzone.cpp',
'/intl/icu/source/i18n/windtfmt.cpp',
'/intl/icu/source/i18n/winnmfmt.cpp',
'/intl/icu/source/i18n/wintzimpl.cpp',
'/intl/icu/source/i18n/zonemeta.cpp',
]
other_sources = [
'/intl/icu/source/i18n/alphaindex.cpp',
'/intl/icu/source/i18n/anytrans.cpp',
'/intl/icu/source/i18n/brktrans.cpp',
'/intl/icu/source/i18n/casetrn.cpp',
'/intl/icu/source/i18n/cpdtrans.cpp',
'/intl/icu/source/i18n/csdetect.cpp',
'/intl/icu/source/i18n/csmatch.cpp',
'/intl/icu/source/i18n/csr2022.cpp',
'/intl/icu/source/i18n/csrecog.cpp',
'/intl/icu/source/i18n/csrmbcs.cpp',
'/intl/icu/source/i18n/csrsbcs.cpp',
'/intl/icu/source/i18n/csrucode.cpp',
'/intl/icu/source/i18n/csrutf8.cpp',
'/intl/icu/source/i18n/esctrn.cpp',
'/intl/icu/source/i18n/fmtable_cnv.cpp',
'/intl/icu/source/i18n/funcrepl.cpp',
'/intl/icu/source/i18n/gender.cpp',
'/intl/icu/source/i18n/inputext.cpp',
'/intl/icu/source/i18n/name2uni.cpp',
'/intl/icu/source/i18n/nortrans.cpp',
'/intl/icu/source/i18n/nultrans.cpp',
'/intl/icu/source/i18n/quant.cpp',
'/intl/icu/source/i18n/rbt.cpp',
'/intl/icu/source/i18n/rbt_data.cpp',
'/intl/icu/source/i18n/rbt_pars.cpp',
'/intl/icu/source/i18n/rbt_rule.cpp',
'/intl/icu/source/i18n/rbt_set.cpp',
'/intl/icu/source/i18n/regexcmp.cpp',
'/intl/icu/source/i18n/regeximp.cpp',
'/intl/icu/source/i18n/regexst.cpp',
'/intl/icu/source/i18n/regextxt.cpp',
'/intl/icu/source/i18n/rematch.cpp',
'/intl/icu/source/i18n/remtrans.cpp',
'/intl/icu/source/i18n/repattrn.cpp',
'/intl/icu/source/i18n/scientificnumberformatter.cpp',
'/intl/icu/source/i18n/strmatch.cpp',
'/intl/icu/source/i18n/strrepl.cpp',
'/intl/icu/source/i18n/titletrn.cpp',
'/intl/icu/source/i18n/tolowtrn.cpp',
'/intl/icu/source/i18n/toupptrn.cpp',
'/intl/icu/source/i18n/translit.cpp',
'/intl/icu/source/i18n/transreg.cpp',
'/intl/icu/source/i18n/tridpars.cpp',
'/intl/icu/source/i18n/ucsdet.cpp',
'/intl/icu/source/i18n/udateintervalformat.cpp',
'/intl/icu/source/i18n/ulocdata.cpp',
'/intl/icu/source/i18n/unesctrn.cpp',
'/intl/icu/source/i18n/uni2name.cpp',
'/intl/icu/source/i18n/uregex.cpp',
'/intl/icu/source/i18n/uregexc.cpp',
'/intl/icu/source/i18n/uregion.cpp',
'/intl/icu/source/i18n/uspoof_build.cpp',
'/intl/icu/source/i18n/uspoof_conf.cpp',
'/intl/icu/source/i18n/utrans.cpp',
'/intl/icu/source/i18n/vzone.cpp',
'/intl/icu/source/i18n/zrule.cpp',
'/intl/icu/source/i18n/ztrans.cpp',
]
EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/alphaindex.h',
'/intl/icu/source/i18n/unicode/basictz.h',
+2 -2
View File
@@ -46,7 +46,7 @@ elif CONFIG['OS_TARGET'] == 'Darwin':
)
SOURCES += [
'/nsprpub/pr/src/md/unix/darwin.c',
'/nsprpub/pr/src/md/unix/os_Darwin.S',
'/nsprpub/pr/src/md/unix/os_Darwin.s',
]
if not CONFIG['MOZ_IOS']:
DEFINES['HAVE_CRT_EXTERNS_H'] = True
@@ -85,7 +85,7 @@ elif CONFIG['OS_TARGET'] == 'WINNT':
else:
DEFINES['_X86_'] = True
else:
error('Not a supported OS_TARGET for NSPR in moz.build: "%s". Cannot build.' % CONFIG['OS_TARGET'])
error('Not a supported OS_TARGET for NSPR in moz.build: "%s". Use --with-system-nspr' % CONFIG['OS_TARGET'])
LOCAL_INCLUDES += [
+1 -1
View File
@@ -8,4 +8,4 @@
# Referenced by milestone.py.
#--------------------------------------------------------
6.6.0
6.5.0
-2
View File
@@ -155,10 +155,8 @@ endif
# Interdependencies that moz.build world don't know about yet for compilation.
# Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
ifdef MOZ_ENABLE_NPAPI
toolkit/library/target: widget/gtk/mozgtk/gtk3/target
endif
endif
ifdef MOZ_LDAP_XPCOM
ldap/target: security/target mozglue/build/target
toolkit/library/target: ldap/target
+6 -4
View File
@@ -411,10 +411,6 @@ EXTRA_DSO_LDOPTS += -Wl,--version-script,$(SYMBOLS_FILE)
else
ifeq ($(OS_TARGET),Darwin)
EXTRA_DSO_LDOPTS += -Wl,-exported_symbols_list,$(SYMBOLS_FILE)
else
ifeq ($(OS_TARGET),SunOS)
EXTRA_DSO_LDOPTS += -Wl,-M,$(SYMBOLS_FILE)
endif
endif
endif
endif
@@ -671,6 +667,9 @@ else
$(EXPAND_LIBS_EXEC) -- $(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif # HOST_CPP_PROG_LINK
endif
ifndef CROSS_COMPILE
$(call CHECK_STDCXX,$@)
endif
#
# This is an attempt to support generation of multiple binaries
@@ -713,6 +712,9 @@ else
$(EXPAND_LIBS_EXEC) -- $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif
endif
ifndef CROSS_COMPILE
$(call CHECK_STDCXX,$@)
endif
ifdef DTRACE_PROBE_OBJ
EXTRA_DEPS += $(DTRACE_PROBE_OBJ)
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

@@ -0,0 +1,94 @@
/* 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/. */
window {
-moz-appearance: none;
background-color: transparent;
}
#doorhanger-container {
width: 450px;
}
#top-panel {
padding: 20px;
background: #343c45; /* toolbars */
color: #8fa1b2; /* body text */
/*
* Sloppy preprocessing since UNIX_BUT_NOT_MAC is only defined
* in `browser/app/profile/firefox.js`, which this file cannot
* depend on. Must style font-size to target linux.
*/
%ifdef XP_UNIX
%ifndef XP_MACOSX
font-size: 13px;
%else
font-size: 15px;
%endif
%else
font-size: 15px;
%endif
line-height: 19px;
min-height: 100px;
}
#top-panel h1 {
font-weight: bold;
font-family: Open Sans, sans-serif;
font-size: 1.1em;
}
#top-panel p {
font-family: Open Sans, sans-serif;
font-size: 0.9em;
width: 300px;
display: block;
margin: 5px 0px 0px 0px;
}
#icon {
background-image: url("chrome://devtools/content/framework/dev-edition-promo/dev-edition-logo.png");
background-size: 64px 64px;
background-repeat: no-repeat;
width: 64px;
height: 64px;
margin-right: 20px;
}
#lower-panel {
padding: 20px;
background-color: #252c33; /* tab toolbars */
min-height: 75px;
border-top: 1px solid #292e33; /* text high contrast (light) */
}
#button-container {
margin: auto 20px;
}
#button-container button {
font: message-box !important;
font-size: 16px !important;
cursor: pointer;
width: 125px;
opacity: 1;
position: static;
-moz-appearance: none;
border-radius: 5px;
height: 30px;
width: 450px;
/* Override embossed borders on Windows/Linux */
border: none;
}
#close {
background-color: transparent;
color: #8fa1b2; /* body text */
}
#go {
margin-left: 100px;
background-color: #70bf53; /* green */
color: #f5f7fa; /* selection text color */
}
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<!DOCTYPE window [
<!ENTITY % toolboxDTD SYSTEM "chrome://devtools/locale/toolbox.dtd" >
%toolboxDTD;
]>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet rel="stylesheet" href="chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="dev-edition-promo">
<vbox id="doorhanger-container">
<hbox flex="1" id="top-panel">
<image id="icon" />
<vbox id="info">
<h1>Using Developer Tools in your browser?</h1>
<p>Download Firefox Developer Edition, our first browser made just for you.</p>
</vbox>
</hbox>
<hbox id="lower-panel" flex="1">
<hbox id="button-container" flex="1">
<button id="close"
flex="1"
standalone="true"
label="No thanks">
</button>
<button id="go"
flex="1"
standalone="true"
label="Learn more »">
</button>
</hbox>
</hbox>
</vbox>
</window>
+25 -9
View File
@@ -46,6 +46,8 @@ loader.lazyRequireGetter(this, "InspectorFront",
"devtools/shared/fronts/inspector", true);
loader.lazyRequireGetter(this, "flags",
"devtools/shared/flags");
loader.lazyRequireGetter(this, "showDoorhanger",
"devtools/client/shared/doorhanger", true);
loader.lazyRequireGetter(this, "createPerformanceFront",
"devtools/shared/fronts/performance", true);
loader.lazyRequireGetter(this, "system",
@@ -115,6 +117,7 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId) {
this._saveSplitConsoleHeight = this._saveSplitConsoleHeight.bind(this);
this._onFocus = this._onFocus.bind(this);
this._onBrowserMessage = this._onBrowserMessage.bind(this);
this._showDevEditionPromo = this._showDevEditionPromo.bind(this);
this._updateTextBoxMenuItems = this._updateTextBoxMenuItems.bind(this);
this._onBottomHostMinimized = this._onBottomHostMinimized.bind(this);
this._onBottomHostMaximized = this._onBottomHostMaximized.bind(this);
@@ -146,6 +149,8 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId) {
this.on("host-changed", this._refreshHostTitle);
this.on("select", this._refreshHostTitle);
this.on("ready", this._showDevEditionPromo);
gDevTools.on("tool-registered", this._toolRegistered);
gDevTools.on("tool-unregistered", this._toolUnregistered);
@@ -2090,6 +2095,7 @@ Toolbox.prototype = {
this._target.off("frame-update", this._updateFrames);
this.off("select", this._refreshHostTitle);
this.off("host-changed", this._refreshHostTitle);
this.off("ready", this._showDevEditionPromo);
gDevTools.off("tool-registered", this._toolRegistered);
gDevTools.off("tool-unregistered", this._toolUnregistered);
@@ -2182,16 +2188,14 @@ Toolbox.prototype = {
.then(() => {
this._removeHostListeners();
// `location` may already be invalid if the toolbox document is
// already in process of destruction. Otherwise if it is still
// around, ensure releasing toolbox document and triggering cleanup
// thanks to unload event. We do that precisely here, before
// nullifying the target as various cleanup code depends on the
// target attribute to be still defined.
try {
// `location` may already be null if the toolbox document is already
// in process of destruction. Otherwise if it is still around, ensure
// releasing toolbox document and triggering cleanup thanks to unload
// event. We do that precisely here, before nullifying the target as
// various cleanup code depends on the target attribute to be still
// defined.
if (win.location) {
win.location.replace("about:blank");
} catch (e) {
// Do nothing.
}
// Targets need to be notified that the toolbox is being torn down.
@@ -2247,6 +2251,18 @@ Toolbox.prototype = {
this.emit("highlighter-hide");
},
/**
* For displaying the promotional Doorhanger on first opening of
* the developer tools, promoting the Developer Edition.
*/
_showDevEditionPromo: function () {
// Do not display in browser toolbox
if (this.target.chrome) {
return;
}
showDoorhanger({ window: this.win, type: "deveditionpromo" });
},
/**
* Enable / disable necessary textbox menu items using globalOverlay.js.
*/
+3
View File
@@ -111,6 +111,9 @@ devtools.jar:
content/framework/options-panel.css (framework/options-panel.css)
content/framework/toolbox-process-window.xul (framework/toolbox-process-window.xul)
* content/framework/toolbox-process-window.js (framework/toolbox-process-window.js)
content/framework/dev-edition-promo/dev-edition-promo.xul (framework/dev-edition-promo/dev-edition-promo.xul)
* content/framework/dev-edition-promo/dev-edition-promo.css (framework/dev-edition-promo/dev-edition-promo.css)
content/framework/dev-edition-promo/dev-edition-logo.png (framework/dev-edition-promo/dev-edition-logo.png)
content/inspector/inspector.xhtml (inspector/inspector.xhtml)
content/framework/connect/connect.xhtml (framework/connect/connect.xhtml)
content/framework/connect/connect.css (framework/connect/connect.css)
@@ -39,8 +39,9 @@ function ConverterObserver() {
ConverterObserver.prototype = {
initialize: function () {
// Only the DevEdition has this feature available by default.
// Users need to manually flip 'devtools.jsonview.enabled' preference
// to have it available.
// to have it available in other distributions.
if (this.isEnabled()) {
this.register();
}
+11
View File
@@ -3,6 +3,17 @@
# 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/.
// Developer edition promo preferences
pref("devtools.devedition.promo.shown", false);
pref("devtools.devedition.promo.url", "https://www.mozilla.org/firefox/developer/?utm_source=firefox-dev-tools&utm_medium=firefox-browser&utm_content=betadoorhanger");
// Only potentially show in beta release
#if MOZ_UPDATE_CHANNEL == beta
pref("devtools.devedition.promo.enabled", true);
#else
pref("devtools.devedition.promo.enabled", false);
#endif
// DevTools development workflow
pref("devtools.loader.hotreload", false);
@@ -8,6 +8,7 @@ const Cu = Components.utils;
var {loader, require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Telemetry = require("devtools/client/shared/telemetry");
var {showDoorhanger} = require("devtools/client/shared/doorhanger");
var {TouchEventSimulator} = require("devtools/shared/touch/simulator");
var {Task} = require("devtools/shared/task");
var promise = require("promise");
@@ -254,6 +255,14 @@ ResponsiveUI.prototype = {
yield this.connectToServer();
this.userAgentInput.hidden = false;
// Hook to display promotional Developer Edition doorhanger.
// Only displayed once.
showDoorhanger({
window: this.mainWindow,
type: "deveditionpromo",
anchor: this.chromeDoc.querySelector("#content")
});
// Notify that responsive mode is on.
this._telemetry.toolOpened("responsive");
ResponsiveUIManager.emit("on", { tab: this.tab });
+164
View File
@@ -0,0 +1,164 @@
/* 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/. */
"use strict";
const { Ci, Cc } = require("chrome");
const Services = require("Services");
const { DOMHelpers } = require("resource://devtools/client/shared/DOMHelpers.jsm");
const { Task } = require("devtools/shared/task");
const defer = require("devtools/shared/defer");
const { getMostRecentBrowserWindow } = require("sdk/window/utils");
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const DEV_EDITION_PROMO_URL = "chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.xul";
const DEV_EDITION_PROMO_ENABLED_PREF = "devtools.devedition.promo.enabled";
const DEV_EDITION_PROMO_SHOWN_PREF = "devtools.devedition.promo.shown";
const DEV_EDITION_PROMO_URL_PREF = "devtools.devedition.promo.url";
const LOCALE = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry)
.getSelectedLocale("global");
/**
* Only show Dev Edition promo if it's enabled (beta channel),
* if it has not been shown before, and it's a locale build
* for `en-US`
*/
function shouldDevEditionPromoShow() {
return Services.prefs.getBoolPref(DEV_EDITION_PROMO_ENABLED_PREF) &&
!Services.prefs.getBoolPref(DEV_EDITION_PROMO_SHOWN_PREF) &&
LOCALE === "en-US";
}
var TYPES = {
// The Developer Edition promo doorhanger, called by
// opening the toolbox, browser console, WebIDE, or responsive design mode
// in Beta releases. Only displayed once per profile.
deveditionpromo: {
predicate: shouldDevEditionPromoShow,
success: () => {
return Services.prefs.setBoolPref(DEV_EDITION_PROMO_SHOWN_PREF, true);
},
action: () => {
let url = Services.prefs.getCharPref(DEV_EDITION_PROMO_URL_PREF);
getGBrowser().selectedTab = getGBrowser().addTab(url);
},
url: DEV_EDITION_PROMO_URL
}
};
var panelAttrs = {
orient: "vertical",
hidden: "false",
consumeoutsideclicks: "true",
noautofocus: "true",
align: "start",
role: "alert"
};
/**
* Helper to call a doorhanger, defined in `TYPES`, with defined conditions,
* success handlers and loads its own XUL in a frame. Takes an object with
* several properties:
*
* @param {XULWindow} window
* The window that should house the doorhanger.
* @param {String} type
* The type of doorhanger to be displayed is, using the `TYPES`
* definition.
* @param {String} selector
* The selector that the doorhanger should be appended to within
* `window`. Defaults to a XUL Document's `window` element.
*/
exports.showDoorhanger = Task.async(function* ({ window, type, anchor }) {
let { predicate, success, url, action } = TYPES[type];
// Abort if predicate fails
if (!predicate()) {
return;
}
// Call success function to set preferences/cleanup immediately,
// so if triggered multiple times, only happens once (Windows/Linux)
success();
// Wait 200ms to prevent flickering where the popup is displayed
// before the underlying window (Windows 7, 64bit)
yield wait(200);
let document = window.document;
let panel = document.createElementNS(XULNS, "panel");
let frame = document.createElementNS(XULNS, "iframe");
let parentEl = document.querySelector("window");
frame.setAttribute("src", url);
let close = () => parentEl.removeChild(panel);
setDoorhangerStyle(panel, frame);
panel.appendChild(frame);
parentEl.appendChild(panel);
yield onFrameLoad(frame);
panel.openPopup(anchor);
let closeBtn = frame.contentDocument.querySelector("#close");
if (closeBtn) {
closeBtn.addEventListener("click", close);
}
let goBtn = frame.contentDocument.querySelector("#go");
if (goBtn) {
goBtn.addEventListener("click", () => {
if (action) {
action();
}
close();
});
}
});
function setDoorhangerStyle(panel, frame) {
Object.keys(panelAttrs).forEach(prop => {
return panel.setAttribute(prop, panelAttrs[prop]);
});
panel.style.margin = "20px";
panel.style.borderRadius = "5px";
panel.style.border = "none";
panel.style.MozAppearance = "none";
panel.style.backgroundColor = "transparent";
frame.style.borderRadius = "5px";
frame.setAttribute("flex", "1");
frame.setAttribute("width", "450");
frame.setAttribute("height", "179");
}
function onFrameLoad(frame) {
let { resolve, promise } = defer();
if (frame.contentWindow) {
let domHelper = new DOMHelpers(frame.contentWindow);
domHelper.onceDOMReady(resolve);
} else {
let callback = () => {
frame.removeEventListener("DOMContentLoaded", callback);
resolve();
};
frame.addEventListener("DOMContentLoaded", callback);
}
return promise;
}
function getGBrowser() {
return getMostRecentBrowserWindow().gBrowser;
}
function wait(n) {
let { resolve, promise } = defer();
setTimeout(resolve, n);
return promise;
}
+1
View File
@@ -26,6 +26,7 @@ DevToolsModules(
'devices.js',
'devtools-file-watcher.js',
'DOMHelpers.jsm',
'doorhanger.js',
'file-watcher-worker.js',
'file-watcher.js',
'getjson.js',
@@ -908,10 +908,6 @@ VariablesView.prototype = {
// Copy current selection to clipboard.
if (e.ctrlKey || e.metaKey) {
let item = this.getFocusedItem();
if (!item) {
// No item is selected; do nothing.
return;
}
clipboardHelper.copyString(
item._nameString + item.separatorStr + item._valueString
);
+8
View File
@@ -19,6 +19,7 @@ loader.lazyRequireGetter(this, "WebConsoleFrame", "devtools/client/webconsole/we
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true);
loader.lazyRequireGetter(this, "showDoorhanger", "devtools/client/shared/doorhanger", true);
loader.lazyRequireGetter(this, "viewSource", "devtools/client/shared/view-source");
const STRINGS_URI = "devtools/client/locales/webconsole.properties";
@@ -674,12 +675,19 @@ BrowserConsole.prototype = extend(WebConsole.prototype, {
// instance.
let onClose = () => {
window.removeEventListener("unload", onClose);
window.removeEventListener("focus", onFocus);
this.destroy();
};
window.addEventListener("unload", onClose);
this._telemetry.toolOpened("browserconsole");
// Create an onFocus handler just to display the dev edition promo.
// This is to prevent race conditions in some environments.
// Hook to display promotional Developer Edition doorhanger. Only displayed once.
let onFocus = () => showDoorhanger({ window, type: "deveditionpromo" });
window.addEventListener("focus", onFocus);
this._bc_init = this.$init();
return this._bc_init;
},
+9 -2
View File
@@ -537,7 +537,6 @@ function newChannelForURL(url, { policy, window, principal }) {
// scheme to see if it helps.
uri = Services.io.newURI("file://" + url, null, null);
}
let channelOptions = {
contentPolicyType: policy,
securityFlags: securityFlags,
@@ -558,7 +557,15 @@ function newChannelForURL(url, { policy, window, principal }) {
}
channelOptions.loadingPrincipal = prin;
return NetUtil.newChannel(channelOptions);
try {
return NetUtil.newChannel(channelOptions);
} catch (e) {
// In xpcshell tests on Windows, nsExternalProtocolHandler::NewChannel()
// can throw NS_ERROR_UNKNOWN_PROTOCOL if the external protocol isn't
// supported by Windows, so we also need to handle the exception here if
// parsing the URL above doesn't throw.
return newChannelForURL("file://" + url, { policy, window, principal });
}
}
// Fetch is defined differently depending on whether we are on the main thread
+14 -89
View File
@@ -2208,10 +2208,10 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"content",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -2231,10 +2231,10 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"content",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -3282,6 +3282,7 @@ exports.CSS_PROPERTIES = {
"-moz-crisp-edges",
"-moz-deck",
"-moz-element",
"-moz-fit-content",
"-moz-grid",
"-moz-grid-group",
"-moz-grid-line",
@@ -3423,7 +3424,6 @@ exports.CSS_PROPERTIES = {
"extra-expanded",
"fill",
"fill-box",
"fit-content",
"fixed",
"flat",
"flex",
@@ -6000,10 +6000,10 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"content",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -6023,10 +6023,10 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"content",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -6816,9 +6816,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -6903,9 +6903,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7257,25 +7257,6 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"margin-block": {
"isInherited": false,
"subproperties": [
"margin-block-start",
"margin-block-end"
],
"supports": [
6,
8
],
"values": [
"-moz-calc",
"auto",
"calc",
"inherit",
"initial",
"unset"
]
},
"margin-block-end": {
"isInherited": false,
"subproperties": [
@@ -7330,25 +7311,6 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"margin-inline": {
"isInherited": false,
"subproperties": [
"margin-inline-start",
"margin-inline-end"
],
"supports": [
6,
8
],
"values": [
"-moz-calc",
"auto",
"calc",
"inherit",
"initial",
"unset"
]
},
"margin-inline-end": {
"isInherited": false,
"subproperties": [
@@ -7782,8 +7744,8 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7804,8 +7766,8 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7826,8 +7788,8 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7866,9 +7828,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7888,9 +7850,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7910,9 +7872,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -8284,24 +8246,6 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"padding-block": {
"isInherited": false,
"subproperties": [
"padding-block-start",
"padding-block-end"
],
"supports": [
6,
8
],
"values": [
"-moz-calc",
"calc",
"inherit",
"initial",
"unset"
]
},
"padding-block-end": {
"isInherited": false,
"subproperties": [
@@ -8353,24 +8297,6 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"padding-inline": {
"isInherited": false,
"subproperties": [
"padding-inline-start",
"padding-inline-end"
],
"supports": [
6,
8
],
"values": [
"-moz-calc",
"calc",
"inherit",
"initial",
"unset"
]
},
"padding-inline-end": {
"isInherited": false,
"subproperties": [
@@ -9710,9 +9636,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -9826,7 +9752,6 @@ exports.CSS_PROPERTIES = {
exports.PSEUDO_ELEMENTS = [
":after",
":before",
":slotted",
":backdrop",
":first-letter",
":first-line",
+1 -1
View File
@@ -136,7 +136,7 @@ nsDSURIContentListener::DoContent(const nsACString& aContentType,
mExistingJPEGRequest = baseChannel;
}
if (rv == NS_ERROR_REMOTE_XUL || rv == NS_ERROR_DOCSHELL_DYING) {
if (rv == NS_ERROR_REMOTE_XUL) {
aRequest->Cancel(rv);
*aAbortProcess = true;
return NS_OK;
+7 -70
View File
@@ -892,8 +892,6 @@ nsDocShell::~nsDocShell()
nsresult
nsDocShell::Init()
{
MOZ_ASSERT(!mIsBeingDestroyed);
nsresult rv = nsDocLoader::Init();
NS_ENSURE_SUCCESS(rv, rv);
@@ -1918,8 +1916,6 @@ bool
nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
bool aFireOnLocationChange, uint32_t aLocationFlags)
{
MOZ_ASSERT(!mIsBeingDestroyed);
if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, LogLevel::Debug)) {
PR_LogPrint("DOCSHELL %p SetCurrentURI %s\n",
this, aURI ? aURI->GetSpecOrDefault().get() : "");
@@ -2180,8 +2176,6 @@ nsDocShell::SetUsePrivateBrowsing(bool aUsePrivateBrowsing)
NS_IMETHODIMP
nsDocShell::SetPrivateBrowsing(bool aUsePrivateBrowsing)
{
MOZ_ASSERT(!mIsBeingDestroyed);
bool changed = aUsePrivateBrowsing != (mPrivateBrowsingId > 0);
if (changed) {
mPrivateBrowsingId = aUsePrivateBrowsing ? 1 : 0;
@@ -2252,8 +2246,6 @@ nsDocShell::SetRemoteTabs(bool aUseRemoteTabs)
NS_IMETHODIMP
nsDocShell::SetAffectPrivateSessionLifetime(bool aAffectLifetime)
{
MOZ_ASSERT(!mIsBeingDestroyed);
bool change = aAffectLifetime != mAffectPrivateSessionLifetime;
if (change && UsePrivateBrowsing()) {
AssertOriginAttributesMatchPrivateBrowsing();
@@ -2756,8 +2748,6 @@ nsDocShell::GetSecurityUI(nsISecureBrowserUI** aSecurityUI)
NS_IMETHODIMP
nsDocShell::SetSecurityUI(nsISecureBrowserUI* aSecurityUI)
{
MOZ_ASSERT(!mIsBeingDestroyed);
mSecurityUI = aSecurityUI;
mSecurityUI->SetDocShell(this);
return NS_OK;
@@ -3940,10 +3930,6 @@ PrintDocTree(nsIDocShellTreeItem* aParentNode)
NS_IMETHODIMP
nsDocShell::SetTreeOwner(nsIDocShellTreeOwner* aTreeOwner)
{
if (mIsBeingDestroyed && aTreeOwner) {
return NS_ERROR_FAILURE;
}
#ifdef DEBUG_DOCSHELL_FOCUS
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(aTreeOwner));
if (item) {
@@ -5200,8 +5186,6 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
const char* aCSSClass,
nsIChannel* aFailedChannel)
{
MOZ_ASSERT(!mIsBeingDestroyed);
#if defined(DEBUG)
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString chanName;
@@ -5555,8 +5539,6 @@ nsDocShell::SetSessionHistory(nsISHistory* aSessionHistory)
// make sure that we are the root docshell and
// set a handle to root docshell in SH.
MOZ_ASSERT(!mIsBeingDestroyed);
nsCOMPtr<nsIDocShellTreeItem> root;
/* Get the root docshell. If *this* is the root docshell
* then save a handle to *this* in SH. SH needs it to do
@@ -5737,22 +5719,16 @@ nsDocShell::Create()
NS_IMETHODIMP
nsDocShell::Destroy()
{
// XXX: We allow this function to be called just once. If you are going to
// reset new variables in this function, please make sure the variables will
// never be re-initialized. Adding assertions to check |mIsBeingDestroyed|
// in the setter functions for the variables would be enough.
if (mIsBeingDestroyed) {
return NS_ERROR_DOCSHELL_DYING;
}
NS_ASSERTION(mItemType == typeContent || mItemType == typeChrome,
"Unexpected item type in docshell");
nsCOMPtr<nsIObserverService> serv = services::GetObserverService();
if (serv) {
const char* msg = mItemType == typeContent ?
NS_WEBNAVIGATION_DESTROY : NS_CHROME_WEBNAVIGATION_DESTROY;
serv->NotifyObservers(GetAsSupports(this), msg, nullptr);
if (!mIsBeingDestroyed) {
nsCOMPtr<nsIObserverService> serv = services::GetObserverService();
if (serv) {
const char* msg = mItemType == typeContent ?
NS_WEBNAVIGATION_DESTROY : NS_CHROME_WEBNAVIGATION_DESTROY;
serv->NotifyObservers(GetAsSupports(this), msg, nullptr);
}
}
mIsBeingDestroyed = true;
@@ -6035,7 +6011,6 @@ nsDocShell::GetParentWidget(nsIWidget** aParentWidget)
NS_IMETHODIMP
nsDocShell::SetParentWidget(nsIWidget* aParentWidget)
{
MOZ_ASSERT(!mIsBeingDestroyed);
mParentWidget = aParentWidget;
return NS_OK;
@@ -6306,8 +6281,6 @@ nsDocShell::SetOnePermittedSandboxedNavigator(nsIDocShell* aSandboxedNavigator)
return NS_OK;
}
MOZ_ASSERT(!mIsBeingDestroyed);
mOnePermittedSandboxedNavigator = do_GetWeakReference(aSandboxedNavigator);
NS_ASSERTION(mOnePermittedSandboxedNavigator,
"One Permitted Sandboxed Navigator must support weak references.");
@@ -6668,8 +6641,6 @@ nsDocShell::RefreshURI(nsIURI* aURI,
bool aMetaRefresh,
nsIPrincipal* aPrincipal)
{
MOZ_ASSERT(!mIsBeingDestroyed);
NS_ENSURE_ARG(aURI);
/* Check if Meta refresh/redirects are permitted. Some
@@ -8014,10 +7985,6 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
// wrong information :-(
//
(void)FirePageHideNotification(!mSavingOldViewer);
// pagehide notification might destroy this docshell.
if (mIsBeingDestroyed) {
return NS_ERROR_DOCSHELL_DYING;
}
}
// Now make sure we don't think we're in the middle of firing unload after
@@ -8161,8 +8128,6 @@ nsDocShell::CanSavePresentation(uint32_t aLoadType,
void
nsDocShell::ReattachEditorToWindow(nsISHEntry* aSHEntry)
{
MOZ_ASSERT(!mIsBeingDestroyed);
NS_ASSERTION(!mEditorData,
"Why reattach an editor when we already have one?");
NS_ASSERTION(aSHEntry && aSHEntry->HasDetachedEditor(),
@@ -8200,9 +8165,6 @@ nsDocShell::DetachEditorFromWindow()
if (NS_SUCCEEDED(res)) {
// Make mOSHE hold the owning ref to the editor data.
if (mOSHE) {
MOZ_ASSERT(!mIsBeingDestroyed || !mOSHE->HasDetachedEditor(),
"We should not set the editor data again once after we "
"detached the editor data during destroying this docshell");
mOSHE->SetEditorData(mEditorData.forget());
} else {
mEditorData = nullptr;
@@ -8389,8 +8351,6 @@ nsDocShell::GetRestoringDocument(bool* aRestoring)
nsresult
nsDocShell::RestorePresentation(nsISHEntry* aSHEntry, bool* aRestoring)
{
MOZ_ASSERT(!mIsBeingDestroyed);
NS_ASSERTION(mLoadType & LOAD_CMD_HISTORY,
"RestorePresentation should only be called for history loads");
@@ -8552,10 +8512,6 @@ nsDocShell::RestoreFromHistory()
// Notify the old content viewer that it's being hidden.
FirePageHideNotification(!mSavingOldViewer);
// pagehide notification might destroy this docshell.
if (mIsBeingDestroyed) {
return NS_ERROR_DOCSHELL_DYING;
}
// If mLSHE was changed as a result of the pagehide event, then
// something else was loaded. Don't finish restoring.
@@ -9013,12 +8969,6 @@ nsDocShell::CreateContentViewer(const nsACString& aContentType,
{
*aContentHandler = nullptr;
if (!mTreeOwner || mIsBeingDestroyed) {
// If we don't have a tree owner, then we're in the process of being
// destroyed. Rather than continue trying to load something, just give up.
return NS_ERROR_DOCSHELL_DYING;
}
// Can we check the content type of the current content viewer
// and reuse it without destroying it and re-creating it?
@@ -9058,11 +9008,6 @@ nsDocShell::CreateContentViewer(const nsACString& aContentType,
aOpenedChannel->GetURI(getter_AddRefs(mLoadingURI));
}
FirePageHideNotification(!mSavingOldViewer);
if (mIsBeingDestroyed) {
// Force to stop the newly created orphaned viewer.
viewer->Stop();
return NS_ERROR_DOCSHELL_DYING;
}
mLoadingURI = nullptr;
// Set mFiredUnloadEvent = false so that the unload handler for the
@@ -9252,8 +9197,6 @@ nsDocShell::NewContentViewerObj(const nsACString& aContentType,
nsresult
nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
{
MOZ_ASSERT(!mIsBeingDestroyed);
//
// Copy content viewer state from previous or parent content viewer.
//
@@ -13439,8 +13382,6 @@ nsDocShell::EnsureScriptEnvironment()
NS_IMETHODIMP
nsDocShell::EnsureEditorData()
{
MOZ_ASSERT(!mIsBeingDestroyed);
bool openDocHasDetachedEditor = mOSHE && mOSHE->HasDetachedEditor();
if (!mEditorData && !mIsBeingDestroyed && !openDocHasDetachedEditor) {
// We shouldn't recreate the editor data if it already exists, or
@@ -13456,8 +13397,6 @@ nsDocShell::EnsureEditorData()
nsresult
nsDocShell::EnsureTransferableHookData()
{
MOZ_ASSERT(!mIsBeingDestroyed);
if (!mTransferableHookData) {
mTransferableHookData = new nsTransferableHookData();
}
@@ -14530,8 +14469,6 @@ nsDocShell::CanSetOriginAttributes()
nsresult
nsDocShell::SetOriginAttributes(const DocShellOriginAttributes& aAttrs)
{
MOZ_ASSERT(!mIsBeingDestroyed);
if (!CanSetOriginAttributes()) {
return NS_ERROR_FAILURE;
}
+5 -32
View File
@@ -1383,30 +1383,6 @@ Animation::GetRenderedDocument() const
return mEffect->AsKeyframeEffect()->GetRenderedDocument();
}
class AsyncFinishNotification : public MicroTaskRunnable
{
public:
explicit AsyncFinishNotification(Animation* aAnimation)
: MicroTaskRunnable()
, mAnimation(aAnimation)
{}
virtual void Run(AutoSlowOperation& aAso) override
{
mAnimation->DoFinishNotificationImmediately(this);
mAnimation = nullptr;
}
virtual bool Suppressed() override
{
nsIGlobalObject* global = mAnimation->GetOwnerGlobal();
return global && global->IsInSyncOperation();
}
private:
RefPtr<Animation> mAnimation;
};
void
Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag)
{
@@ -1414,8 +1390,9 @@ Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag)
if (aSyncNotifyFlag == SyncNotifyFlag::Sync) {
DoFinishNotificationImmediately();
} else if (!mFinishNotificationTask) {
RefPtr<MicroTaskRunnable> runnable = new AsyncFinishNotification(this);
} else if (!mFinishNotificationTask.IsPending()) {
RefPtr<nsRunnableMethod<Animation>> runnable =
NewRunnableMethod(this, &Animation::DoFinishNotificationImmediately);
context->DispatchToMicroTask(do_AddRef(runnable));
mFinishNotificationTask = runnable.forget();
}
@@ -1438,13 +1415,9 @@ Animation::MaybeResolveFinishedPromise()
}
void
Animation::DoFinishNotificationImmediately(MicroTaskRunnable* aAsync)
Animation::DoFinishNotificationImmediately()
{
if (aAsync && aAsync != mFinishNotificationTask) {
return;
}
mFinishNotificationTask = nullptr;
mFinishNotificationTask.Revoke();
if (PlayState() != AnimationPlayState::Finished) {
return;
+2 -5
View File
@@ -9,7 +9,6 @@
#include "nsWrapperCache.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/EffectCompositor.h" // For EffectCompositor::CascadeLevel
#include "mozilla/LinkedList.h"
@@ -43,7 +42,6 @@ class AnimValuesStyleRule;
namespace dom {
class AsyncFinishNotification;
class CSSAnimation;
class CSSTransition;
@@ -380,8 +378,7 @@ protected:
void ResetFinishedPromise();
void MaybeResolveFinishedPromise();
void DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag);
friend class AsyncFinishNotification;
void DoFinishNotificationImmediately(MicroTaskRunnable* aAsync = nullptr);
void DoFinishNotificationImmediately();
void DispatchPlaybackEvent(const nsAString& aName);
/**
@@ -449,7 +446,7 @@ protected:
// getAnimations() list.
bool mIsRelevant;
RefPtr<MicroTaskRunnable> mFinishNotificationTask;
nsRevocableEventPtr<nsRunnableMethod<Animation>> mFinishNotificationTask;
// True if mFinished is resolved or would be resolved if mFinished has
// yet to be created. This is not set when mFinished is rejected since
// in that case mFinished is immediately reset to represent a new current
-7
View File
@@ -155,13 +155,6 @@ DocumentTimeline::WillRefresh(mozilla::TimeStamp aTime)
bool needsTicks = false;
nsTArray<Animation*> animationsToRemove(mAnimations.Count());
// https://drafts.csswg.org/web-animations-1/#update-animations-and-send-events,
// step2.
// Note that this should be done before nsAutoAnimationMutationBatch. If
// PerformMicroTaskCheckpoint was called before nsAutoAnimationMutationBatch
// is destroyed, some mutation records might not be delivered in this
// checkpoint.
nsAutoMicroTask mt;
nsAutoAnimationMutationBatch mb(mDocument);
for (Animation* animation = mAnimationOrder.getFirst(); animation;
+10 -3
View File
@@ -14,7 +14,8 @@
#include "mozilla/AnimationUtils.h"
#include "mozilla/EffectSet.h"
#include "mozilla/LayerAnimationInfo.h"
#include "mozilla/RestyleManager.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetPresShellForContent
#include "nsCSSPropertyIDSet.h"
#include "nsCSSProps.h"
@@ -201,7 +202,10 @@ EffectCompositor::RequestRestyle(dom::Element* aElement,
if (aRestyleType == RestyleType::Layer) {
// Prompt layers to re-sync their animations.
mPresContext->RestyleManager()->IncrementAnimationGeneration();
MOZ_ASSERT(mPresContext->RestyleManager()->IsGecko(),
"stylo: Servo-backed style system should not be using "
"EffectCompositor");
mPresContext->RestyleManager()->AsGecko()->IncrementAnimationGeneration();
EffectSet* effectSet =
EffectSet::GetEffectSet(aElement, aPseudoType);
if (effectSet) {
@@ -313,7 +317,10 @@ EffectCompositor::GetAnimationRule(dom::Element* aElement,
return nullptr;
}
if (mPresContext->RestyleManager()->SkipAnimationRules()) {
MOZ_ASSERT(mPresContext->RestyleManager()->IsGecko(),
"stylo: Servo-backed style system should not be using "
"EffectCompositor");
if (mPresContext->RestyleManager()->AsGecko()->SkipAnimationRules()) {
// We don't need to worry about updating mElementsToRestyle in this case
// since this is not the animation restyle we requested when we called
// PostRestyleForAnimation (see comment at start of this method).
+6 -2
View File
@@ -5,7 +5,8 @@
#include "EffectSet.h"
#include "mozilla/dom/Element.h" // For Element
#include "mozilla/RestyleManager.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "nsCSSPseudoElements.h" // For CSSPseudoElementType
#include "nsCycleCollectionNoteChild.h" // For CycleCollectionNoteChild
#include "nsPresContext.h"
@@ -109,8 +110,11 @@ EffectSet::DestroyEffectSet(dom::Element* aElement,
void
EffectSet::UpdateAnimationGeneration(nsPresContext* aPresContext)
{
MOZ_ASSERT(aPresContext->RestyleManager()->IsGecko(),
"stylo: Servo-backed style system should not be using "
"EffectSet");
mAnimationGeneration =
aPresContext->RestyleManager()->GetAnimationGeneration();
aPresContext->RestyleManager()->AsGecko()->GetAnimationGeneration();
}
/* static */ nsIAtom**
+29 -6
View File
@@ -15,6 +15,7 @@
#include "mozilla/FloatingPoint.h" // For IsFinite
#include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt
#include "mozilla/KeyframeUtils.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/StyleAnimationValue.h"
#include "Layers.h" // For Layer
#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetStyleContextForElement
@@ -31,7 +32,17 @@ namespace mozilla {
bool
PropertyValuePair::operator==(const PropertyValuePair& aOther) const
{
return mProperty == aOther.mProperty && mValue == aOther.mValue;
if (mProperty != aOther.mProperty || mValue != aOther.mValue) {
return false;
}
if (mServoDeclarationBlock == aOther.mServoDeclarationBlock) {
return true;
}
if (!mServoDeclarationBlock || !aOther.mServoDeclarationBlock) {
return false;
}
return Servo_DeclarationBlock_Equals(mServoDeclarationBlock,
aOther.mServoDeclarationBlock);
}
namespace dom {
@@ -285,7 +296,10 @@ KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext)
runningOnCompositorProperties.HasProperty(property.mProperty);
}
CalculateCumulativeChangeHint(aStyleContext);
// FIXME (bug 1303235): Do this for Servo too
if (aStyleContext->PresContext()->StyleSet()->IsGecko()) {
CalculateCumulativeChangeHint(aStyleContext);
}
MarkCascadeNeedsUpdate();
@@ -922,8 +936,13 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
: propertyValue.mProperty;
nsAutoString stringValue;
propertyValue.mValue.AppendToString(
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
if (propertyValue.mServoDeclarationBlock) {
Servo_DeclarationBlock_SerializeOneValue(
propertyValue.mServoDeclarationBlock, &stringValue);
} else {
propertyValue.mValue.AppendToString(
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
}
JS::Rooted<JS::Value> value(aCx);
if (!ToJSValue(aCx, stringValue, &value) ||
@@ -1267,8 +1286,10 @@ CreateStyleContextForAnimationValue(nsCSSPropertyID aProperty,
nsCOMArray<nsIStyleRule> rules;
rules.AppendObject(styleRule);
MOZ_ASSERT(aBaseStyleContext->PresContext()->StyleSet()->IsGecko(),
"ServoStyleSet should not use StyleAnimationValue for animations");
nsStyleSet* styleSet =
aBaseStyleContext->PresContext()->StyleSet();
aBaseStyleContext->PresContext()->StyleSet()->AsGecko();
RefPtr<nsStyleContext> styleContext =
styleSet->ResolveStyleByAddingRules(aBaseStyleContext, rules);
@@ -1341,8 +1362,10 @@ KeyframeEffectReadOnly::CanIgnoreIfNotVisible() const
return false;
}
// FIXME (bug 1303235): We don't calculate mCumulativeChangeHint for
// the Servo backend yet
nsPresContext* presContext = GetPresContext();
if (!presContext) {
if (!presContext || presContext->StyleSet()->IsServo()) {
return false;
}
+7
View File
@@ -19,6 +19,8 @@
#include "mozilla/EffectCompositor.h"
#include "mozilla/KeyframeEffectParams.h"
#include "mozilla/LayerAnimationInfo.h" // LayerAnimations::kRecords
#include "mozilla/ServoBindingTypes.h" // RawServoDeclarationBlock and
// associated RefPtrTraits
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/dom/AnimationEffectReadOnly.h"
#include "mozilla/dom/Element.h"
@@ -61,6 +63,11 @@ struct PropertyValuePair
// (string).
nsCSSValue mValue;
// The specified value when using the Servo backend. However, even when
// using the Servo backend, we still fill in |mValue| in the case where we
// fail to parse the value since we use it to store the original string.
RefPtr<RawServoDeclarationBlock> mServoDeclarationBlock;
bool operator==(const PropertyValuePair&) const;
};
+83 -23
View File
@@ -9,6 +9,7 @@
#include "mozilla/Move.h"
#include "mozilla/Preferences.h"
#include "mozilla/RangedArray.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/TimingParams.h"
#include "mozilla/dom/BaseKeyframeTypesBinding.h" // For FastBaseKeyframe etc.
@@ -318,8 +319,12 @@ public:
// ------------------------------------------------------------------
inline bool
IsInvalidValuePair(const PropertyValuePair& aPair)
IsInvalidValuePair(const PropertyValuePair& aPair, StyleBackendType aBackend)
{
if (aBackend == StyleBackendType::Servo) {
return !aPair.mServoDeclarationBlock;
}
// There are three types of values we store as token streams:
//
// * Shorthand values (where we manually extract the token stream's string
@@ -595,6 +600,8 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
MOZ_ASSERT(aStyleContext);
MOZ_ASSERT(aElement);
StyleBackendType styleBackend = aElement->OwnerDoc()->GetStyleBackendType();
const size_t len = aKeyframes.Length();
nsTArray<ComputedKeyframeValues> result(len);
@@ -603,7 +610,12 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
ComputedKeyframeValues* computedValues = result.AppendElement();
for (const PropertyValuePair& pair :
PropertyPriorityIterator(frame.mPropertyValues)) {
if (IsInvalidValuePair(pair)) {
MOZ_ASSERT(!pair.mServoDeclarationBlock ||
styleBackend == StyleBackendType::Servo,
"Animation values were parsed using Servo backend but target"
" element is not using Servo backend?");
if (IsInvalidValuePair(pair, styleBackend)) {
continue;
}
@@ -611,25 +623,33 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
// a KeyframeValueEntry for each value.
nsTArray<PropertyStyleAnimationValuePair> values;
// For shorthands, we store the string as a token stream so we need to
// extract that first.
if (nsCSSProps::IsShorthand(pair.mProperty)) {
nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
if (styleBackend == StyleBackendType::Servo) {
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
IsComputeValuesFailureKey(pair)) {
CSSEnabledState::eForAllContent, aStyleContext,
*pair.mServoDeclarationBlock, values)) {
continue;
}
} else {
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
pair.mValue, /* aUseSVGMode */ false, values)) {
continue;
// For shorthands, we store the string as a token stream so we need to
// extract that first.
if (nsCSSProps::IsShorthand(pair.mProperty)) {
nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
IsComputeValuesFailureKey(pair)) {
continue;
}
} else {
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
pair.mValue, /* aUseSVGMode */ false, values)) {
continue;
}
MOZ_ASSERT(values.Length() == 1,
"Longhand properties should produce a single"
" StyleAnimationValue");
}
MOZ_ASSERT(values.Length() == 1,
"Longhand properties should produce a single"
" StyleAnimationValue");
}
for (auto& value : values) {
@@ -979,6 +999,30 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
result.mProperty = aProperty;
if (aDocument->GetStyleBackendType() == StyleBackendType::Servo) {
nsCString name = nsCSSProps::GetStringValue(aProperty);
NS_ConvertUTF16toUTF8 value(aStringValue);
RefPtr<ThreadSafeURIHolder> base =
new ThreadSafeURIHolder(aDocument->GetDocumentURI());
RefPtr<ThreadSafeURIHolder> referrer =
new ThreadSafeURIHolder(aDocument->GetDocumentURI());
RefPtr<ThreadSafePrincipalHolder> principal =
new ThreadSafePrincipalHolder(aDocument->NodePrincipal());
nsCString baseString;
aDocument->GetDocumentURI()->GetSpec(baseString);
RefPtr<RawServoDeclarationBlock> servoDeclarationBlock =
Servo_ParseProperty(&name, &value, &baseString,
base, referrer, principal).Consume();
if (servoDeclarationBlock) {
result.mServoDeclarationBlock = servoDeclarationBlock.forget();
return result;
}
}
nsCSSValue value;
if (!nsCSSProps::IsShorthand(aProperty)) {
aParser.ParseLonghandProperty(aProperty,
@@ -1010,6 +1054,13 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
"The shorthand property of a token stream should be initialized"
" to unknown");
value.SetTokenStreamValue(tokenStream);
} else {
// If we succeeded in parsing with Gecko, but not Servo the animation is
// not going to work since, for the purposes of animation, we're going to
// ignore |mValue| when the backend is Servo.
NS_WARNING_ASSERTION(aDocument->GetStyleBackendType() !=
StyleBackendType::Servo,
"Gecko succeeded in parsing where Servo failed");
}
result.mValue = value;
@@ -1361,6 +1412,8 @@ HasImplicitKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
}
};
StyleBackendType styleBackend = aDocument->GetStyleBackendType();
for (size_t i = 0, len = aKeyframes.Length(); i < len; i++) {
const Keyframe& frame = aKeyframes[i];
@@ -1376,18 +1429,25 @@ HasImplicitKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
: computedOffset;
for (const PropertyValuePair& pair : frame.mPropertyValues) {
if (IsInvalidValuePair(pair)) {
if (IsInvalidValuePair(pair, styleBackend)) {
continue;
}
if (nsCSSProps::IsShorthand(pair.mProperty)) {
nsCSSValueTokenStream* tokenStream =
pair.mValue.GetTokenStreamValue();
nsCSSParser parser(aDocument->CSSLoader());
if (!parser.IsValueValidForProperty(pair.mProperty,
tokenStream->mTokenStream)) {
continue;
if (styleBackend == StyleBackendType::Gecko) {
nsCSSValueTokenStream* tokenStream =
pair.mValue.GetTokenStreamValue();
nsCSSParser parser(aDocument->CSSLoader());
if (!parser.IsValueValidForProperty(pair.mProperty,
tokenStream->mTokenStream)) {
continue;
}
}
// For the Servo backend, invalid shorthand values are represented by
// a null mServoDeclarationBlock member which we skip above in
// IsInvalidValuePair.
MOZ_ASSERT(styleBackend != StyleBackendType::Servo ||
pair.mServoDeclarationBlock);
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(
prop, pair.mProperty, CSSEnabledState::eForAllContent) {
addToPropertySets(*prop, offsetToUse);
+1 -1
View File
@@ -135,7 +135,7 @@ TimingParams::ParseEasing(const nsAString& aEasing,
NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR) {
return Nothing();
}
[[fallthrough]];
MOZ_FALLTHROUGH;
case eCSSUnit_Cubic_Bezier:
case eCSSUnit_Steps: {
nsTimingFunction timingFunction;
+4 -1
View File
@@ -474,7 +474,10 @@ IsNativeAnonymousImplementationOfPseudoElement(nsIContent* aContent)
// Unlike regular nodes, native anonymous content (NAC) gets created during
// frame construction, which happens after the main style traversal. This
// means that we have to manually resolve style for those nodes shortly after
// they're created by invoking ResolvePseudoElementStyle (for PE NAC).
// they're created, either by (a) invoking ResolvePseudoElementStyle (for PE
// NAC), or (b) handing the subtree off to Servo for a mini-traversal (for
// non-PE NAC). We have assertions in nsCSSFrameConstructor that we don't do
// both.
//
// Once that happens, the NAC has a frame. So if we have no frame here,
// we're either not NAC, or in the process of doing (b). Either way, this
+2 -1
View File
@@ -5,6 +5,7 @@
#include "mozilla/dom/CustomElementRegistry.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/dom/CustomElementRegistryBinding.h"
#include "mozilla/dom/HTMLElementBinding.h"
#include "mozilla/dom/WebComponentsBinding.h"
@@ -1152,7 +1153,7 @@ CustomElementReactionsStack::Enqueue(Element* aElement,
CycleCollectedJSContext* context = CycleCollectedJSContext::Get();
RefPtr<BackupQueueMicroTask> bqmt = new BackupQueueMicroTask(this);
context->DispatchToMicroTask(bqmt.forget());
context->DispatchMicroTaskRunnable(bqmt.forget());
}
void
-1
View File
@@ -9,7 +9,6 @@
#include "js/GCHashTable.h"
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/FunctionBinding.h"
+29 -46
View File
@@ -80,14 +80,7 @@ DOMIntersectionObserver::Constructor(const mozilla::dom::GlobalObject& aGlobal,
RefPtr<DOMIntersectionObserver> observer =
new DOMIntersectionObserver(window.forget(), aCb);
if (!aOptions.mRoot.IsNull()) {
if (aOptions.mRoot.Value().IsElement()) {
observer->mRoot = aOptions.mRoot.Value().GetAsElement();
} else {
MOZ_ASSERT(aOptions.mRoot.Value().IsDocument());
observer->mRoot = aOptions.mRoot.Value().GetAsDocument();
}
}
observer->mRoot = aOptions.mRoot;
if (!observer->SetRootMargin(aOptions.mRootMargin)) {
aRv.ThrowDOMException(NS_ERROR_DOM_SYNTAX_ERR,
@@ -265,30 +258,6 @@ EdgeInclusiveIntersection(const nsRect& aRect, const nsRect& aOtherRect)
return Some(nsRect(left, top, right - left, bottom - top));
}
// NOTE: This returns nullptr if |aDocument| is in a cross process.
static nsIDocument* GetTopLevelDocument(const nsIDocument& aDocument) {
nsCOMPtr<nsIPresShell> presShell = aDocument.GetShell();
if (presShell) {
nsIFrame* rootFrame = presShell->GetRootScrollFrame();
if (rootFrame) {
nsPresContext* presContext = rootFrame->PresContext();
while (!presContext->IsRootContentDocument()) {
// Walk up the tree
presContext = presContext->GetParentPresContext();
if (!presContext) {
break;
}
}
if(presContext && presContext->IsRootContentDocument()) {
return presContext->Document();
}
}
}
return nullptr;
}
enum class BrowsingContextInfo {
SimilarOriginBrowsingContext,
DifferentOriginBrowsingContext,
@@ -298,12 +267,14 @@ enum class BrowsingContextInfo {
void
DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time)
{
nsINode* root = mRoot;
Element* root = nullptr;
nsIFrame* rootFrame = nullptr;
nsRect rootRect;
if (mRoot && mRoot->IsElement()) {
if ((rootFrame = mRoot->AsElement()->GetPrimaryFrame())) {
if (mRoot) {
root = mRoot;
rootFrame = root->GetPrimaryFrame();
if (rootFrame) {
nsRect rootRectRelativeToRootFrame;
if (rootFrame->GetType() == nsGkAtoms::scrollFrame) {
// rootRectRelativeToRootFrame should be the content rect of rootFrame, not including the scrollbars.
@@ -321,18 +292,30 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
containingBlock);
}
} else {
MOZ_ASSERT(!mRoot || mRoot->IsInUncomposedDoc());
nsIDocument* rootDocument =
mRoot ? mRoot->GetUncomposedDoc() : GetTopLevelDocument(*aDocument);
if (rootDocument) {
if (nsIPresShell* presShell = rootDocument->GetShell()) {
rootFrame = presShell->GetRootScrollFrame();
if (rootFrame) {
root = rootFrame->GetContent()->AsElement();
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
if (scrollFrame) {
rootRect = scrollFrame->GetScrollPortRect();
nsCOMPtr<nsIPresShell> presShell = aDocument->GetShell();
if (presShell) {
rootFrame = presShell->GetRootScrollFrame();
if (rootFrame) {
nsPresContext* presContext = rootFrame->PresContext();
while (!presContext->IsRootContentDocument()) {
// Walk up the tree
presContext = presContext->GetParentPresContext();
if (!presContext) {
break;
}
nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
if (rootScrollFrame) {
rootFrame = rootScrollFrame;
} else {
break;
}
}
root = rootFrame->GetContent()->AsElement();
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
// If we end up with a null root frame for some reason, we'll proceed
// with an empty root intersection rect.
if (scrollFrame) {
rootRect = scrollFrame->GetScrollPortRect();
}
}
}
+2 -2
View File
@@ -145,7 +145,7 @@ public:
return mOwner;
}
nsINode* GetRoot() const {
Element* GetRoot() const {
return mRoot;
}
@@ -178,7 +178,7 @@ protected:
nsCOMPtr<nsPIDOMWindowInner> mOwner;
RefPtr<nsIDocument> mDocument;
RefPtr<mozilla::dom::IntersectionCallback> mCallback;
RefPtr<nsINode> mRoot;
RefPtr<Element> mRoot;
nsCSSRect mRootMargin;
nsTArray<double> mThresholds;
-39
View File
@@ -117,17 +117,6 @@ ValidateAndFixupMatrixInit(DOMMatrixInit& aMatrixInit, ErrorResult& aRv)
#undef Check3DField
}
void
DOMMatrixReadOnly::SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit) {
MOZ_ASSERT(Is2D());
mMatrix2D->_11 = aMatrixInit.mM11.Value();
mMatrix2D->_12 = aMatrixInit.mM12.Value();
mMatrix2D->_21 = aMatrixInit.mM21.Value();
mMatrix2D->_22 = aMatrixInit.mM22.Value();
mMatrix2D->_31 = aMatrixInit.mM41.Value();
mMatrix2D->_32 = aMatrixInit.mM42.Value();
}
void
DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit)
{
@@ -160,34 +149,6 @@ DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit)
}
}
already_AddRefed<DOMMatrixReadOnly> DOMMatrixReadOnly::FromMatrix(
nsISupports* aParent, const DOMMatrix2DInit& aMatrixInit,
ErrorResult& aRv) {
DOMMatrix2DInit matrixInit(aMatrixInit);
if (!ValidateAndFixupMatrix2DInit(matrixInit, aRv)) {
return nullptr;
};
RefPtr<DOMMatrixReadOnly> matrix =
new DOMMatrixReadOnly(aParent, /* is2D */ true);
matrix->SetDataFromMatrix2DInit(matrixInit);
return matrix.forget();
}
already_AddRefed<DOMMatrixReadOnly> DOMMatrixReadOnly::FromMatrix(
nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv) {
DOMMatrixInit matrixInit(aMatrixInit);
if (!ValidateAndFixupMatrixInit(matrixInit, aRv)) {
return nullptr;
};
RefPtr<DOMMatrixReadOnly> rval =
new DOMMatrixReadOnly(aParent, matrixInit.mIs2D.Value());
rval->SetDataFromMatrixInit(matrixInit);
return rval.forget();
}
already_AddRefed<DOMMatrixReadOnly>
DOMMatrixReadOnly::FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv)
{
-14
View File
@@ -26,7 +26,6 @@ class DOMPoint;
class StringOrUnrestrictedDoubleSequence;
struct DOMPointInit;
struct DOMMatrixInit;
struct DOMMatrix2DInit;
class DOMMatrixReadOnly : public nsWrapperCache
{
@@ -58,12 +57,6 @@ public:
nsISupports* GetParentObject() const { return mParent; }
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
static already_AddRefed<DOMMatrixReadOnly>
FromMatrix(nsISupports* aParent, const DOMMatrix2DInit& aMatrixInit, ErrorResult& aRv);
static already_AddRefed<DOMMatrixReadOnly>
FromMatrix(nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
static already_AddRefed<DOMMatrixReadOnly>
FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
@@ -214,12 +207,6 @@ public:
ErrorResult& aRv) const;
void Stringify(nsAString& aResult);
bool WriteStructuredClone(JSStructuredCloneWriter* aWriter) const;
const gfx::Matrix* GetInternal2D() const {
if (Is2D()) {
return mMatrix2D;
}
return nullptr;
}
protected:
nsCOMPtr<nsISupports> mParent;
@@ -233,7 +220,6 @@ protected:
* where all of its members are properly defined.
* The init dictionary's dimension must match the matrix one.
*/
void SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit);
void SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit);
DOMMatrixReadOnly* SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv);
+1 -1
View File
@@ -169,7 +169,7 @@ DocumentOrShadowRoot::GetFullscreenElement()
return nullptr;
}
Element* element = AsNode().OwnerDoc()->GetUnretargetedFullScreenElement();
Element* element = AsNode().OwnerDoc()->FullScreenStackTop();
NS_ASSERTION(!element ||
element->State().HasState(NS_EVENT_STATE_FULL_SCREEN),
"Fullscreen element should have fullscreen styles applied");
+31 -30
View File
@@ -56,6 +56,7 @@
#include "mozilla/AnimationComparator.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/ContentEvents.h"
#include "mozilla/DeclarationBlockInlines.h"
#include "mozilla/EffectSet.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
@@ -105,7 +106,6 @@
#include "nsViewManager.h"
#include "nsIScrollableFrame.h"
#include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
#include "mozilla/css/Declaration.h"
#include "nsCSSRuleProcessor.h"
#include "nsRuleProcessorData.h"
#include "nsTextNode.h"
@@ -1481,27 +1481,6 @@ Element::GetElementsByClassName(const nsAString& aClassNames,
return NS_OK;
}
CSSPseudoElementType
Element::GetPseudoElementType() const {
if (!HasProperties()) {
return CSSPseudoElementType::NotPseudo;
}
nsresult rv = NS_OK;
auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv);
if (rv == NS_PROPTABLE_PROP_NOT_THERE) {
return CSSPseudoElementType::NotPseudo;
}
return CSSPseudoElementType(reinterpret_cast<uintptr_t>(raw));
}
void
Element::SetPseudoElementType(CSSPseudoElementType aPseudo) {
static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t),
"Need to be able to store this in a void*");
MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo);
SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast<void*>(aPseudo));
}
/**
* Returns the count of descendants (inclusive of aContent) in
* the uncomposed document that are explicitly set as editable.
@@ -1628,7 +1607,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
// And clear the lazy frame construction bits.
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
// And the restyle bits
UnsetRestyleFlags();
UnsetRestyleFlagsIfGecko();
} else if (IsInShadowTree()) {
// We're not in a document, but we did get inserted into a shadow tree.
// Since we won't have any restyle data in the document's restyle trackers,
@@ -1638,7 +1617,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
// inserted into a document.
UnsetFlags(NODE_FORCE_XBL_BINDINGS |
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
UnsetRestyleFlags();
UnsetRestyleFlagsIfGecko();
} else {
// If we're not in the doc and not in a shadow tree,
// update our subtree pointer.
@@ -1779,6 +1758,18 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
}
}
// It would be cleanest to mark nodes as dirty when (a) they're created and
// (b) they're unbound from a tree. However, we can't easily do (a) right now,
// because IsStyledByServo() is not always easy to check at node creation time,
// and the bits have different meaning in the non-IsStyledByServo case.
//
// So for now, we just mark nodes as dirty when they're inserted into a
// document or shadow tree.
if (IsStyledByServo() && IsInComposedDoc()) {
MOZ_ASSERT(!HasServoData());
SetIsDirtyForServo();
}
// XXXbz script execution during binding can trigger some of these
// postcondition asserts.... But we do want that, since things will
// generally be quite broken when that happens.
@@ -1905,6 +1896,16 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
ClearInDocument();
// Computed styled data isn't useful for detached nodes, and we'll need to
// recomputed it anyway if we ever insert the nodes back into a document.
if (IsStyledByServo()) {
ClearServoData();
} else {
#ifdef MOZ_STYLO
MOZ_ASSERT(!HasServoData());
#endif
}
// Editable descendant count only counts descendants that
// are in the uncomposed document.
ResetEditableDescendantCount();
@@ -2014,7 +2015,7 @@ Element::GetSMILOverrideStyle()
return slots->mSMILOverrideStyle;
}
css::Declaration*
DeclarationBlock*
Element::GetSMILOverrideStyleDeclaration()
{
Element::nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots();
@@ -2022,7 +2023,7 @@ Element::GetSMILOverrideStyleDeclaration()
}
nsresult
Element::SetSMILOverrideStyleDeclaration(css::Declaration* aDeclaration,
Element::SetSMILOverrideStyleDeclaration(DeclarationBlock* aDeclaration,
bool aNotify)
{
Element::nsExtendedDOMSlots* slots = ExtendedDOMSlots();
@@ -2062,14 +2063,14 @@ Element::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
return false;
}
css::Declaration*
DeclarationBlock*
Element::GetInlineStyleDeclaration()
{
return nullptr;
}
nsresult
Element::SetInlineStyleDeclaration(css::Declaration* aDeclaration,
Element::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
const nsAString* aSerialized,
bool aNotify)
{
@@ -3198,7 +3199,7 @@ Element::GetEventTargetParentForLinks(EventChainPreVisitor& aVisitor)
// Set the status bar similarly for mouseover and focus
case eMouseOver:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
[[fallthrough]];
MOZ_FALLTHROUGH;
case eFocus: {
InternalFocusEvent* focusEvent = aVisitor.mEvent->AsFocusEvent();
if (!focusEvent || !focusEvent->mIsRefocus) {
@@ -3213,7 +3214,7 @@ Element::GetEventTargetParentForLinks(EventChainPreVisitor& aVisitor)
}
case eMouseOut:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
[[fallthrough]];
MOZ_FALLTHROUGH;
case eBlur:
rv = LeaveLink(aVisitor.mPresContext);
if (NS_SUCCEEDED(rv)) {
+31 -18
View File
@@ -57,9 +57,7 @@ class nsDocument;
class nsDOMStringMap;
namespace mozilla {
namespace css {
class Declaration;
} // namespace css
class DeclarationBlock;
namespace dom {
struct AnimationFilter;
struct ScrollIntoViewOptions;
@@ -81,27 +79,27 @@ NS_GetContentList(nsINode* aRootNode,
// Element-specific flags
enum {
// Set if the element has a pending style change.
ELEMENT_HAS_PENDING_RESTYLE = ELEMENT_FLAG_BIT(0),
ELEMENT_HAS_PENDING_RESTYLE = NODE_SHARED_RESTYLE_BIT_1,
// Set if the element is a potential restyle root (that is, has a style
// change pending _and_ that style change will attempt to restyle
// descendants).
ELEMENT_IS_POTENTIAL_RESTYLE_ROOT = ELEMENT_FLAG_BIT(1),
ELEMENT_IS_POTENTIAL_RESTYLE_ROOT = NODE_SHARED_RESTYLE_BIT_2,
// Set if the element has a pending animation-only style change as
// part of an animation-only style update (where we update styles from
// animation to the current refresh tick, but leave everything else as
// it was).
ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE = ELEMENT_FLAG_BIT(2),
ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE = ELEMENT_FLAG_BIT(0),
// Set if the element is a potential animation-only restyle root (that
// is, has an animation-only style change pending _and_ that style
// change will attempt to restyle descendants).
ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT = ELEMENT_FLAG_BIT(3),
ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT = ELEMENT_FLAG_BIT(1),
// Set if this element has a pending restyle with an eRestyle_SomeDescendants
// restyle hint.
ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR = ELEMENT_FLAG_BIT(4),
ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR = ELEMENT_FLAG_BIT(2),
// Just the HAS_PENDING bits, for convenience
ELEMENT_PENDING_RESTYLE_FLAGS =
@@ -119,10 +117,10 @@ enum {
ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR,
// Set if this element is marked as 'scrollgrab' (see bug 912666)
ELEMENT_HAS_SCROLLGRAB = ELEMENT_FLAG_BIT(5),
ELEMENT_HAS_SCROLLGRAB = ELEMENT_FLAG_BIT(3),
// Remaining bits are for subclasses
ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 6
ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 4
};
#undef ELEMENT_FLAG_BIT
@@ -276,13 +274,13 @@ public:
/**
* Get the inline style declaration, if any, for this element.
*/
virtual css::Declaration* GetInlineStyleDeclaration();
virtual DeclarationBlock* GetInlineStyleDeclaration();
/**
* Set the inline style declaration for this element. This will send
* an appropriate AttributeChanged notification if aNotify is true.
*/
virtual nsresult SetInlineStyleDeclaration(css::Declaration* aDeclaration,
virtual nsresult SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
const nsAString* aSerialized,
bool aNotify);
@@ -290,7 +288,7 @@ public:
* Get the SMIL override style declaration for this element. If the
* rule hasn't been created, this method simply returns null.
*/
virtual css::Declaration* GetSMILOverrideStyleDeclaration();
virtual DeclarationBlock* GetSMILOverrideStyleDeclaration();
/**
* Set the SMIL override style declaration for this element. If
@@ -298,7 +296,7 @@ public:
* context, so that the style changes will be noticed.
*/
virtual nsresult SetSMILOverrideStyleDeclaration(
css::Declaration* aDeclaration, bool aNotify);
DeclarationBlock* aDeclaration, bool aNotify);
/**
* Returns a new nsISMILAttr that allows the caller to animate the given
@@ -816,9 +814,24 @@ public:
already_AddRefed<nsIHTMLCollection>
GetElementsByClassName(const nsAString& aClassNames);
CSSPseudoElementType GetPseudoElementType() const;
CSSPseudoElementType GetPseudoElementType() const {
if (!HasProperties()) {
return CSSPseudoElementType::NotPseudo;
}
nsresult rv = NS_OK;
auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv);
if (rv == NS_PROPTABLE_PROP_NOT_THERE) {
return CSSPseudoElementType::NotPseudo;
}
return CSSPseudoElementType(reinterpret_cast<uintptr_t>(raw));
}
void SetPseudoElementType(CSSPseudoElementType aPseudo);
void SetPseudoElementType(CSSPseudoElementType aPseudo) {
static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t),
"Need to be able to store this in a void*");
MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo);
SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast<void*>(aPseudo));
}
private:
/**
@@ -1649,9 +1662,9 @@ inline const mozilla::dom::Element* nsINode::AsElement() const
return static_cast<const mozilla::dom::Element*>(this);
}
inline void nsINode::UnsetRestyleFlags()
inline void nsINode::UnsetRestyleFlagsIfGecko()
{
if (IsElement()) {
if (IsElement() && !IsStyledByServo()) {
UnsetFlags(ELEMENT_ALL_RESTYLE_FLAGS);
}
}
+49 -1
View File
@@ -17,6 +17,7 @@
#include "mozilla/dom/FragmentOrElement.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/DeclarationBlockInlines.h"
#include "mozilla/EffectSet.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
@@ -96,7 +97,6 @@
#include "nsIScrollableFrame.h"
#include "ChildIterator.h"
#include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
#include "mozilla/css/Declaration.h"
#include "nsRuleProcessorData.h"
#include "nsTextNode.h"
#include "mozilla/dom/NodeListBinding.h"
@@ -2527,3 +2527,51 @@ FragmentOrElement::SetIsElementInStyleScopeFlagOnShadowTree(bool aInStyleScope)
shadowRoot->SetIsElementInStyleScopeFlagOnSubtree(aInStyleScope);
}
}
#ifdef DEBUG
static void
AssertDirtyDescendantsBitPropagated(nsINode* aNode)
{
MOZ_ASSERT(aNode->HasDirtyDescendantsForServo());
nsINode* parent = aNode->GetFlattenedTreeParentNode();
if (!parent->IsContent()) {
MOZ_ASSERT(parent == aNode->OwnerDoc());
MOZ_ASSERT(parent->HasDirtyDescendantsForServo());
} else {
AssertDirtyDescendantsBitPropagated(parent);
}
}
#else
static void AssertDirtyDescendantsBitPropagated(nsINode* aNode) {}
#endif
void
nsIContent::MarkAncestorsAsHavingDirtyDescendantsForServo()
{
MOZ_ASSERT(IsInComposedDoc());
// Get the parent in the flattened tree.
nsINode* parent = GetFlattenedTreeParentNode();
// Loop until we hit a base case.
while (true) {
// Base case: the document.
if (!parent->IsContent()) {
MOZ_ASSERT(parent == OwnerDoc());
parent->SetHasDirtyDescendantsForServo();
return;
}
// Base case: the parent is already marked, and therefore
// so are all its ancestors.
if (parent->HasDirtyDescendantsForServo()) {
AssertDirtyDescendantsBitPropagated(parent);
return;
}
// Mark the parent and iterate.
parent->SetHasDirtyDescendantsForServo();
parent = parent->GetFlattenedTreeParentNode();
}
}
+2 -4
View File
@@ -35,9 +35,7 @@ class nsDOMStringMap;
class nsIURI;
namespace mozilla {
namespace css {
class Declaration;
}
class DeclarationBlock;
namespace dom {
struct CustomElementData;
class DOMIntersectionObserver;
@@ -266,7 +264,7 @@ public:
/**
* Holds any SMIL override style declaration for this element.
*/
RefPtr<mozilla::css::Declaration> mSMILOverrideStyleDeclaration;
RefPtr<mozilla::DeclarationBlock> mSMILOverrideStyleDeclaration;
/**
* The nearest enclosing content node with a binding that created us.
+5 -306
View File
@@ -15,7 +15,6 @@
#include "nsCPrefetchService.h"
#include "nsStyleLinkElement.h"
#include "nsAttrValueInlines.h"
#include "nsEscape.h"
#include "nsGkAtoms.h"
#include "nsHTMLDNSPrefetch.h"
@@ -24,57 +23,9 @@
#include "mozilla/Services.h"
#include "nsIContentPolicy.h"
#include "nsCSSParser.h"
#include "nsMimeTypes.h"
#include "nsIMediaList.h"
#include "DecoderTraits.h"
#include "imgLoader.h"
namespace mozilla {
namespace dom {
enum Destination : uint8_t
{
DESTINATION_INVALID,
DESTINATION_AUDIO,
DESTINATION_AUDIOWORKLET,
DESTINATION_DOCUMENT,
DESTINATION_EMBED,
DESTINATION_FONT,
DESTINATION_FRAME,
DESTINATION_IFRAME,
DESTINATION_IMAGE,
DESTINATION_JSON,
DESTINATION_MANIFEST,
DESTINATION_OBJECT,
DESTINATION_REPORT,
DESTINATION_SCRIPT,
DESTINATION_SERVICEWORKER,
DESTINATION_SHAREDWORKER,
DESTINATION_STYLE,
DESTINATION_TRACK,
DESTINATION_VIDEO,
DESTINATION_WEBIDENTITY,
DESTINATION_WORKER,
DESTINATION_XSLT,
DESTINATION_FETCH
};
static const nsAttrValue::EnumTable kDestinationAttributeTable[] = {
{ "", DESTINATION_INVALID },
{ "audio", DESTINATION_AUDIO },
{ "font", DESTINATION_FONT },
{ "image", DESTINATION_IMAGE },
{ "script", DESTINATION_SCRIPT },
{ "style", DESTINATION_STYLE },
{ "track", DESTINATION_TRACK },
{ "video", DESTINATION_VIDEO },
{ "fetch", DESTINATION_FETCH },
{ "json", DESTINATION_JSON },
{ nullptr, 0 }
};
Link::Link(Element *aElement)
: mElement(aElement)
, mHistory(services::GetHistoryService())
@@ -124,7 +75,7 @@ Link::CancelDNSPrefetch(nsWrapperCache::FlagsType aDeferredFlag,
}
void
Link::TrySpeculativeLoadFeature()
Link::TryDNSPrefetchPreconnectOrPrefetch()
{
MOZ_ASSERT(mElement->IsInComposedDoc());
if (!ElementHasHref()) {
@@ -144,28 +95,15 @@ Link::TrySpeculativeLoadFeature()
mElement->NodePrincipal());
if ((linkTypes & nsStyleLinkElement::ePREFETCH) ||
(linkTypes & nsStyleLinkElement::eNEXT) ||
(linkTypes & nsStyleLinkElement::ePRELOAD)) {
(linkTypes & nsStyleLinkElement::eNEXT)){
nsCOMPtr<nsIPrefetchService> prefetchService(do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
if (prefetchService) {
nsCOMPtr<nsIURI> uri(GetURI());
if (uri) {
nsCOMPtr<nsIDOMNode> domNode = GetAsDOMNode(mElement);
if (linkTypes & nsStyleLinkElement::ePRELOAD) {
nsContentPolicyType policyType;
bool isPreloadValid = CheckPreloadAttrs(policyType, mElement);
if (!isPreloadValid) {
// XXX: WPTs expect that we timeout on invalid preloads including
// those with valid destinations instead of firing an error event.
return;
}
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
} else {
prefetchService->PrefetchURI(uri,
mElement->OwnerDoc()->GetDocumentURI(),
domNode,
linkTypes & nsStyleLinkElement::ePREFETCH);
}
prefetchService->PrefetchURI(uri,
mElement->OwnerDoc()->GetDocumentURI(),
domNode, linkTypes & nsStyleLinkElement::ePREFETCH);
return;
}
}
@@ -187,95 +125,6 @@ Link::TrySpeculativeLoadFeature()
}
}
void
Link::UpdatePreload(nsIAtom* aName,
const nsAttrValue* aValue,
const nsAttrValue* aOldValue)
{
MOZ_ASSERT(mElement->IsInComposedDoc());
if (!ElementHasHref()) {
return;
}
nsAutoString rel;
if (!mElement->GetAttr(kNameSpaceID_None, nsGkAtoms::rel, rel)) {
return;
}
if (!nsContentUtils::PrefetchEnabled(mElement->OwnerDoc()->GetDocShell()) ||
!nsContentUtils::IsPreloadEnabled()) {
return;
}
uint32_t linkTypes = nsStyleLinkElement::ParseLinkTypes(rel,
mElement->NodePrincipal());
if (!(linkTypes & nsStyleLinkElement::ePRELOAD)) {
return;
}
nsCOMPtr<nsIURI> uri(GetURI());
if (!uri) {
return;
}
nsCOMPtr<nsIDOMNode> domNode = GetAsDOMNode(mElement);
nsContentPolicyType policyType;
bool isPreloadValid = CheckPreloadAttrs(policyType, mElement);
if (!isPreloadValid) {
// XXX: WPTs expect that we timeout on invalid preloads including
// those with valid destinations instead of firing an error event.
return;
}
if (aName == nsGkAtoms::crossorigin) {
CORSMode corsMode = Element::AttrValueToCORSMode(aValue);
CORSMode oldCorsMode = Element::AttrValueToCORSMode(aOldValue);
if (corsMode != oldCorsMode) {
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
}
return;
}
nsAutoString oldValue;
if (aOldValue) {
aOldValue->ToString(oldValue);
} else {
oldValue = EmptyString();
}
nsContentPolicyType oldPolicyType = nsIContentPolicy::TYPE_INVALID;
if (aName == nsGkAtoms::as) {
if (aOldValue) {
CheckPreloadAttrs(oldPolicyType, aName, oldValue, mElement);
}
} else if (aName == nsGkAtoms::type) {
if (CheckPreloadAttrs(oldPolicyType, aName, oldValue, mElement)) {
oldPolicyType = policyType;
} else {
oldPolicyType = nsIContentPolicy::TYPE_INVALID;
}
} else if (aName == nsGkAtoms::media) {
if (CheckPreloadAttrs(oldPolicyType, aName, oldValue, mElement)) {
oldPolicyType = policyType;
} else {
oldPolicyType = nsIContentPolicy::TYPE_INVALID;
}
}
// Return early for invalid preloads since we shouldn't trigger a new fetch.
if (policyType == nsIContentPolicy::TYPE_INVALID) {
return;
}
// Fire the associated event if the policy type has changed.
if (policyType != oldPolicyType) {
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
}
}
void
Link::CancelPrefetch()
{
@@ -786,156 +635,6 @@ Link::SetHrefAttribute(nsIURI *aURI)
NS_ConvertUTF8toUTF16(href), true);
}
bool
Link::CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
const nsAString& aDestination,
const nsAString& aType,
const nsAString& aMedia,
nsIDocument* aDocument)
{
nsString mimeType;
nsString params;
nsContentUtils::SplitMimeType(aType, mimeType, params);
ToLowerCase(mimeType);
nsAttrValue destinationAttr;
ParseDestinationValue(aDestination, destinationAttr);
aPolicyType = DestinationToContentPolicy(destinationAttr);
if (aPolicyType == nsIContentPolicy::TYPE_INVALID) {
return false;
}
// Check if media attribute is valid.
if (!aMedia.IsEmpty()) {
nsCSSParser cssParser;
RefPtr<nsMediaList> mediaList = new nsMediaList();
cssParser.ParseMediaList(aMedia, nullptr, 0, mediaList, false);
nsIPresShell* shell = aDocument->GetShell();
if (!shell) {
return false;
}
nsPresContext* presContext = shell->GetPresContext();
if (!presContext) {
return false;
}
if (!mediaList->Matches(presContext, nullptr)) {
return false;
}
}
if (mimeType.IsEmpty()) {
return true;
}
switch (aPolicyType) {
case nsIContentPolicy::TYPE_OTHER:
if (destinationAttr.GetEnumValue() == DESTINATION_JSON) {
return nsContentUtils::IsJSONMIMEType(mimeType);
}
return true;
case nsIContentPolicy::TYPE_MEDIA:
if (destinationAttr.GetEnumValue() == DESTINATION_TRACK) {
return mimeType.EqualsASCII(TEXT_VTT);
}
return DecoderTraits::IsSupportedInVideoDocument(NS_ConvertUTF16toUTF8(mimeType));
case nsIContentPolicy::TYPE_FONT:
return nsContentUtils::IsFontMIMEType(mimeType);
case nsIContentPolicy::TYPE_IMAGE:
return imgLoader::SupportImageWithMimeType(NS_ConvertUTF16toUTF8(mimeType).get(),
AcceptedMimeTypes::IMAGES_AND_DOCUMENTS);
case nsIContentPolicy::TYPE_SCRIPT:
return nsContentUtils::IsJavascriptMIMEType(mimeType);
case nsIContentPolicy::TYPE_STYLESHEET:
return mimeType.EqualsASCII(TEXT_CSS);
default:
return false;
}
}
bool
Link::CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
nsIAtom* aName,
const nsAString& aValue,
Element* aElement)
{
nsAutoString destination;
if (aName == nsGkAtoms::as) {
destination = aValue;
} else {
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::as, destination);
}
nsAutoString type;
if (aName == nsGkAtoms::type) {
type = aValue;
} else {
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type);
}
nsAutoString media;
if (aName == nsGkAtoms::media) {
media = aValue;
} else {
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::media, media);
}
return CheckPreloadAttrs(aPolicyType,
destination,
type,
media,
aElement->OwnerDoc());
}
bool
Link::CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
Element* aElement)
{
nsAutoString unused;
return CheckPreloadAttrs(aPolicyType,
nullptr,
unused,
aElement);
}
/* static */ void
Link::ParseDestinationValue(const nsAString& aValue,
nsAttrValue& aResult)
{
// Invalid values are treated as an empty string.
aResult.ParseEnumValue(aValue,
kDestinationAttributeTable,
false,
&kDestinationAttributeTable[0]);
}
/* static */ nsContentPolicyType
Link::DestinationToContentPolicy(const nsAttrValue& aValue)
{
switch (aValue.GetEnumValue()) {
case DESTINATION_AUDIO:
case DESTINATION_TRACK:
case DESTINATION_VIDEO:
return nsIContentPolicy::TYPE_MEDIA;
case DESTINATION_FONT:
return nsIContentPolicy::TYPE_FONT;
case DESTINATION_IMAGE:
return nsIContentPolicy::TYPE_IMAGE;
case DESTINATION_SCRIPT:
return nsIContentPolicy::TYPE_SCRIPT;
case DESTINATION_STYLE:
return nsIContentPolicy::TYPE_STYLESHEET;
case DESTINATION_JSON:
case DESTINATION_FETCH:
return nsIContentPolicy::TYPE_OTHER;
case DESTINATION_INVALID:
default:
return nsIContentPolicy::TYPE_INVALID;
}
}
size_t
Link::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
+1 -18
View File
@@ -116,26 +116,9 @@ public:
nsWrapperCache::FlagsType aRequestedFlag);
// This is called by HTMLLinkElement.
void TrySpeculativeLoadFeature();
void UpdatePreload(nsIAtom* aName,
const nsAttrValue* aValue,
const nsAttrValue* aOldValue);
void TryDNSPrefetchPreconnectOrPrefetch();
void CancelPrefetch();
static void ParseDestinationValue(const nsAString& aValue, nsAttrValue& aResult);
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
Element* aElement);
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
nsIAtom* aName,
const nsAString& aValue,
Element* aElement);
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
const nsAString& aAs,
const nsAString& aType,
const nsAString& aMedia,
nsIDocument* aDocument);
static nsContentPolicyType DestinationToContentPolicy(const nsAttrValue& aValue);
protected:
virtual ~Link();
-30
View File
@@ -8,9 +8,7 @@
#include "Navigator.h"
#include "nsIXULAppInfo.h"
#ifdef MOZ_ENABLE_NPAPI
#include "nsPluginArray.h"
#endif
#include "nsMimeTypeArray.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/BodyExtractor.h"
@@ -32,7 +30,6 @@
#include "nsContentUtils.h"
#include "nsUnicharUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/Clipboard.h"
#ifdef MOZ_GAMEPAD
#include "mozilla/dom/GamepadServiceTest.h"
#endif
@@ -181,9 +178,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMimeTypes)
#ifdef MOZ_ENABLE_NPAPI
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPlugins)
#endif
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPermissions)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGeolocation)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotification)
@@ -214,12 +209,10 @@ Navigator::Invalidate()
mMimeTypes = nullptr;
#ifdef MOZ_ENABLE_NPAPI
if (mPlugins) {
mPlugins->Invalidate();
mPlugins = nullptr;
}
#endif
mPermissions = nullptr;
@@ -495,7 +488,6 @@ Navigator::GetMimeTypes(ErrorResult& aRv)
return mMimeTypes;
}
#ifdef MOZ_ENABLE_NPAPI
nsPluginArray*
Navigator::GetPlugins(ErrorResult& aRv)
{
@@ -510,7 +502,6 @@ Navigator::GetPlugins(ErrorResult& aRv)
return mPlugins;
}
#endif
Permissions*
Navigator::GetPermissions(ErrorResult& aRv)
@@ -671,18 +662,6 @@ Navigator::CpuHasSSE2()
return mozilla::supports_sse2();
}
bool
Navigator::CpuHasAVX()
{
return mozilla::supports_avx();
}
bool
Navigator::CpuHasAVX2()
{
return mozilla::supports_avx2();
}
void
Navigator::RefreshMIMEArray()
{
@@ -1510,14 +1489,5 @@ Navigator::GetUserAgent(nsPIDOMWindowInner* aWindow, nsIURI* aURI,
return siteSpecificUA->GetUserAgentForURIAndWindow(aURI, aWindow, aUserAgent);
}
Clipboard*
Navigator::Clipboard()
{
if (!mClipboard) {
mClipboard = new dom::Clipboard(GetWindow());
}
return mClipboard;
}
} // namespace dom
} // namespace mozilla
-12
View File
@@ -19,9 +19,7 @@
#include "nsTArray.h"
#include "nsWeakPtr.h"
#ifdef MOZ_ENABLE_NPAPI
class nsPluginArray;
#endif
class nsMimeTypeArray;
class nsPIDOMWindowInner;
class nsIDOMNavigatorSystemMessages;
@@ -39,7 +37,6 @@ class WakeLock;
class ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams;
class ServiceWorkerContainer;
class DOMRequest;
class Clipboard;
} // namespace dom
} // namespace mozilla
@@ -129,9 +126,7 @@ public:
void RegisterContentHandler(const nsAString& aMIMEType, const nsAString& aURL,
const nsAString& aTitle, ErrorResult& aRv);
nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv);
#ifdef MOZ_ENABLE_NPAPI
nsPluginArray* GetPlugins(ErrorResult& aRv);
#endif
Permissions* GetPermissions(ErrorResult& aRv);
bool GlobalPrivacyControl();
Geolocation* GetGeolocation(ErrorResult& aRv);
@@ -174,8 +169,6 @@ public:
bool JavaEnabled(ErrorResult& aRv);
uint64_t HardwareConcurrency();
bool CpuHasSSE2();
bool CpuHasAVX();
bool CpuHasAVX2();
bool TaintEnabled()
{
return false;
@@ -217,8 +210,6 @@ public:
ErrorResult& aRv);
already_AddRefed<ServiceWorkerContainer> ServiceWorker();
dom::Clipboard* Clipboard();
void GetLanguages(nsTArray<nsString>& aLanguages);
@@ -266,15 +257,12 @@ private:
ErrorResult& aRv);
RefPtr<nsMimeTypeArray> mMimeTypes;
#ifdef MOZ_ENABLE_NPAPI
RefPtr<nsPluginArray> mPlugins;
#endif
RefPtr<Permissions> mPermissions;
RefPtr<Geolocation> mGeolocation;
RefPtr<DesktopNotificationCenter> mNotification;
RefPtr<PowerManager> mPowerManager;
RefPtr<network::Connection> mConnection;
RefPtr<dom::Clipboard> mClipboard;
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
RefPtr<system::AudioChannelManager> mAudioChannelManager;
#endif
+2 -1
View File
@@ -109,8 +109,9 @@ ShadowRoot::CloneInternalDataFrom(ShadowRoot* aOther)
for (size_t i = 0; i < sheetCount; ++i) {
StyleSheet* sheet = aOther->SheetAt(i);
if (sheet && sheet->IsApplicable()) {
// TODO: Remove AsGecko() call once Stylo is removed.
RefPtr<CSSStyleSheet> clonedSheet =
sheet->AsConcrete()->Clone(nullptr, nullptr, nullptr, nullptr);
sheet->AsGecko()->Clone(nullptr, nullptr, nullptr, nullptr);
if (clonedSheet) {
AppendStyleSheet(*clonedSheet);
}
+4 -10
View File
@@ -2548,22 +2548,16 @@ WebSocket::Close(const Optional<uint16_t>& aCode,
return;
}
// If we don't have mImpl, we are in a shutting down worker where we are still
// in CONNECTING state, but already disconnected internally.
if (!mImpl) {
MOZ_ASSERT(readyState == CONNECTING);
SetReadyState(CLOSING);
return;
}
// If the webSocket is not closed we MUST have a mImpl.
MOZ_ASSERT(mImpl);
RefPtr<WebSocketImpl> impl = mImpl;
if (readyState == CONNECTING) {
impl->FailConnection(closeCode, closeReason);
mImpl->FailConnection(closeCode, closeReason);
return;
}
MOZ_ASSERT(readyState == OPEN);
impl->CloseConnection(closeCode, closeReason);
mImpl->CloseConnection(closeCode, closeReason);
}
//-----------------------------------------------------------------------------
+3 -1
View File
@@ -43,7 +43,9 @@ ShouldExposeChildWindow(nsString& aNameBeingResolved, nsPIDOMWindowOuter* aChild
//
// This is problematic because it allows possibly-malicious and unrelated
// cross-origin subframes to pollute the global namespace of their parent in
// unpredictable ways (see bug 860494).
// unpredictable ways (see bug 860494). This is also problematic for browser
// engines like Servo that want to run cross-origin script on different
// threads.
//
// The naive solution here would be to filter out any cross-origin subframes
// obtained when doing named lookup in global scope. But that is unlikely to
+3 -4
View File
@@ -394,11 +394,10 @@ SOURCES += [
'nsImageLoadingContent.cpp',
# Because of OS X headers.
'nsObjectLoadingContent.cpp',
# nsPluginArray.cpp includes npapi.h indirectly, and that includes a lot of system headers
'nsPluginArray.cpp',
]
if CONFIG['MOZ_ENABLE_NPAPI']:
SOURCES += ['nsPluginArray.cpp']
# Are we targeting x86-32 or x86-64? If so, we want to include SSE2 code for
# nsTextFragment.cpp
if CONFIG['INTEL_ARCHITECTURE']:
@@ -465,7 +464,7 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_XULRUNNER']:
if CONFIG['MOZ_PHOENIX']:
DEFINES['HAVE_SIDEBAR'] = True
if CONFIG['MOZ_X11']:
+16 -9
View File
@@ -16,7 +16,8 @@
#include "nsIAtom.h"
#include "nsUnicharUtils.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/css/Declaration.h"
#include "mozilla/ServoBindingTypes.h"
#include "mozilla/DeclarationBlockInlines.h"
#include "nsContentUtils.h"
#include "nsReadableUtils.h"
#include "prprf.h"
@@ -149,7 +150,7 @@ nsAttrValue::nsAttrValue(nsIAtom* aValue)
SetTo(aValue);
}
nsAttrValue::nsAttrValue(already_AddRefed<css::Declaration> aValue,
nsAttrValue::nsAttrValue(already_AddRefed<DeclarationBlock> aValue,
const nsAString* aSerialized)
: mBits(0)
{
@@ -419,7 +420,7 @@ nsAttrValue::SetTo(double aValue, const nsAString* aSerialized)
}
void
nsAttrValue::SetTo(already_AddRefed<css::Declaration> aValue,
nsAttrValue::SetTo(already_AddRefed<DeclarationBlock> aValue,
const nsAString* aSerialized)
{
MiscContainer* cont = EnsureEmptyMiscContainer();
@@ -642,7 +643,7 @@ nsAttrValue::ToString(nsAString& aResult) const
{
aResult.Truncate();
MiscContainer *container = GetMiscContainer();
if (css::Declaration* decl = container->mValue.mCSSDeclaration) {
if (DeclarationBlock* decl = container->mValue.mCSSDeclaration) {
decl->ToString(aResult);
}
const_cast<nsAttrValue*>(this)->SetMiscAtomOrString(&aResult);
@@ -1747,11 +1748,15 @@ nsAttrValue::ParseStyleAttribute(const nsAString& aString,
}
}
RefPtr<css::Declaration> decl;
css::Loader* cssLoader = ownerDoc->CSSLoader();
nsCSSParser cssParser(cssLoader);
decl = cssParser.ParseStyleAttribute(aString, docURI, baseURI,
aElement->NodePrincipal());
RefPtr<DeclarationBlock> decl;
if (ownerDoc->GetStyleBackendType() == StyleBackendType::Servo) {
decl = ServoDeclarationBlock::FromCssText(aString);
} else {
css::Loader* cssLoader = ownerDoc->CSSLoader();
nsCSSParser cssParser(cssLoader);
decl = cssParser.ParseStyleAttribute(aString, docURI, baseURI,
aElement->NodePrincipal());
}
if (!decl) {
return false;
}
@@ -1983,6 +1988,8 @@ nsAttrValue::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
if (Type() == eCSSDeclaration && container->mValue.mCSSDeclaration) {
// TODO: mCSSDeclaration might be owned by another object which
// would make us count them twice, bug 677493.
// Bug 1281964: For ServoDeclarationBlock if we do measure we'll
// need a way to call the Servo heap_size_of function.
//n += container->mCSSDeclaration->SizeOfIncludingThis(aMallocSizeOf);
} else if (Type() == eAtomArray && container->mValue.mAtomArray) {
// Don't measure each nsIAtom, they are measured separatly.
+4 -4
View File
@@ -36,8 +36,8 @@ class nsStyledElement;
struct MiscContainer;
namespace mozilla {
class DeclarationBlock;
namespace css {
class Declaration;
struct URLValue;
struct ImageValue;
} // namespace css
@@ -122,7 +122,7 @@ public:
nsAttrValue(const nsAttrValue& aOther);
explicit nsAttrValue(const nsAString& aValue);
explicit nsAttrValue(nsIAtom* aValue);
nsAttrValue(already_AddRefed<mozilla::css::Declaration> aValue,
nsAttrValue(already_AddRefed<mozilla::DeclarationBlock> aValue,
const nsAString* aSerialized);
explicit nsAttrValue(const nsIntMargin& aValue);
~nsAttrValue();
@@ -148,7 +148,7 @@ public:
void SetTo(int16_t aInt);
void SetTo(int32_t aInt, const nsAString* aSerialized);
void SetTo(double aValue, const nsAString* aSerialized);
void SetTo(already_AddRefed<mozilla::css::Declaration> aValue,
void SetTo(already_AddRefed<mozilla::DeclarationBlock> aValue,
const nsAString* aSerialized);
void SetTo(mozilla::css::URLValue* aValue, const nsAString* aSerialized);
void SetTo(const nsIntMargin& aValue);
@@ -200,7 +200,7 @@ public:
inline int16_t GetEnumValue() const;
inline float GetPercentValue() const;
inline AtomArray* GetAtomArrayValue() const;
inline mozilla::css::Declaration* GetCSSDeclarationValue() const;
inline mozilla::DeclarationBlock* GetCSSDeclarationValue() const;
inline mozilla::css::URLValue* GetURLValue() const;
inline mozilla::css::ImageValue* GetImageValue() const;
inline double GetDoubleValue() const;
+2 -2
View File
@@ -30,7 +30,7 @@ struct MiscContainer final
nscolor mColor;
uint32_t mEnumValue;
int32_t mPercent;
mozilla::css::Declaration* mCSSDeclaration;
mozilla::DeclarationBlock* mCSSDeclaration;
mozilla::css::URLValue* mURL;
mozilla::css::ImageValue* mImage;
nsAttrValue::AtomArray* mAtomArray;
@@ -145,7 +145,7 @@ nsAttrValue::GetAtomArrayValue() const
return GetMiscContainer()->mValue.mAtomArray;
}
inline mozilla::css::Declaration*
inline mozilla::DeclarationBlock*
nsAttrValue::GetCSSDeclarationValue() const
{
NS_PRECONDITION(Type() == eCSSDeclaration, "wrong type");
+2 -1
View File
@@ -84,7 +84,8 @@ private:
nsIContent **outImageOrLinkNode,
bool* outDragSelectedText);
static already_AddRefed<nsIContent> FindParentLinkNode(nsIContent* inNode);
[[nodiscard]] static nsresult GetAnchorURL(nsIContent* inNode, nsAString& outURL);
static [[nodiscard]] nsresult
GetAnchorURL(nsIContent* inNode, nsAString& outURL);
static void GetNodeString(nsIContent* inNode, nsAString & outNodeString);
static void CreateLinkText(const nsAString& inURL, const nsAString & inText,
nsAString& outLinkText);
-1
View File
@@ -135,7 +135,6 @@ NS_CP_ContentTypeName(uint32_t contentType)
CASE_RETURN( TYPE_INTERNAL_STYLESHEET );
CASE_RETURN( TYPE_INTERNAL_STYLESHEET_PRELOAD );
CASE_RETURN( TYPE_SAVEAS_DOWNLOAD );
CASE_RETURN( TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS );
default:
return "<Unknown Type>";
}
+16 -57
View File
@@ -48,7 +48,6 @@
#include "nsIObserverService.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/ScriptLoader.h"
#include "mozilla/dom/Link.h"
#include "nsParserConstants.h"
#include "nsSandboxFlags.h"
@@ -101,7 +100,6 @@ nsContentSink::nsContentSink()
, mDeferredFlushTags(0)
, mIsDocumentObserver(0)
, mRunsToCompletion(0)
, mIsBlockingOnload(false)
, mDeflectedCount(0)
, mHasPendingEvent(false)
, mCurrentParseEndTime(0)
@@ -472,7 +470,6 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
nsAutoString media;
nsAutoString anchor;
nsAutoString crossOrigin;
nsAutoString destination;
crossOrigin.SetIsVoid(true);
@@ -655,11 +652,6 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
crossOrigin = value;
crossOrigin.StripWhitespace();
}
} else if (attr.LowerCaseEqualsLiteral("as")) {
if (destination.IsEmpty()) {
destination = value;
destination.StripWhitespace();
}
}
}
}
@@ -673,7 +665,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
rv = ProcessLink(anchor, href, rel,
// prefer RFC 5987 variant over non-I18zed version
titleStar.IsEmpty() ? title : titleStar,
type, media, crossOrigin, destination);
type, media, crossOrigin);
}
href.Truncate();
@@ -683,7 +675,6 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
media.Truncate();
anchor.Truncate();
crossOrigin.SetIsVoid(true);
destination.Truncate();
seenParameters = false;
}
@@ -696,7 +687,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
rv = ProcessLink(anchor, href, rel,
// prefer RFC 5987 variant over non-I18zed version
titleStar.IsEmpty() ? title : titleStar,
type, media, crossOrigin, destination);
type, media, crossOrigin);
}
return rv;
@@ -707,8 +698,7 @@ nsresult
nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref,
const nsSubstring& aRel, const nsSubstring& aTitle,
const nsSubstring& aType, const nsSubstring& aMedia,
const nsSubstring& aCrossOrigin,
const nsSubstring& aDestination)
const nsSubstring& aCrossOrigin)
{
uint32_t linkTypes =
nsStyleLinkElement::ParseLinkTypes(aRel, mDocument->NodePrincipal());
@@ -725,21 +715,18 @@ nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref,
return NS_OK;
}
bool hasPrefetch = linkTypes & nsStyleLinkElement::ePREFETCH;
// prefetch href if relation is "next" or "prefetch"
if ((linkTypes & nsStyleLinkElement::eNEXT) ||
(linkTypes & nsStyleLinkElement::ePREFETCH) ||
(linkTypes & nsStyleLinkElement::ePRELOAD)) {
PrefetchOrPreloadHref(aHref, mDocument, linkTypes, aDestination, aType, aMedia);
if (hasPrefetch || (linkTypes & nsStyleLinkElement::eNEXT)) {
PrefetchHref(aHref, mDocument, hasPrefetch);
}
if (!aHref.IsEmpty()) {
if (linkTypes & nsStyleLinkElement::eDNS_PREFETCH) {
PrefetchDNS(aHref);
}
if (!aHref.IsEmpty() && (linkTypes & nsStyleLinkElement::eDNS_PREFETCH)) {
PrefetchDNS(aHref);
}
if (linkTypes & nsStyleLinkElement::ePRECONNECT) {
Preconnect(aHref, aCrossOrigin);
}
if (!aHref.IsEmpty() && (linkTypes & nsStyleLinkElement::ePRECONNECT)) {
Preconnect(aHref, aCrossOrigin);
}
// is it a stylesheet link?
@@ -859,12 +846,9 @@ nsContentSink::ProcessMETATag(nsIContent* aContent)
void
nsContentSink::PrefetchOrPreloadHref(const nsAString &aHref,
nsINode *aSource,
uint32_t aLinkTypes,
const nsAString& aDestination,
const nsAString& aType,
const nsAString& aMedia)
nsContentSink::PrefetchHref(const nsAString &aHref,
nsINode *aSource,
bool aExplicit)
{
nsCOMPtr<nsIPrefetchService> prefetchService(do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
if (prefetchService) {
@@ -876,25 +860,7 @@ nsContentSink::PrefetchOrPreloadHref(const nsAString &aHref,
mDocument->GetDocBaseURI());
if (uri) {
nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(aSource);
if (aLinkTypes & nsStyleLinkElement::ePRELOAD) {
nsContentPolicyType policyType;
bool isPreloadValid = Link::CheckPreloadAttrs(policyType,
aDestination,
aType,
aMedia,
mDocument);
if (!isPreloadValid) {
// XXX: WPTs expect that we timeout on invalid preloads including
// those with valid destinations instead of firing an error event.
return;
}
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
} else {
prefetchService->PrefetchURI(uri,
mDocumentURI,
domNode,
aLinkTypes & nsStyleLinkElement::ePREFETCH);
}
prefetchService->PrefetchURI(uri, mDocumentURI, domNode, aExplicit);
}
}
}
@@ -1573,14 +1539,8 @@ nsContentSink::DropParserAndPerfHint(void)
FavorPerformanceHint(true, 0);
}
// Call UnblockOnload only if mRunsToComletion is false and if
// we have already started loading because it's possible that this function
// is called (i.e. the parser is terminated) before we start loading due to
// destroying the window inside unload event callbacks for the previous
// document.
if (!mRunsToCompletion && mIsBlockingOnload) {
if (!mRunsToCompletion) {
mDocument->UnblockOnload(true);
mIsBlockingOnload = false;
}
}
@@ -1635,7 +1595,6 @@ nsContentSink::WillBuildModelImpl()
{
if (!mRunsToCompletion) {
mDocument->BlockOnload();
mIsBlockingOnload = true;
mBeginLoadTime = PR_IntervalToMicroseconds(PR_IntervalNow());
}
+3 -10
View File
@@ -153,8 +153,7 @@ protected:
nsresult ProcessLink(const nsSubstring& aAnchor,
const nsSubstring& aHref, const nsSubstring& aRel,
const nsSubstring& aTitle, const nsSubstring& aType,
const nsSubstring& aMedia, const nsSubstring& aCrossOrigin,
const nsSubstring& aDestination);
const nsSubstring& aMedia, const nsSubstring& aCrossOrigin);
virtual nsresult ProcessStyleLink(nsIContent* aElement,
const nsSubstring& aHref,
@@ -163,12 +162,8 @@ protected:
const nsSubstring& aType,
const nsSubstring& aMedia);
void PrefetchOrPreloadHref(const nsAString &aHref,
nsINode *aSource,
uint32_t aLinkTypes,
const nsAString& aDestination,
const nsAString& aType,
const nsAString& aMedia);
void PrefetchHref(const nsAString &aHref, nsINode *aSource,
bool aExplicit);
// For PrefetchDNS() aHref can either be the usual
// URI format or of the form "//www.hostname.com" without a scheme.
@@ -309,8 +304,6 @@ protected:
// True if this is parser is a fragment parser or an HTML DOMParser.
// XML DOMParser leaves this to false for now!
uint8_t mRunsToCompletion : 1;
// True if we are blocking load event.
bool mIsBlockingOnload : 1;
//
// -- Can interrupt parsing members --
+36 -214
View File
@@ -23,9 +23,7 @@
#include "Layers.h"
#include "MediaDecoder.h"
// nsNPAPIPluginInstance must be included before nsIDocument.h, which is included in mozAutoDocUpdate.h.
#ifdef MOZ_ENABLE_NPAPI
#include "nsNPAPIPluginInstance.h"
#endif
#include "gfxDrawable.h"
#include "gfxPrefs.h"
#include "ImageOps.h"
@@ -218,7 +216,6 @@
#include "TabChild.h"
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/TabGroup.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "nsIBidiKeyboard.h"
@@ -297,7 +294,6 @@ bool nsContentUtils::sGettersDecodeURLHash = false;
bool nsContentUtils::sPrivacyResistFingerprinting = false;
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
bool nsContentUtils::sUseActivityCursor = false;
bool nsContentUtils::sPreloadEnabled = true;
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
@@ -636,9 +632,6 @@ nsContentUtils::Init()
Preferences::AddBoolVarCache(&sUseActivityCursor,
"ui.use_activity_cursor", false);
Preferences::AddBoolVarCache(&sPreloadEnabled,
"network.preload", true);
Element::InitCCCallbacks();
nsCOMPtr<nsIUUIDGenerator> uuidGenerator =
@@ -740,40 +733,20 @@ nsContentUtils::InitializeModifierStrings()
sModifierSeparator = new nsString(modifierSeparator);
}
mozilla::EventClassID
nsContentUtils::GetEventClassIDFromMessage(EventMessage aEventMessage)
{
switch (aEventMessage) {
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
case message_: return struct_;
#include "mozilla/EventNameList.h"
#undef MESSAGE_TO_EVENT
default:
MOZ_ASSERT_UNREACHABLE("Invalid event message?");
return eBasicEventClass;
}
}
static nsIAtom*
GetEventTypeFromMessage(EventMessage aEventMessage)
{
switch (aEventMessage) {
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
case message_: return nsGkAtoms::on##name_;
#include "mozilla/EventNameList.h"
#undef MESSAGE_TO_EVENT
default:
return nullptr;
}
}
// Because of SVG/SMIL we have several atoms mapped to the same
// id, but we can rely on MESSAGE_TO_EVENT to map id to only one atom.
static bool
ShouldAddEventToStringEventTable(const EventNameMapping& aMapping)
{
MOZ_ASSERT(aMapping.mAtom);
return GetEventTypeFromMessage(aMapping.mMessage) == aMapping.mAtom;
switch(aMapping.mMessage) {
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
case message_: return nsGkAtoms::on##name_ == aMapping.mAtom;
#include "mozilla/EventNameList.h"
#undef MESSAGE_TO_EVENT
default:
break;
}
return false;
}
bool
@@ -2422,35 +2395,34 @@ nsContentUtils::GetCommonAncestor(nsIDOMNode *aNode,
return CallQueryInterface(common, aCommonAncestor);
}
template <typename Node, typename GetParentFunc>
static Node*
GetCommonAncestorInternal(Node* aNode1,
Node* aNode2,
GetParentFunc aGetParentFunc)
// static
nsINode*
nsContentUtils::GetCommonAncestor(nsINode* aNode1,
nsINode* aNode2)
{
if (aNode1 == aNode2) {
return aNode1;
}
// Build the chain of parents
AutoTArray<Node*, 30> parents1, parents2;
AutoTArray<nsINode*, 30> parents1, parents2;
do {
parents1.AppendElement(aNode1);
aNode1 = aGetParentFunc(aNode1);
aNode1 = aNode1->GetParentNode();
} while (aNode1);
do {
parents2.AppendElement(aNode2);
aNode2 = aGetParentFunc(aNode2);
aNode2 = aNode2->GetParentNode();
} while (aNode2);
// Find where the parent chain differs
uint32_t pos1 = parents1.Length();
uint32_t pos2 = parents2.Length();
Node* parent = nullptr;
nsINode* parent = nullptr;
uint32_t len;
for (len = std::min(pos1, pos2); len > 0; --len) {
Node* child1 = parents1.ElementAt(--pos1);
Node* child2 = parents2.ElementAt(--pos2);
nsINode* child1 = parents1.ElementAt(--pos1);
nsINode* child2 = parents2.ElementAt(--pos2);
if (child1 != child2) {
break;
}
@@ -2460,25 +2432,6 @@ GetCommonAncestorInternal(Node* aNode1,
return parent;
}
/* static */
nsINode*
nsContentUtils::GetCommonAncestor(nsINode* aNode1, nsINode* aNode2)
{
return GetCommonAncestorInternal(aNode1, aNode2, [](nsINode* aNode) {
return aNode->GetParentNode();
});
}
/* static */
nsIContent*
nsContentUtils::GetCommonFlattenedTreeAncestor(nsIContent* aContent1,
nsIContent* aContent2)
{
return GetCommonAncestorInternal(aContent1, aContent2, [](nsIContent* aContent) {
return aContent->GetFlattenedTreeParent();
});
}
// static
nsINode*
nsContentUtils::GetCommonAncestorUnderInteractiveContent(nsINode* aNode1,
@@ -4147,36 +4100,12 @@ nsresult GetEventAndTarget(nsIDocument* aDoc, nsISupports* aTarget,
return NS_OK;
}
void
nsContentUtils::DispatchEventForPreloadURI(nsIDOMNode* aNode,
nsContentPolicyType& aPolicyType)
{
if (!IsPreloadEnabled()) {
return;
}
nsCOMPtr<nsINode> domNode = do_QueryInterface(aNode);
if (domNode && domNode->IsInComposedDoc()) {
bool success = aPolicyType != nsIContentPolicy::TYPE_INVALID;
RefPtr<AsyncEventDispatcher> asyncDispatcher =
new AsyncEventDispatcher(domNode,
success ?
NS_LITERAL_STRING("load") :
NS_LITERAL_STRING("error"),
/* aCanBubble = */ false,
/* aCancelable = */ false);
asyncDispatcher->RunDOMEventWhenSafe();
}
}
// static
nsresult
nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc,
nsISupports* aTarget,
nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
const nsAString& aEventName,
bool aCanBubble,
bool aCancelable,
bool* aDefaultAction)
bool aCanBubble, bool aCancelable,
bool *aDefaultAction)
{
return DispatchEvent(aDoc, aTarget, aEventName, aCanBubble, aCancelable,
true, aDefaultAction);
@@ -4184,12 +4113,10 @@ nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc,
// static
nsresult
nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc,
nsISupports* aTarget,
nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
const nsAString& aEventName,
bool aCanBubble,
bool aCancelable,
bool* aDefaultAction)
bool aCanBubble, bool aCancelable,
bool *aDefaultAction)
{
return DispatchEvent(aDoc, aTarget, aEventName, aCanBubble, aCancelable,
false, aDefaultAction);
@@ -4197,13 +4124,10 @@ nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc,
// static
nsresult
nsContentUtils::DispatchEvent(nsIDocument* aDoc,
nsISupports* aTarget,
nsContentUtils::DispatchEvent(nsIDocument* aDoc, nsISupports* aTarget,
const nsAString& aEventName,
bool aCanBubble,
bool aCancelable,
bool aTrusted,
bool* aDefaultAction,
bool aCanBubble, bool aCancelable,
bool aTrusted, bool *aDefaultAction,
bool aOnlyChromeDispatch)
{
nsCOMPtr<nsIDOMEvent> event;
@@ -4218,50 +4142,12 @@ nsContentUtils::DispatchEvent(nsIDocument* aDoc,
return target->DispatchEvent(event, aDefaultAction ? aDefaultAction : &dummy);
}
// static
nsresult
nsContentUtils::DispatchEvent(nsIDocument* aDoc,
nsISupports* aTarget,
WidgetEvent& aEvent,
EventMessage aEventMessage,
bool aCanBubble,
bool aCancelable,
bool aTrusted,
bool* aDefaultAction,
bool aOnlyChromeDispatch)
{
MOZ_ASSERT_IF(aOnlyChromeDispatch, aTrusted);
nsCOMPtr<EventTarget> target(do_QueryInterface(aTarget));
aEvent.mTime = PR_Now();
aEvent.mSpecifiedEventType = GetEventTypeFromMessage(aEventMessage);
aEvent.SetDefaultComposed();
aEvent.SetDefaultComposedInNativeAnonymousContent();
aEvent.mFlags.mBubbles = aCanBubble;
aEvent.mFlags.mCancelable = aCancelable;
aEvent.mFlags.mOnlyChromeDispatch = aOnlyChromeDispatch;
aEvent.mTarget = target;
nsEventStatus status = nsEventStatus_eIgnore;
nsresult rv = EventDispatcher::DispatchDOMEvent(target, &aEvent, nullptr,
nullptr, &status);
if (aDefaultAction) {
*aDefaultAction = (status != nsEventStatus_eConsumeNoDefault);
}
return rv;
}
nsresult
nsContentUtils::DispatchChromeEvent(nsIDocument *aDoc,
nsISupports *aTarget,
const nsAString& aEventName,
bool aCanBubble,
bool aCancelable,
bool* aDefaultAction)
bool aCanBubble, bool aCancelable,
bool *aDefaultAction)
{
nsCOMPtr<nsIDOMEvent> event;
@@ -5532,18 +5418,10 @@ nsContentUtils::RunInStableState(already_AddRefed<nsIRunnable> aRunnable)
/* static */
void
nsContentUtils::AddPendingIDBTransaction(already_AddRefed<nsIRunnable> aTransaction)
nsContentUtils::RunInMetastableState(already_AddRefed<nsIRunnable> aRunnable)
{
MOZ_ASSERT(CycleCollectedJSContext::Get(), "Must be on a script thread!");
CycleCollectedJSContext::Get()->AddPendingIDBTransaction(Move(aTransaction));
}
/* static */
bool
nsContentUtils::IsInStableOrMetaStableState()
{
MOZ_ASSERT(CycleCollectedJSContext::Get(), "Must be on a script thread!");
return CycleCollectedJSContext::Get()->IsInStableOrMetaStableState();
CycleCollectedJSContext::Get()->RunInMetastableState(Move(aRunnable));
}
/*
@@ -6592,16 +6470,9 @@ nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent)
contentViewer->GetPreviousViewer(getter_AddRefs(zombieViewer));
// If there are 2 viewers for the current docshell, that
// means the current document may be a zombie document.
// While load and pageshow events are dispatched, zombie viewer is the old,
// to be hidden document.
if (zombieViewer) {
bool inOnLoad = false;
docShell->GetIsExecutingOnLoadHandler(&inOnLoad);
return inOnLoad;
}
return true;
// means the current document is a zombie document.
// Only navigate into the subdocument if it's not a zombie.
return !zombieViewer;
}
bool
@@ -7072,7 +6943,7 @@ nsContentUtils::HaveEqualPrincipals(nsIDocument* aDoc1, nsIDocument* aDoc2)
bool
nsContentUtils::HasPluginWithUncontrolledEventDispatch(nsIContent* aContent)
{
#if defined(XP_MACOSX) || !defined(MOZ_ENABLE_NPAPI)
#ifdef XP_MACOSX
// We control dispatch to all mac plugins.
return false;
#else
@@ -7469,12 +7340,6 @@ nsContentUtils::GPCEnabled()
return nsContentUtils::sGPCEnabled;
}
bool
nsContentUtils::IsPreloadEnabled()
{
return nsContentUtils::sPreloadEnabled;
}
mozilla::LogModule*
nsContentUtils::DOMDumpLog()
{
@@ -7539,48 +7404,6 @@ nsContentUtils::IsJavascriptMIMEType(const nsAString& aMIMEType)
return false;
}
bool
nsContentUtils::IsJSONMIMEType(const nsAString& aMIMEType)
{
static const char* jsonTypes[] = {
"text/json",
"application/json",
"application/geo+json",
nullptr
};
for (uint32_t i = 0; jsonTypes[i]; ++i) {
if (aMIMEType.LowerCaseEqualsASCII(jsonTypes[i])) {
return true;
}
}
return false;
}
bool
nsContentUtils::IsFontMIMEType(const nsAString& aMIMEType)
{
// The following list was taken from IANA and excludes deprecated mime-types:
// https://www.iana.org/assignments/media-types/media-types.xhtml#font
static const char* fontTypes[] = {
"font/otf",
"font/sfnt",
"font/ttf",
"font/woff",
"font/woff2",
nullptr
};
for (uint32_t i = 0; fontTypes[i]; ++i) {
if (aMIMEType.LowerCaseEqualsASCII(fontTypes[i])) {
return true;
}
}
return false;
}
nsresult
nsContentUtils::GenerateUUIDInPlace(nsID& aUUID)
{
@@ -8763,7 +8586,6 @@ nsContentUtils::InternalContentPolicyTypeToExternal(nsContentPolicyType aType)
case nsIContentPolicy::TYPE_INTERNAL_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS:
return nsIContentPolicy::TYPE_SCRIPT;
case nsIContentPolicy::TYPE_INTERNAL_EMBED:
+14 -108
View File
@@ -19,7 +19,6 @@
#include "js/TypeDecls.h"
#include "js/Value.h"
#include "js/RootingAPI.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/EventForwards.h"
#include "mozilla/GuardObjects.h"
#include "mozilla/TimeStamp.h"
@@ -334,18 +333,12 @@ public:
nsIDOMNode** aCommonAncestor);
/**
* Returns the common ancestor, if any, for two nodes.
* Returns null if the nodes are disconnected.
* Returns the common ancestor, if any, for two nodes. Returns null if the
* nodes are disconnected.
*/
static nsINode* GetCommonAncestor(nsINode* aNode1, nsINode* aNode2);
static nsINode* GetCommonAncestor(nsINode* aNode1,
nsINode* aNode2);
/**
* Returns the common flattened tree ancestor, if any, for two given content
* nodes.
*/
static nsIContent* GetCommonFlattenedTreeAncestor(nsIContent* aContent1,
nsIContent* aContent2);
/**
* Returns the common ancestor under interactive content, if any.
* If neither one has interactive content as ancestor, common ancestor will be
@@ -1179,16 +1172,6 @@ public:
static void MaybeFireNodeRemoved(nsINode* aChild, nsINode* aParent,
nsIDocument* aOwnerDoc);
/**
* This method creates and dispatches either a "load" or "error" event
* to the provided node (a preload link).
* @param aNode The node to fire the event at.
* @param aPolicyType The resulting content policy from the preload.
*/
static void DispatchEventForPreloadURI(nsIDOMNode* aNode,
nsContentPolicyType& aPolicyType);
/**
* This method creates and dispatches a trusted event.
* Works only with events which can be created by calling
@@ -1209,33 +1192,6 @@ public:
bool aCancelable,
bool *aDefaultAction = nullptr);
/**
* This method creates and dispatches a trusted event using an event message.
* @param aDoc The document which will be used to create the event.
* @param aTarget The target of the event, should be QIable to
* EventTarget.
* @param aEventMessage The event message.
* @param aCanBubble Whether the event can bubble.
* @param aCancelable Is the event cancelable.
* @param aDefaultAction Set to true if default action should be taken,
* see nsIDOMEventTarget::DispatchEvent.
*/
template <class WidgetEventType>
static nsresult DispatchTrustedEvent(nsIDocument* aDoc,
nsISupports* aTarget,
mozilla::EventMessage aEventMessage,
bool aCanBubble,
bool aCancelable,
bool *aDefaultAction = nullptr,
bool aOnlyChromeDispatch = false)
{
WidgetEventType event(true, aEventMessage);
MOZ_ASSERT(GetEventClassIDFromMessage(aEventMessage) == event.mClass);
return DispatchEvent(aDoc, aTarget, event, aEventMessage,
aCanBubble, aCancelable, true,
aDefaultAction, aOnlyChromeDispatch);
}
/**
* This method creates and dispatches a untrusted event.
* Works only with events which can be created by calling
@@ -1256,33 +1212,6 @@ public:
bool aCancelable,
bool *aDefaultAction = nullptr);
/**
* This method creates and dispatches a untrusted event using an event message.
* @param aDoc The document which will be used to create the event.
* @param aTarget The target of the event, should be QIable to
* EventTarget.
* @param aEventMessage The event message.
* @param aCanBubble Whether the event can bubble.
* @param aCancelable Is the event cancelable.
* @param aDefaultAction Set to true if default action should be taken,
* see nsIDOMEventTarget::DispatchEvent.
*/
template <class WidgetEventType>
static nsresult DispatchUntrustedEvent(nsIDocument* aDoc,
nsISupports* aTarget,
mozilla::EventMessage aEventMessage,
bool aCanBubble,
bool aCancelable,
bool *aDefaultAction = nullptr,
bool aOnlyChromeDispatch = false)
{
WidgetEventType event(false, aEventMessage);
MOZ_ASSERT(GetEventClassIDFromMessage(aEventMessage) == event.mClass);
return DispatchEvent(aDoc, aTarget, event, aEventMessage,
aCanBubble, aCancelable, false,
aDefaultAction, aOnlyChromeDispatch);
}
/**
* This method creates and dispatches a trusted event to the chrome
* event handler (the parent object of the DOM Window in the event target
@@ -1838,17 +1767,17 @@ public:
*/
static void RunInStableState(already_AddRefed<nsIRunnable> aRunnable);
/* Add a pending IDBTransaction to be cleaned up at the end of performing a
* microtask checkpoint.
* See the step of "Cleanup Indexed Database Transactions" in
* https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint
/* Add a "synchronous section", in the form of an nsIRunnable run once the
* event loop has reached a "metastable state". |aRunnable| must not cause any
* queued events to be processed (i.e. must not spin the event loop).
* We've reached a metastable state when the currently executing task or
* microtask has finished. This is not specced at this time.
* In practice this runs aRunnable once the currently executing task or
* microtask finishes. If called multiple times per microtask, all the
* runnables will be executed, in the order in which RunInMetastableState()
* was called
*/
static void AddPendingIDBTransaction(already_AddRefed<nsIRunnable> aTransaction);
/**
* Returns true if we are doing StableState/MetastableState.
*/
static bool IsInStableOrMetaStableState();
static void RunInMetastableState(already_AddRefed<nsIRunnable> aRunnable);
/* Process viewport META data. This gives us information for the scale
* and zoom of a page on mobile devices. We stick the information in
@@ -2205,11 +2134,6 @@ public:
return sUseActivityCursor;
}
/**
* Returns true if the preload service is enabled.
*/
static bool IsPreloadEnabled();
/**
* Return true if this doc is controlled by a ServiceWorker.
*/
@@ -2454,10 +2378,6 @@ public:
static bool IsJavascriptMIMEType(const nsAString& aMIMEType);
static bool IsJSONMIMEType(const nsAString& aMIMEType);
static bool IsFontMIMEType(const nsAString& aMIMEType);
static void SplitMimeType(const nsAString& aValue, nsString& aType,
nsString& aParams);
@@ -2939,16 +2859,6 @@ private:
bool *aDefaultAction = nullptr,
bool aOnlyChromeDispatch = false);
static nsresult DispatchEvent(nsIDocument* aDoc,
nsISupports* aTarget,
mozilla::WidgetEvent& aWidgetEvent,
mozilla::EventMessage aEventMessage,
bool aCanBubble,
bool aCancelable,
bool aTrusted,
bool *aDefaultAction = nullptr,
bool aOnlyChromeDispatch = false);
static void InitializeModifierStrings();
static void DropFragmentParsers();
@@ -2960,9 +2870,6 @@ private:
static void* AllocClassMatchingInfo(nsINode* aRootNode,
const nsString* aClasses);
static mozilla::EventClassID
GetEventClassIDFromMessage(mozilla::EventMessage aEventMessage);
// Fills in aInfo with the tokens from the supplied autocomplete attribute.
static AutocompleteAttrState InternalSerializeAutocompleteAttribute(const nsAttrValue* aAttrVal,
mozilla::dom::AutocompleteInfo& aInfo);
@@ -3043,7 +2950,6 @@ private:
static bool sPrivacyResistFingerprinting;
static bool sSendPerformanceTimingNotifications;
static bool sUseActivityCursor;
static bool sPreloadEnabled;
static uint32_t sCookiesLifetimePolicy;
static uint32_t sCookiesBehavior;
+93
View File
@@ -67,10 +67,21 @@
#include "nsIDOMEventTarget.h"
// CSS related includes
#include "nsCSSRules.h"
#include "nsIDOMCSSRule.h"
#include "nsMemory.h"
// includes needed for the prototype chain interfaces
#include "nsIDOMCSSKeyframeRule.h"
#include "nsIDOMCSSKeyframesRule.h"
#include "nsIDOMCSSImportRule.h"
#include "nsIDOMCSSMediaRule.h"
#include "nsIDOMCSSFontFaceRule.h"
#include "nsIDOMCSSMozDocumentRule.h"
#include "nsIDOMCSSSupportsRule.h"
#include "nsIDOMCSSCounterStyleRule.h"
#include "nsIDOMCSSPageRule.h"
#include "nsIDOMCSSStyleRule.h"
#include "nsIDOMXULCommandDispatcher.h"
#include "nsIControllers.h"
#include "nsITreeSelection.h"
@@ -175,6 +186,16 @@ static nsDOMClassInfoData sClassInfoData[] = {
// Misc Core related classes
// CSS classes
NS_DEFINE_CLASSINFO_DATA(CSSStyleRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSImportRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSMediaRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSNameSpaceRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
// XUL classes
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULCommandDispatcher, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -191,6 +212,15 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULTreeBuilder, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSMozDocumentRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ContentFrameMessageManager,
nsMessageManagerSH<nsEventTargetSH>,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
@@ -206,6 +236,21 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ChromeMessageSender, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSKeyframeRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSKeyframesRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSCounterStyleRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSPageRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSFontFeatureValuesRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULControlElement, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULLabeledControlElement, nsDOMGenericSH,
@@ -458,6 +503,22 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMConstructor)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSStyleRule, nsIDOMCSSStyleRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSImportRule, nsIDOMCSSImportRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSImportRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSMediaRule, nsIDOMCSSMediaRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMediaRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSNameSpaceRule, nsIDOMCSSRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(XULCommandDispatcher, nsIDOMXULCommandDispatcher)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCommandDispatcher)
DOM_CLASSINFO_MAP_END
@@ -485,6 +546,18 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsITreeView)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSMozDocumentRule, nsIDOMCSSMozDocumentRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMozDocumentRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSSupportsRule, nsIDOMCSSSupportsRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSFontFaceRule, nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsISupports)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager)
@@ -516,6 +589,26 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIMessageSender)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframeRule, nsIDOMCSSKeyframeRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframeRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframesRule, nsIDOMCSSKeyframesRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframesRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSCounterStyleRule, nsIDOMCSSCounterStyleRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSPageRule, nsIDOMCSSPageRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSPageRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSFontFeatureValuesRule, nsIDOMCSSFontFeatureValuesRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULControlElement, nsIDOMXULControlElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement)
DOM_CLASSINFO_MAP_END
+22
View File
@@ -7,6 +7,12 @@
DOMCI_CLASS(DOMPrototype)
DOMCI_CLASS(DOMConstructor)
// CSS classes
DOMCI_CLASS(CSSStyleRule)
DOMCI_CLASS(CSSImportRule)
DOMCI_CLASS(CSSMediaRule)
DOMCI_CLASS(CSSNameSpaceRule)
// XUL classes
DOMCI_CLASS(XULCommandDispatcher)
DOMCI_CLASS(XULControllers)
@@ -15,11 +21,27 @@ DOMCI_CLASS(TreeContentView)
DOMCI_CLASS(XULTemplateBuilder)
DOMCI_CLASS(XULTreeBuilder)
DOMCI_CLASS(CSSMozDocumentRule)
DOMCI_CLASS(CSSSupportsRule)
// @font-face in CSS
DOMCI_CLASS(CSSFontFaceRule)
DOMCI_CLASS(ContentFrameMessageManager)
DOMCI_CLASS(ContentProcessMessageManager)
DOMCI_CLASS(ChromeMessageBroadcaster)
DOMCI_CLASS(ChromeMessageSender)
DOMCI_CLASS(CSSKeyframeRule)
DOMCI_CLASS(CSSKeyframesRule)
// @counter-style in CSS
DOMCI_CLASS(CSSCounterStyleRule)
DOMCI_CLASS(CSSPageRule)
DOMCI_CLASS(CSSFontFeatureValuesRule)
DOMCI_CLASS(XULControlElement)
DOMCI_CLASS(XULLabeledControlElement)
DOMCI_CLASS(XULButtonElement)
+4 -3
View File
@@ -623,7 +623,7 @@ nsDOMMutationObserver::QueueMutationObserverMicroTask()
RefPtr<MutationObserverMicroTask> momt =
new MutationObserverMicroTask();
ccjs->DispatchToMicroTask(momt.forget());
ccjs->DispatchMicroTaskRunnable(momt.forget());
}
void
@@ -644,8 +644,9 @@ nsDOMMutationObserver::RescheduleForRun()
return;
}
RefPtr<MutationObserverMicroTask> momt = new MutationObserverMicroTask();
ccjs->DispatchToMicroTask(momt.forget());
RefPtr<MutationObserverMicroTask> momt =
new MutationObserverMicroTask();
ccjs->DispatchMicroTaskRunnable(momt.forget());
sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
}
+1
View File
@@ -162,6 +162,7 @@ public:
inline DOMHighResTimeStamp TimeStampToDOMHighRes(mozilla::TimeStamp aStamp) const
{
MOZ_ASSERT(!aStamp.IsNull(), "The timestamp should not be null");
if (aStamp.IsNull()) {
return 0;
}
-3
View File
@@ -3145,11 +3145,9 @@ nsDOMWindowUtils::GetPaintingSuppressed(bool *aPaintingSuppressed)
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetPlugins(JSContext* cx, JS::MutableHandle<JS::Value> aPlugins)
{
#ifdef MOZ_ENABLE_NPAPI
nsCOMPtr<nsIDocument> doc = GetDocument();
NS_ENSURE_STATE(doc);
@@ -3161,7 +3159,6 @@ nsDOMWindowUtils::GetPlugins(JSContext* cx, JS::MutableHandle<JS::Value> aPlugin
NS_ENSURE_SUCCESS(rv, rv);
aPlugins.setObject(*jsPlugins);
#endif
return NS_OK;
}
Loaded 100 of 2897 files, more files were not shown because too many files have changed in this diff. Show more