Merge latest green b2g-inbound changeset and mozilla-central

This commit is contained in:
Ed Morley 2013-08-22 12:04:16 +01:00
Родитель ad4db4419f b1b7669c2b
Коммит 21eacd0f93
981 изменённых файлов: 3282 добавлений и 3186 удалений

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

@ -18,6 +18,4 @@
# Modifying this file will now automatically clobber the buildbot machines \o/
#
In Bug 863306 comment #42 sheriff KWierso states that we should CLOBBER every time
that WebRTC code is changed, which will be awesome.
Bug 904831 - MSVC_ENABLE_PGO in js/src/Makefile.in

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

@ -33,7 +33,7 @@ include $(topsrcdir)/config/config.mk
GARBAGE_DIRS += dist _javagen _profile _tests staticlib
DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
config/autoconf.mk \
unallmakefiles mozilla-config.h \
mozilla-config.h \
netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
$(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
@ -107,8 +107,7 @@ include $(topsrcdir)/config/makefiles/tiers.mk
$(foreach tier,$(TIERS),$(eval $(call CREATE_TIER_RULE,$(tier))))
distclean::
cat unallmakefiles | $(XARGS) rm -f
$(RM) unallmakefiles $(DIST_GARBAGE)
$(RM) $(DIST_GARBAGE)
ifeq ($(OS_ARCH),WINNT)
# we want to copy PDB files on Windows

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

@ -10,8 +10,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXPORT_LIBRARY = ..
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
ifdef MOZ_ENABLE_GTK

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

@ -35,3 +35,5 @@ CPP_SOURCES += [
LIBRARY_NAME = 'accessibility_toolkit_s'
LIBXUL_LIBRARY = True

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

@ -9,8 +9,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES += \

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

@ -63,3 +63,5 @@ if a11y_log:
LIBRARY_NAME = 'accessibility_base_s'
LIBXUL_LIBRARY = True

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

@ -9,8 +9,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \

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

@ -29,3 +29,5 @@ CPP_SOURCES += [
LIBRARY_NAME = 'accessibility_generic_s'
LIBXUL_LIBRARY = True

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

@ -10,8 +10,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \

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

@ -19,3 +19,5 @@ CPP_SOURCES += [
LIBRARY_NAME = 'accessibility_html_s'
LIBXUL_LIBRARY = True

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

@ -10,9 +10,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXPORT_LIBRARY = ..
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES += \

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

@ -29,3 +29,6 @@ CMMSRCS += [
'mozHTMLAccessible.mm',
'mozTextAccessible.mm',
]
LIBXUL_LIBRARY = True

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

@ -10,8 +10,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXPORT_LIBRARY = ..
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES += \

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

@ -18,3 +18,5 @@ CPP_SOURCES += [
LIBRARY_NAME = 'accessibility_toolkit_s'
LIBXUL_LIBRARY = True

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

@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = accessibility_toolkit_ia2_s
EXPORT_LIBRARY = 1
LIBXUL_LIBRARY = 1
# The midl generated code include Windows headers which defines min and max
# macros which conflicts with std::min/max. Suppress the macros:

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

@ -30,3 +30,5 @@ CPP_SOURCES += [
'ia2AccessibleValue.cpp',
]
LIBXUL_LIBRARY = True

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

@ -11,8 +11,6 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = accessibility_toolkit_msaa_s
EXPORT_LIBRARY = 1
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

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

@ -41,3 +41,6 @@ if CONFIG['MOZ_XUL']:
'XULMenuAccessibleWrap.cpp',
'XULTreeGridAccessibleWrap.cpp',
]
LIBXUL_LIBRARY = True

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

@ -11,7 +11,7 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = accessibility_toolkit_sdn_s
EXPORT_LIBRARY = 1
LIBXUL_LIBRARY = 1
# The midl generated code include Windows headers which defines min and max
# macros which conflicts with std::min/max. Suppress the macros:
OS_CXXFLAGS += -DNOMINMAX

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

@ -11,3 +11,5 @@ CPP_SOURCES += [
'sdnTextAccessible.cpp',
]
LIBXUL_LIBRARY = True

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

@ -11,7 +11,7 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = accessibility_toolkit_uia_s
EXPORT_LIBRARY = ..
LIBXUL_LIBRARY = 1
# The midl generated code include Windows headers which defines min and max
# macros which conflicts with std::min/max. Suppress the macros:
OS_CXXFLAGS += -DNOMINMAX

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

@ -10,3 +10,5 @@ CPP_SOURCES += [
'uiaRawElmProvider.cpp',
]
LIBXUL_LIBRARY = True

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

@ -9,8 +9,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
EXTRA_MDDEPEND_FILES = xpcAccEvents.pp
include $(topsrcdir)/config/rules.mk

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

@ -19,3 +19,5 @@ CPP_SOURCES += [
LIBRARY_NAME = 'accessibility_xpcom_s'
LIBXUL_LIBRARY = True

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

@ -10,8 +10,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = \

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

@ -23,3 +23,5 @@ CPP_SOURCES += [
LIBRARY_NAME = 'accessibility_xul_s'
LIBXUL_LIBRARY = True

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

@ -1,16 +0,0 @@
# vim: noexpandtab ts=8 sw=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/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk

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

@ -7,3 +7,6 @@
MODULE = 'B2GComponents'
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
FAIL_ON_WARNINGS = True

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

@ -17,14 +17,6 @@ MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
MOZ_NONLOCALIZED_PKG_LIST = \
xpcom \
browser \
b2g \
$(NULL)
MOZ_LOCALIZED_PKG_LIST = $(AB_CD) multilocale
DEFINES += \
-DAB_CD=$(AB_CD) \
-DMOZ_APP_NAME=$(MOZ_APP_NAME) \

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

@ -7,8 +7,6 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
CHROMEDIR = $(call core_abspath,$(FINAL_TARGET))/chrome
include $(DEPTH)/config/autoconf.mk
ifdef MOZ_METRO

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

@ -21,13 +21,6 @@ ifndef SYSTEM_LIBXUL
MOZ_PKG_FATAL_WARNINGS = 1
endif
MOZ_NONLOCALIZED_PKG_LIST = \
xpcom \
browser \
$(NULL)
MOZ_LOCALIZED_PKG_LIST = $(AB_CD)
DEFINES += -DAB_CD=$(AB_CD) -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
ifdef LIBXUL_SDK

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

@ -2,7 +2,7 @@
# 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/.
DEPTH = ../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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

@ -2,7 +2,7 @@
# 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/.
DEPTH = ../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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

@ -2,7 +2,7 @@
# 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/.
DEPTH = ../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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

@ -2,7 +2,7 @@
# 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/.
DEPTH = ../../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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

@ -2,7 +2,7 @@
# 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/.
DEPTH = ../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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

@ -2,7 +2,7 @@
# 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/.
DEPTH = ../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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

@ -2,7 +2,7 @@
# 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/.
DEPTH = ../../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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

@ -2,7 +2,7 @@
# 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/.
DEPTH = ../../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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

@ -2,7 +2,7 @@
# 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/.
DEPTH = ../../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

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

@ -24,11 +24,6 @@ HOST_CPPSRCS = \
OS_CXXFLAGS := $(filter-out -fno-exceptions,$(OS_CXXFLAGS)) -fexceptions
CSRCS := \
test-ctors.c \
test-array.c \
$(NULL)
ifndef CROSS_COMPILE
CSRCS += dummy.c
endif

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

@ -6,3 +6,9 @@
NO_DIST_INSTALL = True
DIRS += ['inject']
CSRCS += [
'test-array.c',
'test-ctors.c',
]

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

@ -10,10 +10,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
INCLUDES += -I$(srcdir)/../include \

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

@ -18,3 +18,7 @@ CPP_SOURCES += [
LIBRARY_NAME = 'caps_s'
LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True

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

@ -11,9 +11,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = chrome_s
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

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

@ -17,3 +17,7 @@ CPP_SOURCES += [
'nsChromeRegistryContent.cpp',
]
LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True

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

@ -24,9 +24,12 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
GTEST_CSRCS \
HOST_CSRCS \
HOST_LIBRARY_NAME \
LIBXUL_LIBRARY \
MODULE \
MSVC_ENABLE_PGO \
NO_DIST_INSTALL \
PARALLEL_DIRS \
SIMPLE_PROGRAMS \
TEST_DIRS \
TIERS \
TOOL_DIRS \
@ -398,7 +401,6 @@ ALL_TRASH_DIRS = \
ifdef QTDIR
GARBAGE += $(MOCSRCS)
GARBAGE += $(RCCSRCS)
endif
ifdef SIMPLE_PROGRAMS

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

@ -0,0 +1,14 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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/. */
#ifndef HTMLSplitOnSpacesTokenizer_h
#define HTMLSplitOnSpacesTokenizer_h
#include "nsCharSeparatedTokenizer.h"
typedef nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace>
HTMLSplitOnSpacesTokenizer;
#endif

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

@ -34,11 +34,13 @@ XPIDL_MODULE = 'content_base'
MODULE = 'content'
EXPORTS += [
'HTMLSplitOnSpacesTokenizer.h',
'mozFlushType.h',
'nsCaseTreatment.h',
'nsContentCID.h',
'nsContentCreatorFunctions.h',
'nsContentPolicyUtils.h',
'nsContentTypeParser.h',
'nsContentUtils.h',
'nsCopySupport.h',
'nsDOMFile.h',

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

@ -0,0 +1,30 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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/. */
#ifndef nsContentTypeParser_h
#define nsContentTypeParser_h
#include "nsAString.h"
class nsIMIMEHeaderParam;
class nsContentTypeParser {
public:
nsContentTypeParser(const nsAString& aString);
~nsContentTypeParser();
nsresult GetParameter(const char* aParameterName, nsAString& aResult);
nsresult GetType(nsAString& aResult)
{
return GetParameter(nullptr, aResult);
}
private:
NS_ConvertUTF16toUTF8 mString;
nsIMIMEHeaderParam* mService;
};
#endif

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

@ -22,11 +22,8 @@
#include "mozilla/Assertions.h"
#include "mozilla/GuardObjects.h"
#include "mozilla/TimeStamp.h"
#include "nsAString.h"
#include "nsCharSeparatedTokenizer.h"
#include "nsContentListDeclarations.h"
#include "nsMathUtils.h"
#include "nsReadableUtils.h"
class imgICache;
class imgIContainer;
@ -66,7 +63,6 @@ class nsIInterfaceRequestor;
class nsIIOService;
class nsIJSRuntimeService;
class nsILineBreaker;
class nsIMIMEHeaderParam;
class nsINameSpaceManager;
class nsINodeInfo;
class nsIObserver;
@ -106,6 +102,7 @@ template<class E> class nsCOMArray;
template<class E> class nsTArray;
template<class K, class V> class nsDataHashtable;
template<class K, class V> class nsRefPtrHashtable;
template<class T> class nsReadingIterator;
namespace JS {
class Value;
@ -143,6 +140,11 @@ class nsIBidiKeyboard;
extern const char kLoadAsData[];
// Stolen from nsReadableUtils, but that's OK, since we can declare the same
// name multiple times.
const nsAFlatString& EmptyString();
const nsAFlatCString& EmptyCString();
enum EventNameType {
EventNameType_None = 0x0000,
EventNameType_HTML = 0x0001,
@ -811,26 +813,6 @@ public:
= EmptyString(),
uint32_t aLineNumber = 0,
uint32_t aColumnNumber = 0);
// This overload allows passing a literal string for aCategory.
template<uint32_t N>
static nsresult ReportToConsole(uint32_t aErrorFlags,
const char (&aCategory)[N],
nsIDocument* aDocument,
PropertiesFile aFile,
const char *aMessageName,
const PRUnichar **aParams = nullptr,
uint32_t aParamsLength = 0,
nsIURI* aURI = nullptr,
const nsAFlatString& aSourceLine
= EmptyString(),
uint32_t aLineNumber = 0,
uint32_t aColumnNumber = 0)
{
nsDependentCString category(aCategory, N - 1);
return ReportToConsole(aErrorFlags, category, aDocument, aFile,
aMessageName, aParams, aParamsLength, aURI,
aSourceLine, aLineNumber, aColumnNumber);
}
/**
* Get the localized string named |aKey| in properties file |aFile|.
@ -1241,11 +1223,7 @@ public:
* @param aResult the result. Out param.
*/
static void GetNodeTextContent(nsINode* aNode, bool aDeep,
nsAString& aResult)
{
aResult.Truncate();
AppendNodeTextContent(aNode, aDeep, aResult);
}
nsAString& aResult);
/**
* Same as GetNodeTextContents but appends the result rather than sets it.
@ -1264,13 +1242,7 @@ public:
/**
* Delete strings allocated for nsContentList matches
*/
static void DestroyMatchString(void* aData)
{
if (aData) {
nsString* matchString = static_cast<nsString*>(aData);
delete matchString;
}
}
static void DestroyMatchString(void* aData);
/**
* Unbinds the content from the tree and nulls it out if it's not null.
@ -1340,7 +1312,7 @@ public:
bool aAllowData,
uint32_t aContentPolicyType,
nsISupports* aContext,
const nsACString& aMimeGuess = EmptyCString(),
const nsAFlatCString& aMimeGuess = EmptyCString(),
nsISupports* aExtra = nullptr);
/**
@ -2052,37 +2024,7 @@ public:
*/
static JSVersion ParseJavascriptVersion(const nsAString& aVersionStr);
static bool IsJavascriptMIMEType(const nsAString& aMIMEType)
{
// Table ordered from most to least likely JS MIME types.
static const char* jsTypes[] = {
"text/javascript",
"text/ecmascript",
"application/javascript",
"application/ecmascript",
"application/x-javascript",
"application/x-ecmascript",
"text/javascript1.0",
"text/javascript1.1",
"text/javascript1.2",
"text/javascript1.3",
"text/javascript1.4",
"text/javascript1.5",
"text/jscript",
"text/livescript",
"text/x-ecmascript",
"text/x-javascript",
nullptr
};
for (uint32_t i = 0; jsTypes[i]; ++i) {
if (aMIMEType.LowerCaseEqualsASCII(jsTypes[i])) {
return true;
}
}
return false;
}
static bool IsJavascriptMIMEType(const nsAString& aMIMEType);
static void SplitMimeType(const nsAString& aValue, nsString& aType,
nsString& aParams);
@ -2182,8 +2124,6 @@ private:
static void* AllocClassMatchingInfo(nsINode* aRootNode,
const nsString* aClasses);
static nsIDOMScriptObjectFactory *sDOMScriptObjectFactory;
static nsIXPConnect *sXPConnect;
static nsIScriptSecurityManager *sSecurityManager;
@ -2265,9 +2205,6 @@ private:
#endif
};
typedef nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace>
HTMLSplitOnSpacesTokenizer;
#define NS_HOLD_JS_OBJECTS(obj, clazz) \
nsContentUtils::HoldJSObjects(NS_CYCLE_COLLECTION_UPCAST(obj, clazz), \
NS_CYCLE_COLLECTION_PARTICIPANT(clazz))
@ -2369,20 +2306,4 @@ public:
} \
}
class nsContentTypeParser {
public:
nsContentTypeParser(const nsAString& aString);
~nsContentTypeParser();
nsresult GetParameter(const char* aParameterName, nsAString& aResult);
nsresult GetType(nsAString& aResult)
{
return GetParameter(nullptr, aResult);
}
private:
NS_ConvertUTF16toUTF8 mString;
nsIMIMEHeaderParam* mService;
};
#endif /* nsContentUtils_h___ */

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

@ -1,6 +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/. */
// IWYU pragma: private, include "nsIDocument.h"
/*
* This file contains the list of deprecated DOM operations. It is

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

@ -50,6 +50,7 @@ class nsIDOMDocument;
class nsIDOMDocumentFragment;
class nsIDOMDocumentType;
class nsIDOMElement;
class nsIDOMNodeFilter;
class nsIDOMNodeList;
class nsIDOMXPathExpression;
class nsIDOMXPathNSResolver;

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

@ -8,6 +8,7 @@
#include "nsContentCreatorFunctions.h"
#include "nsContentUtils.h"
#include "nsDOMClassInfoID.h"
#include "nsIDOMDocument.h"
#include "DocumentType.h"
#include "nsTextNode.h"

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

@ -1133,7 +1133,7 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
// The element being removed is an ancestor of the full-screen element,
// exit full-screen state.
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"DOM", OwnerDoc(),
NS_LITERAL_CSTRING("DOM"), OwnerDoc(),
nsContentUtils::eDOM_PROPERTIES,
"RemovedFullScreenElement");
// Fully exit full-screen.
@ -2432,7 +2432,7 @@ Element::MozRequestFullScreen()
const char* error = GetFullScreenError(OwnerDoc());
if (error) {
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"DOM", OwnerDoc(),
NS_LITERAL_CSTRING("DOM"), OwnerDoc(),
nsContentUtils::eDOM_PROPERTIES,
error);
nsRefPtr<nsAsyncDOMEvent> e =

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

@ -11,18 +11,12 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = gkconbase_s
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
ifdef MOZ_WEBRTC
LOCAL_INCLUDES += \
-I$(topsrcdir)/netwerk/sctp/datachannel \
$(NULL)
endif
GQI_SRCS = contentbase.gqi
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

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

@ -169,3 +169,10 @@ EXTRA_PP_COMPONENTS += [
EXTRA_JS_MODULES += [
'CSPUtils.jsm',
]
FAIL_ON_WARNINGS = True
LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True

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

@ -63,7 +63,7 @@ public:
nsCheapString(nsStringBuffer* aBuf)
{
if (aBuf)
aBuf->ToString(aBuf->StorageSize()/2 - 1, *this);
aBuf->ToString(aBuf->StorageSize()/sizeof(PRUnichar) - 1, *this);
}
};

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

@ -299,7 +299,7 @@ CSPService::AsyncOnChannelRedirect(nsIChannel *oldChannel,
const PRUnichar *formatParams[] = { NS_ConvertUTF8toUTF16(newUriSpec).get() };
if (NS_SUCCEEDED(rv)) {
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"Redirect Error", nullptr,
NS_LITERAL_CSTRING("Redirect Error"), nullptr,
nsContentUtils::eDOM_PROPERTIES,
"InvalidRedirectChannelWarning",
formatParams, 1);

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

@ -8,7 +8,7 @@
#include <stdint.h>
#include "nsCOMPtr.h"
#include "nsStringGlue.h"
#include "nsStringFwd.h"
class nsContentList;
class nsIAtom;

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

@ -168,6 +168,8 @@
#include "nsWrapperCacheInlines.h"
#include "nsXULPopupManager.h"
#include "xpcprivate.h" // nsXPConnect
#include "HTMLSplitOnSpacesTokenizer.h"
#include "nsContentTypeParser.h"
#ifdef IBMBIDI
#include "nsIBidiKeyboard.h"
@ -187,7 +189,6 @@ using namespace mozilla;
const char kLoadAsData[] = "loadAsData";
nsIDOMScriptObjectFactory *nsContentUtils::sDOMScriptObjectFactory = nullptr;
nsIXPConnect *nsContentUtils::sXPConnect;
nsIScriptSecurityManager *nsContentUtils::sSecurityManager;
nsIParserService *nsContentUtils::sParserService = nullptr;
@ -1451,7 +1452,6 @@ nsContentUtils::Shutdown()
NS_IF_RELEASE(sStringBundleService);
NS_IF_RELEASE(sConsoleService);
NS_IF_RELEASE(sDOMScriptObjectFactory);
sXPConnect = nullptr;
NS_IF_RELEASE(sSecurityManager);
NS_IF_RELEASE(sNameSpaceManager);
@ -4352,7 +4352,7 @@ nsContentUtils::CheckSecurityBeforeLoad(nsIURI* aURIToLoad,
bool aAllowData,
uint32_t aContentPolicyType,
nsISupports* aContext,
const nsACString& aMimeGuess,
const nsAFlatCString& aMimeGuess,
nsISupports* aExtra)
{
NS_PRECONDITION(aLoadingPrincipal, "Must have a loading principal here");
@ -6492,3 +6492,52 @@ nsContentUtils::DOMWindowDumpEnabled()
return true;
#endif
}
void
nsContentUtils::GetNodeTextContent(nsINode* aNode, bool aDeep, nsAString& aResult)
{
aResult.Truncate();
AppendNodeTextContent(aNode, aDeep, aResult);
}
void
nsContentUtils::DestroyMatchString(void* aData)
{
if (aData) {
nsString* matchString = static_cast<nsString*>(aData);
delete matchString;
}
}
bool
nsContentUtils::IsJavascriptMIMEType(const nsAString& aMIMEType)
{
// Table ordered from most to least likely JS MIME types.
static const char* jsTypes[] = {
"text/javascript",
"text/ecmascript",
"application/javascript",
"application/ecmascript",
"application/x-javascript",
"application/x-ecmascript",
"text/javascript1.0",
"text/javascript1.1",
"text/javascript1.2",
"text/javascript1.3",
"text/javascript1.4",
"text/javascript1.5",
"text/jscript",
"text/livescript",
"text/x-ecmascript",
"text/x-javascript",
nullptr
};
for (uint32_t i = 0; jsTypes[i]; ++i) {
if (aMIMEType.LowerCaseEqualsASCII(jsTypes[i])) {
return true;
}
}
return false;
}

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

@ -4,6 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMParser.h"
#include "nsIDOMDocument.h"
#include "nsNetUtil.h"
#include "nsStringStream.h"
#include "nsIScriptSecurityManager.h"

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

@ -7,6 +7,7 @@
#include "nsIDocument.h"
#include "nsIDocumentEncoder.h"
#include "nsIDOMDocument.h"
#include "nsComponentManagerUtils.h"
#include "nsContentCID.h"
#include "nsContentUtils.h"

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

@ -8,6 +8,8 @@
* Base class for all our document implementations.
*/
#include "nsDocument.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Util.h"
@ -25,7 +27,6 @@
#include "mozilla/Telemetry.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsDocument.h"
#include "nsUnicharUtils.h"
#include "nsContentList.h"
#include "nsIObserver.h"
@ -208,8 +209,10 @@
#include "nsIEditor.h"
#include "nsIDOMCSSStyleRule.h"
#include "mozilla/css/Rule.h"
#include "nsIDOMLocation.h"
#include "nsIHttpChannelInternal.h"
#include "nsISecurityConsoleMessage.h"
#include "nsCharSeparatedTokenizer.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -2463,7 +2466,7 @@ CSPErrorQueue::Flush(nsIDocument* aDocument)
{
for (uint32_t i = 0; i < mErrors.Length(); i++) {
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"CSP", aDocument,
NS_LITERAL_CSTRING("CSP"), aDocument,
nsContentUtils::eSECURITY_PROPERTIES,
mErrors[i]);
}
@ -4496,7 +4499,7 @@ void
nsDocument::ReportEmptyGetElementByIdArg()
{
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"DOM", this,
NS_LITERAL_CSTRING("DOM"), this,
nsContentUtils::eDOM_PROPERTIES,
"EmptyGetElementByIdParam");
}
@ -6151,7 +6154,7 @@ nsDocument::GetBoxObjectFor(Element* aElement, ErrorResult& aRv)
if (!mHasWarnedAboutBoxObjects && !aElement->IsXUL()) {
mHasWarnedAboutBoxObjects = true;
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"BoxObjects", this,
NS_LITERAL_CSTRING("BoxObjects"), this,
nsContentUtils::eDOM_PROPERTIES,
"UseOfGetBoxObjectForWarning");
}
@ -9048,7 +9051,7 @@ nsIDocument::WarnOnceAbout(DeprecatedOperations aOperation,
uint32_t flags = asError ? nsIScriptError::errorFlag
: nsIScriptError::warningFlag;
nsContentUtils::ReportToConsole(flags,
"DOM Core", this,
NS_LITERAL_CSTRING("DOM Core"), this,
nsContentUtils::eDOM_PROPERTIES,
kWarnings[aOperation]);
}
@ -10032,7 +10035,7 @@ LogFullScreenDenied(bool aLogFailure, const char* aMessage, nsIDocument* aDoc)
false);
e->PostDOMEvent();
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"DOM", aDoc,
NS_LITERAL_CSTRING("DOM"), aDoc,
nsContentUtils::eDOM_PROPERTIES,
aMessage);
}

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

