TextIndicatorWindow's bounce animation is lopsided when indicating two short lines of text
https://bugs.webkit.org/show_bug.cgi?id=138458

Reviewed by Simon Fraser.

Previously, the TextIndicator's frame() covered the entire selection highlight bounds.
This was undesirable in cases where the highlight included areas far outside the
bounds of the selected text, as the TextIndicatorWindow's 'bounce' animation
would be misaligned (centered on the highlight instead of on the text).

* Shared/TextIndicator.cpp:
Get rid of the many-argument TextIndicator::create, because it was only used
internally, and have createWithSelectionInFrame make a ::Data instead.

(WebKit::TextIndicator::createWithSelectionInFrame):
Compute and store the bounding rect of all of the selected text rects, and store
all of the text rects relative to that bounding rect instead of relative to the
selection highlight bounds. We do this because the selection highlight bounds
often includes area which is far outside of the text bounds (in the case of a
selection that spans multiple lines), and causes the text indicator bounce
animation to bounce in a lopsided manner.

(WebKit::TextIndicator::TextIndicator):
Adjust to the rename of textRectsInSelectionRectCoordinates -> textRectsInBoundingRectCoordinates.

(WebKit::TextIndicator::frameRect):
Instead of the TextIndicator's frame being the selection highlight bounds,
it is now the bounds of all of the text rects.

(WebKit::TextIndicator::draw):
Translate into the image by the difference between the selection highlight bounds
and the text bounding rect. This is necessary because the content image is still generated
covering the entire selection highlight bounds, but the text rects are in text-rect-bounds coordinates.

(WebKit::TextIndicator::Data::encode):
(WebKit::TextIndicator::Data::decode):
Adjust to the rename of textRectsInSelectionRectCoordinates -> textRectsInBoundingRectCoordinates.
Encode/decode textBoundingRectInWindowCoordinates.

* Shared/TextIndicator.h:
(WebKit::TextIndicator::contentImage): Deleted.
Get rid of an unnecessary getter and constructor.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r174985-174986): Site display disappears 
https://bugs.webkit.org/show_bug.cgi?id=138082

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

In support of the change in WebCore, this adds a new functor class to unwind to our
caller's frame possibly skipping of intermediate C++ frames.

* interpreter/StackVisitor.h:
(JSC::CallerFunctor::CallerFunctor):
(JSC::CallerFunctor::callerFrame):
(JSC::CallerFunctor::operator()):

Source/WebCore:

This effectively reverts to the behavior before r174985 by using the 
lexical global object of the caller's frame to find the active document.
Before r174985, native functions are invoked with the ScopeShain of their
caller.  The lexical global object is accessed from the ScopeChain.

* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::getOwnPropertySlot):
(WebCore::findOwningDocument):
(WebCore::documentWrite):
(WebCore::JSHTMLDocument::write):
(WebCore::JSHTMLDocument::writeln):
* html/HTMLDocument.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
inspector-protocol/debugger/setPauseOnExceptions-uncaught.html frequently times out on Yosemite
https://bugs.webkit.org/show_bug.cgi?id=138097

* platform/mac-wk2/TestExpectations: Marking it as such.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Preview views often misplaced inside popover
https://bugs.webkit.org/show_bug.cgi?id=138472

Reviewed by Tim Horton.

Source/WebCore:

* WebCore.exp.in:

Source/WebKit2:

This patch makes the popover maintain aspect ratio, and it uses the final scale of 
that popover to scale the preview view as well.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKPagePreviewViewController initWithPageURL:mainViewSize:popoverToViewScale:]):
(-[WKPagePreviewViewController loadView]):
(-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
(-[WKActionMenuController _targetSize:fitsInAvailableSpace:]):
(-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
(-[WKPagePreviewViewController initWithPageURL:]): Deleted.



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