⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 288034 in webkit


Ignore:
Timestamp:
Jan 14, 2022, 2:58:18 PM (5 years ago)
Author:
dino@apple.com
Message:

REGRESSION: ARKit example loads a page full of random symbols instead of a 3D model
​https://bugs.webkit.org/show_bug.cgi?id=235254

Reviewed by Tim Horton.

When we enabled the ModelDocument support, we disabled the ContentProvider path.
This was a mistake - it has to be a runtime check.

  • UIProcess/API/Cocoa/WKPreferences.mm: Expose the ModelDocumentEnabled WebPreference so that

it can be read from a WKWebViewConfiguration.
(-[WKPreferences _setModelDocumentEnabled:]):
(-[WKPreferences _modelDocumentEnabled]):

  • UIProcess/API/Cocoa/WKPreferencesPrivate.h:
  • UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: Rather than the compile-time test, check the

WebPreferences to see if ModelDocument is disabled.
(-[WKWebViewContentProviderRegistry initWithConfiguration:]):

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r288032 r288034  
     12022-01-14  Dean Jackson  <dino@apple.com>
     2
     3        REGRESSION:  ARKit example loads a page full of random symbols instead of a 3D model
     4        https://bugs.webkit.org/show_bug.cgi?id=235254
     5
     6        Reviewed by Tim Horton.
     7
     8        When we enabled the ModelDocument support, we disabled the ContentProvider path.
     9        This was a mistake - it has to be a runtime check.
     10
     11        * UIProcess/API/Cocoa/WKPreferences.mm: Expose the ModelDocumentEnabled WebPreference so that
     12        it can be read from a WKWebViewConfiguration.
     13        (-[WKPreferences _setModelDocumentEnabled:]):
     14        (-[WKPreferences _modelDocumentEnabled]):
     15        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
     16        * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: Rather than the compile-time test, check the
     17        WebPreferences to see if ModelDocument is disabled.
     18        (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
     19
    1202022-01-14  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm

    r287121 r288034  
    15611561}
    15621562
     1563- (void)_setModelDocumentEnabled:(BOOL)enabled
     1564{
     1565    _preferences->setModelDocumentEnabled(enabled);
     1566}
     1567
     1568- (BOOL)_modelDocumentEnabled
     1569{
     1570    return _preferences->modelDocumentEnabled();
     1571}
     1572
    15631573@end
    1564 
    15651574
    15661575@implementation WKPreferences (WKDeprecated)
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h

    r286911 r288034  
    178178@property (nonatomic, setter=_setAccessHandleEnabled:) BOOL _accessHandleEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    179179@property (nonatomic, setter=_setNotificationsEnabled:) BOOL _notificationsEnabled WK_API_AVAILABLE(macos(10.13.4), ios(WK_IOS_TBA));
     180@property (nonatomic, setter=_setModelDocumentEnabled:) BOOL _modelDocumentEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    180181
    181182#if !TARGET_OS_IPHONE
  • trunk/Source/WebKit/UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm

    r285936 r288034  
    3131#import "WKPDFView.h"
    3232#import "WKUSDPreviewView.h"
    33 #import <WebKit/WKWebViewConfigurationPrivate.h>
    3433#import "WKWebViewInternal.h"
    3534#import "WebPageProxy.h"
    3635#import <WebCore/MIMETypeRegistry.h>
     36#import <WebKit/WKPreferencesPrivate.h>
     37#import <WebKit/WKWebViewConfigurationPrivate.h>
    3738#import <wtf/FixedVector.h>
    3839#import <wtf/HashCountedSet.h>
    … …  
    5556#endif
    5657
    57 #if USE(SYSTEM_PREVIEW) && !HAVE(UIKIT_WEBKIT_INTERNALS) && !ENABLE(MODEL_ELEMENT)
    58     if (configuration._systemPreviewEnabled) {
     58#if USE(SYSTEM_PREVIEW) && !HAVE(UIKIT_WEBKIT_INTERNALS)
     59    if (configuration._systemPreviewEnabled && !configuration.preferences._modelDocumentEnabled) {
    5960        for (auto& type : WebCore::MIMETypeRegistry::usdMIMETypes())
    6061            [self registerProvider:[WKUSDPreviewView class] forMIMEType:@(type)];
Note: See TracChangeset for help on using the changeset viewer.