Title: [256697] trunk
Revision
256697
Author
jon...@apple.com
Date
2020-02-14 19:19:00 -0800 (Fri, 14 Feb 2020)

Log Message

Mask WebGL strings
https://bugs.webkit.org/show_bug.cgi?id=207608

Reviewed by Dean Jackson.

Source/WebCore:

Test: platform/mac/webgl/fingerprinting-strings.html

Add new experimental feature to mask WebGL vendor, renderer, and shading language strings.

* html/canvas/WebGL2RenderingContext.cpp: Whitespace cleanup also.
(WebCore::WebGL2RenderingContext::getParameter): Check against the runtime feature to return the
old string.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter): Ditto.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setMaskWebGLStringsEnabled):
(WebCore::RuntimeEnabledFeatures::maskWebGLStringsEnabled const):

Source/WebKit:

Test: platform/mac/webgl/fingerprinting-strings.html

* Shared/WebPreferences.yaml: Add new experimental feature.

Source/WebKitLegacy/mac:

Test: platform/mac/webgl/fingerprinting-strings.html

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:

LayoutTests:

* platform/mac/webgl/fingerprinting-strings-expected.txt: Added.
* platform/mac/webgl/fingerprinting-strings.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (256696 => 256697)


--- trunk/LayoutTests/ChangeLog	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/LayoutTests/ChangeLog	2020-02-15 03:19:00 UTC (rev 256697)
@@ -1,3 +1,13 @@
+2020-02-14  Jon Lee  <jon...@apple.com>
+
+        Mask WebGL strings
+        https://bugs.webkit.org/show_bug.cgi?id=207608
+
+        Reviewed by Dean Jackson.
+
+        * platform/mac/webgl/fingerprinting-strings-expected.txt: Added.
+        * platform/mac/webgl/fingerprinting-strings.html: Added.
+
 2020-02-14  Nikos Mouchtaris  <nmouchta...@apple.com>
 
         new FontFace() should not throw when failing to parse arguments

Added: trunk/LayoutTests/platform/mac/webgl/fingerprinting-strings-expected.txt (0 => 256697)


--- trunk/LayoutTests/platform/mac/webgl/fingerprinting-strings-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/webgl/fingerprinting-strings-expected.txt	2020-02-15 03:19:00 UTC (rev 256697)
@@ -0,0 +1,11 @@
+ 
+WebGL 1 vendor is: WebKit
+WebGL 1 renderer is: WebKit WebGL
+WebGL 1 shading language version is: WebGL GLSL ES 1.0 (1.0)
+WebGL 1 unmasked vendor is: Apple Inc.
+WebGL 1 unmasked renderer is: Apple GPU
+WebGL 2 vendor is: WebKit
+WebGL 2 renderer is: WebKit WebGL
+WebGL 2 shading language version is: WebGL GLSL ES 1.0 (1.0)
+WebGL 2 unmasked vendor is: Apple Inc.
+WebGL 2 unmasked renderer is: Apple GPU

Added: trunk/LayoutTests/platform/mac/webgl/fingerprinting-strings.html (0 => 256697)


--- trunk/LayoutTests/platform/mac/webgl/fingerprinting-strings.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/webgl/fingerprinting-strings.html	2020-02-15 03:19:00 UTC (rev 256697)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<style>
+canvas {
+    width: 1px;
+    height: 1px;
+}
+</style>
+<canvas id="canvas1"></canvas>
+<canvas id="canvas2"></canvas>
+<script>
+function run() {
+    if (window.testRunner) {
+        testRunner.dumpAsText();
+    }
+    var canvas = document.getElementById("canvas1");
+    canvas.width = 1;
+    canvas.height = 1;
+    outputString("#webgl1", canvas.getContext("webgl"));
+
+    canvas = document.getElementById("canvas2");
+    canvas.width = 1;
+    canvas.height = 1;
+    outputString("#webgl2", canvas.getContext("webgl2"));
+}
+
+function outputString(glId, gl) {
+    if (!gl)
+        return;
+    document.querySelector(glId + " .vendor").innerText = gl.getParameter(gl.VENDOR);
+    document.querySelector(glId + " .renderer").innerText = gl.getParameter(gl.RENDERER);
+    document.querySelector(glId + " .shading_language_version").innerText = gl.getParameter(gl.SHADING_LANGUAGE_VERSION);
+
+    const debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
+    document.querySelector(glId + " .unmasked_vendor").innerText = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
+    document.querySelector(glId + " .unmasked_renderer").innerText = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
+}
+window.addEventListener("load", run, false);
+</script>
+
+<section id="webgl1">
+<div>WebGL 1 vendor is: <span class="vendor">NOT SUPPORTED</span></div>
+<div>WebGL 1 renderer is: <span class="renderer">NOT SUPPORTED</span></div>
+<div>WebGL 1 shading language version is: <span class="shading_language_version">NOT SUPPORTED</span></div>
+<div>WebGL 1 unmasked vendor is: <span class="unmasked_vendor">NOT SUPPORTED</span></div>
+<div>WebGL 1 unmasked renderer is: <span class="unmasked_renderer">NOT SUPPORTED</span></div>
+</section>
+
+<section id="webgl2">
+<div>WebGL 2 vendor is: <span class="vendor">NOT SUPPORTED</span></div>
+<div>WebGL 2 renderer is: <span class="renderer">NOT SUPPORTED</span></div>
+<div>WebGL 2 shading language version is: <span class="shading_language_version">NOT SUPPORTED</span></div>
+<div>WebGL 2 unmasked vendor is: <span class="unmasked_vendor">NOT SUPPORTED</span></div>
+<div>WebGL 2 unmasked renderer is: <span class="unmasked_renderer">NOT SUPPORTED</span></div>
+</section>

Modified: trunk/Source/WebCore/ChangeLog (256696 => 256697)


--- trunk/Source/WebCore/ChangeLog	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebCore/ChangeLog	2020-02-15 03:19:00 UTC (rev 256697)
@@ -1,3 +1,23 @@
+2020-02-14  Jon Lee  <jon...@apple.com>
+
+        Mask WebGL strings
+        https://bugs.webkit.org/show_bug.cgi?id=207608
+
+        Reviewed by Dean Jackson.
+
+        Test: platform/mac/webgl/fingerprinting-strings.html
+
+        Add new experimental feature to mask WebGL vendor, renderer, and shading language strings.
+
+        * html/canvas/WebGL2RenderingContext.cpp: Whitespace cleanup also.
+        (WebCore::WebGL2RenderingContext::getParameter): Check against the runtime feature to return the
+        old string.
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getParameter): Ditto.
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setMaskWebGLStringsEnabled):
+        (WebCore::RuntimeEnabledFeatures::maskWebGLStringsEnabled const):
+
 2020-02-14  Youenn Fablet  <you...@apple.com>
 
         Simplify WebProcess handling of unregistering of service workers

Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (256696 => 256697)


--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2020-02-15 03:19:00 UTC (rev 256697)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -43,6 +43,7 @@
 #include "OESTextureHalfFloat.h"
 #include "OESTextureHalfFloatLinear.h"
 #include "RenderBox.h"
+#include "RuntimeEnabledFeatures.h"
 #include "WebGLActiveInfo.h"
 #include "WebGLCompressedTextureASTC.h"
 #include "WebGLCompressedTextureATC.h"
@@ -940,7 +941,7 @@
 {
     if (isContextLostOrPending())
         return;
-    
+
     WebGLRenderingContextBase::vertexAttribDivisor(index, divisor);
 }
 
