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
3252 changed files with 838435 additions and 153764 deletions

No files matched your search

+1 -1
View File
@@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Clobber for NSS update
Switching to C++17 requires CLOBBER to pick up compiler conf. (Issue #2281)
-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 -1
View File
@@ -80,7 +80,7 @@ StyleInfo::TextIndent(nsAString& aValue)
}
void
StyleInfo::Margin(Side aSide, nsAString& aValue)
StyleInfo::Margin(css::Side aSide, nsAString& aValue)
{
MOZ_ASSERT(mElement->GetPrimaryFrame(), " mElement->GetPrimaryFrame() needs to be valid pointer");
aValue.Truncate();
+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
-17
View File
@@ -560,23 +560,6 @@ BasePrincipal::GetCspJSON(nsAString& outCSPinJSON)
return mCSP->ToJSON(outCSPinJSON);
}
NS_IMETHODIMP
BasePrincipal::IsSameOrigin(nsIURI* aURI, bool aIsPrivateWin, bool* aRes) {
*aRes = false;
nsCOMPtr<nsIURI> prinURI;
nsresult rv = GetURI(getter_AddRefs(prinURI));
if (NS_FAILED(rv) || !prinURI) {
return NS_OK;
}
nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
if (!ssm) {
return NS_ERROR_UNEXPECTED;
;
}
*aRes = NS_SUCCEEDED(ssm->CheckSameOriginURI(prinURI, aURI, aIsPrivateWin));
return NS_OK;
}
NS_IMETHODIMP
BasePrincipal::GetIsNullPrincipal(bool* aResult)
{
-1
View File
@@ -282,7 +282,6 @@ public:
NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId) final;
NS_IMETHOD GetUserContextId(uint32_t* aUserContextId) final;
NS_IMETHOD GetPrivateBrowsingId(uint32_t* aPrivateBrowsingId) final;
NS_IMETHOD IsSameOrigin(nsIURI* aURI, bool aIsPrivateWin, bool* aRes) override;
bool EqualsIgnoringAddonId(nsIPrincipal *aOther);
-6
View File
@@ -223,12 +223,6 @@ interface nsIPrincipal : nsISerializable
*/
readonly attribute AUTF8String originSuffix;
/**
* Uses NS_Security Compare to determine if the
* other URI is same-origin as the uri of the Principal
*/
bool IsSameOrigin(in nsIURI otherURI, in bool aIsPrivateWin);
/**
* The base domain of the codebase URI to which this principal pertains
* (generally the document URI), handling null principals and
+6 -25
View File
@@ -76,7 +76,6 @@ nsIIOService *nsScriptSecurityManager::sIOService = nullptr;
nsIStringBundle *nsScriptSecurityManager::sStrBundle = nullptr;
JSContext *nsScriptSecurityManager::sContext = nullptr;
bool nsScriptSecurityManager::sStrictFileOriginPolicy = true;
bool nsScriptSecurityManager::sSameOriginPolicy = true;
///////////////////////////
// Convenience Functions //
@@ -536,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();
@@ -560,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);
}
@@ -587,7 +574,6 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx,
fileName,
scriptSample,
lineNum,
columnNum,
EmptyString(),
EmptyString());
}
@@ -608,7 +594,7 @@ nsScriptSecurityManager::CheckSameOriginURI(nsIURI* aSourceURI,
nsIURI* aTargetURI,
bool reportError)
{
if (sSameOriginPolicy && !SecurityCompareURIs(aSourceURI, aTargetURI))
if (!SecurityCompareURIs(aSourceURI, aTargetURI))
{
if (reportError) {
ReportError(nullptr, NS_LITERAL_STRING("CheckSameOriginError"),
@@ -1435,13 +1421,10 @@ nsScriptSecurityManager::CanGetService(JSContext *cx,
const char sJSEnabledPrefName[] = "javascript.enabled";
const char sFileOriginPolicyPrefName[] =
"security.fileuri.strict_origin_policy";
const char sSameOriginPolicyPrefName[] =
"security.same_origin_policy.enabled";
static const char* kObservedPrefs[] = {
sJSEnabledPrefName,
sFileOriginPolicyPrefName,
sSameOriginPolicyPrefName,
"capability.policy.",
nullptr
};
@@ -1597,8 +1580,6 @@ nsScriptSecurityManager::ScriptSecurityPrefChanged()
Preferences::GetBool(sJSEnabledPrefName, mIsJavaScriptEnabled);
sStrictFileOriginPolicy =
Preferences::GetBool(sFileOriginPolicyPrefName, false);
sSameOriginPolicy =
Preferences::GetBool(sSameOriginPolicyPrefName, true);
mFileURIWhitelist.reset();
}
+1 -2
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);
@@ -152,7 +152,6 @@ private:
}
static bool sStrictFileOriginPolicy;
static bool sSameOriginPolicy;
static nsIIOService *sIOService;
static nsIStringBundle *sStrBundle;
+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.7.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)
+34 -9
View File
@@ -1,14 +1,39 @@
This is the SQLite amalgamation.
Check sqlite3.h for the version number and source id.
This directory contains source code to
See http://www.sqlite.org/ for more info.
SQLite: An Embeddable SQL Database Engine
We have a UXP-specific moz.build in src/ (normally not there) that we
use to build. Adfditionally, src/ contains sqlite.symbols which lists
all explicitly exported symbols from the library to expose.
To compile the project, first create a directory in which to place
the build products. It is recommended, but not required, that the
build directory be separate from the source directory. Cd into the
build directory and then from the build directory run the configure
script found at the root of the source tree. Then run "make".
To move to a new version:
For example:
Copy the sqlite3.h and sqlite3.c files from the amalgamation of sqlite.
tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
mkdir bld ;# Build will occur in a sibling directory
cd bld ;# Change to the build directory
../sqlite/configure ;# Run the configure script
make ;# Run the makefile.
make install ;# (Optional) Install the build products
Be sure to update SQLITE_VERSION accordingly in $(topsrcdir)/old-configure.in.
The configure script uses autoconf 2.61 and libtool. If the configure
script does not work out for you, there is a generic makefile named
"Makefile.linux-gcc" in the top directory of the source tree that you
can copy and edit to suit your needs. Comments on the generic makefile
show what changes are needed.
The linux binaries on the website are created using the generic makefile,
not the configure script. The windows binaries on the website are created
using MinGW32 configured as a cross-compiler running under Linux. For
details, see the ./publish.sh script at the top-level of the source tree.
The developers do not use teh configure script.
SQLite does not require TCL to run, but a TCL installation is required
by the makefiles. SQLite contains a lot of generated code and TCL is
used to do much of that code generation. The makefile also requires
AWK.
Contacts:
http://www.sqlite.org/
+13
View File
@@ -0,0 +1,13 @@
This is the SQLite amalgamation.
Check sqlite3.h for the version number and source id.
See http://www.sqlite.org/ for more info.
We have a mozilla-specific Makefile.in in src/ (normally no
Makefile.in there) that we use to build.
To move to a new version:
Copy the sqlite3.h and sqlite3.c files from the amalgamation of sqlite.
Be sure to update SQLITE_VERSION accordingly in $(topsrcdir)/configure.in.
+7962 -18006
View File
File diff suppressed because it is too large. Load diff
+93 -450
View File
@@ -146,9 +146,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.46.0"
#define SQLITE_VERSION_NUMBER 3046000
#define SQLITE_SOURCE_ID "2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e"
#define SQLITE_VERSION "3.42.0"
#define SQLITE_VERSION_NUMBER 3042000
#define SQLITE_SOURCE_ID "2023-05-16 12:36:15 831d0fb2836b71c9bc51067c49fee4b8f18047814f2ff22d817d25195cf350b0"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -420,8 +420,6 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
** <li> The application must not modify the SQL statement text passed into
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
** <li> The application must not dereference the arrays or string pointers
** passed as the 3rd and 4th callback parameters after it returns.
** </ul>
*/
SQLITE_API int sqlite3_exec(
@@ -530,7 +528,6 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
#define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8))
#define SQLITE_IOERR_CORRUPTFS (SQLITE_IOERR | (33<<8))
#define SQLITE_IOERR_IN_PAGE (SQLITE_IOERR | (34<<8))
#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
@@ -764,11 +761,11 @@ struct sqlite3_file {
** </ul>
** xLock() upgrades the database file lock. In other words, xLock() moves the
** database file lock in the direction NONE toward EXCLUSIVE. The argument to
** xLock() is always one of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
** xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
** SQLITE_LOCK_NONE. If the database file lock is already at or above the
** requested lock, then the call to xLock() is a no-op.
** xUnlock() downgrades the database file lock to either SHARED or NONE.
** If the lock is already at or below the requested lock state, then the call
* If the lock is already at or below the requested lock state, then the call
** to xUnlock() is a no-op.
** The xCheckReservedLock() method checks whether any database connection,
** either in this process or in some other process, is holding a RESERVED,
@@ -1193,7 +1190,7 @@ struct sqlite3_io_methods {
** by clients within the current process, only within other processes.
**
** <li>[[SQLITE_FCNTL_CKSM_FILE]]
** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the
** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use interally by the
** [checksum VFS shim] only.
**
** <li>[[SQLITE_FCNTL_RESET_CACHE]]
@@ -2129,7 +2126,7 @@ struct sqlite3_mem_methods {
** is stored in each sorted record and the required column values loaded
** from the database as records are returned in sorted order. The default
** value for this option is to never use this optimization. Specifying a
** negative value for this option restores the default behavior.
** negative value for this option restores the default behaviour.
** This option is only available if SQLite is compiled with the
** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option.
**
@@ -2143,22 +2140,6 @@ struct sqlite3_mem_methods {
** configuration setting is never used, then the default maximum is determined
** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option. If that
** compile-time option is not set, then the default maximum is 1073741824.
**
** [[SQLITE_CONFIG_ROWID_IN_VIEW]]
** <dt>SQLITE_CONFIG_ROWID_IN_VIEW
** <dd>The SQLITE_CONFIG_ROWID_IN_VIEW option enables or disables the ability
** for VIEWs to have a ROWID. The capability can only be enabled if SQLite is
** compiled with -DSQLITE_ALLOW_ROWID_IN_VIEW, in which case the capability
** defaults to on. This configuration option queries the current setting or
** changes the setting to off or on. The argument is a pointer to an integer.
** If that integer initially holds a value of 1, then the ability for VIEWs to
** have ROWIDs is activated. If the integer initially holds zero, then the
** ability is deactivated. Any other initial value for the integer leaves the
** setting unchanged. After changes, if any, the integer is written with
** a 1 or 0, if the ability for VIEWs to have ROWIDs is on or off. If SQLite
** is compiled without -DSQLITE_ALLOW_ROWID_IN_VIEW (which is the usual and
** recommended case) then the integer is always filled with zero, regardless
** if its initial value.
** </dl>
*/
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -2190,7 +2171,6 @@ struct sqlite3_mem_methods {
#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
#define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */
#define SQLITE_CONFIG_ROWID_IN_VIEW 30 /* int* */
/*
** CAPI3REF: Database Connection Configuration Options
@@ -2321,7 +2301,7 @@ struct sqlite3_mem_methods {
** database handle, SQLite checks if this will mean that there are now no
** connections at all to the database. If so, it performs a checkpoint
** operation before closing the connection. This option may be used to
** override this behavior. The first parameter passed to this operation
** override this behaviour. The first parameter passed to this operation
** is an integer - positive to disable checkpoints-on-close, or zero (the
** default) to enable them, and negative to leave the setting unchanged.
** The second parameter is a pointer to an integer
@@ -2474,7 +2454,7 @@ struct sqlite3_mem_methods {
** the [VACUUM] command will fail with an obscure error when attempting to
** process a table with generated columns and a descending index. This is
** not considered a bug since SQLite versions 3.3.0 and earlier do not support
** either generated columns or descending indexes.
** either generated columns or decending indexes.
** </dd>
**
** [[SQLITE_DBCONFIG_STMT_SCANSTATUS]]
@@ -2755,7 +2735,6 @@ SQLITE_API sqlite3_int64 sqlite3_total_changes64(sqlite3*);
**
** ^The [sqlite3_is_interrupted(D)] interface can be used to determine whether
** or not an interrupt is currently in effect for [database connection] D.
** It returns 1 if an interrupt is currently in effect, or 0 otherwise.
*/
SQLITE_API void sqlite3_interrupt(sqlite3*);
SQLITE_API int sqlite3_is_interrupted(sqlite3*);
@@ -3305,8 +3284,8 @@ SQLITE_API int sqlite3_set_authorizer(
#define SQLITE_RECURSIVE 33 /* NULL NULL */
/*
** CAPI3REF: Deprecated Tracing And Profiling Functions
** DEPRECATED
** CAPI3REF: Tracing And Profiling Functions
** METHOD: sqlite3
**
** These routines are deprecated. Use the [sqlite3_trace_v2()] interface
** instead of the routines described here.
@@ -3409,10 +3388,8 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*,
** M argument should be the bitwise OR-ed combination of
** zero or more [SQLITE_TRACE] constants.
**
** ^Each call to either sqlite3_trace(D,X,P) or sqlite3_trace_v2(D,M,X,P)
** overrides (cancels) all prior calls to sqlite3_trace(D,X,P) or
** sqlite3_trace_v2(D,M,X,P) for the [database connection] D. Each
** database connection may have at most one trace callback.
** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides
** (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2().
**
** ^The X callback is invoked whenever any of the events identified by
** mask M occur. ^The integer return value from the callback is currently
@@ -3781,7 +3758,7 @@ SQLITE_API int sqlite3_open_v2(
** as F) must be one of:
** <ul>
** <li> A database filename pointer created by the SQLite core and
** passed into the xOpen() method of a VFS implementation, or
** passed into the xOpen() method of a VFS implemention, or
** <li> A filename obtained from [sqlite3_db_filename()], or
** <li> A new filename constructed using [sqlite3_create_filename()].
** </ul>
@@ -3894,7 +3871,7 @@ SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
/*
** CAPI3REF: Create and Destroy VFS Filenames
**
** These interfaces are provided for use by [VFS shim] implementations and
** These interfces are provided for use by [VFS shim] implementations and
** are not useful outside of that context.
**
** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of
@@ -3973,17 +3950,14 @@ SQLITE_API void sqlite3_free_filename(sqlite3_filename);
** </ul>
**
** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language
** text that describes the error, as either UTF-8 or UTF-16 respectively,
** or NULL if no error message is available.
** (See how SQLite handles [invalid UTF] for exceptions to this rule.)
** text that describes the error, as either UTF-8 or UTF-16 respectively.
** ^(Memory to hold the error message string is managed internally.
** The application does not need to worry about freeing the result.
** However, the error string might be overwritten or deallocated by
** subsequent calls to other SQLite interface functions.)^
**
** ^The sqlite3_errstr(E) interface returns the English-language text
** that describes the [result code] E, as UTF-8, or NULL if E is not an
** result code for which a text error message is available.
** ^The sqlite3_errstr() interface returns the English-language text
** that describes the [result code], as UTF-8.
** ^(Memory to hold the error message string is managed internally
** and must not be freed by the application)^.
**
@@ -4444,41 +4418,6 @@ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
*/
SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt);
/*
** CAPI3REF: Change The EXPLAIN Setting For A Prepared Statement
** METHOD: sqlite3_stmt
**
** The sqlite3_stmt_explain(S,E) interface changes the EXPLAIN
** setting for [prepared statement] S. If E is zero, then S becomes
** a normal prepared statement. If E is 1, then S behaves as if
** its SQL text began with "[EXPLAIN]". If E is 2, then S behaves as if
** its SQL text began with "[EXPLAIN QUERY PLAN]".
**
** Calling sqlite3_stmt_explain(S,E) might cause S to be reprepared.
** SQLite tries to avoid a reprepare, but a reprepare might be necessary
** on the first transition into EXPLAIN or EXPLAIN QUERY PLAN mode.
**
** Because of the potential need to reprepare, a call to
** sqlite3_stmt_explain(S,E) will fail with SQLITE_ERROR if S cannot be
** reprepared because it was created using [sqlite3_prepare()] instead of
** the newer [sqlite3_prepare_v2()] or [sqlite3_prepare_v3()] interfaces and
** hence has no saved SQL text with which to reprepare.
**
** Changing the explain setting for a prepared statement does not change
** the original SQL text for the statement. Hence, if the SQL text originally
** began with EXPLAIN or EXPLAIN QUERY PLAN, but sqlite3_stmt_explain(S,0)
** is called to convert the statement into an ordinary statement, the EXPLAIN
** or EXPLAIN QUERY PLAN keywords will still appear in the sqlite3_sql(S)
** output, even though the statement now acts like a normal SQL statement.
**
** This routine returns SQLITE_OK if the explain mode is successfully
** changed, or an error code if the explain mode could not be changed.
** The explain mode cannot be changed while a statement is active.
** Hence, it is good practice to call [sqlite3_reset(S)]
** immediately prior to calling sqlite3_stmt_explain(S,E).
*/
SQLITE_API int sqlite3_stmt_explain(sqlite3_stmt *pStmt, int eMode);
/*
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
** METHOD: sqlite3_stmt
@@ -4642,7 +4581,7 @@ typedef struct sqlite3_context sqlite3_context;
** with it may be passed. ^It is called to dispose of the BLOB or string even
** if the call to the bind API fails, except the destructor is not called if
** the third parameter is a NULL pointer or the fourth parameter is negative.
** ^ (2) The special constant, [SQLITE_STATIC], may be passed to indicate that
** ^ (2) The special constant, [SQLITE_STATIC], may be passsed to indicate that
** the application remains responsible for disposing of the object. ^In this
** case, the object and the provided pointer to it must remain valid until
** either the prepared statement is finalized or the same SQL parameter is
@@ -5321,33 +5260,20 @@ SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt);
** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S
** back to the beginning of its program.
**
** ^The return code from [sqlite3_reset(S)] indicates whether or not
** the previous evaluation of prepared statement S completed successfully.
** ^If [sqlite3_step(S)] has never before been called on S or if
** [sqlite3_step(S)] has not been called since the previous call
** to [sqlite3_reset(S)], then [sqlite3_reset(S)] will return
** [SQLITE_OK].
** ^If the most recent call to [sqlite3_step(S)] for the
** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE],
** or if [sqlite3_step(S)] has never before been called on S,
** then [sqlite3_reset(S)] returns [SQLITE_OK].
**
** ^If the most recent call to [sqlite3_step(S)] for the
** [prepared statement] S indicated an error, then
** [sqlite3_reset(S)] returns an appropriate [error code].
** ^The [sqlite3_reset(S)] interface might also return an [error code]
** if there were no prior errors but the process of resetting
** the prepared statement caused a new error. ^For example, if an
** [INSERT] statement with a [RETURNING] clause is only stepped one time,
** that one call to [sqlite3_step(S)] might return SQLITE_ROW but
** the overall statement might still fail and the [sqlite3_reset(S)] call
** might return SQLITE_BUSY if locking constraints prevent the
** database change from committing. Therefore, it is important that
** applications check the return code from [sqlite3_reset(S)] even if
** no prior call to [sqlite3_step(S)] indicated a problem.
**
** ^The [sqlite3_reset(S)] interface does not change the values
** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S.
*/
SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
/*
** CAPI3REF: Create Or Redefine SQL Functions
** KEYWORDS: {function creation routines}
@@ -5558,7 +5484,7 @@ SQLITE_API int sqlite3_create_window_function(
** [application-defined SQL function]
** that has side-effects or that could potentially leak sensitive information.
** This will prevent attacks in which an application is tricked
** into using a database file that has had its schema surreptitiously
** into using a database file that has had its schema surreptiously
** modified to invoke the application-defined function in ways that are
** harmful.
** <p>
@@ -5594,27 +5520,13 @@ SQLITE_API int sqlite3_create_window_function(
** </dd>
**
** [[SQLITE_SUBTYPE]] <dt>SQLITE_SUBTYPE</dt><dd>
** The SQLITE_SUBTYPE flag indicates to SQLite that a function might call
** The SQLITE_SUBTYPE flag indicates to SQLite that a function may call
** [sqlite3_value_subtype()] to inspect the sub-types of its arguments.
** This flag instructs SQLite to omit some corner-case optimizations that
** might disrupt the operation of the [sqlite3_value_subtype()] function,
** causing it to return zero rather than the correct subtype().
** SQL functions that invokes [sqlite3_value_subtype()] should have this
** property. If the SQLITE_SUBTYPE property is omitted, then the return
** value from [sqlite3_value_subtype()] might sometimes be zero even though
** a non-zero subtype was specified by the function argument expression.
**
** [[SQLITE_RESULT_SUBTYPE]] <dt>SQLITE_RESULT_SUBTYPE</dt><dd>
** The SQLITE_RESULT_SUBTYPE flag indicates to SQLite that a function might call
** [sqlite3_result_subtype()] to cause a sub-type to be associated with its
** result.
** Every function that invokes [sqlite3_result_subtype()] should have this
** property. If it does not, then the call to [sqlite3_result_subtype()]
** might become a no-op if the function is used as term in an
** [expression index]. On the other hand, SQL functions that never invoke
** [sqlite3_result_subtype()] should avoid setting this property, as the
** purpose of this property is to disable certain optimizations that are
** incompatible with subtypes.
** Specifying this flag makes no difference for scalar or aggregate user
** functions. However, if it is not specified for a user-defined window
** function, then any sub-types belonging to arguments passed to the window
** function may be discarded before the window function is called (i.e.
** sqlite3_value_subtype() will always return 0).
** </dd>
** </dl>
*/
@@ -5622,7 +5534,6 @@ SQLITE_API int sqlite3_create_window_function(
#define SQLITE_DIRECTONLY 0x000080000
#define SQLITE_SUBTYPE 0x000100000
#define SQLITE_INNOCUOUS 0x000200000
#define SQLITE_RESULT_SUBTYPE 0x001000000
/*
** CAPI3REF: Deprecated Functions
@@ -5819,12 +5730,6 @@ SQLITE_API int sqlite3_value_encoding(sqlite3_value*);
** information can be used to pass a limited amount of context from
** one SQL function to another. Use the [sqlite3_result_subtype()]
** routine to set the subtype for the return value of an SQL function.
**
** Every [application-defined SQL function] that invoke this interface
** should include the [SQLITE_SUBTYPE] property in the text
** encoding argument when the function is [sqlite3_create_function|registered].
** If the [SQLITE_SUBTYPE] property is omitted, then sqlite3_value_subtype()
** might return zero instead of the upstream subtype in some corner cases.
*/
SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*);
@@ -5923,56 +5828,48 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
** METHOD: sqlite3_context
**
** These functions may be used by (non-aggregate) SQL functions to
** associate auxiliary data with argument values. If the same argument
** value is passed to multiple invocations of the same SQL function during
** query execution, under some circumstances the associated auxiliary data
** might be preserved. An example of where this might be useful is in a
** regular-expression matching function. The compiled version of the regular
** expression can be stored as auxiliary data associated with the pattern string.
** associate metadata with argument values. If the same value is passed to
** multiple invocations of the same SQL function during query execution, under
** some circumstances the associated metadata may be preserved. An example
** of where this might be useful is in a regular-expression matching
** function. The compiled version of the regular expression can be stored as
** metadata associated with the pattern string.
** Then as long as the pattern string remains the same,
** the compiled regular expression can be reused on multiple
** invocations of the same function.
**
** ^The sqlite3_get_auxdata(C,N) interface returns a pointer to the auxiliary data
** ^The sqlite3_get_auxdata(C,N) interface returns a pointer to the metadata
** associated by the sqlite3_set_auxdata(C,N,P,X) function with the Nth argument
** value to the application-defined function. ^N is zero for the left-most
** function argument. ^If there is no auxiliary data
** function argument. ^If there is no metadata
** associated with the function argument, the sqlite3_get_auxdata(C,N) interface
** returns a NULL pointer.
**
** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as auxiliary data for the
** N-th argument of the application-defined function. ^Subsequent
** ^The sqlite3_set_auxdata(C,N,P,X) interface saves P as metadata for the N-th
** argument of the application-defined function. ^Subsequent
** calls to sqlite3_get_auxdata(C,N) return P from the most recent
** sqlite3_set_auxdata(C,N,P,X) call if the auxiliary data is still valid or
** NULL if the auxiliary data has been discarded.
** sqlite3_set_auxdata(C,N,P,X) call if the metadata is still valid or
** NULL if the metadata has been discarded.
** ^After each call to sqlite3_set_auxdata(C,N,P,X) where X is not NULL,
** SQLite will invoke the destructor function X with parameter P exactly
** once, when the auxiliary data is discarded.
** SQLite is free to discard the auxiliary data at any time, including: <ul>
** once, when the metadata is discarded.
** SQLite is free to discard the metadata at any time, including: <ul>
** <li> ^(when the corresponding function parameter changes)^, or
** <li> ^(when [sqlite3_reset()] or [sqlite3_finalize()] is called for the
** SQL statement)^, or
** <li> ^(when sqlite3_set_auxdata() is invoked again on the same
** parameter)^, or
** <li> ^(during the original sqlite3_set_auxdata() call when a memory
** allocation error occurs.)^
** <li> ^(during the original sqlite3_set_auxdata() call if the function
** is evaluated during query planning instead of during query execution,
** as sometimes happens with [SQLITE_ENABLE_STAT4].)^ </ul>
** allocation error occurs.)^ </ul>
**
** Note the last two bullets in particular. The destructor X in
** Note the last bullet in particular. The destructor X in
** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the
** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata()
** should be called near the end of the function implementation and the
** function implementation should not make any use of P after
** sqlite3_set_auxdata() has been called. Furthermore, a call to
** sqlite3_get_auxdata() that occurs immediately after a corresponding call
** to sqlite3_set_auxdata() might still return NULL if an out-of-memory
** condition occurred during the sqlite3_set_auxdata() call or if the
** function is being evaluated during query planning rather than during
** query execution.
** sqlite3_set_auxdata() has been called.
**
** ^(In practice, auxiliary data is preserved between function calls for
** ^(In practice, metadata is preserved between function calls for
** function parameters that are compile-time constants, including literal
** values and [parameters] and expressions composed from the same.)^
**
@@ -5982,67 +5879,10 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*);
**
** These routines must be called from the same thread in which
** the SQL function is running.
**
** See also: [sqlite3_get_clientdata()] and [sqlite3_set_clientdata()].
*/
SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N);
SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*));
/*
** CAPI3REF: Database Connection Client Data
** METHOD: sqlite3
**
** These functions are used to associate one or more named pointers
** with a [database connection].
** A call to sqlite3_set_clientdata(D,N,P,X) causes the pointer P
** to be attached to [database connection] D using name N. Subsequent
** calls to sqlite3_get_clientdata(D,N) will return a copy of pointer P
** or a NULL pointer if there were no prior calls to
** sqlite3_set_clientdata() with the same values of D and N.
** Names are compared using strcmp() and are thus case sensitive.
**
** If P and X are both non-NULL, then the destructor X is invoked with
** argument P on the first of the following occurrences:
** <ul>
** <li> An out-of-memory error occurs during the call to
** sqlite3_set_clientdata() which attempts to register pointer P.
** <li> A subsequent call to sqlite3_set_clientdata(D,N,P,X) is made
** with the same D and N parameters.
** <li> The database connection closes. SQLite does not make any guarantees
** about the order in which destructors are called, only that all
** destructors will be called exactly once at some point during the
** database connection closing process.
** </ul>
**
** SQLite does not do anything with client data other than invoke
** destructors on the client data at the appropriate time. The intended
** use for client data is to provide a mechanism for wrapper libraries
** to store additional information about an SQLite database connection.
**
** There is no limit (other than available memory) on the number of different
** client data pointers (with different names) that can be attached to a
** single database connection. However, the implementation is optimized
** for the case of having only one or two different client data names.
** Applications and wrapper libraries are discouraged from using more than
** one client data name each.
**
** There is no way to enumerate the client data pointers
** associated with a database connection. The N parameter can be thought
** of as a secret key such that only code that knows the secret key is able
** to access the associated data.
**
** Security Warning: These interfaces should not be exposed in scripting
** languages or in other circumstances where it might be possible for an
** an attacker to invoke them. Any agent that can invoke these interfaces
** can probably also take control of the process.
**
** Database connection client data is only available for SQLite
** version 3.44.0 ([dateof:3.44.0]) and later.
**
** See also: [sqlite3_set_auxdata()] and [sqlite3_get_auxdata()].
*/
SQLITE_API void *sqlite3_get_clientdata(sqlite3*,const char*);
SQLITE_API int sqlite3_set_clientdata(sqlite3*, const char*, void*, void(*)(void*));
/*
** CAPI3REF: Constants Defining Special Destructor Behavior
@@ -6244,20 +6084,6 @@ SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
** higher order bits are discarded.
** The number of subtype bytes preserved by SQLite might increase
** in future releases of SQLite.
**
** Every [application-defined SQL function] that invokes this interface
** should include the [SQLITE_RESULT_SUBTYPE] property in its
** text encoding argument when the SQL function is
** [sqlite3_create_function|registered]. If the [SQLITE_RESULT_SUBTYPE]
** property is omitted from the function that invokes sqlite3_result_subtype(),
** then in some cases the sqlite3_result_subtype() might fail to set
** the result subtype.
**
** If SQLite is compiled with -DSQLITE_STRICT_SUBTYPE=1, then any
** SQL function that invokes the sqlite3_result_subtype() interface
** and that does not have the SQLITE_RESULT_SUBTYPE property will raise
** an error. Future versions of SQLite might enable -DSQLITE_STRICT_SUBTYPE=1
** by default.
*/
SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int);
@@ -6689,7 +6515,7 @@ SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName);
SQLITE_API int sqlite3_txn_state(sqlite3*,const char *zSchema);
/*
** CAPI3REF: Allowed return values from sqlite3_txn_state()
** CAPI3REF: Allowed return values from [sqlite3_txn_state()]
** KEYWORDS: {transaction state}
**
** These constants define the current transaction state of a database file.
@@ -6821,7 +6647,7 @@ SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
** ^Each call to the sqlite3_autovacuum_pages() interface overrides all
** previous invocations for that database connection. ^If the callback
** argument (C) to sqlite3_autovacuum_pages(D,C,P,X) is a NULL pointer,
** then the autovacuum steps callback is canceled. The return value
** then the autovacuum steps callback is cancelled. The return value
** from sqlite3_autovacuum_pages() is normally SQLITE_OK, but might
** be some other error code if something goes wrong. The current
** implementation will only return SQLITE_OK or SQLITE_MISUSE, but other
@@ -6887,12 +6713,6 @@ SQLITE_API int sqlite3_autovacuum_pages(
** The exceptions defined in this paragraph might change in a future
** release of SQLite.
**
** Whether the update hook is invoked before or after the
** corresponding change is currently unspecified and may differ
** depending on the type of change. Do not rely on the order of the
** hook call with regards to the final result of the operation which
** triggers the hook.
**
** The update hook implementation must not do anything that will modify
** the database connection that invoked the update hook. Any actions
** to modify the database connection must be deferred until after the
@@ -7346,10 +7166,6 @@ struct sqlite3_module {
/* The methods above are in versions 1 and 2 of the sqlite_module object.
** Those below are for version 3 and greater. */
int (*xShadowName)(const char*);
/* The methods above are in versions 1 through 3 of the sqlite_module object.
** Those below are for version 4 and greater. */
int (*xIntegrity)(sqlite3_vtab *pVTab, const char *zSchema,
const char *zTabName, int mFlags, char **pzErr);
};
/*
@@ -7837,7 +7653,7 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
** code is returned and the transaction rolled back.
**
** Calling this function with an argument that is not a NULL pointer or an
** open blob handle results in undefined behavior. ^Calling this routine
** open blob handle results in undefined behaviour. ^Calling this routine
** with a null pointer (such as would be returned by a failed call to
** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function
** is passed a valid open blob handle, the values returned by the
@@ -8064,11 +7880,9 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
**
** ^(Some systems (for example, Windows 95) do not support the operation
** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try()
** will always return SQLITE_BUSY. In most cases the SQLite core only uses
** sqlite3_mutex_try() as an optimization, so this is acceptable
** behavior. The exceptions are unix builds that set the
** SQLITE_ENABLE_SETLK_TIMEOUT build option. In that case a working
** sqlite3_mutex_try() is required.)^
** will always return SQLITE_BUSY. The SQLite core only ever uses
** sqlite3_mutex_try() as an optimization so this is acceptable
** behavior.)^
**
** ^The sqlite3_mutex_leave() routine exits a mutex that was
** previously entered by the same thread. The behavior
@@ -8319,7 +8133,6 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_PRNG_SAVE 5
#define SQLITE_TESTCTRL_PRNG_RESTORE 6
#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
#define SQLITE_TESTCTRL_FK_NO_ACTION 7
#define SQLITE_TESTCTRL_BITVEC_TEST 8
#define SQLITE_TESTCTRL_FAULT_INSTALL 9
#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
@@ -8327,7 +8140,6 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_ASSERT 12
#define SQLITE_TESTCTRL_ALWAYS 13
#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */
#define SQLITE_TESTCTRL_JSON_SELFCHECK 14
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
@@ -8349,8 +8161,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_TRACEFLAGS 31
#define SQLITE_TESTCTRL_TUNE 32
#define SQLITE_TESTCTRL_LOGEST 33
#define SQLITE_TESTCTRL_USELONGDOUBLE 34
#define SQLITE_TESTCTRL_LAST 34 /* Largest TESTCTRL */
#define SQLITE_TESTCTRL_LAST 33 /* Largest TESTCTRL */
/*
** CAPI3REF: SQL Keyword Checking
@@ -8363,7 +8174,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
** The sqlite3_keyword_count() interface returns the number of distinct
** keywords understood by SQLite.
**
** The sqlite3_keyword_name(N,Z,L) interface finds the 0-based N-th keyword and
** The sqlite3_keyword_name(N,Z,L) interface finds the N-th keyword and
** makes *Z point to that keyword expressed as UTF8 and writes the number
** of bytes in the keyword into *L. The string that *Z points to is not
** zero-terminated. The sqlite3_keyword_name(N,Z,L) routine returns
@@ -9806,7 +9617,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
** [[SQLITE_VTAB_DIRECTONLY]]<dt>SQLITE_VTAB_DIRECTONLY</dt>
** <dd>Calls of the form
** [sqlite3_vtab_config](db,SQLITE_VTAB_DIRECTONLY) from within the
** the [xConnect] or [xCreate] methods of a [virtual table] implementation
** the [xConnect] or [xCreate] methods of a [virtual table] implmentation
** prohibits that virtual table from being used from within triggers and
** views.
** </dd>
@@ -9942,45 +9753,24 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
** <li value="2"><p>
** ^(If the sqlite3_vtab_distinct() interface returns 2, that means
** that the query planner does not need the rows returned in any particular
** order, as long as rows with the same values in all columns identified
** by "aOrderBy" are adjacent.)^ ^(Furthermore, when two or more rows
** contain the same values for all columns identified by "colUsed", all but
** one such row may optionally be omitted from the result.)^
** The virtual table is not required to omit rows that are duplicates
** over the "colUsed" columns, but if the virtual table can do that without
** too much extra effort, it could potentially help the query to run faster.
** order, as long as rows with the same values in all "aOrderBy" columns
** are adjacent.)^ ^(Furthermore, only a single row for each particular
** combination of values in the columns identified by the "aOrderBy" field
** needs to be returned.)^ ^It is always ok for two or more rows with the same
** values in all "aOrderBy" columns to be returned, as long as all such rows
** are adjacent. ^The virtual table may, if it chooses, omit extra rows
** that have the same value for all columns identified by "aOrderBy".
** ^However omitting the extra rows is optional.
** This mode is used for a DISTINCT query.
** <li value="3"><p>
** ^(If the sqlite3_vtab_distinct() interface returns 3, that means the
** virtual table must return rows in the order defined by "aOrderBy" as
** if the sqlite3_vtab_distinct() interface had returned 0. However if
** two or more rows in the result have the same values for all columns
** identified by "colUsed", then all but one such row may optionally be
** omitted.)^ Like when the return value is 2, the virtual table
** is not required to omit rows that are duplicates over the "colUsed"
** columns, but if the virtual table can do that without
** too much extra effort, it could potentially help the query to run faster.
** This mode is used for queries
** ^(If the sqlite3_vtab_distinct() interface returns 3, that means
** that the query planner needs only distinct rows but it does need the
** rows to be sorted.)^ ^The virtual table implementation is free to omit
** rows that are identical in all aOrderBy columns, if it wants to, but
** it is not required to omit any rows. This mode is used for queries
** that have both DISTINCT and ORDER BY clauses.
** </ol>
**
** <p>The following table summarizes the conditions under which the
** virtual table is allowed to set the "orderByConsumed" flag based on
** the value returned by sqlite3_vtab_distinct(). This table is a
** restatement of the previous four paragraphs:
**
** <table border=1 cellspacing=0 cellpadding=10 width="90%">
** <tr>
** <td valign="top">sqlite3_vtab_distinct() return value
** <td valign="top">Rows are returned in aOrderBy order
** <td valign="top">Rows with the same value in all aOrderBy columns are adjacent
** <td valign="top">Duplicates over all colUsed columns may be omitted
** <tr><td>0<td>yes<td>yes<td>no
** <tr><td>1<td>no<td>yes<td>no
** <tr><td>2<td>no<td>yes<td>yes
** <tr><td>3<td>yes<td>yes<td>yes
** </table>
**
** ^For the purposes of comparing virtual table output values to see if the
** values are same value for sorting purposes, two NULL values are considered
** to be the same. In other words, the comparison operator is "IS"
@@ -10017,7 +9807,7 @@ SQLITE_API int sqlite3_vtab_distinct(sqlite3_index_info*);
** communicated to the xBestIndex method as a
** [SQLITE_INDEX_CONSTRAINT_EQ] constraint.)^ If xBestIndex wants to use
** this constraint, it must set the corresponding
** aConstraintUsage[].argvIndex to a positive integer. ^(Then, under
** aConstraintUsage[].argvIndex to a postive integer. ^(Then, under
** the usual mode of handling IN operators, SQLite generates [bytecode]
** that invokes the [xFilter|xFilter() method] once for each value
** on the right-hand side of the IN operator.)^ Thus the virtual table
@@ -10446,7 +10236,7 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
** When the [sqlite3_blob_write()] API is used to update a blob column,
** the pre-update hook is invoked with SQLITE_DELETE. This is because the
** in this case the new values are not available. In this case, when a
** callback made with op==SQLITE_DELETE is actually a write using the
** callback made with op==SQLITE_DELETE is actuall a write using the
** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns
** the index of the column being written. In other cases, where the
** pre-update hook is being invoked for some other reason, including a
@@ -10707,13 +10497,6 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c
** SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy
** of the database exists.
**
** After the call, if the SQLITE_SERIALIZE_NOCOPY bit had been set,
** the returned buffer content will remain accessible and unchanged
** until either the next write operation on the connection or when
** the connection is closed, and applications must not modify the
** buffer. If the bit had been clear, the returned buffer will not
** be accessed by SQLite after the call.
**
** A call to sqlite3_serialize(D,S,P,F) might return NULL even if the
** SQLITE_SERIALIZE_NOCOPY bit is omitted from argument F if a memory
** allocation error occurs.
@@ -10762,9 +10545,6 @@ SQLITE_API unsigned char *sqlite3_serialize(
** SQLite will try to increase the buffer size using sqlite3_realloc64()
** if writes on the database cause it to grow larger than M bytes.
**
** Applications must not modify the buffer P or invalidate it before
** the database connection D is closed.
**
** The sqlite3_deserialize() interface will fail with SQLITE_BUSY if the
** database is currently in a read transaction or is involved in a backup
** operation.
@@ -10773,13 +10553,6 @@ SQLITE_API unsigned char *sqlite3_serialize(
** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the
** function returns SQLITE_ERROR.
**
** The deserialized database should not be in [WAL mode]. If the database
** is in WAL mode, then any attempt to use the database file will result
** in an [SQLITE_CANTOPEN] error. The application can set the
** [file format version numbers] (bytes 18 and 19) of the input database P
** to 0x01 prior to invoking sqlite3_deserialize(D,S,P,N,M,F) to force the
** database file into rollback mode and work around this limitation.
**
** If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the
** SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then
** [sqlite3_free()] is invoked on argument P prior to returning.
@@ -11852,18 +11625,6 @@ SQLITE_API int sqlite3changeset_concat(
);
/*
** CAPI3REF: Upgrade the Schema of a Changeset/Patchset
*/
SQLITE_API int sqlite3changeset_upgrade(
sqlite3 *db,
const char *zDb,
int nIn, const void *pIn, /* Input changeset */
int *pnOut, void **ppOut /* OUT: Inverse of input */
);
/*
** CAPI3REF: Changegroup Handle
**
@@ -11910,38 +11671,6 @@ typedef struct sqlite3_changegroup sqlite3_changegroup;
*/
SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp);
/*
** CAPI3REF: Add a Schema to a Changegroup
** METHOD: sqlite3_changegroup_schema
**
** This method may be used to optionally enforce the rule that the changesets
** added to the changegroup handle must match the schema of database zDb
** ("main", "temp", or the name of an attached database). If
** sqlite3changegroup_add() is called to add a changeset that is not compatible
** with the configured schema, SQLITE_SCHEMA is returned and the changegroup
** object is left in an undefined state.
**
** A changeset schema is considered compatible with the database schema in
** the same way as for sqlite3changeset_apply(). Specifically, for each
** table in the changeset, there exists a database table with:
**
** <ul>
** <li> The name identified by the changeset, and
** <li> at least as many columns as recorded in the changeset, and
** <li> the primary key columns in the same position as recorded in
** the changeset.
** </ul>
**
** The output of the changegroup object always has the same schema as the
** database nominated using this function. In cases where changesets passed
** to sqlite3changegroup_add() have fewer columns than the corresponding table
** in the database schema, these are filled in using the default column
** values from the database schema. This makes it possible to combined
** changesets that have different numbers of columns for a single table
** within a changegroup, provided that they are otherwise compatible.
*/
SQLITE_API int sqlite3changegroup_schema(sqlite3_changegroup*, sqlite3*, const char *zDb);
/*
** CAPI3REF: Add A Changeset To A Changegroup
** METHOD: sqlite3_changegroup
@@ -12010,45 +11739,16 @@ SQLITE_API int sqlite3changegroup_schema(sqlite3_changegroup*, sqlite3*, const c
** If the new changeset contains changes to a table that is already present
** in the changegroup, then the number of columns and the position of the
** primary key columns for the table must be consistent. If this is not the
** case, this function fails with SQLITE_SCHEMA. Except, if the changegroup
** object has been configured with a database schema using the
** sqlite3changegroup_schema() API, then it is possible to combine changesets
** with different numbers of columns for a single table, provided that
** they are otherwise compatible.
** case, this function fails with SQLITE_SCHEMA. If the input changeset
** appears to be corrupt and the corruption is detected, SQLITE_CORRUPT is
** returned. Or, if an out-of-memory condition occurs during processing, this
** function returns SQLITE_NOMEM. In all cases, if an error occurs the state
** of the final contents of the changegroup is undefined.
**
** If the input changeset appears to be corrupt and the corruption is
** detected, SQLITE_CORRUPT is returned. Or, if an out-of-memory condition
** occurs during processing, this function returns SQLITE_NOMEM.
**
** In all cases, if an error occurs the state of the final contents of the
** changegroup is undefined. If no error occurs, SQLITE_OK is returned.
** If no error occurs, SQLITE_OK is returned.
*/
SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData);
/*
** CAPI3REF: Add A Single Change To A Changegroup
** METHOD: sqlite3_changegroup
**
** This function adds the single change currently indicated by the iterator
** passed as the second argument to the changegroup object. The rules for
** adding the change are just as described for [sqlite3changegroup_add()].
**
** If the change is successfully added to the changegroup, SQLITE_OK is
** returned. Otherwise, an SQLite error code is returned.
**
** The iterator must point to a valid entry when this function is called.
** If it does not, SQLITE_ERROR is returned and no change is added to the
** changegroup. Additionally, the iterator must not have been opened with
** the SQLITE_CHANGESETAPPLY_INVERT flag. In this case SQLITE_ERROR is also
** returned.
*/
SQLITE_API int sqlite3changegroup_add_change(
sqlite3_changegroup*,
sqlite3_changeset_iter*
);
/*
** CAPI3REF: Obtain A Composite Changeset From A Changegroup
** METHOD: sqlite3_changegroup
@@ -12310,17 +12010,10 @@ SQLITE_API int sqlite3changeset_apply_v2(
** <li>an insert change if all fields of the conflicting row match
** the row being inserted.
** </ul>
**
** <dt>SQLITE_CHANGESETAPPLY_FKNOACTION <dd>
** If this flag it set, then all foreign key constraints in the target
** database behave as if they were declared with "ON UPDATE NO ACTION ON
** DELETE NO ACTION", even if they are actually CASCADE, RESTRICT, SET NULL
** or SET DEFAULT.
*/
#define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001
#define SQLITE_CHANGESETAPPLY_INVERT 0x0002
#define SQLITE_CHANGESETAPPLY_IGNORENOOP 0x0004
#define SQLITE_CHANGESETAPPLY_FKNOACTION 0x0008
/*
** CAPI3REF: Constants Passed To The Conflict Handler
@@ -12853,8 +12546,8 @@ struct Fts5PhraseIter {
** EXTENSION API FUNCTIONS
**
** xUserData(pFts):
** Return a copy of the pUserData pointer passed to the xCreateFunction()
** API when the extension function was registered.
** Return a copy of the context pointer the extension function was
** registered with.
**
** xColumnTotalSize(pFts, iCol, pnToken):
** If parameter iCol is less than zero, set output variable *pnToken
@@ -12886,11 +12579,8 @@ struct Fts5PhraseIter {
** created with the "columnsize=0" option.
**
** xColumnText:
** If parameter iCol is less than zero, or greater than or equal to the
** number of columns in the table, SQLITE_RANGE is returned.
**
** Otherwise, this function attempts to retrieve the text of column iCol of
** the current document. If successful, (*pz) is set to point to a buffer
** This function attempts to retrieve the text of column iCol of the
** current document. If successful, (*pz) is set to point to a buffer
** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
** if an error occurs, an SQLite error code is returned and the final values
@@ -12900,10 +12590,8 @@ struct Fts5PhraseIter {
** Returns the number of phrases in the current query expression.
**
** xPhraseSize:
** If parameter iCol is less than zero, or greater than or equal to the
** number of phrases in the current query, as returned by xPhraseCount,
** 0 is returned. Otherwise, this function returns the number of tokens in
** phrase iPhrase of the query. Phrases are numbered starting from zero.
** Returns the number of tokens in phrase iPhrase of the query. Phrases
** are numbered starting from zero.
**
** xInstCount:
** Set *pnInst to the total number of occurrences of all phrases within
@@ -12919,13 +12607,12 @@ struct Fts5PhraseIter {
** Query for the details of phrase match iIdx within the current row.
** Phrase matches are numbered starting from zero, so the iIdx argument
** should be greater than or equal to zero and smaller than the value
** output by xInstCount(). If iIdx is less than zero or greater than
** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned.
** output by xInstCount().
**
** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol
** Usually, output parameter *piPhrase is set to the phrase number, *piCol
** to the column in which it occurs and *piOff the token offset of the
** first token of the phrase. SQLITE_OK is returned if successful, or an
** error code (i.e. SQLITE_NOMEM) if an error occurs.
** first token of the phrase. Returns SQLITE_OK if successful, or an error
** code (i.e. SQLITE_NOMEM) if an error occurs.
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option.
@@ -12951,10 +12638,6 @@ struct Fts5PhraseIter {
** Invoking Api.xUserData() returns a copy of the pointer passed as
** the third argument to pUserData.
**
** If parameter iPhrase is less than zero, or greater than or equal to
** the number of phrases in the query, as returned by xPhraseCount(),
** this function returns SQLITE_RANGE.
**
** If the callback function returns any value other than SQLITE_OK, the
** query is abandoned and the xQueryPhrase function returns immediately.
** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK.
@@ -13069,39 +12752,6 @@ struct Fts5PhraseIter {
**
** xPhraseNextColumn()
** See xPhraseFirstColumn above.
**
** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken)
** This is used to access token iToken of phrase iPhrase of the current
** query. Before returning, output parameter *ppToken is set to point
** to a buffer containing the requested token, and *pnToken to the
** size of this buffer in bytes.
**
** If iPhrase or iToken are less than zero, or if iPhrase is greater than
** or equal to the number of phrases in the query as reported by
** xPhraseCount(), or if iToken is equal to or greater than the number of
** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken
are both zeroed.
**
** The output text is not a copy of the query text that specified the
** token. It is the output of the tokenizer module. For tokendata=1
** tables, this includes any embedded 0x00 and trailing data.
**
** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken)
** This is used to access token iToken of phrase hit iIdx within the
** current row. If iIdx is less than zero or greater than or equal to the
** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise,
** output variable (*ppToken) is set to point to a buffer containing the
** matching document token, and (*pnToken) to the size of that buffer in
** bytes. This API is not available if the specified token matches a
** prefix query term. In that case both output variables are always set
** to 0.
**
** The output text is not a copy of the document text that was tokenized.
** It is the output of the tokenizer module. For tokendata=1 tables, this
** includes any embedded 0x00 and trailing data.
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option.
*/
struct Fts5ExtensionApi {
int iVersion; /* Currently always set to 3 */
@@ -13139,13 +12789,6 @@ struct Fts5ExtensionApi {
int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
/* Below this point are iVersion>=3 only */
int (*xQueryToken)(Fts5Context*,
int iPhrase, int iToken,
const char **ppToken, int *pnToken
);
int (*xInstToken)(Fts5Context*, int iIdx, int iToken, const char**, int*);
};
/*
@@ -13340,8 +12983,8 @@ struct Fts5ExtensionApi {
** as separate queries of the FTS index are required for each synonym.
**
** When using methods (2) or (3), it is important that the tokenizer only
** provide synonyms when tokenizing document text (method (3)) or query
** text (method (2)), not both. Doing so will not cause any errors, but is
** provide synonyms when tokenizing document text (method (2)) or query
** text (method (3)), not both. Doing so will not cause any errors, but is
** inefficient.
*/
typedef struct Fts5Tokenizer Fts5Tokenizer;
@@ -13389,7 +13032,7 @@ struct fts5_api {
int (*xCreateTokenizer)(
fts5_api *pApi,
const char *zName,
void *pUserData,
void *pContext,
fts5_tokenizer *pTokenizer,
void (*xDestroy)(void*)
);
@@ -13398,7 +13041,7 @@ struct fts5_api {
int (*xFindTokenizer)(
fts5_api *pApi,
const char *zName,
void **ppUserData,
void **ppContext,
fts5_tokenizer *pTokenizer
);
@@ -13406,7 +13049,7 @@ struct fts5_api {
int (*xCreateFunction)(
fts5_api *pApi,
const char *zName,
void *pUserData,
void *pContext,
fts5_extension_function xFunction,
void (*xDestroy)(void*)
);
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 });
-3
View File
@@ -209,9 +209,6 @@ SplitView.prototype = {
this._nav.appendChild(aSummary);
aSummary.addEventListener("click", (aEvent) => {
if (aEvent.button != 0) {
return;
}
aEvent.stopPropagation();
this.activeSummary = aSummary;
}, false);
@@ -97,9 +97,6 @@ AutocompletePopup.prototype = {
},
onClick: function (e) {
if (e.button != 0) {
return;
}
let item = e.target.closest(".autocomplete-item");
if (item && typeof item.dataset.index !== "undefined") {
this.selectedIndex = parseInt(item.dataset.index, 10);
+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',
@@ -240,9 +240,6 @@ Spectrum.prototype = {
},
onElementClick: function (e) {
if (e.button != 0) {
return;
}
e.stopPropagation();
},
@@ -1480,9 +1480,6 @@ Column.prototype = {
* for sorting.
*/
onClick: function (event) {
if (event.button != 0) {
return;
}
let target = event.originalTarget;
if (target.nodeType !== target.ELEMENT_NODE || target == this.column) {
@@ -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
);
@@ -174,10 +174,7 @@ StyleEditorUI.prototype = {
this._view = new SplitView(viewRoot);
wire(this._view.rootElement, ".style-editor-newButton", (e) =>{
if (e.button != 0) {
return;
}
wire(this._view.rootElement, ".style-editor-newButton", () =>{
this._debuggee.addStyleSheet(null);
});
+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"
+30 -47
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();
}
}
}
@@ -340,7 +323,7 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
nsMargin rootMargin;
NS_FOR_CSS_SIDES(side) {
nscoord basis = side == eSideTop || side == eSideBottom ?
nscoord basis = side == NS_SIDE_TOP || side == NS_SIDE_BOTTOM ?
rootRect.height : rootRect.width;
nsCSSValue value = mRootMargin.*nsCSSRect::sides[side];
nsStyleCoord coord;
+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;
+7 -41
View File
@@ -118,23 +118,17 @@ ValidateAndFixupMatrixInit(DOMMatrixInit& aMatrixInit, ErrorResult& aRv)
}
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(const DOMMatrixInit& aMatrixInit)
DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit)
{
const bool is2D = aMatrixInit.mIs2D.Value();
MOZ_ASSERT(is2D == Is2D());
if (is2D) {
SetDataFromMatrix2DInit(aMatrixInit);
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();
} else {
mMatrix3D->_11 = aMatrixInit.mM11.Value();
mMatrix3D->_12 = aMatrixInit.mM12.Value();
@@ -155,34 +149,6 @@ DOMMatrixReadOnly::SetDataFromMatrixInit(const 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)
{
+1 -24
View File
@@ -26,7 +26,6 @@ class DOMPoint;
class StringOrUnrestrictedDoubleSequence;
struct DOMPointInit;
struct DOMMatrixInit;
struct DOMMatrix2DInit;
class DOMMatrixReadOnly : public nsWrapperCache
{
@@ -52,23 +51,12 @@ public:
mMatrix3D = new gfx::Matrix4x4(aMatrix);
}
DOMMatrixReadOnly(nsISupports* aParent, const gfx::Matrix& aMatrix)
: mParent(aParent) {
mMatrix2D = new gfx::Matrix(aMatrix);
}
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMMatrixReadOnly)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMMatrixReadOnly)
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);
@@ -219,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;
@@ -238,8 +220,7 @@ 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(const DOMMatrixInit& aMatrixInit);
void SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit);
DOMMatrixReadOnly* SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv);
void Ensure3DMatrix();
@@ -273,10 +254,6 @@ public:
: DOMMatrixReadOnly(aParent, aMatrix)
{}
DOMMatrix(nsISupports* aParent, const gfx::Matrix& aMatrix)
: DOMMatrixReadOnly(aParent, aMatrix)
{}
static already_AddRefed<DOMMatrix>
FromMatrix(nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
static already_AddRefed<DOMMatrix>
+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();
-38
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,22 +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;
}
/* static */
bool
Navigator::Webdriver()
{
// We don't support Selenium or marionette, so this is always false.
return false;
}
} // namespace dom
} // namespace mozilla
-14
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,11 +210,7 @@ public:
ErrorResult& aRv);
already_AddRefed<ServiceWorkerContainer> ServiceWorker();
dom::Clipboard* Clipboard();
static bool Webdriver();
void GetLanguages(nsTArray<nsString>& aLanguages);
StorageManager* Storage();
@@ -268,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
+11 -9
View File
@@ -32,14 +32,16 @@ PostMessageEvent::PostMessageEvent(nsGlobalWindow* aSource,
const nsAString& aCallerOrigin,
nsGlobalWindow* aTargetWindow,
nsIPrincipal* aProvidedPrincipal,
nsIDocument* aSourceDocument)
: StructuredCloneHolder(CloningSupported, TransferringSupported,
StructuredCloneScope::SameProcessSameThread)
, mSource(aSource)
, mCallerOrigin(aCallerOrigin)
, mTargetWindow(aTargetWindow)
, mProvidedPrincipal(aProvidedPrincipal)
, mSourceDocument(aSourceDocument)
nsIDocument* aSourceDocument,
bool aTrustedCaller)
: StructuredCloneHolder(CloningSupported, TransferringSupported,
StructuredCloneScope::SameProcessSameThread),
mSource(aSource),
mCallerOrigin(aCallerOrigin),
mTargetWindow(aTargetWindow),
mProvidedPrincipal(aProvidedPrincipal),
mSourceDocument(aSourceDocument),
mTrustedCaller(aTrustedCaller)
{
MOZ_COUNT_CTOR(PostMessageEvent);
}
@@ -167,7 +169,7 @@ PostMessageEvent::Run()
if (shell)
presContext = shell->GetPresContext();
event->SetTrusted(true);
event->SetTrusted(mTrustedCaller);
WidgetEvent* internalEvent = event->WidgetEventPtr();
nsEventStatus status = nsEventStatus_eIgnore;
+3 -1
View File
@@ -33,7 +33,8 @@ public:
const nsAString& aCallerOrigin,
nsGlobalWindow* aTargetWindow,
nsIPrincipal* aProvidedPrincipal,
nsIDocument* aSourceDocument);
nsIDocument* aSourceDocument,
bool aTrustedCaller);
private:
~PostMessageEvent();
@@ -43,6 +44,7 @@ private:
RefPtr<nsGlobalWindow> mTargetWindow;
nsCOMPtr<nsIPrincipal> mProvidedPrincipal;
nsCOMPtr<nsIDocument> mSourceDocument;
bool mTrustedCaller;
};
} // namespace dom
+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);
}
//-----------------------------------------------------------------------------
Loaded 100 of 3252 files, more files were not shown because too many files have changed in this diff. Show more