<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[176807] branches/safari-600.3-branch/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/176807">176807</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-12-04 11:47:31 -0800 (Thu, 04 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/176766">r176766</a>. rdar://problems/19072083</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebCoreChangeLog">branches/safari-600.3-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebCoreWebCoreexpin">branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#branchessafari6003branchSourceWebCorerenderingHitTestResultcpp">branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.cpp</a></li>
<li><a href="#branchessafari6003branchSourceWebCorerenderingHitTestResulth">branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKitChangeLog">branches/safari-600.3-branch/Source/WebKit/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebActionMenuControllermm">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2ChangeLog">branches/safari-600.3-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2SharedWebHitTestResultcpp">branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.cpp</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2SharedWebHitTestResulth">branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessmacWKActionMenuControllermm">branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2WebProcessWebPagemacWebPageMacmm">branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6003branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/ChangeLog (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/ChangeLog        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebCore/ChangeLog        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -1,5 +1,25 @@
</span><span class="cx"> 2014-12-04  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r176766. &lt;rdar://problem/19072083&gt;
+
+    2014-12-03  Beth Dakin  &lt;bdakin@apple.com&gt; 
+            
+               &lt;input&gt; elements get whitespace action menu instead of editable text menu 
+               https://bugs.webkit.org/show_bug.cgi?id=139241 
+               -and corresponding- 
+               rdar://problem/19072083 
+
+               Reviewed by Sam Weinig. 
+        
+              Since we will hit test form controls as form controls, we need a new function to  
+              determine if the hit point is over text inside that form control or not. 
+              * WebCore.exp.in: 
+              * rendering/HitTestResult.cpp: 
+              (WebCore::HitTestResult::isOverTextInsideFormControlElement): 
+              * rendering/HitTestResult.h: 
+
+2014-12-04  Dana Burkart  &lt;dburkart@apple.com&gt;
+
</ins><span class="cx">         Merge r173235. &lt;rdar://problem/19072083&gt;
</span><span class="cx"> 
</span><span class="cx">     2014-09-03  Enrica Casucci  &lt;enrica@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -1078,6 +1078,7 @@
</span><span class="cx"> __ZN7WebCore29cookieRequestHeaderFieldValueERKNS_21NetworkStorageSessionERKNS_3URLES5_
</span><span class="cx"> __ZN7WebCore29createDefaultParagraphElementERNS_8DocumentE
</span><span class="cx"> __ZN7WebCore29isCharacterSmartReplaceExemptEib
</span><ins>+__ZN7WebCore30enclosingTextUnitOfGranularityERKNS_15VisiblePositionENS_15TextGranularityENS_18SelectionDirectionE
</ins><span class="cx"> __ZN7WebCore30hostNameNeedsDecodingWithRangeEP8NSString8_NSRange
</span><span class="cx"> __ZN7WebCore30hostNameNeedsEncodingWithRangeEP8NSString8_NSRange
</span><span class="cx"> __ZN7WebCore30overrideUserPreferredLanguagesERKN3WTF6VectorINS0_6StringELm0ENS0_15CrashOnOverflowEEE
</span><span class="lines">@@ -1684,6 +1685,7 @@
</span><span class="cx"> __ZNK7WebCore13HitTestResult19mediaIsInFullscreenEv
</span><span class="cx"> __ZNK7WebCore13HitTestResult19rectBasedTestResultEv
</span><span class="cx"> __ZNK7WebCore13HitTestResult21innerNonSharedElementEv
</span><ins>+__ZNK7WebCore13HitTestResult34isOverTextInsideFormControlElementEv
</ins><span class="cx"> __ZNK7WebCore13HitTestResult5imageEv
</span><span class="cx"> __ZNK7WebCore13HitTestResult5titleERNS_13TextDirectionE
</span><span class="cx"> __ZNK7WebCore13HitTestResult9imageRectEv
</span><span class="lines">@@ -2726,7 +2728,6 @@
</span><span class="cx"> __ZN7WebCore27tileControllerMemoryHandlerEv
</span><span class="cx"> __ZN7WebCore27withinTextUnitOfGranularityERKNS_15VisiblePositionENS_15TextGranularityENS_18SelectionDirectionE
</span><span class="cx"> __ZN7WebCore30closestWordBoundaryForPositionERKNS_15VisiblePositionE
</span><del>-__ZN7WebCore30enclosingTextUnitOfGranularityERKNS_15VisiblePositionENS_15TextGranularityENS_18SelectionDirectionE
</del><span class="cx"> __ZN7WebCore30plainTextReplacingNoBreakSpaceEPKNS_5RangeEtb
</span><span class="cx"> __ZN7WebCore31NonSharedCharacterBreakIteratorC1EN3WTF10StringViewE
</span><span class="cx"> __ZN7WebCore31NonSharedCharacterBreakIteratorD1Ev
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebCorerenderingHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.cpp (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.cpp        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.cpp        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #include &quot;SVGImageElement.h&quot;
</span><span class="cx"> #include &quot;SVGNames.h&quot;
</span><span class="cx"> #include &quot;UserGestureIndicator.h&quot;
</span><ins>+#include &quot;VisibleUnits.h&quot;
</ins><span class="cx"> #include &quot;XLinkNames.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -515,6 +516,34 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HitTestResult::isOverTextInsideFormControlElement() const
+{
+    Node* node = innerNode();
+    if (!node)
+        return false;
+
+    if (!isHTMLTextFormControlElement(*node))
+        return false;
+
+    Frame* frame = node-&gt;document().frame();
+    if (!frame)
+        return false;
+
+    IntPoint framePoint = roundedPointInInnerNodeFrame();
+    if (!frame-&gt;rangeForPoint(framePoint))
+        return false;
+
+    VisiblePosition position = frame-&gt;visiblePositionForPoint(framePoint);
+    if (position.isNull())
+        return false;
+
+    RefPtr&lt;Range&gt; wordRange = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionForward);
+    if (!wordRange)
+        return false;
+
+    return !wordRange-&gt;text().isEmpty();
+}
+
</ins><span class="cx"> URL HitTestResult::absoluteLinkURL() const
</span><span class="cx"> {
</span><span class="cx">     if (m_innerURLElement)
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebCorerenderingHitTestResulth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.h (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.h        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.h        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -125,6 +125,7 @@
</span><span class="cx">     bool mediaMuted() const;
</span><span class="cx">     void toggleMediaMuteState() const;
</span><span class="cx">     bool isDownloadableMedia() const;
</span><ins>+    bool isOverTextInsideFormControlElement() const;
</ins><span class="cx"> 
</span><span class="cx">     // Returns true if it is rect-based hit test and needs to continue until the rect is fully
</span><span class="cx">     // enclosed by the boundaries of a node.
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/ChangeLog (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/ChangeLog        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebKit/ChangeLog        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-12-04  Dana Burkart  &lt;dburkart@apple.com&gt;
+
+        Merge r176766. &lt;rdar://problem/19072083&gt;
+
+    2014-12-03  Beth Dakin  &lt;bdakin@apple.com&gt; 
+      
+            &lt;input&gt; elements get whitespace action menu instead of editable text menu 
+            https://bugs.webkit.org/show_bug.cgi?id=139241 
+            -and corresponding- 
+            rdar://problem/19072083 
+     
+            Reviewed by Sam Weinig. 
+     
+            We should disallow shadow content in the hit test. This is the default and it is  
+            how context menus behave. We originally wanted to text inside shadow content so  
+            that we could find the text, but the new function I added to HitTestResult will  
+            allow that. 
+            * WebView/WebActionMenuController.mm: 
+            (-[WebActionMenuController performHitTestAtPoint:]): 
+      
+            Adjust to the fact that we don’t hit test shadow content any more. 
+            (-[WebActionMenuController focusAndSelectHitTestResult]): 
+      
+            Offer the text menus for text inside form controls. 
+            (-[WebActionMenuController _defaultMenuItems]):
+
</ins><span class="cx"> 2014-12-03  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r176680. &lt;rdar://problem/19067172&gt;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebActionMenuControllermm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -109,18 +109,8 @@
</span><span class="cx">     Frame* coreFrame = core([documentView _frame]);
</span><span class="cx">     if (!coreFrame)
</span><span class="cx">         return nil;
</span><del>-    HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
-    _hitTestResult = coreFrame-&gt;eventHandler().hitTestResultAtPoint(IntPoint(point), hitType);
</del><ins>+    _hitTestResult = coreFrame-&gt;eventHandler().hitTestResultAtPoint(IntPoint(point));
</ins><span class="cx"> 
</span><del>-    // We hit test including shadow content to get the desired result for editable text regions.
-    // But for media, we want to re-set to the shadow root.
-    if (Node* node = _hitTestResult.innerNode()) {
-        if (Element* shadowHost = node-&gt;shadowHost()) {
-            if (shadowHost-&gt;isMediaElement())
-                _hitTestResult.setToNonShadowAncestor();
-        }
-    }
-
</del><span class="cx">     return [[[WebElementDictionary alloc] initWithHitTestResult:_hitTestResult] autorelease];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -182,15 +172,13 @@
</span><span class="cx">     if (!element)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto renderer = element-&gt;renderer();
-    if (!renderer)
</del><ins>+    Frame* frame = element-&gt;document().frame();
+    if (!frame)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Frame&amp; frame = renderer-&gt;frame();
-
-    frame.page()-&gt;focusController().setFocusedElement(element, element-&gt;document().frame());
-    VisiblePosition position = renderer-&gt;positionForPoint(_hitTestResult.localPoint(), nullptr);
-    frame.selection().setSelection(position);
</del><ins>+    frame-&gt;page()-&gt;focusController().setFocusedElement(element, frame);
+    VisiblePosition position = frame-&gt;visiblePositionForPoint(_hitTestResult.roundedPointInInnerNodeFrame());
+    frame-&gt;selection().setSelection(position);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)willOpenMenu:(NSMenu *)menu withEvent:(NSEvent *)event
</span><span class="lines">@@ -875,7 +863,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Node* node = _hitTestResult.innerNode();
</span><del>-    if (node &amp;&amp; node-&gt;isTextNode()) {
</del><ins>+    if ((node &amp;&amp; node-&gt;isTextNode()) || _hitTestResult.isOverTextInsideFormControlElement()) {
</ins><span class="cx">         NSArray *dataDetectorMenuItems = [self _defaultMenuItemsForDataDetectedText];
</span><span class="cx">         if (_currentActionContext) {
</span><span class="cx">             // If this is a data detected item with no menu items, we should not fall back to regular text options.
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -1,5 +1,41 @@
</span><span class="cx"> 2014-12-04  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r176766. &lt;rdar://problem/19072083&gt;
+
+   2014-12-03  Beth Dakin  &lt;bdakin@apple.com&gt; 
+    
+            &lt;input&gt; elements get whitespace action menu instead of editable text menu 
+            https://bugs.webkit.org/show_bug.cgi?id=139241 
+            -and corresponding- 
+            rdar://problem/19072083 
+     
+            Reviewed by Sam Weinig. 
+
+            Add isOverTextInsideFormControlElement to WebHitTestResult. 
+            * Shared/WebHitTestResult.cpp: 
+            (WebKit::WebHitTestResult::Data::Data): 
+            (WebKit::WebHitTestResult::Data::encode): 
+            (WebKit::WebHitTestResult::Data::decode): 
+            * Shared/WebHitTestResult.h: 
+            (WebKit::WebHitTestResult::isOverTextInsideFormControlElement): 
+   
+            Offer the text menus for text inside form controls. 
+            * UIProcess/mac/WKActionMenuController.mm: 
+            (-[WKActionMenuController _defaultMenuItems]): 
+   
+            We should disallow shadow content in the hit test. This is the default and it is  
+            how context menus behave. We originally wanted to text inside shadow content so  
+            that we could find the text, but the new function I added to HitTestResult will  
+            allow that. 
+            * WebProcess/WebPage/mac/WebPageMac.mm: 
+
+            Adjust to the fact that we don’t hit test shadow content any more. 
+            (WebKit::WebPage::performActionMenuHitTestAtLocation): 
+            (WebKit::WebPage::lookupTextAtLocation): 
+            (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult): 
+
+2014-12-04  Dana Burkart  &lt;dburkart@apple.com&gt;
+
</ins><span class="cx">         Merge r173235. &lt;rdar://problem/19072083&gt;
</span><span class="cx"> 
</span><span class="cx">     2014-09-03  Enrica Casucci  &lt;enrica@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2SharedWebHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.cpp (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.cpp        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.cpp        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">     , isScrollbar(hitTestResult.scrollbar())
</span><span class="cx">     , isSelected(hitTestResult.isSelected())
</span><span class="cx">     , isTextNode(hitTestResult.innerNode() &amp;&amp; hitTestResult.innerNode()-&gt;isTextNode())
</span><ins>+    , isOverTextInsideFormControlElement(hitTestResult.isOverTextInsideFormControlElement())
</ins><span class="cx">     , isDownloadableMedia(hitTestResult.isDownloadableMedia())
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -75,6 +76,7 @@
</span><span class="cx">     encoder &lt;&lt; isScrollbar;
</span><span class="cx">     encoder &lt;&lt; isSelected;
</span><span class="cx">     encoder &lt;&lt; isTextNode;
</span><ins>+    encoder &lt;&lt; isOverTextInsideFormControlElement;
</ins><span class="cx">     encoder &lt;&lt; isDownloadableMedia;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -91,6 +93,7 @@
</span><span class="cx">         || !decoder.decode(hitTestResultData.isScrollbar)
</span><span class="cx">         || !decoder.decode(hitTestResultData.isSelected)
</span><span class="cx">         || !decoder.decode(hitTestResultData.isTextNode)
</span><ins>+        || !decoder.decode(hitTestResultData.isOverTextInsideFormControlElement)
</ins><span class="cx">         || !decoder.decode(hitTestResultData.isDownloadableMedia))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2SharedWebHitTestResulth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.h (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.h        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.h        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">         bool isScrollbar;
</span><span class="cx">         bool isSelected;
</span><span class="cx">         bool isTextNode;
</span><ins>+        bool isOverTextInsideFormControlElement;
</ins><span class="cx">         bool isDownloadableMedia;
</span><span class="cx"> 
</span><span class="cx">         Data();
</span><span class="lines">@@ -86,6 +87,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool isTextNode() const { return m_data.isTextNode; }
</span><span class="cx"> 
</span><ins>+    bool isOverTextInsideFormControlElement() const { return m_data.isOverTextInsideFormControlElement; }
+
</ins><span class="cx">     bool isDownloadableMedia() const { return m_data.isDownloadableMedia; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessmacWKActionMenuControllermm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -1124,7 +1124,7 @@
</span><span class="cx">         return [self _defaultMenuItemsForImage];
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (hitTestResult-&gt;isTextNode()) {
</del><ins>+    if (hitTestResult-&gt;isTextNode() || hitTestResult-&gt;isOverTextInsideFormControlElement()) {
</ins><span class="cx">         NSArray *dataDetectorMenuItems = [self _defaultMenuItemsForDataDetectedText];
</span><span class="cx">         if (_currentActionContext) {
</span><span class="cx">             // If this is a data detected item with no menu items, we should not fall back to regular text options.
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (176806 => 176807)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-12-04 19:39:48 UTC (rev 176806)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-12-04 19:47:31 UTC (rev 176807)
</span><span class="lines">@@ -977,23 +977,9 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RenderView&amp; mainRenderView = *mainFrame.view()-&gt;renderView();
-
-    HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowChildFrameContent | HitTestRequest::IgnoreClipping);
-
</del><span class="cx">     IntPoint locationInContentCoordinates = mainFrame.view()-&gt;rootViewToContents(roundedIntPoint(locationInViewCooordinates));
</span><del>-    HitTestResult hitTestResult(locationInContentCoordinates);
-    mainRenderView.hitTest(request, hitTestResult);
</del><ins>+    HitTestResult hitTestResult = mainFrame.eventHandler().hitTestResultAtPoint(locationInContentCoordinates);
</ins><span class="cx"> 
</span><del>-    // We hit test including shadow content to get the desired result for editable text regions.
-    // But for media, we want to re-set to the shadow root.
-    if (Node* node = hitTestResult.innerNode()) {
-        if (Element* shadowHost = node-&gt;shadowHost()) {
-            if (shadowHost-&gt;isMediaElement())
-                hitTestResult.setToNonShadowAncestor();
-        }
-    }
-
</del><span class="cx">     ActionMenuHitTestResult actionMenuResult;
</span><span class="cx">     actionMenuResult.hitTestLocationInViewCooordinates = locationInViewCooordinates;
</span><span class="cx">     actionMenuResult.hitTestResult = WebHitTestResult::Data(hitTestResult);
</span><span class="lines">@@ -1068,7 +1054,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     IntPoint point = roundedIntPoint(locationInViewCooordinates);
</span><del>-    HitTestResult result = mainFrame.eventHandler().hitTestResultAtPoint(m_page-&gt;mainFrame().view()-&gt;windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowChildFrameContent | HitTestRequest::IgnoreClipping);
</del><ins>+    HitTestResult result = mainFrame.eventHandler().hitTestResultAtPoint(m_page-&gt;mainFrame().view()-&gt;windowToContents(point));
</ins><span class="cx">     NSDictionary *options = nil;
</span><span class="cx">     return rangeForDictionaryLookupAtHitTestResult(result, &amp;options);
</span><span class="cx"> }
</span><span class="lines">@@ -1088,13 +1074,13 @@
</span><span class="cx">     if (!element)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto renderer = element-&gt;renderer();
-    if (!renderer)
</del><ins>+    Frame* frame = element-&gt;document().frame();
+    if (!frame)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_page-&gt;focusController().setFocusedElement(element, element-&gt;document().frame());
-    VisiblePosition position = renderer-&gt;positionForPoint(m_lastActionMenuHitTestResult.localPoint(), nullptr);
-    element-&gt;document().frame()-&gt;selection().setSelection(position);
</del><ins>+    m_page-&gt;focusController().setFocusedElement(element, frame);
+    VisiblePosition position = frame-&gt;visiblePositionForPoint(m_lastActionMenuHitTestResult.roundedPointInInnerNodeFrame());
+    frame-&gt;selection().setSelection(position);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::dataDetectorsDidPresentUI(PageOverlay::PageOverlayID overlayID)
</span></span></pre>
</div>
</div>

</body>
</html>