@@ -1516,7 +1517,7 @@
 {
     if (isContextLost())
         return nullptr;
-    
+
     auto object = WebGLVertexArrayObject::create(*this, WebGLVertexArrayObject::Type::User);
     addContextObject(object.get());
     return WTFMove(object);
@@ -1526,10 +1527,10 @@
 {
     if (!arrayObject || isContextLost())
         return;
-    
+
     if (arrayObject->isDeleted())
         return;
-    
+
     if (!arrayObject->isDefaultObject() && arrayObject == m_boundVertexArrayObject)
 #if USE(OPENGL_ES)
         setBoundVertexArrayObject(nullptr);
@@ -1536,7 +1537,7 @@
 #else
         bindVertexArray(nullptr); // The default VAO was removed in OpenGL 3.3 but not from WebGL 2; bind the default for WebGL to use.
 #endif
-    
+
     arrayObject->deleteObject(graphicsContextGL());
 }
 
@@ -1544,10 +1545,10 @@
 {
     if (!arrayObject || isContextLost())
         return false;
-    
+
     if (!arrayObject->hasEverBeenBound() || !arrayObject->validate(0, *this))
         return false;
-    
+
     return m_context->isVertexArray(arrayObject->object());
 }
 
@@ -1555,7 +1556,7 @@
 {
     if (isContextLost())
         return;
-    
+
     if (arrayObject && (arrayObject->isDeleted() || !arrayObject->validate(0, *this) || !m_contextObjects.contains(arrayObject))) {
         m_context->synthesizeGLError(GraphicsContextGL::INVALID_OPERATION);
         return;
@@ -1562,7 +1563,7 @@
     }
     if (arrayObject && !arrayObject->isDefaultObject() && arrayObject->object()) {
         m_context->bindVertexArray(arrayObject->object());
-        
+
         arrayObject->setHasEverBeenBound();
         setBoundVertexArrayObject(arrayObject);
     } else {
@@ -1610,7 +1611,7 @@
         return WTF::nullopt;
 
     Vector<String> result;
-    
+
     if (m_isPendingPolicyResolution)
         return result;
 
@@ -1704,7 +1705,7 @@
         return value;
     }
     }
-    
+
     if (object->isTexture()) {
         switch (pname) {
         case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
@@ -2114,7 +2115,9 @@
     case GraphicsContextGL::SCISSOR_TEST:
         return getBooleanParameter(pname);
     case GraphicsContextGL::SHADING_LANGUAGE_VERSION:
-        return "WebGL GLSL ES 1.0 (" + m_context->getString(GraphicsContextGL::SHADING_LANGUAGE_VERSION) + ")";
+        if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
+            return "WebGL GLSL ES 1.0 (" + m_context->getString(GraphicsContextGL::SHADING_LANGUAGE_VERSION) + ")";
+        return "WebGL GLSL ES 1.0 (1.0)"_str;
     case GraphicsContextGL::STENCIL_BACK_FAIL:
         return getUnsignedIntParameter(pname);
     case GraphicsContextGL::STENCIL_BACK_FUNC:
@@ -2173,17 +2176,22 @@
         return getWebGLIntArrayParameter(pname);
     case WebGLDebugRendererInfo::UNMASKED_RENDERER_WEBGL:
         if (m_webglDebugRendererInfo) {
-#if PLATFORM(IOS_FAMILY)
+#if !PLATFORM(IOS_FAMILY)
+            if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
+                return m_context->getString(GraphicsContextGL::RENDERER);
+#endif
             return "Apple GPU"_str;
-#else
-            return m_context->getString(GraphicsContextGL::RENDERER);
-#endif
         }
         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
         return nullptr;
     case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
-        if (m_webglDebugRendererInfo)
-            return m_context->getString(GraphicsContextGL::VENDOR);
+        if (m_webglDebugRendererInfo) {
+#if !PLATFORM(IOS_FAMILY)
+            if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
+                return m_context->getString(GraphicsContextGL::VENDOR);
+#endif
+            return "Apple Inc."_str;
+        }
         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
         return nullptr;
     case ExtensionsGL::MAX_TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
@@ -2241,8 +2249,8 @@
         return getIntParameter(pname);
     case GraphicsContextGL::MAX_VERTEX_UNIFORM_BLOCKS:
         return getIntParameter(pname);
-    case GraphicsContextGL::MAX_VERTEX_UNIFORM_COMPONENTS: 
-        return getIntParameter(pname);                            
+    case GraphicsContextGL::MAX_VERTEX_UNIFORM_COMPONENTS:
+        return getIntParameter(pname);
     case GraphicsContextGL::MIN_PROGRAM_TEXEL_OFFSET:
         return getIntParameter(pname);
     case GraphicsContextGL::PACK_ROW_LENGTH:
@@ -2306,7 +2314,7 @@
         return m_boundSamplers[m_activeTextureUnit];
     case GraphicsContextGL::COPY_READ_BUFFER:
     case GraphicsContextGL::COPY_WRITE_BUFFER:
-    case GraphicsContextGL::PIXEL_PACK_BUFFER_BINDING:   
+    case GraphicsContextGL::PIXEL_PACK_BUFFER_BINDING:
     case GraphicsContextGL::PIXEL_UNPACK_BUFFER_BINDING:
     case GraphicsContextGL::READ_BUFFER:
     case GraphicsContextGL::TEXTURE_BINDING_2D_ARRAY:
@@ -2327,12 +2335,12 @@
     // array buffers have enough elements to satisfy that maximum
     // index, skips the expensive per-draw-call iteration in
     // validateIndexArrayPrecise.
-    
+
     RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer();
-    
+
     if (!elementArrayBuffer)
         return false;
-    
+
     GCGLsizeiptr numElements = elementArrayBuffer->byteLength();
     // The case count==0 is already dealt with in drawElements before validateIndexArrayConservative.
     if (!numElements)
@@ -2339,7 +2347,7 @@
         return false;
     auto buffer = elementArrayBuffer->elementArrayBuffer();
     ASSERT(buffer);
-    
+
     Optional<unsigned> maxIndex = elementArrayBuffer->getCachedMaxIndex(type);
     if (!maxIndex) {
         // Compute the maximum index in the entire buffer for the given type of index.
@@ -2359,7 +2367,7 @@
         if (maxIndex)
             elementArrayBuffer->setCachedMaxIndex(type, maxIndex.value());
     }
-    
+
     if (!maxIndex)
         return false;
 

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (256696 => 256697)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2020-02-15 03:19:00 UTC (rev 256697)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -20,7 +20,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
@@ -49,6 +49,7 @@
 #include "OESTextureHalfFloatLinear.h"
 #include "OESVertexArrayObject.h"
 #include "RenderBox.h"
+#include "RuntimeEnabledFeatures.h"
 #include "WebGLCompressedTextureASTC.h"
 #include "WebGLCompressedTextureATC.h"
 #include "WebGLCompressedTextureETC.h"
@@ -191,10 +192,10 @@
         return WTF::nullopt;
 
     Vector<String> result;
-    
+
     if (m_isPendingPolicyResolution)
         return result;
-    
+
     if (m_context->getExtensions().supports("GL_EXT_blend_minmax"_s))
         result.append("EXT_blend_minmax"_s);
     if (m_context->getExtensions().supports("GL_EXT_sRGB"_s))
@@ -249,12 +250,12 @@
 {
     if (isContextLostOrPending() || !validateFramebufferFuncParameters("getFramebufferAttachmentParameter", target, attachment))
         return nullptr;
-    
+
     if (!m_framebufferBinding || !m_framebufferBinding->object()) {
         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getFramebufferAttachmentParameter", "no framebuffer bound");
         return nullptr;
     }
-    
+
     auto object = makeRefPtr(m_framebufferBinding->getAttachmentObject(attachment));
     if (!object) {
         if (pname == GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)
@@ -264,7 +265,7 @@
         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getFramebufferAttachmentParameter", "invalid parameter name");
         return nullptr;
     }
-    
+
     if (object->isTexture()) {
         switch (pname) {
         case GraphicsContextGL::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
@@ -331,7 +332,7 @@
         return false;
     }
 }
-    
+
 void WebGLRenderingContext::renderbufferStorage(GCGLenum target, GCGLenum internalformat, GCGLsizei width, GCGLsizei height)
 {
     if (isContextLostOrPending())
@@ -396,7 +397,7 @@
     }
     m_context->hint(target, mode);
 }
-    
+
 void WebGLRenderingContext::clear(GCGLbitfield mask)
 {
     if (isContextLostOrPending())
@@ -546,7 +547,9 @@
     case GraphicsContextGL::SCISSOR_TEST:
         return getBooleanParameter(pname);
     case GraphicsContextGL::SHADING_LANGUAGE_VERSION:
-        return "WebGL GLSL ES 1.0 (" + m_context->getString(GraphicsContextGL::SHADING_LANGUAGE_VERSION) + ")";
+        if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
+            return "WebGL GLSL ES 1.0 (" + m_context->getString(GraphicsContextGL::SHADING_LANGUAGE_VERSION) + ")";
+        return "WebGL GLSL ES 1.0 (1.0)"_str;
     case GraphicsContextGL::STENCIL_BACK_FAIL:
         return getUnsignedIntParameter(pname);
     case GraphicsContextGL::STENCIL_BACK_FUNC:
@@ -610,17 +613,22 @@
         return nullptr;
     case WebGLDebugRendererInfo::UNMASKED_RENDERER_WEBGL:
         if (m_webglDebugRendererInfo) {
-#if PLATFORM(IOS_FAMILY)
+#if !PLATFORM(IOS_FAMILY)
+            if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
+                return m_context->getString(GraphicsContextGL::RENDERER);
+#endif
             return "Apple GPU"_str;
-#else
-            return m_context->getString(GraphicsContextGL::RENDERER);
-#endif
         }
         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
         return nullptr;
     case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
-        if (m_webglDebugRendererInfo)
-            return m_context->getString(GraphicsContextGL::VENDOR);
+        if (m_webglDebugRendererInfo) {
+#if !PLATFORM(IOS_FAMILY)
+            if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
+                return m_context->getString(GraphicsContextGL::VENDOR);
+#endif
+            return "Apple Inc."_str;
+        }
         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
         return nullptr;
     case ExtensionsGL::VERTEX_ARRAY_BINDING_OES: // OES_vertex_array_object
@@ -682,7 +690,7 @@
         m_context->getIntegerv(ExtensionsGL::MAX_COLOR_ATTACHMENTS_EXT, &m_maxColorAttachments);
     return m_maxColorAttachments;
 }
-    
+
 bool WebGLRenderingContext::validateIndexArrayConservative(GCGLenum type, unsigned& numElementsRequired)
 {
     // Performs conservative validation by caching a maximum index of
@@ -690,12 +698,12 @@
     // array buffers have enough elements to satisfy that maximum
     // index, skips the expensive per-draw-call iteration in
     // validateIndexArrayPrecise.
-    
+
     RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer();
-    
+
     if (!elementArrayBuffer)
         return false;
-    
+
     GCGLsizeiptr numElements = elementArrayBuffer->byteLength();
     // The case count==0 is already dealt with in drawElements before validateIndexArrayConservative.
     if (!numElements)
@@ -702,7 +710,7 @@
         return false;
     auto buffer = elementArrayBuffer->elementArrayBuffer();
     ASSERT(buffer);
-    
+
     Optional<unsigned> maxIndex = elementArrayBuffer->getCachedMaxIndex(type);
     if (!maxIndex) {
         // Compute the maximum index in the entire buffer for the given type of index.
@@ -735,7 +743,7 @@
         if (maxIndex)
             elementArrayBuffer->setCachedMaxIndex(type, maxIndex.value());
     }
-    
+
     if (!maxIndex)
         return false;
 

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (256696 => 256697)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2020-02-15 03:19:00 UTC (rev 256697)
@@ -78,7 +78,7 @@
 
     void setMenuItemElementEnabled(bool isEnabled) { m_isMenuItemElementEnabled = isEnabled; }
     bool menuItemElementEnabled() const { return m_isMenuItemElementEnabled; }
-    
+
     void setDirectoryUploadEnabled(bool isEnabled) { m_isDirectoryUploadEnabled = isEnabled; }
     bool directoryUploadEnabled() const { return m_isDirectoryUploadEnabled; }
 
@@ -87,7 +87,7 @@
 
     void setCustomPasteboardDataEnabled(bool isEnabled) { m_isCustomPasteboardDataEnabled = isEnabled; }
     bool customPasteboardDataEnabled() const { return m_isCustomPasteboardDataEnabled; }
-    
+
     void setWebShareEnabled(bool isEnabled) { m_isWebShareEnabled = isEnabled; }
     bool webShareEnabled() const { return m_isWebShareEnabled; }
 
@@ -176,7 +176,7 @@
 
     void setPointerEventsEnabled(bool isEnabled) { m_pointerEventsEnabled = isEnabled; }
     bool pointerEventsEnabled() const { return m_pointerEventsEnabled; }
-    
+
     void setSyntheticEditingCommandsEnabled(bool isEnabled) { m_syntheticEditingCommandsEnabled = isEnabled; }
     bool syntheticEditingCommandsEnabled() const { return m_syntheticEditingCommandsEnabled; }
 
@@ -183,7 +183,7 @@
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     void setLayoutFormattingContextEnabled(bool isEnabled) { m_layoutFormattingContextEnabled = isEnabled; }
     bool layoutFormattingContextEnabled() const { return m_layoutFormattingContextEnabled; }
-    
+
     void setLayoutFormattingContextIntegrationEnabled(bool isEnabled) { m_layoutFormattingContextIntegrationEnabled = isEnabled; }
     bool layoutFormattingContextIntegrationEnabled() const { return m_layoutFormattingContextIntegrationEnabled; }
 #endif
@@ -206,7 +206,7 @@
 
     void setKeygenElementEnabled(bool isEnabled) { m_keygenElementEnabled = isEnabled; }
     bool keygenElementEnabled() const { return m_keygenElementEnabled; }
-    
+
     void setHighlightAPIEnabled(bool isEnabled) { m_highlightAPIEnabled = isEnabled; }
     bool highlightAPIEnabled() const { return m_highlightAPIEnabled; }
 
@@ -298,12 +298,17 @@
     void setWebGL2Enabled(bool isEnabled) { m_isWebGL2Enabled = isEnabled; }
     bool webGL2Enabled() const { return m_isWebGL2Enabled; }
 #endif
-    
+
 #if ENABLE(WEBGPU)
     void setWebGPUEnabled(bool isEnabled) { m_isWebGPUEnabled = isEnabled; }
     bool webGPUEnabled() const { return m_isWebGPUEnabled; }
 #endif
 
+#if ENABLE(WEBGL) || ENABLE(WEBGL2)
+    void setMaskWebGLStringsEnabled(bool isEnabled) { m_isMaskWebGLStringsEnabled = isEnabled; }
+    bool maskWebGLStringsEnabled() const { return m_isMaskWebGLStringsEnabled; }
+#endif
+
 #if ENABLE(STREAMS_API)
     void setReadableByteStreamAPIEnabled(bool isEnabled) { m_isReadableByteStreamAPIEnabled = isEnabled; }
     bool readableByteStreamAPIEnabled() const { return m_isReadableByteStreamAPIEnabled; }
@@ -310,7 +315,7 @@
     void setWritableStreamAPIEnabled(bool isEnabled) { m_isWritableStreamAPIEnabled = isEnabled; }
     bool writableStreamAPIEnabled() const { return m_isWritableStreamAPIEnabled; }
 #endif
-    
+
 #if ENABLE(DOWNLOAD_ATTRIBUTE)
     void setDownloadAttributeEnabled(bool isEnabled) { m_isDownloadAttributeEnabled = isEnabled; }
     bool downloadAttributeEnabled() const { return m_isDownloadAttributeEnabled; }
@@ -358,7 +363,7 @@
     bool touchEventsEnabled() const;
     void setTouchEventsEnabled(bool isEnabled) { m_touchEventsEnabled = isEnabled; }
 #endif
-    
+
     bool referrerPolicyAttributeEnabled() const { return m_referrerPolicyAttributeEnabled; }
     void setReferrerPolicyAttributeEnabled(bool isEnabled) { m_referrerPolicyAttributeEnabled = isEnabled; }
 
@@ -534,11 +539,15 @@
 #if ENABLE(WEBGL2)
     bool m_isWebGL2Enabled { false };
 #endif
-    
+
 #if ENABLE(WEBGPU)
     bool m_isWebGPUEnabled { false };
 #endif
 
+#if ENABLE(WEBGL) || ENABLE(WEBGL2)
+    bool m_isMaskWebGLStringsEnabled { false };
+#endif
+
 #if ENABLE(DOWNLOAD_ATTRIBUTE)
     bool m_isDownloadAttributeEnabled { false };
 #endif

Modified: trunk/Source/WebKit/ChangeLog (256696 => 256697)


--- trunk/Source/WebKit/ChangeLog	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebKit/ChangeLog	2020-02-15 03:19:00 UTC (rev 256697)
@@ -1,3 +1,14 @@
+2020-02-14  Jon Lee  <jon...@apple.com>
+
+        Mask WebGL strings
+        https://bugs.webkit.org/show_bug.cgi?id=207608
+
+        Reviewed by Dean Jackson.
+
+        Test: platform/mac/webgl/fingerprinting-strings.html
+
+        * Shared/WebPreferences.yaml: Add new experimental feature.
+
 2020-02-14  Youenn Fablet  <you...@apple.com>
 
         Simplify WebProcess handling of unregistering of service workers

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (256696 => 256697)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2020-02-15 03:19:00 UTC (rev 256697)
@@ -768,7 +768,7 @@
   humanReadableDescription: "Web Gamepad API support"
   webcoreBinding: RuntimeEnabledFeatures
   condition: ENABLE(GAMEPAD)
-  
+
 HighlightAPIEnabled:
     type: bool
     defaultValue: false
@@ -1385,6 +1385,15 @@
   webcoreBinding: RuntimeEnabledFeatures
   condition: ENABLE(WEBGPU)
 
+MaskWebGLStringsEnabled:
+  type: bool
+  defaultValue: true
+  humanReadableName: "Mask WebGL Strings"
+  humanReadableDescription: "Mask WebGL Vendor, Renderer, Shader Language Strings"
+  category: experimental
+  webcoreBinding: RuntimeEnabledFeatures
+  condition: ENABLE(WEBGL) || ENABLE(WEBGL2)
+
 AccessibilityObjectModelEnabled:
   type: bool
   defaultValue: false

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (256696 => 256697)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-02-15 03:19:00 UTC (rev 256697)
@@ -1,3 +1,17 @@
+2020-02-14  Jon Lee  <jon...@apple.com>
+
+        Mask WebGL strings
+        https://bugs.webkit.org/show_bug.cgi?id=207608
+
+        Reviewed by Dean Jackson.
+
+        Test: platform/mac/webgl/fingerprinting-strings.html
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+
 2020-02-13  Said Abou-Hallawa  <s...@apple.com>
 
         Unreviewed, rolling out r255158, 255405 and r255486

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (256696 => 256697)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2020-02-15 03:19:00 UTC (rev 256697)
@@ -6,13 +6,13 @@
  * are met:
  *
  * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
+ *     notice, this list of conditions and the following disclaimer.
  * 2.  Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
+ *     documentation and/or other materials provided with the distribution.
  * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
  *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
+ *     from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -122,6 +122,7 @@
 #define WebKitWebGL2EnabledPreferenceKey @"WebKitWebGL2Enabled"
 #define WebKitWebGPUEnabledPreferenceKey @"WebKitWebGPUEnabled"
 #define WebKitForceWebGLUsesLowPowerPreferenceKey @"WebKitForceWebGLUsesLowPower"
+#define WebKitMaskWebGLStringsEnabledPreferenceKey @"WebKitMaskWebGLStringsEnabled"
 #define WebKitAccelerated2dCanvasEnabledPreferenceKey @"WebKitAccelerated2dCanvasEnabled"
 #define WebKitFrameFlatteningPreferenceKey @"WebKitFrameFlattening"
 #define WebKitAsyncFrameScrollingEnabledPreferenceKey @"WebKitAsyncFrameScrollingEnabled"

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (256696 => 256697)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-02-15 03:19:00 UTC (rev 256697)
@@ -7,13 +7,13 @@
  * are met:
  *
  * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
+ *     notice, this list of conditions and the following disclaimer.
  * 2.  Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
+ *     documentation and/or other materials provided with the distribution.
  * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
  *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
+ *     from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -90,10 +90,10 @@
         // Apps that probably need the small setting
         static const char* const documentViewerIDs[] = {
             "Microsoft/com.microsoft.Messenger",
-            "com.adiumX.adiumX", 
+            "com.adiumX.adiumX",
             "com.alientechnology.Proteus",
             "com.apple.Dashcode",
-            "com.apple.iChat", 
+            "com.apple.iChat",
             "com.barebones.bbedit",
             "com.barebones.textwrangler",
             "com.barebones.yojimbo",
@@ -107,7 +107,7 @@
             "com.yahoo.messenger3",
             "de.codingmonkeys.SubEthaEdit",
             "fi.karppinen.Pyro",
-            "info.colloquy", 
+            "info.colloquy",
             "kungfoo.tv.ecto",
         };
 
@@ -228,13 +228,13 @@
     // Create fake identifier
     static int instanceCount = 1;
     NSString *fakeIdentifier;
-    
-    // At least ensure that identifier hasn't been already used.  
+
+    // At least ensure that identifier hasn't been already used.
     fakeIdentifier = [NSString stringWithFormat:@"WebPreferences%d", instanceCount++];
     while ([[self class] _getInstanceForIdentifier:fakeIdentifier]){
         fakeIdentifier = [NSString stringWithFormat:@"WebPreferences%d", instanceCount++];
     }
-    
+
     return [self initWithIdentifier:fakeIdentifier];
 }
 
@@ -595,7 +595,7 @@
         @NO, WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey,
         @YES, WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
         @NO, WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
-        
+
         @NO, WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey,
 #if ENABLE(MEDIA_SOURCE)
         @YES, WebKitMediaSourceEnabledPreferenceKey,
@@ -643,6 +643,9 @@
 #if ENABLE(WEBGPU)
         @NO, WebKitWebGPUEnabledPreferenceKey,
 #endif
+#if ENABLE(WEBGL) || ENABLE(WEBGL2)
+        @YES, WebKitMaskWebGLStringsEnabledPreferenceKey,
+#endif
         @NO, WebKitCacheAPIEnabledPreferenceKey,
         @YES, WebKitFetchAPIEnabledPreferenceKey,
 
@@ -968,7 +971,7 @@
     return [self _stringValueForKey: WebKitSerifFontPreferenceKey];
 }
 
-- (void)setSerifFontFamily:(NSString *)family 
+- (void)setSerifFontFamily:(NSString *)family
 {
     [self _setStringValue: family forKey: WebKitSerifFontPreferenceKey];
 }
@@ -1067,7 +1070,7 @@
 - (NSURL *)userStyleSheetLocation
 {
     NSString *locationString = [self _stringValueForKey: WebKitUserStyleSheetLocationPreferenceKey];
-    
+
     if ([locationString _webkit_looksLikeAbsoluteURL]) {
         return [NSURL _web_URLWithDataAsString:locationString];
     } else {
@@ -1079,7 +1082,7 @@
 - (void)setUserStyleSheetLocation:(NSURL *)URL
 {
     NSString *locationString;
-    
+
     if ([URL isFileURL]) {
         locationString = [[URL path] _web_stringByAbbreviatingWithTildeInPath];
     } else {
@@ -1100,7 +1103,7 @@
 // in use display web content in a straightforward manner. However, it is
 // wrong for iOS, where WebViews are used for various purposes, like
 // text editing, text rendering, and displaying web content.
-// 
+//
 // I have changed the user style sheet mechanism to be a per-WebView
 // setting, rather than a per-process preference. This seems to give the
 // behavior we want for iOS.
@@ -1805,7 +1808,7 @@
         // ensure that a valid result is returned
         value = WebKitEditableLinkDefaultBehavior;
     }
-    
+
     return value;
 }
 
@@ -1889,7 +1892,7 @@
 
     if (!ident)
         return _standardPreferences;
-    
+
     WebPreferences *instance = [webPreferencesInstances objectForKey:[self _concatenateKeyWithIBCreatorID:ident]];
 
     return instance;
@@ -2203,6 +2206,16 @@
     [self _setBoolValue:enabled forKey:WebKitWebGPUEnabledPreferenceKey];
 }
 
+- (BOOL)maskWebGLStringsEnabled
+{
+    return [self _boolValueForKey:WebKitMaskWebGLStringsEnabledPreferenceKey];
+}
+
+- (void)setMaskWebGLStringsEnabled:(BOOL)enabled
+{
+    [self _setBoolValue:enabled forKey:WebKitMaskWebGLStringsEnabledPreferenceKey];
+}
+
 - (BOOL)accelerated2dCanvasEnabled
 {
     return [self _boolValueForKey:WebKitAccelerated2dCanvasEnabledPreferenceKey];
@@ -2643,7 +2656,7 @@
         ASSERT_NOT_REACHED();
         storageBlockingPolicy = WebBlockAllStorage;
         break;
-    }    
+    }
 
     [self setStorageBlockingPolicy:storageBlockingPolicy];
 }

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h (256696 => 256697)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2020-02-15 03:19:00 UTC (rev 256697)
@@ -6,13 +6,13 @@
  * are met:
  *
  * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
+ *     notice, this list of conditions and the following disclaimer.
  * 2.  Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
+ *     documentation and/or other materials provided with the distribution.
  * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
  *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
+ *     from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -284,6 +284,9 @@
 - (BOOL)webGPUEnabled;
 - (void)setWebGPUEnabled:(BOOL)enabled;
 
+- (BOOL)maskWebGLStringsEnabled;
+- (void)setMaskWebGLStringsEnabled:(BOOL)enabled;
+
 - (BOOL)accelerated2dCanvasEnabled;
 - (void)setAccelerated2dCanvasEnabled:(BOOL)enabled;
 
@@ -417,7 +420,7 @@
 - (void)didRemoveFromWebView;
 
 // Full screen support is dependent on WebCore/WebKit being
-// compiled with ENABLE_FULLSCREEN_API. 
+// compiled with ENABLE_FULLSCREEN_API.
 - (void)setFullScreenEnabled:(BOOL)flag;
 - (BOOL)fullScreenEnabled;
 

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (256696 => 256697)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2020-02-15 03:02:55 UTC (rev 256696)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2020-02-15 03:19:00 UTC (rev 256697)
@@ -8,13 +8,13 @@
  * are met:
  *
  * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
+ *     notice, this list of conditions and the following disclaimer.
  * 2.  Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
+ *     documentation and/or other materials provided with the distribution.
  * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
  *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
+ *     from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -688,11 +688,11 @@
 {
     if (!(self = [super init]))
         return nil;
-    
+
     _dataInteractionImage = [PAL::allocUIImageInstance() initWithCGImage:image scale:scale orientation:UIImageOrientationDownMirrored];
     _selectionRectInRootViewCoordinates = indicatorData.selectionRectInRootViewCoordinates;
     _textBoundingRectInRootViewCoordinates = indicatorData.textBoundingRectInRootViewCoordinates;
-    
+
     NSMutableArray *textRectsInBoundingRectCoordinates = [NSMutableArray array];
     for (auto rect : indicatorData.textRectsInBoundingRectCoordinates)
         [textRectsInBoundingRectCoordinates addObject:[NSValue valueWithCGRect:rect]];
@@ -721,9 +721,9 @@
 {
     if (!(self = [super init]))
         return nil;
-    
+
     _dataInteractionImage = [PAL::allocUIImageInstance() initWithCGImage:image scale:scale orientation:UIImageOrientationDownMirrored];
-    
+
     return self;
 }
 
@@ -1353,7 +1353,7 @@
 #ifndef NDEBUG
     WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen);
 #endif
-    
+
     WebPreferences *standardPreferences = [WebPreferences standardPreferences];
     [standardPreferences willAddToWebView];
 
@@ -1410,7 +1410,7 @@
 #endif
         [WebDatabaseManager sharedWebDatabaseManager];
 
-#if PLATFORM(IOS_FAMILY)        
+#if PLATFORM(IOS_FAMILY)
         if ([standardPreferences storageTrackerEnabled])
 #endif
         WebKitInitializeStorageIfNecessary();
@@ -1538,10 +1538,10 @@
         [self scheduleInRunLoop:runLoop forMode:NSDefaultRunLoopMode];
 
     [self _addToAllWebViewsSet];
-    
+
     // If there's already a next key view (e.g., from a nib), wire it up to our
     // contained frame view. In any case, wire our next key view up to the our
-    // contained frame view. This works together with our becomeFirstResponder 
+    // contained frame view. This works together with our becomeFirstResponder
     // and setNextKeyView overrides.
     NSView *nextKeyView = [self nextKeyView];
     if (nextKeyView && nextKeyView != frameView)
@@ -1679,17 +1679,17 @@
     self = [super initWithFrame:frame];
     if (!self)
         return nil;
-    
+
     _private = [[WebViewPrivate alloc] init];
-    
+
 #ifndef NDEBUG
     WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen);
 #endif
