Skip to content
Permalink
Browse files
Add simple line layout toggle to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=167405

Reviewed by Andreas Kling.

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences simpleLineLayoutEnabled]):
(-[WebPreferences setSimpleLineLayoutEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _simpleLineLayoutEnabled]):
(-[WKPreferences _setSimpleLineLayoutEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleSimpleLineLayoutEnabled:]):
(-[SettingsController simpleLineLayoutEnabled]):
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):


Canonical link: https://commits.webkit.org/184434@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbujtas committed Jan 25, 2017
1 parent 018147d commit 2fc6d53cda2fe18765b93b949dd3126ae722e641
@@ -1,3 +1,19 @@
2017-01-24 Zalan Bujtas <zalan@apple.com>

Add simple line layout toggle to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=167405

Reviewed by Andreas Kling.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences simpleLineLayoutEnabled]):
(-[WebPreferences setSimpleLineLayoutEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

2017-01-24 Joseph Pecoraro <pecoraro@apple.com>

Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
@@ -105,6 +105,7 @@
#define WebKitCanvasUsesAcceleratedDrawingPreferenceKey @"WebKitCanvasUsesAcceleratedDrawing"
#define WebKitAcceleratedCompositingEnabledPreferenceKey @"WebKitAcceleratedCompositingEnabled"
#define WebKitShowDebugBordersPreferenceKey @"WebKitShowDebugBorders"
#define WebKitSimpleLineLayoutEnabledPreferenceKey @"WebKitSimpleLineLayoutEnabled"
#define WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey @"WebKitSimpleLineLayoutDebugBordersEnabled"
#define WebKitShowRepaintCounterPreferenceKey @"WebKitShowRepaintCounter"
#define WebKitWebAudioEnabledPreferenceKey @"WebKitWebAudioEnabled"
@@ -500,6 +500,7 @@ + (void)initialize
[NSNumber numberWithBool:NO], WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
#endif
[NSNumber numberWithBool:NO], WebKitShowDebugBordersPreferenceKey,
[NSNumber numberWithBool:YES], WebKitSimpleLineLayoutEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitShowRepaintCounterPreferenceKey,
[NSNumber numberWithBool:YES], WebKitWebGLEnabledPreferenceKey,
@@ -1960,6 +1961,16 @@ - (void)setShowDebugBorders:(BOOL)enabled
[self _setBoolValue:enabled forKey:WebKitShowDebugBordersPreferenceKey];
}

- (BOOL)simpleLineLayoutEnabled
{
return [self _boolValueForKey:WebKitSimpleLineLayoutEnabledPreferenceKey];
}

- (void)setSimpleLineLayoutEnabled:(BOOL)enabled
{
[self _setBoolValue:enabled forKey:WebKitSimpleLineLayoutEnabledPreferenceKey];
}

- (BOOL)simpleLineLayoutDebugBordersEnabled
{
return [self _boolValueForKey:WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey];
@@ -227,6 +227,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
- (BOOL)showDebugBorders;
- (void)setShowDebugBorders:(BOOL)show;

- (BOOL)simpleLineLayoutEnabled;
- (void)setSimpleLineLayoutEnabled:(BOOL)enabled;

- (BOOL)simpleLineLayoutDebugBordersEnabled;
- (void)setSimpleLineLayoutDebugBordersEnabled:(BOOL)enabled;

@@ -2681,6 +2681,7 @@ - (void)_preferencesChanged:(WebPreferences *)preferences
settings.setDisplayListDrawingEnabled([preferences displayListDrawingEnabled]);
settings.setCanvasUsesAcceleratedDrawing([preferences canvasUsesAcceleratedDrawing]);
settings.setShowDebugBorders([preferences showDebugBorders]);
settings.setSimpleLineLayoutEnabled([preferences simpleLineLayoutEnabled]);
settings.setSimpleLineLayoutDebugBordersEnabled([preferences simpleLineLayoutDebugBordersEnabled]);
settings.setShowRepaintCounter([preferences showRepaintCounter]);
settings.setWebGLEnabled([preferences webGLEnabled]);
@@ -1,3 +1,15 @@
2017-01-24 Zalan Bujtas <zalan@apple.com>

Add simple line layout toggle to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=167405

Reviewed by Andreas Kling.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _simpleLineLayoutEnabled]):
(-[WKPreferences _setSimpleLineLayoutEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

2017-01-24 Joseph Pecoraro <pecoraro@apple.com>

Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
@@ -285,6 +285,16 @@ - (void)_setVisibleDebugOverlayRegions:(_WKDebugOverlayRegions)regionFlags
_preferences->setVisibleDebugOverlayRegions(regionFlags);
}

- (BOOL)_simpleLineLayoutEnabled
{
return _preferences->simpleLineLayoutEnabled();
}

- (void)_setSimpleLineLayoutEnabled:(BOOL)simpleLineLayoutEnabled
{
_preferences->setSimpleLineLayoutEnabled(simpleLineLayoutEnabled);
}

- (BOOL)_simpleLineLayoutDebugBordersEnabled
{
return _preferences->simpleLineLayoutDebugBordersEnabled();
@@ -59,6 +59,7 @@ typedef NS_OPTIONS(NSUInteger, _WKJavaScriptRuntimeFlags) {
@property (nonatomic, setter=_setTiledScrollingIndicatorVisible:) BOOL _tiledScrollingIndicatorVisible;
@property (nonatomic, setter=_setResourceUsageOverlayVisible:) BOOL _resourceUsageOverlayVisible WK_API_AVAILABLE(macosx(10.12), ios(10.0));
@property (nonatomic, setter=_setVisibleDebugOverlayRegions:) _WKDebugOverlayRegions _visibleDebugOverlayRegions WK_API_AVAILABLE(macosx(10.11), ios(9.0));
@property (nonatomic, setter=_setSimpleLineLayoutEnabled:) BOOL _simpleLineLayoutEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
@property (nonatomic, setter=_setSimpleLineLayoutDebugBordersEnabled:) BOOL _simpleLineLayoutDebugBordersEnabled WK_API_AVAILABLE(macosx(10.11), ios(9.0));
@property (nonatomic, setter=_setAcceleratedDrawingEnabled:) BOOL _acceleratedDrawingEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
@property (nonatomic, setter=_setDisplayListDrawingEnabled:) BOOL _displayListDrawingEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
@@ -1,3 +1,21 @@
2017-01-24 Zalan Bujtas <zalan@apple.com>

Add simple line layout toggle to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=167405

Reviewed by Andreas Kling.

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleSimpleLineLayoutEnabled:]):
(-[SettingsController simpleLineLayoutEnabled]):
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

2017-01-24 Joseph Pecoraro <pecoraro@apple.com>

WKR does not include my nick when commit-queue lands my patch
@@ -38,6 +38,7 @@
@property (nonatomic, readonly) BOOL useTransparentWindows;
@property (nonatomic, readonly) BOOL usePaginatedMode;
@property (nonatomic, readonly) BOOL layerBordersVisible;
@property (nonatomic, readonly) BOOL simpleLineLayoutEnabled;
@property (nonatomic, readonly) BOOL simpleLineLayoutDebugBordersEnabled;
@property (nonatomic, readonly) BOOL incrementalRenderingSuppressed;
@property (nonatomic, readonly) BOOL tiledScrollingIndicatorVisible;
@@ -39,6 +39,7 @@
static NSString * const UseWebKit2ByDefaultPreferenceKey = @"UseWebKit2ByDefault";
static NSString * const CreateEditorByDefaultPreferenceKey = @"CreateEditorByDefault";
static NSString * const LayerBordersVisiblePreferenceKey = @"LayerBordersVisible";
static NSString * const SimpleLineLayoutEnabledPreferenceKey = @"SimpleLineLayoutEnabled";
static NSString * const SimpleLineLayoutDebugBordersEnabledPreferenceKey = @"SimpleLineLayoutDebugBordersEnabled";
static NSString * const TiledScrollingIndicatorVisiblePreferenceKey = @"TiledScrollingIndicatorVisible";
static NSString * const ReserveSpaceForBannersPreferenceKey = @"ReserveSpaceForBanners";
@@ -128,6 +129,7 @@ - (void)_populateMenu
[self _addItemWithTitle:@"Use Transparent Windows" action:@selector(toggleUseTransparentWindows:) indented:NO];
[self _addItemWithTitle:@"Use Paginated Mode" action:@selector(toggleUsePaginatedMode:) indented:NO];
[self _addItemWithTitle:@"Show Layer Borders" action:@selector(toggleShowLayerBorders:) indented:NO];
[self _addItemWithTitle:@"Disable Simple Line Layout" action:@selector(toggleSimpleLineLayoutEnabled:) indented:NO];
[self _addItemWithTitle:@"Show Simple Line Layout Borders" action:@selector(toggleSimpleLineLayoutDebugBordersEnabled:) indented:NO];
[self _addItemWithTitle:@"Suppress Incremental Rendering in New Windows" action:@selector(toggleIncrementalRenderingSuppressed:) indented:NO];
[self _addItemWithTitle:@"Enable Accelerated Drawing" action:@selector(toggleAcceleratedDrawingEnabled:) indented:NO];
@@ -205,6 +207,8 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
[menuItem setState:[self usePaginatedMode] ? NSOnState : NSOffState];
else if (action == @selector(toggleShowLayerBorders:))
[menuItem setState:[self layerBordersVisible] ? NSOnState : NSOffState];
else if (action == @selector(toggleSimpleLineLayoutEnabled:))
[menuItem setState:[self simpleLineLayoutEnabled] ? NSOffState : NSOnState];
else if (action == @selector(toggleSimpleLineLayoutDebugBordersEnabled:))
[menuItem setState:[self simpleLineLayoutDebugBordersEnabled] ? NSOnState : NSOffState];
else if (action == @selector(toggleIncrementalRenderingSuppressed:))
@@ -350,6 +354,16 @@ - (BOOL)layerBordersVisible
return [[NSUserDefaults standardUserDefaults] boolForKey:LayerBordersVisiblePreferenceKey];
}

- (void)toggleSimpleLineLayoutEnabled:(id)sender
{
[self _toggleBooleanDefault:SimpleLineLayoutEnabledPreferenceKey];
}

- (BOOL)simpleLineLayoutEnabled
{
return [[NSUserDefaults standardUserDefaults] boolForKey:SimpleLineLayoutEnabledPreferenceKey];
}

- (void)toggleSimpleLineLayoutDebugBordersEnabled:(id)sender
{
[self _toggleBooleanDefault:SimpleLineLayoutDebugBordersEnabledPreferenceKey];
@@ -264,6 +264,7 @@ - (void)didChangeSettings

[[WebPreferences standardPreferences] setSubpixelCSSOMElementMetricsEnabled:settings.subPixelCSSOMMetricsEnabled];
[[WebPreferences standardPreferences] setShowDebugBorders:settings.layerBordersVisible];
[[WebPreferences standardPreferences] setSimpleLineLayoutEnabled:settings.simpleLineLayoutEnabled];
[[WebPreferences standardPreferences] setSimpleLineLayoutDebugBordersEnabled:settings.simpleLineLayoutDebugBordersEnabled];
[[WebPreferences standardPreferences] setShowRepaintCounter:settings.layerBordersVisible];
[[WebPreferences standardPreferences] setSuppressesIncrementalRendering:settings.incrementalRenderingSuppressed];
@@ -370,6 +370,7 @@ - (void)didChangeSettings
preferences._tiledScrollingIndicatorVisible = settings.tiledScrollingIndicatorVisible;
preferences._compositingBordersVisible = settings.layerBordersVisible;
preferences._compositingRepaintCountersVisible = settings.layerBordersVisible;
preferences._simpleLineLayoutEnabled = settings.simpleLineLayoutEnabled;
preferences._simpleLineLayoutDebugBordersEnabled = settings.simpleLineLayoutDebugBordersEnabled;
preferences._acceleratedDrawingEnabled = settings.acceleratedDrawingEnabled;
preferences._resourceUsageOverlayVisible = settings.resourceUsageOverlayVisible;

0 comments on commit 2fc6d53

Please sign in to comment.