Title: [102285] branches/safari-534.53-branch/Source
Diff
Modified: branches/safari-534.53-branch/Source/WebKit/mac/ChangeLog (102284 => 102285)
--- branches/safari-534.53-branch/Source/WebKit/mac/ChangeLog 2011-12-08 00:35:12 UTC (rev 102284)
+++ branches/safari-534.53-branch/Source/WebKit/mac/ChangeLog 2011-12-08 00:45:14 UTC (rev 102285)
@@ -1,3 +1,25 @@
+2011-12-07 Lucas Forschler <[email protected]>
+
+ Merge 99617
+
+ 2011-11-08 Beth Dakin <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=71856
+ WebKit should use new NSWindowDidChangeBackingPropertiesNotification instead of
+ old NSWindowDidChangeResolutionNotification
+ -and corresponding-
+ <rdar://problem/10317253>
+
+ Reviewed by Tim Hatcher.
+
+ * WebView/WebView.mm:
+ (-[WebView addWindowObserversForWindow:]):
+ (-[WebView removeWindowObservers]):
+
+ We have to check that the backing scale factor actually changed since this
+ notification can also be used to signify other changes.
+ (-[WebView _windowDidChangeBackingProperties:]):
+
2011-12-06 Lucas Forschler <[email protected]>
Merge 97886
Modified: branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebView.mm (102284 => 102285)
--- branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebView.mm 2011-12-08 00:35:12 UTC (rev 102284)
+++ branches/safari-534.53-branch/Source/WebKit/mac/WebView/WebView.mm 2011-12-08 00:45:14 UTC (rev 102285)
@@ -3339,8 +3339,9 @@
return _private->shouldCloseWithWindow;
}
-// FIXME: Use an AppKit constant for this once one is available.
-static NSString * const windowDidChangeResolutionNotification = @"NSWindowDidChangeResolutionNotification";
+// FIXME: Use AppKit constants for these when they are available.
+static NSString * const windowDidChangeBackingPropertiesNotification = @"NSWindowDidChangeBackingPropertiesNotification";
+static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey";
- (void)addWindowObserversForWindow:(NSWindow *)window
{
@@ -3353,8 +3354,10 @@
name:WKWindowWillOrderOnScreenNotification() object:window];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillOrderOffScreen:)
name:WKWindowWillOrderOffScreenNotification() object:window];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeResolution:)
- name:windowDidChangeResolutionNotification object:window];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeBackingProperties:)
+ name:windowDidChangeBackingPropertiesNotification object:window];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeScreen:)
+ name:NSWindowDidChangeScreenNotification object:window];
}
}
@@ -3371,7 +3374,7 @@
[[NSNotificationCenter defaultCenter] removeObserver:self
name:WKWindowWillOrderOffScreenNotification() object:window];
[[NSNotificationCenter defaultCenter] removeObserver:self
- name:windowDidChangeResolutionNotification object:window];
+ name:windowDidChangeBackingPropertiesNotification object:window];
}
}
@@ -3463,9 +3466,14 @@
[self close];
}
-- (void)_windowDidChangeResolution:(NSNotification *)notification
+- (void)_windowDidChangeBackingProperties:(NSNotification *)notification
{
- _private->page->setDeviceScaleFactor([self _deviceScaleFactor]);
+ CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue];
+ CGFloat newBackingScaleFactor = [self _deviceScaleFactor];
+ if (oldBackingScaleFactor == newBackingScaleFactor)
+ return;
+
+ _private->page->setDeviceScaleFactor(newBackingScaleFactor);
}
- (void)setPreferences:(WebPreferences *)prefs
Modified: branches/safari-534.53-branch/Source/WebKit2/ChangeLog (102284 => 102285)
--- branches/safari-534.53-branch/Source/WebKit2/ChangeLog 2011-12-08 00:35:12 UTC (rev 102284)
+++ branches/safari-534.53-branch/Source/WebKit2/ChangeLog 2011-12-08 00:45:14 UTC (rev 102285)
@@ -1,5 +1,27 @@
2011-12-07 Lucas Forschler <[email protected]>
+ Merge 99617
+
+ 2011-11-08 Beth Dakin <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=71856
+ WebKit should use new NSWindowDidChangeBackingPropertiesNotification instead of
+ old NSWindowDidChangeResolutionNotification
+ -and corresponding-
+ <rdar://problem/10317253>
+
+ Reviewed by Tim Hatcher.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView addWindowObserversForWindow:]):
+ (-[WKView removeWindowObservers]):
+
+ We have to check that the backing scale factor actually changed since this
+ notification can also be used to signify other changes.
+ (-[WKView _windowDidChangeBackingProperties:]):
+
+2011-12-07 Lucas Forschler <[email protected]>
+
Merge 99493
2011-11-07 Beth Dakin <[email protected]>
Modified: branches/safari-534.53-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (102284 => 102285)
--- branches/safari-534.53-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2011-12-08 00:35:12 UTC (rev 102284)
+++ branches/safari-534.53-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2011-12-08 00:45:14 UTC (rev 102285)
@@ -1697,8 +1697,9 @@
return ownsGrowBox;
}
-// FIXME: Use an AppKit constant for this once one is available.
-static NSString * const windowDidChangeResolutionNotification = @"NSWindowDidChangeResolutionNotification";
+// FIXME: Use AppKit constants for these when they are available.
+static NSString * const windowDidChangeBackingPropertiesNotification = @"NSWindowDidChangeBackingPropertiesNotification";
+static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey";
- (void)addWindowObserversForWindow:(NSWindow *)window
{
@@ -1719,8 +1720,8 @@
name:@"NSWindowDidOrderOffScreenNotification" object:window];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidOrderOnScreen:)
name:@"_NSWindowDidBecomeVisible" object:window];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeResolution:)
- name:windowDidChangeResolutionNotification object:window];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeBackingProperties:)
+ name:windowDidChangeBackingPropertiesNotification object:window];
}
}
@@ -1739,7 +1740,7 @@
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidResizeNotification object:window];
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSWindowDidOrderOffScreenNotification" object:window];
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"_NSWindowDidBecomeVisible" object:window];
- [[NSNotificationCenter defaultCenter] removeObserver:self name:windowDidChangeResolutionNotification object:window];
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:windowDidChangeBackingPropertiesNotification object:window];
}
@@ -1835,9 +1836,14 @@
_data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
}
-- (void)_windowDidChangeResolution:(NSNotification *)notification
+- (void)_windowDidChangeBackingProperties:(NSNotification *)notification
{
- _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]);
+ CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue];
+ CGFloat newBackingScaleFactor = [self _intrinsicDeviceScaleFactor];
+ if (oldBackingScaleFactor == newBackingScaleFactor)
+ return;
+
+ _data->_page->setIntrinsicDeviceScaleFactor(newBackingScaleFactor);
}
static void drawPageBackground(CGContextRef context, WebPageProxy* page, const IntRect& rect)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes