<!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>[176799] 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/176799">176799</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-12-04 09:11:04 -0800 (Thu, 04 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rollout <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="#branchessafari6003branchSourceWebKitmacChangeLog">branches/safari-600.3-branch/Source/WebKit/mac/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 (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/ChangeLog        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebCore/ChangeLog        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -1,24 +1,3 @@
</span><del>-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.
-
-            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:
-
-
</del><span class="cx"> 2014-12-03  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r176753. &lt;rdar://problem/19052381&gt;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -1078,7 +1078,6 @@
</span><span class="cx"> __ZN7WebCore29cookieRequestHeaderFieldValueERKNS_21NetworkStorageSessionERKNS_3URLES5_
</span><span class="cx"> __ZN7WebCore29createDefaultParagraphElementERNS_8DocumentE
</span><span class="cx"> __ZN7WebCore29isCharacterSmartReplaceExemptEib
</span><del>-__ZN7WebCore30enclosingTextUnitOfGranularityERKNS_15VisiblePositionENS_15TextGranularityENS_18SelectionDirectionE
</del><span class="cx"> __ZN7WebCore30hostNameNeedsDecodingWithRangeEP8NSString8_NSRange
</span><span class="cx"> __ZN7WebCore30hostNameNeedsEncodingWithRangeEP8NSString8_NSRange
</span><span class="cx"> __ZN7WebCore30overrideUserPreferredLanguagesERKN3WTF6VectorINS0_6StringELm0ENS0_15CrashOnOverflowEEE
</span><span class="lines">@@ -1685,7 +1684,6 @@
</span><span class="cx"> __ZNK7WebCore13HitTestResult19mediaIsInFullscreenEv
</span><span class="cx"> __ZNK7WebCore13HitTestResult19rectBasedTestResultEv
</span><span class="cx"> __ZNK7WebCore13HitTestResult21innerNonSharedElementEv
</span><del>-__ZNK7WebCore13HitTestResult34isOverTextInsideFormControlElementEv
</del><span class="cx"> __ZNK7WebCore13HitTestResult5imageEv
</span><span class="cx"> __ZNK7WebCore13HitTestResult5titleERNS_13TextDirectionE
</span><span class="cx"> __ZNK7WebCore13HitTestResult9imageRectEv
</span><span class="lines">@@ -2728,6 +2726,7 @@
</span><span class="cx"> __ZN7WebCore27tileControllerMemoryHandlerEv
</span><span class="cx"> __ZN7WebCore27withinTextUnitOfGranularityERKNS_15VisiblePositionENS_15TextGranularityENS_18SelectionDirectionE
</span><span class="cx"> __ZN7WebCore30closestWordBoundaryForPositionERKNS_15VisiblePositionE
</span><ins>+__ZN7WebCore30enclosingTextUnitOfGranularityERKNS_15VisiblePositionENS_15TextGranularityENS_18SelectionDirectionE
</ins><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 (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.cpp        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.cpp        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -49,7 +49,6 @@
</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><del>-#include &quot;VisibleUnits.h&quot;
</del><span class="cx"> #include &quot;XLinkNames.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -516,34 +515,6 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool HitTestResult::isOverTextInsideFormControlElement() const
-{
-    Node* node = innerNode();
-    if (!node)
-        return false;
-
-    if (!is&lt;HTMLTextFormControlElement&gt;(*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();
-}
-
</del><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 (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.h        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebCore/rendering/HitTestResult.h        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -125,7 +125,6 @@
</span><span class="cx">     bool mediaMuted() const;
</span><span class="cx">     void toggleMediaMuteState() const;
</span><span class="cx">     bool isDownloadableMedia() const;
</span><del>-    bool isOverTextInsideFormControlElement() const;
</del><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="branchessafari6003branchSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -34,33 +34,6 @@
</span><span class="cx"> 
</span><span class="cx"> 2014-12-04  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><del>-        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]):
-
-
-2014-12-04  Dana Burkart  &lt;dburkart@apple.com&gt;
-
</del><span class="cx">         Merge r176763. &lt;rdar://problem/19115662&gt;
</span><span class="cx"> 
</span><span class="cx">     2014-12-03  Tim Horton  &lt;timothy_horton@apple.com&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 (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -109,8 +109,18 @@
</span><span class="cx">     Frame* coreFrame = core([documentView _frame]);
</span><span class="cx">     if (!coreFrame)
</span><span class="cx">         return nil;
</span><del>-    _hitTestResult = coreFrame-&gt;eventHandler().hitTestResultAtPoint(IntPoint(point));
</del><ins>+    HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
+    _hitTestResult = coreFrame-&gt;eventHandler().hitTestResultAtPoint(IntPoint(point), hitType);
</ins><span class="cx"> 
</span><ins>+    // 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();
+        }
+    }
+
</ins><span class="cx">     return [[[WebElementDictionary alloc] initWithHitTestResult:_hitTestResult] autorelease];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -172,13 +182,15 @@
</span><span class="cx">     if (!element)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Frame* frame = element-&gt;document().frame();
-    if (!frame)
</del><ins>+    auto renderer = element-&gt;renderer();
+    if (!renderer)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    frame-&gt;page()-&gt;focusController().setFocusedElement(element, frame);
-    VisiblePosition position = frame-&gt;visiblePositionForPoint(_hitTestResult.roundedPointInInnerNodeFrame());
-    frame-&gt;selection().setSelection(position);
</del><ins>+    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);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)willOpenMenu:(NSMenu *)menu withEvent:(NSEvent *)event
</span><span class="lines">@@ -863,7 +875,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()) || _hitTestResult.isOverTextInsideFormControlElement()) {
</del><ins>+    if (node &amp;&amp; node-&gt;isTextNode()) {
</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 (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -1,42 +1,5 @@
</span><span class="cx"> 2014-12-04  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><del>-        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;
-
</del><span class="cx">         Merge r176763. &lt;rdar://problem/19115662&gt;
</span><span class="cx"> 
</span><span class="cx">     2014-12-03  Tim Horton  &lt;timothy_horton@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 (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.cpp        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.cpp        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -54,7 +54,6 @@
</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><del>-    , isOverTextInsideFormControlElement(hitTestResult.isOverTextInsideFormControlElement())
</del><span class="cx">     , isDownloadableMedia(hitTestResult.isDownloadableMedia())
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -76,7 +75,6 @@
</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><del>-    encoder &lt;&lt; isOverTextInsideFormControlElement;
</del><span class="cx">     encoder &lt;&lt; isDownloadableMedia;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -93,7 +91,6 @@
</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><del>-        || !decoder.decode(hitTestResultData.isOverTextInsideFormControlElement)
</del><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 (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.h        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/WebHitTestResult.h        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -54,7 +54,6 @@
</span><span class="cx">         bool isScrollbar;
</span><span class="cx">         bool isSelected;
</span><span class="cx">         bool isTextNode;
</span><del>-        bool isOverTextInsideFormControlElement;
</del><span class="cx">         bool isDownloadableMedia;
</span><span class="cx"> 
</span><span class="cx">         Data();
</span><span class="lines">@@ -87,8 +86,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool isTextNode() const { return m_data.isTextNode; }
</span><span class="cx"> 
</span><del>-    bool isOverTextInsideFormControlElement() const { return m_data.isOverTextInsideFormControlElement; }
-
</del><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 (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm        2014-12-04 17:11:04 UTC (rev 176799)
</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() || hitTestResult-&gt;isOverTextInsideFormControlElement()) {
</del><ins>+    if (hitTestResult-&gt;isTextNode()) {
</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 (176798 => 176799)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-12-04 17:05:12 UTC (rev 176798)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-12-04 17:11:04 UTC (rev 176799)
</span><span class="lines">@@ -977,9 +977,23 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    RenderView&amp; mainRenderView = *mainFrame.view()-&gt;renderView();
+
+    HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowChildFrameContent | HitTestRequest::IgnoreClipping);
+
</ins><span class="cx">     IntPoint locationInContentCoordinates = mainFrame.view()-&gt;rootViewToContents(roundedIntPoint(locationInViewCooordinates));
</span><del>-    HitTestResult hitTestResult = mainFrame.eventHandler().hitTestResultAtPoint(locationInContentCoordinates);
</del><ins>+    HitTestResult hitTestResult(locationInContentCoordinates);
+    mainRenderView.hitTest(request, hitTestResult);
</ins><span class="cx"> 
</span><ins>+    // 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();
+        }
+    }
+
</ins><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">@@ -1054,7 +1068,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));
</del><ins>+    HitTestResult result = mainFrame.eventHandler().hitTestResultAtPoint(m_page-&gt;mainFrame().view()-&gt;windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowChildFrameContent | HitTestRequest::IgnoreClipping);
</ins><span class="cx">     NSDictionary *options = nil;
</span><span class="cx">     return rangeForDictionaryLookupAtHitTestResult(result, &amp;options);
</span><span class="cx"> }
</span><span class="lines">@@ -1074,13 +1088,13 @@
</span><span class="cx">     if (!element)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Frame* frame = element-&gt;document().frame();
-    if (!frame)
</del><ins>+    auto renderer = element-&gt;renderer();
+    if (!renderer)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_page-&gt;focusController().setFocusedElement(element, frame);
-    VisiblePosition position = frame-&gt;visiblePositionForPoint(m_lastActionMenuHitTestResult.roundedPointInInnerNodeFrame());
-    frame-&gt;selection().setSelection(position);
</del><ins>+    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);
</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>