@ -10,10 +10,11 @@
#ifndef nsDocument_h___
#define nsDocument_h___
#include "nsIDocument.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsCRT.h"
#include "nsIDocument.h"
#include "nsWeakReference.h"
#include "nsWeakPtr.h"
#include "nsVoidArray.h"

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

@ -2,7 +2,6 @@
/* 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/. */
// IWYU pragma: private, include "nsGkAtoms.h"
/*

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

@ -158,7 +158,7 @@ LogBlockingMixedContent(MixedContentTypes classification,
const PRUnichar* strings[] = { locationSpecUTF16.get() };
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
"Mixed Content Blocker",
NS_LITERAL_CSTRING("Mixed Content Blocker"),
aRootDoc,
nsContentUtils::eSECURITY_PROPERTIES,
classification == eMixedDisplay ? "BlockMixedDisplayContent" : "BlockMixedActiveContent",

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

@ -1263,7 +1263,7 @@ nsObjectLoadingContent::CheckJavaCodebase()
// the exception of URIs that represent local files
if (NS_URIIsLocalFile(mBaseURI) &&
nsScriptSecurityManager::GetStrictFileOriginPolicy() &&
!NS_RelaxStrictFileOriginPolicy(mBaseURI, principalBaseURI)) {
!NS_RelaxStrictFileOriginPolicy(mBaseURI, principalBaseURI, true)) {
LOG(("OBJLC [%p]: Java failed RelaxStrictFileOriginPolicy for file URI",
this));
return false;

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

@ -1,63 +1,63 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
/*
* Constant flags that describe how a document is sandboxed according to the
* HTML5 spec.
*/
#ifndef nsSandboxFlags_h___
#define nsSandboxFlags_h___
/**
* This flag prevents content from navigating browsing contexts other than
* the sandboxed browsing context itself (or browsing contexts further
* nested inside it), and the top-level browsing context.
*/
const unsigned long SANDBOXED_NAVIGATION = 0x1;
/**
* This flag prevents content from navigating their top-level browsing
* context.
*/
const unsigned long SANDBOXED_TOPLEVEL_NAVIGATION = 0x2;
/**
* This flag prevents content from instantiating plugins, whether using the
* embed element, the object element, the applet element, or through
* navigation of a nested browsing context, unless those plugins can be
* secured.
*/
const unsigned long SANDBOXED_PLUGINS = 0x4;
/**
* This flag forces content into a unique origin, thus preventing it from
* accessing other content from the same origin.
* This flag also prevents script from reading from or writing to the
* document.cookie IDL attribute, and blocks access to localStorage.
*/
const unsigned long SANDBOXED_ORIGIN = 0x8;
/**
* This flag blocks form submission.
*/
const unsigned long SANDBOXED_FORMS = 0x10;
/**
* This flag blocks script execution.
*/
const unsigned long SANDBOXED_SCRIPTS = 0x20;
/**
* This flag blocks features that trigger automatically, such as
* automatically playing a video or automatically focusing a form control.
*/
const unsigned long SANDBOXED_AUTOMATIC_FEATURES = 0x40;
/**
* This flag blocks the document from acquiring pointerlock.
*/
const unsigned long SANDBOXED_POINTER_LOCK = 0x80;
#endif
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
/*
* Constant flags that describe how a document is sandboxed according to the
* HTML5 spec.
*/
#ifndef nsSandboxFlags_h___
#define nsSandboxFlags_h___
/**
* This flag prevents content from navigating browsing contexts other than
* the sandboxed browsing context itself (or browsing contexts further
* nested inside it), and the top-level browsing context.
*/
const unsigned long SANDBOXED_NAVIGATION = 0x1;
/**
* This flag prevents content from navigating their top-level browsing
* context.
*/
const unsigned long SANDBOXED_TOPLEVEL_NAVIGATION = 0x2;
/**
* This flag prevents content from instantiating plugins, whether using the
* embed element, the object element, the applet element, or through
* navigation of a nested browsing context, unless those plugins can be
* secured.
*/
const unsigned long SANDBOXED_PLUGINS = 0x4;
/**
* This flag forces content into a unique origin, thus preventing it from
* accessing other content from the same origin.
* This flag also prevents script from reading from or writing to the
* document.cookie IDL attribute, and blocks access to localStorage.
*/
const unsigned long SANDBOXED_ORIGIN = 0x8;
/**
* This flag blocks form submission.
*/
const unsigned long SANDBOXED_FORMS = 0x10;
/**
* This flag blocks script execution.
*/
const unsigned long SANDBOXED_SCRIPTS = 0x20;
/**
* This flag blocks features that trigger automatically, such as
* automatically playing a video or automatically focusing a form control.
*/
const unsigned long SANDBOXED_AUTOMATIC_FEATURES = 0x40;
/**
* This flag blocks the document from acquiring pointerlock.
*/
const unsigned long SANDBOXED_POINTER_LOCK = 0x80;
#endif

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

@ -45,6 +45,7 @@
#include "mozilla/dom/Element.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsSandboxFlags.h"
#include "nsContentTypeParser.h"
#include "mozilla/CORSMode.h"
#include "mozilla/Attributes.h"

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

@ -4,16 +4,19 @@
* 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 "nsXMLHttpRequest.h"
#include "mozilla/dom/XMLHttpRequestUploadBinding.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Util.h"
#include "nsXMLHttpRequest.h"
#include "nsISimpleEnumerator.h"
#include "nsIXPConnect.h"
#include "nsDOMBlobBuilder.h"
#include "nsICharsetConverterManager.h"
#include "nsIDOMDocument.h"
#include "nsIDOMProgressEvent.h"
#include "nsIJARChannel.h"
#include "nsLayoutCID.h"
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#include "nsIURI.h"
#include "nsILoadGroup.h"
#include "nsNetUtil.h"
@ -23,31 +26,18 @@
#include "nsIUploadChannel2.h"
#include "nsIDOMSerializer.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsGUIEvent.h"
#include "prprf.h"
#include "nsIDOMEventListener.h"
#include "nsIScriptSecurityManager.h"
#include "nsWeakPtr.h"
#include "nsIScriptGlobalObject.h"
#include "nsDOMClassInfoID.h"
#include "nsIDOMElement.h"
#include "nsIDOMWindow.h"
#include "nsIMIMEService.h"
#include "nsCExternalHandlerService.h"
#include "nsIVariant.h"
#include "nsVariant.h"
#include "nsIScriptError.h"
#include "xpcpublic.h"
#include "nsStringStream.h"
#include "nsIStreamConverterService.h"
#include "nsICachingChannel.h"
#include "nsContentUtils.h"
#include "nsCxPusher.h"
#include "nsEventDispatcher.h"
#include "nsDOMJSUtils.h"
#include "nsCOMArray.h"
#include "nsIScriptableUConv.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIContentPolicy.h"
#include "nsContentPolicyUtils.h"
@ -55,11 +45,9 @@
#include "nsLayoutStatics.h"
#include "nsCrossSiteListenerProxy.h"
#include "nsIHTMLDocument.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIStorageStream.h"
#include "nsIPromptFactory.h"
#include "nsIWindowWatcher.h"
#include "nsCharSeparatedTokenizer.h"
#include "nsIConsoleService.h"
#include "nsIChannelPolicy.h"
#include "nsChannelPolicy.h"
@ -73,12 +61,11 @@
#include "GeckoProfiler.h"
#include "mozilla/dom/EncodingUtils.h"
#include "mozilla/dom/XMLHttpRequestBinding.h"
#include "nsIDOMFormData.h"
#include "DictionaryHelpers.h"
#include "mozilla/Attributes.h"
#include "nsIPermissionManager.h"
#include "nsMimeTypes.h"
#include "nsIHttpChannelInternal.h"
#include "nsCharSeparatedTokenizer.h"
#include "nsFormData.h"
#include "nsStreamListenerWrapper.h"
@ -284,6 +271,12 @@ NS_INTERFACE_MAP_END_INHERITING(nsXHREventTarget)
NS_IMPL_ADDREF_INHERITED(nsXMLHttpRequestUpload, nsXHREventTarget)
NS_IMPL_RELEASE_INHERITED(nsXMLHttpRequestUpload, nsXHREventTarget)
/* virtual */ JSObject*
nsXMLHttpRequestUpload::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
return XMLHttpRequestUploadBinding::Wrap(aCx, aScope, this);
}
/////////////////////////////////////////////
//
//
@ -583,7 +576,7 @@ static void LogMessage(const char* aWarning, nsPIDOMWindow* aWindow)
doc = aWindow->GetExtantDoc();
}
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"DOM", doc,
NS_LITERAL_CSTRING("DOM"), doc,
nsContentUtils::eDOM_PROPERTIES,
aWarning);
}

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

