Select Data Detectors results instead of just highlighting them
https://bugs.webkit.org/show_bug.cgi?id=138435
<rdar://problem/18877675>

Reviewed by Beth Dakin.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::selectLastActionMenuRange):
(WebKit::WebPageProxy::selectLookupTextAtLocation): Deleted.
Rename selectLookupTextAtLocation to selectLastActionMenuRange.

* UIProcess/WebPageProxy.h:
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController willOpenMenu:withEvent:]):
Do a real selection for single-item Data Detector menus; show the yellow highlight otherwise.
Adopt selectLastActionMenuRange for non-detected text.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
(WebKit::WebPage::selectLastActionMenuRange):
(WebKit::WebPage::selectLookupTextAtLocation): Deleted.
Store the last (detected data or Lookup-derived) action menu range.
Select it upon selectLastActionMenuRange.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/dom/remove-body-during-body-replacement2.html fails on WK2
https://bugs.webkit.org/show_bug.cgi?id=138334

Reviewed by Anders Carlsson.

Source/WebKit2:

Added an SPI to focus a frame.

* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameFocus):
* WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setViewState):

Tools:

Reset focus to main frame between tests. DumpRenderTree does this via -makeFirstResponder
calls, which works because each frame is an NSView in WK1. WK2 makes equivalent
-makeFirstResponder calls, which may or may not be needed for other reasons, but
it also needs to reset internal focus explicitly.

It's not clear if this is the right long-term fix or a workaround for a WebKit bug.
WebKit behavior appears wrong, but it matches Firefox.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::resetAfterTest):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175638 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove 2 unnecessary virtual functions on InputType
https://bugs.webkit.org/show_bug.cgi?id=138433

Reviewed by Andreas Kling.

Remove 2 unused virtual functions on InputType:
- valueAttributeChanged()
- updateClearButtonVisibility()

No new tests, no behavior change.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::updateClearButtonVisibility): Deleted.
* html/HTMLInputElement.h:
* html/InputType.cpp:
(WebCore::InputType::valueAttributeChanged): Deleted.
(WebCore::InputType::updateClearButtonVisibility): Deleted.
* html/InputType.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderBlock shouldn't need a pre-destructor hook.
<https://webkit.org/b/138430>

Reviewed by Antti Koivisto.

All that was interesting in RenderBlock::willBeDestroyed() has migrated
to RenderBlockFlow. removeFromUpdateScrollInfoAfterLayoutTransaction()
can be called from the plain destructor, so just move it there.

We don't have to worry about destroyLeftoverChildren(), since RenderElement
will take care of that for us.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::~RenderBlock):
(WebCore::RenderBlock::willBeDestroyed): Deleted.
* rendering/RenderBlock.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Descendant ends up in wrong flow thread with nested columns and spans.
https://bugs.webkit.org/show_bug.cgi?id=137273

Reviewed by Simon Fraser.

Unskipped the two problematic span tests.

Source/WebCore:

* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::isValidColumnSpanner):
Remove the guard and comment and added the assertion back in.

(WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
Changed to no longer use handleSpannerRemoval. Because the spanner was removed from the flow thread's map,
handleSpannerRemoval was a no-op. So instead I just removed the placeholder by hand.

The second fix was to stop destroying the placeholder. Since the placeholder can just have been inserted, you
can't delete it, since otherwise code further up the stack will access the deleted object. For now, we just
leak the placeholder.

The third fix is to make sure the subtreeRoot is properly updated to be the new placeholder.

LayoutTests:

* TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175641 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Specificity not shown for pseudo element styles
https://bugs.webkit.org/show_bug.cgi?id=138436

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-11-05
Reviewed by Benjamin Poulain.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype.refresh):
Previously we were skipping the pre-selector <span>s when we were
not getting a listing of matched selector indices, and missing out
on the opportunity to give each selector a specificity. Now, always
loop over selectors if we have them.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Page preview popovers sometimes cover their originating element
https://bugs.webkit.org/show_bug.cgi?id=138437

Patch by Conrad Shultz <conrad_shultz@apple.com> on 2014-11-05
Reviewed by Beth Dakin.

If a popover is sufficiently large, and the originating element is in a particular location, it's
possible that the popover can't be positioned in a manner that doesn't occlude the originating element.
Address this by scaling down the popover content if it can't fit entirely between the originating
element and the screen edge.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _previewURLFromActionMenu:]):
Update to use -_createPreviewPopoverForURL:originRect:.
(-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
Renamed from -_createPreviewPopoverForURL:; extract code to -_preferredSizeForPopoverPresentedFromOriginRect:.
(-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
Compute a size that is as large as possible while keeping the popover between the origin rect and screen edge
(with an arbitrary padding applied to keep from directly abutting the screen edge).
(-[WKActionMenuController _createPreviewPopoverForURL:]): Deleted.



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