-    
+
     if (!preferences)
         preferences = [WebPreferences standardPreferences];
     [preferences willAddToWebView];
-    
+
     _private->preferences = [preferences retain];
     _private->mainFrameDocumentReady = NO;
     _private->drawsBackground = YES;
@@ -1736,9 +1736,9 @@
 
     _private->page = new WebCore::Page(WTFMove(pageConfiguration));
     storageProvider->setPage(*_private->page);
-    
+
     [self setSmartInsertDeleteEnabled:YES];
-    
+
     // FIXME: <rdar://problem/6851451> Should respect preferences in fast path WebView initialization
     // We are ignoring the preferences object on fast path and just using Settings defaults (everything fancy off).
     // This matches how UIKit sets up the preferences. We need to set  default values for fonts though, <rdar://problem/6850611>.
@@ -1748,16 +1748,16 @@
     _private->page->settings().setDefaultFixedFontSize(13);
     _private->page->settings().setAcceleratedDrawingEnabled([preferences acceleratedDrawingEnabled]);
     _private->page->settings().setDisplayListDrawingEnabled([preferences displayListDrawingEnabled]);
-    
+
     _private->page->settings().setFontFallbackPrefersPictographs(true);
     _private->page->settings().setPictographFontFamily("AppleColorEmoji");