@ -13,36 +13,26 @@
#include "nsString.h"
#include "nsIURI.h"
#include "nsIHttpChannel.h"
#include "nsIJARChannel.h"
#include "nsIDocument.h"
#include "nsIStreamListener.h"
#include "nsWeakReference.h"
#include "jsapi.h"
#include "nsIScriptContext.h"
#include "nsIChannelEventSink.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsIInterfaceRequestor.h"
#include "nsIHttpHeaderVisitor.h"
#include "nsIProgressEventSink.h"
#include "nsCOMArray.h"
#include "nsJSUtils.h"
#include "nsTArray.h"
#include "nsITimer.h"
#include "nsIDOMProgressEvent.h"
#include "nsDOMEventTargetHelper.h"
#include "nsDOMFile.h"
#include "nsDOMBlobBuilder.h"
#include "nsIPrincipal.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsISizeOfEventTarget.h"
#include "mozilla/Assertions.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/TypedArray.h"
#include "mozilla/dom/XMLHttpRequestBinding.h"
#include "mozilla/dom/XMLHttpRequestUploadBinding.h"
#include "mozilla/dom/EventHandlerBinding.h"
#ifdef Status
/* Xlib headers insist on this for some reason... Nuke it because
@ -50,10 +40,13 @@
#undef Status
#endif
class nsILoadGroup;
class AsyncVerifyRedirectCallbackForwarder;
class nsIUnicodeDecoder;
class BlobSet;
class nsDOMFile;
class nsFormData;
class nsIJARChannel;
class nsILoadGroup;
class nsIUnicodeDecoder;
class nsXHREventTarget : public nsDOMEventTargetHelper,
public nsIXMLHttpRequestEventTarget
@ -82,25 +75,22 @@ public:
virtual void DisconnectFromOwner();
};
class nsXMLHttpRequestUpload : public nsXHREventTarget,
public nsIXMLHttpRequestUpload
class nsXMLHttpRequestUpload MOZ_FINAL : public nsXHREventTarget,
public nsIXMLHttpRequestUpload
{
public:
nsXMLHttpRequestUpload(nsDOMEventTargetHelper* aOwner)
{
BindToOwner(aOwner);
SetIsDOMBinding();
}
}
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIXMLHTTPREQUESTEVENTTARGET(nsXHREventTarget::)
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsXHREventTarget)
NS_DECL_NSIXMLHTTPREQUESTUPLOAD
virtual JSObject* WrapObject(JSContext *cx,
JS::Handle<JSObject*> scope) MOZ_OVERRIDE
{
return mozilla::dom::XMLHttpRequestUploadBinding::Wrap(cx, scope, this);
}
JS::Handle<JSObject*> scope) MOZ_OVERRIDE;
nsISupports* GetParentObject()
{
return GetOwner();

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

@ -7,8 +7,6 @@ topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk
LOCAL_INCLUDES := \

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

@ -8,3 +8,5 @@ CPP_UNIT_TESTS += [
'TestWebGLElementArrayCache.cpp',
]
FAIL_ON_WARNINGS = True

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

@ -11,10 +11,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = gkconcvs_s
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
ifdef MOZ_WEBGL
LOCAL_INCLUDES += \
-I$(topsrcdir)/js/xpconnect/wrappers \

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

@ -1596,17 +1596,19 @@ WebGLContext::GetSupportedExtensions(JSContext *cx, Nullable< nsTArray<nsString>
NS_IMPL_CYCLE_COLLECTING_ADDREF(WebGLContext)
NS_IMPL_CYCLE_COLLECTING_RELEASE(WebGLContext)
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_10(WebGLContext,
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_12(WebGLContext,
mCanvasElement,
mExtensions,
mBound2DTextures,
mBoundCubeMapTextures,
mBoundArrayBuffer,
mBoundTransformFeedbackBuffer,
mCurrentProgram,
mBoundFramebuffer,
mBoundRenderbuffer,
mBoundVertexArray,
mActiveOcclusionQuery)
mActiveOcclusionQuery,
mActiveTransformFeedbackQuery)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WebGLContext)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY

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

@ -13,18 +13,11 @@
#include <stdarg.h>
#include "nsTArray.h"
#include "nsDataHashtable.h"
#include "nsHashKeys.h"
#include "nsCycleCollectionNoteChild.h"
#include "nsIDocShell.h"
#include "nsIDOMWebGLRenderingContext.h"
#include "nsICanvasRenderingContextInternal.h"
#include "mozilla/dom/HTMLCanvasElement.h"
#include "nsIDOMHTMLElement.h"
#include "nsIMemoryReporter.h"
#include "nsIJSNativeInitializer.h"
#include "nsWrapperCache.h"
#include "nsIObserver.h"
@ -39,9 +32,9 @@
#endif
#include "mozilla/dom/TypedArray.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingUtils.h"
class nsIDocShell;
/*
* Minimum value constants defined in 6.2 State Tables of OpenGL ES - 2.0.25
@ -82,6 +75,7 @@ class WebGLVertexArray;
namespace dom {
struct WebGLContextAttributes;
struct WebGLContextAttributesInitializer;
template<typename> class Nullable;
}
using WebGLTexelConversions::WebGLTexelFormat;
@ -737,7 +731,10 @@ public:
JS::Value GetQueryObject(JSContext* cx, WebGLQuery *query, WebGLenum pname);
private:
bool ValidateTargetParameter(WebGLenum target, const char* infos);
WebGLRefPtr<WebGLQuery> mActiveOcclusionQuery;
WebGLRefPtr<WebGLQuery> mActiveTransformFeedbackQuery;
bool ValidateQueryTargetParameter(WebGLenum target, const char* infos);
WebGLRefPtr<WebGLQuery>& GetActiveQueryByTarget(WebGLenum target);
// -----------------------------------------------------------------------------
@ -1137,7 +1134,6 @@ protected:
WebGLRefPtr<WebGLFramebuffer> mBoundFramebuffer;
WebGLRefPtr<WebGLRenderbuffer> mBoundRenderbuffer;
WebGLRefPtr<WebGLVertexArray> mBoundVertexArray;
WebGLRefPtr<WebGLQuery> mActiveOcclusionQuery;
LinkedList<WebGLTexture> mTextures;
LinkedList<WebGLBuffer> mBuffers;

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

@ -9,7 +9,7 @@
using namespace mozilla;
/*
* We fake ANY_SAMPLES_PASSED and ANY_SAMPLES_PASSED_CONSERVATIVE with
* We fake ANY_SAMPLES_PASSED and ANY_SAMPLES_PASSED_CONSERVATIVE with
* SAMPLES_PASSED on desktop.
*
* OpenGL ES 3.0 spec 4.1.6
@ -27,6 +27,8 @@ GetQueryTargetEnumString(WebGLenum target)
return "ANY_SAMPLES_PASSED";
case LOCAL_GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
return "ANY_SAMPLES_PASSED_CONSERVATIVE";
case LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
return "TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN";
default:
break;
}
@ -111,7 +113,7 @@ WebGLContext::BeginQuery(WebGLenum target, WebGLQuery *query)
if (!IsContextStable())
return;
if (!ValidateTargetParameter(target, "beginQuery")) {
if (!ValidateQueryTargetParameter(target, "beginQuery")) {
return;
}
@ -165,7 +167,11 @@ WebGLContext::BeginQuery(WebGLenum target, WebGLQuery *query)
MakeContextCurrent();
gl->fBeginQuery(SimulateOcclusionQueryTarget(gl, target), query->mGLName);
if (target == LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN) {
gl->fBeginQuery(LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, query->mGLName);
} else {
gl->fBeginQuery(SimulateOcclusionQueryTarget(gl, target), query->mGLName);
}
GetActiveQueryByTarget(target) = query;
}
@ -176,7 +182,7 @@ WebGLContext::EndQuery(WebGLenum target)
if (!IsContextStable())
return;
if (!ValidateTargetParameter(target, "endQuery")) {
if (!ValidateQueryTargetParameter(target, "endQuery")) {
return;
}
@ -202,7 +208,11 @@ WebGLContext::EndQuery(WebGLenum target)
MakeContextCurrent();
gl->fEndQuery(SimulateOcclusionQueryTarget(gl, target));
if (target == LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN) {
gl->fEndQuery(LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
} else {
gl->fEndQuery(SimulateOcclusionQueryTarget(gl, target));
}
GetActiveQueryByTarget(target) = nullptr;
}
@ -227,7 +237,7 @@ WebGLContext::GetQuery(WebGLenum target, WebGLenum pname)
if (!IsContextStable())
return nullptr;
if (!ValidateTargetParameter(target, "getQuery")) {
if (!ValidateQueryTargetParameter(target, "getQuery")) {
return nullptr;
}
@ -299,6 +309,10 @@ WebGLContext::GetQueryObject(JSContext* cx, WebGLQuery *query, WebGLenum pname)
MakeContextCurrent();
gl->fGetQueryObjectuiv(query->mGLName, LOCAL_GL_QUERY_RESULT, &returned);
if (query->mType == LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN) {
return JS::NumberValue(uint32_t(returned));
}
/*
* test (returned != 0) is important because ARB_occlusion_query on desktop drivers
* return the number of samples drawed when the OpenGL ES extension
@ -316,23 +330,34 @@ WebGLContext::GetQueryObject(JSContext* cx, WebGLQuery *query, WebGLenum pname)
}
bool
WebGLContext::ValidateTargetParameter(WebGLenum target, const char* infos)
WebGLContext::ValidateQueryTargetParameter(WebGLenum target, const char* infos)
{
if (target != LOCAL_GL_ANY_SAMPLES_PASSED &&
target != LOCAL_GL_ANY_SAMPLES_PASSED_CONSERVATIVE)
{
ErrorInvalidEnum("%s: target must be ANY_SAMPLES_PASSED{_CONSERVATIVE}", infos);
return false;
switch (target) {
case LOCAL_GL_ANY_SAMPLES_PASSED:
case LOCAL_GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
case LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
return true;
}
return true;
ErrorInvalidEnum("%s: unknown query target", infos);
return false;
}
WebGLRefPtr<WebGLQuery>&
WebGLContext::GetActiveQueryByTarget(WebGLenum target)
{
MOZ_ASSERT(ValidateTargetParameter(target, "private WebGLContext::GetActiveQueryByTarget"));
MOZ_ASSERT(ValidateQueryTargetParameter(target, "private WebGLContext::GetActiveQueryByTarget"));
switch (target) {
case LOCAL_GL_ANY_SAMPLES_PASSED:
case LOCAL_GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
return mActiveOcclusionQuery;
case LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
return mActiveTransformFeedbackQuery;
}
MOZ_ASSERT(false, "WebGLContext::GetActiveQueryByTarget is not compatible with "
"WebGLContext::ValidateQueryTargetParameter");
return mActiveOcclusionQuery;
}

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

@ -73,3 +73,10 @@ else:
CPP_SOURCES += [
'WebGLContextNotSupported.cpp',
]
FAIL_ON_WARNINGS = True
LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True

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

@ -3,6 +3,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/. */
// IWYU pragma: private, include "nsGUIEvent.h"
/**
* This header file defines all DOM keys which are defined in nsIDOMKeyEvent.

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

@ -11,10 +11,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = gkconevents_s
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

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

@ -66,3 +66,10 @@ CPP_SOURCES += [
if CONFIG['MOZ_WEBSPEECH']:
CPP_SOURCES += ['SpeechRecognitionError.cpp']
FAIL_ON_WARNINGS = True
LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True

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

@ -9,6 +9,7 @@
#include "prlog.h"
#include "nsString.h"
#include "nsIDOMDocument.h"
#include "nsIServiceManager.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIVariant.h"

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

@ -111,10 +111,7 @@ using namespace mozilla::dom;
static const LayoutDeviceIntPoint kInvalidRefPoint = LayoutDeviceIntPoint(-1,-1);
static bool sLeftClickOnly = true;
static bool sKeyCausesActivation = true;
static uint32_t sESMInstanceCount = 0;
static int32_t sChromeAccessModifier = 0, sContentAccessModifier = 0;
int32_t nsEventStateManager::sUserInputEventDepth = 0;
bool nsEventStateManager::sNormalLMouseEventInProcess = false;
nsEventStateManager* nsEventStateManager::sActiveESM = nullptr;
@ -268,30 +265,6 @@ GetDocumentFromWindow(nsIDOMWindow *aWindow)
return win ? win->GetExtantDoc() : nullptr;
}
static int32_t
GetAccessModifierMaskFromPref(int32_t aItemType)
{
int32_t accessKey = Preferences::GetInt("ui.key.generalAccessKey", -1);
switch (accessKey) {
case -1: break; // use the individual prefs
case nsIDOMKeyEvent::DOM_VK_SHIFT: return NS_MODIFIER_SHIFT;
case nsIDOMKeyEvent::DOM_VK_CONTROL: return NS_MODIFIER_CONTROL;
case nsIDOMKeyEvent::DOM_VK_ALT: return NS_MODIFIER_ALT;
case nsIDOMKeyEvent::DOM_VK_META: return NS_MODIFIER_META;
case nsIDOMKeyEvent::DOM_VK_WIN: return NS_MODIFIER_OS;
default: return 0;
}
switch (aItemType) {
case nsIDocShellTreeItem::typeChrome:
return Preferences::GetInt("ui.key.chromeAccess", 0);
case nsIDocShellTreeItem::typeContent:
return Preferences::GetInt("ui.key.contentAccess", 0);
default:
return 0;
}
}
struct DeltaValues
{
DeltaValues() : deltaX(0.0), deltaY(0.0) {}
@ -681,8 +654,7 @@ nsEventStateManager::nsEventStateManager()
mLClickCount(0),
mMClickCount(0),
mRClickCount(0),
m_haveShutdown(false),
mClickHoldContextMenu(false)
m_haveShutdown(false)
{
if (sESMInstanceCount == 0) {
gUserInteractionTimerCallback = new nsUITimerCallback();
@ -710,17 +682,6 @@ nsEventStateManager::UpdateUserActivityTimer(void)
return NS_OK;
}
static const char* kObservedPrefs[] = {
"accessibility.accesskeycausesactivation",
"nglayout.events.dispatchLeftClickOnly",
"ui.key.generalAccessKey",
"ui.key.chromeAccess",
"ui.key.contentAccess",
"ui.click_hold_context_menus",
"dom.popup_allowed_events",
nullptr
};
nsresult
nsEventStateManager::Init()
{
@ -732,21 +693,8 @@ nsEventStateManager::Init()
observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, true);
if (sESMInstanceCount == 1) {
sKeyCausesActivation =
Preferences::GetBool("accessibility.accesskeycausesactivation",
sKeyCausesActivation);
sLeftClickOnly =
Preferences::GetBool("nglayout.events.dispatchLeftClickOnly",
sLeftClickOnly);
sChromeAccessModifier =
GetAccessModifierMaskFromPref(nsIDocShellTreeItem::typeChrome);
sContentAccessModifier =
GetAccessModifierMaskFromPref(nsIDocShellTreeItem::typeContent);
Prefs::Init();
}
Preferences::AddWeakObservers(this, kObservedPrefs);
mClickHoldContextMenu =
Preferences::GetBool("ui.click_hold_context_menus", false);
return NS_OK;
}
@ -756,7 +704,7 @@ nsEventStateManager::~nsEventStateManager()
if (sActiveESM == this) {
sActiveESM = nullptr;
}
if (mClickHoldContextMenu)
if (Prefs::ClickHoldContextMenu())
KillClickHoldTimer();
if (mDocument == sMouseOverDocument)
@ -773,6 +721,7 @@ nsEventStateManager::~nsEventStateManager()
gUserInteractionTimer->Cancel();
NS_RELEASE(gUserInteractionTimer);
}
Prefs::Shutdown();
WheelPrefs::Shutdown();
DeltaAccumulator::Shutdown();
}
@ -800,7 +749,6 @@ nsEventStateManager::~nsEventStateManager()
nsresult
nsEventStateManager::Shutdown()
{
Preferences::RemoveObservers(this, kObservedPrefs);
m_haveShutdown = true;
return NS_OK;
}
@ -810,38 +758,8 @@ nsEventStateManager::Observe(nsISupports *aSubject,
const char *aTopic,
const PRUnichar *someData)
{
if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
Shutdown();
else if (!nsCRT::strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
if (!someData)
return NS_OK;
nsDependentString data(someData);
if (data.EqualsLiteral("accessibility.accesskeycausesactivation")) {
sKeyCausesActivation =
Preferences::GetBool("accessibility.accesskeycausesactivation",
sKeyCausesActivation);
} else if (data.EqualsLiteral("nglayout.events.dispatchLeftClickOnly")) {
sLeftClickOnly =
Preferences::GetBool("nglayout.events.dispatchLeftClickOnly",
sLeftClickOnly);
} else if (data.EqualsLiteral("ui.key.generalAccessKey")) {
sChromeAccessModifier =
GetAccessModifierMaskFromPref(nsIDocShellTreeItem::typeChrome);
sContentAccessModifier =
GetAccessModifierMaskFromPref(nsIDocShellTreeItem::typeContent);
} else if (data.EqualsLiteral("ui.key.chromeAccess")) {
sChromeAccessModifier =
GetAccessModifierMaskFromPref(nsIDocShellTreeItem::typeChrome);
} else if (data.EqualsLiteral("ui.key.contentAccess")) {
sContentAccessModifier =
GetAccessModifierMaskFromPref(nsIDocShellTreeItem::typeContent);
} else if (data.EqualsLiteral("ui.click_hold_context_menus")) {
mClickHoldContextMenu =
Preferences::GetBool("ui.click_hold_context_menus", false);
} else if (data.EqualsLiteral("dom.popup_allowed_events")) {
nsDOMEvent::PopupAllowedEventsChanged();
}
}
return NS_OK;
@ -965,7 +883,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
case NS_MOUSE_BUTTON_UP:
switch (static_cast<nsMouseEvent*>(aEvent)->button) {
case nsMouseEvent::eLeftButton:
if (mClickHoldContextMenu) {
if (Prefs::ClickHoldContextMenu()) {
KillClickHoldTimer();
}
#ifndef XP_OS2
@ -1018,7 +936,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
FlushPendingEvents(aPresContext);
break;
case NS_DRAGDROP_GESTURE:
if (mClickHoldContextMenu) {
if (Prefs::ClickHoldContextMenu()) {
// an external drag gesture event came in, not generated internally
// by Gecko. Make sure we get rid of the click-hold timer.
KillClickHoldTimer();
@ -1048,10 +966,12 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
modifierMask |= NS_MODIFIER_OS;
// Prevent keyboard scrolling while an accesskey modifier is in use.
if (modifierMask && (modifierMask == sChromeAccessModifier ||
modifierMask == sContentAccessModifier))
if (modifierMask &&
(modifierMask == Prefs::ChromeAccessModifierMask() ||
modifierMask == Prefs::ContentAccessModifierMask())) {
HandleAccessKey(aPresContext, keyEvent, aStatus, nullptr,
eAccessKeyProcessingNormal, modifierMask);
}
}
// then fall through...
case NS_KEY_DOWN:
@ -1220,8 +1140,9 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
static int32_t
GetAccessModifierMask(nsISupports* aDocShell)
// static
int32_t
nsEventStateManager::GetAccessModifierMaskFor(nsISupports* aDocShell)
{
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(aDocShell));
if (!treeItem)
@ -1232,10 +1153,10 @@ GetAccessModifierMask(nsISupports* aDocShell)
switch (itemType) {
case nsIDocShellTreeItem::typeChrome:
return sChromeAccessModifier;
return Prefs::ChromeAccessModifierMask();
case nsIDocShellTreeItem::typeContent:
return sContentAccessModifier;
return Prefs::ContentAccessModifierMask();
default:
return -1; // invalid modifier
@ -1314,7 +1235,7 @@ nsEventStateManager::ExecuteAccessKey(nsTArray<uint32_t>& aAccessCharCodes,
content = mAccessKeys[(start + count) % length];
frame = content->GetPrimaryFrame();
if (IsAccessKeyTarget(content, frame, accessKey)) {
bool shouldActivate = sKeyCausesActivation;
bool shouldActivate = Prefs::KeyCausesActivation();
while (shouldActivate && ++count <= length) {
nsIContent *oc = mAccessKeys[(start + count) % length];
nsIFrame *of = oc->GetPrimaryFrame();
@ -1345,25 +1266,25 @@ nsEventStateManager::GetAccessKeyLabelPrefix(nsAString& aPrefix)
nsContentUtils::GetModifierSeparatorText(separator);
nsCOMPtr<nsISupports> container = mPresContext->GetContainer();
int32_t modifier = GetAccessModifierMask(container);
int32_t modifierMask = GetAccessModifierMaskFor(container);
if (modifier & NS_MODIFIER_CONTROL) {
if (modifierMask & NS_MODIFIER_CONTROL) {
nsContentUtils::GetControlText(modifierText);
aPrefix.Append(modifierText + separator);
}
if (modifier & NS_MODIFIER_META) {
if (modifierMask & NS_MODIFIER_META) {
nsContentUtils::GetMetaText(modifierText);
aPrefix.Append(modifierText + separator);
}
if (modifier & NS_MODIFIER_OS) {
if (modifierMask & NS_MODIFIER_OS) {
nsContentUtils::GetOSText(modifierText);
aPrefix.Append(modifierText + separator);
}
if (modifier & NS_MODIFIER_ALT) {
if (modifierMask & NS_MODIFIER_ALT) {
nsContentUtils::GetAltText(modifierText);
aPrefix.Append(modifierText + separator);
}
if (modifier & NS_MODIFIER_SHIFT) {
if (modifierMask & NS_MODIFIER_SHIFT) {
nsContentUtils::GetShiftText(modifierText);
aPrefix.Append(modifierText + separator);
}
@ -1382,7 +1303,7 @@ nsEventStateManager::HandleAccessKey(nsPresContext* aPresContext,
// Alt or other accesskey modifier is down, we may need to do an accesskey
if (mAccessKeys.Count() > 0 &&
aModifierMask == GetAccessModifierMask(pcContainer)) {
aModifierMask == GetAccessModifierMaskFor(pcContainer)) {
// Someone registered an accesskey. Find and activate it.
nsAutoTArray<uint32_t, 10> accessCharCodes;
nsContentUtils::GetAccessKeyCandidates(aEvent, accessCharCodes);
@ -1900,7 +1821,7 @@ nsEventStateManager::BeginTrackingDragGesture(nsPresContext* aPresContext,
mGestureModifiers = inDownEvent->modifiers;
mGestureDownButtons = inDownEvent->buttons;
if (mClickHoldContextMenu) {
if (Prefs::ClickHoldContextMenu()) {
// fire off a timer to track click-hold
CreateClickHoldTimer(aPresContext, inDownFrame, inDownEvent);
}
@ -1990,7 +1911,7 @@ nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
if (DeprecatedAbs(pt.x - mGestureDownPoint.x) > pixelThresholdX ||
DeprecatedAbs(pt.y - mGestureDownPoint.y) > pixelThresholdY) {
if (mClickHoldContextMenu) {
if (Prefs::ClickHoldContextMenu()) {
// stop the click-hold before we fire off the drag gesture, in case
// it takes a long time
KillClickHoldTimer();
@ -5585,3 +5506,107 @@ nsEventStateManager::WheelPrefs::IsOverOnePageScrollAllowedY(
return Abs(mMultiplierY[index]) >=
MIN_MULTIPLIER_VALUE_ALLOWING_OVER_ONE_PAGE_SCROLL;
}
/******************************************************************/
/* nsEventStateManager::Prefs */
/******************************************************************/
bool nsEventStateManager::Prefs::sKeyCausesActivation = true;
bool nsEventStateManager::Prefs::sClickHoldContextMenu = false;
int32_t nsEventStateManager::Prefs::sGenericAccessModifierKey = -1;
int32_t nsEventStateManager::Prefs::sChromeAccessModifierMask = 0;
int32_t nsEventStateManager::Prefs::sContentAccessModifierMask = 0;
// static
void
nsEventStateManager::Prefs::Init()
{
DebugOnly<nsresult> rv =
Preferences::AddBoolVarCache(&sKeyCausesActivation,
"accessibility.accesskeycausesactivation",
sKeyCausesActivation);
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"accessibility.accesskeycausesactivation\"");
rv = Preferences::AddBoolVarCache(&sClickHoldContextMenu,
"ui.click_hold_context_menus",
sClickHoldContextMenu);
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"ui.click_hold_context_menus\"");
rv = Preferences::AddIntVarCache(&sGenericAccessModifierKey,
"ui.key.generalAccessKey",
sGenericAccessModifierKey);
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"ui.key.generalAccessKey\"");
rv = Preferences::AddIntVarCache(&sChromeAccessModifierMask,
"ui.key.chromeAccess",
sChromeAccessModifierMask);
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"ui.key.chromeAccess\"");
rv = Preferences::AddIntVarCache(&sContentAccessModifierMask,
"ui.key.contentAccess",
sContentAccessModifierMask);
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"ui.key.contentAccess\"");
rv = Preferences::RegisterCallback(OnChange, "dom.popup_allowed_events");
MOZ_ASSERT(NS_SUCCEEDED(rv),
"Failed to observe \"dom.popup_allowed_events\"");
}
// static
int
nsEventStateManager::Prefs::OnChange(const char* aPrefName, void*)
{
nsDependentCString prefName(aPrefName);
if (prefName.EqualsLiteral("dom.popup_allowed_events")) {
nsDOMEvent::PopupAllowedEventsChanged();
}
return 0;
}
// static
void
nsEventStateManager::Prefs::Shutdown()
{
Preferences::UnregisterCallback(OnChange, "dom.popup_allowed_events");
}
// static
int32_t
nsEventStateManager::Prefs::ChromeAccessModifierMask()
{
return GetAccessModifierMask(nsIDocShellTreeItem::typeChrome);
}
// static
int32_t
nsEventStateManager::Prefs::ContentAccessModifierMask()
{
return GetAccessModifierMask(nsIDocShellTreeItem::typeContent);
}
// static
int32_t
nsEventStateManager::Prefs::GetAccessModifierMask(int32_t aItemType)
{
switch (sGenericAccessModifierKey) {
case -1: break; // use the individual prefs
case nsIDOMKeyEvent::DOM_VK_SHIFT: return NS_MODIFIER_SHIFT;
case nsIDOMKeyEvent::DOM_VK_CONTROL: return NS_MODIFIER_CONTROL;
case nsIDOMKeyEvent::DOM_VK_ALT: return NS_MODIFIER_ALT;
case nsIDOMKeyEvent::DOM_VK_META: return NS_MODIFIER_META;
case nsIDOMKeyEvent::DOM_VK_WIN: return NS_MODIFIER_OS;
default: return 0;
}
switch (aItemType) {
case nsIDocShellTreeItem::typeChrome:
return sChromeAccessModifierMask;
case nsIDocShellTreeItem::typeContent:
return sContentAccessModifierMask;
default:
return 0;
}
}

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

