Merge inbound to mozilla-central a=merge

This commit is contained in:
arthur.iakab 2018-09-19 05:18:50 +03:00
Родитель 2ebe13510b 14d863897b
Коммит 1ee75a928a
344 изменённых файлов: 8667 добавлений и 2787 удалений

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

@ -0,0 +1,22 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=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/. */
#ifndef MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#define MOZILLA_A11Y_ARIAGRIDACCESSIBLEWRAP_H
#include "ARIAGridAccessible.h"
namespace mozilla {
namespace a11y {
typedef class ARIAGridAccessible ARIAGridAccessibleWrap;
typedef class ARIAGridCellAccessible ARIAGridCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,23 @@
/* -*- 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/. */
#include "AccessibleWrap.h"
using namespace mozilla::a11y;
//-----------------------------------------------------
// construction
//-----------------------------------------------------
AccessibleWrap::AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc)
: Accessible(aContent, aDoc)
{
}
//-----------------------------------------------------
// destruction
//-----------------------------------------------------
AccessibleWrap::~AccessibleWrap()
{
}

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

@ -0,0 +1,25 @@
/* -*- 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/. */
#ifndef mozilla_a11y_AccessibleWrap_h_
#define mozilla_a11y_AccessibleWrap_h_
#include "nsCOMPtr.h"
#include "Accessible.h"
namespace mozilla {
namespace a11y {
class AccessibleWrap : public Accessible
{
public: // construction, destruction
AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
virtual ~AccessibleWrap();
};
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:expandtab:shiftwidth=4:tabstop=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 mozilla_a11y_ApplicationAccessibleWrap_h__
#define mozilla_a11y_ApplicationAccessibleWrap_h__
#include "ApplicationAccessible.h"
namespace mozilla {
namespace a11y {
typedef ApplicationAccessible ApplicationAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,19 @@
/* -*- 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/. */
#ifndef mozilla_a11y_DocAccessibleWrap_h__
#define mozilla_a11y_DocAccessibleWrap_h__
#include "DocAccessible.h"
namespace mozilla {
namespace a11y {
typedef DocAccessible DocAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,23 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=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/. */
#ifndef mozilla_a11y_HTMLTableAccessibleWrap_h__
#define mozilla_a11y_HTMLTableAccessibleWrap_h__
#include "HTMLTableAccessible.h"
namespace mozilla {
namespace a11y {
typedef class HTMLTableAccessible HTMLTableAccessibleWrap;
typedef class HTMLTableCellAccessible HTMLTableCellAccessibleWrap;
typedef class HTMLTableHeaderCellAccessible HTMLTableHeaderCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,19 @@
/* -*- 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/. */
#ifndef mozilla_a11y_HyperTextAccessibleWrap_h__
#define mozilla_a11y_HyperTextAccessibleWrap_h__
#include "HyperTextAccessible.h"
namespace mozilla {
namespace a11y {
typedef class HyperTextAccessible HyperTextAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,21 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=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/. */
#ifndef mozilla_a11y_ImageAccessibleWrap_h__
#define mozilla_a11y_ImageAccessibleWrap_h__
#include "ImageAccessible.h"
namespace mozilla {
namespace a11y {
typedef class ImageAccessible ImageAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,89 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "Platform.h"
using namespace mozilla;
using namespace mozilla::a11y;
void
a11y::PlatformInit()
{
}
void
a11y::PlatformShutdown()
{
}
void
a11y::ProxyCreated(ProxyAccessible*, uint32_t)
{
}
void
a11y::ProxyDestroyed(ProxyAccessible*)
{
}
void
a11y::ProxyEvent(ProxyAccessible*, uint32_t)
{
}
void
a11y::ProxyStateChangeEvent(ProxyAccessible*, uint64_t, bool)
{
}
void
a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
{
}
void
a11y::ProxyTextChangeEvent(ProxyAccessible*,
const nsString&,
int32_t,
uint32_t,
bool,
bool)
{
}
void
a11y::ProxyShowHideEvent(ProxyAccessible*, ProxyAccessible*, bool, bool)
{
}
void
a11y::ProxySelectionEvent(ProxyAccessible*, ProxyAccessible*, uint32_t)
{
}
void
a11y::ProxyVirtualCursorChangeEvent(ProxyAccessible*,
ProxyAccessible*,
int32_t,
int32_t,
ProxyAccessible*,
int32_t,
int32_t,
int16_t,
int16_t,
bool)
{
}
void
a11y::ProxyScrollingEvent(ProxyAccessible*,
uint32_t,
uint32_t,
uint32_t,
uint32_t,
uint32_t)
{
}

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

@ -0,0 +1,19 @@
/* -*- 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/. */
#ifndef mozilla_a11y_RootAccessibleWrap_h__
#define mozilla_a11y_RootAccessibleWrap_h__
#include "RootAccessible.h"
namespace mozilla {
namespace a11y {
typedef RootAccessible RootAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,19 @@
/* -*- 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/. */
#ifndef mozilla_a11y_TextLeafAccessibleWrap_h__
#define mozilla_a11y_TextLeafAccessibleWrap_h__
#include "TextLeafAccessible.h"
namespace mozilla {
namespace a11y {
typedef class TextLeafAccessible TextLeafAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,20 @@
/* -*- 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/. */
#ifndef mozilla_a11y_XULListboxAccessibleWrap_h__
#define mozilla_a11y_XULListboxAccessibleWrap_h__
#include "XULListboxAccessible.h"
namespace mozilla {
namespace a11y {
typedef class XULListboxAccessible XULListboxAccessibleWrap;
typedef class XULListCellAccessible XULListCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,19 @@
/* -*- 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/. */
#ifndef mozilla_a11y_XULMenuAccessibleWrap_h__
#define mozilla_a11y_XULMenuAccessibleWrap_h__
#include "XULMenuAccessible.h"
namespace mozilla {
namespace a11y {
typedef class XULMenuitemAccessible XULMenuitemAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,20 @@
/* -*- 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/. */
#ifndef mozilla_a11y_XULTreeGridAccessibleWrap_h__
#define mozilla_a11y_XULTreeGridAccessibleWrap_h__
#include "XULTreeGridAccessible.h"
namespace mozilla {
namespace a11y {
typedef class XULTreeGridAccessible XULTreeGridAccessibleWrap;
typedef class XULTreeGridCellAccessible XULTreeGridCellAccessibleWrap;
} // namespace a11y
} // namespace mozilla
#endif

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

@ -0,0 +1,33 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
EXPORTS.mozilla.a11y += ['AccessibleWrap.h',
'HyperTextAccessibleWrap.h',
]
SOURCES += [
'AccessibleWrap.cpp',
'Platform.cpp',
]
LOCAL_INCLUDES += [
'/accessible/base',
'/accessible/generic',
'/accessible/html',
'/accessible/ipc',
'/accessible/ipc/other',
'/accessible/xul',
'/dom/base',
'/widget',
'/widget/android',
]
FINAL_LIBRARY = 'xul'
include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']

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

@ -30,6 +30,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
LOCAL_INCLUDES += [
'/accessible/mac',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
LOCAL_INCLUDES += [
'/accessible/android',
]
else:
LOCAL_INCLUDES += [
'/accessible/other',

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

@ -114,7 +114,7 @@ void ProxyVirtualCursorChangeEvent(ProxyAccessible* aTarget,
int16_t aReason, int16_t aBoundaryType,
bool aFromUser);
void ProxyScrollingEvent(ProxyAccessible* aTarget,
void ProxyScrollingEvent(ProxyAccessible* aTarget, uint32_t aEventType,
uint32_t aScrollX, uint32_t aScrollY,
uint32_t aMaxScrollX, uint32_t aMaxScrollY);
#endif

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

@ -491,7 +491,7 @@ ROLE(SPINBUTTON,
NSAccessibilityIncrementorRole, //Subroles: Increment/Decrement.
ROLE_SYSTEM_SPINBUTTON,
ROLE_SYSTEM_SPINBUTTON,
"android.widget.EditText",
"android.view.View", // A composite widget
eNameFromValueRule)
ROLE(DIAGRAM,

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

@ -104,6 +104,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
LOCAL_INCLUDES += [
'/accessible/mac',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
LOCAL_INCLUDES += [
'/accessible/android',
]
else:
LOCAL_INCLUDES += [
'/accessible/other',

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

@ -1195,7 +1195,6 @@ private:
Accessible() = delete;
Accessible(const Accessible&) = delete;
Accessible& operator =(const Accessible&) = delete;
};
NS_DEFINE_STATIC_IID_ACCESSOR(Accessible,

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

@ -59,6 +59,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
LOCAL_INCLUDES += [
'/accessible/mac',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
LOCAL_INCLUDES += [
'/accessible/android',
]
else:
LOCAL_INCLUDES += [
'/accessible/other',

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

@ -37,6 +37,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
LOCAL_INCLUDES += [
'/accessible/mac',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
LOCAL_INCLUDES += [
'/accessible/android',
]
else:
LOCAL_INCLUDES += [
'/accessible/other',

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

@ -8,7 +8,7 @@ GeckoSharedLibrary('IA2Marshal', linkage=None)
DEFINES['REGISTER_PROXY_DLL'] = True
DEFFILE = SRCDIR + '/IA2Marshal.def'
DEFFILE = 'IA2Marshal.def'
OS_LIBS += [
'uuid',

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

@ -18,7 +18,7 @@ DEFINES['REGISTER_PROXY_DLL'] = True
# of AccessibleMarshal.dll.
DEFINES['PROXY_CLSID'] = 'IID_ISimpleDOMNode'
DEFFILE = SRCDIR + '/AccessibleMarshal.def'
DEFFILE = 'AccessibleMarshal.def'
OS_LIBS += [
'kernel32',

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

@ -451,7 +451,7 @@ DocAccessibleParent::RecvScrollingEvent(const uint64_t& aID,
}
#if defined(ANDROID)
ProxyScrollingEvent(target, aScrollX, aScrollY, aMaxScrollX, aMaxScrollY);
ProxyScrollingEvent(target, aType, aScrollX, aScrollY, aMaxScrollX, aMaxScrollY);
#endif
if (!nsCoreUtils::AccEventObserversExist()) {

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

@ -24,6 +24,10 @@ else:
LOCAL_INCLUDES += [
'/accessible/mac',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
LOCAL_INCLUDES += [
'/accessible/android',
]
else:
LOCAL_INCLUDES += [
'/accessible/other',

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

@ -33,6 +33,10 @@ if CONFIG['ACCESSIBILITY']:
LOCAL_INCLUDES += [
'/accessible/mac',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
LOCAL_INCLUDES += [
'/accessible/android',
]
else:
LOCAL_INCLUDES += [
'/accessible/other',
@ -44,4 +48,3 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
FINAL_LIBRARY = 'xul'

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

@ -37,7 +37,7 @@ GENERATED_FILES += [
'HandlerData_p.c',
]
DEFFILE = SRCDIR + '/AccessibleHandler.def'
DEFFILE = 'AccessibleHandler.def'
USE_LIBS += [
'mscom_oop',

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

@ -12,6 +12,8 @@ elif toolkit == 'windows':
DIRS += ['windows']
elif toolkit == 'cocoa':
DIRS += ['mac']
elif toolkit == 'android':
DIRS += ['android']
else:
DIRS += ['other']

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

@ -59,17 +59,3 @@ void
a11y::ProxySelectionEvent(ProxyAccessible*, ProxyAccessible*, uint32_t)
{
}
#if defined(ANDROID)
void
a11y::ProxyVirtualCursorChangeEvent(ProxyAccessible*, ProxyAccessible*,
int32_t, int32_t, ProxyAccessible*,
int32_t, int32_t, int16_t, int16_t, bool)
{
}
void
a11y::ProxyScrollingEvent(ProxyAccessible*, uint32_t, uint32_t, uint32_t, uint32_t)
{
}
#endif

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

@ -47,6 +47,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
LOCAL_INCLUDES += [
'/accessible/mac',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
LOCAL_INCLUDES += [
'/accessible/android',
]
else:
LOCAL_INCLUDES += [
'/accessible/other',

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

@ -43,6 +43,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
LOCAL_INCLUDES += [
'/accessible/mac',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
LOCAL_INCLUDES += [
'/accessible/android',
]
else:
LOCAL_INCLUDES += [
'/accessible/other',

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

@ -100,16 +100,7 @@ ifelse($#, 2, _MOZ_AC_DEFINE_UNQUOTED($1, $2), $#, 3, _MOZ_AC_DEFINE_UNQUOTED($1
dnl Replace AC_OUTPUT to create and call a python config.status
define([MOZ_CREATE_CONFIG_STATUS],
[dnl Top source directory in Windows format (as opposed to msys format).
WIN_TOP_SRC=
case "$host_os" in
mingw*)
WIN_TOP_SRC=`cd $srcdir; pwd -W`
;;
esac
AC_SUBST(WIN_TOP_SRC)
dnl Used in all Makefile.in files
[dnl Used in all Makefile.in files
top_srcdir=$srcdir
AC_SUBST(top_srcdir)

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

@ -50,7 +50,6 @@ if __name__ == '__main__':
prefpaths = [os.path.join(profile_data_dir, profile, 'user.js')
for profile in base_profiles]
prefpaths.append(os.path.join(build.topsrcdir, "build", "pgo", "prefs_override.js"))
prefs = {}
for path in prefpaths:

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

@ -10,7 +10,7 @@ SOURCES += [
SharedLibrary('crashinjectdll')
DEFFILE = SRCDIR + '/crashinjectdll.def'
DEFFILE = 'crashinjectdll.def'
USE_STATIC_LIBS = True
NO_PGO = True

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

@ -103,22 +103,6 @@ endif
# The VERSION_NUMBER is suffixed onto the end of the DLLs we ship.
VERSION_NUMBER = 50
ifeq ($(HOST_OS_ARCH),WINNT)
ifeq ($(MOZILLA_DIR),$(topsrcdir))
win_srcdir := $(subst $(topsrcdir),$(WIN_TOP_SRC),$(srcdir))
else
# This means we're in comm-central's topsrcdir, so we need to adjust
# WIN_TOP_SRC (which points to mozilla's topsrcdir) for the substitution
# to win_srcdir.
cc_WIN_TOP_SRC := $(WIN_TOP_SRC:%/mozilla=%)
win_srcdir := $(subst $(topsrcdir),$(cc_WIN_TOP_SRC),$(srcdir))
endif
BUILD_TOOLS = $(WIN_TOP_SRC)/build/unix
else
win_srcdir := $(srcdir)
BUILD_TOOLS = $(MOZILLA_DIR)/build/unix
endif
CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf

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

@ -47,7 +47,7 @@ EXEC = exec
# prints out failed commands anyway, so ELOG just makes things worse by
# forcing shell invocations.
ifneq (,$(findstring -s, $(filter-out --%, $(MAKEFLAGS))))
ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh
ELOG := $(EXEC) sh $(MOZILLA_DIR)/build/unix/print-failed-commands.sh
else
ELOG :=
endif # -s
@ -153,9 +153,6 @@ CODFILE=$(basename $(@F)).cod
endif
endif # !GNU_CC
EXTRA_DEPS += $(DEFFILE)
endif # WINNT
ifeq (arm-Darwin,$(CPU_ARCH)-$(OS_TARGET))
@ -568,15 +565,15 @@ ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
if test -f '$(srcdir)/$(notdir $@).manifest'; then \
echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest and $@.manifest'; \
$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
echo 'Embedding manifest from $(srcdir_rel)/$(notdir $@).manifest and $@.manifest'; \
$(MT) -NOLOGO -MANIFEST '$(srcdir_rel)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
else \
echo 'Embedding manifest from $@.manifest'; \
$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
fi; \
elif test -f '$(srcdir)/$(notdir $@).manifest'; then \
echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest'; \
$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' -OUTPUTRESOURCE:$@\;1; \
echo 'Embedding manifest from $(srcdir_rel)/$(notdir $@).manifest'; \
$(MT) -NOLOGO -MANIFEST '$(srcdir_rel)/$(notdir $@).manifest' -OUTPUTRESOURCE:$@\;1; \
fi
endif # MSVC with manifest tool
ifdef MOZ_PROFILE_GENERATE
@ -603,15 +600,15 @@ ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
if test -f '$(srcdir)/$(notdir $@).manifest'; then \
echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest and $@.manifest'; \
$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
echo 'Embedding manifest from $(srcdir_rel)/$(notdir $@).manifest and $@.manifest'; \
$(MT) -NOLOGO -MANIFEST '$(srcdir_rel)/$(notdir $@).manifest' $@.manifest -OUTPUTRESOURCE:$@\;1; \
else \
echo 'Embedding manifest from $@.manifest'; \
$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
fi; \
elif test -f '$(srcdir)/$(notdir $@).manifest'; then \
echo 'Embedding manifest from $(srcdir)/$(notdir $@).manifest'; \
$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' -OUTPUTRESOURCE:$@\;1; \
echo 'Embedding manifest from $(srcdir_rel)/$(notdir $@).manifest'; \
$(MT) -NOLOGO -MANIFEST '$(srcdir_rel)/$(notdir $@).manifest' -OUTPUTRESOURCE:$@\;1; \
fi
endif # MSVC with manifest tool
else
@ -642,7 +639,7 @@ ifdef MSMANIFEST_TOOL
$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
rm -f $@.manifest; \
elif test -f '$(srcdir)/$(notdir $@).manifest'; then \
$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$(notdir $@).manifest' -OUTPUTRESOURCE:$@\;1; \
$(MT) -NOLOGO -MANIFEST '$(srcdir_rel)/$(notdir $@).manifest' -OUTPUTRESOURCE:$@\;1; \
fi
endif # MSVC with manifest tool
else
@ -720,15 +717,15 @@ ifdef MSMANIFEST_TOOL
ifdef EMBED_MANIFEST_AT
@if test -f $@.manifest; then \
if test -f '$(srcdir)/$@.manifest'; then \
echo 'Embedding manifest from $(srcdir)/$@.manifest and $@.manifest'; \
$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$@.manifest' $@.manifest -OUTPUTRESOURCE:$@\;$(EMBED_MANIFEST_AT); \
echo 'Embedding manifest from $(srcdir_rel)/$@.manifest and $@.manifest'; \
$(MT) -NOLOGO -MANIFEST '$(srcdir_rel)/$@.manifest' $@.manifest -OUTPUTRESOURCE:$@\;$(EMBED_MANIFEST_AT); \
else \
echo 'Embedding manifest from $@.manifest'; \
$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;$(EMBED_MANIFEST_AT); \
fi; \
elif test -f '$(srcdir)/$@.manifest'; then \
echo 'Embedding manifest from $(srcdir)/$@.manifest'; \
$(MT) -NOLOGO -MANIFEST '$(win_srcdir)/$@.manifest' -OUTPUTRESOURCE:$@\;$(EMBED_MANIFEST_AT); \
echo 'Embedding manifest from $(srcdir_rel)/$@.manifest'; \
$(MT) -NOLOGO -MANIFEST '$(srcdir_rel)/$@.manifest' -OUTPUTRESOURCE:$@\;$(EMBED_MANIFEST_AT); \
fi
endif # EMBED_MANIFEST_AT
endif # MSVC with manifest tool

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

@ -1,9 +1,9 @@
This is the debugger.html project output.
See https://github.com/devtools-html/debugger.html
Version 87
Version 88
Comparison: https://github.com/devtools-html/debugger.html/compare/release-86...release-87
Comparison: https://github.com/devtools-html/debugger.html/compare/release-87...release-88
Packages:
- babel-plugin-transform-es2015-modules-commonjs @6.26.2

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

@ -2173,6 +2173,7 @@ menuseparator {
padding: 0 2px;
}
.objectBox-accessible.clickable,
.objectBox-node.clickable {
cursor: pointer;
}
@ -2198,6 +2199,7 @@ menuseparator {
color: var(--comment-node-color);
}
.accessible-role,
.tag-name {
color: var(--object-color);
}
@ -2274,8 +2276,9 @@ menuseparator {
}
/******************************************************************************/
/* Open DOMNode in inspector button */
/* Open DOMNode in inspector or Accessible in accessibility inspector button */
button.open-accessibility-inspector,
button.open-inspector {
mask: url("chrome://devtools/skin/images/devtools-reps/open-inspector.svg") no-repeat;
display: inline-block;
@ -2286,8 +2289,10 @@ button.open-inspector {
cursor: pointer;
}
.objectBox-accessible:hover .open-accessibility-inspector,
.objectBox-node:hover .open-inspector,
.objectBox-textNode:hover .open-inspector,
.open-accessibility-inspector:hover,
.open-inspector:hover {
background-color: var(--theme-highlight-blue);
}
@ -3993,11 +3998,6 @@ html[dir="rtl"] .object-node {
cursor: pointer;
}
.welcomebox__searchSources,
.welcomebox__searchProject {
transition: color 0.15s linear;
}
.welcomebox__searchSources:hover,
.welcomebox__searchProject:hover {
color: var(--theme-body-color);

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

@ -25724,8 +25724,8 @@ function WorkerDispatcher() {
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
WorkerDispatcher.prototype = {
start(url) {
this.worker = new Worker(url);
start(url, win = window) {
this.worker = new win.Worker(url);
this.worker.onerror = () => {
console.error(`Error in worker ${url}`);
};

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

@ -197,8 +197,8 @@ function WorkerDispatcher() {
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
WorkerDispatcher.prototype = {
start(url) {
this.worker = new Worker(url);
start(url, win = window) {
this.worker = new win.Worker(url);
this.worker.onerror = () => {
console.error(`Error in worker ${url}`);
};

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

@ -516,8 +516,8 @@ function WorkerDispatcher() {
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
WorkerDispatcher.prototype = {
start(url) {
this.worker = new Worker(url);
start(url, win = window) {
this.worker = new win.Worker(url);
this.worker.onerror = () => {
console.error(`Error in worker ${url}`);
};

2930
devtools/client/debugger/new/dist/vendors.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

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

@ -47,7 +47,12 @@ function mapDisplayNames(frames, getState) {
return frame;
}
const source = (0, _selectors.getSourceFromId)(getState(), frame.location.sourceId);
const source = (0, _selectors.getSource)(getState(), frame.location.sourceId);
if (!source) {
return frame;
}
const symbols = (0, _selectors.getSymbols)(getState(), source);
if (!symbols || !symbols.functions) {
@ -72,8 +77,8 @@ function isWasmOriginalSourceFrame(frame, getState) {
return false;
}
const generatedSource = (0, _selectors.getSourceFromId)(getState(), frame.generatedLocation.sourceId);
return generatedSource.isWasm;
const generatedSource = (0, _selectors.getSource)(getState(), frame.generatedLocation.sourceId);
return Boolean(generatedSource && generatedSource.isWasm);
}
async function expandFrames(frames, sourceMaps, getState) {

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

@ -29,14 +29,13 @@ function mapScopes(scopes, frame) {
client,
sourceMaps
}) {
const generatedSource = (0, _selectors.getSourceFromId)(getState(), frame.generatedLocation.sourceId);
const source = (0, _selectors.getSourceFromId)(getState(), frame.location.sourceId);
const shouldMapScopes = _prefs.features.mapScopes && !generatedSource.isWasm && !source.isPrettyPrinted && !(0, _devtoolsSourceMap.isGeneratedId)(frame.location.sourceId);
const generatedSource = (0, _selectors.getSource)(getState(), frame.generatedLocation.sourceId);
const source = (0, _selectors.getSource)(getState(), frame.location.sourceId);
await dispatch({
type: "MAP_SCOPES",
frame,
[_promise.PROMISE]: async function () {
if (!shouldMapScopes) {
if (!_prefs.features.mapScopes || !source || !generatedSource || generatedSource.isWasm || source.isPrettyPrinted || (0, _devtoolsSourceMap.isGeneratedId)(frame.location.sourceId)) {
return null;
}

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

@ -68,6 +68,10 @@ function loadSourceText(source) {
client,
sourceMaps
}) => {
if (!source) {
return;
}
const id = source.id; // Fetch the source text only once.
if (requests.has(id)) {
@ -97,7 +101,11 @@ function loadSourceText(source) {
return;
}
const newSource = (0, _selectors.getSourceFromId)(getState(), source.id);
const newSource = (0, _selectors.getSource)(getState(), source.id);
if (!newSource) {
return;
}
if ((0, _devtoolsSourceMap.isOriginalId)(newSource.id) && !newSource.isWasm) {
const generatedSource = (0, _selectors.getGeneratedSource)(getState(), source);

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

@ -112,10 +112,10 @@ function checkSelectedSource(sourceId) {
dispatch,
getState
}) => {
const source = (0, _selectors.getSourceFromId)(getState(), sourceId);
const source = (0, _selectors.getSource)(getState(), sourceId);
const pendingLocation = (0, _selectors.getPendingSelectedLocation)(getState());
if (!pendingLocation || !pendingLocation.url || !source.url) {
if (!pendingLocation || !pendingLocation.url || !source || !source.url) {
return;
}
@ -141,7 +141,12 @@ function checkPendingBreakpoints(sourceId) {
getState
}) => {
// source may have been modified by selectLocation
const source = (0, _selectors.getSourceFromId)(getState(), sourceId);
const source = (0, _selectors.getSource)(getState(), sourceId);
if (!source) {
return;
}
const pendingBreakpoints = (0, _selectors.getPendingBreakpointsForSource)(getState(), source);
if (pendingBreakpoints.length === 0) {

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

@ -342,7 +342,12 @@ function pauseGrip(func) {
async function fetchSources() {
const {
sources
} = await threadClient.getSources();
} = await threadClient.getSources(); // NOTE: this happens when we fetch sources and then immediately navigate
if (!sources) {
return;
}
return sources.map(source => (0, _create.createSource)(source, {
supportsWasm
}));

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

@ -57,10 +57,22 @@ async function paused(_, packet) {
if (why.type === "interrupted" && !packet.why.onNext) {
isInterrupted = true;
return;
} // Eagerly fetch the frames
}
let response;
try {
// Eagerly fetch the frames
response = await threadClient.getFrames(0, CALL_STACK_PAGE_SIZE);
} catch (e) {
console.log(e);
return;
} // NOTE: this happens if we fetch frames and then immediately navigate
const response = await threadClient.getFrames(0, CALL_STACK_PAGE_SIZE);
if (!response.hasOwnProperty("frames")) {
return;
}
if (why.type != "alreadyPaused") {
const pause = (0, _create.createPause)(packet, response);

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

@ -71,7 +71,7 @@ function getMenuItems(event, {
const copyFunctionKey = L10N.getStr("copyFunction.accesskey");
const copyFunctionLabel = L10N.getStr("copyFunction.label");
const copySourceKey = L10N.getStr("copySource.accesskey");
const copySourceLabel = L10N.getStr("copySource");
const copySourceLabel = L10N.getStr("copySource.label");
const copyToClipboardKey = L10N.getStr("copyToClipboard.accesskey");
const copyToClipboardLabel = L10N.getStr("copyToClipboard.label");
const copySourceUri2Key = L10N.getStr("copySourceUri2.accesskey");

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

@ -78,12 +78,14 @@ function gutterMenu({
closeConditionalPanel();
}
},
accelerator: L10N.getStr("toggleBreakpoint.key"),
...(breakpoint ? gutterItems.removeBreakpoint : gutterItems.addBreakpoint)
};
const conditionalBreakpoint = {
accesskey: L10N.getStr("editor.addConditionalBreakpoint.accesskey"),
disabled: false,
click: () => openConditionalPanel(line),
accelerator: L10N.getStr("toggleCondPanel.key"),
...(breakpoint && breakpoint.condition ? gutterItems.editConditional : gutterItems.addConditional)
};
const items = [toggleBreakpointItem, conditionalBreakpoint];

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

@ -335,7 +335,7 @@ class SearchBar extends _react.Component {
}, _react2.default.createElement(_SearchInput2.default, {
query: this.state.query,
count: count,
placeholder: L10N.getStr("sourceSearch.search.placeholder"),
placeholder: L10N.getStr("sourceSearch.search.placeholder2"),
summaryMsg: this.buildSummaryMsg(),
onChange: this.onChange,
onBlur: this.onBlur,

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

@ -228,8 +228,10 @@ class Editor extends _react.PureComponent {
return;
}
(0, _editor.startOperation)();
(0, _ui.resizeBreakpointGutter)(this.state.editor.codeMirror);
(0, _ui.resizeToggleButton)(this.state.editor.codeMirror);
(0, _editor.endOperation)();
}
componentWillUpdate(nextProps) {
@ -260,8 +262,10 @@ class Editor extends _react.PureComponent {
codeMirror
} = editor;
const codeMirrorWrapper = codeMirror.getWrapperElement();
(0, _editor.startOperation)();
(0, _ui.resizeBreakpointGutter)(codeMirror);
(0, _ui.resizeToggleButton)(codeMirror);
(0, _editor.endOperation)();
codeMirror.on("gutterClick", this.onGutterClick); // Set code editor wrapper to be focusable
codeMirrorWrapper.tabIndex = 0;

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

@ -169,8 +169,7 @@ class ProjectSearch extends _react.Component {
className: (0, _classnames2.default)("file-result", {
focused
}),
key: file.sourceId,
onClick: e => setExpanded(file, !expanded)
key: file.sourceId
}, _react2.default.createElement(_Svg2.default, {
name: "arrow",
className: (0, _classnames2.default)({

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

@ -436,7 +436,7 @@ class QuickOpenModal extends _react.Component {
query: query,
hasPrefix: true,
count: this.getResultCount(),
placeholder: L10N.getStr("sourceSearch.search"),
placeholder: L10N.getStr("sourceSearch.search2"),
summaryMsg: this.getSummaryMessage(),
showErrorEmoji: this.shouldShowErrorEmoji(),
onChange: this.onChange,

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

@ -51,7 +51,7 @@ class ShortcutsModal extends _react.Component {
renderSearchShortcuts() {
return _react2.default.createElement("ul", {
className: "shortcuts-list"
}, this.renderShorcutItem(L10N.getStr("shortcuts.fileSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))), this.renderShorcutItem(L10N.getStr("shortcuts.searchAgain"), (0, _text.formatKeyShortcut)(L10N.getStr("sourceSearch.search.again.key2"))), this.renderShorcutItem(L10N.getStr("shortcuts.projectSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("projectTextSearch.key"))), this.renderShorcutItem(L10N.getStr("shortcuts.functionSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("functionSearch.key"))), this.renderShorcutItem(L10N.getStr("shortcuts.gotoLine"), (0, _text.formatKeyShortcut)(L10N.getStr("gotoLineModal.key2"))));
}, this.renderShorcutItem(L10N.getStr("shortcuts.fileSearch2"), (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))), this.renderShorcutItem(L10N.getStr("shortcuts.searchAgain2"), (0, _text.formatKeyShortcut)(L10N.getStr("sourceSearch.search.again.key2"))), this.renderShorcutItem(L10N.getStr("shortcuts.projectSearch2"), (0, _text.formatKeyShortcut)(L10N.getStr("projectTextSearch.key"))), this.renderShorcutItem(L10N.getStr("shortcuts.functionSearch2"), (0, _text.formatKeyShortcut)(L10N.getStr("functionSearch.key"))), this.renderShorcutItem(L10N.getStr("shortcuts.gotoLine"), (0, _text.formatKeyShortcut)(L10N.getStr("gotoLineModal.key2"))));
}
renderShortcutsContent() {

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

@ -49,8 +49,8 @@ class WelcomeBox extends _react.Component {
render() {
const searchSourcesShortcut = (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"));
const searchProjectShortcut = (0, _text.formatKeyShortcut)(L10N.getStr("projectTextSearch.key"));
const searchSourcesLabel = L10N.getStr("welcome.search").substring(2);
const searchProjectLabel = L10N.getStr("welcome.findInFiles").substring(2);
const searchSourcesLabel = L10N.getStr("welcome.search2").substring(2);
const searchProjectLabel = L10N.getStr("welcome.findInFiles2").substring(2);
const {
setActiveSearch,
openQuickOpen

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

@ -7,12 +7,6 @@ exports.InitialState = InitialState;
exports.default = update;
exports.getExpandedState = getExpandedState;
var _makeRecord = require("../utils/makeRecord");
var _makeRecord2 = _interopRequireDefault(_makeRecord);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* 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/>. */
@ -22,20 +16,26 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
* @module reducers/source-tree
*/
function InitialState() {
return (0, _makeRecord2.default)({
return {
expanded: null
})();
};
}
function update(state = InitialState(), action) {
switch (action.type) {
case "SET_EXPANDED_STATE":
return state.set("expanded", action.expanded);
return updateExpanded(state, action);
}
return state;
}
function updateExpanded(state, action) {
return { ...state,
expanded: new Set(action.expanded)
};
}
function getExpandedState(state) {
return state.sourceTree.get("expanded");
return state.sourceTree.expanded;
}

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

@ -178,6 +178,10 @@ function getTextPropsFromAction(action) {
};
}
if (!action.value) {
return null;
}
return {
id: sourceId,
text: action.value.text,
@ -192,6 +196,11 @@ function getTextPropsFromAction(action) {
function setSourceTextProps(state, action) {
const source = getTextPropsFromAction(action);
if (!source) {
return state;
}
return updateSources(state, [source]);
}

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

@ -142,6 +142,15 @@ function setEditorText(editor, source) {
editor.setText(text);
}
}
function setMode(editor, source, symbols) {
const mode = (0, _source.getMode)(source, symbols);
const currentMode = editor.codeMirror.getOption("mode");
if (!currentMode || currentMode.name != mode.name) {
editor.setMode(mode);
}
}
/**
* Handle getting the source document or creating a new
* document with the correct mode and text.
@ -157,19 +166,13 @@ function showSourceText(editor, source, symbols) {
const doc = getDocument(source.id);
if (editor.codeMirror.doc === doc) {
const mode = (0, _source.getMode)(source, symbols);
const currentMode = editor.codeMirror.getOption("mode");
if (currentMode.name != mode.name) {
editor.setMode(mode);
}
setMode(editor, source, symbols);
return;
}
editor.replaceDocument(doc);
updateLineNumberFormat(editor, source.id);
editor.setMode((0, _source.getMode)(source, symbols));
setMode(editor, source, symbols);
return doc;
}
@ -177,6 +180,6 @@ function showSourceText(editor, source, symbols) {
setDocument(source.id, doc);
editor.replaceDocument(doc);
setEditorText(editor, source);
editor.setMode((0, _source.getMode)(source, symbols));
setMode(editor, source, symbols);
updateLineNumberFormat(editor, source.id);
}

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

@ -710,6 +710,8 @@ skip-if = os == "win"
skip-if = os == "win"
[browser_dbg-returnvalues.js]
[browser_dbg-reload.js]
[browser_dbg-reloading.js]
skip-if = true
[browser_dbg-pause-points.js]
[browser_dbg-scopes-mutations.js]
[browser_dbg-search-file.js]
@ -726,6 +728,7 @@ skip-if = os == "win" || (verify) # Bug 1434792
[browser_dbg-sourcemaps-bogus.js]
skip-if = os == 'linux' && !asan # bug 1447118
[browser_dbg-sources.js]
[browser_dbg-sources-arrow-keys.js]
[browser_dbg-sources-named-eval.js]
[browser_dbg-stepping.js]
skip-if = debug || (verify && (os == 'win')) || (os == "win" && os_version == "6.1")

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

@ -70,10 +70,16 @@ add_task(async function() {
info("Arrow keys and check to see if source is selected");
quickOpen(dbg, "sw");
is(resultCount(dbg), 2, "two file results");
pressKey(dbg, "Escape");
quickOpen(dbg, "sw2");
pressKey(dbg, "Down");
pressKey(dbg, "Enter");
await waitForSelectedSource(dbg, "switching-02");
quickOpen(dbg, "sw");
pressKey(dbg, "Tab");
assertDisabled(dbg);

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

@ -0,0 +1,42 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* Test reloading:
* 1. reload the source
* 2. re-sync breakpoints
*/
async function waitForBreakpoint(dbg, location) {
return waitForState(
dbg,
state => {
return dbg.selectors.getBreakpoint(dbg.getState(), location);
},
"Waiting for breakpoint"
);
}
add_task(async function() {
const dbg = await initDebugger("ember/quickstart/dist/");
await waitForSource(dbg, "ember-application/index.js");
await selectSource(dbg, "ember-application/index.js");
info("1. reload and hit breakpoint")
await addBreakpoint(dbg, "ember-application/index.js", 4);
reload(dbg, "ember/quickstart/dist/");
info("2. Wait for sources to appear and then reload")
await waitForDispatch(dbg, "ADD_SOURCES")
reload(dbg, "ember/quickstart/dist/");
info("3. Wait for sources to appear and then reload mid source-maps")
await waitForDispatch(dbg, "ADD_SOURCES");
reload(dbg, "ember/quickstart/dist/");
info("4. wait for the debugger to pause and show that we're in the correct location")
await waitForPaused(dbg)
assertPausedLocation(dbg, "ember-application/index.js", 4);
});

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

@ -0,0 +1,79 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Test keyboard arrow behaviour
async function waitForNodeToGainFocus(dbg, index) {
await waitUntil(() => {
const element = findElement(dbg, "sourceNode", index);
if (element) {
return element.classList.contains("focused");
}
return false;
}, `waiting for source node ${index} to be focused`);
}
async function assertNodeIsFocused(dbg, index) {
await waitForNodeToGainFocus(dbg, index);
const node = findElement(dbg, "sourceNode", index);
ok(node.classList.contains("focused"), `node ${index} is focused`);
}
add_task(async function() {
const dbg = await initDebugger("doc-sources.html");
await waitForSources(dbg, "simple1", "simple2", "nested-source", "long.js");
await clickElement(dbg, "sourceDirectoryLabel", 2);
await assertSourceCount(dbg, 7);
// Right key on open dir
await pressKey(dbg, "Right");
await assertNodeIsFocused(dbg, 3);
// Right key on closed dir
await pressKey(dbg, "Right");
await assertSourceCount(dbg, 8);
await assertNodeIsFocused(dbg, 3);
// Left key on a open dir
await pressKey(dbg, "Left");
await assertSourceCount(dbg, 7);
await assertNodeIsFocused(dbg, 3);
// Down key on a closed dir
await pressKey(dbg, "Down");
await assertNodeIsFocused(dbg, 4);
// Right key on a source
await pressKey(dbg, "Right");
await assertNodeIsFocused(dbg, 5);
// Down key on a source
await pressKey(dbg, "Down");
await assertNodeIsFocused(dbg, 6);
// Go to bottom of tree and press down key
await pressKey(dbg, "Down");
await pressKey(dbg, "Down");
await assertNodeIsFocused(dbg, 7);
// Up key on a source
await pressKey(dbg, "Up");
await assertNodeIsFocused(dbg, 6);
// Left key on a source
await pressKey(dbg, "Left");
await assertNodeIsFocused(dbg, 2);
// Left key on a closed dir
await pressKey(dbg, "Left");
await assertSourceCount(dbg, 2);
await pressKey(dbg, "Left");
await assertNodeIsFocused(dbg, 1);
// Up Key at the top of the source tree
await pressKey(dbg, "Up");
await assertNodeIsFocused(dbg, 1);
});

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

@ -3,19 +3,6 @@
// Tests that the source tree works.
async function waitForSourceCount(dbg, i) {
// We are forced to wait until the DOM nodes appear because the
// source tree batches its rendering.
await waitUntil(() => {
return findAllElements(dbg, "sourceNodes").length === i;
}, `waiting for ${i} sources`);
}
async function assertSourceCount(dbg, count) {
await waitForSourceCount(dbg, count);
is(findAllElements(dbg, "sourceNodes").length, count, `${count} sources`);
}
function getLabel(dbg, index) {
return findElement(dbg, "sourceNode", index)
.textContent.trim()

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

@ -1328,3 +1328,16 @@ async function assertPreviews(dbg, previews) {
dbg.actions.clearPreview();
}
}
async function waitForSourceCount(dbg, i) {
// We are forced to wait until the DOM nodes appear because the
// source tree batches its rendering.
await waitUntil(() => {
return findAllElements(dbg, "sourceNodes").length === i;
}, `waiting for ${i} sources`);
}
async function assertSourceCount(dbg, count) {
await waitForSourceCount(dbg, count);
is(findAllElements(dbg, "sourceNodes").length, count, `${count} sources`);
}

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

@ -4,16 +4,16 @@
"use strict";
const { createFactory, createRef, PureComponent } = require("devtools/client/shared/vendor/react");
const {
createElement,
createRef,
Fragment,
PureComponent,
} = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { translateNodeFrontToGrip } = require("devtools/client/inspector/shared/utils");
loader.lazyGetter(this, "FlexItemSelector", function() {
return createFactory(require("./FlexItemSelector"));
});
// Reps
const { REPS, MODE } = require("devtools/client/shared/components/reps/reps");
const { Rep } = REPS;
const ElementNode = REPS.ElementNode;
@ -28,8 +28,6 @@ class FlexContainer extends PureComponent {
onHideBoxModelHighlighter: PropTypes.func.isRequired,
onSetFlexboxOverlayColor: PropTypes.func.isRequired,
onShowBoxModelHighlighterForNode: PropTypes.func.isRequired,
onToggleFlexboxHighlighter: PropTypes.func.isRequired,
onToggleFlexItemShown: PropTypes.func.isRequired,
setSelectedNode: PropTypes.func.isRequired,
};
}
@ -40,7 +38,6 @@ class FlexContainer extends PureComponent {
this.colorValueEl = createRef();
this.swatchEl = createRef();
this.onFlexboxCheckboxClick = this.onFlexboxCheckboxClick.bind(this);
this.onFlexboxInspectIconClick = this.onFlexboxInspectIconClick.bind(this);
this.setFlexboxColor = this.setFlexboxColor.bind(this);
}
@ -77,51 +74,12 @@ class FlexContainer extends PureComponent {
this.props.onSetFlexboxOverlayColor(color);
}
onFlexboxCheckboxClick(e) {
// If the click was on the svg icon to select the node in the inspector, bail out.
const originalTarget = e.nativeEvent && e.nativeEvent.explicitOriginalTarget;
if (originalTarget && originalTarget.namespaceURI === "http://www.w3.org/2000/svg") {
// We should be able to cancel the click event propagation after the following reps
// issue is implemented : https://github.com/devtools-html/reps/issues/95 .
e.preventDefault();
return;
}
const {
flexbox,
onToggleFlexboxHighlighter,
} = this.props;
onToggleFlexboxHighlighter(flexbox.nodeFront);
}
onFlexboxInspectIconClick(nodeFront) {
const { setSelectedNode } = this.props;
setSelectedNode(nodeFront, { reason: "layout-panel" });
nodeFront.scrollIntoView().catch(e => console.error(e));
}
renderFlexItemSelector() {
const {
flexbox,
onToggleFlexItemShown,
} = this.props;
const {
flexItems,
flexItemShown,
} = flexbox;
if (!flexItemShown) {
return null;
}
return FlexItemSelector({
flexItem: flexItems.find(item => item.nodeFront.actorID === flexItemShown),
flexItems,
onToggleFlexItemShown,
});
}
render() {
const {
flexbox,
@ -130,56 +88,36 @@ class FlexContainer extends PureComponent {
} = this.props;
const {
color,
highlighted,
nodeFront,
} = flexbox;
return (
dom.div({ className: "flex-container devtools-monospace" },
dom.div({},
dom.label({},
dom.input(
{
className: "devtools-checkbox-toggle",
checked: highlighted,
onChange: this.onFlexboxCheckboxClick,
type: "checkbox",
}
),
Rep(
{
defaultRep: ElementNode,
mode: MODE.TINY,
object: translateNodeFrontToGrip(nodeFront),
onDOMNodeMouseOut: () => onHideBoxModelHighlighter(),
onDOMNodeMouseOver: () => onShowBoxModelHighlighterForNode(nodeFront),
onInspectIconClick: () => this.onFlexboxInspectIconClick(nodeFront),
}
)
),
dom.div(
{
className: "layout-color-swatch",
ref: this.swatchEl,
style: {
backgroundColor: color,
},
title: color,
}
),
// The SwatchColorPicker relies on the nextSibling of the swatch element to
// apply the selected color. This is why we use a span in display: none for
// now. Ideally we should modify the SwatchColorPickerTooltip to bypass this
// requirement. See https://bugzilla.mozilla.org/show_bug.cgi?id=1341578
dom.span(
{
className: "layout-color-value",
ref: this.colorValueEl,
},
color
)
),
this.renderFlexItemSelector()
return createElement(Fragment, null,
Rep({
defaultRep: ElementNode,
mode: MODE.TINY,
object: translateNodeFrontToGrip(nodeFront),
onDOMNodeMouseOut: () => onHideBoxModelHighlighter(),
onDOMNodeMouseOver: () => onShowBoxModelHighlighterForNode(nodeFront),
onInspectIconClick: () => this.onFlexboxInspectIconClick(nodeFront),
}),
dom.div({
className: "layout-color-swatch",
ref: this.swatchEl,
style: {
backgroundColor: color,
},
title: color,
}),
// The SwatchColorPicker relies on the nextSibling of the swatch element to
// apply the selected color. This is why we use a span in display: none for
// now. Ideally we should modify the SwatchColorPickerTooltip to bypass this
// requirement. See https://bugzilla.mozilla.org/show_bug.cgi?id=1341578
dom.span(
{
className: "layout-color-value",
ref: this.colorValueEl,
},
color
)
);
}

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

@ -9,7 +9,6 @@ const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { translateNodeFrontToGrip } = require("devtools/client/inspector/shared/utils");
// Reps
const { REPS, MODE } = require("devtools/client/shared/components/reps/reps");
const { Rep } = REPS;
const ElementNode = REPS.ElementNode;
@ -38,13 +37,11 @@ class FlexItem extends PureComponent {
className: "devtools-button devtools-monospace",
onClick: () => onToggleFlexItemShown(nodeFront),
},
Rep(
{
defaultRep: ElementNode,
mode: MODE.TINY,
object: translateNodeFrontToGrip(nodeFront)
}
)
Rep({
defaultRep: ElementNode,
mode: MODE.TINY,
object: translateNodeFrontToGrip(nodeFront),
})
)
)
);

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

@ -7,9 +7,11 @@
const { PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { translateNodeFrontToGrip } = require("devtools/client/inspector/shared/utils");
const {
getSelectorFromGrip,
translateNodeFrontToGrip,
} = require("devtools/client/inspector/shared/utils");
// Reps
const { REPS, MODE } = require("devtools/client/shared/components/reps/reps");
const { Rep } = REPS;
const ElementNode = REPS.ElementNode;
@ -43,7 +45,7 @@ class FlexItemSelector extends PureComponent {
for (const item of flexItems) {
const grip = translateNodeFrontToGrip(item.nodeFront);
menuItems.push({
label: getLabel(grip),
label: getSelectorFromGrip(grip),
type: "checkbox",
checked: item === flexItem,
click: () => onToggleFlexItemShown(item.nodeFront),
@ -59,61 +61,20 @@ class FlexItemSelector extends PureComponent {
const { flexItem } = this.props;
return (
dom.div({ className: "flex-item-selector-wrapper" },
dom.button(
{
id: "flex-item-selector",
className: "devtools-button devtools-dropdown-button",
onClick: this.onShowFlexItemMenu,
},
Rep(
{
defaultRep: ElementNode,
mode: MODE.TINY,
object: translateNodeFrontToGrip(flexItem.nodeFront)
}
)
)
dom.button(
{
id: "flex-item-selector",
className: "devtools-button devtools-dropdown-button",
onClick: this.onShowFlexItemMenu,
},
Rep({
defaultRep: ElementNode,
mode: MODE.TINY,
object: translateNodeFrontToGrip(flexItem.nodeFront),
})
)
);
}
}
/**
* Returns a selector label of the Element Rep from the grip. This is based on the
* getElements() function in our devtools-reps component for a ElementNode.
*
* @param {Object} grip
* Grip-like object that can be used with Reps.
* @return {String} selector label of the element node.
*/
function getLabel(grip) {
const {
attributes,
nodeName,
isAfterPseudoElement,
isBeforePseudoElement
} = grip.preview;
if (isAfterPseudoElement || isBeforePseudoElement) {
return `::${isAfterPseudoElement ? "after" : "before"}`;
}
let label = nodeName;
if (attributes.id) {
label += `#${attributes.id}`;
}
if (attributes.class) {
label += attributes.class
.trim()
.split(/\s+/)
.map(cls => `.${cls}`)
.join("");
}
return label;
}
module.exports = FlexItemSelector;

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

@ -9,9 +9,6 @@ const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { getStr } = require("devtools/client/inspector/layout/utils/l10n");
loader.lazyGetter(this, "FlexContainer", function() {
return createFactory(require("./FlexContainer"));
});
loader.lazyGetter(this, "FlexContainerProperties", function() {
return createFactory(require("./FlexContainerProperties"));
});
@ -21,6 +18,9 @@ loader.lazyGetter(this, "FlexItemList", function() {
loader.lazyGetter(this, "FlexItemSizingProperties", function() {
return createFactory(require("./FlexItemSizingProperties"));
});
loader.lazyGetter(this, "Header", function() {
return createFactory(require("./Header"));
});
const Types = require("../types");
@ -48,7 +48,7 @@ class Flexbox extends PureComponent {
flexItemShown,
} = flexbox;
if (flexItemShown) {
if (flexItemShown || !flexItems.length) {
return null;
}
@ -97,7 +97,7 @@ class Flexbox extends PureComponent {
return (
dom.div({ id: "layout-flexbox-container" },
FlexContainer({
Header({
flexbox,
getSwatchColorPickerTooltip,
onHideBoxModelHighlighter,

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

@ -0,0 +1,128 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const FlexContainer = createFactory(require("./FlexContainer"));
const FlexItemSelector = createFactory(require("./FlexItemSelector"));
const Types = require("../types");
class Header extends PureComponent {
static get propTypes() {
return {
flexbox: PropTypes.shape(Types.flexbox).isRequired,
getSwatchColorPickerTooltip: PropTypes.func.isRequired,
onHideBoxModelHighlighter: PropTypes.func.isRequired,
onSetFlexboxOverlayColor: PropTypes.func.isRequired,
onShowBoxModelHighlighterForNode: PropTypes.func.isRequired,
onToggleFlexboxHighlighter: PropTypes.func.isRequired,
onToggleFlexItemShown: PropTypes.func.isRequired,
setSelectedNode: PropTypes.func.isRequired,
};
}
constructor(props) {
super(props);
this.onFlexboxCheckboxClick = this.onFlexboxCheckboxClick.bind(this);
}
onFlexboxCheckboxClick() {
const {
flexbox,
onToggleFlexboxHighlighter,
} = this.props;
onToggleFlexboxHighlighter(flexbox.nodeFront);
}
renderFlexContainer() {
if (this.props.flexbox.flexItemShown) {
return null;
}
const {
flexbox,
getSwatchColorPickerTooltip,
onHideBoxModelHighlighter,
onSetFlexboxOverlayColor,
onShowBoxModelHighlighterForNode,
setSelectedNode,
} = this.props;
return FlexContainer({
flexbox,
getSwatchColorPickerTooltip,
onHideBoxModelHighlighter,
onSetFlexboxOverlayColor,
onShowBoxModelHighlighterForNode,
setSelectedNode,
});
}
renderFlexItemSelector() {
if (!this.props.flexbox.flexItemShown) {
return null;
}
const {
flexbox,
onToggleFlexItemShown,
} = this.props;
const {
flexItems,
flexItemShown,
} = flexbox;
return FlexItemSelector({
flexItem: flexItems.find(item => item.nodeFront.actorID === flexItemShown),
flexItems,
onToggleFlexItemShown,
});
}
render() {
const {
flexbox,
onToggleFlexItemShown,
} = this.props;
const {
flexItemShown,
highlighted,
} = flexbox;
return (
dom.div({ className: "flex-header devtools-monospace" },
flexItemShown ?
dom.button({
className: "flex-header-button-prev devtools-button",
onClick: () => onToggleFlexItemShown(),
})
:
null,
dom.div(
{
className: "flex-header-content" +
(flexItemShown ? " flex-item-shown" : "")
},
this.renderFlexContainer(),
this.renderFlexItemSelector()
),
dom.div({ className: "devtools-separator" }),
dom.input({
className: "devtools-checkbox-toggle",
checked: highlighted,
onChange: this.onFlexboxCheckboxClick,
type: "checkbox",
})
)
);
}
}
module.exports = Header;

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

@ -12,4 +12,5 @@ DevToolsModules(
'FlexItemList.js',
'FlexItemSelector.js',
'FlexItemSizingProperties.js',
'Header.js',
)

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

@ -24,6 +24,7 @@ class FlexboxInspector {
constructor(inspector, window) {
this.document = window.document;
this.inspector = inspector;
this.selection = inspector.selection;
this.store = inspector.store;
this.walker = inspector.walker;
@ -85,7 +86,7 @@ class FlexboxInspector {
this.highlighters.off("flexbox-highlighter-shown", this.onHighlighterShown);
}
this.inspector.selection.off("new-node-front", this.onUpdatePanel);
this.selection.off("new-node-front", this.onUpdatePanel);
this.inspector.sidebar.off("select", this.onSidebarSelect);
this.inspector.off("new-root", this.onUpdatePanel);
@ -96,6 +97,7 @@ class FlexboxInspector {
this.hasGetCurrentFlexbox = null;
this.inspector = null;
this.layoutInspector = null;
this.selection = null;
this.store = null;
this.walker = null;
}
@ -180,14 +182,14 @@ class FlexboxInspector {
async onReflow() {
if (!this.isPanelVisible() ||
!this.store ||
!this.inspector.selection.nodeFront ||
!this.selection.nodeFront ||
!this.hasGetCurrentFlexbox) {
return;
}
try {
const flexboxFront = await this.layoutInspector.getCurrentFlexbox(
this.inspector.selection.nodeFront);
this.selection.nodeFront);
// Clear the flexbox panel if there is no flex container for the current node
// selection.
@ -243,14 +245,14 @@ class FlexboxInspector {
onSidebarSelect() {
if (!this.isPanelVisible()) {
this.inspector.reflowTracker.untrackReflows(this, this.onReflow);
this.inspector.selection.off("new-node-front", this.onUpdatePanel);
this.inspector.off("new-root", this.onUpdatePanel);
this.selection.off("new-node-front", this.onUpdatePanel);
return;
}
this.inspector.reflowTracker.trackReflows(this, this.onReflow);
this.inspector.selection.on("new-node-front", this.onUpdatePanel);
this.inspector.on("new-root", this.onUpdatePanel);
this.selection.on("new-node-front", this.onUpdatePanel);
this.update();
}
@ -270,16 +272,21 @@ class FlexboxInspector {
}
/**
* Handler for a change in the input checkbox in the FlexItem component.
* Toggles on/off the flex item highlighter for the provided flex item element.
* Handler for a change in the input checkbox in the FlexItem and Header component.
* Toggles on/off the flex item highlighter for the provided flex item element and
* changes the selection to the given node.
*
* @param {NodeFront} node
* @param {NodeFront|null} node
* The NodeFront of the flex item element for which the flex item is toggled
* on/off for.
*/
onToggleFlexItemShown(node) {
this.highlighters.toggleFlexItemHighlighter(node);
this.store.dispatch(toggleFlexItemShown(node));
if (node) {
this.selection.setNodeFront(node);
}
}
/**
@ -307,7 +314,7 @@ class FlexboxInspector {
// selected.
if (!this.inspector ||
!this.store ||
!this.inspector.selection.nodeFront ||
!this.selection.nodeFront ||
!this.hasGetCurrentFlexbox) {
return;
}
@ -316,7 +323,7 @@ class FlexboxInspector {
// Fetch the current flexbox if no flexbox front was passed into this update.
if (!flexboxFront) {
flexboxFront = await this.layoutInspector.getCurrentFlexbox(
this.inspector.selection.nodeFront);
this.selection.nodeFront);
}
// Clear the flexbox panel if there is no flex container for the current node
@ -335,17 +342,25 @@ class FlexboxInspector {
["containerEl"]);
}
// Fetch the flex items for the given flex container and the flex item NodeFronts.
const flexItems = [];
// Fetch the flex items for the given flex container.
const flexItemFronts = await flexboxFront.getFlexItems();
const flexItems = [];
let flexItemShown = null;
for (const flexItemFront of flexItemFronts) {
// Fetch the NodeFront of the flex items.
let itemNodeFront = flexItemFront.nodeFront;
if (!itemNodeFront) {
itemNodeFront = await this.walker.getNodeFromActor(flexItemFront.actorID,
["element"]);
}
// If the current selected node is a flex item, display its flex item sizing
// properties.
if (!flexItemShown && itemNodeFront === this.selection.nodeFront) {
flexItemShown = itemNodeFront.actorID;
}
flexItems.push({
actorID: flexItemFront.actorID,
flexItemSizing: flexItemFront.flexItemSizing,
@ -363,16 +378,6 @@ class FlexboxInspector {
const customColors = await this.getCustomFlexboxColors();
const color = customColors[hostname] ? customColors[hostname] : FLEXBOX_COLOR;
const { flexbox } = this.store.getState();
let { flexItemShown } = flexbox;
// Check if the flex item shown still exists in the list of flex items, otherwise
// set the flex item shown to null.
if (flexItemShown &&
!flexItemFronts.find(item => item.nodeFront.actorID === flexItemShown)) {
flexItemShown = null;
}
this.store.dispatch(updateFlexbox({
actorID: flexboxFront.actorID,
color,

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

@ -36,11 +36,16 @@ const reducers = {
},
[TOGGLE_FLEX_ITEM_SHOWN](flexbox, { nodeFront }) {
const { flexItems } = flexbox;
const flexItemShown = flexItems.find(item => item.nodeFront === nodeFront);
let flexItemShown = null;
// Get the NodeFront actor ID of the flex item.
if (nodeFront) {
const flexItem = flexbox.flexItems.find(item => item.nodeFront === nodeFront);
flexItemShown = flexItem.nodeFront.actorID;
}
return Object.assign({}, flexbox, {
flexItemShown: flexItemShown ? flexItemShown.nodeFront.actorID : null,
flexItemShown,
});
},

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

@ -9,7 +9,6 @@ const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { translateNodeFrontToGrip } = require("devtools/client/inspector/shared/utils");
// Reps
const { REPS, MODE } = require("devtools/client/shared/components/reps/reps");
const { Rep } = REPS;
const ElementNode = REPS.ElementNode;

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

@ -9,8 +9,13 @@ const { createFactory, PureComponent } = require("devtools/client/shared/vendor/
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { connect } = require("devtools/client/shared/vendor/react-redux");
const {
getSelectorFromGrip,
translateNodeFrontToGrip,
} = require("devtools/client/inspector/shared/utils");
const { LocalizationHelper } = require("devtools/shared/l10n");
const Accordion = createFactory(require("./Accordion"));
const BoxModel = createFactory(require("devtools/client/inspector/boxmodel/components/BoxModel"));
const Flexbox = createFactory(require("devtools/client/inspector/flexbox/components/Flexbox"));
const Grid = createFactory(require("devtools/client/inspector/grids/components/Grid"));
@ -19,8 +24,6 @@ const BoxModelTypes = require("devtools/client/inspector/boxmodel/types");
const FlexboxTypes = require("devtools/client/inspector/flexbox/types");
const GridTypes = require("devtools/client/inspector/grids/types");
const Accordion = createFactory(require("./Accordion"));
const BOXMODEL_STRINGS_URI = "devtools/client/locales/boxmodel.properties";
const BOXMODEL_L10N = new LocalizationHelper(BOXMODEL_STRINGS_URI);
@ -59,6 +62,21 @@ class LayoutApp extends PureComponent {
};
}
getFlexboxHeader() {
const { flexbox } = this.props;
if (!flexbox.actorID) {
// No flex container or flex item selected.
return LAYOUT_L10N.getStr("flexbox.header");
} else if (!flexbox.flexItemShown) {
// No flex item selected.
return LAYOUT_L10N.getStr("flexbox.flexContainer");
}
const grip = translateNodeFrontToGrip(flexbox.nodeFront);
return LAYOUT_L10N.getFormatStr("flexbox.flexItemOf", getSelectorFromGrip(grip));
}
render() {
let items = [
{
@ -88,7 +106,7 @@ class LayoutApp extends PureComponent {
{
component: Flexbox,
componentProps: this.props,
header: LAYOUT_L10N.getStr("flexbox.header"),
header: this.getFlexboxHeader(),
opened: Services.prefs.getBoolPref(FLEXBOX_OPENED_PREF),
onToggled: () => {
const opened = Services.prefs.getBoolPref(FLEXBOX_OPENED_PREF);

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

@ -109,6 +109,43 @@ function createChild(parent, tagName, attributes = {}) {
return elt;
}
/**
* Returns a selector of the Element Rep from the grip. This is based on the
* getElements() function in our devtools-reps component for a ElementNode.
*
* @param {Object} grip
* Grip-like object that can be used with Reps.
* @return {String} selector of the element node.
*/
function getSelectorFromGrip(grip) {
const {
attributes,
nodeName,
isAfterPseudoElement,
isBeforePseudoElement
} = grip.preview;
if (isAfterPseudoElement || isBeforePseudoElement) {
return `::${isAfterPseudoElement ? "after" : "before"}`;
}
let selector = nodeName;
if (attributes.id) {
selector += `#${attributes.id}`;
}
if (attributes.class) {
selector += attributes.class
.trim()
.split(/\s+/)
.map(cls => `.${cls}`)
.join("");
}
return selector;
}
/**
* Log the provided error to the console and return a rejected Promise for
* this error.
@ -160,6 +197,7 @@ exports.advanceValidate = advanceValidate;
exports.appendText = appendText;
exports.blurOnMultipleProperties = blurOnMultipleProperties;
exports.createChild = createChild;
exports.getSelectorFromGrip = getSelectorFromGrip;
exports.promiseWarn = promiseWarn;
exports.throttle = throttle;
exports.translateNodeFrontToGrip = translateNodeFrontToGrip;

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

@ -107,6 +107,7 @@ devtools.jar:
skin/tooltips.css (themes/tooltips.css)
skin/images/accessibility.svg (themes/images/accessibility.svg)
skin/images/add.svg (themes/images/add.svg)
skin/images/arrowhead-left.svg (themes/images/arrowhead-left.svg)
skin/images/arrowhead-down.svg (themes/images/arrowhead-down.svg)
skin/images/arrowhead-up.svg (themes/images/arrowhead-up.svg)
skin/images/breadcrumbs-divider.svg (themes/images/breadcrumbs-divider.svg)

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

@ -19,9 +19,10 @@ collapsePanes=Collapse panes
copyToClipboard.label=Copy to clipboard
copyToClipboard.accesskey=C
# LOCALIZATION NOTE (copySource): This is the text that appears in the
# LOCALIZATION NOTE (copySource.label): This is the text that appears in the
# context menu to copy the selected source of file open.
copySource=Copy
copySource.label=Copy source text
copySource.accesskey=y
# LOCALIZATION NOTE (copySourceUri2): This is the text that appears in the
@ -261,6 +262,10 @@ sourceSearch.search.key2=CmdOrCtrl+F
# the source search input bar
sourceSearch.search.placeholder=Search in file…
# LOCALIZATION NOTE (sourceSearch.search.placeholder2): placeholder text in
# the source search input bar
sourceSearch.search.placeholder2=Find in file…
# LOCALIZATION NOTE (sourceSearch.search.again.key2): Key shortcut to highlight
# the next occurrence of the last search triggered from a source search
# Do not localize "CmdOrCtrl+G", or change the format of the string. These are
@ -305,6 +310,10 @@ searchPanelGlobal=Search in all files (%S)
# filter panel popup for the function search operation.
searchPanelFunction=Search for function definition (%S)
# LOCALIZATION NOTE (searchPanelFunction2): This is the text that appears in the
# filter panel popup for the function search operation.
searchPanelFunction2=Find function definition (%S)
# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the
# filter panel popup for the token search operation.
searchPanelToken=Find in this file (%S)
@ -496,6 +505,7 @@ expressions.placeholder=Add watch expression
expressions.errorMsg=Invalid expression…
expressions.label=Add watch expression
expressions.accesskey=e
expressions.key=CmdOrCtrl+Shift+E
# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item
# for closing the selected tab below the mouse.
@ -617,11 +627,21 @@ watchExpressions.refreshButton=Refresh
# a mac we use the unicode character.
welcome.search=%S to search for sources
# LOCALIZATION NOTE (welcome.search2): The center pane welcome panel's
# search prompt. e.g. cmd+p to search for files. On windows, it's ctrl, on
# a mac we use the unicode character.
welcome.search2=%S Go to file
# LOCALIZATION NOTE (welcome.findInFiles): The center pane welcome panel's
# search prompt. e.g. cmd+f to search for files. On windows, it's ctrl+shift+f, on
# a mac we use the unicode character.
welcome.findInFiles=%S to find in files
# LOCALIZATION NOTE (welcome.findInFiles2): The center pane welcome panel's
# search prompt. e.g. cmd+f to search for files. On windows, it's ctrl+shift+f, on
# a mac we use the unicode character.
welcome.findInFiles2=%S Find in files
# LOCALIZATION NOTE (welcome.searchFunction): Label displayed in the welcome
# panel. %S is replaced by the keyboard shortcut to search for functions.
welcome.searchFunction=%S to search for functions in file
@ -630,6 +650,10 @@ welcome.searchFunction=%S to search for functions in file
# prompt for searching for files.
sourceSearch.search=Search sources…
# LOCALIZATION NOTE (sourceSearch.search2): The center pane Source Search
# prompt for searching for files.
sourceSearch.search2=Go to file…
# LOCALIZATION NOTE (sourceSearch.noResults2): The center pane Source Search
# message when the query did not match any of the sources.
sourceSearch.noResults2=No results found
@ -904,6 +928,10 @@ shortcuts.stepOut=Step Out
# keyboard shortcut action for source file search
shortcuts.fileSearch=Source File Search
# LOCALIZATION NOTE (shortcuts.fileSearch2): text describing
# keyboard shortcut action for source file search
shortcuts.fileSearch2=Go to file
# LOCALIZATION NOTE (shortcuts.gotoLine): text describing
# keyboard shortcut for jumping to a specific line
shortcuts.gotoLine=Go to line
@ -912,14 +940,26 @@ shortcuts.gotoLine=Go to line
# keyboard shortcut action for searching again
shortcuts.searchAgain=Search Again
# LOCALIZATION NOTE (shortcuts.searchAgain2): text describing
# keyboard shortcut action for searching again
shortcuts.searchAgain2=Find next
# LOCALIZATION NOTE (shortcuts.projectSearch): text describing
# keyboard shortcut action for full project search
shortcuts.projectSearch=Full Project Search
# LOCALIZATION NOTE (shortcuts.projectSearch2): text describing
# keyboard shortcut action for full project search
shortcuts.projectSearch2=Find in files
# LOCALIZATION NOTE (shortcuts.functionSearch): text describing
# keyboard shortcut action for function search
shortcuts.functionSearch=Function Search
# LOCALIZATION NOTE (shortcuts.functionSearch2): text describing
# keyboard shortcut action for function search
shortcuts.functionSearch2=Find function
# LOCALIZATION NOTE (shortcuts.buttonName): text describing
# keyboard shortcut button text
shortcuts.buttonName=Keyboard shortcuts

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

@ -5,9 +5,18 @@
# LOCALIZATION NOTE This file contains the Layout Inspector strings.
# The Layout Inspector is a panel accessible in the Inspector sidebar.
# LOCALIZATION NOTE (flexbox.header): The accordion header for the Flexbox pane.
# LOCALIZATION NOTE (flexbox.header): The accordion header for the Flexbox panel when
# no flex container or item is selected.
flexbox.header=Flexbox
# LOCALIZATION (flexbox.flexContainer): The accordion header for the Flexbox panel
# when a flex container is selected.
flexbox.flexContainer=Flex Container
# LOCALIZATION NOTE) (flexbox.flexItemOf): The accordion header for the Flexbox panel
# when a flex item is selected. %s represents the flex container selector.
flexbox.flexItemOf=Flex Item of %s
# LOCALIZATION NOTE (flexbox.noFlexboxeOnThisPage): In the case where there are no CSS
# flex containers to display.
flexbox.noFlexboxeOnThisPage=Select a Flex container or item to continue.
@ -29,22 +38,22 @@ layout.cannotShowGridOutline=Cannot show outline for this grid
layout.cannotShowGridOutline.title=The selected grids outline cannot effectively fit inside the layout panel for it to be usable.
# LOCALIZATION NOTE (layout.displayAreaNames): Label of the display area names setting
# option in the CSS Grid pane.
# option in the CSS Grid panel.
layout.displayAreaNames=Display area names
# LOCALIZATION NOTE (layout.displayLineNumbers): Label of the display line numbers
# setting option in the CSS Grid pane.
# setting option in the CSS Grid panel.
layout.displayLineNumbers=Display line numbers
# LOCALIZATION NOTE (layout.extendLinesInfinitely): Label of the extend lines
# infinitely setting option in the CSS Grid pane.
# infinitely setting option in the CSS Grid panel.
layout.extendLinesInfinitely=Extend lines infinitely
# LOCALIZATION NOTE (layout.header): The accordion header for the CSS Grid pane.
# LOCALIZATION NOTE (layout.header): The accordion header for the CSS Grid panel.
layout.header=Grid
# LOCALIZATION NOTE (layout.gridDisplaySettings): The header for the grid display
# settings container in the CSS Grid pane.
# settings container in the CSS Grid panel.
layout.gridDisplaySettings=Grid Display Settings
# LOCALIZATION NOTE (layout.noGridsOnThisPage): In the case where there are no CSS grid
@ -52,7 +61,7 @@ layout.gridDisplaySettings=Grid Display Settings
layout.noGridsOnThisPage=CSS Grid is not in use on this page
# LOCALIZATION NOTE (layout.overlayMultipleGrids): The header for the list of grid
# container elements that can be highlighted in the CSS Grid pane.
# container elements that can be highlighted in the CSS Grid panel.
layout.overlayMultipleGrids=Overlay Multiple Grids
# LOCALIZATION NOTE (layout.overlayGrid): Alternate header for the list of grid container

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

@ -67,14 +67,14 @@ pref("devtools.inspector.fonthighlighter.enabled", true);
pref("devtools.inspector.changes.enabled", false);
// Flexbox preferences
// Enable the Flexbox highlighter in Nightly
// Enable the Flexbox highlighter and inspector panel in Nightly
#if defined(NIGHTLY_BUILD)
pref("devtools.inspector.flexboxHighlighter.enabled", true);
pref("devtools.flexboxinspector.enabled", true);
#else
pref("devtools.inspector.flexboxHighlighter.enabled", false);
#endif
// Enable the Flexbox Inspector panel
pref("devtools.flexboxinspector.enabled", false);
#endif
// Grid highlighter preferences
pref("devtools.gridinspector.gridOutlineMaxColumns", 50);

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

@ -221,6 +221,7 @@ html[dir="rtl"] .tree-node img.arrow {
padding: 0 2px;
}
.objectBox-accessible.clickable,
.objectBox-node.clickable {
cursor: pointer;
}
@ -246,6 +247,7 @@ html[dir="rtl"] .tree-node img.arrow {
color: var(--comment-node-color);
}
.accessible-role,
.tag-name {
color: var(--object-color);
}
@ -322,8 +324,9 @@ html[dir="rtl"] .tree-node img.arrow {
}
/******************************************************************************/
/* Open DOMNode in inspector button */
/* Open DOMNode in inspector or Accessible in accessibility inspector button */
button.open-accessibility-inspector,
button.open-inspector {
mask: url("chrome://devtools/skin/images/devtools-reps/open-inspector.svg") no-repeat;
display: inline-block;
@ -334,8 +337,10 @@ button.open-inspector {
cursor: pointer;
}
.objectBox-accessible:hover .open-accessibility-inspector,
.objectBox-node:hover .open-inspector,
.objectBox-textNode:hover .open-inspector,
.open-accessibility-inspector:hover,
.open-inspector:hover {
background-color: var(--theme-highlight-blue);
}

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

@ -655,6 +655,7 @@ const NaNRep = __webpack_require__(3679);
const Accessor = __webpack_require__(3680);
// DOM types (grips)
const Accessible = __webpack_require__(3787);
const Attribute = __webpack_require__(3681);
const DateTime = __webpack_require__(3682);
const Document = __webpack_require__(3683);
@ -679,7 +680,7 @@ const Grip = __webpack_require__(3656);
// List of all registered template.
// XXX there should be a way for extensions to register a new
// or modify an existing rep.
const reps = [RegExp, StyleSheet, Event, DateTime, CommentNode, ElementNode, TextNode, Attribute, Func, PromiseRep, ArrayRep, Document, DocumentType, Window, ObjectWithText, ObjectWithURL, ErrorRep, GripArray, GripMap, GripMapEntry, Grip, Undefined, Null, StringRep, Number, SymbolRep, InfinityRep, NaNRep, Accessor, Obj];
const reps = [RegExp, StyleSheet, Event, DateTime, CommentNode, Accessible, ElementNode, TextNode, Attribute, Func, PromiseRep, ArrayRep, Document, DocumentType, Window, ObjectWithText, ObjectWithURL, ErrorRep, GripArray, GripMap, GripMapEntry, Grip, Undefined, Null, StringRep, Number, SymbolRep, InfinityRep, NaNRep, Accessor, Obj];
/**
* Generic rep that is used for rendering native JS types or an object.
@ -730,6 +731,7 @@ function getRep(object, defaultRep = Grip, noGrip = false) {
module.exports = {
Rep,
REPS: {
Accessible,
Accessor,
ArrayRep,
Attribute,
@ -969,8 +971,7 @@ function getLinkifiedElements(text, cropLimit, openLink) {
if (currentIndex !== text.length) {
let nonUrlText = text.slice(currentIndex, text.length);
if (currentIndex < endCropIndex) {
const cutIndex = endCropIndex - currentIndex;
nonUrlText = nonUrlText.substring(cutIndex);
nonUrlText = getCroppedString(nonUrlText, currentIndex, startCropIndex, endCropIndex);
}
items.push(nonUrlText);
}
@ -6944,6 +6945,128 @@ module.exports = reducer;
module.exports = __webpack_require__(3655);
/***/ }),
/***/ 3787:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* 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/>. */
// ReactJS
const PropTypes = __webpack_require__(3642);
const { button, span } = __webpack_require__(3643);
// Utils
const { isGrip, wrapRender } = __webpack_require__(3644);
const { rep: StringRep } = __webpack_require__(3648);
/**
* Renders Accessible object.
*/
Accessible.propTypes = {
object: PropTypes.object.isRequired,
inspectIconTitle: PropTypes.string,
nameMaxLength: PropTypes.number,
onAccessibleClick: PropTypes.func,
onAccessibleMouseOver: PropTypes.func,
onAccessibleMouseOut: PropTypes.func,
onInspectIconClick: PropTypes.func,
separatorText: PropTypes.string
};
function Accessible(props) {
const {
object,
inspectIconTitle,
nameMaxLength,
onAccessibleClick,
onAccessibleMouseOver,
onAccessibleMouseOut,
onInspectIconClick,
separatorText
} = props;
const elements = getElements(object, nameMaxLength, separatorText);
const isInTree = object.preview && object.preview.isConnected === true;
const baseConfig = {
"data-link-actor-id": object.actor,
className: "objectBox objectBox-accessible"
};
let inspectIcon;
if (isInTree) {
if (onAccessibleClick) {
Object.assign(baseConfig, {
onClick: _ => onAccessibleClick(object),
className: `${baseConfig.className} clickable`
});
}
if (onAccessibleMouseOver) {
Object.assign(baseConfig, {
onMouseOver: _ => onAccessibleMouseOver(object)
});
}
if (onAccessibleMouseOut) {
Object.assign(baseConfig, {
onMouseOut: onAccessibleMouseOut
});
}
if (onInspectIconClick) {
inspectIcon = button({
className: "open-accessibility-inspector",
title: inspectIconTitle,
onClick: e => {
if (onAccessibleClick) {
e.stopPropagation();
}
onInspectIconClick(object, e);
}
});
}
}
return span(baseConfig, ...elements, inspectIcon);
}
function getElements(grip, nameMaxLength, separatorText = ": ") {
const { name, role } = grip.preview;
const elements = [];
elements.push(span({ className: "accessible-role" }, role));
if (name) {
elements.push(span({ className: "separator" }, separatorText), StringRep({
className: "accessible-name",
object: name,
cropLimit: nameMaxLength
}));
}
return elements;
}
// Registration
function supportsObject(object, noGrip = false) {
if (noGrip === true || !isGrip(object)) {
return false;
}
return object.preview && object.typeName && object.typeName === "accessible";
}
// Exports from this module
module.exports = {
rep: wrapRender(Accessible),
supportsObject
};
/***/ })
/******/ });

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

@ -622,8 +622,8 @@ function WorkerDispatcher() {
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
WorkerDispatcher.prototype = {
start(url) {
this.worker = new Worker(url);
start(url, win = window) {
this.worker = new win.Worker(url);
this.worker.onerror = () => {
console.error(`Error in worker ${url}`);
};

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

@ -557,8 +557,8 @@ function WorkerDispatcher() {
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
WorkerDispatcher.prototype = {
start(url) {
this.worker = new Worker(url);
start(url, win = window) {
this.worker = new win.Worker(url);
this.worker.onerror = () => {
console.error(`Error in worker ${url}`);
};
@ -1987,11 +1987,10 @@ const {
getOriginalSourceText,
getLocationScopes,
hasMappedSource,
clearSourceMaps,
applySourceMap
} = __webpack_require__(3710);
const { clearSourceMaps } = __webpack_require__(3704);
const { getOriginalStackFrames } = __webpack_require__(3783);
const {
@ -2040,7 +2039,7 @@ const { fetchSourceMap } = __webpack_require__(3718);
const {
getSourceMap,
setSourceMap,
clearSourceMaps
clearSourceMaps: clearSourceMapsRequests
} = __webpack_require__(3704);
const {
originalToGeneratedId,
@ -2049,6 +2048,7 @@ const {
isOriginalId,
getContentType
} = __webpack_require__(3652);
const { clearWasmXScopes } = __webpack_require__(3788);
async function getOriginalURLs(generatedSource) {
const map = await fetchSourceMap(generatedSource);
@ -2294,6 +2294,11 @@ function applySourceMap(generatedId, url, code, mappings) {
setSourceMap(generatedId, Promise.resolve(map));
}
function clearSourceMaps() {
clearSourceMapsRequests();
clearWasmXScopes();
}
module.exports = {
getOriginalURLs,
getOriginalRanges,
@ -4351,6 +4356,11 @@ async function _resolveAndFetch(generatedSource) {
let map = new SourceMapConsumer(fetched.content, baseURL);
if (generatedSource.isWasm) {
map = new WasmRemap(map);
// Check if experimental scope info exists.
if (fetched.content.includes("x-scopes")) {
const parsedJSON = JSON.parse(fetched.content);
map.xScopes = parsedJSON["x-scopes"];
}
}
return map;
@ -4514,14 +4524,27 @@ module.exports = __webpack_require__(3709);
"use strict";
const { getWasmXScopes } = __webpack_require__(3788);
// Returns expanded stack frames details based on the generated location.
// The function return null if not information was found.
/* 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/>. */
async function getOriginalStackFrames(generatedLocation) {
// Reserved for experemental source maps formats.
return null;
} /* 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/>. */
const wasmXScopes = await getWasmXScopes(generatedLocation.sourceId);
if (!wasmXScopes) {
return null;
}
const scopes = wasmXScopes.search(generatedLocation);
if (scopes.length === 0) {
console.warn("Something wrong with debug data: none original frames found");
return null;
}
return scopes;
}
module.exports = {
getOriginalStackFrames
@ -4549,7 +4572,7 @@ function convertDwarf(wasm, instance) {
const wasmPtr = alloc_mem(wasm.byteLength);
new Uint8Array(memory.buffer, wasmPtr, wasm.byteLength).set(new Uint8Array(wasm));
const resultPtr = alloc_mem(12);
const enableXScopes = false;
const enableXScopes = true;
convert_dwarf(wasmPtr, wasm.byteLength, resultPtr, resultPtr + 4, enableXScopes);
free_mem(wasmPtr);
const resultView = new DataView(memory.buffer, resultPtr, 12);
@ -4580,6 +4603,160 @@ module.exports = {
convertToJSON
};
/***/ }),
/***/ 3788:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
const { getSourceMap } = __webpack_require__(3704); /* 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/>. */
/* eslint camelcase: 0*/
const { generatedToOriginalId } = __webpack_require__(3652);
const xScopes = new Map();
function indexLinkingNames(items) {
const result = new Map();
let queue = [...items];
while (queue.length > 0) {
const item = queue.shift();
if ("linkage_name" in item) {
result.set(item.linkage_name, item);
}
if ("children" in item) {
queue = [...queue, ...item.children];
}
}
return result;
}
async function getXScopes(sourceId) {
if (xScopes.has(sourceId)) {
return xScopes.get(sourceId);
}
const map = await getSourceMap(sourceId);
if (!map || !map.xScopes) {
xScopes.set(sourceId, null);
return null;
}
const { code_section_offset, debug_info } = map.xScopes;
const xScope = {
code_section_offset,
debug_info,
idIndex: indexLinkingNames(debug_info),
sources: map.sources
};
xScopes.set(sourceId, xScope);
return xScope;
}
function isInRange(item, pc) {
if ("ranges" in item) {
return item.ranges.some(r => r[0] <= pc && pc < r[1]);
}
if ("high_pc" in item) {
return item.low_pc <= pc && pc < item.high_pc;
}
return false;
}
function filterScopes(items, pc, lastItem, index) {
if (!items) {
return [];
}
return items.reduce((result, item) => {
switch (item.tag) {
case "compile_unit":
if (isInRange(item, pc)) {
result = [...result, ...filterScopes(item.children, pc, lastItem, index)];
}
break;
case "namespace":
case "structure_type":
case "union_type":
result = [...result, ...filterScopes(item.children, pc, lastItem, index)];
break;
case "subprogram":
if (isInRange(item, pc)) {
const s = {
id: item.linkage_name,
name: item.name
};
result = [...result, s, ...filterScopes(item.children, pc, s, index)];
}
break;
case "inlined_subroutine":
if (isInRange(item, pc)) {
const linkedItem = index.get(item.abstract_origin);
const s = {
id: item.abstract_origin,
name: linkedItem ? linkedItem.name : void 0
};
if (lastItem) {
lastItem.file = item.call_file;
lastItem.line = item.call_line;
}
result = [...result, s, ...filterScopes(item.children, pc, s, index)];
}
break;
}
return result;
}, []);
}
class XScope {
constructor(xScopeData) {
this.xScope = xScopeData;
}
search(generatedLocation) {
const { code_section_offset, debug_info, sources, idIndex } = this.xScope;
const pc = generatedLocation.line - (code_section_offset || 0);
const scopes = filterScopes(debug_info, pc, null, idIndex);
scopes.reverse();
return scopes.map(i => {
if (!("file" in i)) {
return {
displayName: i.name || ""
};
}
const sourceId = generatedToOriginalId(generatedLocation.sourceId, sources[i.file || 0]);
return {
displayName: i.name || "",
location: {
line: i.line || 0,
sourceId
}
};
});
}
}
async function getWasmXScopes(sourceId) {
const xScopeData = await getXScopes(sourceId);
if (!xScopeData) {
return null;
}
return new XScope(xScopeData);
}
function clearWasmXScopes() {
xScopes.clear();
}
module.exports = {
getWasmXScopes,
clearWasmXScopes
};
/***/ })
/******/ });

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

@ -0,0 +1,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/. -->
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="context-fill #0C0C0D" fill-rule="evenodd" clip-rule="evenodd" d="M15.707 4.293a1 1 0 0 1 0 1.414L9.414 12l6.293 6.293a1 1 0 1 1-1.414 1.414l-7-7a1 1 0 0 1 0-1.414l7-7a1 1 0 0 1 1.414 0z"></path>
</svg>

После

Ширина:  |  Высота:  |  Размер: 524 B

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

@ -2,14 +2,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/. */
:root {
--flex-item-selector-wrapper-border-color: var(--theme-content-color3);
}
:root.theme-dark {
--flex-item-selector-wrapper-border-color: var(--theme-content-color1);
}
#layout-container {
height: 100%;
width: 100%;
@ -97,10 +89,34 @@
flex-direction: column;
}
.flex-container {
/**
* Header
*/
.flex-header {
display: flex;
align-items: center;
height: 32px;
border-bottom: 1px solid var(--theme-splitter-color);
padding: 5px 0;
padding: 0 3px;
}
.flex-header-button-prev::before {
background-image: url("chrome://devtools/skin/images/arrowhead-left.svg");
background-size: 16px;
}
.flex-header-content {
flex: 1;
padding-top: 2px;
padding-inline-start: 20px;
-moz-user-select: none;
}
.flex-header-content.flex-item-shown {
display: flex;
justify-content: center;
padding: 0;
}
/**
@ -124,24 +140,6 @@
* Flex Item Selector
*/
.flex-item-selector-wrapper {
margin-inline-start: 25px;
position: relative;
}
.flex-item-selector-wrapper::before {
position: absolute;
left: -12px;
top: 3px;
content: '';
display: block;
border-left: 0.5px solid var(--flex-item-selector-wrapper-border-color);
height: 0.8em;
border-bottom: 0.5px solid var(--flex-item-selector-wrapper-border-color);
width: 10px;
}
#flex-item-selector {
background-position: right 4px center;
padding-left: 0;

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

@ -19,14 +19,14 @@ const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test-closure-optimized-out.html";
add_task(async function() {
const breakpointLine = 18;
const hud = await openNewTabAndConsole(TEST_URI);
await openDebugger();
const toolbox = gDevTools.getToolbox(hud.target);
const dbg = createDebuggerContext(toolbox);
await addBreakpoint(dbg, "test-closure-optimized-out.html", 18);
await waitForThreadEvents(dbg, "resumed");
await addBreakpoint(dbg, "test-closure-optimized-out.html", breakpointLine);
// Cause the debuggee to pause
await pauseDebugger(dbg);
@ -50,7 +50,7 @@ add_task(async function() {
info("Remove the breakpoint");
const source = findSource(dbg, "test-closure-optimized-out.html");
await removeBreakpoint(dbg, source.id, 18);
await removeBreakpoint(dbg, source.id, breakpointLine);
});
async function pauseDebugger(dbg) {

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

@ -51,6 +51,7 @@
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/ServiceWorkerInterceptController.h"
#include "mozilla/dom/ServiceWorkerUtils.h"
#include "mozilla/dom/SessionStorageManager.h"
#include "mozilla/dom/TabChild.h"
#include "mozilla/dom/TabGroup.h"
#include "mozilla/dom/ToJSValue.h"
@ -2467,8 +2468,7 @@ nsDocShell::TopSessionStorageManager()
}
if (!mSessionStorageManager) {
mSessionStorageManager =
do_CreateInstance("@mozilla.org/dom/sessionStorage-manager;1");
mSessionStorageManager = new SessionStorageManager();
}
return mSessionStorageManager;

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

@ -21,21 +21,6 @@
#define NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID \
{ 0xfc886801, 0xe768, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
#define NS_HTMLDOCUMENT_CID \
{ /* 5d0fcdd0-4daa-11d2-b328-00805f8a3859 */ \
0x5d0fcdd0, 0x4daa, 0x11d2, \
{0xb3, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0x38, 0x59}}
#define NS_XMLDOCUMENT_CID \
{ /* a6cf9063-15b3-11d2-932e-00805f8add32 */ \
0xa6cf9063, 0x15b3, 0x11d2, \
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
#define NS_IMAGEDOCUMENT_CID \
{ /* e11a6080-4daa-11d2-b328-00805f8a3859 */ \
0xe11a6080, 0x4daa, 0x11d2, \
{0xb3, 0x28, 0x00, 0x80, 0x5f, 0x8a, 0x38, 0x59}}
// {e7ba1480-1dea-11d3-830f-00104bed045e}
#define NS_TEXT_ENCODER_CID \
{ 0xe7ba1480, 0x1dea, 0x11d3, {0x83, 0x0f, 0x00, 0x10, 0x4b, 0xed, 0x04, 0x5e} }
@ -117,20 +102,6 @@
#define NS_XULTREEBUILDER_CID \
{ 0x1abdcc96, 0x1dd2, 0x11b2, { 0xb5, 0x20, 0xf8, 0xf5, 0x9c, 0xdd, 0x67, 0xbc } }
// {541AFCB2-A9A3-11d2-8EC5-00805F29F370}
#define NS_XULDOCUMENT_CID \
{ 0x541afcb2, 0xa9a3, 0x11d2, { 0x8e, 0xc5, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } }
#define NS_SVGDOCUMENT_CID \
{ /* b7f44954-1dd1-11b2-8c2e-c2feab4186bc */ \
0xb7f44954, 0x11d1, 0x11b2, \
{0x8c, 0x2e, 0xc2, 0xfe, 0xab, 0x41, 0x86, 0xbc}}
// {d899a152-9412-46b2-b651-2e71c5c2f05f}
#define NS_VIDEODOCUMENT_CID \
{ 0xd899a152, 0x9412, 0x46b2, \
{ 0xb6, 0x51, 0x2e, 0x71, 0xc5, 0xc2, 0xf0, 0x5f } }
#define NS_EVENTLISTENERSERVICE_CID \
{ /* baa34652-f1f1-4185-b224-244ee82a413a */ \
0xbaa34652, 0xf1f1, 0x4185, \
@ -159,10 +130,6 @@
#define NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID \
"@mozilla.org/childprocessmessagemanager;1"
// {f96f5ec9-755b-447e-b1f3-717d1a84bb41}
#define NS_PLUGINDOCUMENT_CID \
{ 0xf96f5ec9, 0x755b, 0x447e, { 0xb1, 0xf3, 0x71, 0x7d, 0x1a, 0x84, 0xbb, 0x41 } }
// {08c6cc8b-cfb0-421d-b1f7-683ff2989681}
#define THIRDPARTYUTIL_CID \
{0x08c6cc8b, 0xcfb0, 0x421d, {0xb1, 0xf7, 0x68, 0x3f, 0xf2, 0x98, 0x96, 0x81}}

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

@ -554,6 +554,21 @@ FileReader::ClearProgressEventTimer()
}
}
void
FileReader::FreeFileData()
{
if (mFileData) {
if (mDataFormat == FILE_AS_ARRAYBUFFER) {
js_free(mFileData);
} else {
free(mFileData);
}
mFileData = nullptr;
}
mDataLen = 0;
}
void
FileReader::FreeDataAndDispatchSuccess()
{

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

@ -164,12 +164,7 @@ private:
void OnLoadEndArrayBuffer();
void FreeFileData()
{
free(mFileData);
mFileData = nullptr;
mDataLen = 0;
}
void FreeFileData();
nsresult IncreaseBusyCounter();
void DecreaseBusyCounter();

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

@ -12,8 +12,7 @@ webidl Storage;
/**
* General purpose interface that has two implementations, for localStorage
* resp. sessionStorage with "@mozilla.org/dom/localStorage-manager;1" resp.
* "@mozilla.org/dom/sessionStorage-manager;1" contract IDs.
* with "@mozilla.org/dom/localStorage-manager;1".
*/
[scriptable, uuid(a20c742e-3ed1-44fb-b897-4080a75b1662)]
interface nsIDOMStorageManager : nsISupports

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

@ -617,6 +617,8 @@ ContentParent::PreallocateProcess()
eNotRecordingOrReplaying,
/* aRecordingFile = */ EmptyString());
PreallocatedProcessManager::AddBlocker(process);
if (!process->LaunchSubprocess(PROCESS_PRIORITY_PREALLOC)) {
return nullptr;
}
@ -882,7 +884,6 @@ ContentParent::GetNewOrUsedBrowserProcess(Element* aFrameElement,
PreallocatedProcessManager::AddBlocker(p);
if (!p->LaunchSubprocess(aPriority)) {
PreallocatedProcessManager::RemoveBlocker(p);
return nullptr;
}
@ -1758,10 +1759,6 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
// finish waiting in the xpcom-shutdown/profile-before-change observer.
mIPCOpen = false;
// RemoveBlocker is idempotent, and this may have been destroyed
// after launch but before RecvFirstIdle.
PreallocatedProcessManager::RemoveBlocker(this);
if (mHangMonitorActor) {
ProcessHangMonitor::RemoveProcess(mHangMonitorActor);
mHangMonitorActor = nullptr;

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

@ -212,9 +212,7 @@ void
PreallocatedProcessManagerImpl::RemoveBlocker(ContentParent* aParent)
{
uint64_t childID = aParent->ChildID();
// This does not assert that the entry existed so that removal is
// idempotent; this makes it easier to handle error cases and
// preallocated processes themselves (which aren't blockers).
MOZ_ASSERT(mBlockers.Contains(childID));
mBlockers.RemoveEntry(childID);
if (!mPreallocatedProcess && mBlockers.IsEmpty()) {
AllocateAfterDelay();

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

@ -55,7 +55,7 @@ skip-if = os == 'linux' && debug # Bug 1389983
[test_getUserMedia_audioConstraints.html]
skip-if = os == 'mac' || os == 'win' || toolkit == 'android' # Bug 1404995, no loopback devices on some platforms
[test_getUserMedia_audioConstraints_concurrentIframes.html]
skip-if = os == 'mac' || os == 'win' || toolkit == 'android' # Bug 1404995, no loopback devices on some platforms
skip-if = os == 'mac' || os == 'win' || toolkit == 'android' || (os == 'linux' && debug) # Bug 1404995, no loopback devices on some platforms # Bug 1481101
[test_getUserMedia_audioConstraints_concurrentStreams.html]
skip-if = os == 'mac' || os == 'win' || toolkit == 'android' # Bug 1404995, no loopback devices on some platforms
[test_getUserMedia_basicAudio_loopback.html]

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

@ -42,7 +42,7 @@ NO_PGO = True
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
RCFILE = 'nptest.rc'
RESFILE = 'nptest.res'
DEFFILE = SRCDIR + '/nptest.def'
DEFFILE = 'nptest.def'
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' and '64' in CONFIG['OS_TEST']:
OS_LIBS += ['-framework Carbon']

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

@ -15,6 +15,7 @@
#include "nsNetUtil.h"
#include "nsQueryObject.h"
#include "mozilla/dom/nsCSPUtils.h"
#include "mozilla/NullPrincipal.h"
using namespace mozilla;
@ -255,12 +256,14 @@ FramingChecker::CheckFrameOptions(nsIChannel* aChannel,
nsCOMPtr<nsIWebNavigation> webNav(do_QueryObject(aDocShell));
if (webNav) {
nsCOMPtr<nsILoadInfo> loadInfo = httpChannel->GetLoadInfo();
nsCOMPtr<nsIPrincipal> triggeringPrincipal = loadInfo
? loadInfo->TriggeringPrincipal()
: nsContentUtils::GetSystemPrincipal();
MOZ_ASSERT(loadInfo);
RefPtr<NullPrincipal> principal =
NullPrincipal::CreateWithInheritedAttributes(
loadInfo->TriggeringPrincipal());
webNav->LoadURI(NS_LITERAL_STRING("about:blank"),
0, nullptr, nullptr, nullptr,
triggeringPrincipal);
principal);
}
}
return false;

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

@ -33,7 +33,7 @@ function checkFinished() {
// 1) test XFO with CSP
var csp_testframe = document.getElementById("csp_testframe");
csp_testframe.onload = function() {
var msg = csp_testframe.contentWindow.document.getElementById("cspmessage");
var msg = csp_testframe.contentDocument.getElementById("cspmessage");
is(msg.innerHTML, "Ignoring XFO because of CSP", "Loading frame with with XFO and CSP");
checkFinished();
}
@ -45,8 +45,7 @@ csp_testframe.src = "file_ignore_xfo.html";
// 2) test XFO with CSP_RO
var csp_ro_testframe = document.getElementById("csp_ro_testframe");
csp_ro_testframe.onload = function() {
var msg = csp_ro_testframe.contentWindow.document.getElementById("cspmessage");
is(msg, null, "Blocking frame with with XFO and CSP_RO");
is(csp_ro_testframe.contentDocument, null, "Blocking frame with with XFO and CSP_RO");
checkFinished();
}
csp_ro_testframe.onerror = function() {

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

@ -15,6 +15,7 @@ EXPORTS.mozilla.dom += [
'StorageActivityService.h',
'StorageIPC.h',
'StorageNotifierService.h',
'StorageObserver.h',
'StorageUtils.h',
]

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