Diff
Modified: trunk/Source/WebKit2/ChangeLog (158026 => 158027)
--- trunk/Source/WebKit2/ChangeLog 2013-10-25 18:20:25 UTC (rev 158026)
+++ trunk/Source/WebKit2/ChangeLog 2013-10-25 18:24:23 UTC (rev 158027)
@@ -1,3 +1,35 @@
+2013-10-25 Gavin Barraclough <[email protected]>
+
+ Move ViewStateFlags out of WebPageProxy
+ https://bugs.webkit.org/show_bug.cgi?id=123323
+
+ Unreviewed
+
+ Rolling out 158026 - landed extra chnages!
+
+ * Shared/ViewState.h: Removed.
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView becomeFirstResponder]):
+ (-[WKView resignFirstResponder]):
+ (-[WKView viewDidMoveToWindow]):
+ (-[WKView _windowDidBecomeKey:]):
+ (-[WKView _windowDidResignKey:]):
+ (-[WKView _windowDidMiniaturize:]):
+ (-[WKView _windowDidDeminiaturize:]):
+ (-[WKView _windowDidOrderOffScreen:]):
+ (-[WKView _windowDidOrderOnScreen:]):
+ (-[WKView _windowDidChangeOcclusionState:]):
+ (-[WKView viewDidHide]):
+ (-[WKView viewDidUnhide]):
+ (-[WKView _activeSpaceDidChange:]):
+ (-[WKView endDeferringViewInWindowChanges]):
+ (-[WKView endDeferringViewInWindowChangesSync]):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::viewInWindowStateDidChange):
+ (WebKit::WebPageProxy::viewStateDidChange):
+ * UIProcess/WebPageProxy.h:
+ * WebKit2.xcodeproj/project.pbxproj:
+
2013-10-24 Gavin Barraclough <[email protected]>
Move ViewStateFlags out of WebPageProxy
Deleted: trunk/Source/WebKit2/Shared/ViewState.h (158026 => 158027)
--- trunk/Source/WebKit2/Shared/ViewState.h 2013-10-25 18:20:25 UTC (rev 158026)
+++ trunk/Source/WebKit2/Shared/ViewState.h 2013-10-25 18:24:23 UTC (rev 158027)
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ViewState_h
-#define ViewState_h
-
-namespace WebKit {
-
-struct ViewState {
- enum {
- WindowIsActive = 1 << 0,
- IsFocused = 1 << 1,
- IsVisible = 1 << 2,
- IsInWindow = 1 << 3,
- WindowIsVisible = 1 << 4
- };
- typedef unsigned Flags;
-};
-
-} // namespace WebKit
-
-#endif // ViewState_h
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (158026 => 158027)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-10-25 18:20:25 UTC (rev 158026)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2013-10-25 18:24:23 UTC (rev 158027)
@@ -330,7 +330,7 @@
_data->_inBecomeFirstResponder = true;
[self _updateSecureInputState];
- _data->_page->viewStateDidChange(ViewState::IsFocused);
+ _data->_page->viewStateDidChange(WebPageProxy::ViewIsFocused);
_data->_inBecomeFirstResponder = false;
@@ -358,7 +358,7 @@
if (!_data->_page->maintainsInactiveSelection())
_data->_page->clearSelection();
- _data->_page->viewStateDidChange(ViewState::IsFocused);
+ _data->_page->viewStateDidChange(WebPageProxy::ViewIsFocused);
_data->_inResignFirstResponder = false;
@@ -1927,11 +1927,11 @@
_data->_windowHasValidBackingStore = NO;
[self doWindowDidChangeScreen];
- ViewState::Flags viewStateChanges = ViewState::WindowIsVisible | ViewState::WindowIsActive | ViewState::IsVisible;
+ WebPageProxy::ViewStateFlags viewStateChanges = WebPageProxy::WindowIsVisible | WebPageProxy::ViewWindowIsActive | WebPageProxy::ViewIsVisible;
if ([self isDeferringViewInWindowChanges])
_data->_viewInWindowChangeWasDeferred = YES;
else
- viewStateChanges |= ViewState::IsInWindow;
+ viewStateChanges |= WebPageProxy::ViewIsInWindow;
_data->_page->viewStateDidChange(viewStateChanges);
[self _updateWindowAndViewFrames];
@@ -1945,11 +1945,11 @@
[self _accessibilityRegisterUIProcessTokens];
} else {
- ViewState::Flags viewStateChanges = ViewState::WindowIsVisible | ViewState::WindowIsActive | ViewState::IsVisible;
+ WebPageProxy::ViewStateFlags viewStateChanges = WebPageProxy::WindowIsVisible | WebPageProxy::ViewWindowIsActive | WebPageProxy::ViewIsVisible;
if ([self isDeferringViewInWindowChanges])
_data->_viewInWindowChangeWasDeferred = YES;
else
- viewStateChanges |= ViewState::IsInWindow;
+ viewStateChanges |= WebPageProxy::ViewIsInWindow;
_data->_page->viewStateDidChange(viewStateChanges);
[NSEvent removeMonitor:_data->_flagsChangedEventMonitor];
@@ -1971,7 +1971,7 @@
NSWindow *keyWindow = [notification object];
if (keyWindow == [self window] || keyWindow == [[self window] attachedSheet]) {
[self _updateSecureInputState];
- _data->_page->viewStateDidChange(ViewState::WindowIsActive);
+ _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive);
}
}
@@ -1985,19 +1985,19 @@
NSWindow *formerKeyWindow = [notification object];
if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) {
[self _updateSecureInputState];
- _data->_page->viewStateDidChange(ViewState::WindowIsActive);
+ _data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive);
}
}
- (void)_windowDidMiniaturize:(NSNotification *)notification
{
_data->_windowHasValidBackingStore = NO;
- _data->_page->viewStateDidChange(ViewState::WindowIsVisible);
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible);
}
- (void)_windowDidDeminiaturize:(NSNotification *)notification
{
- _data->_page->viewStateDidChange(ViewState::WindowIsVisible);
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible);
}
- (void)_windowDidMove:(NSNotification *)notification
@@ -2014,12 +2014,12 @@
- (void)_windowDidOrderOffScreen:(NSNotification *)notification
{
- _data->_page->viewStateDidChange(ViewState::WindowIsVisible | ViewState::IsVisible | ViewState::WindowIsActive);
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible | WebPageProxy::ViewIsVisible | WebPageProxy::ViewWindowIsActive);
}
- (void)_windowDidOrderOnScreen:(NSNotification *)notification
{
- _data->_page->viewStateDidChange(ViewState::WindowIsVisible | ViewState::IsVisible | ViewState::WindowIsActive);
+ _data->_page->viewStateDidChange(WebPageProxy::WindowIsVisible | WebPageProxy::ViewIsVisible | WebPageProxy::ViewWindowIsActive);
}
- (void)_windowDidChangeBackingProperties:(NSNotification *)notification
@@ -2036,7 +2036,7 @@
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
- (void)_windowDidChangeOcclusionState:(NSNotification *)notification
{
- _data->_page->viewStateDidChange(ViewState::IsVisible);
+ _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
}
#endif
@@ -2060,12 +2060,12 @@
- (void)viewDidHide
{
- _data->_page->viewStateDidChange(ViewState::IsVisible);
+ _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
}
- (void)viewDidUnhide
{
- _data->_page->viewStateDidChange(ViewState::IsVisible);
+ _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
}
- (void)viewDidChangeBackingProperties
@@ -2081,7 +2081,7 @@
- (void)_activeSpaceDidChange:(NSNotification *)notification
{
- _data->_page->viewStateDidChange(ViewState::IsVisible);
+ _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
}
- (void)_accessibilityRegisterUIProcessTokens
@@ -3157,7 +3157,7 @@
_data->_shouldDeferViewInWindowChanges = NO;
if (_data->_viewInWindowChangeWasDeferred) {
- _data->_page->viewStateDidChange(ViewState::IsInWindow);
+ _data->_page->viewInWindowStateDidChange();
_data->_viewInWindowChangeWasDeferred = NO;
}
}
@@ -3175,7 +3175,7 @@
_data->_shouldDeferViewInWindowChanges = NO;
if (_data->_viewInWindowChangeWasDeferred) {
- _data->_page->viewStateDidChange(ViewState::IsInWindow, hasPendingViewInWindowChange ? WebPageProxy::WantsReplyOrNot::DoesWantReply : WebPageProxy::WantsReplyOrNot::DoesNotWantReply);
+ _data->_page->viewInWindowStateDidChange(hasPendingViewInWindowChange ? WebPageProxy::WantsReplyOrNot::DoesWantReply : WebPageProxy::WantsReplyOrNot::DoesNotWantReply);
_data->_viewInWindowChangeWasDeferred = NO;
}
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (158026 => 158027)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-10-25 18:20:25 UTC (rev 158026)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-10-25 18:24:23 UTC (rev 158027)
@@ -964,25 +964,52 @@
m_pageClient->scrollView(scrollRect, scrollOffset);
}
-void WebPageProxy::viewStateDidChange(ViewState::Flags flags, WantsReplyOrNot wantsReply)
+void WebPageProxy::viewInWindowStateDidChange(WantsReplyOrNot wantsReply)
{
if (!isValid())
return;
- if (flags & ViewState::WindowIsVisible)
+ bool isInWindow = m_pageClient->isViewInWindow();
+ if (m_isInWindow != isInWindow) {
+ m_isInWindow = isInWindow;
+ m_process->send(Messages::WebPage::SetIsInWindow(isInWindow, wantsReply == WantsReplyOrNot::DoesWantReply), m_pageID);
+ }
+
+ if (isInWindow) {
+ LayerHostingMode layerHostingMode = m_pageClient->viewLayerHostingMode();
+ if (m_layerHostingMode != layerHostingMode) {
+ m_layerHostingMode = layerHostingMode;
+ m_drawingArea->layerHostingModeDidChange();
+ }
+ }
+#if ENABLE(INPUT_TYPE_COLOR_POPOVER)
+ else {
+ // When leaving the current page, close the popover color well.
+ if (m_colorPicker)
+ endColorPicker();
+ }
+#endif
+}
+
+void WebPageProxy::viewStateDidChange(ViewStateFlags flags)
+{
+ if (!isValid())
+ return;
+
+ if (flags & WindowIsVisible)
process()->send(Messages::WebPage::SetWindowIsVisible(m_pageClient->isWindowVisible()), m_pageID);
- if (flags & ViewState::IsFocused)
+ if (flags & ViewIsFocused)
m_process->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
// We want to make sure to update the active state while hidden, so if the view is hidden then update the active state
// early (in case it becomes visible), and if the view was visible then update active state later (in case it hides).
bool viewWasVisible = m_isVisible;
- if (flags & ViewState::WindowIsActive && !viewWasVisible)
+ if (flags & ViewWindowIsActive && !viewWasVisible)
m_process->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
- if (flags & ViewState::IsVisible) {
+ if (flags & ViewIsVisible) {
bool isVisible = m_pageClient->isViewVisible();
if (isVisible != m_isVisible) {
m_isVisible = isVisible;
@@ -1003,32 +1030,12 @@
}
}
- if (flags & ViewState::WindowIsActive && viewWasVisible)
+ if (flags & ViewWindowIsActive && viewWasVisible)
m_process->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
- if (flags & ViewState::IsInWindow) {
- bool isInWindow = m_pageClient->isViewInWindow();
- if (m_isInWindow != isInWindow) {
- m_isInWindow = isInWindow;
- m_process->send(Messages::WebPage::SetIsInWindow(isInWindow, wantsReply == WantsReplyOrNot::DoesWantReply), m_pageID);
- }
+ if (flags & ViewIsInWindow)
+ viewInWindowStateDidChange();
- if (isInWindow) {
- LayerHostingMode layerHostingMode = m_pageClient->viewLayerHostingMode();
- if (m_layerHostingMode != layerHostingMode) {
- m_layerHostingMode = layerHostingMode;
- m_drawingArea->layerHostingModeDidChange();
- }
- }
-#if ENABLE(INPUT_TYPE_COLOR_POPOVER)
- else {
- // When leaving the current page, close the popover color well.
- if (m_colorPicker)
- endColorPicker();
- }
-#endif
- }
-
#if ENABLE(PAGE_VISIBILITY_API)
PageVisibilityState visibilityState = PageVisibilityStateHidden;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (158026 => 158027)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-10-25 18:20:25 UTC (rev 158026)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-10-25 18:24:23 UTC (rev 158027)
@@ -37,7 +37,6 @@
#include "PlatformProcessIdentifier.h"
#include "SandboxExtension.h"
#include "ShareableBitmap.h"
-#include "ViewState.h"
#include "WKBase.h"
#include "WKPagePrivate.h"
#include "WebColorPicker.h"
@@ -324,8 +323,17 @@
bool canScrollView();
void scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
+ enum {
+ ViewWindowIsActive = 1 << 0,
+ ViewIsFocused = 1 << 1,
+ ViewIsVisible = 1 << 2,
+ ViewIsInWindow = 1 << 3,
+ WindowIsVisible = 1 << 4
+ };
+ typedef unsigned ViewStateFlags;
+ void viewStateDidChange(ViewStateFlags flags);
enum class WantsReplyOrNot { DoesNotWantReply, DoesWantReply };
- void viewStateDidChange(ViewState::Flags, WantsReplyOrNot = WantsReplyOrNot::DoesNotWantReply);
+ void viewInWindowStateDidChange(WantsReplyOrNot = WantsReplyOrNot::DoesNotWantReply);
bool isInWindow() const { return m_isInWindow; }
void waitForDidUpdateInWindowState();
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (158026 => 158027)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-10-25 18:20:25 UTC (rev 158026)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-10-25 18:24:23 UTC (rev 158027)
@@ -656,7 +656,6 @@
7CF47FFE17276AE3008ACB91 /* WKBundlePageBannerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CF47FFC17276AE3008ACB91 /* WKBundlePageBannerMac.mm */; };
7CF47FFF17276AE3008ACB91 /* WKBundlePageBannerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
84477853176FCC0800CDC7BB /* InjectedBundleHitTestResultMediaType.h in Headers */ = {isa = PBXBuildFile; fileRef = 84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */; };
- 865E0485181A094A001F72F2 /* ViewState.h in Headers */ = {isa = PBXBuildFile; fileRef = 865E0484181A090D001F72F2 /* ViewState.h */; };
8CFECE941490F140002AAA32 /* EditorState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CFECE931490F140002AAA32 /* EditorState.cpp */; };
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
909854EC12BC4E17000AD080 /* WebMemorySampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 905620E812BC248B000799B6 /* WebMemorySampler.cpp */; };
@@ -2158,7 +2157,6 @@
7CF47FFC17276AE3008ACB91 /* WKBundlePageBannerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKBundlePageBannerMac.mm; sourceTree = "<group>"; };
7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundlePageBannerMac.h; sourceTree = "<group>"; };
84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleHitTestResultMediaType.h; sourceTree = "<group>"; };
- 865E0484181A090D001F72F2 /* ViewState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewState.h; sourceTree = "<group>"; };
8CFECE931490F140002AAA32 /* EditorState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorState.cpp; sourceTree = "<group>"; };
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8DC2EF5B0486A6940098B216 /* WebKit2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -3332,7 +3330,6 @@
1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */,
1A64245C12DE29A100CAAE2C /* UpdateInfo.h */,
BCB0B0DF12305AB100B1341E /* UserMessageCoders.h */,
- 865E0484181A090D001F72F2 /* ViewState.h */,
1A0F29C9120B37160053D1B9 /* VisitedLinkTable.cpp */,
1A0F29CA120B37160053D1B9 /* VisitedLinkTable.h */,
BC329D9916ACCE9900316DE2 /* WebArchive.cpp */,
@@ -5399,7 +5396,6 @@
CDC3830C17212282008A2FC3 /* CookieStorageShimLibrary.h in Headers */,
B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */,
2989A414167D184B004F96D2 /* CustomProtocolManager.h in Headers */,
- 865E0485181A094A001F72F2 /* ViewState.h in Headers */,
2984F589164BA095004BC0C6 /* CustomProtocolManagerMessages.h in Headers */,
29AD3093164B4C5D0072DEA9 /* CustomProtocolManagerProxy.h in Headers */,
2984F57D164B915F004BC0C6 /* CustomProtocolManagerProxyMessages.h in Headers */,