@ -217,6 +217,37 @@ public:
protected:
friend class MouseEnterLeaveDispatcher;
/**
* Prefs class capsules preference management.
*/
class Prefs
{
public:
static bool KeyCausesActivation() { return sKeyCausesActivation; }
static bool ClickHoldContextMenu() { return sClickHoldContextMenu; }
static int32_t ChromeAccessModifierMask();
static int32_t ContentAccessModifierMask();
static void Init();
static int OnChange(const char* aPrefName, void*);
static void Shutdown();
private:
static bool sKeyCausesActivation;
static bool sClickHoldContextMenu;
static int32_t sGenericAccessModifierKey;
static int32_t sChromeAccessModifierMask;
static int32_t sContentAccessModifierMask;
static int32_t GetAccessModifierMask(int32_t aItemType);
};
/**
* Get appropriate access modifier mask for the aDocShell. Returns -1 if
* access key isn't available.
*/
static int32_t GetAccessModifierMaskFor(nsISupports* aDocShell);
void UpdateCursor(nsPresContext* aPresContext, nsEvent* aEvent, nsIFrame* aTargetFrame, nsEventStatus* aStatus);
/**
* Turn a GUI mouse event into a mouse event targeted at the specified
@ -784,7 +815,6 @@ public:
static void ClearGlobalActiveContent(nsEventStateManager* aClearer);
// Functions used for click hold context menus
bool mClickHoldContextMenu;
nsCOMPtr<nsITimer> mClickHoldTimer;
void CreateClickHoldTimer ( nsPresContext* aPresContext, nsIFrame* inDownFrame,
nsGUIEvent* inMouseDownEvent ) ;

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

@ -541,7 +541,7 @@ HTMLBodyElement::IsEventAttributeName(nsIAtom *aName)
WINDOW_EVENT_HELPER(name_, EventHandlerNonNull)
#define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \
WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull)
#include "nsEventNameList.h"
#include "nsEventNameList.h" // IWYU pragma: keep
#undef BEFOREUNLOAD_EVENT
#undef WINDOW_EVENT
#undef WINDOW_EVENT_HELPER

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

@ -65,7 +65,7 @@ public:
WINDOW_EVENT_HELPER(name_, EventHandlerNonNull)
#define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \
WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull)
#include "nsEventNameList.h"
#include "nsEventNameList.h" // IWYU pragma: keep
#undef BEFOREUNLOAD_EVENT
#undef WINDOW_EVENT
#undef WINDOW_EVENT_HELPER

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

@ -400,7 +400,7 @@ HTMLFrameSetElement::IsEventAttributeName(nsIAtom *aName)
WINDOW_EVENT_HELPER(name_, EventHandlerNonNull)
#define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \
WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull)
#include "nsEventNameList.h"
#include "nsEventNameList.h" // IWYU pragma: keep
#undef BEFOREUNLOAD_EVENT
#undef WINDOW_EVENT
#undef WINDOW_EVENT_HELPER

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

@ -95,7 +95,7 @@ public:
WINDOW_EVENT_HELPER(name_, EventHandlerNonNull)
#define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_) \
WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull)
#include "nsEventNameList.h"
#include "nsEventNameList.h" // IWYU pragma: keep
#undef BEFOREUNLOAD_EVENT
#undef WINDOW_EVENT
#undef WINDOW_EVENT_HELPER

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

@ -3,9 +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/. */
#include "mozilla/DebugOnly.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/dom/Date.h"
#include "mozilla/dom/HTMLInputElementBinding.h"
#include "nsAsyncDOMEvent.h"
#include "nsAttrValueInlines.h"
@ -98,6 +99,7 @@
#include "nsIColorPicker.h"
#include "nsIStringEnumerator.h"
#include "HTMLSplitOnSpacesTokenizer.h"
// input type=date
#include "js/Date.h"

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

