Changeset 256697 in webkit


Ignore:
Timestamp:
Feb 14, 2020 7:19:00 PM (4 years ago)
Author:
jonlee@apple.com
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.
Location:
trunk
Files:
3 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r256659 r256697  
     12020-02-14  Jon Lee  <jonlee@apple.com>
     2
     3        Mask WebGL strings
     4        https://bugs.webkit.org/show_bug.cgi?id=207608
     5
     6        Reviewed by Dean Jackson.
     7
     8        * platform/mac/webgl/fingerprinting-strings-expected.txt: Added.
     9        * platform/mac/webgl/fingerprinting-strings.html: Added.
     10
    1112020-02-14  Nikos Mouchtaris  <nmouchtaris@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r256664 r256697  
     12020-02-14  Jon Lee  <jonlee@apple.com>
     2
     3        Mask WebGL strings
     4        https://bugs.webkit.org/show_bug.cgi?id=207608
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test: platform/mac/webgl/fingerprinting-strings.html
     9
     10        Add new experimental feature to mask WebGL vendor, renderer, and shading language strings.
     11
     12        * html/canvas/WebGL2RenderingContext.cpp: Whitespace cleanup also.
     13        (WebCore::WebGL2RenderingContext::getParameter): Check against the runtime feature to return the
     14        old string.
     15        * html/canvas/WebGLRenderingContext.cpp:
     16        (WebCore::WebGLRenderingContext::getParameter): Ditto.
     17        * page/RuntimeEnabledFeatures.h:
     18        (WebCore::RuntimeEnabledFeatures::setMaskWebGLStringsEnabled):
     19        (WebCore::RuntimeEnabledFeatures::maskWebGLStringsEnabled const):
     20
    1212020-02-14  Youenn Fablet  <youenn@apple.com>
    222
  • trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

    r256418 r256697  
    11/*
    2  * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4444#include "OESTextureHalfFloatLinear.h"
    4545#include "RenderBox.h"
     46#include "RuntimeEnabledFeatures.h"
    4647#include "WebGLActiveInfo.h"
    4748#include "WebGLCompressedTextureASTC.h"
     
    941942    if (isContextLostOrPending())
    942943        return;
    943    
     944
    944945    WebGLRenderingContextBase::vertexAttribDivisor(index, divisor);
    945946}
     
    15171518    if (isContextLost())
    15181519        return nullptr;
    1519    
     1520
    15201521    auto object = WebGLVertexArrayObject::create(*this, WebGLVertexArrayObject::Type::User);
    15211522    addContextObject(object.get());
     
    15271528    if (!arrayObject || isContextLost())
    15281529        return;
    1529    
     1530
    15301531    if (arrayObject->isDeleted())
    15311532        return;
    1532    
     1533
    15331534    if (!arrayObject->isDefaultObject() && arrayObject == m_boundVertexArrayObject)
    15341535#if USE(OPENGL_ES)
     
    15371538        bindVertexArray(nullptr); // The default VAO was removed in OpenGL 3.3 but not from WebGL 2; bind the default for WebGL to use.
    15381539#endif
    1539    
     1540
    15401541    arrayObject->deleteObject(graphicsContextGL());
    15411542}
     
    15451546    if (!arrayObject || isContextLost())
    15461547        return false;
    1547    
     1548
    15481549    if (!arrayObject->hasEverBeenBound() || !arrayObject->validate(0, *this))
    15491550        return false;
    1550    
     1551
    15511552    return m_context->isVertexArray(arrayObject->object());
    15521553}
     
    15561557    if (isContextLost())
    15571558        return;
    1558    
     1559
    15591560    if (arrayObject && (arrayObject->isDeleted() || !arrayObject->validate(0, *this) || !m_contextObjects.contains(arrayObject))) {
    15601561        m_context->synthesizeGLError(GraphicsContextGL::INVALID_OPERATION);
     
    15631564    if (arrayObject && !arrayObject->isDefaultObject() && arrayObject->object()) {
    15641565        m_context->bindVertexArray(arrayObject->object());
    1565        
     1566
    15661567        arrayObject->setHasEverBeenBound();
    15671568        setBoundVertexArrayObject(arrayObject);
     
    16111612
    16121613    Vector<String> result;
    1613    
     1614
    16141615    if (m_isPendingPolicyResolution)
    16151616        return result;
     
    17051706    }
    17061707    }
    1707    
     1708
    17081709    if (object->isTexture()) {
    17091710        switch (pname) {
     
    21152116        return getBooleanParameter(pname);
    21162117    case GraphicsContextGL::SHADING_LANGUAGE_VERSION:
    2117         return "WebGL GLSL ES 1.0 (" + m_context->getString(GraphicsContextGL::SHADING_LANGUAGE_VERSION) + ")";
     2118        if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
     2119            return "WebGL GLSL ES 1.0 (" + m_context->getString(GraphicsContextGL::SHADING_LANGUAGE_VERSION) + ")";
     2120        return "WebGL GLSL ES 1.0 (1.0)"_str;
    21182121    case GraphicsContextGL::STENCIL_BACK_FAIL:
    21192122        return getUnsignedIntParameter(pname);
     
    21742177    case WebGLDebugRendererInfo::UNMASKED_RENDERER_WEBGL:
    21752178        if (m_webglDebugRendererInfo) {
    2176 #if PLATFORM(IOS_FAMILY)
     2179#if !PLATFORM(IOS_FAMILY)
     2180            if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
     2181                return m_context->getString(GraphicsContextGL::RENDERER);
     2182#endif
    21772183            return "Apple GPU"_str;
    2178 #else
    2179             return m_context->getString(GraphicsContextGL::RENDERER);
     2184        }
     2185        synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
     2186        return nullptr;
     2187    case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
     2188        if (m_webglDebugRendererInfo) {
     2189#if !PLATFORM(IOS_FAMILY)
     2190            if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
     2191                return m_context->getString(GraphicsContextGL::VENDOR);
    21802192#endif
    2181         }
    2182         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
    2183         return nullptr;
    2184     case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
    2185         if (m_webglDebugRendererInfo)
    2186             return m_context->getString(GraphicsContextGL::VENDOR);
     2193            return "Apple Inc."_str;
     2194        }
    21872195        synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
    21882196        return nullptr;
     
    22422250    case GraphicsContextGL::MAX_VERTEX_UNIFORM_BLOCKS:
    22432251        return getIntParameter(pname);
    2244     case GraphicsContextGL::MAX_VERTEX_UNIFORM_COMPONENTS: 
    2245         return getIntParameter(pname);                           
     2252    case GraphicsContextGL::MAX_VERTEX_UNIFORM_COMPONENTS:
     2253        return getIntParameter(pname);
    22462254    case GraphicsContextGL::MIN_PROGRAM_TEXEL_OFFSET:
    22472255        return getIntParameter(pname);
     
    23072315    case GraphicsContextGL::COPY_READ_BUFFER:
    23082316    case GraphicsContextGL::COPY_WRITE_BUFFER:
    2309     case GraphicsContextGL::PIXEL_PACK_BUFFER_BINDING:   
     2317    case GraphicsContextGL::PIXEL_PACK_BUFFER_BINDING:
    23102318    case GraphicsContextGL::PIXEL_UNPACK_BUFFER_BINDING:
    23112319    case GraphicsContextGL::READ_BUFFER:
     
    23282336    // index, skips the expensive per-draw-call iteration in
    23292337    // validateIndexArrayPrecise.
    2330    
     2338
    23312339    RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer();
    2332    
     2340
    23332341    if (!elementArrayBuffer)
    23342342        return false;
    2335    
     2343
    23362344    GCGLsizeiptr numElements = elementArrayBuffer->byteLength();
    23372345    // The case count==0 is already dealt with in drawElements before validateIndexArrayConservative.
     
    23402348    auto buffer = elementArrayBuffer->elementArrayBuffer();
    23412349    ASSERT(buffer);
    2342    
     2350
    23432351    Optional<unsigned> maxIndex = elementArrayBuffer->getCachedMaxIndex(type);
    23442352    if (!maxIndex) {
     
    23602368            elementArrayBuffer->setCachedMaxIndex(type, maxIndex.value());
    23612369    }
    2362    
     2370
    23632371    if (!maxIndex)
    23642372        return false;
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r254214 r256697  
    11/*
    2  * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
    2525
     
    5050#include "OESVertexArrayObject.h"
    5151#include "RenderBox.h"
     52#include "RuntimeEnabledFeatures.h"
    5253#include "WebGLCompressedTextureASTC.h"
    5354#include "WebGLCompressedTextureATC.h"
     
    192193
    193194    Vector<String> result;
    194    
     195
    195196    if (m_isPendingPolicyResolution)
    196197        return result;
    197    
     198
    198199    if (m_context->getExtensions().supports("GL_EXT_blend_minmax"_s))
    199200        result.append("EXT_blend_minmax"_s);
     
    250251    if (isContextLostOrPending() || !validateFramebufferFuncParameters("getFramebufferAttachmentParameter", target, attachment))
    251252        return nullptr;
    252    
     253
    253254    if (!m_framebufferBinding || !m_framebufferBinding->object()) {
    254255        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "getFramebufferAttachmentParameter", "no framebuffer bound");
    255256        return nullptr;
    256257    }
    257    
     258
    258259    auto object = makeRefPtr(m_framebufferBinding->getAttachmentObject(attachment));
    259260    if (!object) {
     
    265266        return nullptr;
    266267    }
    267    
     268
    268269    if (object->isTexture()) {
    269270        switch (pname) {
     
    332333    }
    333334}
    334    
     335
    335336void WebGLRenderingContext::renderbufferStorage(GCGLenum target, GCGLenum internalformat, GCGLsizei width, GCGLsizei height)
    336337{
     
    397398    m_context->hint(target, mode);
    398399}
    399    
     400
    400401void WebGLRenderingContext::clear(GCGLbitfield mask)
    401402{
     
    547548        return getBooleanParameter(pname);
    548549    case GraphicsContextGL::SHADING_LANGUAGE_VERSION:
    549         return "WebGL GLSL ES 1.0 (" + m_context->getString(GraphicsContextGL::SHADING_LANGUAGE_VERSION) + ")";
     550        if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
     551            return "WebGL GLSL ES 1.0 (" + m_context->getString(GraphicsContextGL::SHADING_LANGUAGE_VERSION) + ")";
     552        return "WebGL GLSL ES 1.0 (1.0)"_str;
    550553    case GraphicsContextGL::STENCIL_BACK_FAIL:
    551554        return getUnsignedIntParameter(pname);
     
    611614    case WebGLDebugRendererInfo::UNMASKED_RENDERER_WEBGL:
    612615        if (m_webglDebugRendererInfo) {
    613 #if PLATFORM(IOS_FAMILY)
     616#if !PLATFORM(IOS_FAMILY)
     617            if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
     618                return m_context->getString(GraphicsContextGL::RENDERER);
     619#endif
    614620            return "Apple GPU"_str;
    615 #else
    616             return m_context->getString(GraphicsContextGL::RENDERER);
     621        }
     622        synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
     623        return nullptr;
     624    case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
     625        if (m_webglDebugRendererInfo) {
     626#if !PLATFORM(IOS_FAMILY)
     627            if (!RuntimeEnabledFeatures::sharedFeatures().maskWebGLStringsEnabled())
     628                return m_context->getString(GraphicsContextGL::VENDOR);
    617629#endif
    618         }
    619         synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
    620         return nullptr;
    621     case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
    622         if (m_webglDebugRendererInfo)
    623             return m_context->getString(GraphicsContextGL::VENDOR);
     630            return "Apple Inc."_str;
     631        }
    624632        synthesizeGLError(GraphicsContextGL::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_debug_renderer_info not enabled");
    625633        return nullptr;
     
    683691    return m_maxColorAttachments;
    684692}
    685    
     693
    686694bool WebGLRenderingContext::validateIndexArrayConservative(GCGLenum type, unsigned& numElementsRequired)
    687695{
     
    691699    // index, skips the expensive per-draw-call iteration in
    692700    // validateIndexArrayPrecise.
    693    
     701
    694702    RefPtr<WebGLBuffer> elementArrayBuffer = m_boundVertexArrayObject->getElementArrayBuffer();
    695    
     703
    696704    if (!elementArrayBuffer)
    697705        return false;
    698    
     706
    699707    GCGLsizeiptr numElements = elementArrayBuffer->byteLength();
    700708    // The case count==0 is already dealt with in drawElements before validateIndexArrayConservative.
     
    703711    auto buffer = elementArrayBuffer->elementArrayBuffer();
    704712    ASSERT(buffer);
    705    
     713
    706714    Optional<unsigned> maxIndex = elementArrayBuffer->getCachedMaxIndex(type);
    707715    if (!maxIndex) {
     
    736744            elementArrayBuffer->setCachedMaxIndex(type, maxIndex.value());
    737745    }
    738    
     746
    739747    if (!maxIndex)
    740748        return false;
  • trunk/Source/WebCore/page/RuntimeEnabledFeatures.h

    r255406 r256697  
    7979    void setMenuItemElementEnabled(bool isEnabled) { m_isMenuItemElementEnabled = isEnabled; }
    8080    bool menuItemElementEnabled() const { return m_isMenuItemElementEnabled; }
    81    
     81
    8282    void setDirectoryUploadEnabled(bool isEnabled) { m_isDirectoryUploadEnabled = isEnabled; }
    8383    bool directoryUploadEnabled() const { return m_isDirectoryUploadEnabled; }
     
    8888    void setCustomPasteboardDataEnabled(bool isEnabled) { m_isCustomPasteboardDataEnabled = isEnabled; }
    8989    bool customPasteboardDataEnabled() const { return m_isCustomPasteboardDataEnabled; }
    90    
     90
    9191    void setWebShareEnabled(bool isEnabled) { m_isWebShareEnabled = isEnabled; }
    9292    bool webShareEnabled() const { return m_isWebShareEnabled; }
     
    177177    void setPointerEventsEnabled(bool isEnabled) { m_pointerEventsEnabled = isEnabled; }
    178178    bool pointerEventsEnabled() const { return m_pointerEventsEnabled; }
    179    
     179
    180180    void setSyntheticEditingCommandsEnabled(bool isEnabled) { m_syntheticEditingCommandsEnabled = isEnabled; }
    181181    bool syntheticEditingCommandsEnabled() const { return m_syntheticEditingCommandsEnabled; }
     
    184184    void setLayoutFormattingContextEnabled(bool isEnabled) { m_layoutFormattingContextEnabled = isEnabled; }
    185185    bool layoutFormattingContextEnabled() const { return m_layoutFormattingContextEnabled; }
    186    
     186
    187187    void setLayoutFormattingContextIntegrationEnabled(bool isEnabled) { m_layoutFormattingContextIntegrationEnabled = isEnabled; }
    188188    bool layoutFormattingContextIntegrationEnabled() const { return m_layoutFormattingContextIntegrationEnabled; }
     
    207207    void setKeygenElementEnabled(bool isEnabled) { m_keygenElementEnabled = isEnabled; }
    208208    bool keygenElementEnabled() const { return m_keygenElementEnabled; }
    209    
     209
    210210    void setHighlightAPIEnabled(bool isEnabled) { m_highlightAPIEnabled = isEnabled; }
    211211    bool highlightAPIEnabled() const { return m_highlightAPIEnabled; }
     
    299299    bool webGL2Enabled() const { return m_isWebGL2Enabled; }
    300300#endif
    301    
     301
    302302#if ENABLE(WEBGPU)
    303303    void setWebGPUEnabled(bool isEnabled) { m_isWebGPUEnabled = isEnabled; }
    304304    bool webGPUEnabled() const { return m_isWebGPUEnabled; }
     305#endif
     306
     307#if ENABLE(WEBGL) || ENABLE(WEBGL2)
     308    void setMaskWebGLStringsEnabled(bool isEnabled) { m_isMaskWebGLStringsEnabled = isEnabled; }
     309    bool maskWebGLStringsEnabled() const { return m_isMaskWebGLStringsEnabled; }
    305310#endif
    306311
     
    311316    bool writableStreamAPIEnabled() const { return m_isWritableStreamAPIEnabled; }
    312317#endif
    313    
     318
    314319#if ENABLE(DOWNLOAD_ATTRIBUTE)
    315320    void setDownloadAttributeEnabled(bool isEnabled) { m_isDownloadAttributeEnabled = isEnabled; }
     
    359364    void setTouchEventsEnabled(bool isEnabled) { m_touchEventsEnabled = isEnabled; }
    360365#endif
    361    
     366
    362367    bool referrerPolicyAttributeEnabled() const { return m_referrerPolicyAttributeEnabled; }
    363368    void setReferrerPolicyAttributeEnabled(bool isEnabled) { m_referrerPolicyAttributeEnabled = isEnabled; }
     
    535540    bool m_isWebGL2Enabled { false };
    536541#endif
    537    
     542
    538543#if ENABLE(WEBGPU)
    539544    bool m_isWebGPUEnabled { false };
     545#endif
     546
     547#if ENABLE(WEBGL) || ENABLE(WEBGL2)
     548    bool m_isMaskWebGLStringsEnabled { false };
    540549#endif
    541550
  • trunk/Source/WebKit/ChangeLog

    r256664 r256697  
     12020-02-14  Jon Lee  <jonlee@apple.com>
     2
     3        Mask WebGL strings
     4        https://bugs.webkit.org/show_bug.cgi?id=207608
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test: platform/mac/webgl/fingerprinting-strings.html
     9
     10        * Shared/WebPreferences.yaml: Add new experimental feature.
     11
    1122020-02-14  Youenn Fablet  <youenn@apple.com>
    213
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r256661 r256697  
    769769  webcoreBinding: RuntimeEnabledFeatures
    770770  condition: ENABLE(GAMEPAD)
    771  
     771
    772772HighlightAPIEnabled:
    773773    type: bool
     
    13851385  webcoreBinding: RuntimeEnabledFeatures
    13861386  condition: ENABLE(WEBGPU)
     1387
     1388MaskWebGLStringsEnabled:
     1389  type: bool
     1390  defaultValue: true
     1391  humanReadableName: "Mask WebGL Strings"
     1392  humanReadableDescription: "Mask WebGL Vendor, Renderer, Shader Language Strings"
     1393  category: experimental
     1394  webcoreBinding: RuntimeEnabledFeatures
     1395  condition: ENABLE(WEBGL) || ENABLE(WEBGL2)
    13871396
    13881397AccessibilityObjectModelEnabled:
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r256512 r256697  
     12020-02-14  Jon Lee  <jonlee@apple.com>
     2
     3        Mask WebGL strings
     4        https://bugs.webkit.org/show_bug.cgi?id=207608
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test: platform/mac/webgl/fingerprinting-strings.html
     9
     10        * WebView/WebPreferenceKeysPrivate.h:
     11        * WebView/WebPreferences.mm:
     12        * WebView/WebPreferencesPrivate.h:
     13        * WebView/WebView.mm:
     14
    1152020-02-13  Said Abou-Hallawa  <said@apple.com>
    216
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h

    r256512 r256697  
    77 *
    88 * 1.  Redistributions of source code must retain the above copyright
    9  *     notice, this list of conditions and the following disclaimer. 
     9 *     notice, this list of conditions and the following disclaimer.
    1010 * 2.  Redistributions in binary form must reproduce the above copyright
    1111 *     notice, this list of conditions and the following disclaimer in the
    12  *     documentation and/or other materials provided with the distribution. 
     12 *     documentation and/or other materials provided with the distribution.
    1313 * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
    1414 *     its contributors may be used to endorse or promote products derived
    15  *     from this software without specific prior written permission. 
     15 *     from this software without specific prior written permission.
    1616 *
    1717 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     
    123123#define WebKitWebGPUEnabledPreferenceKey @"WebKitWebGPUEnabled"
    124124#define WebKitForceWebGLUsesLowPowerPreferenceKey @"WebKitForceWebGLUsesLowPower"
     125#define WebKitMaskWebGLStringsEnabledPreferenceKey @"WebKitMaskWebGLStringsEnabled"
    125126#define WebKitAccelerated2dCanvasEnabledPreferenceKey @"WebKitAccelerated2dCanvasEnabled"
    126127#define WebKitFrameFlatteningPreferenceKey @"WebKitFrameFlattening"
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm

    r256512 r256697  
    88 *
    99 * 1.  Redistributions of source code must retain the above copyright
    10  *     notice, this list of conditions and the following disclaimer. 
     10 *     notice, this list of conditions and the following disclaimer.
    1111 * 2.  Redistributions in binary form must reproduce the above copyright
    1212 *     notice, this list of conditions and the following disclaimer in the
    13  *     documentation and/or other materials provided with the distribution. 
     13 *     documentation and/or other materials provided with the distribution.
    1414 * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
    1515 *     its contributors may be used to endorse or promote products derived
    16  *     from this software without specific prior written permission. 
     16 *     from this software without specific prior written permission.
    1717 *
    1818 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     
    9191        static const char* const documentViewerIDs[] = {
    9292            "Microsoft/com.microsoft.Messenger",
    93             "com.adiumX.adiumX", 
     93            "com.adiumX.adiumX",
    9494            "com.alientechnology.Proteus",
    9595            "com.apple.Dashcode",
    96             "com.apple.iChat", 
     96            "com.apple.iChat",
    9797            "com.barebones.bbedit",
    9898            "com.barebones.textwrangler",
     
    108108            "de.codingmonkeys.SubEthaEdit",
    109109            "fi.karppinen.Pyro",
    110             "info.colloquy", 
     110            "info.colloquy",
    111111            "kungfoo.tv.ecto",
    112112        };
     
    229229    static int instanceCount = 1;
    230230    NSString *fakeIdentifier;
    231    
    232     // At least ensure that identifier hasn't been already used. 
     231
     232    // At least ensure that identifier hasn't been already used.
    233233    fakeIdentifier = [NSString stringWithFormat:@"WebPreferences%d", instanceCount++];
    234234    while ([[self class] _getInstanceForIdentifier:fakeIdentifier]){
    235235        fakeIdentifier = [NSString stringWithFormat:@"WebPreferences%d", instanceCount++];
    236236    }
    237    
     237
    238238    return [self initWithIdentifier:fakeIdentifier];
    239239}
     
    596596        @YES, WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
    597597        @NO, WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
    598        
     598
    599599        @NO, WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey,
    600600#if ENABLE(MEDIA_SOURCE)
     
    643643#if ENABLE(WEBGPU)
    644644        @NO, WebKitWebGPUEnabledPreferenceKey,
     645#endif
     646#if ENABLE(WEBGL) || ENABLE(WEBGL2)
     647        @YES, WebKitMaskWebGLStringsEnabledPreferenceKey,
    645648#endif
    646649        @NO, WebKitCacheAPIEnabledPreferenceKey,
     
    969972}
    970973
    971 - (void)setSerifFontFamily:(NSString *)family 
     974- (void)setSerifFontFamily:(NSString *)family
    972975{
    973976    [self _setStringValue: family forKey: WebKitSerifFontPreferenceKey];
     
    10681071{
    10691072    NSString *locationString = [self _stringValueForKey: WebKitUserStyleSheetLocationPreferenceKey];
    1070    
     1073
    10711074    if ([locationString _webkit_looksLikeAbsoluteURL]) {
    10721075        return [NSURL _web_URLWithDataAsString:locationString];
     
    10801083{
    10811084    NSString *locationString;
    1082    
     1085
    10831086    if ([URL isFileURL]) {
    10841087        locationString = [[URL path] _web_stringByAbbreviatingWithTildeInPath];
     
    11011104// wrong for iOS, where WebViews are used for various purposes, like
    11021105// text editing, text rendering, and displaying web content.
    1103 // 
     1106//
    11041107// I have changed the user style sheet mechanism to be a per-WebView
    11051108// setting, rather than a per-process preference. This seems to give the
     
    18061809        value = WebKitEditableLinkDefaultBehavior;
    18071810    }
    1808    
     1811
    18091812    return value;
    18101813}
     
    18901893    if (!ident)
    18911894        return _standardPreferences;
    1892    
     1895
    18931896    WebPreferences *instance = [webPreferencesInstances objectForKey:[self _concatenateKeyWithIBCreatorID:ident]];
    18941897
     
    22022205{
    22032206    [self _setBoolValue:enabled forKey:WebKitWebGPUEnabledPreferenceKey];
     2207}
     2208
     2209- (BOOL)maskWebGLStringsEnabled
     2210{
     2211    return [self _boolValueForKey:WebKitMaskWebGLStringsEnabledPreferenceKey];
     2212}
     2213
     2214- (void)setMaskWebGLStringsEnabled:(BOOL)enabled
     2215{
     2216    [self _setBoolValue:enabled forKey:WebKitMaskWebGLStringsEnabledPreferenceKey];
    22042217}
    22052218
     
    26442657        storageBlockingPolicy = WebBlockAllStorage;
    26452658        break;
    2646     }   
     2659    }
    26472660
    26482661    [self setStorageBlockingPolicy:storageBlockingPolicy];
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h

    r256512 r256697  
    77 *
    88 * 1.  Redistributions of source code must retain the above copyright
    9  *     notice, this list of conditions and the following disclaimer. 
     9 *     notice, this list of conditions and the following disclaimer.
    1010 * 2.  Redistributions in binary form must reproduce the above copyright
    1111 *     notice, this list of conditions and the following disclaimer in the
    12  *     documentation and/or other materials provided with the distribution. 
     12 *     documentation and/or other materials provided with the distribution.
    1313 * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
    1414 *     its contributors may be used to endorse or promote products derived
    15  *     from this software without specific prior written permission. 
     15 *     from this software without specific prior written permission.
    1616 *
    1717 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     
    284284- (BOOL)webGPUEnabled;
    285285- (void)setWebGPUEnabled:(BOOL)enabled;
     286
     287- (BOOL)maskWebGLStringsEnabled;
     288- (void)setMaskWebGLStringsEnabled:(BOOL)enabled;
    286289
    287290- (BOOL)accelerated2dCanvasEnabled;
     
    418421
    419422// Full screen support is dependent on WebCore/WebKit being
    420 // compiled with ENABLE_FULLSCREEN_API. 
     423// compiled with ENABLE_FULLSCREEN_API.
    421424- (void)setFullScreenEnabled:(BOOL)flag;
    422425- (BOOL)fullScreenEnabled;
  • trunk/Source/WebKitLegacy/mac/WebView/WebView.mm

    r256512 r256697  
    99 *
    1010 * 1.  Redistributions of source code must retain the above copyright
    11  *     notice, this list of conditions and the following disclaimer. 
     11 *     notice, this list of conditions and the following disclaimer.
    1212 * 2.  Redistributions in binary form must reproduce the above copyright
    1313 *     notice, this list of conditions and the following disclaimer in the
    14  *     documentation and/or other materials provided with the distribution. 
     14 *     documentation and/or other materials provided with the distribution.
    1515 * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
    1616 *     its contributors may be used to endorse or promote products derived
    17  *     from this software without specific prior written permission. 
     17 *     from this software without specific prior written permission.
    1818 *
    1919 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     
    689689    if (!(self = [super init]))
    690690        return nil;
    691    
     691
    692692    _dataInteractionImage = [PAL::allocUIImageInstance() initWithCGImage:image scale:scale orientation:UIImageOrientationDownMirrored];
    693693    _selectionRectInRootViewCoordinates = indicatorData.selectionRectInRootViewCoordinates;
    694694    _textBoundingRectInRootViewCoordinates = indicatorData.textBoundingRectInRootViewCoordinates;
    695    
     695
    696696    NSMutableArray *textRectsInBoundingRectCoordinates = [NSMutableArray array];
    697697    for (auto rect : indicatorData.textRectsInBoundingRectCoordinates)
     
    722722    if (!(self = [super init]))
    723723        return nil;
    724    
     724
    725725    _dataInteractionImage = [PAL::allocUIImageInstance() initWithCGImage:image scale:scale orientation:UIImageOrientationDownMirrored];
    726    
     726
    727727    return self;
    728728}
     
    13541354    WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen);
    13551355#endif
    1356    
     1356
    13571357    WebPreferences *standardPreferences = [WebPreferences standardPreferences];
    13581358    [standardPreferences willAddToWebView];
     
    14111411        [WebDatabaseManager sharedWebDatabaseManager];
    14121412
    1413 #if PLATFORM(IOS_FAMILY)       
     1413#if PLATFORM(IOS_FAMILY)
    14141414        if ([standardPreferences storageTrackerEnabled])
    14151415#endif
     
    15391539
    15401540    [self _addToAllWebViewsSet];
    1541    
     1541
    15421542    // If there's already a next key view (e.g., from a nib), wire it up to our
    15431543    // contained frame view. In any case, wire our next key view up to the our
    1544     // contained frame view. This works together with our becomeFirstResponder 
     1544    // contained frame view. This works together with our becomeFirstResponder
    15451545    // and setNextKeyView overrides.
    15461546    NSView *nextKeyView = [self nextKeyView];
     
    16801680    if (!self)
    16811681        return nil;
    1682    
     1682
    16831683    _private = [[WebViewPrivate alloc] init];
    1684    
     1684
    16851685#ifndef NDEBUG
    16861686    WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen);
    16871687#endif
    1688    
     1688
    16891689    if (!preferences)
    16901690        preferences = [WebPreferences standardPreferences];
    16911691    [preferences willAddToWebView];
    1692    
     1692
    16931693    _private->preferences = [preferences retain];
    16941694    _private->mainFrameDocumentReady = NO;
     
    17371737    _private->page = new WebCore::Page(WTFMove(pageConfiguration));
    17381738    storageProvider->setPage(*_private->page);
    1739    
     1739
    17401740    [self setSmartInsertDeleteEnabled:YES];
    1741    
     1741
    17421742    // FIXME: <rdar://problem/6851451> Should respect preferences in fast path WebView initialization
    17431743    // We are ignoring the preferences object on fast path and just using Settings defaults (everything fancy off).
     
    17491749    _private->page->settings().setAcceleratedDrawingEnabled([preferences acceleratedDrawingEnabled]);
    17501750    _private->page->settings().setDisplayListDrawingEnabled([preferences displayListDrawingEnabled]);
    1751    
     1751
    17521752    _private->page->settings().setFontFallbackPrefersPictographs(true);
    17531753    _private->page->settings().setPictographFontFamily("AppleColorEmoji");
    1754    
     1754
    17551755    _private->page->settings().setScriptMarkupEnabled(false);
    17561756    _private->page->settings().setScriptEnabled(true);
    1757    
     1757
    17581758    // FIXME: this is a workaround for <rdar://problem/11518688> REGRESSION: Quoted text font changes when replying to certain email
    17591759    _private->page->settings().setStandardFontFamily([_private->preferences standardFontFamily]);
    1760    
     1760
    17611761    // FIXME: this is a workaround for <rdar://problem/11820090> Quoted text changes in size when replying to certain email
    17621762    _private->page->settings().setMinimumFontSize([_private->preferences minimumFontSize]);
     
    17701770    _private->page->setRemoteInspectionAllowed(isInternalInstall());
    17711771#endif
    1772    
     1772
    17731773    [self _updateScreenScaleFromWindow];
    17741774    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_wakWindowScreenScaleChanged:) name:WAKWindowScreenScaleDidChangeNotification object:nil];
     
    17761776
    17771777    [WebFrame _createMainFrameWithSimpleHTMLDocumentWithPage:_private->page frameView:frameView style:style];
    1778    
     1778
    17791779    [self _addToAllWebViewsSet];
    1780    
     1780
    17811781    ++WebViewCount;
    1782    
     1782
    17831783    WebCore::SecurityPolicy::setLocalLoadPolicy(WebCore::SecurityPolicy::AllowLocalLoadsForLocalAndSubstituteData);
    1784    
     1784
    17851785    WebCore::RuntimeEnabledFeatures::sharedFeatures().setAttachmentElementEnabled(self.preferences.attachmentElementEnabled);
    17861786
     
    20362036{
    20372037    static NSMutableSet *mimeTypes = [[NSMutableSet alloc] init];
    2038    
     2038
    20392039    return mimeTypes;
    20402040}
     
    20762076        repClass = [[WebDataSource _repTypesAllowImageTypeOmission:NO] _webkit_objectForMIMEType:MIMEType];
    20772077    }
    2078    
     2078
    20792079    if (viewClass && repClass) {
    20802080        if (viewClass == [WebHTMLView class] && repClass == [WebHTMLRepresentation class]) {
     
    20872087                BOOL isSupportedByWebKit = [[WebHTMLView supportedNonImageMIMETypes] containsObject:MIMEType] ||
    20882088                    [[WebHTMLView supportedMIMETypes] containsObject:MIMEType];
    2089                
     2089
    20902090                // If this is a known plug-in MIME type and WebKit can't show it natively, we don't want to show it.
    20912091                if (!isSupportedByWebKit)
     
    20992099        return YES;
    21002100    }
    2101    
     2101
    21022102    return NO;
    21032103}
     
    22622262
    22632263#if !PLATFORM(IOS_FAMILY)
    2264     // Unload the WebView local plug-in database. 
     2264    // Unload the WebView local plug-in database.
    22652265    if (_private->pluginDatabase) {
    22662266        [_private->pluginDatabase destroyAllPluginInstanceViews];
     
    22702270    }
    22712271#endif
    2272    
     2272
    22732273    // Keep the global plug-in database active until the app terminates to avoid having to reload plug-in bundles.
    22742274    if (!pluginDatabaseClientCount && applicationIsTerminating)
     
    22762276}
    22772277
    2278 - (void)_closeWithFastTeardown 
     2278- (void)_closeWithFastTeardown
    22792279{
    22802280#ifndef NDEBUG
     
    23212321    // Fix for problems such as <rdar://problem/5774587> Crash closing tab in WebCore::Frame::page() from -[WebCoreFrameBridge pauseTimeouts]
    23222322    WebThreadRun(^{
    2323 #endif           
     2323#endif
    23242324
    23252325    if (!_private || _private->closed)
     
    24292429    // Fix for problems such as <rdar://problem/5774587> Crash closing tab in WebCore::Frame::page() from -[WebCoreFrameBridge pauseTimeouts]
    24302430    });
    2431 #endif           
     2431#endif
    24322432}
    24332433
     
    24712471{
    24722472    ASSERT(URL);
    2473    
     2473
    24742474    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
    24752475ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     
    26652665    if (!_private->page)
    26662666        return;
    2667    
     2667
    26682668    if (!otherView->_private->page)
    26692669        return;
    2670    
     2670
    26712671    // It turns out the right combination of behavior is done with the back/forward load
    26722672    // type.  (See behavior matrix at the top of WebFramePrivate.)  So we copy all the items
     
    26792679    if (!otherBackForward.currentItem())
    26802680        return; // empty back forward list, bail
    2681    
     2681
    26822682    WebCore::HistoryItem* newItemToGoTo = nullptr;
    26832683
     
    26912691        }
    26922692        Ref<WebCore::HistoryItem> newItem = otherBackForward.itemAtIndex(i)->copy();
    2693         if (i == 0) 
     2693        if (i == 0)
    26942694            newItemToGoTo = newItem.ptr();
    26952695        backForward.client().addItem(WTFMove(newItem));
     
    27732773{
    27742774    static BOOL needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.apple.iAdProducer"), -1, 2.1);
    2775    
     2775
    27762776    return needsQuirk;
    27772777}
     
    27972797
    27982798- (BOOL)_needsPreHTML5ParserQuirks
    2799 {   
     2799{
    28002800#if !PLATFORM(IOS_FAMILY)
    28012801    // AOL Instant Messenger and Microsoft My Day contain markup incompatible
    28022802    // with the new HTML5 parser. If these applications were linked against a
    28032803    // version of WebKit prior to the introduction of the HTML5 parser, enable
    2804     // parser quirks to maintain compatibility. For details, see 
     2804    // parser quirks to maintain compatibility. For details, see
    28052805    // <https://bugs.webkit.org/show_bug.cgi?id=46134> and
    28062806    // <https://bugs.webkit.org/show_bug.cgi?id=46334>.
    28072807    static bool isApplicationNeedingParserQuirks = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER)
    28082808        && (WebCore::MacApplication::isAOLInstantMessenger() || WebCore::MacApplication::isMicrosoftMyDay());
    2809    
     2809
    28102810    // Mail.app must continue to display HTML email that contains quirky markup.
    28112811    static bool isAppleMail = WebCore::MacApplication::isAppleMail();
     
    31673167    RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled([preferences webGL2Enabled]);
    31683168#endif
    3169    
     3169
    31703170#if ENABLE(WEBGPU)
    31713171    RuntimeEnabledFeatures::sharedFeatures().setWebGPUEnabled([preferences webGPUEnabled]);
     3172#endif
     3173
     3174#if ENABLE(WEBGL) || ENABLE(WEBGL2)
     3175    RuntimeEnabledFeatures::sharedFeatures().setMaskWebGLStringsEnabled([preferences maskWebGLStringsEnabled]);
    31723176#endif
    31733177
     
    32913295    if (_private->closing)
    32923296        return nil;
    3293        
     3297
    32943298    if (!_private->UIKitDelegateForwarder)
    32953299        _private->UIKitDelegateForwarder = [[_WebSafeForwarder alloc] initWithTarget:_private->UIKitDelegate defaultTarget:[WebDefaultUIKitDelegate sharedUIKitDelegate]];
     
    34923496    if (_private->closing)
    34933497        return nil;
    3494 #endif   
     3498#endif
    34953499    // This can be called during window deallocation by QTMovieView in the QuickTime Cocoa Plug-in.
    34963500    // Not sure if that is a bug or not.
     
    35073511    [[WebFrameView _viewTypesAllowImageTypeOmission:NO] removeObjectForKey:MIMEType];
    35083512    [[WebDataSource _repTypesAllowImageTypeOmission:NO] removeObjectForKey:MIMEType];
    3509    
     3513
    35103514    // FIXME: We also need to maintain MIMEType registrations (which can be dynamically changed)
    35113515    // in the WebCore MIMEType registry.  For now we're doing this in a safe, limited manner
     
    35243528    if ([viewClass class] == [WebHTMLView class])
    35253529        WebCore::MIMETypeRegistry::supportedNonImageMIMETypes().add(MIMEType);
    3526    
     3530
    35273531    // This is used to make _representationExistsForURLScheme faster.
    35283532    // Without this set, we'd have to create the MIME type each time.
     
    37043708    if (needsSelfRetainWhileLoadingQuirk())
    37053709        [self performSelector:@selector(release) withObject:nil afterDelay:0];
    3706        
     3710
    37073711    [self _didChangeBackForwardKeys];
    37083712    if (frame == [self mainFrame]){
     
    37383742        [self _willChangeValueForKey: _WebIsLoadingKey];
    37393743        [self _didChangeValueForKey: _WebIsLoadingKey];
    3740        
     3744
    37413745        [self _didChangeValueForKey: _WebMainFrameURLKey];
    37423746    }
     
    37683772                        element:domElement
    37693773                            URL:linkURL ? linkURL : (NSURL *)[element objectForKey:WebElementImageURLKey]
    3770                           title:[element objectForKey:WebElementImageAltStringKey] 
     3774                          title:[element objectForKey:WebElementImageAltStringKey]
    37713775                        archive:[[element objectForKey:WebElementDOMNodeKey] webArchive]
    37723776                          types:types
     
    38903894        _private->_caretChangeListeners = [[NSMutableSet alloc] init];
    38913895    }
    3892    
     3896
    38933897    [_private->_caretChangeListeners addObject:listener];
    38943898}
     
    39173921{
    39183922    ASSERT(WebThreadIsLocked() || !WebThreadIsEnabled());
    3919    
     3923
    39203924    [self _setFormDelegate:nil];
    39213925    [self _setUIKitDelegate:nil];
     
    39233927    [self removeAllCaretChangeListeners];
    39243928    [self setWebMailDelegate:nil];
    3925    
     3929
    39263930    [self setDownloadDelegate:nil];
    3927     [self setEditingDelegate:nil]; 
     3931    [self setEditingDelegate:nil];
    39283932    [self setFrameLoadDelegate:nil];
    39293933    [self setPolicyDelegate:nil];
    39303934    [self setResourceLoadDelegate:nil];
    39313935    [self setScriptDebugDelegate:nil];
    3932     [self setUIDelegate:nil];     
     3936    [self setUIDelegate:nil];
    39333937}
    39343938
     
    40234027    if (!_private->pluginDatabase)
    40244028        _private->pluginDatabase = [[WebPluginDatabase alloc] init];
    4025        
     4029
    40264030    [_private->pluginDatabase setPlugInPaths:newPaths];
    40274031    [_private->pluginDatabase refresh];
     
    40474051            return YES;
    40484052    }
    4049    
     4053
    40504054    return NO;
    40514055}
     
    41174121        if (!layerForWidget)
    41184122            continue;
    4119        
     4123
    41204124        if (layerForWidget->contentsLayerForMedia() != layer) {
    41214125            layerForWidget->setContentsToPlatformLayer(layer, WebCore::GraphicsLayer::ContentsLayerPurpose::Media);
     
    43184322{
    43194323    ASSERT(WebThreadIsLocked());
    4320    
     4324
    43214325    if (auto* coreFrame = [self _mainCoreFrame])
    43224326        coreFrame->viewportOffsetChanged(WebCore::Frame::IncrementalScrollOffset);
     
    43464350    if (!frame)
    43474351        return nil;
    4348    
     4352
    43494353    auto* document = frame->document();
    43504354    if (!document)
     
    44094413    WebCore::IntPoint rectStart(rect.origin.x, rect.origin.y);
    44104414    WebCore::IntPoint rectEnd(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height);
    4411    
     4415
    44124416    auto* coreFrame = [self _mainCoreFrame];
    44134417    if (!coreFrame)
    44144418        return nil;
    4415    
     4419
    44164420    WebCore::VisibleSelection selectionInsideRect(coreFrame->visiblePositionForPoint(rectStart), coreFrame->visiblePositionForPoint(rectEnd));
    4417    
     4421
    44184422    return [[[WebTextIterator alloc] initWithRange:kit(selectionInsideRect.toNormalizedRange().get())] autorelease];
    44194423}
     
    45474551    if (auto* view = coreFrame->view())
    45484552        return view->isTrackingRepaints();
    4549    
     4553
    45504554    return NO;
    45514555}
     
    45674571    const Vector<WebCore::FloatRect>& repaintRects = view->trackedRepaintRects();
    45684572    NSMutableArray* rectsArray = [[NSMutableArray alloc] initWithCapacity:repaintRects.size()];
    4569    
     4573
    45704574    for (unsigned i = 0; i < repaintRects.size(); ++i)
    45714575        [rectsArray addObject:[NSValue valueWithRect:snappedIntRect(WebCore::LayoutRect(repaintRects[i]))]];
     
    48174821    if (suspended == frame->animation().isSuspended())
    48184822        return;
    4819        
     4823
    48204824    if (suspended)
    48214825        frame->animation().suspendAnimations();
     
    48764880    if (!coreFrame)
    48774881        return;
    4878    
     4882
    48794883    auto* view = coreFrame->view();
    48804884    if (!view)
    48814885        return;
    4882    
     4886
    48834887    view->setFixedLayoutSize(WebCore::IntSize(size));
    48844888    view->forceLayout();
     
    48914895    if (!coreFrame)
    48924896        return NO;
    4893    
     4897
    48944898    auto* view = coreFrame->view();
    48954899    if (!view)
    48964900        return NO;
    4897    
     4901
    48984902    return view->useFixedLayout();
    48994903}
     
    49054909    if (!coreFrame)
    49064910        return WebCore::IntSize();
    4907    
     4911
    49084912    auto* view = coreFrame->view();
    49094913    if (!view)
     
    50885092    if (!page)
    50895093        return;
    5090    
     5094
    50915095    page->setPaginationLineGridEnabled(lineGridEnabled);
    50925096}
     
    50975101    if (!page)
    50985102        return NO;
    5099    
     5103
    51005104    return page->paginationLineGridEnabled();
    51015105}
     
    51425146}
    51435147
    5144 + (void)_setLoadResourcesSerially:(BOOL)serialize 
     5148+ (void)_setLoadResourcesSerially:(BOOL)serialize
    51455149{
    51465150    WebPlatformStrategies::initializeIfNecessary();
     
    55605564
    55615565+ (void)_applicationWillTerminate
    5562 {   
     5566{
    55635567    applicationIsTerminating = YES;
    55645568
     
    55965600    if (pluginPackage)
    55975601        return pluginPackage;
    5598    
     5602
    55995603#if !PLATFORM(IOS_FAMILY)
    56005604    if (_private->pluginDatabase)
    56015605        return [_private->pluginDatabase pluginForMIMEType:MIMEType];
    56025606#endif
    5603    
     5607
    56045608    return nil;
    56055609}
     
    56135617    if (pluginPackage)
    56145618        return pluginPackage;
    5615    
     5619
    56165620#if !PLATFORM(IOS_FAMILY)
    56175621    if (_private->pluginDatabase)
    56185622        return [_private->pluginDatabase pluginForExtension:extension];
    56195623#endif
    5620    
     5624
    56215625    return nil;
    56225626}
     
    56335637{
    56345638    if (_private->pluginDatabase)
    5635         [_private->pluginDatabase removePluginInstanceView:view];   
     5639        [_private->pluginDatabase removePluginInstanceView:view];
    56365640}
    56375641
     
    56395643{
    56405644    if (_private->pluginDatabase)
    5641         [_private->pluginDatabase removePluginInstanceViewsFor:webFrame];   
     5645        [_private->pluginDatabase removePluginInstanceViewsFor:webFrame];
    56425646}
    56435647#endif
     
    56505654    if ([[WebPluginDatabase sharedDatabase] isMIMETypeRegistered:MIMEType])
    56515655        return YES;
    5652        
     5656
    56535657#if !PLATFORM(IOS_FAMILY)
    56545658    if (_private->pluginDatabase && [_private->pluginDatabase isMIMETypeRegistered:MIMEType])
    56555659        return YES;
    56565660#endif
    5657    
     5661
    56585662    return NO;
    56595663}
     
    56765680    id key;
    56775681    NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease];
    5678    
     5682
    56795683    while ((key = [enumerator nextObject])) {
    56805684        if ([viewTypes objectForKey:key] == [WebHTMLView class])
    56815685            [array addObject:key];
    56825686    }
    5683    
     5687
    56845688    return array;
    56855689}
     
    56945698            [WebView _unregisterViewClassAndRepresentationClassForMIMEType:key];
    56955699    }
    5696    
     5700
    56975701    int i, count = [MIMETypes count];
    56985702    for (i = 0; i < count; i++) {
    5699         [WebView registerViewClass:[WebHTMLView class] 
    5700                 representationClass:[WebHTMLRepresentation class] 
     5703        [WebView registerViewClass:[WebHTMLView class]
     5704                representationClass:[WebHTMLRepresentation class]
    57015705                forMIMEType:[MIMETypes objectAtIndex:i]];
    57025706    }
     
    58075811        BOOL useBackForwardList = NO;
    58085812        BOOL allowsUndo = YES;
    5809        
     5813
    58105814        result = [super initWithCoder:decoder];
    58115815        result->_private = [[WebViewPrivate alloc] init];
     
    59535957// FIXME: Use AppKit constants for these when they are available.
    59545958static NSString * const windowDidChangeBackingPropertiesNotification = @"NSWindowDidChangeBackingPropertiesNotification";
    5955 static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey"; 
     5959static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey";
    59565960
    59575961- (void)addWindowObserversForWindow:(NSWindow *)window
     
    60236027    if (window) {
    60246028        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillClose:) name:NSWindowWillCloseNotification object:window];
    6025          
     6029
    60266030        // Ensure that we will receive the events that WebHTMLView (at least) needs.
    60276031        // The following are expensive enough that we don't want to call them over
     
    60336037        _private->page->setIsInWindow(false);
    60346038    }
    6035        
     6039
    60366040    if (window != [self window]) {
    60376041        [self removeWindowObservers];
     
    61496153- (void)_windowDidChangeBackingProperties:(NSNotification *)notification
    61506154{
    6151     CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue]; 
     6155    CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue];
    61526156    CGFloat newBackingScaleFactor = [self _deviceScaleFactor];
    6153     if (oldBackingScaleFactor == newBackingScaleFactor) 
    6154         return; 
     6157    if (oldBackingScaleFactor == newBackingScaleFactor)
     6158        return;
    61556159
    61566160    _private->page->setDeviceScaleFactor(newBackingScaleFactor);
     
    63556359    if (focusedFrame)
    63566360        return focusedFrame;
    6357    
     6361
    63586362    // If the first responder is outside of our view tree, we search for a frame containing a selection.
    63596363    // There should be at most only one of these.
     
    63826386    if (!_private->page)
    63836387        return NO;
    6384    
     6388
    63856389#if PLATFORM(IOS_FAMILY)
    63866390    if (WebThreadIsCurrent() || !WebThreadIsEnabled())
     
    64696473    if (!_private->page)
    64706474        return NO;
    6471    
     6475
    64726476    return _private->zoomsTextOnly;
    64736477}
     
    67066710    if (!_private)
    67076711        return nil;
    6708    
     6712
    67096713    return _private->hostWindow;
    67106714}
     
    67356739#if ENABLE(DRAG_SUPPORT) && PLATFORM(MAC)
    67366740// The following 2 internal NSView methods are called on the drag destination to make scrolling while dragging work.
    6737 // Scrolling while dragging will only work if the drag destination is in a scroll view. The WebView is the drag destination. 
    6738 // When dragging to a WebView, the document subview should scroll, but it doesn't because it is not the drag destination. 
     6741// Scrolling while dragging will only work if the drag destination is in a scroll view. The WebView is the drag destination.
     6742// When dragging to a WebView, the document subview should scroll, but it doesn't because it is not the drag destination.
    67396743// Forward these calls to the document subview to make its scroll view scroll.
    67406744- (void)_autoscrollForDraggingInfo:(id)draggingInfo timeDelta:(NSTimeInterval)repeatDelta
     
    68166820    NSArray* types = draggingInfo.draggingPasteboard.types;
    68176821    if (![types containsObject:WebArchivePboardType] && [types containsObject:WebCore::legacyFilesPromisePasteboardType()]) {
    6818        
     6822
    68196823        // FIXME: legacyFilesPromisePasteboardType() contains UTIs, not path names. Also, it's not
    68206824        // guaranteed that the count of UTIs equals the count of files, since some clients only write
     
    68866890        return NO;
    68876891    }
    6888    
     6892
    68896893    // This works together with setNextKeyView to splice the WebView into
    68906894    // the key loop similar to the way NSScrollView does this. Note that
     
    69226926#endif
    69236927        return YES;
    6924     } 
     6928    }
    69256929
    69266930    return NO;
     
    69666970    [[WebFrameView _viewTypesAllowImageTypeOmission:YES] setObject:viewClass forKey:MIMEType];
    69676971    [[WebDataSource _repTypesAllowImageTypeOmission:YES] setObject:representationClass forKey:MIMEType];
    6968    
     6972
    69696973    // FIXME: We also need to maintain MIMEType registrations (which can be dynamically changed)
    69706974    // in the WebCore MIMEType registry.  For now we're doing this in a safe, limited manner
     
    71377141    if (!coreMainFrame)
    71387142        return nil;
    7139    
     7143
    71407144    auto* documentLoader = coreMainFrame->loader().documentLoader();
    71417145    if (!documentLoader)
    71427146        return nil;
    7143    
     7147
    71447148    auto& linkIcons = documentLoader->linkIcons();
    71457149    if (linkIcons.isEmpty())
     
    74717475{
    74727476    NSString *URLString = [sender stringValue];
    7473    
     7477
    74747478    [[self mainFrame] loadRequest: [NSURLRequest requestWithURL: [NSURL _web_URLWithDataAsString: URLString]]];
    74757479}
     
    75577561#if PLATFORM(IOS_FAMILY)
    75587562    WebThreadRun(^{
    7559 #endif           
     7563#endif
    75607564    [[self mainFrame] reload];
    75617565#if PLATFORM(IOS_FAMILY)
    75627566    });
    7563 #endif           
     7567#endif
    75647568}
    75657569
     
    77497753    if (_private->closed)
    77507754        return NO;
    7751    
     7755
    77527756    // Get the frame holding the selection, or start with the main frame
    77537757    WebFrame *startFrame = [self _selectedOrMainFrame];
    7754    
     7758
    77557759    // Search the first frame, then all the other frames, in order
    77567760    NSView <WebDocumentSearching> *startSearchView = nil;
     
    77587762    do {
    77597763        WebFrame *nextFrame = incrementFrame(frame, options);
    7760        
     7764
    77617765        BOOL onlyOneFrame = (frame == nextFrame);
    77627766        ASSERT(!onlyOneFrame || frame == startFrame);
    7763        
     7767
    77647768        id <WebDocumentView> view = [[frame frameView] documentView];
    77657769        if ([view conformsToProtocol:@protocol(WebDocumentSearching)]) {
    77667770            NSView <WebDocumentSearching> *searchView = (NSView <WebDocumentSearching> *)view;
    7767            
     7771
    77687772            if (frame == startFrame)
    77697773                startSearchView = searchView;
    7770            
     7774
    77717775            // In some cases we have to search some content twice; see comment later in this method.
    7772             // We can avoid ever doing this in the common one-frame case by passing the wrap option through 
     7776            // We can avoid ever doing this in the common one-frame case by passing the wrap option through
    77737777            // here, and then bailing out before we get to the code that would search again in the
    77747778            // same content.
     
    77817785                return YES;
    77827786            }
    7783            
     7787
    77847788            if (onlyOneFrame)
    77857789                return NO;
     
    77877791        frame = nextFrame;
    77887792    } while (frame && frame != startFrame);
    7789    
    7790     // 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 
    7791     // 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 
     7793
     7794    // 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
     7795    // 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
    77927796    // way to make sure the entire frame is searched is to pass WebFindOptionsWrapAround. When there are no matches, this will search
    77937797    // some content that we already searched on the first pass. In the worst case, we could search the entire contents of this frame twice.
     
    78527856    return _private->scriptDebugDelegate;
    78537857}
    7854  
     7858
    78557859- (void)setHistoryDelegate:(id)delegate
    78567860{
     
    79527956        if (view && ![view conformsToProtocol:@protocol(WebMultipleTextMatches)])
    79537957            return NO;
    7954        
     7958
    79557959        frame = incrementFrame(frame);
    79567960    } while (frame);
    7957    
     7961
    79587962    return YES;
    79597963}
     
    79767980            if (markMatches)
    79777981                [(NSView <WebMultipleTextMatches>*)view setMarkedTextMatchesAreHighlighted:highlight];
    7978        
     7982
    79797983            ASSERT(limit == 0 || matchCount < limit);
    79807984            matchCount += [(NSView <WebMultipleTextMatches>*)view countMatchesForText:string inDOMRange:range options:options limit:(limit == 0 ? 0 : limit - matchCount) markMatches:markMatches];
     
    79847988                break;
    79857989        }
    7986        
     7990
    79877991        frame = incrementFrame(frame);
    79887992    } while (frame);
    7989    
     7993
    79907994    return matchCount;
    79917995}
     
    80018005        if ([view conformsToProtocol:@protocol(WebMultipleTextMatches)])
    80028006            [(NSView <WebMultipleTextMatches>*)view unmarkAllTextMatches];
    8003        
     8007
    80048008        frame = incrementFrame(frame);
    80058009    } while (frame);
     
    80358039        frame = incrementFrame(frame);
    80368040    } while (frame);
    8037    
     8041
    80388042    return result;
    80398043}
     
    81888192    [currentContext restoreGraphicsState];
    81898193#endif
    8190    
     8194
    81918195    SEL selector = @selector(webView:drawFooterInRect:);
    81928196    if (![_private->UIDelegate respondsToSelector:selector])
     
    82078211    NSPrintInfo *info = [op printInfo];
    82088212    NSMutableDictionary *infoDictionary = [info dictionary];
    8209    
     8213
    82108214    // We need to modify the top and bottom margins in the NSPrintInfo to account for the space needed by the
    82118215    // header and footer. Because this method can be called more than once on the same NSPrintInfo (see 5038087),
     
    82278231        originalBottomMargin = [[infoDictionary objectForKey:WebKitOriginalBottomPrintingMarginKey] floatValue];
    82288232    }
    8229    
     8233
    82308234    float scale = [op _web_pageSetupScaleFactor];
    82318235    [info setTopMargin:originalTopMargin + [self _headerHeight] * scale];
     
    82438247    float headerFooterLeft = [printInfo leftMargin]/scale;
    82448248    float headerFooterWidth = (paperSize.width - ([printInfo leftMargin] + [printInfo rightMargin]))/scale;
    8245     NSRect footerRect = NSMakeRect(headerFooterLeft, [printInfo bottomMargin]/scale - [self _footerHeight] , 
     8249    NSRect footerRect = NSMakeRect(headerFooterLeft, [printInfo bottomMargin]/scale - [self _footerHeight] ,
    82468250                                   headerFooterWidth, [self _footerHeight]);
    8247     NSRect headerRect = NSMakeRect(headerFooterLeft, (paperSize.height - [printInfo topMargin])/scale, 
     8251    NSRect headerRect = NSMakeRect(headerFooterLeft, (paperSize.height - [printInfo topMargin])/scale,
    82488252                                   headerFooterWidth, [self _headerHeight]);
    8249    
     8253
    82508254    [self _drawHeaderInRect:headerRect];
    82518255    [self _drawFooterInRect:footerRect];
     
    84768480    [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidChangeTypingStyleNotification object:self];
    84778481    [defaultCenter removeObserver:_private->editingDelegate name:WebViewDidChangeSelectionNotification object:self];
    8478    
     8482
    84798483    _private->editingDelegate = delegate;
    84808484    [_private->editingDelegateForwarder release];
    84818485    _private->editingDelegateForwarder = nil;
    8482    
     8486
    84838487    // add notifications for new delegate
    84848488    [self registerForEditingDelegateNotification:WebViewDidBeginEditingNotification selector:@selector(webViewDidBeginEditing:)];
     
    85188522    if (grammarCheckingEnabled == flag)
    85198523        return;
    8520    
     8524
    85218525    grammarCheckingEnabled = flag;
    8522     [[NSUserDefaults standardUserDefaults] setBool:grammarCheckingEnabled forKey:WebGrammarCheckingEnabled];   
     8526    [[NSUserDefaults standardUserDefaults] setBool:grammarCheckingEnabled forKey:WebGrammarCheckingEnabled];
    85238527    [[NSSpellChecker sharedSpellChecker] updatePanels];
    85248528
    85258529    // We call _preflightSpellChecker when turning continuous spell checking on, but we don't need to do that here
    85268530    // because grammar checking only occurs on code paths that already preflight spell checking appropriately.
    8527    
     8531
    85288532    if (![self isGrammarCheckingEnabled])
    85298533        [[self mainFrame] _unmarkAllBadGrammar];
     
    85938597        return;
    85948598    automaticQuoteSubstitutionEnabled = flag;
    8595     [[NSUserDefaults standardUserDefaults] setBool:automaticQuoteSubstitutionEnabled forKey:WebAutomaticQuoteSubstitutionEnabled];   
     8599    [[NSUserDefaults standardUserDefaults] setBool:automaticQuoteSubstitutionEnabled forKey:WebAutomaticQuoteSubstitutionEnabled];
    85968600    [[NSSpellChecker sharedSpellChecker] updatePanels];
    85978601}
     
    86078611        return;
    86088612    automaticLinkDetectionEnabled = flag;
    8609     [[NSUserDefaults standardUserDefaults] setBool:automaticLinkDetectionEnabled forKey:WebAutomaticLinkDetectionEnabled];   
     8613    [[NSUserDefaults standardUserDefaults] setBool:automaticLinkDetectionEnabled forKey:WebAutomaticLinkDetectionEnabled];
    86108614    [[NSSpellChecker sharedSpellChecker] updatePanels];
    86118615}
     
    86218625        return;
    86228626    automaticDashSubstitutionEnabled = flag;
    8623     [[NSUserDefaults standardUserDefaults] setBool:automaticDashSubstitutionEnabled forKey:WebAutomaticDashSubstitutionEnabled];   
     8627    [[NSUserDefaults standardUserDefaults] setBool:automaticDashSubstitutionEnabled forKey:WebAutomaticDashSubstitutionEnabled];
    86248628    [[NSSpellChecker sharedSpellChecker] updatePanels];
    86258629}
     
    86358639        return;
    86368640    automaticTextReplacementEnabled = flag;
    8637     [[NSUserDefaults standardUserDefaults] setBool:automaticTextReplacementEnabled forKey:WebAutomaticTextReplacementEnabled];   
     8641    [[NSUserDefaults standardUserDefaults] setBool:automaticTextReplacementEnabled forKey:WebAutomaticTextReplacementEnabled];
    86388642    [[NSSpellChecker sharedSpellChecker] updatePanels];
    86398643}
     
    86498653        return;
    86508654    automaticSpellingCorrectionEnabled = flag;
    8651     [[NSUserDefaults standardUserDefaults] setBool:automaticSpellingCorrectionEnabled forKey:WebAutomaticSpellingCorrectionEnabled];   
     8655    [[NSUserDefaults standardUserDefaults] setBool:automaticSpellingCorrectionEnabled forKey:WebAutomaticSpellingCorrectionEnabled];
    86528656    [[NSSpellChecker sharedSpellChecker] updatePanels];
    86538657}
     
    86678671{
    86688672    [[self _selectedOrMainFrame] _replaceSelectionWithNode:node selectReplacement:YES smartReplace:NO matchStyle:NO];
    8669 }   
     8673}
    86708674
    86718675- (void)replaceSelectionWithText:(NSString *)text
     
    86918695        coreFrame->editor().deleteSelectionWithSmartDelete([(WebHTMLView *)[[webFrame frameView] documentView] _canSmartCopyOrDelete]);
    86928696}
    8693    
     8697
    86948698- (void)applyStyle:(DOMCSSStyleDeclaration *)style
    86958699{
     
    87508754    if (!coreFrame)
    87518755        return;
    8752    
     8756
    87538757    coreFrame->editor().insertDictationPhrases(vectorForDictationPhrasesArray(dictationPhrases), metadata);
    87548758}
     
    87648768    if (auto* coreFrame = core([self _selectedOrMainFrame]))
    87658769        return coreFrame->editor().fontAttributesAtSelectionStart().createDictionary().autorelease();
    8766    
     8770
    87678771    return nil;
    87688772}
     
    88548858#if PLATFORM(IOS_FAMILY)
    88558859        else
    8856             cacheTotalCapacity = 4 * 1024 * 1024; 
     8860            cacheTotalCapacity = 4 * 1024 * 1024;
    88578861#endif
    88588862
     
    89058909            nsurlCacheMemoryCapacity = 1 * 1024 * 1024;
    89068910        else
    8907             nsurlCacheMemoryCapacity =      512 * 1024; 
     8911            nsurlCacheMemoryCapacity =      512 * 1024;
    89088912
    89098913        // Foundation disk cache capacity (in bytes)
     
    89378941        // Object cache capacities (in bytes)
    89388942        // (Testing indicates that value / MB depends heavily on content and
    8939         // browsing pattern. Even growth above 128MB can have substantial 
     8943        // browsing pattern. Even growth above 128MB can have substantial
    89408944        // value / MB for some content / browsing patterns.)
    89418945        if (memSize >= 4096)
     
    89728976            nsurlCacheMemoryCapacity = 1 * 1024 * 1024;
    89738977        else
    8974             nsurlCacheMemoryCapacity =      512 * 1024; 
     8978            nsurlCacheMemoryCapacity =      512 * 1024;
    89758979#endif
    89768980
     
    90489052    NSURLRequest *request = [[dataSource request] copy];
    90499053    ASSERT(request);
    9050    
     9054
    90519055    [self _openNewWindowWithRequest:request];
    90529056    [request release];
     
    90599063        return;
    90609064    }
    9061    
     9065
    90629066    NSString *selectedString = [(id <WebDocumentText>)documentView selectedString];
    90639067    if ([selectedString length] == 0) {
    90649068        return;
    90659069    }
    9066    
     9070
    90679071    NSPasteboard *pasteboard = [NSPasteboard pasteboardWithUniqueName];
    90689072    [pasteboard declareTypes:[NSArray arrayWithObject:WebCore::legacyStringPasteboardType()] owner:nil];
     
    90739077    [pasteboard setString:s forType:WebCore::legacyStringPasteboardType()];
    90749078    [s release];
    9075    
     9079
    90769080    // FIXME: seems fragile to use the service by name, but this is what AppKit does
    90779081    NSPerformService(@"Search With Google", pasteboard);
     
    91119115
    91129116    // If the identifier map is initially empty it means we're starting a load
    9113     // of something. The semantic is that the web view should be around as long 
     9117    // of something. The semantic is that the web view should be around as long
    91149118    // as something is loading. Because of that we retain the web view.
    91159119    if (_private->identifierMap.isEmpty())
    91169120        CFRetain(self);
    9117    
     9121
    91189122    _private->identifierMap.set(identifier, object);
    91199123}
     
    91289132    ASSERT(_private->identifierMap.contains(identifier));
    91299133    _private->identifierMap.remove(identifier);
    9130    
     9134
    91319135    // If the identifier map is now empty it means we're no longer loading anything
    91329136    // and we should release the web view. Autorelease rather than release in order to
     
    91609164
    91619165        [self _retrieveKeyboardUIModeFromPreferences:nil];
    9162        
     9166
    91639167#if !PLATFORM(IOS_FAMILY)
    9164         [[NSDistributedNotificationCenter defaultCenter] 
    9165             addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:) 
     9168        [[NSDistributedNotificationCenter defaultCenter]
     9169            addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
    91669170            name:KeyboardUIModeDidChangeNotification object:nil];
    91679171#endif
    91689172
    9169         [[NSNotificationCenter defaultCenter] 
    9170             addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:) 
     9173        [[NSNotificationCenter defaultCenter]
     9174            addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:)
    91719175            name:WebPreferencesChangedInternalNotification object:nil];
    91729176    }
     
    92199223/*
    92209224    The order of events with compositing updates is this:
    9221    
     9225
    92229226   Start of runloop                                        End of runloop
    92239227        |                                                       |
     
    92269230           |         |                                        |
    92279231    NSWindow update, |                                     CA commit
    9228      NSView drawing  |                                 
    9229         flush        |                                 
     9232     NSView drawing  |
     9233        flush        |
    92309234                layerSyncRunLoopObserverCallBack
    92319235
     
    92379241    its "CA commit" observer. Those changes can then appear onscreen at any time
    92389242    when the display link fires, which can result in unsynchronized rendering.
    9239    
     9243
    92409244    To fix this, the GraphicsLayerCA code in WebCore does not change the CA
    92419245    layer tree during style changes and layout; it stores up all changes and
    92429246    commits them via flushCompositingState(). There are then two situations in
    92439247    which we can call flushCompositingState():
    9244    
     9248
    92459249    1. When painting. FrameView::paintContents() makes a call to flushCompositingState().
    9246    
     9250
    92479251    2. When style changes/layout have made changes to the layer tree which do not
    92489252       result in painting. In this case we need a run loop observer to do a
    92499253       flushCompositingState() at an appropriate time. The observer will keep firing
    92509254       until the time is right (essentially when there are no more pending layouts).
    9251    
     9255
    92529256*/
    92539257bool LayerFlushController::flushLayers()
     
    94139417    [_private->newFullscreenController setElement:element.get()];
    94149418    [_private->newFullscreenController setWebView:self];
    9415     [_private->newFullscreenController enterFullScreen:[[self window] screen]];       
     9419    [_private->newFullscreenController enterFullScreen:[[self window] screen]];
    94169420}
    94179421
     
    95529556
    95539557    _private->hasInitializedLookupObserver = YES;
    9554    
     9558
    95559559#if !ENABLE(REVEAL)
    95569560    if (PAL::canLoad_Lookup_LUNotificationPopoverWillClose())
    95579561        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:PAL::get_Lookup_LUNotificationPopoverWillClose() object:nil];
    95589562#endif // !ENABLE(REVEAL)
    9559    
     9563
    95609564}
    95619565
     
    98169820    if (![documentView isKindOfClass:[WebHTMLView class]])
    98179821        return;
    9818    
     9822
    98199823    WebHTMLView *webHTMLView = (WebHTMLView *)documentView;
    98209824    if (![webHTMLView _isEditable])
Note: See TracChangeset for help on using the changeset viewer.