Web Inspector: Selected DOM element highlights invisible near bottom of the viewport (topContentInset?)
https://bugs.webkit.org/show_bug.cgi?id=133818

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-07-01
Reviewed by Beth Dakin.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::update):
Take the topContentInset into account when sizing the InspectorOverlay's FrameView.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Oops, didn't mean to commit this.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa][Mac] WKWebView should automatically set topContentInset when beneath a toolbar
<rdar://problem/17523159>
https://bugs.webkit.org/show_bug.cgi?id=134496

Reviewed by Beth Dakin.


Source/WebKit2: 
- Adds _automaticallyAdjustsContentInsets SPI to both WKView and WKWebView.
- Defaults _automaticallyAdjustsContentInsets to NO for WKView to keep legacy clients working.
- Defaults _automaticallyAdjustsContentInsets to YES for WKWebView.

* UIProcess/API/Cocoa/WKViewPrivate.h:
Add _automaticallyAdjustsContentInsets SPI.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Default _automaticallyAdjustsContentInsets to YES for WKWebView.

(-[WKWebView _setTopContentInset:]):
(-[WKWebView _topContentInset]):
Change to forward to the WKView, since we now do coalescing and caching there.

(-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
(-[WKWebView _automaticallyAdjustsContentInsets]):
Forward to the WKView.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add _automaticallyAdjustsContentInsets SPI.

* UIProcess/API/mac/WKView.mm:
(-[WKView renewGState]):
Ensure the contentInset is updated when the view changes, as its relative location to the toolbar may have changed.

(-[WKView addWindowObserversForWindow:]):
(-[WKView removeWindowObservers]):
(-[WKView observeValueForKeyPath:ofObject:change:context:]):
Add observers for the contentLayoutRect and titlebarAppearsTransparent properties on the window. If either of them
change, we need to recalculate the content inset.

(-[WKView _updateContentInsetsIfAutomatic]):
If _automaticallyAdjustsContentInsets is YES, follow the same rules as AppKit in setting the top content inset. Like
AppKit this is only done when:
    - The window's style mask has the NSFullSizeContentViewWindowMask bit.
    - The window does not have titlebarAppearsTransparent set.
    - And we are not in an enclosing NSScrollView.

(-[WKView _setTopContentInset:]):
(-[WKView _topContentInset]):
Coalesce setting the topContentInset to avoid a visual lag when resizing the window that was caused by us sending
multiple topContentInsets to the WebContentProcess per runloop cycle. The reason for the lag was that at the time
we observe the contentLayoutRect changing, our view may not yet be in its final position yet, so the inset will be
temporarily wrong. When the view is finally positioned correctly, we will get a renewGState, at which point we will
again calculate the inset, which now will be correct. Since these both happen in the same runloop iteration, we can
just defer sending the inset to the WebContentProcess.

(-[WKView _setAutomaticallyAdjustsContentInsets:]):
(-[WKView _automaticallyAdjustsContentInsets]):
Add the new SPI.

Tools: 
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController windowDidLoad]):
Use the NSFullSizeContentViewWindowMask bit on Yosemite and later to enable toolbar blurring.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix ServicesOverlayController teardown
<rdar://problem/17523998> and https://bugs.webkit.org/show_bug.cgi?id=134510

Reviewed by Mark Rowe.

* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::~ServicesOverlayController): Flipped logic on null-checking the overlay.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update the highest back-forward list item ID in the other WebBackForwardListItem constructor
https://bugs.webkit.org/show_bug.cgi?id=134515

Reviewed by Tim Horton.

* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::WebBackForwardListItem):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: [iOS WebKit2] Support for Speak selection
https://bugs.webkit.org/show_bug.cgi?id=134512

Reviewed by Darin Adler.

Implement a method that Speak Selection can use to retrieve the selected content.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView accessibilityRetrieveSpeakSelectionContent]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use the new legacy session state coding in WKPageCopySessionState
https://bugs.webkit.org/show_bug.cgi?id=134516

Reviewed by Tim Horton.

* UIProcess/API/C/WKPage.cpp:
(WKPageCopySessionState):
Call encodeLegacySessionState.

* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeSessionHistoryEntryData):
Use leakPtr() so we won't attempt to double-free the buffer.

(WebKit::createDictionary):
Fix a typo.

(WebKit::encodeLegacySessionState):
Don't encode the provisional URL if it's empty.

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