@ -31,6 +31,8 @@ class nsIRadioVisitor;
namespace mozilla {
namespace dom {
class Date;
class UploadLastDir MOZ_FINAL : public nsIObserver, public nsSupportsWeakReference {
public:
NS_DECL_ISUPPORTS

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

@ -95,6 +95,7 @@ static PRLogModuleInfo* gMediaElementEventsLog;
#include "mozilla/Preferences.h"
#include "nsIPermissionManager.h"
#include "nsContentTypeParser.h"
using namespace mozilla::layers;
using mozilla::net::nsMediaFragmentURIParser;
@ -277,7 +278,7 @@ void HTMLMediaElement::ReportLoadError(const char* aMsg,
uint32_t aParamCount)
{
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"Media",
NS_LITERAL_CSTRING("Media"),
OwnerDoc(),
nsContentUtils::eDOM_PROPERTIES,
aMsg,

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

@ -36,42 +36,42 @@ public:
double Value() const;
void SetValue(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::value, aValue);
SetDoubleAttr(nsGkAtoms::value, aValue, aRv);
}
/* @return the minimum value */
double Min() const;
void SetMin(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::min, aValue);
SetDoubleAttr(nsGkAtoms::min, aValue, aRv);
}
/* @return the maximum value */
double Max() const;
void SetMax(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::max, aValue);
SetDoubleAttr(nsGkAtoms::max, aValue, aRv);
}
/* @return the low value */
double Low() const;
void SetLow(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::low, aValue);
SetDoubleAttr(nsGkAtoms::low, aValue, aRv);
}
/* @return the high value */
double High() const;
void SetHigh(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::high, aValue);
SetDoubleAttr(nsGkAtoms::high, aValue, aRv);
}
/* @return the optimum value */
double Optimum() const;
void SetOptimum(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::optimum, aValue);
SetDoubleAttr(nsGkAtoms::optimum, aValue, aRv);
}
protected:

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

