Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,29 @@
From 10cfdcc905915d8814c609008a069102f2bc7e39 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Tue, 27 Oct 2015 16:02:19 +0200
Subject: [PATCH] FindGObjectIntrospection.cmake: prefix variables obtained
from pkg-config with PKG_CONFIG_SYSROOT_DIR
See discussion at https://bugs.webkit.org/show_bug.cgi?id=232933 for
reasons why this is not approproiate for upstream submission.
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
Source/cmake/FindGI.cmake | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Source/cmake/FindGI.cmake b/Source/cmake/FindGI.cmake
index af039cbb..b3e810cd 100644
--- a/Source/cmake/FindGI.cmake
+++ b/Source/cmake/FindGI.cmake
@@ -72,6 +72,9 @@ if (PKG_CONFIG_FOUND)
endif ()
endif ()
+set(_GI_SCANNER_EXE "$ENV{PKG_CONFIG_SYSROOT_DIR}${_GI_SCANNER_EXE}")
+set(_GI_COMPILER_EXE "$ENV{PKG_CONFIG_SYSROOT_DIR}${_GI_COMPILER_EXE}")
+
find_program(GI_SCANNER_EXE NAMES ${_GI_SCANNER_EXE} g-ir-scanner)
find_program(GI_COMPILER_EXE NAMES ${_GI_COMPILER_EXE} g-ir-compiler)
@@ -0,0 +1,28 @@
From cd65e3d9256a4f6eb7906a9f10678c29a4ffef2f Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Mon, 26 Jun 2023 14:30:02 +0200
Subject: [PATCH] Source/JavaScriptCore/CMakeLists.txt: ensure reproducibility
of __TIMESTAMP__
__TIMESTAMP__ refers to mtime of the file that contains it, which is unstable
and breaks binary reproducibility when the file is generated at build time. To ensure
this does not happen, mtime should be set from the original file.
Upstream-Status: Submitted [https://github.com/WebKit/WebKit/pull/15293]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
Source/JavaScriptCore/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index 43dc22ff..c2e3b1cd 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -159,6 +159,7 @@ add_custom_command(
OUTPUT ${JavaScriptCore_DERIVED_SOURCES_DIR}/JSCBytecodeCacheVersion.cpp
MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/runtime/JSCBytecodeCacheVersion.cpp.in
COMMAND ${PERL_EXECUTABLE} -pe s/CACHED_TYPES_CKSUM/__TIMESTAMP__/ ${JAVASCRIPTCORE_DIR}/runtime/JSCBytecodeCacheVersion.cpp.in > ${JavaScriptCore_DERIVED_SOURCES_DIR}/JSCBytecodeCacheVersion.cpp
+ COMMAND touch -r ${JAVASCRIPTCORE_DIR}/runtime/JSCBytecodeCacheVersion.cpp.in ${JavaScriptCore_DERIVED_SOURCES_DIR}/JSCBytecodeCacheVersion.cpp
VERBATIM
)
@@ -0,0 +1,310 @@
From 647c93de99a0f71f478d76a4cc7714eba7ba1447 Mon Sep 17 00:00:00 2001
From: Adrian Perez de Castro <aperez@igalia.com>
Date: Thu, 2 Jun 2022 11:19:06 +0300
Subject: [PATCH] FELightningNEON.cpp fails to build, NEON fast path seems
unused https://bugs.webkit.org/show_bug.cgi?id=241182
Reviewed by NOBODY (OOPS!).
Move the NEON fast path for the SVG lighting filter effects into
FELightingSoftwareApplier, and arrange to actually use them by
forwarding calls to applyPlatformGeneric() into applyPlatformNeon().
Some changes were needed to adapt platformApplyNeon() to the current
state of filters after r286140. This was not detected because the code
bitrotted due to it being guarded with CPU(ARM_TRADITIONAL), which does
not get used much these days: CPU(ARM_THUMB2) is more common. It should
be possible to use the NEON fast paths also in Thumb mode, but that is
left for a follow-up fix.
* Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
(WebCore::FELightingSoftwareApplier::platformApplyNeonWorker):
(WebCore::FELightingSoftwareApplier::getPowerCoefficients):
(WebCore::FELighting::platformApplyNeonWorker): Deleted.
(WebCore::FELighting::getPowerCoefficients): Deleted.
* Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h:
(WebCore::FELightingSoftwareApplier::applyPlatformNeon):
(WebCore::FELighting::platformApplyNeon): Deleted.
* Source/WebCore/platform/graphics/filters/DistantLightSource.h:
* Source/WebCore/platform/graphics/filters/FELighting.h:
* Source/WebCore/platform/graphics/filters/PointLightSource.h:
* Source/WebCore/platform/graphics/filters/SpotLightSource.h:
* Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h:
Upstream-Status: Submitted [https://github.com/WebKit/WebKit/pull/1233]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../cpu/arm/filters/FELightingNEON.cpp | 4 +-
.../graphics/cpu/arm/filters/FELightingNEON.h | 52 +++++++++----------
.../graphics/filters/DistantLightSource.h | 4 ++
.../platform/graphics/filters/FELighting.h | 7 ---
.../graphics/filters/PointLightSource.h | 4 ++
.../graphics/filters/SpotLightSource.h | 4 ++
.../software/FELightingSoftwareApplier.h | 16 ++++++
7 files changed, 56 insertions(+), 35 deletions(-)
diff --git a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp
index f6ff8c20..42a97ffc 100644
--- a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp
+++ b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp
@@ -49,7 +49,7 @@ short* feLightingConstantsForNeon()
return s_FELightingConstantsForNeon;
}
-void FELighting::platformApplyNeonWorker(FELightingPaintingDataForNeon* parameters)
+void FELightingSoftwareApplier::platformApplyNeonWorker(FELightingPaintingDataForNeon* parameters)
{
neonDrawLighting(parameters);
}
@@ -464,7 +464,7 @@ TOSTRING(neonDrawLighting) ":" NL
"b .lightStrengthCalculated" NL
); // NOLINT
-int FELighting::getPowerCoefficients(float exponent)
+int FELightingSoftwareApplier::getPowerCoefficients(float exponent)
{
// Calling a powf function from the assembly code would require to save
// and reload a lot of NEON registers. Since the base is in range [0..1]
diff --git a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h
index b17c603d..e4629cda 100644
--- a/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h
+++ b/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.h
@@ -24,14 +24,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FELightingNEON_h
-#define FELightingNEON_h
+#pragma once
#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE)
-#include "FELighting.h"
+#include "FELightingSoftwareApplier.h"
+#include "ImageBuffer.h"
#include "PointLightSource.h"
#include "SpotLightSource.h"
+#include <wtf/ObjectIdentifier.h>
#include <wtf/ParallelJobs.h>
namespace WebCore {
@@ -93,14 +94,14 @@ extern "C" {
void neonDrawLighting(FELightingPaintingDataForNeon*);
}
-inline void FELighting::platformApplyNeon(const LightingData& data, const LightSource::PaintingData& paintingData)
+inline void FELightingSoftwareApplier::applyPlatformNeon(const FELightingSoftwareApplier::LightingData& data, const LightSource::PaintingData& paintingData)
{
- alignas(16) FELightingFloatArgumentsForNeon floatArguments;
- FELightingPaintingDataForNeon neonData = {
+ WebCore::FELightingFloatArgumentsForNeon alignas(16) floatArguments;
+ WebCore::FELightingPaintingDataForNeon neonData = {
data.pixels->data(),
1,
- data.widthDecreasedByOne - 1,
- data.heightDecreasedByOne - 1,
+ data.width - 2,
+ data.height - 2,
0,
0,
0,
@@ -111,23 +112,23 @@ inline void FELighting::platformApplyNeon(const LightingData& data, const LightS
// Set light source arguments.
floatArguments.constOne = 1;
- auto color = m_lightingColor.toColorTypeLossy<SRGBA<uint8_t>>().resolved();
+ auto color = data.lightingColor.toColorTypeLossy<SRGBA<uint8_t>>().resolved();
floatArguments.colorRed = color.red;
floatArguments.colorGreen = color.green;
floatArguments.colorBlue = color.blue;
floatArguments.padding4 = 0;
- if (m_lightSource->type() == LS_POINT) {
+ if (data.lightSource->type() == LS_POINT) {
neonData.flags |= FLAG_POINT_LIGHT;
- PointLightSource& pointLightSource = static_cast<PointLightSource&>(m_lightSource.get());
+ const auto& pointLightSource = *static_cast<const PointLightSource*>(data.lightSource);
floatArguments.lightX = pointLightSource.position().x();
floatArguments.lightY = pointLightSource.position().y();
floatArguments.lightZ = pointLightSource.position().z();
floatArguments.padding2 = 0;
- } else if (m_lightSource->type() == LS_SPOT) {
+ } else if (data.lightSource->type() == LS_SPOT) {
neonData.flags |= FLAG_SPOT_LIGHT;
- SpotLightSource& spotLightSource = static_cast<SpotLightSource&>(m_lightSource.get());
+ const auto& spotLightSource = *static_cast<const SpotLightSource*>(data.lightSource);
floatArguments.lightX = spotLightSource.position().x();
floatArguments.lightY = spotLightSource.position().y();
floatArguments.lightZ = spotLightSource.position().z();
@@ -145,7 +146,7 @@ inline void FELighting::platformApplyNeon(const LightingData& data, const LightS
if (spotLightSource.specularExponent() == 1)
neonData.flags |= FLAG_CONE_EXPONENT_IS_1;
} else {
- ASSERT(m_lightSource->type() == LS_DISTANT);
+ ASSERT(data.lightSource->type() == LS_DISTANT);
floatArguments.lightX = paintingData.initialLightingData.lightVector.x();
floatArguments.lightY = paintingData.initialLightingData.lightVector.y();
floatArguments.lightZ = paintingData.initialLightingData.lightVector.z();
@@ -155,38 +156,39 @@ inline void FELighting::platformApplyNeon(const LightingData& data, const LightS
// Set lighting arguments.
floatArguments.surfaceScale = data.surfaceScale;
floatArguments.minusSurfaceScaleDividedByFour = -data.surfaceScale / 4;
- if (m_lightingType == FELighting::DiffuseLighting)
- floatArguments.diffuseConstant = m_diffuseConstant;
+ if (data.filterType == FilterEffect::Type::FEDiffuseLighting)
+ floatArguments.diffuseConstant = data.diffuseConstant;
else {
neonData.flags |= FLAG_SPECULAR_LIGHT;
- floatArguments.diffuseConstant = m_specularConstant;
- neonData.specularExponent = getPowerCoefficients(m_specularExponent);
- if (m_specularExponent == 1)
+ floatArguments.diffuseConstant = data.specularConstant;
+ neonData.specularExponent = getPowerCoefficients(data.specularExponent);
+ if (data.specularExponent == 1)
neonData.flags |= FLAG_SPECULAR_EXPONENT_IS_1;
}
if (floatArguments.diffuseConstant == 1)
neonData.flags |= FLAG_DIFFUSE_CONST_IS_1;
- int optimalThreadNumber = ((data.widthDecreasedByOne - 1) * (data.heightDecreasedByOne - 1)) / s_minimalRectDimension;
+ static constexpr int minimalRectDimension = 100 * 100; // Empirical data limit for parallel jobs
+ int optimalThreadNumber = ((data.width - 2) * (data.height - 2)) / minimalRectDimension;
if (optimalThreadNumber > 1) {
// Initialize parallel jobs
- ParallelJobs<FELightingPaintingDataForNeon> parallelJobs(&WebCore::FELighting::platformApplyNeonWorker, optimalThreadNumber);
+ ParallelJobs<FELightingPaintingDataForNeon> parallelJobs(&FELightingSoftwareApplier::platformApplyNeonWorker, optimalThreadNumber);
// Fill the parameter array
int job = parallelJobs.numberOfJobs();
if (job > 1) {
int yStart = 1;
- int yStep = (data.heightDecreasedByOne - 1) / job;
+ int yStep = (data.height - 2) / job;
for (--job; job >= 0; --job) {
FELightingPaintingDataForNeon& params = parallelJobs.parameter(job);
params = neonData;
params.yStart = yStart;
- params.pixels += (yStart - 1) * (data.widthDecreasedByOne + 1) * 4;
+ params.pixels += (yStart - 1) * data.width * 4;
if (job > 0) {
params.absoluteHeight = yStep;
yStart += yStep;
} else
- params.absoluteHeight = data.heightDecreasedByOne - yStart;
+ params.absoluteHeight = (data.height - 1) - yStart;
}
parallelJobs.execute();
return;
@@ -199,5 +201,3 @@ inline void FELighting::platformApplyNeon(const LightingData& data, const LightS
} // namespace WebCore
#endif // CPU(ARM_NEON) && COMPILER(GCC_COMPATIBLE)
-
-#endif // FELightingNEON_h
diff --git a/Source/WebCore/platform/graphics/filters/DistantLightSource.h b/Source/WebCore/platform/graphics/filters/DistantLightSource.h
index 70c6512f..b032c82e 100644
--- a/Source/WebCore/platform/graphics/filters/DistantLightSource.h
+++ b/Source/WebCore/platform/graphics/filters/DistantLightSource.h
@@ -26,6 +26,10 @@
#include <wtf/ArgumentCoder.h>
#include <wtf/Ref.h>
+namespace WTF {
+class TextStream;
+} // namespace WTF
+
namespace WebCore {
class DistantLightSource : public LightSource {
diff --git a/Source/WebCore/platform/graphics/filters/FELighting.h b/Source/WebCore/platform/graphics/filters/FELighting.h
index 53beb596..e78a9354 100644
--- a/Source/WebCore/platform/graphics/filters/FELighting.h
+++ b/Source/WebCore/platform/graphics/filters/FELighting.h
@@ -35,8 +35,6 @@
namespace WebCore {
-struct FELightingPaintingDataForNeon;
-
class FELighting : public FilterEffect {
public:
const Color& lightingColor() const { return m_lightingColor; }
@@ -64,11 +62,6 @@ protected:
std::unique_ptr<FilterEffectApplier> createSoftwareApplier() const override;
-#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE)
- static int getPowerCoefficients(float exponent);
- inline void platformApplyNeon(const LightingData&, const LightSource::PaintingData&);
-#endif
-
Color m_lightingColor;
float m_surfaceScale;
float m_diffuseConstant;
diff --git a/Source/WebCore/platform/graphics/filters/PointLightSource.h b/Source/WebCore/platform/graphics/filters/PointLightSource.h
index 3a5723f0..675d63f5 100644
--- a/Source/WebCore/platform/graphics/filters/PointLightSource.h
+++ b/Source/WebCore/platform/graphics/filters/PointLightSource.h
@@ -26,6 +26,10 @@
#include "LightSource.h"
#include <wtf/Ref.h>
+namespace WTF {
+class TextStream;
+} // namespace WTF
+
namespace WebCore {
class PointLightSource : public LightSource {
diff --git a/Source/WebCore/platform/graphics/filters/SpotLightSource.h b/Source/WebCore/platform/graphics/filters/SpotLightSource.h
index 684626f7..dea58389 100644
--- a/Source/WebCore/platform/graphics/filters/SpotLightSource.h
+++ b/Source/WebCore/platform/graphics/filters/SpotLightSource.h
@@ -26,6 +26,10 @@
#include "LightSource.h"
#include <wtf/Ref.h>
+namespace WTF {
+class TextStream;
+} // namespace WTF
+
namespace WebCore {
class SpotLightSource : public LightSource {
diff --git a/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h b/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h
index c974d921..e2896660 100644
--- a/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h
+++ b/Source/WebCore/platform/graphics/filters/software/FELightingSoftwareApplier.h
@@ -36,6 +36,7 @@
namespace WebCore {
class FELighting;
+struct FELightingPaintingDataForNeon;
class FELightingSoftwareApplier final : public FilterEffectConcreteApplier<FELighting> {
WTF_MAKE_FAST_ALLOCATED;
@@ -132,8 +133,23 @@ private:
static void applyPlatformGenericPaint(const LightingData&, const LightSource::PaintingData&, int startY, int endY);
static void applyPlatformGenericWorker(ApplyParameters*);
+
+#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE)
+ static int getPowerCoefficients(float exponent);
+ static void platformApplyNeonWorker(FELightingPaintingDataForNeon*);
+ inline static void applyPlatformNeon(const LightingData&, const LightSource::PaintingData&);
+
+ inline static void applyPlatformGeneric(const LightingData& data, const LightSource::PaintingData& paintingData)
+ {
+ applyPlatformNeon(data, paintingData);
+ }
+#else
static void applyPlatformGeneric(const LightingData&, const LightSource::PaintingData&);
+#endif
+
static void applyPlatform(const LightingData&);
};
} // namespace WebCore
+
+#include "FELightingNEON.h"
@@ -0,0 +1,41 @@
From 4977290ab4ab35258a6da9b13795c9b0f7894bf4 Mon Sep 17 00:00:00 2001
From: Diego Pino Garcia <dpino@igalia.com>
Date: Mon, 22 May 2023 19:58:50 -0700
Subject: [PATCH] [GLIB] Fix build error after 264196@main
https://bugs.webkit.org/show_bug.cgi?id=256917
Reviewed by Michael Catanzaro.
Variable BWRAP_EXECUTABLE is only defined when BUBBLEWRAP_SANDBOX is
enabled.
* Source/WTF/wtf/glib/Sandbox.cpp:
(WTF::isInsideUnsupportedContainer):
Canonical link: https://commits.webkit.org/264395@main
Upstream-Status: Backport [https://github.com/WebKit/WebKit/commit/4977290ab4ab35258a6da9b13795c9b0f7894bf4]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
Source/WTF/wtf/glib/Sandbox.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Source/WTF/wtf/glib/Sandbox.cpp b/Source/WTF/wtf/glib/Sandbox.cpp
index 7d84e830ab33e..9b07bb8cb5a9b 100644
--- a/Source/WTF/wtf/glib/Sandbox.cpp
+++ b/Source/WTF/wtf/glib/Sandbox.cpp
@@ -36,6 +36,7 @@ bool isInsideFlatpak()
return returnValue;
}
+#if ENABLE(BUBBLEWRAP_SANDBOX)
bool isInsideUnsupportedContainer()
{
static bool inContainer = g_file_test("/run/.containerenv", G_FILE_TEST_EXISTS);
@@ -64,6 +65,7 @@ bool isInsideUnsupportedContainer()
return inContainer && !supportedContainer;
}
+#endif
bool isInsideSnap()
{
@@ -0,0 +1,33 @@
Add additional check on GST_GL_HAVE_PLATFORM_GLX before using gst_gl_display_x11_new_with_display
This ensures that there is a compile time check for glx support in gstreamer as
runtime check is not enough because gst_gl_display_x11_new_with_display() API comes from
gst/gl/x11/gstgldisplay_x11.h which is only included when GST_GL_HAVE_PLATFORM_GLX is defined
therefore make this check consistent to fix build with some platforms which use pvr gl drivers
where this problem appear at compile time.
/mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/webkitgtk/2.40.2-r0/webkitgtk-2.40.2/Source/WebCore/platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp:68:31: error: use of undeclared identifier 'gst_gl_display_x11_new_with_display'; did you mean 'gst_gl_display_egl_new_with_egl_display'?
68 | return GST_GL_DISPLAY(gst_gl_display_x11_new_with_display(downcast<PlatformDisplayX11>(sharedDisplay).native()));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| gst_gl_display_egl_new_with_egl_display
This issue is 2.40 specific since GLX support is removed [1] from trunk upstream, therefore
this patch wont be needed when upgrading to 2.42+
[1] https://github.com/WebKit/WebKit/commit/320560f9e53ddcd53954059bd005e0c75eb91abf
Upstream-Status: Inappropriate [GLX support is gone in 2.41+]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/Source/WebCore/platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp 2023-02-20 01:22:18.917743700 -0800
+++ b/Source/WebCore/platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp 2023-07-08 08:45:09.739177065 -0700
@@ -63,7 +63,7 @@
if (glPlatform == GST_GL_PLATFORM_EGL)
return GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(sharedDisplay.eglDisplay()));
#endif
-#if USE(GLX)
+#if USE(GLX) && GST_GL_HAVE_PLATFORM_GLX
if (is<PlatformDisplayX11>(sharedDisplay) && glPlatform == GST_GL_PLATFORM_GLX)
return GST_GL_DISPLAY(gst_gl_display_x11_new_with_display(downcast<PlatformDisplayX11>(sharedDisplay).native()));
#endif
@@ -0,0 +1,22 @@
Injection a year based on the current date isn't reproducible. Hack this
to a specific year for now for reproducibilty and to avoid autobuilder failures.
The correct fix would be to use SOURCE_DATE_EPOCH from the environment and
then this could be submitted upstream, sadly my ruby isn't up to that.
Upstream-Status: Pending [could be reworked]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Index: webkitgtk-2.34.2/Source/JavaScriptCore/generator/GeneratedFile.rb
===================================================================
--- webkitgtk-2.34.2.orig/Source/JavaScriptCore/generator/GeneratedFile.rb
+++ webkitgtk-2.34.2/Source/JavaScriptCore/generator/GeneratedFile.rb
@@ -25,7 +25,7 @@ require 'date'
require 'digest'
$LICENSE = <<-EOF
-Copyright (C) #{Date.today.year} Apple Inc. All rights reserved.
+Copyright (C) 2021 Apple Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions