LibWeb: Don't lie about supported WebGL extensions unless told to do so

We shouldn't say we support something we don't, unless we are told to
do so by the flag that exposes experimental interfaces.
This commit is contained in:
Undefine
2026-03-05 21:02:49 +01:00
committed by Jelle Raaijmakers
parent c2aeb9ea73
commit 3ac56aad7b
Notes: github-actions[bot] 2026-03-11 19:21:01 +00:00

View File

@@ -19,6 +19,7 @@ extern "C" {
#include <LibWeb/HTML/HTMLVideoElement.h>
#include <LibWeb/HTML/ImageBitmap.h>
#include <LibWeb/HTML/ImageData.h>
#include <LibWeb/HTML/UniversalGlobalScope.h>
#include <LibWeb/WebGL/Extensions/ANGLEInstancedArrays.h>
#include <LibWeb/WebGL/Extensions/EXTBlendMinMax.h>
#include <LibWeb/WebGL/Extensions/EXTColorBufferFloat.h>
@@ -173,6 +174,10 @@ Optional<Vector<String>> WebGLRenderingContextBase::get_supported_extensions()
bool supported = !available_extension_info.only_for_webgl_version.has_value()
|| context().webgl_version() == available_extension_info.only_for_webgl_version;
if (!available_extension_info.factory && !HTML::UniversalGlobalScopeMixin::expose_experimental_interfaces()) {
supported = false;
}
if (supported) {
for (auto const& required_extension : available_extension_info.required_angle_extensions) {
if (!opengl_extensions.contains_slow(required_extension)) {