@ -33,12 +33,12 @@ public:
double Value() const;
void SetValue(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::value, aValue);
SetDoubleAttr(nsGkAtoms::value, aValue, aRv);
}
double Max() const;
void SetMax(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::max, aValue);
SetDoubleAttr(nsGkAtoms::max, aValue, aRv);
}
double Position() const;

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

@ -11,10 +11,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = gkconhtmlcon_s
MSVC_ENABLE_PGO := 1
LIBXUL_LIBRARY = 1
FAIL_ON_WARNINGS = 1
include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk

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

@ -9,6 +9,7 @@
#include "nsDOMClassInfoID.h"
#include "nsDOMEvent.h"
#include "nsIClassInfo.h"
#include "nsIDOMDocument.h"
#include "nsIXPCScriptable.h"
#include "nsIVariant.h"
#include "nsVariant.h"

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

@ -154,3 +154,9 @@ CPP_SOURCES += [
'nsTextEditorState.cpp',
]
FAIL_ON_WARNINGS = True
LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True

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

@ -51,7 +51,7 @@ SendJSWarning(nsIDocument* aDocument,
const PRUnichar** aWarningArgs, uint32_t aWarningArgsLen)
{
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
"HTML", aDocument,
NS_LITERAL_CSTRING("HTML"), aDocument,
nsContentUtils::eFORMS_PROPERTIES,
aWarningName,
aWarningArgs, aWarningArgsLen);

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

@ -820,7 +820,7 @@ nsGenericHTMLElement::GetEventListenerManagerForAttr(nsIAtom* aAttrName,
#define FORWARDED_EVENT(name_, id_, type_, struct_) \
|| nsGkAtoms::on##name_ == aAttrName
#define WINDOW_EVENT FORWARDED_EVENT
#include "nsEventNameList.h"
#include "nsEventNameList.h" // IWYU pragma: keep
#undef WINDOW_EVENT
#undef FORWARDED_EVENT
#undef EVENT
@ -928,7 +928,7 @@ nsGenericHTMLElement::SetOn##name_(EventHandlerNonNull* handler, \
\
return nsINode::SetOn##name_(handler, error); \
}
#include "nsEventNameList.h"
#include "nsEventNameList.h" // IWYU pragma: keep
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef EVENT
@ -1758,15 +1758,6 @@ nsGenericHTMLElement::GetUnsignedIntAttr(nsIAtom* aAttr,
return attrVal->GetIntegerValue();
}
nsresult
nsGenericHTMLElement::SetDoubleAttr(nsIAtom* aAttr, double aValue)
{
nsAutoString value;
value.AppendFloat(aValue);
return SetAttr(kNameSpaceID_None, aAttr, value, true);
}
void
nsGenericHTMLElement::GetURIAttr(nsIAtom* aAttr, nsIAtom* aBaseAttr,
nsAString& aResult) const

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

@ -247,7 +247,7 @@ public:
already_AddRefed<mozilla::dom::EventHandlerNonNull> GetOn##name_(); \
void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler, \
mozilla::ErrorResult& error);
#include "nsEventNameList.h"
#include "nsEventNameList.h" // IWYU pragma: keep
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef EVENT
@ -1104,7 +1104,13 @@ protected:
* @param aAttr name of attribute.
* @param aValue Double value of attribute.
*/
NS_HIDDEN_(nsresult) SetDoubleAttr(nsIAtom* aAttr, double aValue);
void SetDoubleAttr(nsIAtom* aAttr, double aValue, mozilla::ErrorResult& aRv)
{
nsAutoString value;
value.AppendFloat(aValue);
SetHTMLAttr(aAttr, value, aRv);
}
/**
* This method works like GetURIAttr, except that it supports multiple

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