Add page overlays that show regions with mouseWheel event handlers, and the non-fast-scrollable region, and code to toggle them in MiniBrowser WK2
https://bugs.webkit.org/show_bug.cgi?id=138257

Reviewed by Tim Horton.
Source/WebCore:

Add code for debugging page overlays that show the non-fast scrollable region,
and the region with wheel event handlers. The list of region types is intended
to be easily extensible.

A singleton DebugPageOverlays maintains a map of Frame -> vector of overlays.
A purely inline code path is provided so that DebugPageOverlays::didLayout() is
fast.

For each region type, a PageOverlay::Client subclass knows how to generate
the region, which is painted into a document-level page overlay.

Add a set of bitflags to Settings to control region visibility.

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* page/DebugPageOverlays.cpp: Added.
(WebCore::RegionOverlay::overlay):
(WebCore::MouseWheelRegionOverlay::updateRegion):
(WebCore::NonFastScrollableRegionOverlay::updateRegion):
(WebCore::RegionOverlay::create):
(WebCore::RegionOverlay::RegionOverlay):
(WebCore::RegionOverlay::~RegionOverlay):
(WebCore::RegionOverlay::pageOverlayDestroyed):
(WebCore::RegionOverlay::willMoveToPage):
(WebCore::RegionOverlay::didMoveToPage):
(WebCore::RegionOverlay::drawRect):
(WebCore::RegionOverlay::mouseEvent):
(WebCore::RegionOverlay::didScrollFrame):
(WebCore::RegionOverlay::recomputeRegion):
(WebCore::DebugPageOverlays::shared):
(WebCore::indexOf):
(WebCore::DebugPageOverlays::ensureRegionOverlayForFrame):
(WebCore::DebugPageOverlays::showRegionOverlay):
(WebCore::DebugPageOverlays::hideRegionOverlay):
(WebCore::DebugPageOverlays::regionChanged):
(WebCore::DebugPageOverlays::regionOverlayForFrame):
(WebCore::DebugPageOverlays::updateOverlayRegionVisibility):
(WebCore::DebugPageOverlays::settingsChanged):
* page/DebugPageOverlays.h: Added.
(WebCore::DebugPageOverlays::hasOverlaysForFrame):
(WebCore::DebugPageOverlays::hasOverlays):
(WebCore::DebugPageOverlays::didLayout):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
* page/Settings.h:
* page/Settings.in:

Source/WebKit2:

Add private prefs to control visibility of debug-related page region overlays.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _visibleDebugOverlayRegions]):
(-[WKPreferences _setVisibleDebugOverlayRegions:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/mac/WebPreferencesMac.mm:
(WebKit::setDebugUInt32ValueIfInUserDefaults):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updatePreferences): Update the overlays.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updatePreferences): Update the overlays.

Tools:

Add a "Debug Overlays" submenu item under "WebKit2-only Settings" which allows
the user to toggle region page overlays on and off. Two overlays are available,
for the non-fast scrollable region, and the region of element with wheel
event handlers.

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController nonFastScrollableRegionOverlayVisible]):
(-[SettingsController wheelEventHandlerRegionOverlayVisible]):
(-[SettingsController preferenceKeyForRegionOverlayTag:]):
(-[SettingsController toggleDebugOverlay:]):
(-[SettingsController debugOverlayVisible:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175494 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Client certificate credentials with session persistence don’t work
https://bugs.webkit.org/show_bug.cgi?id=138330

Reviewed by Alexey Proskuryakov.

I think this is not testable with our test HTTP server.

* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::set): Don’t require a valid URL for client certificate
credentials, since they don’t apply to a specific path. Don’t save such credentials to
CFNetwork’s persistent storage (we only do that as a workaround for sharing credentials
with the media framework, and we don’t want to expand the scope of the workaround).
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::receivedCredential): Changed to use the Credential consturctor
that takes a Credential and a new persistence, so that this code works not only with
user+password credentials.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move WebCore/bridge to std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=138280

Reviewed by Anders Carlsson.

Clean up OwnPtr in WebCore/bridge.

No new tests, no behavior changes.

* bridge/c/c_class.cpp:
(JSC::Bindings::CClass::methodNamed):
(JSC::Bindings::CClass::fieldNamed):
* bridge/c/c_class.h: Use std::unique_ptr instead of OwnPtr.
* bridge/objc/objc_class.h: ditto.
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::methodNamed):
(JSC::Bindings::ObjcClass::fieldNamed):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::callObjCFallbackObject):
* bridge/runtime_method.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: TextEditor search doesn't work after editing contents
https://bugs.webkit.org/show_bug.cgi?id=138198

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-11-03
Reviewed by Timothy Hatcher.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.customPerformSearch):
Fallback to pure TextEditor content searching (CodeMirror) if the editor has edits.

* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype.hasEdits):
Check the CodeMirror clean state to known if we have edits or not.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement action menus for editable text with spelling suggestions
https://bugs.webkit.org/show_bug.cgi?id=138333
-and corresponding-
rdar://problem/18742371

Reviewed by Tim Horton.

New types.
* Shared/API/c/WKActionMenuItemTypes.h:
* Shared/API/c/WKActionMenuTypes.h:

ActionMenuHitTestResult now stores the String result of the lookup.
* Shared/mac/ActionMenuHitTestResult.h:
* Shared/mac/ActionMenuHitTestResult.mm:
(WebKit::ActionMenuHitTestResult::encode):
(WebKit::ActionMenuHitTestResult::decode):

Make getGuessesForWord() public so we can call it from WKActionMenuController.
* UIProcess/WebPageProxy.h:
* UIProcess/mac/WKActionMenuController.mm:

Select the text for all types of text menus.
(-[WKActionMenuController isMenuForTextContent]):
(-[WKActionMenuController willOpenMenu:withEvent:]):

Spelling suggestions are presented in a sub-menu and will replace the selection 
when chosen.
(-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions:]):
(-[WKActionMenuController _changeSelectionToSuggestion:]):
(-[WKActionMenuController _createActionMenuItemForTag:]):
(-[WKActionMenuController _defaultMenuItems:]):

New function to store the lookupText as a String on the ActionMenuHitTestResult.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
(WebKit::WebPage::lookupTextAtLocation):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175498 268f45cc-cd09-0410-ab3c-d52691b4dbfc