-    
+
     _private->page->settings().setScriptMarkupEnabled(false);
     _private->page->settings().setScriptEnabled(true);
-    
+
     // FIXME: this is a workaround for <rdar://problem/11518688> REGRESSION: Quoted text font changes when replying to certain email
     _private->page->settings().setStandardFontFamily([_private->preferences standardFontFamily]);
-    
+
     // FIXME: this is a workaround for <rdar://problem/11820090> Quoted text changes in size when replying to certain email
     _private->page->settings().setMinimumFontSize([_private->preferences minimumFontSize]);
 
@@ -1769,19 +1769,19 @@
 #if ENABLE(REMOTE_INSPECTOR)
     _private->page->setRemoteInspectionAllowed(isInternalInstall());
 #endif
-    
+
     [self _updateScreenScaleFromWindow];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_wakWindowScreenScaleChanged:) name:WAKWindowScreenScaleDidChangeNotification object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_wakWindowVisibilityChanged:) name:WAKWindowVisibilityDidChangeNotification object:nil];
 
     [WebFrame _createMainFrameWithSimpleHTMLDocumentWithPage:_private->page frameView:frameView style:style];
-    
+
     [self _addToAllWebViewsSet];
-    
+
     ++WebViewCount;
-    
+
     WebCore::SecurityPolicy::setLocalLoadPolicy(WebCore::SecurityPolicy::AllowLocalLoadsForLocalAndSubstituteData);
-    
+
     WebCore::RuntimeEnabledFeatures::sharedFeatures().setAttachmentElementEnabled(self.preferences.attachmentElementEnabled);
 
     return self;
@@ -2035,7 +2035,7 @@
 static NSMutableSet *knownPluginMIMETypes()
 {
     static NSMutableSet *mimeTypes = [[NSMutableSet alloc] init];
-    
+
     return mimeTypes;
 }
 
@@ -2075,7 +2075,7 @@
         viewClass = [[WebFrameView _viewTypesAllowImageTypeOmission:NO] _webkit_objectForMIMEType:MIMEType];
         repClass = [[WebDataSource _repTypesAllowImageTypeOmission:NO] _webkit_objectForMIMEType:MIMEType];
     }
-    
+
     if (viewClass && repClass) {
         if (viewClass == [WebHTMLView class] && repClass == [WebHTMLRepresentation class]) {
             // Special-case WebHTMLView for text types that shouldn't be shown.
@@ -2086,7 +2086,7 @@
             if (!allowPlugins && [knownPluginMIMETypes() containsObject:MIMEType]) {
                 BOOL isSupportedByWebKit = [[WebHTMLView supportedNonImageMIMETypes] containsObject:MIMEType] ||
                     [[WebHTMLView supportedMIMETypes] containsObject:MIMEType];
-                
+
                 // If this is a known plug-in MIME type and WebKit can't show it natively, we don't want to show it.
                 if (!isSupportedByWebKit)
                     return NO;
@@ -2098,7 +2098,7 @@
             *rClass = repClass;
         return YES;
     }
-    
+
     return NO;
 }
 
@@ -2261,7 +2261,7 @@
     // Close both sets of plug-in databases because plug-ins need an opportunity to clean up files, etc.
 
 #if !PLATFORM(IOS_FAMILY)
-    // Unload the WebView local plug-in database. 
+    // Unload the WebView local plug-in database.
     if (_private->pluginDatabase) {
         [_private->pluginDatabase destroyAllPluginInstanceViews];
         [_private->pluginDatabase close];
@@ -2269,13 +2269,13 @@
         _private->pluginDatabase = nil;
     }
 #endif
-    
+
     // Keep the global plug-in database active until the app terminates to avoid having to reload plug-in bundles.
     if (!pluginDatabaseClientCount && applicationIsTerminating)
         [WebPluginDatabase closeSharedDatabase];
 }
 
