diff options
46 files changed, 110 insertions, 237 deletions
diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4 index d3cc3113d..b5111598c 100644 --- a/build/autoconf/icu.m4 +++ b/build/autoconf/icu.m4 @@ -8,19 +8,6 @@ dnl ICU library, as well as a few other things. AC_DEFUN([MOZ_CONFIG_ICU], [ ICU_LIB_NAMES= -MOZ_SYSTEM_ICU= -MOZ_ARG_WITH_BOOL(system-icu, -[ --with-system-icu - Use system ICU (located with pkgconfig)], - MOZ_SYSTEM_ICU=1) - -if test -n "$MOZ_SYSTEM_ICU"; then - PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 58.1) - CFLAGS="$CFLAGS $MOZ_ICU_CFLAGS" - CXXFLAGS="$CXXFLAGS $MOZ_ICU_CFLAGS" -fi - -AC_SUBST(MOZ_SYSTEM_ICU) dnl We always use ICU. USE_ICU=1 @@ -51,7 +38,7 @@ if test -n "$USE_ICU"; then dnl We also don't do it on Windows because sometimes the file goes dnl missing -- possibly due to overzealous antivirus software? -- dnl which prevents the browser from starting up :( - if test -z "$JS_STANDALONE" -a -z "$MOZ_SYSTEM_ICU" -a "$OS_TARGET" != WINNT -a "$MOZ_WIDGET_TOOLKIT" != "android"; then + if test -z "$JS_STANDALONE" -a "$OS_TARGET" != WINNT -a "$MOZ_WIDGET_TOOLKIT" != "android"; then MOZ_ICU_DATA_ARCHIVE=1 else MOZ_ICU_DATA_ARCHIVE= @@ -64,7 +51,7 @@ AC_SUBST(USE_ICU) AC_SUBST(ICU_DATA_FILE) AC_SUBST(MOZ_ICU_DATA_ARCHIVE) -if test -n "$USE_ICU" -a -z "$MOZ_SYSTEM_ICU"; then +if test -n "$USE_ICU"; then if test -z "$YASM" -a -z "$GNU_AS" -a "$COMPILE_ENVIRONMENT"; then AC_MSG_ERROR([Building ICU requires either yasm or a GNU assembler. If you do not have either of those available for this platform you must use --without-intl-api]) fi diff --git a/build/autoconf/nspr-build.m4 b/build/autoconf/nspr-build.m4 index b733579c2..b53fb4d37 100644 --- a/build/autoconf/nspr-build.m4 +++ b/build/autoconf/nspr-build.m4 @@ -42,15 +42,6 @@ if test "$MOZ_BUILD_APP" != js || test -n "$JS_STANDALONE"; then _IS_OUTER_CONFIGURE=1 fi -MOZ_ARG_WITH_BOOL(system-nspr, -[ --with-system-nspr Use an NSPR that is already built and installed. - Use the 'nspr-config' script in the current path, - or look for the script in the directories given with - --with-nspr-exec-prefix or --with-nspr-prefix. - (Those flags are only checked if you specify - --with-system-nspr.)], - _USE_SYSTEM_NSPR=1 ) - JS_POSIX_NSPR=unset ifdef([CONFIGURING_JS],[ if test -n "$JS_STANDALONE"; then @@ -71,7 +62,6 @@ ifdef([CONFIGURING_JS],[ ]) dnl Pass at most one of -dnl --with-system-nspr dnl --with-nspr-cflags/libs dnl --enable-nspr-build dnl --enable-posix-nspr-emulation @@ -79,10 +69,6 @@ dnl --enable-posix-nspr-emulation AC_MSG_CHECKING([NSPR selection]) nspr_opts= which_nspr=default -if test -n "$_USE_SYSTEM_NSPR"; then - nspr_opts="x$nspr_opts" - which_nspr="system" -fi if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then nspr_opts="x$nspr_opts" which_nspr="command-line" @@ -136,11 +122,7 @@ fi # anything itself. if test -n "$_IS_OUTER_CONFIGURE"; then -if test -n "$_USE_SYSTEM_NSPR"; then - AM_PATH_NSPR($NSPR_MINVER, [MOZ_SYSTEM_NSPR=1], [AC_MSG_ERROR([you do not have NSPR installed or your version is older than $NSPR_MINVER.])]) -fi - -if test -n "$MOZ_SYSTEM_NSPR" -o -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then +if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then _SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $NSPR_CFLAGS" AC_TRY_COMPILE([#include "prtypes.h"], @@ -178,19 +160,7 @@ AC_SUBST(NSPR_INCLUDE_DIR) AC_SUBST(NSPR_LIB_DIR) PKGCONF_REQUIRES_PRIVATE="Requires.private: nspr" -if test -n "$MOZ_SYSTEM_NSPR"; then - _SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $NSPR_CFLAGS" - AC_TRY_COMPILE([#include "prlog.h"], - [#ifndef PR_STATIC_ASSERT - #error PR_STATIC_ASSERT not defined - #endif], - , - AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT])) - CFLAGS=$_SAVE_CFLAGS - # piggy back on $MOZ_SYSTEM_NSPR to set a variable for the nspr check for js.pc - PKGCONF_REQUIRES_PRIVATE="Requires.private: nspr >= $NSPR_MINVER" -elif test -n "$JS_POSIX_NSPR"; then +if test -n "$JS_POSIX_NSPR"; then PKGCONF_REQUIRES_PRIVATE= fi AC_SUBST([PKGCONF_REQUIRES_PRIVATE]) diff --git a/build/directive4.py b/build/directive4.py index bb832f6b7..38465628b 100644 --- a/build/directive4.py +++ b/build/directive4.py @@ -33,8 +33,6 @@ if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("br # Applies to Pale Moon and Basilisk if ('MC_BASILISK' in listConfig) or ('MC_PALEMOON' in listConfig): listViolations += [ - 'MOZ_SYSTEM_NSS', - 'MOZ_SYSTEM_NSPR', 'MOZ_SYSTEM_JPEG', 'MOZ_SYSTEM_ZLIB', 'MOZ_SYSTEM_BZ2', diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index 65add5cdc..03b1d4cdc 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -287,7 +287,6 @@ def old_configure_options(*options): '--with-sixgill', '--with-soft-float', '--with-system-bz2', - '--with-system-icu', '--with-system-jpeg', '--with-system-libevent', '--with-system-libvpx', diff --git a/config/Makefile.in b/config/Makefile.in index 1512520e4..5fe0162f2 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -47,7 +47,6 @@ export:: $(export-preqs) -DMOZ_SYSTEM_PNG=$(MOZ_SYSTEM_PNG) \ -DMOZ_SYSTEM_JPEG=$(MOZ_SYSTEM_JPEG) \ -DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \ - -DMOZ_SYSTEM_ICU=$(MOZ_SYSTEM_ICU) \ $(srcdir)/system-headers $(srcdir)/stl-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) diff --git a/config/external/icu/moz.build b/config/external/icu/moz.build index 248652a85..488a02159 100644 --- a/config/external/icu/moz.build +++ b/config/external/icu/moz.build @@ -6,16 +6,14 @@ Library('icu') -if CONFIG['MOZ_SYSTEM_ICU']: - OS_LIBS += CONFIG['MOZ_ICU_LIBS'] +DIRS += [ + 'common', + 'data', + 'i18n', +] + +if CONFIG['MOZ_ICU_DATA_ARCHIVE']: + DIRS += ['stubdata'] + USE_LIBS += ['icustubdata'] else: - DIRS += [ - 'common', - 'data', - 'i18n', - ] - if CONFIG['MOZ_ICU_DATA_ARCHIVE']: - DIRS += ['stubdata'] - USE_LIBS += ['icustubdata'] - else: - USE_LIBS += ['icudata'] + USE_LIBS += ['icudata'] diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in index 71954b403..eff80cd32 100644 --- a/config/external/nss/Makefile.in +++ b/config/external/nss/Makefile.in @@ -3,8 +3,6 @@ # 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 MOZ_SYSTEM_NSS - CC_WRAPPER = CXX_WRAPPER = @@ -475,4 +473,3 @@ endif # MOZ_FOLD_LIBS # security/nss/lib/ckfw/builtins. See bug #836220. libs-nss/lib$(if $(MOZ_FOLD_LIBS),/ckfw): $(call mkdir_deps,$(DEPTH)/security/nss/lib/ckfw/builtins) -endif diff --git a/config/external/nss/crmf/moz.build b/config/external/nss/crmf/moz.build index 04d985d74..8b5434a49 100644 --- a/config/external/nss/crmf/moz.build +++ b/config/external/nss/crmf/moz.build @@ -6,14 +6,11 @@ Library('crmf') -if CONFIG['MOZ_SYSTEM_NSS']: - OS_LIBS += [l for l in CONFIG['NSS_LIBS'] if l.startswith('-L')] -else: - USE_LIBS += [ - # The dependency on nss is not real, but is required to force the - # parent directory being built before this one. This has no - # practical effect on linkage, since the only thing linking crmf - # will need nss anyways. - 'nss', - 'static:/security/nss/lib/crmf/crmf', - ] +USE_LIBS += [ + # The dependency on nss is not real, but is required to force the + # parent directory being built before this one. This has no + # practical effect on linkage, since the only thing linking crmf + # will need nss anyways. + 'nss', + 'static:/security/nss/lib/crmf/crmf', +] diff --git a/config/external/nss/moz.build b/config/external/nss/moz.build index 1c61b28fd..dbf19ff50 100644 --- a/config/external/nss/moz.build +++ b/config/external/nss/moz.build @@ -6,10 +6,7 @@ DIRS += ['crmf'] -if CONFIG['MOZ_SYSTEM_NSS']: - Library('nss') - OS_LIBS += CONFIG['NSS_LIBS'] -elif CONFIG['MOZ_FOLD_LIBS']: +if CONFIG['MOZ_FOLD_LIBS']: GeckoSharedLibrary('nss', linkage=None) # TODO: The library name can be changed when bug 845217 is fixed. SHARED_LIBRARY_NAME = 'nss3' diff --git a/config/moz.build b/config/moz.build index 7bcac7992..c512bd07d 100644 --- a/config/moz.build +++ b/config/moz.build @@ -29,9 +29,6 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT': # while the program here is in C. HostProgram('nsinstall_real', c_only=True) -if CONFIG['MOZ_SYSTEM_ICU']: - DEFINES['MOZ_SYSTEM_ICU'] = True - PYTHON_UNIT_TESTS += [ 'tests/test_mozbuild_reading.py', 'tests/unit-expandlibs.py', diff --git a/config/recurse.mk b/config/recurse.mk index 0b469c1c3..6bf5670b5 100644 --- a/config/recurse.mk +++ b/config/recurse.mk @@ -172,7 +172,7 @@ ifeq ($(MOZ_REPLACE_MALLOC_LINKAGE),dummy library) mozglue/build/target memory/replace/logalloc/replay/target: memory/replace/dummy/target endif endif -ifeq (,$(MOZ_SYSTEM_NSPR)$(MOZ_SYSTEM_NSS)$(MOZ_FOLD_LIBS)) +ifeq (,$(MOZ_FOLD_LIBS)) config/external/nss/target: config/external/nspr/pr/target config/external/nspr/ds/target config/external/nspr/libc/target endif # Most things are built during compile (target/host), but some things happen during export diff --git a/config/system-headers b/config/system-headers index 29eef3210..a2d3b813d 100644 --- a/config/system-headers +++ b/config/system-headers @@ -1312,22 +1312,6 @@ kvm.h spawn.h err.h xlocale.h -#ifdef MOZ_SYSTEM_ICU -unicode/locid.h -unicode/numsys.h -unicode/timezone.h -unicode/ucal.h -unicode/uchar.h -unicode/uclean.h -unicode/ucol.h -unicode/udat.h -unicode/udatpg.h -unicode/uenum.h -unicode/unorm.h -unicode/unum.h -unicode/ustring.h -unicode/utypes.h -#endif libutil.h unwind.h fenv.h diff --git a/devtools/client/themes/webconsole.css b/devtools/client/themes/webconsole.css index 89bb38628..85c73264c 100644 --- a/devtools/client/themes/webconsole.css +++ b/devtools/client/themes/webconsole.css @@ -14,7 +14,6 @@ a { -moz-user-focus: normal; - -moz-user-input: enabled; cursor: pointer; text-decoration: underline; } diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js index 25d9e2d33..eda2c7148 100644 --- a/devtools/shared/css/generated/properties-db.js +++ b/devtools/shared/css/generated/properties-db.js @@ -1440,8 +1440,6 @@ exports.CSS_PROPERTIES = { "supports": [], "values": [ "auto", - "disabled", - "enabled", "inherit", "initial", "none", diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 9428529f4..feee2423a 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -53,11 +53,6 @@ DOMInterfaces = { 'concrete': False }, -'AddonManagerPermissions': { - 'wrapperCache': False, - 'concrete': False -}, - 'AnimationEffectReadOnly': { 'concrete': False }, diff --git a/dom/html/HTMLLabelElement.h b/dom/html/HTMLLabelElement.h index c8385fc53..4057ffef6 100644 --- a/dom/html/HTMLLabelElement.h +++ b/dom/html/HTMLLabelElement.h @@ -59,8 +59,6 @@ public: using nsGenericHTMLElement::Focus; virtual void Focus(mozilla::ErrorResult& aError) override; - virtual bool IsDisabled() const override { return false; } - // nsIContent virtual nsresult PostHandleEvent( EventChainPostVisitor& aVisitor) override; diff --git a/dom/html/HTMLObjectElement.h b/dom/html/HTMLObjectElement.h index 4041b78a3..5226154da 100644 --- a/dom/html/HTMLObjectElement.h +++ b/dom/html/HTMLObjectElement.h @@ -77,8 +77,6 @@ public: NS_IMETHOD Reset() override; NS_IMETHOD SubmitNamesValues(HTMLFormSubmission *aFormSubmission) override; - virtual bool IsDisabled() const override { return false; } - virtual void DoneAddingChildren(bool aHaveNotified) override; virtual bool IsDoneAddingChildren() override; diff --git a/dom/html/HTMLOptGroupElement.cpp b/dom/html/HTMLOptGroupElement.cpp index 8a044fbf3..9e738961d 100644 --- a/dom/html/HTMLOptGroupElement.cpp +++ b/dom/html/HTMLOptGroupElement.cpp @@ -53,15 +53,14 @@ HTMLOptGroupElement::PreHandleEvent(EventChainPreVisitor& aVisitor) aVisitor.mCanHandle = false; // Do not process any DOM events if the element is disabled // XXXsmaug This is not the right thing to do. But what is? - if (HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) { + if (IsDisabled()) { return NS_OK; } - nsIFrame* frame = GetPrimaryFrame(); - if (frame) { - const nsStyleUserInterface* uiStyle = frame->StyleUserInterface(); - if (uiStyle->mUserInput == StyleUserInput::None || - uiStyle->mUserInput == StyleUserInput::Disabled) { + if (nsIFrame* frame = GetPrimaryFrame()) { + // FIXME(emilio): This poking at the style of the frame is broken unless we + // flush before every event handling, which we don't really want to. + if (frame->StyleUserInterface()->mUserInput == StyleUserInput::None) { return NS_OK; } } diff --git a/dom/html/HTMLOptGroupElement.h b/dom/html/HTMLOptGroupElement.h index d53a2e32b..e46a6a953 100644 --- a/dom/html/HTMLOptGroupElement.h +++ b/dom/html/HTMLOptGroupElement.h @@ -46,10 +46,6 @@ public: virtual nsIDOMNode* AsDOMNode() override { return this; } - virtual bool IsDisabled() const override { - return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled); - } - bool Disabled() const { return GetBoolAttr(nsGkAtoms::disabled); diff --git a/dom/html/HTMLOptionElement.h b/dom/html/HTMLOptionElement.h index e220b84df..4b5e192ff 100644 --- a/dom/html/HTMLOptionElement.h +++ b/dom/html/HTMLOptionElement.h @@ -67,10 +67,6 @@ public: nsresult CopyInnerTo(mozilla::dom::Element* aDest); - virtual bool IsDisabled() const override { - return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled); - } - bool Disabled() const { return GetBoolAttr(nsGkAtoms::disabled); diff --git a/dom/html/HTMLOutputElement.h b/dom/html/HTMLOutputElement.h index 588262480..6b6c3f66c 100644 --- a/dom/html/HTMLOutputElement.h +++ b/dom/html/HTMLOutputElement.h @@ -35,8 +35,6 @@ public: NS_IMETHOD Reset() override; NS_IMETHOD SubmitNamesValues(HTMLFormSubmission* aFormSubmission) override; - virtual bool IsDisabled() const override { return false; } - nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const override; bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute, diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp index cbf97f1ea..78e4d5b95 100644 --- a/dom/html/nsGenericHTMLElement.cpp +++ b/dom/html/nsGenericHTMLElement.cpp @@ -2109,14 +2109,6 @@ nsGenericHTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor) return nsGenericHTMLElement::PreHandleEvent(aVisitor); } -/* virtual */ -bool -nsGenericHTMLFormElement::IsDisabled() const -{ - return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled) || - (mFieldSet && mFieldSet->IsDisabled()); -} - void nsGenericHTMLFormElement::ForgetFieldSet(nsIContent* aFieldset) { @@ -2308,14 +2300,13 @@ nsGenericHTMLFormElement::IsElementDisabledForEvents(EventMessage aMessage, break; } - bool disabled = IsDisabled(); - if (!disabled && aFrame) { - const nsStyleUserInterface* uiStyle = aFrame->StyleUserInterface(); - disabled = uiStyle->mUserInput == StyleUserInput::None || - uiStyle->mUserInput == StyleUserInput::Disabled; - + // FIXME(emilio): This poking at the style of the frame is slightly bogus + // unless we flush before every event, which we don't really want to do. + if (aFrame && + aFrame->StyleUserInterface()->mUserInput == StyleUserInput::None) { + return true; } - return disabled; + return IsDisabled(); } void diff --git a/dom/html/nsGenericHTMLElement.h b/dom/html/nsGenericHTMLElement.h index edef2eeef..2b8b608b9 100644 --- a/dom/html/nsGenericHTMLElement.h +++ b/dom/html/nsGenericHTMLElement.h @@ -817,8 +817,8 @@ public: /** * Returns the current disabled state of the element. */ - virtual bool IsDisabled() const { - return false; + bool IsDisabled() const { + return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled); } bool IsHidden() const @@ -1222,8 +1222,6 @@ public: virtual nsresult PreHandleEvent( mozilla::EventChainPreVisitor& aVisitor) override; - virtual bool IsDisabled() const override; - /** * This callback is called by a fieldest on all its elements whenever its * disabled attribute is changed so the element knows its disabled state diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl index 70ec7e0ae..fcfe407e8 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -1786,7 +1786,7 @@ interface nsIDOMWindowUtils : nsISupports { /** * In certain cases the event handling of nodes, form controls in practice, * may be disabled. Such cases are for example the existence of disabled - * attribute or -moz-user-input: none/disabled. + * attribute or -moz-user-input: none. */ boolean isNodeDisabledForEvents(in nsIDOMNode aNode); diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 4cd044f90..ae4336060 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2175,7 +2175,11 @@ gfxPlatform::CanUseHardwareVideoDecoding() bool gfxPlatform::AccelerateLayersByDefault() { -#if defined(MOZ_GL_PROVIDER) || defined(MOZ_WIDGET_UIKIT) + // Note: add any new platform defines here that should get HWA by default. +#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_UIKIT) + return true; +#elif defined(MOZ_GL_PROVIDER) + // GL provider manually declared return true; #else return false; diff --git a/js/src/old-configure.in b/js/src/old-configure.in index 6566ce05e..856d7aeb4 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -2157,7 +2157,6 @@ HOST_CXXFLAGS=`echo \ $HOST_CXXFLAGS` AC_SUBST(_DEPEND_CFLAGS) -AC_SUBST(MOZ_SYSTEM_NSPR) OS_CFLAGS="$CFLAGS" OS_CXXFLAGS="$CXXFLAGS" diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp index eca22f3ba..8396726c6 100644 --- a/layout/base/nsCaret.cpp +++ b/layout/base/nsCaret.cpp @@ -511,7 +511,7 @@ nsCaret::GetPaintGeometry(nsRect* aRect) CheckSelectionLanguageChange(); int32_t frameOffset; - nsIFrame *frame = GetFrameAndOffset(GetSelectionInternal(), + nsIFrame* frame = GetFrameAndOffset(GetSelectionInternal(), mOverrideContent, mOverrideOffset, &frameOffset); if (!frame) { return nullptr; @@ -521,8 +521,7 @@ nsCaret::GetPaintGeometry(nsRect* aRect) const nsStyleUserInterface* userinterface = frame->StyleUserInterface(); if ((!mIgnoreUserModify && userinterface->mUserModify == StyleUserModify::ReadOnly) || - userinterface->mUserInput == StyleUserInput::None || - userinterface->mUserInput == StyleUserInput::Disabled) { + frame->IsContentDisabled()){ return nullptr; } diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 5a9438939..78185616f 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -1165,9 +1165,7 @@ nsComboboxControlFrame::HandleEvent(nsPresContext* aPresContext, // If we have style that affects how we are selected, feed event down to // nsFrame::HandleEvent so that selection takes place when appropriate. - const nsStyleUserInterface* uiStyle = StyleUserInterface(); - if (uiStyle->mUserInput == StyleUserInput::None || - uiStyle->mUserInput == StyleUserInput::Disabled) { + if (IsContentDisabled()) { return nsBlockFrame::HandleEvent(aPresContext, aEvent, aEventStatus); } return NS_OK; diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index 4ee62acbf..8dbe564dd 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -183,10 +183,8 @@ nsFormControlFrame::HandleEvent(nsPresContext* aPresContext, WidgetGUIEvent* aEvent, nsEventStatus* aEventStatus) { - // Check for user-input:none style - const nsStyleUserInterface* uiStyle = StyleUserInterface(); - if (uiStyle->mUserInput == StyleUserInput::None || - uiStyle->mUserInput == StyleUserInput::Disabled) { + // Check for disabled content so that selection works properly (?). + if (IsContentDisabled()) { return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); } return NS_OK; diff --git a/layout/forms/nsGfxButtonControlFrame.cpp b/layout/forms/nsGfxButtonControlFrame.cpp index 90da437f7..393145e0b 100644 --- a/layout/forms/nsGfxButtonControlFrame.cpp +++ b/layout/forms/nsGfxButtonControlFrame.cpp @@ -227,10 +227,7 @@ nsGfxButtonControlFrame::HandleEvent(nsPresContext* aPresContext, // from being called. The nsFrame::HandleEvent causes the button label // to be selected (Drawn with an XOR rectangle over the label) - // do we have user-input style? - const nsStyleUserInterface* uiStyle = StyleUserInterface(); - if (uiStyle->mUserInput == StyleUserInput::None || - uiStyle->mUserInput == StyleUserInput::Disabled) { + if (IsContentDisabled()) { return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); } return NS_OK; diff --git a/layout/forms/nsImageControlFrame.cpp b/layout/forms/nsImageControlFrame.cpp index 212fa9356..8aef41538 100644 --- a/layout/forms/nsImageControlFrame.cpp +++ b/layout/forms/nsImageControlFrame.cpp @@ -150,15 +150,9 @@ nsImageControlFrame::HandleEvent(nsPresContext* aPresContext, return NS_OK; } - // do we have user-input style? - const nsStyleUserInterface* uiStyle = StyleUserInterface(); - if (uiStyle->mUserInput == StyleUserInput::None || - uiStyle->mUserInput == StyleUserInput::Disabled) { + if (IsContentDisabled()) { return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); } - if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) { // XXX cache disabled - return NS_OK; - } *aEventStatus = nsEventStatus_eIgnore; diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index cc5f37f9a..58e81039f 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -920,16 +920,11 @@ nsListControlFrame::HandleEvent(nsPresContext* aPresContext, if (nsEventStatus_eConsumeNoDefault == *aEventStatus) return NS_OK; - // do we have style that affects how we are selected? - // do we have user-input style? - const nsStyleUserInterface* uiStyle = StyleUserInterface(); - if (uiStyle->mUserInput == StyleUserInput::None || - uiStyle->mUserInput == StyleUserInput::Disabled) { + // disabled state affects how we're selected, but we don't want to go through + // nsHTMLScrollFrame if we're disabled. + if (IsContentDisabled()) { return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); } - EventStates eventStates = mContent->AsElement()->State(); - if (eventStates.HasState(NS_EVENT_STATE_DISABLED)) - return NS_OK; return nsHTMLScrollFrame::HandleEvent(aPresContext, aEvent, aEventStatus); } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index bbbb5c332..8d4ea8754 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -5557,6 +5557,19 @@ nsFrame::Reflow(nsPresContext* aPresContext, NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); } +bool +nsIFrame::IsContentDisabled() const +{ + // FIXME(emilio): Doing this via CSS means callers must ensure the style is up + // to date, and they don't! + if (StyleUserInterface()->mUserInput == StyleUserInput::None) { + return true; + } + + auto* element = nsGenericHTMLElement::FromContentOrNull(GetContent()); + return element && element->IsDisabled(); +} + nsresult nsFrame::CharacterDataChanged(CharacterDataChangeInfo* aInfo) { diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 57f5c460c..93eb95099 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -2436,6 +2436,11 @@ public: nsIWidget* GetNearestWidget(nsPoint& aOffset) const; /** + * Whether the content for this frame is disabled, used for event handling. + */ + bool IsContentDisabled() const; + + /** * Get the "type" of the frame. May return nullptr. * * @see nsGkAtoms diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index ac2978c27..289a16ecd 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -2189,8 +2189,6 @@ const KTableEntry nsCSSProps::kUserFocusKTable[] = { const KTableEntry nsCSSProps::kUserInputKTable[] = { { eCSSKeyword_none, StyleUserInput::None }, - { eCSSKeyword_enabled, StyleUserInput::Enabled }, - { eCSSKeyword_disabled, StyleUserInput::Disabled }, { eCSSKeyword_auto, StyleUserInput::Auto }, { eCSSKeyword_UNKNOWN, -1 } }; diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index 6d207aec9..5412eed26 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -241,8 +241,6 @@ enum class StyleUserSelect : uint8_t { // user-input enum class StyleUserInput : uint8_t { None, - Enabled, - Disabled, Auto, }; diff --git a/layout/style/res/forms.css b/layout/style/res/forms.css index e7566e183..95025221d 100644 --- a/layout/style/res/forms.css +++ b/layout/style/res/forms.css @@ -425,7 +425,6 @@ optgroup:disabled, select:disabled:disabled /* Need the pseudo-class twice to have the specificity be at least the same as select[size][multiple] above */ { - -moz-user-input: disabled; color: GrayText; background-color: ThreeDLightShadow; cursor: inherit; diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index c75f7b498..3486d15d0 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -2203,7 +2203,7 @@ var gCSSProperties = { inherited: true, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], - other_values: [ "none", "enabled", "disabled" ], + other_values: [ "none" ], invalid_values: [] }, "-moz-user-modify": { diff --git a/old-configure.in b/old-configure.in index a98951937..530a70471 100644 --- a/old-configure.in +++ b/old-configure.in @@ -2005,26 +2005,9 @@ esac MOZ_CONFIG_NSPR() -dnl ======================================================== -dnl = If NSS was not detected in the system, -dnl = use the one in the source tree (mozilla/security/nss) -dnl ======================================================== - -MOZ_ARG_WITH_BOOL(system-nss, -[ --with-system-nss Use system installed NSS], - _USE_SYSTEM_NSS=1 ) - -if test -n "$_USE_SYSTEM_NSS"; then - AC_MSG_ERROR([Building with system NSS is currently not supported.]) -fi - -if test -n "$_USE_SYSTEM_NSS"; then - AM_PATH_NSS(3.41, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])]) -fi - -if test -z "$MOZ_SYSTEM_NSS"; then - NSS_CFLAGS="-I${DIST}/include/nss" -fi +# TODO: We need to find a better place to define this include +NSS_CFLAGS="-I${DIST}/include/nss" +AC_SUBST(NSS_CFLAGS) if test -z "$SKIP_LIBRARY_CHECKS"; then dnl system JPEG support @@ -5403,10 +5386,6 @@ AC_SUBST_LIST(MOZ_BZ2_LIBS) AC_SUBST_LIST(MOZ_PNG_CFLAGS) AC_SUBST_LIST(MOZ_PNG_LIBS) -AC_SUBST(MOZ_SYSTEM_NSPR) - -AC_SUBST(MOZ_SYSTEM_NSS) - HOST_CMFLAGS=-fobjc-exceptions HOST_CMMFLAGS=-fobjc-exceptions OS_COMPILE_CMFLAGS=-fobjc-exceptions @@ -5586,8 +5565,6 @@ MC_BASILISK=$MC_BASILISK MC_PALEMOON=$MC_PALEMOON MOZ_EME=$MOZ_EME MOZ_WEBRTC=$MOZ_WEBRTC -MOZ_SYSTEM_NSS=$MOZ_SYSTEM_NSS -MOZ_SYSTEM_NSPR=$MOZ_SYSTEM_NSPR MOZ_SYSTEM_JPEG=$MOZ_SYSTEM_JPEG MOZ_SYSTEM_ZLIB=$MOZ_SYSTEM_ZLIB MOZ_SYSTEM_BZ2=$MOZ_SYSTEM_BZ2 diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 03dda4a1f..4dbbdf43e 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -15394,6 +15394,10 @@ "url": "/dom/events/EventTarget-removeEventListener.html" }, { + "path": "dom/events/event-disabled-dynamic.html", + "url": "/dom/events/event-disabled-dynamic.html" + }, + { "path": "dom/events/ProgressEvent.html", "url": "/dom/events/ProgressEvent.html" }, diff --git a/testing/web-platform/tests/dom/events/event-disabled-dynamic.html b/testing/web-platform/tests/dom/events/event-disabled-dynamic.html new file mode 100644 index 000000000..89a3d3b15 --- /dev/null +++ b/testing/web-platform/tests/dom/events/event-disabled-dynamic.html @@ -0,0 +1,21 @@ +<!doctype html> +<meta charset=utf-8> +<title>Test that disabled is honored immediately in presence of dynamic changes</title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="author" title="Andreas Farre" href="mailto:afarre@mozilla.com"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/#enabling-and-disabling-form-controls:-the-disabled-attribute"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405087"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<input type="button" value="Click" disabled> +<script> +async_test(t => { + window.addEventListener('load', t.step_func(() => { ++ +− let e = document.querySelector('input'); + e.disabled = false; + e.onclick = t.step_func_done(() => {}); + e.click(); + })); +}, "disabled is honored properly in presence of dynamic changes"); +</script> diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm index 40ceb15ba..41b398efc 100644 --- a/toolkit/modules/AppConstants.jsm +++ b/toolkit/modules/AppConstants.jsm @@ -187,13 +187,6 @@ MOZ_SAFE_BROWSING: false, #endif - MOZ_SYSTEM_NSS: -#ifdef MOZ_SYSTEM_NSS - true, -#else - false, -#endif - MOZ_PLACES: #ifdef MOZ_PLACES true, diff --git a/toolkit/modules/addons/.eslintrc.js b/toolkit/modules/addons/.eslintrc.js index 019759c87..32c92be0a 100644 --- a/toolkit/modules/addons/.eslintrc.js +++ b/toolkit/modules/addons/.eslintrc.js @@ -8,7 +8,6 @@ module.exports = { // eslint-disable-line no-undef "addMessageListener": false, "removeEventListener": false, "sendAsyncMessage": false, - "AddonManagerPermissions": false, "initialProcessData": true, }, diff --git a/toolkit/modules/addons/WebRequest.jsm b/toolkit/modules/addons/WebRequest.jsm index c720dae5d..76114d7ba 100644 --- a/toolkit/modules/addons/WebRequest.jsm +++ b/toolkit/modules/addons/WebRequest.jsm @@ -720,11 +720,7 @@ HttpObserverManager = { try { let result = callback(data); - if (result && typeof result === "object" && opts.blocking - && !AddonManagerPermissions.isHostPermitted(uri.host) - && (!loadInfo || !loadInfo.loadingPrincipal - || !loadInfo.loadingPrincipal.URI - || !AddonManagerPermissions.isHostPermitted(loadInfo.loadingPrincipal.URI.host))) { + if (result && typeof result === "object" && opts.blocking) { handlerResults.push({opts, result}); } } catch (e) { diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build index 4e647bd7f..6b181b6aa 100644 --- a/toolkit/modules/moz.build +++ b/toolkit/modules/moz.build @@ -148,7 +148,6 @@ for var in ('ANDROID_PACKAGE_NAME', DEFINES[var] = CONFIG[var] for var in ('MOZ_TOOLKIT_SEARCH', - 'MOZ_SYSTEM_NSS', 'MOZ_UPDATER', 'MOZ_SWITCHBOARD'): if CONFIG[var]: diff --git a/toolkit/mozapps/installer/upload-files.mk b/toolkit/mozapps/installer/upload-files.mk index 40af34a59..82b550fb4 100644 --- a/toolkit/mozapps/installer/upload-files.mk +++ b/toolkit/mozapps/installer/upload-files.mk @@ -63,17 +63,15 @@ JSSHELL_BINS = \ $(DLL_PREFIX)mozglue$(DLL_SUFFIX) \ $(NULL) -ifndef MOZ_SYSTEM_NSPR - ifdef MOZ_FOLD_LIBS - JSSHELL_BINS += $(DLL_PREFIX)nss3$(DLL_SUFFIX) - else - JSSHELL_BINS += \ - $(DLL_PREFIX)nspr4$(DLL_SUFFIX) \ - $(DLL_PREFIX)plds4$(DLL_SUFFIX) \ - $(DLL_PREFIX)plc4$(DLL_SUFFIX) \ - $(NULL) - endif # MOZ_FOLD_LIBS -endif # MOZ_SYSTEM_NSPR +ifdef MOZ_FOLD_LIBS + JSSHELL_BINS += $(DLL_PREFIX)nss3$(DLL_SUFFIX) +else + JSSHELL_BINS += \ + $(DLL_PREFIX)nspr4$(DLL_SUFFIX) \ + $(DLL_PREFIX)plds4$(DLL_SUFFIX) \ + $(DLL_PREFIX)plc4$(DLL_SUFFIX) \ + $(NULL) +endif # MOZ_FOLD_LIBS ifdef MSVC_C_RUNTIME_DLL JSSHELL_BINS += $(MSVC_C_RUNTIME_DLL) |