Changeset 85356 in webkit
- Timestamp:
- Apr 29, 2011 1:42:11 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85355 r85356 1 2011-04-29 Jon Lee <jonlee@apple.com> 2 3 Reviewed by mitzpettel. 4 5 REGRESSION (WebKit2): (Mac) Selection is gone after switching tabs (59721) 6 <rdar://problem/9327332> 7 https://bugs.webkit.org/show_bug.cgi?id=59721 8 9 Removing shouldClearSelectionWhenLosingWebPageFocus(). Reverting changelist 83814. 10 11 * WebCore.exp.in: 12 * editing/EditingBehavior.h: 13 1 14 2011-04-29 Abhishek Arya <inferno@chromium.org> 2 15 -
trunk/Source/WebCore/WebCore.exp.in
r85056 r85356 1249 1249 __ZNK7WebCore6Editor7canCopyEv 1250 1250 __ZNK7WebCore6Editor7canEditEv 1251 __ZNK7WebCore6Editor8behaviorEv1252 1251 __ZNK7WebCore6Editor8canPasteEv 1253 1252 __ZNK7WebCore6Editor9canDeleteEv -
trunk/Source/WebCore/editing/EditingBehavior.h
r83814 r85356 60 60 // On Mac, when processing a contextual click, the object being clicked upon should be selected. 61 61 bool shouldSelectOnContextualMenuClick() const { return m_type == EditingMacBehavior; } 62 63 // On Mac, when the web view loses focus, any active selection clears. On Windows, the selection64 // should remain highlighted, just in an inactive state.65 bool shouldClearSelectionWhenLosingWebPageFocus() const { return m_type == EditingMacBehavior; }66 62 67 63 private: -
trunk/Source/WebKit2/ChangeLog
r85345 r85356 1 2011-04-29 Jon Lee <jonlee@apple.com> 2 3 Reviewed by mitzpettel. 4 5 REGRESSION (WebKit2): (Mac) Selection is gone after switching tabs (59721) 6 <rdar://problem/9327332> 7 https://bugs.webkit.org/show_bug.cgi?id=59721 8 9 When resigning first responder status, check to see if we need to maintain an inactive 10 selection in the web view. If we don't, we clear the selection. 11 12 This also reverts the change made in 83814, since that was a different attempt to solve this same issue. 13 14 * UIProcess/API/C/WKPage.cpp: 15 (WKPageSetMaintainsInactiveSelection): Export setMaintainsInactiveSelection() 16 * UIProcess/API/C/WKPage.h: 17 * UIProcess/API/mac/WKView.mm: 18 (-[WKView resignFirstResponder]): Check and see if we need to maintain the selection in the view prior to resigning. 19 If not, we clear the selection 20 * UIProcess/WebPageProxy.cpp: 21 (WebKit::WebPageProxy::clearSelection): Send message across process boundary 22 (WebKit::WebPageProxy::setMaintainsInactiveSelection): Sets variable 23 * UIProcess/WebPageProxy.h: New member variable to keep track of whether we need to maintain the current selection 24 (WebKit::WebPageProxy::maintainsInactiveSelection): Returns variable 25 * WebProcess/WebPage/WebPage.cpp: 26 (WebKit::WebPage::setFocused): Reverting code to just set the focused bit instead of also clearing the selection 27 (WebKit::WebPage::clearSelection): 28 * WebProcess/WebPage/WebPage.h: 29 * WebProcess/WebPage/WebPage.messages.in: add new ClearSelection() message 30 1 31 2011-04-29 Anders Carlsson <andersca@apple.com> 2 32 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r84519 r85356 335 335 } 336 336 337 void WKPageSetMaintainsInactiveSelection(WKPageRef pageRef, bool newValue) 338 { 339 return toImpl(pageRef)->setMaintainsInactiveSelection(newValue); 340 } 341 337 342 void WKPageFindString(WKPageRef pageRef, WKStringRef string, WKFindOptions options, unsigned maxMatchCount) 338 343 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.h
r85120 r85356 347 347 WK_EXPORT bool WKPageIsContentEditable(WKPageRef page); 348 348 349 WK_EXPORT void WKPageSetMaintainsInactiveSelection(WKPageRef page, bool maintainsInactiveSelection); 350 349 351 WK_EXPORT void WKPageFindString(WKPageRef page, WKStringRef string, WKFindOptions findOptions, unsigned maxMatchCount); 350 352 WK_EXPORT void WKPageHideFindUI(WKPageRef page); -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r84598 r85356 314 314 _data->_page->confirmCompositionWithoutDisturbingSelection(); 315 315 [self _resetTextInputState]; 316 317 if (!_data->_page->maintainsInactiveSelection()) 318 _data->_page->clearSelection(); 316 319 317 320 _data->_page->viewStateDidChange(WebPageProxy::ViewIsFocused); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r85339 r85356 643 643 process()->send(Messages::WebPage::SetWindowResizerSize(windowResizerSize), m_pageID); 644 644 } 645 646 void WebPageProxy::clearSelection() 647 { 648 if (!isValid()) 649 return; 650 process()->send(Messages::WebPage::ClearSelection(), m_pageID); 651 } 645 652 646 653 void WebPageProxy::validateCommand(const String& commandName, PassRefPtr<ValidateCommandCallback> callback) … … 654 661 m_validateCommandCallbacks.set(callbackID, callback.get()); 655 662 process()->send(Messages::WebPage::ValidateCommand(commandName, callbackID), m_pageID); 663 } 664 665 void WebPageProxy::setMaintainsInactiveSelection(bool newValue) 666 { 667 m_maintainsInactiveSelection = newValue; 656 668 } 657 669 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r85245 r85356 235 235 void setInitialFocus(bool); 236 236 void setWindowResizerSize(const WebCore::IntSize&); 237 238 void clearSelection(); 237 239 238 240 void setViewNeedsDisplay(const WebCore::IntRect&); … … 260 262 bool hasSelectedRange() const { return m_editorState.selectionIsRange; } 261 263 bool isContentEditable() const { return m_editorState.isContentEditable; } 264 265 bool maintainsInactiveSelection() const { return m_maintainsInactiveSelection; } 266 void setMaintainsInactiveSelection(bool); 262 267 263 268 #if PLATFORM(MAC) … … 785 790 bool m_canGoForward; 786 791 RefPtr<WebBackForwardList> m_backForwardList; 792 793 bool m_maintainsInactiveSelection; 787 794 788 795 String m_toolTip; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r85259 r85356 79 79 #include <WebCore/DragController.h> 80 80 #include <WebCore/DragData.h> 81 #include <WebCore/EditingBehavior.h>82 81 #include <WebCore/EventHandler.h> 83 82 #include <WebCore/FocusController.h> … … 1207 1206 void WebPage::setFocused(bool isFocused) 1208 1207 { 1209 if (!isFocused && m_page->focusController()->focusedOrMainFrame()->editor()->behavior().shouldClearSelectionWhenLosingWebPageFocus())1210 m_page->focusController()->focusedOrMainFrame()->selection()->clear();1211 1212 1208 m_page->focusController()->setFocused(isFocused); 1213 1209 } … … 1808 1804 } 1809 1805 1806 void WebPage::clearSelection() 1807 { 1808 m_page->focusController()->focusedOrMainFrame()->selection()->clear(); 1809 } 1810 1810 1811 bool WebPage::mainFrameHasCustomRepresentation() const 1811 1812 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r84526 r85356 365 365 366 366 void replaceSelectionWithText(WebCore::Frame*, const String&); 367 void clearSelection(); 367 368 #if PLATFORM(WIN) 368 369 void performDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, const WebCore::DragDataMap&, uint32_t flags); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r84526 r85356 68 68 DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, uint32_t policyAction, uint64_t downloadID) 69 69 70 ClearSelection() 71 70 72 # Callbacks. 71 73 GetContentsAsString(uint64_t callbackID)
Note: See TracChangeset
for help on using the changeset viewer.