-- (void)_closeWithFastTeardown 
+- (void)_closeWithFastTeardown
 {
 #ifndef NDEBUG
     WTF::RefCountedLeakCounter::suppressMessages("At least one WebView was closed with fast teardown.");
@@ -2320,7 +2320,7 @@
 
     // Fix for problems such as <rdar://problem/5774587> Crash closing tab in WebCore::Frame::page() from -[WebCoreFrameBridge pauseTimeouts]
     WebThreadRun(^{
-#endif            
+#endif
 
     if (!_private || _private->closed)
         return;
@@ -2428,7 +2428,7 @@
 #if PLATFORM(IOS_FAMILY)
     // Fix for problems such as <rdar://problem/5774587> Crash closing tab in WebCore::Frame::page() from -[WebCoreFrameBridge pauseTimeouts]
     });
-#endif            
+#endif
 }
 
 // Indicates if the WebView is in the midst of a user gesture.
@@ -2470,7 +2470,7 @@
 - (WebDownload *)_downloadURL:(NSURL *)URL
 {
     ASSERT(URL);
-    
+
     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
 ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     WebDownload *download = [WebDownload _downloadWithRequest:request delegate:_private->downloadDelegate directory:nil];
@@ -2664,10 +2664,10 @@
 {
     if (!_private->page)
         return;
-    
+
     if (!otherView->_private->page)
         return;
-    
+
     // It turns out the right combination of behavior is done with the back/forward load
     // type.  (See behavior matrix at the top of WebFramePrivate.)  So we copy all the items
     // in the back forward list, and go to the current one.
@@ -2678,7 +2678,7 @@
     auto& otherBackForward = otherView->_private->page->backForward();
     if (!otherBackForward.currentItem())
         return; // empty back forward list, bail
-    
+
     WebCore::HistoryItem* newItemToGoTo = nullptr;
 
     int lastItemIndex = otherBackForward.forwardCount();
@@ -2690,7 +2690,7 @@
             otherView->_private->page->mainFrame().loader().history().saveDocumentAndScrollState();
         }
         Ref<WebCore::HistoryItem> newItem = otherBackForward.itemAtIndex(i)->copy();
-        if (i == 0) 
+        if (i == 0)
             newItemToGoTo = newItem.ptr();
         backForward.client().addItem(WTFMove(newItem));
     }
@@ -2772,7 +2772,7 @@
 - (BOOL)_needsIsLoadingInAPISenseQuirk
 {
     static BOOL needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.apple.iAdProducer"), -1, 2.1);
-    
+
     return needsQuirk;
 }
 
@@ -2796,17 +2796,17 @@
 #endif // !PLATFORM(IOS_FAMILY)
 
 - (BOOL)_needsPreHTML5ParserQuirks
-{    
+{
 #if !PLATFORM(IOS_FAMILY)
     // AOL Instant Messenger and Microsoft My Day contain markup incompatible
     // with the new HTML5 parser. If these applications were linked against a
     // version of WebKit prior to the introduction of the HTML5 parser, enable
-    // parser quirks to maintain compatibility. For details, see 
+    // parser quirks to maintain compatibility. For details, see
     // <https://bugs.webkit.org/show_bug.cgi?id=46134> and
     // <https://bugs.webkit.org/show_bug.cgi?id=46334>.
     static bool isApplicationNeedingParserQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER)
         && (WebCore::MacApplication::isAOLInstantMessenger() || WebCore::MacApplication::isMicrosoftMyDay());
-    
+
     // Mail.app must continue to display HTML email that contains quirky markup.
     static bool isAppleMail = WebCore::MacApplication::isAppleMail();
 
@@ -3166,11 +3166,15 @@
 #if ENABLE(WEBGL2)
     RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled([preferences webGL2Enabled]);
 #endif
-    
+
 #if ENABLE(WEBGPU)
     RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled([preferences webGPUEnabled]);
 #endif
 
+#if ENABLE(WEBGL) || ENABLE(WEBGL2)
+    RuntimeEnabledFeatures::sharedFeatures().setMaskWebGLStringsEnabled([preferences maskWebGLStringsEnabled]);
+#endif
+
 #if ENABLE(DOWNLOAD_ATTRIBUTE)
     RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled([preferences downloadAttributeEnabled]);
 #endif
@@ -3290,7 +3294,7 @@
 {
     if (_private->closing)
         return nil;
-        
+
     if (!_private->UIKitDelegateForwarder)
         _private->UIKitDelegateForwarder = [[_WebSafeForwarder alloc] initWithTarget:_private->UIKitDelegate defaultTarget:[WebDefaultUIKitDelegate sharedUIKitDelegate]];
     return _private->UIKitDelegateForwarder;
@@ -3491,7 +3495,7 @@
 #if PLATFORM(IOS_FAMILY)
     if (_private->closing)
         return nil;
-#endif    
+#endif
     // This can be called during window deallocation by QTMovieView in the QuickTime Cocoa Plug-in.
     // Not sure if that is a bug or not.
     if (!_private)
@@ -3506,7 +3510,7 @@
 {
     [[WebFrameView _viewTypesAllowImageTypeOmission:NO] removeObjectForKey:MIMEType];
     [[WebDataSource _repTypesAllowImageTypeOmission:NO] removeObjectForKey:MIMEType];
-    
+
     // FIXME: We also need to maintain MIMEType registrations (which can be dynamically changed)
     // in the WebCore MIMEType registry.  For now we're doing this in a safe, limited manner
     // to fix <rdar://problem/5372989> - a future revamping of the entire system is neccesary for future robustness
@@ -3523,7 +3527,7 @@
     // to fix <rdar://problem/5372989> - a future revamping of the entire system is neccesary for future robustness
     if ([viewClass class] == [WebHTMLView class])
         WebCore::MIMETypeRegistry::supportedNonImageMIMETypes().add(MIMEType);
-    
+
     // This is used to make _representationExistsForURLScheme faster.
     // Without this set, we'd have to create the MIME type each time.
     if (schemesWithRepresentationsSet == nil) {
@@ -3703,7 +3707,7 @@
 {
     if (needsSelfRetainWhileLoadingQuirk())
         [self performSelector:@selector(release) withObject:nil afterDelay:0];
-        
+
     [self _didChangeBackForwardKeys];
     if (frame == [self mainFrame]){
         // Force an observer update by sending a will/did.
@@ -3737,7 +3741,7 @@
         // Force an observer update by sending a will/did.
         [self _willChangeValueForKey: _WebIsLoadingKey];
         [self _didChangeValueForKey: _WebIsLoadingKey];
-        
+
         [self _didChangeValueForKey: _WebMainFrameURLKey];
     }
     [NSApp setWindowsNeedUpdate:YES];
@@ -3767,7 +3771,7 @@
     [pasteboard _web_writeImage:(NSImage *)(domElement ? nil : [element objectForKey:WebElementImageKey])
                         element:domElement
                             URL:linkURL ? linkURL : (NSURL *)[element objectForKey:WebElementImageURLKey]
-                          title:[element objectForKey:WebElementImageAltStringKey] 
+                          title:[element objectForKey:WebElementImageAltStringKey]
                         archive:[[element objectForKey:WebElementDOMNodeKey] webArchive]
                           types:types
                          source:nil];
@@ -3889,7 +3893,7 @@
     if (_private->_caretChangeListeners == nil) {
         _private->_caretChangeListeners = [[NSMutableSet alloc] init];
     }
-    
+
     [_private->_caretChangeListeners addObject:listener];
 }
 
@@ -3916,20 +3920,20 @@
 - (void)_clearDelegates
 {
     ASSERT(WebThreadIsLocked() || !WebThreadIsEnabled());
-    
+
     [self _setFormDelegate:nil];
     [self _setUIKitDelegate:nil];
     [self setCaretChangeListener:nil];
     [self removeAllCaretChangeListeners];
     [self setWebMailDelegate:nil];
-    
+
     [self setDownloadDelegate:nil];
-    [self setEditingDelegate:nil]; 
+    [self setEditingDelegate:nil];
     [self setFrameLoadDelegate:nil];
     [self setPolicyDelegate:nil];
     [self setResourceLoadDelegate:nil];
     [self setScriptDebugDelegate:nil];
-    [self setUIDelegate:nil];     
+    [self setUIDelegate:nil];
 }
 
 - (NSURL *)_displayURL
@@ -4022,7 +4026,7 @@
 {
     if (!_private->pluginDatabase)
         _private->pluginDatabase = [[WebPluginDatabase alloc] init];
-        
+
     [_private->pluginDatabase setPlugInPaths:newPaths];
     [_private->pluginDatabase refresh];
 }
@@ -4046,7 +4050,7 @@
         if ([self _locked_plugInsAreRunningInFrame:[childFrames objectAtIndex:childIndex]])
             return YES;
     }
-    
+
     return NO;
 }
 
@@ -4116,7 +4120,7 @@
         WebCore::GraphicsLayer* layerForWidget = coreView->graphicsLayerForPlatformWidget(pluginView);
         if (!layerForWidget)
             continue;
-        
+
         if (layerForWidget->contentsLayerForMedia() != layer) {
             layerForWidget->setContentsToPlatformLayer(layer, WebCore::GraphicsLayer::ContentsLayerPurpose::Media);
             // We need to make sure the layer hierarchy change is applied immediately.
@@ -4317,7 +4321,7 @@
 - (void)_viewGeometryDidChange
 {
     ASSERT(WebThreadIsLocked());
-    
+
     if (auto* coreFrame = [self _mainCoreFrame])
         coreFrame->viewportOffsetChanged(WebCore::Frame::IncrementalScrollOffset);
 }
@@ -4345,7 +4349,7 @@
     auto* frame = [self _mainCoreFrame];
     if (!frame)
         return nil;
-    
+
     auto* document = frame->document();
     if (!document)
         return nil;
@@ -4408,13 +4412,13 @@
 {
     WebCore::IntPoint rectStart(rect.origin.x, rect.origin.y);
     WebCore::IntPoint rectEnd(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height);
-    
+
     auto* coreFrame = [self _mainCoreFrame];
     if (!coreFrame)
         return nil;
-    
+
     WebCore::VisibleSelection selectionInsideRect(coreFrame->visiblePositionForPoint(rectStart), coreFrame->visiblePositionForPoint(rectEnd));
-    
+
     return [[[WebTextIterator alloc] initWithRange:kit(selectionInsideRect.toNormalizedRange().get())] autorelease];
 }
 
@@ -4546,7 +4550,7 @@
     auto* coreFrame = [self _mainCoreFrame];
     if (auto* view = coreFrame->view())
         return view->isTrackingRepaints();
-    
+
     return NO;
 }
 
@@ -4566,7 +4570,7 @@
 
     const Vector<WebCore::FloatRect>& repaintRects = view->trackedRepaintRects();
     NSMutableArray* rectsArray = [[NSMutableArray alloc] initWithCapacity:repaintRects.size()];
-    
+
     for (unsigned i = 0; i < repaintRects.size(); ++i)
         [rectsArray addObject:[NSValue valueWithRect:snappedIntRect(WebCore::LayoutRect(repaintRects[i]))]];
 
@@ -4816,7 +4820,7 @@
     auto* frame = core([self mainFrame]);
     if (suspended == frame->animation().isSuspended())
         return;
-        
+
     if (suspended)
         frame->animation().suspendAnimations();
     else
@@ -4875,11 +4879,11 @@
     auto* coreFrame = [self _mainCoreFrame];
     if (!coreFrame)
         return;
-    
+
     auto* view = coreFrame->view();
     if (!view)
         return;
-    
+
     view->setFixedLayoutSize(WebCore::IntSize(size));
     view->forceLayout();
 }
@@ -4890,11 +4894,11 @@
     auto* coreFrame = [self _mainCoreFrame];
     if (!coreFrame)
         return NO;
-    
+
     auto* view = coreFrame->view();
     if (!view)
         return NO;
-    
+
     return view->useFixedLayout();
 }
 
@@ -4904,7 +4908,7 @@
     auto* coreFrame = [self _mainCoreFrame];
     if (!coreFrame)
         return WebCore::IntSize();
-    
+
     auto* view = coreFrame->view();
     if (!view)
         return WebCore::IntSize();
@@ -5087,7 +5091,7 @@
     auto* page = core(self);
     if (!page)
         return;
-    
+
     page->setPaginationLineGridEnabled(lineGridEnabled);
 }
 
@@ -5096,7 +5100,7 @@
     auto* page = core(self);
     if (!page)
         return NO;
-    
+
     return page->paginationLineGridEnabled();
 }
 
@@ -5141,7 +5145,7 @@
     return [self findString:string options:((forward ? 0 : WebFindOptionsBackwards) | (caseFlag ? 0 : WebFindOptionsCaseInsensitive) | (wrapFlag ? WebFindOptionsWrapAround : 0) | (startInSelection ? WebFindOptionsStartInSelection : 0))];
 }
 
-+ (void)_setLoadResourcesSerially:(BOOL)serialize 
++ (void)_setLoadResourcesSerially:(BOOL)serialize
 {
     WebPlatformStrategies::initializeIfNecessary();
 
@@ -5559,7 +5563,7 @@
 }
 
 + (void)_applicationWillTerminate
-{   
+{
     applicationIsTerminating = YES;
 
     if (fastDocumentTeardownEnabled())
@@ -5595,12 +5599,12 @@
     WebBasePluginPackage *pluginPackage = [[WebPluginDatabase sharedDatabase] pluginForMIMEType:MIMEType];
     if (pluginPackage)
         return pluginPackage;
-    
+
 #if !PLATFORM(IOS_FAMILY)
     if (_private->pluginDatabase)
         return [_private->pluginDatabase pluginForMIMEType:MIMEType];
 #endif
-    
+
     return nil;
 }
 
@@ -5612,12 +5616,12 @@
     WebBasePluginPackage *pluginPackage = [[WebPluginDatabase sharedDatabase] pluginForExtension:extension];
     if (pluginPackage)
         return pluginPackage;
-    
+
 #if !PLATFORM(IOS_FAMILY)
     if (_private->pluginDatabase)
         return [_private->pluginDatabase pluginForExtension:extension];
 #endif
-    
+
     return nil;
 }
 
@@ -5632,13 +5636,13 @@
 - (void)removePluginInstanceView:(NSView *)view
 {
     if (_private->pluginDatabase)
-        [_private->pluginDatabase removePluginInstanceView:view];    
+        [_private->pluginDatabase removePluginInstanceView:view];
 }
 
 - (void)removePluginInstanceViewsFor:(WebFrame*)webFrame
 {
     if (_private->pluginDatabase)
-        [_private->pluginDatabase removePluginInstanceViewsFor:webFrame];    
+        [_private->pluginDatabase removePluginInstanceViewsFor:webFrame];
 }
 #endif
 
@@ -5649,12 +5653,12 @@
 
     if ([[WebPluginDatabase sharedDatabase] isMIMETypeRegistered:MIMEType])
         return YES;
-        
+
 #if !PLATFORM(IOS_FAMILY)
     if (_private->pluginDatabase && [_private->pluginDatabase isMIMETypeRegistered:MIMEType])
         return YES;
 #endif
-    
+
     return NO;
 }
 
@@ -5675,12 +5679,12 @@
     NSEnumerator *enumerator = [viewTypes keyEnumerator];
     id key;
     NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease];
-    
+
     while ((key = [enumerator nextObject])) {
         if ([viewTypes objectForKey:key] == [WebHTMLView class])
             [array addObject:key];
     }
-    
+
     return array;
 }
 
@@ -5693,11 +5697,11 @@
         if ([viewTypes objectForKey:key] == [WebHTMLView class])
             [WebView _unregisterViewClassAndRepresentationClassForMIMEType:key];
     }
-    
+
     int i, count = [MIMETypes count];
     for (i = 0; i < count; i++) {
-        [WebView registerViewClass:[WebHTMLView class] 
-                representationClass:[WebHTMLRepresentation class] 
+        [WebView registerViewClass:[WebHTMLView class]
+                representationClass:[WebHTMLRepresentation class]
                 forMIMEType:[MIMETypes objectAtIndex:i]];
     }
     [viewTypes release];
@@ -5806,7 +5810,7 @@
         WebPreferences *preferences;
         BOOL useBackForwardList = NO;
         BOOL allowsUndo = YES;
-        
+
         result = [super initWithCoder:decoder];
         result->_private = [[WebViewPrivate alloc] init];
 
@@ -5952,7 +5956,7 @@
 #if !PLATFORM(IOS_FAMILY)
 // FIXME: Use AppKit constants for these when they are available.
 static NSString * const windowDidChangeBackingPropertiesNotification = @"NSWindowDidChangeBackingPropertiesNotification";
-static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey"; 
+static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey";
 
 - (void)addWindowObserversForWindow:(NSWindow *)window
 {
@@ -6022,7 +6026,7 @@
 
     if (window) {
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillClose:) name:NSWindowWillCloseNotification object:window];
-         
+
         // Ensure that we will receive the events that WebHTMLView (at least) needs.
         // The following are expensive enough that we don't want to call them over
         // and over, so do them when we move into a window.
@@ -6032,7 +6036,7 @@
         _private->page->setCanStartMedia(false);
         _private->page->setIsInWindow(false);
     }
-        
+
     if (window != [self window]) {
         [self removeWindowObservers];
         [self addWindowObserversForWindow:window];
@@ -6148,10 +6152,10 @@
 
 - (void)_windowDidChangeBackingProperties:(NSNotification *)notification
 {
-    CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue]; 
+    CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue];
     CGFloat newBackingScaleFactor = [self _deviceScaleFactor];
-    if (oldBackingScaleFactor == newBackingScaleFactor) 
-        return; 
+    if (oldBackingScaleFactor == newBackingScaleFactor)
+        return;
 
     _private->page->setDeviceScaleFactor(newBackingScaleFactor);
 }
@@ -6354,7 +6358,7 @@
     WebFrame *focusedFrame = [self _focusedFrame];
     if (focusedFrame)
         return focusedFrame;
-    
+
     // If the first responder is outside of our view tree, we search for a frame containing a selection.
     // There should be at most only one of these.
     return [[self mainFrame] _findFrameWithSelection];
@@ -6381,7 +6385,7 @@
 {
     if (!_private->page)
         return NO;
-    
+
 #if PLATFORM(IOS_FAMILY)
     if (WebThreadIsCurrent() || !WebThreadIsEnabled())
 #endif
@@ -6468,7 +6472,7 @@
 {
     if (!_private->page)
         return NO;
-    
+
     return _private->zoomsTextOnly;
 }
 
@@ -6705,7 +6709,7 @@
     // so we check here to make sure it's not null.
     if (!_private)
         return nil;
-    
+
     return _private->hostWindow;
 }
 
@@ -6734,8 +6738,8 @@
 
 #if ENABLE(DRAG_SUPPORT) && PLATFORM(MAC)
 // The following 2 internal NSView methods are called on the drag destination to make scrolling while dragging work.
-// Scrolling while dragging will only work if the drag destination is in a scroll view. The WebView is the drag destination. 
-// When dragging to a WebView, the document subview should scroll, but it doesn't because it is not the drag destination. 
+// Scrolling while dragging will only work if the drag destination is in a scroll view. The WebView is the drag destination.
+// When dragging to a WebView, the document subview should scroll, but it doesn't because it is not the drag destination.
 // Forward these calls to the document subview to make its scroll view scroll.
 - (void)_autoscrollForDraggingInfo:(id)draggingInfo timeDelta:(NSTimeInterval)repeatDelta
 {
@@ -6815,7 +6819,7 @@
 
     NSArray* types = draggingInfo.draggingPasteboard.types;
     if (![types containsObject:WebArchivePboardType] && [types containsObject:WebCore::legacyFilesPromisePasteboardType()]) {
-        
+
         // FIXME: legacyFilesPromisePasteboardType() contains UTIs, not path names. Also, it's not
         // guaranteed that the count of UTIs equals the count of files, since some clients only write
         // unique UTIs.
@@ -6885,7 +6889,7 @@
         ASSERT_NOT_REACHED();
         return NO;
     }
-    
+
     // This works together with setNextKeyView to splice the WebView into
     // the key loop similar to the way NSScrollView does this. Note that
     // WebFrameView has very similar code.
@@ -6921,7 +6925,7 @@
         _private->becomingFirstResponder = NO;
 #endif
         return YES;
-    } 
+    }
 
     return NO;
 }
@@ -6965,7 +6969,7 @@
 {
     [[WebFrameView _viewTypesAllowImageTypeOmission:YES] setObject:viewClass forKey:MIMEType];
     [[WebDataSource _repTypesAllowImageTypeOmission:YES] setObject:representationClass forKey:MIMEType];
-    
+
     // FIXME: We also need to maintain MIMEType registrations (which can be dynamically changed)
     // in the WebCore MIMEType registry.  For now we're doing this in a safe, limited manner
     // to fix <rdar://problem/5372989> - a future revamping of the entire system is neccesary for future robustness
@@ -7136,11 +7140,11 @@
     auto* coreMainFrame = core(mainFrame);
     if (!coreMainFrame)
         return nil;
-    
+
     auto* documentLoader = coreMainFrame->loader().documentLoader();
     if (!documentLoader)
         return nil;
-    
+
     auto& linkIcons = documentLoader->linkIcons();
     if (linkIcons.isEmpty())
         return nil;
@@ -7470,7 +7474,7 @@
 - (IBAction)takeStringURLFrom: sender
 {
     NSString *URLString = [sender stringValue];
-    
+
     [[self mainFrame] loadRequest: [NSURLRequest requestWithURL: [NSURL _web_URLWithDataAsString: URLString]]];
 }
 
@@ -7556,11 +7560,11 @@
 {
 #if PLATFORM(IOS_FAMILY)
     WebThreadRun(^{
-#endif            
+#endif
     [[self mainFrame] reload];
 #if PLATFORM(IOS_FAMILY)
     });
-#endif            
+#endif
 }
 
 - (IBAction)reloadFromOrigin:(id)sender
@@ -7748,28 +7752,28 @@
 {
     if (_private->closed)
         return NO;
-    
+
     // Get the frame holding the selection, or start with the main frame
     WebFrame *startFrame = [self _selectedOrMainFrame];
-    
+
     // Search the first frame, then all the other frames, in order
     NSView <WebDocumentSearching> *startSearchView = nil;
     WebFrame *frame = startFrame;
     do {
         WebFrame *nextFrame = incrementFrame(frame, options);
-        
+
         BOOL _onlyOneFrame_ = (frame == nextFrame);
         ASSERT(!onlyOneFrame || frame == startFrame);
-        
+
         id <WebDocumentView> view = [[frame frameView] documentView];
         if ([view conformsToProtocol:@protocol(WebDocumentSearching)]) {
             NSView <WebDocumentSearching> *searchView = (NSView <WebDocumentSearching> *)view;
-            
+
             if (frame == startFrame)
                 startSearchView = searchView;
-            
+
             // In some cases we have to search some content twice; see comment later in this method.
-            // We can avoid ever doing this in the common one-frame case by passing the wrap option through 
+            // We can avoid ever doing this in the common one-frame case by passing the wrap option through
             // here, and then bailing out before we get to the code that would search again in the
             // same content.
             WebFindOptions optionsForThisPass = onlyOneFrame ? options : (options & ~WebFindOptionsWrapAround);
@@ -7780,15 +7784,15 @@
                 [[self window] makeFirstResponder:searchView];
                 return YES;
             }
-            
+
             if (onlyOneFrame)
                 return NO;
         }
         frame = nextFrame;
     } while (frame && frame != startFrame);
-    
-    // If there are multiple frames and WebFindOptionsWrapAround is set and we've visited each one without finding a result, we still need to search in the 
-    // first-searched frame up to the selection. However, the API doesn't provide a way to search only up to a particular point. The only 
+
+    // If there are multiple frames and WebFindOptionsWrapAround is set and we've visited each one without finding a result, we still need to search in the
+    // first-searched frame up to the selection. However, the API doesn't provide a way to search only up to a particular point. The only
     // way to make sure the entire frame is searched is to pass WebFindOptionsWrapAround. When there are no matches, this will search
     // some content that we already searched on the first pass. In the worst case, we could search the entire contents of this frame twice.
     // To fix this, we'd need to add a mechanism to specify a range in which to search.
@@ -7851,7 +7855,7 @@
 {
     return _private->scriptDebugDelegate;
 }
-  
+
 - (void)setHistoryDelegate:(id)delegate
 {
     _private->historyDelegate = delegate;
@@ -7951,10 +7955,10 @@
         id <WebDocumentView> view = [[frame frameView] documentView];
         if (view && ![view conformsToProtocol:@protocol(WebMultipleTextMatches)])
             return NO;
-        
+
         frame = incrementFrame(frame);
     } while (frame);
-    
+
     return YES;
 }
 
@@ -7975,7 +7979,7 @@
         if ([view conformsToProtocol:@protocol(WebMultipleTextMatches)]) {
             if (markMatches)
                 [(NSView <WebMultipleTextMatches>*)view setMarkedTextMatchesAreHighlighted:highlight];
-        
+
             ASSERT(limit == 0 || matchCount < limit);
             matchCount += [(NSView <WebMultipleTextMatches>*)view countMatchesForText:string inDOMRange:range options:options limit:(limit == 0 ? 0 : limit - matchCount) markMatches:markMatches];
 
@@ -7983,10 +7987,10 @@
             if (limit > 0 && matchCount >= limit)
                 break;
         }
-        
+
         frame = incrementFrame(frame);
     } while (frame);
-    
+
     return matchCount;
 }
 
@@ -8000,7 +8004,7 @@
         id <WebDocumentView> view = [[frame frameView] documentView];
         if ([view conformsToProtocol:@protocol(WebMultipleTextMatches)])
             [(NSView <WebMultipleTextMatches>*)view unmarkAllTextMatches];
-        
+
         frame = incrementFrame(frame);
     } while (frame);
 }
@@ -8034,7 +8038,7 @@
 
         frame = incrementFrame(frame);
     } while (frame);
-    
+
     return result;
 }
 
@@ -8187,7 +8191,7 @@
     NSRectFill(rect);
     [currentContext restoreGraphicsState];
 #endif
-    
+
     SEL selector = @selector(webView:drawFooterInRect:);
     if (![_private->UIDelegate respondsToSelector:selector])
         return;
@@ -8206,7 +8210,7 @@
     NSPrintOperation *op = [NSPrintOperation currentOperation];
     NSPrintInfo *info = [op printInfo];
     NSMutableDictionary *infoDictionary = [info dictionary];
-    
+
     // We need to modify the top and bottom margins in the NSPrintInfo to account for the space needed by the
     // header and footer. Because this method can be called more than once on the same NSPrintInfo (see 5038087),
     // we stash away the unmodified top and bottom margins the first time this method is called, and we read from
@@ -8226,7 +8230,7 @@
         originalTopMargin = [originalTopMarginNumber floatValue];
         originalBottomMargin = [[infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey] floatValue];
     }
-    
+
     float scale = [op _web_pageSetupScaleFactor];
     [info setTopMargin:originalTopMargin + [self _headerHeight] * scale];
     [info setBottomMargin:originalBottomMargin + [self _footerHeight] * scale];
@@ -8242,11 +8246,11 @@
     NSSize paperSize = [printInfo paperSize];
     float headerFooterLeft = [printInfo leftMargin]/scale;
     float headerFooterWidth = (paperSize.width - ([printInfo leftMargin] + [printInfo rightMargin]))/scale;
-    NSRect footerRect = NSMakeRect(headerFooterLeft, [printInfo bottomMargin]/scale - [self _footerHeight] , 
+    NSRect footerRect = NSMakeRect(headerFooterLeft, [printInfo bottomMargin]/scale - [self _footerHeight] ,
                                    headerFooterWidth, [self _footerHeight]);
-    NSRect headerRect = NSMakeRect(headerFooterLeft, (paperSize.height - [printInfo topMargin])/scale, 
+    NSRect headerRect = NSMakeRect(headerFooterLeft, (paperSize.height - [printInfo topMargin])/scale,
                                    headerFooterWidth, [self _headerHeight]);
-    
+
     [self _drawHeaderInRect:headerRect];
     [self _drawFooterInRect:footerRect];
 }
@@ -8475,11 +8479,11 @@
     [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidEndEditingNotification object:self];
     [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidChangeTypingStyleNotification object:self];
     [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidChangeSelectionNotification object:self];
-    
+
     _private->editingDelegate = delegate;
     [_private->editingDelegateForwarder release];
     _private->editingDelegateForwarder = nil;
-    
+
     // add notifications for new delegate
     [self registerForEditingDelegateNotification:WebViewDidBeginEditingNotification selector:@selector(webViewDidBeginEditing:)];
     [self registerForEditingDelegateNotification:WebViewDidChangeNotification selector:@selector(webViewDidChange:)];
@@ -8517,14 +8521,14 @@
 {
     if (grammarCheckingEnabled == flag)
         return;
-    
+
     grammarCheckingEnabled = flag;
-    [[NSUserDefaults standardUserDefaults] setBool:grammarCheckingEnabled forKey:WebGrammarCheckingEnabled];    
+    [[NSUserDefaults standardUserDefaults] setBool:grammarCheckingEnabled forKey:WebGrammarCheckingEnabled];
     [[NSSpellChecker sharedSpellChecker] updatePanels];
 
     // We call _preflightSpellChecker when turning continuous spell checking on, but we don't need to do that here
     // because grammar checking only occurs on code paths that already preflight spell checking appropriately.
-    
+
     if (![self isGrammarCheckingEnabled])
         [[self mainFrame] _unmarkAllBadGrammar];
 }
@@ -8592,7 +8596,7 @@
     if (automaticQuoteSubstitutionEnabled == flag)
         return;
     automaticQuoteSubstitutionEnabled = flag;
-    [[NSUserDefaults standardUserDefaults] setBool:automaticQuoteSubstitutionEnabled forKey:WebAutomaticQuoteSubstitutionEnabled];    
+    [[NSUserDefaults standardUserDefaults] setBool:automaticQuoteSubstitutionEnabled forKey:WebAutomaticQuoteSubstitutionEnabled];
     [[NSSpellChecker sharedSpellChecker] updatePanels];
 }
 
@@ -8606,7 +8610,7 @@
     if (automaticLinkDetectionEnabled == flag)
         return;
     automaticLinkDetectionEnabled = flag;
-    [[NSUserDefaults standardUserDefaults] setBool:automaticLinkDetectionEnabled forKey:WebAutomaticLinkDetectionEnabled];    
+    [[NSUserDefaults standardUserDefaults] setBool:automaticLinkDetectionEnabled forKey:WebAutomaticLinkDetectionEnabled];
     [[NSSpellChecker sharedSpellChecker] updatePanels];
 }
 
@@ -8620,7 +8624,7 @@
     if (automaticDashSubstitutionEnabled == flag)
         return;
     automaticDashSubstitutionEnabled = flag;
-    [[NSUserDefaults standardUserDefaults] setBool:automaticDashSubstitutionEnabled forKey:WebAutomaticDashSubstitutionEnabled];    
+    [[NSUserDefaults standardUserDefaults] setBool:automaticDashSubstitutionEnabled forKey:WebAutomaticDashSubstitutionEnabled];
     [[NSSpellChecker sharedSpellChecker] updatePanels];
 }
 
@@ -8634,7 +8638,7 @@
     if (automaticTextReplacementEnabled == flag)
         return;
     automaticTextReplacementEnabled = flag;
-    [[NSUserDefaults standardUserDefaults] setBool:automaticTextReplacementEnabled forKey:WebAutomaticTextReplacementEnabled];    
+    [[NSUserDefaults standardUserDefaults] setBool:automaticTextReplacementEnabled forKey:WebAutomaticTextReplacementEnabled];
     [[NSSpellChecker sharedSpellChecker] updatePanels];
 }
 
@@ -8648,7 +8652,7 @@
     if (automaticSpellingCorrectionEnabled == flag)
         return;
     automaticSpellingCorrectionEnabled = flag;
-    [[NSUserDefaults standardUserDefaults] setBool:automaticSpellingCorrectionEnabled forKey:WebAutomaticSpellingCorrectionEnabled];    
+    [[NSUserDefaults standardUserDefaults] setBool:automaticSpellingCorrectionEnabled forKey:WebAutomaticSpellingCorrectionEnabled];
     [[NSSpellChecker sharedSpellChecker] updatePanels];
 }
 
@@ -8666,7 +8670,7 @@
 - (void)replaceSelectionWithNode:(DOMNode *)node
 {
     [[self _selectedOrMainFrame] _replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:NO];
-}    
+}
 
 - (void)replaceSelectionWithText:(NSString *)text
 {
@@ -8690,7 +8694,7 @@
     if (coreFrame)
         coreFrame->editor().deleteSelectionWithSmartDelete([(WebHTMLView *)[[webFrame frameView] documentView] _canSmartCopyOrDelete]);
 }
-    
+
 - (void)applyStyle:(DOMCSSStyleDeclaration *)style
 {
     // We don't know enough at thls level to pass in a relevant WebUndoAction; we'd have to
@@ -8749,7 +8753,7 @@
     auto* coreFrame = core([self _selectedOrMainFrame]);
     if (!coreFrame)
         return;
-    
+
     coreFrame->editor().insertDictationPhrases(vectorForDictationPhrasesArray(dictationPhrases), metadata);
 }
 #endif
@@ -8763,7 +8767,7 @@
 {
     if (auto* coreFrame = core([self _selectedOrMainFrame]))
         return coreFrame->editor().fontAttributesAtSelectionStart().createDictionary().autorelease();
-    
+
     return nil;
 }
 
@@ -8853,7 +8857,7 @@
             cacheTotalCapacity = 16 * 1024 * 1024;
 #if PLATFORM(IOS_FAMILY)
         else
-            cacheTotalCapacity = 4 * 1024 * 1024; 
+            cacheTotalCapacity = 4 * 1024 * 1024;
 #endif
 
         cacheMinDeadCapacity = 0;
@@ -8904,7 +8908,7 @@
         else if (memSize >= 512)
             nsurlCacheMemoryCapacity = 1 * 1024 * 1024;
         else
-            nsurlCacheMemoryCapacity =      512 * 1024; 
+            nsurlCacheMemoryCapacity =      512 * 1024;
 
         // Foundation disk cache capacity (in bytes)
         if (diskFreeSize >= 16384)
@@ -8936,7 +8940,7 @@
 
         // Object cache capacities (in bytes)
         // (Testing indicates that value / MB depends heavily on content and
-        // browsing pattern. Even growth above 128MB can have substantial 
+        // browsing pattern. Even growth above 128MB can have substantial
         // value / MB for some content / browsing patterns.)
         if (memSize >= 4096)
             cacheTotalCapacity = 192 * 1024 * 1024;
@@ -8971,7 +8975,7 @@
         else if (memSize >= 256)
             nsurlCacheMemoryCapacity = 1 * 1024 * 1024;
         else
-            nsurlCacheMemoryCapacity =      512 * 1024; 
+            nsurlCacheMemoryCapacity =      512 * 1024;
 #endif
 
         // Foundation disk cache capacity (in bytes)
@@ -9047,7 +9051,7 @@
     WebDataSource *dataSource = [(WebFrame *)[element objectForKey:WebElementFrameKey] dataSource];
     NSURLRequest *request = [[dataSource request] copy];
     ASSERT(request);
-    
+
     [self _openNewWindowWithRequest:request];
     [request release];
 }
@@ -9058,12 +9062,12 @@
     if (![documentView conformsToProtocol:@protocol(WebDocumentText)]) {
         return;
     }
-    
+
     NSString *selectedString = [(id <WebDocumentText>)documentView selectedString];
     if ([selectedString length] == 0) {
         return;
     }
-    
+
     NSPasteboard *pasteboard = [NSPasteboard pasteboardWithUniqueName];
     [pasteboard declareTypes:[NSArray arrayWithObject:WebCore::legacyStringPasteboardType()] owner:nil];
     NSMutableString *s = [selectedString mutableCopy];
@@ -9072,7 +9076,7 @@
     [s replaceOccurrencesOfString:nonBreakingSpaceString withString:@" " options:0 range:NSMakeRange(0, [s length])];
     [pasteboard setString:s forType:WebCore::legacyStringPasteboardType()];
     [s release];
-    
+
     // FIXME: seems fragile to use the service by name, but this is what AppKit does
     NSPerformService(@"Search With Google", pasteboard);
 }
@@ -9110,11 +9114,11 @@
     ASSERT(!_private->identifierMap.contains(identifier));
 
     // If the identifier map is initially empty it means we're starting a load
-    // of something. The semantic is that the web view should be around as long 
+    // of something. The semantic is that the web view should be around as long
     // as something is loading. Because of that we retain the web view.
     if (_private->identifierMap.isEmpty())
         CFRetain(self);
-    
+
     _private->identifierMap.set(identifier, object);
 }
 
@@ -9127,7 +9131,7 @@
 {
     ASSERT(_private->identifierMap.contains(identifier));
     _private->identifierMap.remove(identifier);
-    
+
     // If the identifier map is now empty it means we're no longer loading anything
     // and we should release the web view. Autorelease rather than release in order to
     // avoid re-entering this method beneath -dealloc with the same identifier. <rdar://problem/10523721>
@@ -9159,15 +9163,15 @@
         _private->_keyboardUIModeAccessed = YES;
 
         [self _retrieveKeyboardUIModeFromPreferences:nil];
-        
+
 #if !PLATFORM(IOS_FAMILY)
-        [[NSDistributedNotificationCenter defaultCenter] 
-            addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:) 
+        [[NSDistributedNotificationCenter defaultCenter]
+            addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
             name:KeyboardUIModeDidChangeNotification object:nil];
 #endif
 
-        [[NSNotificationCenter defaultCenter] 
-            addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:) 
+        [[NSNotificationCenter defaultCenter]
+            addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
             name:WebPreferencesChangedInternalNotification object:nil];
     }
     return _private->_keyboardUIMode;
@@ -9218,7 +9222,7 @@
 
 /*
     The order of events with compositing updates is this:
-    
+
    Start of runloop                                        End of runloop
         |                                                       |
       --|-------------------------------------------------------|--
@@ -9225,8 +9229,8 @@
            ^         ^                                        ^
            |         |                                        |
     NSWindow update, |                                     CA commit
-     NSView drawing  |                                  
-        flush        |                                  
+     NSView drawing  |
+        flush        |
                 layerSyncRunLoopObserverCallBack
 
     To avoid flashing, we have to ensure that compositing changes (rendered via
@@ -9236,19 +9240,19 @@
     CoreAnimation will commit any layer changes at the end of the runloop via
     its "CA commit" observer. Those changes can then appear onscreen at any time
     when the display link fires, which can result in unsynchronized rendering.
-    
+
     To fix this, the GraphicsLayerCA code in WebCore does not change the CA
     layer tree during style changes and layout; it stores up all changes and
     commits them via flushCompositingState(). There are then two situations in
     which we can call flushCompositingState():
-    
+
     1. When painting. FrameView::paintContents() makes a call to flushCompositingState().
-    
+
     2. When style changes/layout have made changes to the layer tree which do not
        result in painting. In this case we need a run loop observer to do a
        flushCompositingState() at an appropriate time. The observer will keep firing
        until the time is right (essentially when there are no more pending layouts).
-    
+
 */
 bool LayerFlushController::flushLayers()
 {
@@ -9412,7 +9416,7 @@
 
     [_private->newFullscreenController setElement:element.get()];
     [_private->newFullscreenController setWebView:self];
-    [_private->newFullscreenController enterFullScreen:[[self window] screen]];        
+    [_private->newFullscreenController enterFullScreen:[[self window] screen]];
 }
 
 - (void)_exitFullScreenForElement:(NakedPtr<WebCore::Element>)element
@@ -9551,12 +9555,12 @@
         return;
 
     _private->hasInitializedLookupObserver = YES;
-    
+
 #if !ENABLE(REVEAL)
     if (PAL::canLoad_Lookup_LUNotificationPopoverWillClose())
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:PAL::get_Lookup_LUNotificationPopoverWillClose() object:nil];
 #endif // !ENABLE(REVEAL)
-    
+
 }
 
 - (void)_showDictionaryLookupPopup:(const WebCore::DictionaryPopupInfo&)dictionaryPopupInfo
@@ -9815,7 +9819,7 @@
     NSView *documentView = [[[self _selectedOrMainFrame] frameView] documentView];
     if (![documentView isKindOfClass:[WebHTMLView class]])
         return;
-    
+
     WebHTMLView *webHTMLView = (WebHTMLView *)documentView;
     if (![webHTMLView _isEditable])
         return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to