<!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>[161106] trunk/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/161106">161106</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-27 12:40:28 -0800 (Fri, 27 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] Upstream WebCore/page changes
https://bugs.webkit.org/show_bug.cgi?id=126180

Reviewed by Darin Adler.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
(WebCore::EventNames::isGestureEventType): Added.
* page/AlternativeTextClient.h: Do not define WTF_USE_DICTATION_ALTERNATIVES when building for iOS.
* page/Chrome.cpp:
(WebCore::Chrome::Chrome):
(WebCore::Chrome::dispatchViewportPropertiesDidChange): Added; guarded by PLATFORM(IOS).
(WebCore::Chrome::setCursor): Make this an empty function when building for iOS.
(WebCore::Chrome::setCursorHiddenUntilMouseMoves): Ditto.
(WebCore::Chrome::didReceiveDocType): Added; iOS-specific.
* page/Chrome.h:
(WebCore::Chrome::setDispatchViewportDataDidChangeSuppressed): Added; guarded by PLATFORM(IOS).
* page/ChromeClient.h:
(WebCore::ChromeClient::didFlushCompositingLayers): Added; guarded by PLATFORM(IOS).
(WebCore::ChromeClient::fetchCustomFixedPositionLayoutRect): Added; guarded by PLATFORM(IOS).
(WebCore::ChromeClient::updateViewportConstrainedLayers): Added; guarded by PLATFORM(IOS).
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install): Added iOS-specific code.
(WebCore::DOMTimer::fired): Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow): Ditto.
(WebCore::DOMWindow::innerHeight): Ditto.
(WebCore::DOMWindow::innerWidth): Ditto.
(WebCore::DOMWindow::scrollX): Ditto.
(WebCore::DOMWindow::scrollY): Ditto.
(WebCore::DOMWindow::scrollBy): Ditto.
(WebCore::DOMWindow::scrollTo): Ditto.
(WebCore::DOMWindow::clearTimeout): Ditto.
(WebCore::DOMWindow::addEventListener): Ditto.
(WebCore::DOMWindow::incrementScrollEventListenersCount): Added; guarded by PLATFORM(IOS).
(WebCore::DOMWindow::decrementScrollEventListenersCount): Added; guarded by PLATFORM(IOS).
(WebCore::DOMWindow::resetAllGeolocationPermission): Added; Also added FIXME comment.
(WebCore::DOMWindow::removeEventListener): Added iOS-specific code.
(WebCore::DOMWindow::dispatchEvent): Modified to prevent dispatching duplicate pageshow and pagehide
events per &lt;http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow&gt;.
(WebCore::DOMWindow::removeAllEventListeners): Added iOS-specific code.
* page/DOMWindow.h:
* page/DOMWindow.idl: Added IOS_GESTURE_EVENTS-guarded attributes: ongesture{change, end, start}. Also
added IOS_TOUCH_EVENTS-guarded attributes: {Touch, TouchList}Constructor.
* page/EditorClient.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler): Added iOS-specific code.
(WebCore::EventHandler::clear): Ditto.
(WebCore::EventHandler::startPanScrolling): Make this an empty function when building for iOS.
(WebCore::EventHandler::handleMousePressEvent): Modified to invalidate a click when the clicked node is
null. Also, opt out of code for updating the scrollbars as UIKit manages scrollbars on iOS.
(WebCore::EventHandler::handleMouseMoveEvent): Opt of code for updating the scrollbars and cursor when building on iOS.
(WebCore::hitTestResultInFrame): Made this a file-local static function since it's only used in EventHandler.cpp.
(WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled): Added iOS-specific code.
* page/EventHandler.h:
* page/FocusController.h:
* page/Frame.cpp:
(WebCore::Frame::Frame): Added iOS-specific code.
(WebCore::Frame::scrollOverflowLayer): Added; iOS-specific.
(WebCore::Frame::overflowAutoScrollTimerFired): Added; iOS-specific.
(WebCore::Frame::startOverflowAutoScroll): Added; iOS-specific.
(WebCore::Frame::checkOverflowScroll): Added; iOS-specific.
(WebCore::Frame::willDetachPage): Added iOS-specific code.
(WebCore::Frame::createView): Ditto.
(WebCore::Frame::setSelectionChangeCallbacksDisabled): Added; iOS-specific.
(WebCore::Frame::selectionChangeCallbacksDisabled): Added; iOS-specific.
* page/Frame.h:
(WebCore::Frame::timersPaused): Added; guarded by PLATFORM(IOS).
* page/FrameView.cpp:
(WebCore::FrameView::FrameView): Added iOS-specific code.
(WebCore::FrameView::clear): Ditto.
(WebCore::FrameView::flushCompositingStateForThisFrame): Ditto.
(WebCore::FrameView::graphicsLayerForPlatformWidget): Added.
(WebCore::FrameView::scheduleLayerFlushAllowingThrottling): Added.
(WebCore::FrameView::layout): Added iOS-specific code.
(WebCore::countRenderedCharactersInRenderObjectWithThreshold): Added; helper function used by FrameView::renderedCharactersExceed().
Also added FIXME comment.
(WebCore::FrameView::renderedCharactersExceed): Added.
(WebCore::FrameView::visibleContentsResized): Added iOS-specific code.
(WebCore::FrameView::adjustTiledBackingCoverage): Ditto.
(WebCore::FrameView::performPostLayoutTasks): Ditto.
(WebCore::FrameView::sendResizeEventIfNeeded): Ditto.
(WebCore::FrameView::paintContents): Added iOS-specific code. Also added FIXME comments.
(WebCore::FrameView::setUseCustomFixedPositionLayoutRect): Added; iOS-specific.
(WebCore::FrameView::setCustomFixedPositionLayoutRect): Added; iOS-specific.
(WebCore::FrameView::updateFixedPositionLayoutRect): Added; iOS-specific.
* page/FrameView.h:
* page/Navigator.cpp:
(WebCore::Navigator::standalone): Added; iOS-specific.
* page/Navigator.h:
* page/Navigator.idl: Added WTF_PLATFORM_IOS-guarded attribute: standalone. Also added FIXME comment.
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::platform): Added iOS-specific code.
* page/Page.h:
(WebCore::Page::hasCustomHTMLTokenizerTimeDelay): Added; guarded by PLATFORM(IOS). Also added FIXME comment
to remove this method.
(WebCore::Page::customHTMLTokenizerTimeDelay): Added; guarded by PLATFORM(IOS). Also added FIXME comment
to remove this method.
* page/PageGroup.cpp:
(WebCore::PageGroup::removeVisitedLink): Added.
* page/PageGroup.h:
* page/Settings.cpp:
(WebCore::Settings::Settings):
(WebCore::Settings::setScriptEnabled): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setStandalone): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setAudioSessionCategoryOverride): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::audioSessionCategoryOverride): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setNetworkDataUsageTrackingEnabled): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::networkDataUsageTrackingEnabled): Added; guarded by PLATFORM(IOS).
(WebCore::sharedNetworkInterfaceNameGlobal): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setNetworkInterfaceName): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::networkInterfaceName): Added; guarded by PLATFORM(IOS).
* page/Settings.h:
(WebCore::Settings::setMaxParseDuration): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
(WebCore::Settings::maxParseDuration): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
(WebCore::Settings::standalone): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setTelephoneNumberParsingEnabled): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::telephoneNumberParsingEnabled): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setMediaDataLoadsAutomatically): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::mediaDataLoadsAutomatically): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setShouldTransformsAffectOverflow): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::shouldTransformsAffectOverflow): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setShouldDispatchJavaScriptWindowOnErrorEvents): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::shouldDispatchJavaScriptWindowOnErrorEvents): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setAlwaysUseBaselineOfPrimaryFont): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::alwaysUseBaselineOfPrimaryFont): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::setAlwaysUseAcceleratedOverflowScroll): Added; guarded by PLATFORM(IOS).
(WebCore::Settings::alwaysUseAcceleratedOverflowScroll): Added; guarded by PLATFORM(IOS).
* page/Settings.in: Added IOS_AIRPLAY-guarded setting: mediaPlaybackAllowsAirPlay.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Added iOS-specific code and FIXME comment.
* page/ios/EventHandlerIOS.mm: Added.
* page/ios/FrameIOS.mm: Added.
* page/mac/ChromeMac.mm:
* page/mac/PageMac.cpp:
(WebCore::Page::addSchedulePair): Opt out of code when building for iOS.
(WebCore::Page::removeSchedulePair): Ditto.
* page/mac/SettingsMac.mm:
(WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Added iOS-specific code.
* page/mac/WebCoreFrameView.h:

Source/WebKit/ios:

* WebCoreSupport/WebChromeClientIOS.mm: Substitute ENABLE(IOS_TOUCH_EVENTS) for ENABLE(TOUCH_EVENTS).

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: Added.
* WebProcess/WebPage/WebPage.cpp: Include header &lt;WebCore/HitTestResult.h&gt;.

Source/WTF:

* wtf/FeatureDefines.h: Define ENABLE_IOS_TOUCH_EVENTS to be enabled by default
when building iOS with ENABLE(TOUCH_EVENTS).</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfFeatureDefinesh">trunk/Source/WTF/wtf/FeatureDefines.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomEventNamesh">trunk/Source/WebCore/dom/EventNames.h</a></li>
<li><a href="#trunkSourceWebCorepageAlternativeTextClienth">trunk/Source/WebCore/page/AlternativeTextClient.h</a></li>
<li><a href="#trunkSourceWebCorepageChromecpp">trunk/Source/WebCore/page/Chrome.cpp</a></li>
<li><a href="#trunkSourceWebCorepageChromeh">trunk/Source/WebCore/page/Chrome.h</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMTimercpp">trunk/Source/WebCore/page/DOMTimer.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowh">trunk/Source/WebCore/page/DOMWindow.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowidl">trunk/Source/WebCore/page/DOMWindow.idl</a></li>
<li><a href="#trunkSourceWebCorepageEditorClienth">trunk/Source/WebCore/page/EditorClient.h</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlerh">trunk/Source/WebCore/page/EventHandler.h</a></li>
<li><a href="#trunkSourceWebCorepageFocusControllerh">trunk/Source/WebCore/page/FocusController.h</a></li>
<li><a href="#trunkSourceWebCorepageFramecpp">trunk/Source/WebCore/page/Frame.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameh">trunk/Source/WebCore/page/Frame.h</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebCorepageNavigatorcpp">trunk/Source/WebCore/page/Navigator.cpp</a></li>
<li><a href="#trunkSourceWebCorepageNavigatorh">trunk/Source/WebCore/page/Navigator.h</a></li>
<li><a href="#trunkSourceWebCorepageNavigatoridl">trunk/Source/WebCore/page/Navigator.idl</a></li>
<li><a href="#trunkSourceWebCorepageNavigatorBasecpp">trunk/Source/WebCore/page/NavigatorBase.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebCorepagePageGroupcpp">trunk/Source/WebCore/page/PageGroup.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageGrouph">trunk/Source/WebCore/page/PageGroup.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingscpp">trunk/Source/WebCore/page/Settings.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingsh">trunk/Source/WebCore/page/Settings.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSPropertyAnimationcpp">trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepagemacChromeMacmm">trunk/Source/WebCore/page/mac/ChromeMac.mm</a></li>
<li><a href="#trunkSourceWebCorepagemacPageMaccpp">trunk/Source/WebCore/page/mac/PageMac.cpp</a></li>
<li><a href="#trunkSourceWebCorepagemacSettingsMacmm">trunk/Source/WebCore/page/mac/SettingsMac.mm</a></li>
<li><a href="#trunkSourceWebCorepagemacWebCoreFrameViewh">trunk/Source/WebCore/page/mac/WebCoreFrameView.h</a></li>
<li><a href="#trunkSourceWebKitiosChangeLog">trunk/Source/WebKit/ios/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitiosWebCoreSupportWebChromeClientIOSmm">trunk/Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm</a></li>
<li><a href="#trunkSourceWebKitiosWebViewWebPDFViewIOSmm">trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportiosWebChromeClientIOSmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/page/ios/</li>
<li><a href="#trunkSourceWebCorepageiosEventHandlerIOSmm">trunk/Source/WebCore/page/ios/EventHandlerIOS.mm</a></li>
<li><a href="#trunkSourceWebCorepageiosFrameIOSmm">trunk/Source/WebCore/page/ios/FrameIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WTF/ChangeLog        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2013-12-27  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] Upstream WebCore/page changes
+        https://bugs.webkit.org/show_bug.cgi?id=126180
+
+        Reviewed by Darin Adler.
+
+        * wtf/FeatureDefines.h: Define ENABLE_IOS_TOUCH_EVENTS to be enabled by default
+        when building iOS with ENABLE(TOUCH_EVENTS).
+
</ins><span class="cx"> 2013-12-25  Thiago de Barros Lacerda  &lt;thiago.lacerda@openbossa.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [Nix] Building with DRAG_SUPPORT enabled
</span></span></pre></div>
<a id="trunkSourceWTFwtfFeatureDefinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/FeatureDefines.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/FeatureDefines.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WTF/wtf/FeatureDefines.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -68,6 +68,10 @@
</span><span class="cx"> #define ENABLE_CSS_IMAGE_SET 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !defined(ENABLE_CURSOR_SUPPORT)
+#define ENABLE_CURSOR_SUPPORT 0
+#endif
+
</ins><span class="cx"> #if !defined(ENABLE_DISK_IMAGE_CACHE)
</span><span class="cx"> #define ENABLE_DISK_IMAGE_CACHE 1
</span><span class="cx"> #endif
</span><span class="lines">@@ -84,6 +88,10 @@
</span><span class="cx"> #define ENABLE_ICONDATABASE 0
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !defined(ENABLE_LETTERPRESS)
+#define ENABLE_LETTERPRESS 1
+#endif
+
</ins><span class="cx"> #if !defined(ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
</span><span class="cx"> #define ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE 1
</span><span class="cx"> #endif
</span><span class="lines">@@ -92,14 +100,14 @@
</span><span class="cx"> #define ENABLE_IOS_GESTURE_EVENTS 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if !defined(ENABLE_LETTERPRESS)
-#define ENABLE_LETTERPRESS 1
-#endif
-
</del><span class="cx"> #if !defined(ENABLE_IOS_TEXT_AUTOSIZING)
</span><span class="cx"> #define ENABLE_IOS_TEXT_AUTOSIZING 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !defined(ENABLE_IOS_TOUCH_EVENTS)
+#define ENABLE_IOS_TOUCH_EVENTS 1
+#endif
+
</ins><span class="cx"> #if !defined(ENABLE_METER_ELEMENT)
</span><span class="cx"> #define ENABLE_METER_ELEMENT 0
</span><span class="cx"> #endif
</span><span class="lines">@@ -430,6 +438,10 @@
</span><span class="cx"> #define ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED 0
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !defined(ENABLE_CURSOR_SUPPORT)
+#define ENABLE_CURSOR_SUPPORT 1
+#endif
+
</ins><span class="cx"> #if !defined(ENABLE_CUSTOM_SCHEME_HANDLER)
</span><span class="cx"> #define ENABLE_CUSTOM_SCHEME_HANDLER 0
</span><span class="cx"> #endif
</span><span class="lines">@@ -894,4 +906,8 @@
</span><span class="cx"> #error &quot;ENABLE(REMOTE_INSPECTOR) requires ENABLE(INSPECTOR)&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS) &amp;&amp; !ENABLE(TOUCH_EVENTS)
+#error &quot;ENABLE(IOS_TOUCH_EVENTS) requires ENABLE(TOUCH_EVENTS)&quot;
+#endif
+
</ins><span class="cx"> #endif /* WTF_FeatureDefines_h */
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/ChangeLog        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -1,3 +1,146 @@
</span><ins>+2013-12-27  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] Upstream WebCore/page changes
+        https://bugs.webkit.org/show_bug.cgi?id=126180
+
+        Reviewed by Darin Adler.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/EventNames.h:
+        (WebCore::EventNames::isGestureEventType): Added.
+        * page/AlternativeTextClient.h: Do not define WTF_USE_DICTATION_ALTERNATIVES when building for iOS.
+        * page/Chrome.cpp:
+        (WebCore::Chrome::Chrome):
+        (WebCore::Chrome::dispatchViewportPropertiesDidChange): Added; guarded by PLATFORM(IOS).
+        (WebCore::Chrome::setCursor): Make this an empty function when building for iOS.
+        (WebCore::Chrome::setCursorHiddenUntilMouseMoves): Ditto.
+        (WebCore::Chrome::didReceiveDocType): Added; iOS-specific.
+        * page/Chrome.h:
+        (WebCore::Chrome::setDispatchViewportDataDidChangeSuppressed): Added; guarded by PLATFORM(IOS).
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::didFlushCompositingLayers): Added; guarded by PLATFORM(IOS).
+        (WebCore::ChromeClient::fetchCustomFixedPositionLayoutRect): Added; guarded by PLATFORM(IOS).
+        (WebCore::ChromeClient::updateViewportConstrainedLayers): Added; guarded by PLATFORM(IOS).
+        * page/DOMTimer.cpp:
+        (WebCore::DOMTimer::install): Added iOS-specific code.
+        (WebCore::DOMTimer::fired): Ditto.
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::DOMWindow): Ditto.
+        (WebCore::DOMWindow::innerHeight): Ditto.
+        (WebCore::DOMWindow::innerWidth): Ditto.
+        (WebCore::DOMWindow::scrollX): Ditto.
+        (WebCore::DOMWindow::scrollY): Ditto.
+        (WebCore::DOMWindow::scrollBy): Ditto.
+        (WebCore::DOMWindow::scrollTo): Ditto.
+        (WebCore::DOMWindow::clearTimeout): Ditto.
+        (WebCore::DOMWindow::addEventListener): Ditto.
+        (WebCore::DOMWindow::incrementScrollEventListenersCount): Added; guarded by PLATFORM(IOS).
+        (WebCore::DOMWindow::decrementScrollEventListenersCount): Added; guarded by PLATFORM(IOS).
+        (WebCore::DOMWindow::resetAllGeolocationPermission): Added; Also added FIXME comment.
+        (WebCore::DOMWindow::removeEventListener): Added iOS-specific code.
+        (WebCore::DOMWindow::dispatchEvent): Modified to prevent dispatching duplicate pageshow and pagehide
+        events per &lt;http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow&gt;.
+        (WebCore::DOMWindow::removeAllEventListeners): Added iOS-specific code.
+        * page/DOMWindow.h:
+        * page/DOMWindow.idl: Added IOS_GESTURE_EVENTS-guarded attributes: ongesture{change, end, start}. Also
+        added IOS_TOUCH_EVENTS-guarded attributes: {Touch, TouchList}Constructor.
+        * page/EditorClient.h:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::EventHandler): Added iOS-specific code.
+        (WebCore::EventHandler::clear): Ditto.
+        (WebCore::EventHandler::startPanScrolling): Make this an empty function when building for iOS.
+        (WebCore::EventHandler::handleMousePressEvent): Modified to invalidate a click when the clicked node is
+        null. Also, opt out of code for updating the scrollbars as UIKit manages scrollbars on iOS.
+        (WebCore::EventHandler::handleMouseMoveEvent): Opt of code for updating the scrollbars and cursor when building on iOS.
+        (WebCore::hitTestResultInFrame): Made this a file-local static function since it's only used in EventHandler.cpp.
+        (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled): Added iOS-specific code.
+        * page/EventHandler.h:
+        * page/FocusController.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::Frame): Added iOS-specific code.
+        (WebCore::Frame::scrollOverflowLayer): Added; iOS-specific.
+        (WebCore::Frame::overflowAutoScrollTimerFired): Added; iOS-specific.
+        (WebCore::Frame::startOverflowAutoScroll): Added; iOS-specific.
+        (WebCore::Frame::checkOverflowScroll): Added; iOS-specific.
+        (WebCore::Frame::willDetachPage): Added iOS-specific code.
+        (WebCore::Frame::createView): Ditto.
+        (WebCore::Frame::setSelectionChangeCallbacksDisabled): Added; iOS-specific.
+        (WebCore::Frame::selectionChangeCallbacksDisabled): Added; iOS-specific.
+        * page/Frame.h:
+        (WebCore::Frame::timersPaused): Added; guarded by PLATFORM(IOS).
+        * page/FrameView.cpp:
+        (WebCore::FrameView::FrameView): Added iOS-specific code.
+        (WebCore::FrameView::clear): Ditto.
+        (WebCore::FrameView::flushCompositingStateForThisFrame): Ditto.
+        (WebCore::FrameView::graphicsLayerForPlatformWidget): Added.
+        (WebCore::FrameView::scheduleLayerFlushAllowingThrottling): Added.
+        (WebCore::FrameView::layout): Added iOS-specific code.
+        (WebCore::countRenderedCharactersInRenderObjectWithThreshold): Added; helper function used by FrameView::renderedCharactersExceed().
+        Also added FIXME comment.
+        (WebCore::FrameView::renderedCharactersExceed): Added.
+        (WebCore::FrameView::visibleContentsResized): Added iOS-specific code.
+        (WebCore::FrameView::adjustTiledBackingCoverage): Ditto.
+        (WebCore::FrameView::performPostLayoutTasks): Ditto.
+        (WebCore::FrameView::sendResizeEventIfNeeded): Ditto.
+        (WebCore::FrameView::paintContents): Added iOS-specific code. Also added FIXME comments.
+        (WebCore::FrameView::setUseCustomFixedPositionLayoutRect): Added; iOS-specific.
+        (WebCore::FrameView::setCustomFixedPositionLayoutRect): Added; iOS-specific.
+        (WebCore::FrameView::updateFixedPositionLayoutRect): Added; iOS-specific.
+        * page/FrameView.h:
+        * page/Navigator.cpp:
+        (WebCore::Navigator::standalone): Added; iOS-specific.
+        * page/Navigator.h:
+        * page/Navigator.idl: Added WTF_PLATFORM_IOS-guarded attribute: standalone. Also added FIXME comment.
+        * page/NavigatorBase.cpp:
+        (WebCore::NavigatorBase::platform): Added iOS-specific code.
+        * page/Page.h:
+        (WebCore::Page::hasCustomHTMLTokenizerTimeDelay): Added; guarded by PLATFORM(IOS). Also added FIXME comment
+        to remove this method.
+        (WebCore::Page::customHTMLTokenizerTimeDelay): Added; guarded by PLATFORM(IOS). Also added FIXME comment
+        to remove this method.
+        * page/PageGroup.cpp:
+        (WebCore::PageGroup::removeVisitedLink): Added.
+        * page/PageGroup.h:
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        (WebCore::Settings::setScriptEnabled): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setStandalone): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setAudioSessionCategoryOverride): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::audioSessionCategoryOverride): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setNetworkDataUsageTrackingEnabled): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::networkDataUsageTrackingEnabled): Added; guarded by PLATFORM(IOS).
+        (WebCore::sharedNetworkInterfaceNameGlobal): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setNetworkInterfaceName): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::networkInterfaceName): Added; guarded by PLATFORM(IOS).
+        * page/Settings.h:
+        (WebCore::Settings::setMaxParseDuration): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
+        (WebCore::Settings::maxParseDuration): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
+        (WebCore::Settings::standalone): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setTelephoneNumberParsingEnabled): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::telephoneNumberParsingEnabled): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setMediaDataLoadsAutomatically): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::mediaDataLoadsAutomatically): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setShouldTransformsAffectOverflow): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::shouldTransformsAffectOverflow): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setShouldDispatchJavaScriptWindowOnErrorEvents): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::shouldDispatchJavaScriptWindowOnErrorEvents): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setAlwaysUseBaselineOfPrimaryFont): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::alwaysUseBaselineOfPrimaryFont): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::setAlwaysUseAcceleratedOverflowScroll): Added; guarded by PLATFORM(IOS).
+        (WebCore::Settings::alwaysUseAcceleratedOverflowScroll): Added; guarded by PLATFORM(IOS).
+        * page/Settings.in: Added IOS_AIRPLAY-guarded setting: mediaPlaybackAllowsAirPlay.
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Added iOS-specific code and FIXME comment.
+        * page/ios/EventHandlerIOS.mm: Added.
+        * page/ios/FrameIOS.mm: Added.
+        * page/mac/ChromeMac.mm:
+        * page/mac/PageMac.cpp:
+        (WebCore::Page::addSchedulePair): Opt out of code when building for iOS.
+        (WebCore::Page::removeSchedulePair): Ditto.
+        * page/mac/SettingsMac.mm:
+        (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Added iOS-specific code.
+        * page/mac/WebCoreFrameView.h:
+
</ins><span class="cx"> 2013-12-27  Gavin Barraclough  &lt;barraclough@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge PageVisibilityState &amp; ViewState::IsVisible in WebKit2
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -5466,6 +5466,8 @@
</span><span class="cx">                 CE057FA61220731100A476D5 /* DocumentMarkerController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE057FA41220731100A476D5 /* DocumentMarkerController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CE08C3D1152B599A0021B8C2 /* AlternativeTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */; };
</span><span class="cx">                 CE08C3D2152B599A0021B8C2 /* AlternativeTextController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE08C3D0152B599A0021B8C2 /* AlternativeTextController.h */; settings = {ATTRIBUTES = (); }; };
</span><ins>+                FE6938B61045D67E008EABB6 /* EventHandlerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */; };
+                FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D3B0CEA936A00D89466 /* FrameIOS.mm */; };
</ins><span class="cx">                 CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */; };
</span><span class="cx">                 CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -12621,6 +12623,8 @@
</span><span class="cx">                 CE057FA41220731100A476D5 /* DocumentMarkerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarkerController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlternativeTextController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE08C3D0152B599A0021B8C2 /* AlternativeTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlternativeTextController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventHandlerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CE5CB1B314EDAB6F00BB2795 /* EventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSender.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AlternativeTextUIController.h; path = mac/AlternativeTextUIController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AlternativeTextUIController.mm; path = mac/AlternativeTextUIController.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15731,6 +15735,7 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 316FE1060E6E1D8400BF6088 /* animation */,
</span><ins>+                                18A6CD6F0D8F2025001DC3CE /* ios */,
</ins><span class="cx">                                 93C09A820B064F05005ABD4D /* mac */,
</span><span class="cx">                                 1AF62EE114DA22A70041556C /* scrolling */,
</span><span class="cx">                                 8538F0000AD71770006A81D1 /* AbstractView.idl */,
</span><span class="lines">@@ -20538,6 +20543,15 @@
</span><span class="cx">                         path = mediasource;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                18A6CD6F0D8F2025001DC3CE /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */,
+                                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */,
+                        );
+                        path = ios;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 CE79D68617F220ED00815C00 /* ios */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -26350,6 +26364,7 @@
</span><span class="cx">                                 850657010AAB4763002D15C0 /* DOMStyleSheet.mm in Sources */,
</span><span class="cx">                                 850657030AAB4763002D15C0 /* DOMStyleSheetList.mm in Sources */,
</span><span class="cx">                                 85ACA99D0A9B575900671E90 /* DOMText.mm in Sources */,
</span><ins>+                                FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */,
</ins><span class="cx">                                 933A14AA0B7D1D0900A53FFD /* DOMTextEvent.mm in Sources */,
</span><span class="cx">                                 188604B30F2E654A000B6443 /* DOMTimer.cpp in Sources */,
</span><span class="cx">                                 76FC2B0B12370DA0006A991A /* DOMTokenList.cpp in Sources */,
</span><span class="lines">@@ -28461,6 +28476,7 @@
</span><span class="cx">                                 49C7B9E51042D32F0009D447 /* WebGLTexture.cpp in Sources */,
</span><span class="cx">                                 0C3F1F5A10C8871200D72CE1 /* WebGLUniformLocation.cpp in Sources */,
</span><span class="cx">                                 77A17A7712F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp in Sources */,
</span><ins>+                                FE6938B61045D67E008EABB6 /* EventHandlerIOS.mm in Sources */,
</ins><span class="cx">                                 31C0FF210E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp in Sources */,
</span><span class="cx">                                 976D6C7B122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp in Sources */,
</span><span class="cx">                                 150B923915F08DC400E10986 /* WebKitCSSArrayFunctionValue.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventNames.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventNames.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/dom/EventNames.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -290,6 +290,11 @@
</span><span class="cx">     DOM_EVENT_NAMES_FOR_EACH(DOM_EVENT_NAMES_DECLARE)
</span><span class="cx">     #undef DOM_EVENT_NAMES_DECLARE
</span><span class="cx"> 
</span><ins>+    inline bool isGestureEventType(const AtomicString&amp; eventType) const
+    {
+        return eventType == gesturestartEvent || eventType == gesturechangeEvent || eventType == gestureendEvent;
+    }
+
</ins><span class="cx">     inline bool isTouchEventType(const AtomicString&amp; eventType) const
</span><span class="cx">     {
</span><span class="cx">         return eventType == touchstartEvent
</span></span></pre></div>
<a id="trunkSourceWebCorepageAlternativeTextClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/AlternativeTextClient.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/AlternativeTextClient.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/AlternativeTextClient.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -31,10 +31,10 @@
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC) &amp;&amp; (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080)
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</ins><span class="cx"> // Some platforms provide UI for suggesting alternative dictation text.
</span><span class="cx"> #define WTF_USE_DICTATION_ALTERNATIVES 1
</span><del>-#endif // PLATFORM(MAC) &amp;&amp; (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080)
</del><ins>+#endif // !PLATFORM(IOS) &amp;&amp; PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Chrome.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;DNS.h&quot;
</span><span class="cx"> #include &quot;DateTimeChooser.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><ins>+#include &quot;DocumentType.h&quot;
</ins><span class="cx"> #include &quot;FileIconLoader.h&quot;
</span><span class="cx"> #include &quot;FileChooser.h&quot;
</span><span class="cx"> #include &quot;FileList.h&quot;
</span><span class="lines">@@ -65,6 +66,9 @@
</span><span class="cx">     : m_page(page)
</span><span class="cx">     , m_client(client)
</span><span class="cx">     , m_displayID(0)
</span><ins>+#if PLATFORM(IOS)
+    , m_isDispatchViewportDataDidChangeSuppressed(false)
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -477,7 +481,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
</del><ins>+#if ENABLE(DATE_AND_TIME_INPUT_TYPES) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> PassRefPtr&lt;DateTimeChooser&gt; Chrome::openDateTimeChooser(DateTimeChooserClient* client, const DateTimeChooserParameters&amp; parameters)
</span><span class="cx"> {
</span><span class="cx">     notifyPopupOpeningObservers();
</span><span class="lines">@@ -498,17 +502,29 @@
</span><span class="cx"> 
</span><span class="cx"> void Chrome::dispatchViewportPropertiesDidChange(const ViewportArguments&amp; arguments) const
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (m_isDispatchViewportDataDidChangeSuppressed)
+        return;
+#endif
</ins><span class="cx">     m_client.dispatchViewportPropertiesDidChange(arguments);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Chrome::setCursor(const Cursor&amp; cursor)
</span><span class="cx"> {
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     m_client.setCursor(cursor);
</span><ins>+#else
+    UNUSED_PARAM(cursor);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Chrome::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
</span><span class="cx"> {
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     m_client.setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
</span><ins>+#else
+    UNUSED_PARAM(hiddenUntilMouseMoves);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><span class="lines">@@ -602,6 +618,26 @@
</span><span class="cx">     return m_client.requiresFullscreenForVideoPlayback();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+// FIXME: Make argument, frame, a reference.
+void Chrome::didReceiveDocType(Frame* frame)
+{
+    ASSERT(frame);
+    if (!frame-&gt;isMainFrame())
+        return;
+
+    DocumentType* documentType = frame-&gt;document()-&gt;doctype();
+    if (!documentType) {
+        // FIXME: We should notify the client when &lt;!DOCTYPE&gt; is removed so that
+        // it can adjust the viewport accordingly. See &lt;rdar://problem/15417894&gt;.
+        return;
+    }
+
+    if (documentType-&gt;publicId().contains(&quot;xhtml mobile&quot;, false))
+        m_client.didReceiveMobileDocType();
+}
+#endif
+
</ins><span class="cx"> void Chrome::registerPopupOpeningObserver(PopupOpeningObserver* observer)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(observer);
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Chrome.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -155,8 +155,9 @@
</span><span class="cx"> #if ENABLE(INPUT_TYPE_COLOR)
</span><span class="cx">     PassOwnPtr&lt;ColorChooser&gt; createColorChooser(ColorChooserClient*, const Color&amp; initialColor);
</span><span class="cx"> #endif
</span><del>-#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
-    PassRefPtr&lt;DateTimeChooser&gt; openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&amp;);
</del><ins>+
+#if ENABLE(DATE_AND_TIME_INPUT_TYPES) &amp;&amp; !PLATFORM(IOS)
+    PassRefPtr&lt;DateTimeChooser&gt; openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&amp;)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(Frame*, PassRefPtr&lt;FileChooser&gt;);
</span><span class="lines">@@ -179,6 +180,13 @@
</span><span class="cx">     PassRefPtr&lt;PopupMenu&gt; createPopupMenu(PopupMenuClient*) const;
</span><span class="cx">     PassRefPtr&lt;SearchPopupMenu&gt; createSearchPopupMenu(PopupMenuClient*) const;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Can we come up with a better name for this setter?
+    void setDispatchViewportDataDidChangeSuppressed(bool dispatchViewportDataDidChangeSuppressed) { m_isDispatchViewportDataDidChangeSuppressed = dispatchViewportDataDidChangeSuppressed; }
+
+    void didReceiveDocType(Frame*);
+#endif
+
</ins><span class="cx">     void registerPopupOpeningObserver(PopupOpeningObserver*);
</span><span class="cx">     void unregisterPopupOpeningObserver(PopupOpeningObserver*);
</span><span class="cx"> 
</span><span class="lines">@@ -189,6 +197,9 @@
</span><span class="cx">     ChromeClient&amp; m_client;
</span><span class="cx">     PlatformDisplayID m_displayID;
</span><span class="cx">     Vector&lt;PopupOpeningObserver*&gt; m_popupOpeningObservers;
</span><ins>+#if PLATFORM(IOS)
+    bool m_isDispatchViewportDataDidChangeSuppressed;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/ChromeClient.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -40,6 +40,16 @@
</span><span class="cx"> #include &lt;wtf/PassOwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;PlatformLayer.h&quot;
+#define NSResponder WAKResponder
+#ifndef __OBJC__
+class WAKResponder;
+#else
+@class WAKResponder;
+#endif
+#endif
+
</ins><span class="cx"> #if ENABLE(SQL_DATABASE)
</span><span class="cx"> #include &quot;DatabaseDetails.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -62,14 +72,15 @@
</span><span class="cx"> class GraphicsContext3D;
</span><span class="cx"> class GraphicsLayer;
</span><span class="cx"> class GraphicsLayerFactory;
</span><ins>+class HTMLInputElement;
</ins><span class="cx"> class HitTestResult;
</span><del>-class HTMLInputElement;
</del><span class="cx"> class IntRect;
</span><span class="cx"> class NavigationAction;
</span><span class="cx"> class Node;
</span><span class="cx"> class Page;
</span><span class="cx"> class PopupMenuClient;
</span><span class="cx"> class SecurityOrigin;
</span><ins>+class ViewportConstraints;
</ins><span class="cx"> class Widget;
</span><span class="cx"> 
</span><span class="cx"> struct DateTimeChooserParameters;
</span><span class="lines">@@ -156,8 +167,10 @@
</span><span class="cx">     virtual IntRect rootViewToScreen(const IntRect&amp;) const = 0;
</span><span class="cx">     virtual PlatformPageClient platformPageClient() const = 0;
</span><span class="cx">     virtual void scrollbarsModeDidChange() const = 0;
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     virtual void setCursor(const Cursor&amp;) = 0;
</span><span class="cx">     virtual void setCursorHiddenUntilMouseMoves(bool) = 0;
</span><ins>+#endif
</ins><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME) &amp;&amp; !USE(REQUEST_ANIMATION_FRAME_TIMER)
</span><span class="cx">     virtual void scheduleAnimation() = 0;
</span><span class="cx"> #endif
</span><span class="lines">@@ -212,11 +225,46 @@
</span><span class="cx">     virtual bool shouldReplaceWithGeneratedFileForUpload(const String&amp; path, String&amp; generatedFilename);
</span><span class="cx">     virtual String generateReplacementFile(const String&amp; path);
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+    virtual void didPreventDefaultForEvent() = 0;
+#endif
+
+#if PLATFORM(IOS)
+    virtual void didReceiveMobileDocType() = 0;
+    virtual void setNeedsScrollNotifications(Frame*, bool) = 0;
+    virtual void observedContentChange(Frame*) = 0;
+    virtual void clearContentChangeObservers(Frame*) = 0;
+    virtual void notifyRevealedSelectionByScrollingFrame(Frame*) = 0;
+
+    enum LayoutType { NormalLayout, Scroll };
+    virtual void didLayout(LayoutType = NormalLayout) = 0;
+    virtual void didStartOverflowScroll() = 0;
+    virtual void didEndOverflowScroll() = 0;
+
+    // FIXME: Remove this functionality. This functionality was added to workaround an issue (&lt;rdar://problem/5973875&gt;)
+    // where the unconfirmed text in a text area would be removed when a person clicks in the text area before a
+    // suggestion is shown. We should fix this issue in &lt;rdar://problem/5975559&gt;.
+    virtual void suppressFormNotifications() = 0;
+    virtual void restoreFormNotifications() = 0;
+
+    virtual void didFlushCompositingLayers() { }
+
+    virtual bool fetchCustomFixedPositionLayoutRect(IntRect&amp;) { return false; }
+
+    // FIXME: Use std::unique_ptr instead of OwnPtr.
+    virtual void updateViewportConstrainedLayers(HashMap&lt;PlatformLayer*, OwnPtr&lt;ViewportConstraints&gt;&gt;&amp;, HashMap&lt;PlatformLayer*, PlatformLayer*&gt;&amp;) { }
+
+    virtual void addOrUpdateScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer, const IntSize&amp; scrollSize, bool allowHorizontalScrollbar, bool allowVerticalScrollbar) = 0;
+    virtual void removeScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer) = 0;
+
+    virtual void webAppOrientationsUpdated() = 0;
+#endif
+
</ins><span class="cx"> #if ENABLE(INPUT_TYPE_COLOR)
</span><span class="cx">     virtual PassOwnPtr&lt;ColorChooser&gt; createColorChooser(ColorChooserClient*, const Color&amp;) = 0;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
</del><ins>+#if ENABLE(DATE_AND_TIME_INPUT_TYPES) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     virtual PassRefPtr&lt;DateTimeChooser&gt; openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&amp;) = 0;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMTimer.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMTimer.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/DOMTimer.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -35,6 +35,14 @@
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;Chrome.h&quot;
+#include &quot;ChromeClient.h&quot;
+#include &quot;Frame.h&quot;
+#include &quot;Page.h&quot;
+#include &quot;WKContentObservation.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static const int maxIntervalForUserGestureForwarding = 1000; // One second matches Gecko.
</span><span class="lines">@@ -81,6 +89,16 @@
</span><span class="cx">     // The timer is deleted when context is deleted (DOMTimer::contextDestroyed) or explicitly via DOMTimer::removeById(),
</span><span class="cx">     // or if it is a one-time timer and it has fired (DOMTimer::fired).
</span><span class="cx">     DOMTimer* timer = new DOMTimer(context, action, timeout, singleShot);
</span><ins>+#if PLATFORM(IOS)
+    if (context-&gt;isDocument()) {
+        Document&amp; document = toDocument(*context);
+        bool didDeferTimeout = document.frame() &amp;&amp; document.frame()-&gt;timersPaused();
+        if (!didDeferTimeout &amp;&amp; timeout &lt;= 100 &amp;&amp; singleShot) {
+            WKSetObservedContentChange(WKContentIndeterminateChange);
+            WebThreadAddObservedContentModifier(timer); // Will only take affect if not already visibility change.
+        }
+    }
+#endif
</ins><span class="cx"> 
</span><span class="cx">     timer-&gt;suspendIfNeeded();
</span><span class="cx">     InspectorInstrumentation::didInstallTimer(context, timer-&gt;m_timeoutId, timeout, singleShot);
</span><span class="lines">@@ -104,6 +122,14 @@
</span><span class="cx"> void DOMTimer::fired()
</span><span class="cx"> {
</span><span class="cx">     ScriptExecutionContext* context = scriptExecutionContext();
</span><ins>+    ASSERT(context);
+#if PLATFORM(IOS)
+    Document* document = nullptr;
+    if (!context-&gt;isDocument()) {
+        document = toDocument(context);
+        ASSERT(!document-&gt;frame()-&gt;timersPaused());
+    }
+#endif
</ins><span class="cx">     timerNestingLevel = m_nestingLevel;
</span><span class="cx">     ASSERT(!isSuspended());
</span><span class="cx">     ASSERT(!context-&gt;activeDOMObjectsAreSuspended());
</span><span class="lines">@@ -136,8 +162,35 @@
</span><span class="cx">     // No access to member variables after this point.
</span><span class="cx">     delete this;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    bool shouldReportLackOfChanges;
+    bool shouldBeginObservingChanges;
+    if (document) {
+        shouldReportLackOfChanges = WebThreadCountOfObservedContentModifiers() == 1;
+        shouldBeginObservingChanges = WebThreadContainsObservedContentModifier(this);
+    } else {
+        shouldReportLackOfChanges = false;
+        shouldBeginObservingChanges = false;
+    }
+
+    if (shouldBeginObservingChanges) {
+        WKBeginObservingContentChanges(false);
+        WebThreadRemoveObservedContentModifier(this);
+    }
+#endif
+
</ins><span class="cx">     action-&gt;execute(context);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if (shouldBeginObservingChanges) {
+        WKStopObservingContentChanges();
+
+        if (WKObservedContentChange() == WKContentVisibilityChange || shouldReportLackOfChanges)
+            if (document &amp;&amp; document-&gt;page())
+                document-&gt;page()-&gt;chrome().client().observedContentChange(document-&gt;frame());
+    }
+#endif
+
</ins><span class="cx">     InspectorInstrumentation::didFireTimer(cookie);
</span><span class="cx"> 
</span><span class="cx">     timerNestingLevel = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -117,6 +117,13 @@
</span><span class="cx"> #include &quot;RequestAnimationFrameCallback.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#if ENABLE(GEOLOCATION)
+#include &quot;NavigatorGeolocation.h&quot;
+#endif
+#include &quot;WKContentObservation.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class PostMessageTimer : public TimerBase {
</span><span class="lines">@@ -371,6 +378,13 @@
</span><span class="cx">     , FrameDestructionObserver(document-&gt;frame())
</span><span class="cx">     , m_shouldPrintWhenFinishedLoading(false)
</span><span class="cx">     , m_suspendedForPageCache(false)
</span><ins>+    , m_lastPageStatus(PageStatusNone)
+#if PLATFORM(IOS)
+    , m_scrollEventListenerCount(0)
+#endif
+#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
+    , m_touchEventListenerCount(0)
+#endif
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(frame());
</span><span class="cx">     ASSERT(DOMWindow::document());
</span><span class="lines">@@ -1139,9 +1153,13 @@
</span><span class="cx">     if (!view)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    return view-&gt;mapFromLayoutToCSSUnits(static_cast&lt;int&gt;(view-&gt;actualVisibleContentRect().height()));
+#else
</ins><span class="cx">     // If the device height is overridden, do not include the horizontal scrollbar into the innerHeight (since it is absent on the real device).
</span><span class="cx">     bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenHeightOverride(m_frame);
</span><span class="cx">     return view-&gt;mapFromLayoutToCSSUnits(static_cast&lt;int&gt;(view-&gt;visibleContentRect(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScrollbars).height()));
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int DOMWindow::innerWidth() const
</span><span class="lines">@@ -1153,9 +1171,13 @@
</span><span class="cx">     if (!view)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    return view-&gt;mapFromLayoutToCSSUnits(static_cast&lt;int&gt;(view-&gt;actualVisibleContentRect().width()));
+#else
</ins><span class="cx">     // If the device width is overridden, do not include the vertical scrollbar into the innerWidth (since it is absent on the real device).
</span><span class="cx">     bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(m_frame);
</span><span class="cx">     return view-&gt;mapFromLayoutToCSSUnits(static_cast&lt;int&gt;(view-&gt;visibleContentRect(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScrollbars).width()));
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int DOMWindow::screenX() const
</span><span class="lines">@@ -1196,7 +1218,11 @@
</span><span class="cx"> 
</span><span class="cx">     m_frame-&gt;document()-&gt;updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    return static_cast&lt;int&gt;(view-&gt;actualVisibleContentRect().x() / (m_frame-&gt;pageZoomFactor() * m_frame-&gt;frameScaleFactor()));
+#else
</ins><span class="cx">     return view-&gt;mapFromLayoutToCSSUnits(view-&gt;scrollX());
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int DOMWindow::scrollY() const
</span><span class="lines">@@ -1213,7 +1239,11 @@
</span><span class="cx"> 
</span><span class="cx">     m_frame-&gt;document()-&gt;updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    return static_cast&lt;int&gt;(view-&gt;actualVisibleContentRect().y() / (m_frame-&gt;pageZoomFactor() * m_frame-&gt;frameScaleFactor()));
+#else
</ins><span class="cx">     return view-&gt;mapFromLayoutToCSSUnits(view-&gt;scrollY());
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool DOMWindow::closed() const
</span><span class="lines">@@ -1425,7 +1455,11 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     IntSize scaledOffset(view-&gt;mapFromCSSToLayoutUnits(x), view-&gt;mapFromCSSToLayoutUnits(y));
</span><ins>+#if PLATFORM(IOS)
+    view-&gt;setActualScrollPosition(view-&gt;actualVisibleContentRect().location() + scaledOffset);
+#else
</ins><span class="cx">     view-&gt;scrollBy(scaledOffset);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DOMWindow::scrollTo(int x, int y) const
</span><span class="lines">@@ -1439,8 +1473,15 @@
</span><span class="cx">     if (!view)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+
+#if PLATFORM(IOS)
+    int zoomedX = static_cast&lt;int&gt;(x * m_frame-&gt;pageZoomFactor() * m_frame-&gt;frameScaleFactor());
+    int zoomedY = static_cast&lt;int&gt;(y * m_frame-&gt;pageZoomFactor() * m_frame-&gt;frameScaleFactor());
+    view-&gt;setActualScrollPosition(IntPoint(zoomedX, zoomedY));
+#else
</ins><span class="cx">     IntPoint layoutPos(view-&gt;mapFromCSSToLayoutUnits(x), view-&gt;mapFromCSSToLayoutUnits(y));
</span><span class="cx">     view-&gt;setScrollPosition(layoutPos);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool DOMWindow::allowedToChangeWindowGeometry() const
</span><span class="lines">@@ -1521,6 +1562,22 @@
</span><span class="cx"> 
</span><span class="cx"> void DOMWindow::clearTimeout(int timeoutId)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (m_frame) {
+        Document* document = m_frame-&gt;document();
+        if (timeoutId &gt; 0 &amp;&amp; document) {
+            DOMTimer* timer = document-&gt;findTimeout(timeoutId);
+            if (timer &amp;&amp; WebThreadContainsObservedContentModifier(timer)) {
+                WebThreadRemoveObservedContentModifier(timer);
+
+                if (!WebThreadCountOfObservedContentModifiers()) {
+                    if (Page* page = m_frame-&gt;page())
+                        page-&gt;chrome().client().observedContentChange(m_frame);
+                }
+            }
+        }
+    }
+#endif
</ins><span class="cx">     ScriptExecutionContext* context = scriptExecutionContext();
</span><span class="cx">     if (!context)
</span><span class="cx">         return;
</span><span class="lines">@@ -1608,6 +1665,12 @@
</span><span class="cx">     else if (eventType == eventNames().beforeunloadEvent &amp;&amp; allowsBeforeUnloadListeners(this))
</span><span class="cx">         addBeforeUnloadEventListener(this);
</span><span class="cx"> #if ENABLE(DEVICE_ORIENTATION)
</span><ins>+#if PLATFORM(IOS)
+    else if (eventType == eventNames().devicemotionEvent &amp;&amp; document())
+        document()-&gt;deviceMotionController()-&gt;addDeviceEventListener(this);
+    else if (eventType == eventNames().deviceorientationEvent &amp;&amp; document())
+        document()-&gt;deviceOrientationController()-&gt;addDeviceEventListener(this);
+#else
</ins><span class="cx">     else if (eventType == eventNames().devicemotionEvent &amp;&amp; RuntimeEnabledFeatures::sharedFeatures().deviceMotionEnabled()) {
</span><span class="cx">         if (DeviceMotionController* controller = DeviceMotionController::from(page()))
</span><span class="cx">             controller-&gt;addDeviceEventListener(this);
</span><span class="lines">@@ -1615,7 +1678,20 @@
</span><span class="cx">         if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
</span><span class="cx">             controller-&gt;addDeviceEventListener(this);
</span><span class="cx">     }
</span><ins>+#endif // PLATFORM(IOS)
+#endif // ENABLE(DEVICE_ORIENTATION)
+#if PLATFORM(IOS)
+    else if (eventType == eventNames().scrollEvent)
+        incrementScrollEventListenersCount();
</ins><span class="cx"> #endif
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+    else if (eventNames().isTouchEventType(eventType))
+        ++m_touchEventListenerCount;
+#endif
+#if ENABLE(IOS_GESTURE_EVENTS)
+    else if (eventNames().isGestureEventType(eventType))
+        ++m_touchEventListenerCount;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(PROXIMITY_EVENTS)
</span><span class="cx">     else if (eventType == eventNames().webkitdeviceproximityEvent) {
</span><span class="lines">@@ -1627,6 +1703,37 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void DOMWindow::incrementScrollEventListenersCount()
+{
+    Document* document = this-&gt;document();
+    if (++m_scrollEventListenerCount == 1 &amp;&amp; document == document-&gt;topDocument()) {
+        Frame* frame = this-&gt;frame();
+        if (frame &amp;&amp; frame-&gt;page())
+            frame-&gt;page()-&gt;chrome().client().setNeedsScrollNotifications(frame, true);
+    }
+}
+
+void DOMWindow::decrementScrollEventListenersCount()
+{
+    Document* document = this-&gt;document();
+    if (!--m_scrollEventListenerCount &amp;&amp; document == document-&gt;topDocument()) {
+        Frame* frame = this-&gt;frame();
+        if (frame &amp;&amp; frame-&gt;page() &amp;&amp; !document-&gt;inPageCache())
+            frame-&gt;page()-&gt;chrome().client().setNeedsScrollNotifications(frame, false);
+    }
+}
+#endif
+
+void DOMWindow::resetAllGeolocationPermission()
+{
+    // FIXME: Remove PLATFORM(IOS)-guard once we upstream the iOS changes to Geolocation.cpp.
+#if ENABLE(GEOLOCATION) &amp;&amp; PLATFORM(IOS)
+    if (m_navigator)
+        NavigatorGeolocation::from(m_navigator.get())-&gt;resetAllGeolocationPermission();
+#endif
+}
+
</ins><span class="cx"> bool DOMWindow::removeEventListener(const AtomicString&amp; eventType, EventListener* listener, bool useCapture)
</span><span class="cx"> {
</span><span class="cx">     if (!EventTarget::removeEventListener(eventType, listener, useCapture))
</span><span class="lines">@@ -1644,6 +1751,12 @@
</span><span class="cx">     else if (eventType == eventNames().beforeunloadEvent &amp;&amp; allowsBeforeUnloadListeners(this))
</span><span class="cx">         removeBeforeUnloadEventListener(this);
</span><span class="cx"> #if ENABLE(DEVICE_ORIENTATION)
</span><ins>+#if PLATFORM(IOS)
+    else if (eventType == eventNames().devicemotionEvent &amp;&amp; document())
+        document()-&gt;deviceMotionController()-&gt;removeDeviceEventListener(this);
+    else if (eventType == eventNames().deviceorientationEvent &amp;&amp; document())
+        document()-&gt;deviceOrientationController()-&gt;removeDeviceEventListener(this);
+#else
</ins><span class="cx">     else if (eventType == eventNames().devicemotionEvent) {
</span><span class="cx">         if (DeviceMotionController* controller = DeviceMotionController::from(page()))
</span><span class="cx">             controller-&gt;removeDeviceEventListener(this);
</span><span class="lines">@@ -1651,7 +1764,24 @@
</span><span class="cx">         if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
</span><span class="cx">             controller-&gt;removeDeviceEventListener(this);
</span><span class="cx">     }
</span><ins>+#endif // PLATFORM(IOS)
+#endif // ENABLE(DEVICE_ORIENTATION)
+#if PLATFORM(IOS)
+    else if (eventType == eventNames().scrollEvent)
+        decrementScrollEventListenersCount();
</ins><span class="cx"> #endif
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+    else if (eventNames().isTouchEventType(eventType)) {
+        ASSERT(m_touchEventListenerCount &gt; 0);
+        --m_touchEventListenerCount;
+    }
+#endif
+#if ENABLE(IOS_GESTURE_EVENTS)
+    else if (eventNames().isGestureEventType(eventType)) {
+        ASSERT(m_touchEventListenerCount &gt; 0);
+        --m_touchEventListenerCount;
+    }
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(PROXIMITY_EVENTS)
</span><span class="cx">     else if (eventType == eventNames().webkitdeviceproximityEvent) {
</span><span class="lines">@@ -1692,6 +1822,22 @@
</span><span class="cx">     Ref&lt;EventTarget&gt; protect(*this);
</span><span class="cx">     RefPtr&lt;Event&gt; event = prpEvent;
</span><span class="cx"> 
</span><ins>+    // Pausing a page may trigger pagehide and pageshow events. WebCore also implicitly fires these
+    // events when closing a WebView. Here we keep track of the state of the page to prevent duplicate,
+    // unbalanced events per the definition of the pageshow event:
+    // &lt;http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow&gt;.
+    if (event-&gt;eventInterface() == PageTransitionEventInterfaceType) {
+        if (event-&gt;type() == eventNames().pageshowEvent) {
+            if (m_lastPageStatus == PageStatusShown)
+                return true; // Event was previously dispatched; do not fire a duplicate event.
+            m_lastPageStatus = PageStatusShown;
+        } else if (event-&gt;type() == eventNames().pagehideEvent) {
+            if (m_lastPageStatus == PageStatusHidden)
+                return true; // Event was previously dispatched; do not fire a duplicate event.
+            m_lastPageStatus = PageStatusHidden;
+        }
+    }
+
</ins><span class="cx">     event-&gt;setTarget(prpTarget ? prpTarget : this);
</span><span class="cx">     event-&gt;setCurrentTarget(this);
</span><span class="cx">     event-&gt;setEventPhase(Event::AT_TARGET);
</span><span class="lines">@@ -1710,11 +1856,30 @@
</span><span class="cx">     EventTarget::removeAllEventListeners();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DEVICE_ORIENTATION)
</span><ins>+#if PLATFORM(IOS)
+    if (Document* document = this-&gt;document()) {
+        document-&gt;deviceMotionController()-&gt;removeAllDeviceEventListeners(this);
+        document-&gt;deviceOrientationController()-&gt;removeAllDeviceEventListeners(this);
+    }
+#else
</ins><span class="cx">     if (DeviceMotionController* controller = DeviceMotionController::from(page()))
</span><span class="cx">         controller-&gt;removeAllDeviceEventListeners(this);
</span><span class="cx">     if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
</span><span class="cx">         controller-&gt;removeAllDeviceEventListeners(this);
</span><ins>+#endif // PLATFORM(IOS)
+#endif // ENABLE(DEVICE_ORIENTATION)
+
+#if PLATFORM(IOS)
+    if (m_scrollEventListenerCount) {
+        m_scrollEventListenerCount = 1;
+        decrementScrollEventListenersCount();
+    }
</ins><span class="cx"> #endif
</span><ins>+
+#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
+    m_touchEventListenerCount = 0;
+#endif
+
</ins><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx">     if (Document* document = this-&gt;document())
</span><span class="cx">         document-&gt;didRemoveEventTargetNode(document);
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/DOMWindow.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -397,10 +397,28 @@
</span><span class="cx">         DEFINE_ATTRIBUTE_EVENT_LISTENER(touchcancel);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_GESTURE_EVENTS)
+        DEFINE_ATTRIBUTE_EVENT_LISTENER(gesturestart);
+        DEFINE_ATTRIBUTE_EVENT_LISTENER(gesturechange);
+        DEFINE_ATTRIBUTE_EVENT_LISTENER(gestureend);
+#endif
+
</ins><span class="cx"> #if ENABLE(WEB_TIMING)
</span><span class="cx">         Performance* performance() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        void incrementScrollEventListenersCount();
+        void decrementScrollEventListenersCount();
+        unsigned scrollEventListenerCount() const { return m_scrollEventListenerCount; }
+#endif
+
+        void resetAllGeolocationPermission();
+
+#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
+        bool hasTouchEventListeners() const { return m_touchEventListenerCount &gt; 0; }
+#endif
+
</ins><span class="cx">         // FIXME: When this DOMWindow is no longer the active DOMWindow (i.e.,
</span><span class="cx">         // when its document is no longer the document that is displayed in its
</span><span class="cx">         // frame), we would like to zero out m_frame to avoid being confused
</span><span class="lines">@@ -457,6 +475,17 @@
</span><span class="cx">         String m_status;
</span><span class="cx">         String m_defaultStatus;
</span><span class="cx"> 
</span><ins>+        enum PageStatus { PageStatusNone, PageStatusShown, PageStatusHidden };
+        PageStatus m_lastPageStatus;
+
+#if PLATFORM(IOS)
+        unsigned m_scrollEventListenerCount;
+#endif
+
+#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
+        unsigned m_touchEventListenerCount;
+#endif
+
</ins><span class="cx">         mutable RefPtr&lt;Storage&gt; m_sessionStorage;
</span><span class="cx">         mutable RefPtr&lt;Storage&gt; m_localStorage;
</span><span class="cx">         mutable RefPtr&lt;DOMApplicationCache&gt; m_applicationCache;
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.idl (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.idl        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/DOMWindow.idl        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -285,6 +285,10 @@
</span><span class="cx">     [Conditional=TOUCH_EVENTS] attribute EventListener ontouchend;
</span><span class="cx">     [Conditional=TOUCH_EVENTS] attribute EventListener ontouchcancel;
</span><span class="cx"> 
</span><ins>+    [Conditional=IOS_GESTURE_EVENTS] attribute EventListener ongesturestart;
+    [Conditional=IOS_GESTURE_EVENTS] attribute EventListener ongesturechange;
+    [Conditional=IOS_GESTURE_EVENTS] attribute EventListener ongestureend;
+
</ins><span class="cx">     [Conditional=DEVICE_ORIENTATION] attribute EventListener ondevicemotion;
</span><span class="cx">     [Conditional=DEVICE_ORIENTATION] attribute EventListener ondeviceorientation;
</span><span class="cx"> 
</span><span class="lines">@@ -308,6 +312,10 @@
</span><span class="cx">     // Mozilla has a separate XMLDocument object for XML documents.
</span><span class="cx">     // We just use Document for this.
</span><span class="cx">     attribute DocumentConstructor XMLDocument;
</span><ins>+
+    [Conditional=IOS_TOUCH_EVENTS, CustomGetter] attribute TouchConstructor Touch; // Usable with the new operator
+    [Conditional=IOS_TOUCH_EVENTS, CustomGetter] attribute TouchListConstructor TouchList; // Usable with the new operator
+
</ins><span class="cx">     [Conditional=BLOB] attribute DOMURLConstructor webkitURL; // FIXME: deprecate this.
</span><span class="cx">     attribute MutationObserverConstructor WebKitMutationObserver; // FIXME: Add metrics to determine when we can remove this.
</span><span class="cx">     [Conditional=INDEXED_DATABASE] attribute IDBCursorConstructor webkitIDBCursor;
</span></span></pre></div>
<a id="trunkSourceWebCorepageEditorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EditorClient.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EditorClient.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/EditorClient.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -41,6 +41,11 @@
</span><span class="cx"> OBJC_CLASS NSURL;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+OBJC_CLASS NSArray;
+OBJC_CLASS NSDictionary;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class ArchiveResource;
</span><span class="lines">@@ -113,6 +118,21 @@
</span><span class="cx">     virtual void textWillBeDeletedInTextField(Element*) = 0;
</span><span class="cx">     virtual void textDidChangeInTextArea(Element*) = 0;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    virtual void suppressSelectionNotifications() = 0;
+    virtual void restoreSelectionNotifications() = 0;
+    virtual void startDelayingAndCoalescingContentChangeNotifications() = 0;
+    virtual void stopDelayingAndCoalescingContentChangeNotifications() = 0;
+    virtual void writeDataToPasteboard(NSDictionary*) = 0;
+    virtual NSArray* supportedPasteboardTypesForCurrentSelection() = 0;
+    virtual NSArray* readDataFromPasteboard(NSString* type, int index) = 0;
+    virtual bool hasRichlyEditableSelection() = 0;
+    virtual int getPasteboardItemsCount() = 0;
+    virtual DocumentFragment* documentFragmentFromDelegate(int index) = 0;
+    virtual bool performsTwoStepPaste(DocumentFragment*) = 0;
+    virtual int pasteboardChangeCount() = 0;
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     virtual NSString* userVisibleString(NSURL*) = 0;
</span><span class="cx">     virtual DocumentFragment* documentFragmentFromAttributedString(NSAttributedString*, Vector&lt; RefPtr&lt;ArchiveResource&gt;&gt;&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -104,7 +104,11 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+#include &quot;PlatformTouchEventIOS.h&quot;
+#else
</ins><span class="cx"> #include &quot;PlatformTouchEvent.h&quot;
</span><ins>+#endif
</ins><span class="cx"> #include &quot;TouchEvent.h&quot;
</span><span class="cx"> #include &quot;TouchList.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -127,6 +131,15 @@
</span><span class="cx"> const int GeneralDragHysteresis = 3;
</span><span class="cx"> #endif // ENABLE(DRAG_SUPPORT)
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_GESTURE_EVENTS)
+const float GestureUnknown = 0;
+#endif
+
+#if ENABLE(IOS_TOUCH_EVENTS)
+// FIXME: Share this constant with EventHandler and SliderThumbElement.
+const unsigned InvalidTouchIdentifier = 0;
+#endif
+
</ins><span class="cx"> // Match key code of composition keydown event on windows.
</span><span class="cx"> // IE sends VK_PROCESSKEY which has value 229;
</span><span class="cx"> const int CompositionEventKeyCode = 229;
</span><span class="lines">@@ -142,7 +155,7 @@
</span><span class="cx"> const double fakeMouseMoveShortInterval = 0.1;
</span><span class="cx"> const double fakeMouseMoveLongInterval = 0.25;
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
</del><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx"> // The amount of time to wait for a cursor update on style and layout changes
</span><span class="cx"> // Set to 50Hz, no need to be faster than common screen refresh rate
</span><span class="cx"> const double cursorUpdateInterval = 0.02;
</span><span class="lines">@@ -190,7 +203,7 @@
</span><span class="cx">     double m_start;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-#if ENABLE(TOUCH_EVENTS)
</del><ins>+#if ENABLE(TOUCH_EVENTS) &amp;&amp; !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx"> class SyntheticTouchPoint : public PlatformTouchPoint {
</span><span class="cx"> public:
</span><span class="cx"> 
</span><span class="lines">@@ -255,7 +268,7 @@
</span><span class="cx">         m_touchPoints.append(SyntheticTouchPoint(event));
</span><span class="cx">     }
</span><span class="cx"> };
</span><del>-#endif
</del><ins>+#endif // ENABLE(TOUCH_EVENTS) &amp;&amp; !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx"> 
</span><span class="cx"> static inline ScrollGranularity wheelGranularityToScrollGranularity(unsigned deltaMode)
</span><span class="cx"> {
</span><span class="lines">@@ -320,7 +333,9 @@
</span><span class="cx">     , m_mouseDownWasSingleClickInSelection(false)
</span><span class="cx">     , m_selectionInitiationState(HaveNotStartedSelection)
</span><span class="cx">     , m_hoverTimer(this, &amp;EventHandler::hoverTimerFired)
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     , m_cursorUpdateTimer(this, &amp;EventHandler::cursorUpdateTimerFired)
</span><ins>+#endif
</ins><span class="cx">     , m_autoscrollController(adoptPtr(new AutoscrollController))
</span><span class="cx">     , m_mouseDownMayStartAutoscroll(false)
</span><span class="cx">     , m_mouseDownWasInSubframe(false)
</span><span class="lines">@@ -331,6 +346,15 @@
</span><span class="cx">     , m_resizeLayer(0)
</span><span class="cx">     , m_eventHandlerWillResetCapturingMouseEventsElement(nullptr)
</span><span class="cx">     , m_clickCount(0)
</span><ins>+#if ENABLE(IOS_GESTURE_EVENTS)
+    , m_gestureInitialDiameter(GestureUnknown)
+    , m_gestureLastDiameter(GestureUnknown)
+    , m_gestureInitialRotation(GestureUnknown)
+    , m_gestureLastRotation(GestureUnknown)
+#endif
+#if ENABLE(IOS_TOUCH_EVENTS)
+    , m_firstTouchID(InvalidTouchIdentifier)
+#endif
</ins><span class="cx">     , m_mousePositionIsUnknown(true)
</span><span class="cx">     , m_mouseDownTimestamp(0)
</span><span class="cx">     , m_inTrackingScrollGesturePhase(false)
</span><span class="lines">@@ -338,9 +362,11 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     , m_mouseDownView(nil)
</span><span class="cx">     , m_sendingEventToSubview(false)
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     , m_activationEventNumber(-1)
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> #endif
</span><del>-#if ENABLE(TOUCH_EVENTS)
</del><ins>+#if ENABLE(TOUCH_EVENTS) &amp;&amp; !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx">     , m_originatingTouchPointTargetKey(0)
</span><span class="cx">     , m_touchPressed(false)
</span><span class="cx"> #endif
</span><span class="lines">@@ -374,7 +400,9 @@
</span><span class="cx"> void EventHandler::clear()
</span><span class="cx"> {
</span><span class="cx">     m_hoverTimer.stop();
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     m_cursorUpdateTimer.stop();
</span><ins>+#endif
</ins><span class="cx">     m_fakeMouseMoveEventTimer.stop();
</span><span class="cx"> #if ENABLE(CURSOR_VISIBILITY)
</span><span class="cx">     cancelAutoHideCursorTimer();
</span><span class="lines">@@ -390,6 +418,18 @@
</span><span class="cx">     m_lastScrollbarUnderMouse = 0;
</span><span class="cx">     m_clickCount = 0;
</span><span class="cx">     m_clickNode = 0;
</span><ins>+#if ENABLE(IOS_GESTURE_EVENTS)
+    m_gestureInitialDiameter = GestureUnknown;
+    m_gestureLastDiameter = GestureUnknown;
+    m_gestureInitialRotation = GestureUnknown;
+    m_gestureLastRotation = GestureUnknown;
+    m_gestureTargets.clear();
+#endif
+#if ENABLE(IOS_TOUCH_EVENTS)
+    m_touches.clear();
+    m_firstTouchID = InvalidTouchIdentifier;
+    m_touchEventTargetSubframe = 0;
+#endif
</ins><span class="cx">     m_frameSetBeingResized = 0;
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">     m_dragTarget = 0;
</span><span class="lines">@@ -404,7 +444,7 @@
</span><span class="cx">     m_capturingMouseEventsElement = nullptr;
</span><span class="cx">     m_latchedWheelEventElement = nullptr;
</span><span class="cx">     m_previousWheelScrolledElement = nullptr;
</span><del>-#if ENABLE(TOUCH_EVENTS)
</del><ins>+#if ENABLE(TOUCH_EVENTS) &amp;&amp; !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx">     m_originatingTouchPointTargets.clear();
</span><span class="cx">     m_originatingTouchPointDocument.clear();
</span><span class="cx">     m_originatingTouchPointTargetKey = 0;
</span><span class="lines">@@ -973,10 +1013,12 @@
</span><span class="cx"> 
</span><span class="cx"> void EventHandler::startPanScrolling(RenderElement* renderer)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (!renderer-&gt;isBox())
</span><span class="cx">         return;
</span><span class="cx">     m_autoscrollController-&gt;startPanScrolling(toRenderBox(renderer), lastKnownMousePosition());
</span><span class="cx">     invalidateClick();
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(PAN_SCROLLING)
</span><span class="lines">@@ -1178,6 +1220,7 @@
</span><span class="cx">     return &amp;toFrameView(widget)-&gt;frame();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx"> static bool isSubmitImage(Node* node)
</span><span class="cx"> {
</span><span class="cx">     return node &amp;&amp; isHTMLInputElement(node) &amp;&amp; toHTMLInputElement(node)-&gt;isImageButton();
</span><span class="lines">@@ -1444,6 +1487,7 @@
</span><span class="cx">     }
</span><span class="cx">     return pointerCursor();
</span><span class="cx"> }
</span><ins>+#endif // ENABLE(CURSOR_SUPPORT)
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CURSOR_VISIBILITY)
</span><span class="cx"> void EventHandler::startAutoHideCursorTimer()
</span><span class="lines">@@ -1564,6 +1608,11 @@
</span><span class="cx">     m_clickCount = mouseEvent.clickCount();
</span><span class="cx">     m_clickNode = mev.targetNode();
</span><span class="cx"> 
</span><ins>+    if (!m_clickNode) {
+        invalidateClick();
+        return false;
+    }
+
</ins><span class="cx">     if (FrameView* view = m_frame.view()) {
</span><span class="cx">         RenderLayer* layer = m_clickNode-&gt;renderer() ? m_clickNode-&gt;renderer()-&gt;enclosingLayer() : 0;
</span><span class="cx">         IntPoint p = view-&gt;windowToContents(mouseEvent.position());
</span><span class="lines">@@ -1726,7 +1775,9 @@
</span><span class="cx">     if (m_hoverTimer.isActive())
</span><span class="cx">         m_hoverTimer.stop();
</span><span class="cx"> 
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     m_cursorUpdateTimer.stop();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     cancelFakeMouseMoveEvent();
</span><span class="cx"> 
</span><span class="lines">@@ -1740,9 +1791,12 @@
</span><span class="cx">     if (m_frameSetBeingResized)
</span><span class="cx">         return !dispatchMouseEvent(eventNames().mousemoveEvent, m_frameSetBeingResized.get(), false, 0, mouseEvent, false);
</span><span class="cx"> 
</span><ins>+    // On iOS, our scrollbars are managed by UIKit.
+#if !PLATFORM(IOS)
</ins><span class="cx">     // Send events right to a scrollbar if the mouse is pressed.
</span><span class="cx">     if (m_lastScrollbarUnderMouse &amp;&amp; m_mousePressed)
</span><span class="cx">         return m_lastScrollbarUnderMouse-&gt;mouseMoved(mouseEvent);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestRequest::DisallowShadowContent | HitTestRequest::AllowFrameScrollbars;
</span><span class="cx">     if (m_mousePressed)
</span><span class="lines">@@ -1755,7 +1809,7 @@
</span><span class="cx">         hitType |= HitTestRequest::ReadOnly;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(TOUCH_EVENTS)
</del><ins>+#if ENABLE(TOUCH_EVENTS) &amp;&amp; !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx">     // Treat any mouse move events as readonly if the user is currently touching the screen.
</span><span class="cx">     if (m_touchPressed)
</span><span class="cx">         hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly;
</span><span class="lines">@@ -1770,8 +1824,12 @@
</span><span class="cx">     else {
</span><span class="cx">         Scrollbar* scrollbar = mev.scrollbar();
</span><span class="cx">         updateLastScrollbarUnderMouse(scrollbar, !m_mousePressed);
</span><ins>+
+        // On iOS, our scrollbars are managed by UIKit.
+#if !PLATFORM(IOS)
</ins><span class="cx">         if (!m_mousePressed &amp;&amp; scrollbar)
</span><span class="cx">             scrollbar-&gt;mouseMoved(mouseEvent); // Handle hover effects on platforms that support visual feedback on scrollbar hovering.
</span><ins>+#endif
</ins><span class="cx">         if (onlyUpdateScrollbars)
</span><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="lines">@@ -1791,6 +1849,7 @@
</span><span class="cx">         // node to be detached from its FrameView, in which case the event should not be passed.
</span><span class="cx">         if (newSubframe-&gt;view())
</span><span class="cx">             swallowEvent |= passMouseMoveEventToSubframe(mev, newSubframe.get(), hoveredNode);
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     } else {
</span><span class="cx">         if (FrameView* view = m_frame.view()) {
</span><span class="cx">             OptionalCursor optionalCursor = selectCursor(mev.hitTestResult(), mouseEvent.shiftKey());
</span><span class="lines">@@ -1799,6 +1858,7 @@
</span><span class="cx">                 view-&gt;setCursor(m_currentMouseCursor);
</span><span class="cx">             }
</span><span class="cx">         }
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     m_lastMouseMoveEventSubframe = newSubframe;
</span><span class="lines">@@ -2714,11 +2774,13 @@
</span><span class="cx">         m_hoverTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx"> void EventHandler::scheduleCursorUpdate()
</span><span class="cx"> {
</span><span class="cx">     if (!m_cursorUpdateTimer.isActive())
</span><span class="cx">         m_cursorUpdateTimer.startOneShot(cursorUpdateInterval);
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> void EventHandler::dispatchFakeMouseMoveEventSoon()
</span><span class="cx"> {
</span><span class="lines">@@ -2830,7 +2892,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !PLATFORM(MAC)
</del><ins>+#if !PLATFORM(MAC) || PLATFORM(IOS)
</ins><span class="cx"> bool EventHandler::needsKeyboardEventDisambiguationQuirks() const
</span><span class="cx"> {
</span><span class="cx">     return false;
</span><span class="lines">@@ -3507,8 +3569,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(TOUCH_EVENTS)
-
</del><ins>+#if ENABLE(TOUCH_EVENTS) &amp;&amp; !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx"> static const AtomicString&amp; eventNameForTouchPointState(PlatformTouchPoint::State state)
</span><span class="cx"> {
</span><span class="cx">     switch (state) {
</span><span class="lines">@@ -3528,7 +3589,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HitTestResult EventHandler::hitTestResultInFrame(Frame* frame, const LayoutPoint&amp; point, HitTestRequest::HitTestRequestType hitType)
</del><ins>+static HitTestResult hitTestResultInFrame(Frame* frame, const LayoutPoint&amp; point, HitTestRequest::HitTestRequestType hitType)
</ins><span class="cx"> {
</span><span class="cx">     HitTestResult result(point);
</span><span class="cx"> 
</span><span class="lines">@@ -3744,9 +3805,15 @@
</span><span class="cx"> 
</span><span class="cx">     return swallowedEvent;
</span><span class="cx"> }
</span><ins>+#endif // ENABLE(TOUCH_EVENTS) &amp;&amp; !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx"> 
</span><ins>+#if ENABLE(TOUCH_EVENTS)
</ins><span class="cx"> bool EventHandler::dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent&amp; event)
</span><span class="cx"> {
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+    UNUSED_PARAM(event);
+    return false;
+#else
</ins><span class="cx">     if (!m_frame.settings().isTouchEventEmulationEnabled())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -3765,10 +3832,10 @@
</span><span class="cx"> 
</span><span class="cx">     SyntheticSingleTouchEvent touchEvent(event);
</span><span class="cx">     return handleTouchEvent(touchEvent);
</span><ins>+#endif
</ins><span class="cx"> }
</span><ins>+#endif // ENABLE(TOUCH_EVENTS)
</ins><span class="cx"> 
</span><del>-#endif
-
</del><span class="cx"> void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent&amp; event)
</span><span class="cx"> {
</span><span class="cx">     m_mousePositionIsUnknown = false;
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/EventHandler.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -42,6 +42,16 @@
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#ifdef __OBJC__
+@class WebEvent;
+@class WAKView;
+#include &quot;WAKAppKitStubs.h&quot;
+#else
+class WebEvent;
+#endif
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> #if PLATFORM(MAC) &amp;&amp; !defined(__OBJC__)
</span><span class="cx"> class NSView;
</span><span class="cx"> #endif
</span><span class="lines">@@ -50,6 +60,11 @@
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+#include &lt;wtf/HashSet.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class AutoscrollController;
</span><span class="lines">@@ -78,6 +93,7 @@
</span><span class="cx"> class SVGElementInstance;
</span><span class="cx"> class Scrollbar;
</span><span class="cx"> class TextEvent;
</span><ins>+class Touch;
</ins><span class="cx"> class TouchEvent;
</span><span class="cx"> class VisibleSelection;
</span><span class="cx"> class WheelEvent;
</span><span class="lines">@@ -92,6 +108,10 @@
</span><span class="cx"> extern const int GeneralDragHysteresis;
</span><span class="cx"> #endif // ENABLE(DRAG_SUPPORT)
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_GESTURE_EVENTS)
+extern const float GestureUnknown;
+#endif
+
</ins><span class="cx"> enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTrailingWhitespace };
</span><span class="cx"> enum CheckDragHysteresis { ShouldCheckDragHysteresis, DontCheckDragHysteresis };
</span><span class="cx"> 
</span><span class="lines">@@ -144,7 +164,9 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void scheduleHoverStateUpdate();
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     void scheduleCursorUpdate();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     void setResizingFrameSet(HTMLFrameSetElement*);
</span><span class="cx"> 
</span><span class="lines">@@ -175,6 +197,24 @@
</span><span class="cx">     void defaultWheelEventHandler(Node*, WheelEvent*);
</span><span class="cx">     bool handlePasteGlobalSelection(const PlatformMouseEvent&amp;);
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
+    typedef Vector&lt;RefPtr&lt;Touch&gt;&gt; TouchArray;
+    typedef HashMap&lt;EventTarget*, TouchArray*&gt; EventTargetTouchMap;
+    typedef HashSet&lt;RefPtr&lt;EventTarget&gt;&gt; EventTargetSet;
+#endif
+
+#if ENABLE(IOS_TOUCH_EVENTS)
+    bool dispatchTouchEvent(const PlatformTouchEvent&amp;, const AtomicString&amp;, const EventTargetTouchMap&amp;, float, float);
+#endif
+
+#if ENABLE(IOS_GESTURE_EVENTS)
+    bool dispatchGestureEvent(const PlatformTouchEvent&amp;, const AtomicString&amp;, const EventTargetSet&amp;, float, float);
+#endif
+
+#if PLATFORM(IOS)
+    void defaultTouchEventHandler(Node*, TouchEvent*);
+#endif
+
</ins><span class="cx"> #if ENABLE(TOUCH_ADJUSTMENT)
</span><span class="cx">     bool bestClickableNodeForTouchPoint(const IntPoint&amp; touchCenter, const IntSize&amp; touchRadius, IntPoint&amp; targetPoint, Node*&amp; targetNode);
</span><span class="cx">     bool bestContextMenuNodeForTouchPoint(const IntPoint&amp; touchCenter, const IntSize&amp; touchRadius, IntPoint&amp; targetPoint, Node*&amp; targetNode);
</span><span class="lines">@@ -213,20 +253,42 @@
</span><span class="cx">     void sendScrollEvent(); // Ditto
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; defined(__OBJC__)
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     void mouseDown(NSEvent *);
</span><span class="cx">     void mouseDragged(NSEvent *);
</span><span class="cx">     void mouseUp(NSEvent *);
</span><span class="cx">     void mouseMoved(NSEvent *);
</span><span class="cx">     bool keyEvent(NSEvent *);
</span><span class="cx">     bool wheelEvent(NSEvent *);
</span><ins>+#else
+    void mouseDown(WebEvent *);
+    void mouseUp(WebEvent *);
+    void mouseMoved(WebEvent *);
+    bool keyEvent(WebEvent *);
+    bool wheelEvent(WebEvent *);
+#endif
</ins><span class="cx"> 
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+    void touchEvent(WebEvent *);
+#endif
+
+#if !PLATFORM(IOS)
</ins><span class="cx">     void passMouseMovedEventToScrollbars(NSEvent *);
</span><span class="cx"> 
</span><span class="cx">     void sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent);
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     void setActivationEventNumber(int num) { m_activationEventNumber = num; }
</span><span class="cx"> 
</span><span class="cx">     static NSEvent *currentNSEvent();
</span><ins>+#else
+    static WebEvent *currentEvent();
+#endif // !PLATFORM(IOS)
+#endif // PLATFORM(MAC) &amp;&amp; defined(__OBJC__)
+
+#if PLATFORM(IOS)
+    void invalidateClick();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="lines">@@ -266,7 +328,9 @@
</span><span class="cx">     OptionalCursor selectCursor(const HitTestResult&amp;, bool shiftKey);
</span><span class="cx"> 
</span><span class="cx">     void hoverTimerFired(Timer&lt;EventHandler&gt;*);
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     void cursorUpdateTimerFired(Timer&lt;EventHandler&gt;*);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
</span><span class="cx">     
</span><span class="lines">@@ -291,10 +355,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx">     bool dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent&amp;);
</span><del>-    HitTestResult hitTestResultInFrame(Frame*, const LayoutPoint&amp;, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     void invalidateClick();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     Node* nodeUnderMouse() const;
</span><span class="cx">     
</span><span class="lines">@@ -401,7 +466,9 @@
</span><span class="cx">     bool m_panScrollButtonPressed;
</span><span class="cx"> 
</span><span class="cx">     Timer&lt;EventHandler&gt; m_hoverTimer;
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx">     Timer&lt;EventHandler&gt; m_cursorUpdateTimer;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     OwnPtr&lt;AutoscrollController&gt; m_autoscrollController;
</span><span class="cx">     bool m_mouseDownMayStartAutoscroll;
</span><span class="lines">@@ -429,6 +496,21 @@
</span><span class="cx">     int m_clickCount;
</span><span class="cx">     RefPtr&lt;Node&gt; m_clickNode;
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_GESTURE_EVENTS)
+    float m_gestureInitialDiameter;
+    float m_gestureLastDiameter;
+    float m_gestureInitialRotation;
+    float m_gestureLastRotation;
+#endif
+
+#if ENABLE(IOS_TOUCH_EVENTS)
+    unsigned m_firstTouchID;
+
+    TouchArray m_touches;
+    EventTargetSet m_gestureTargets;
+    RefPtr&lt;Frame&gt; m_touchEventTargetSubframe;
+#endif
+
</ins><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">     RefPtr&lt;Element&gt; m_dragTarget;
</span><span class="cx">     bool m_shouldOnlyFireDragOverEvent;
</span><span class="lines">@@ -452,12 +534,14 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Element&gt; m_previousWheelScrolledElement;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) || PLATFORM(IOS)
</ins><span class="cx">     NSView *m_mouseDownView;
</span><span class="cx">     bool m_sendingEventToSubview;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     int m_activationEventNumber;
</span><span class="cx"> #endif
</span><del>-#if ENABLE(TOUCH_EVENTS)
</del><ins>+#endif
+#if ENABLE(TOUCH_EVENTS) &amp;&amp; !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx">     typedef HashMap&lt;int, RefPtr&lt;EventTarget&gt;&gt; TouchTargetMap;
</span><span class="cx">     TouchTargetMap m_originatingTouchPointTargets;
</span><span class="cx">     RefPtr&lt;Document&gt; m_originatingTouchPointDocument;
</span></span></pre></div>
<a id="trunkSourceWebCorepageFocusControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FocusController.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FocusController.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/FocusController.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -82,6 +82,10 @@
</span><span class="cx">     void setContainingWindowIsVisible(bool);
</span><span class="cx">     bool containingWindowIsVisible() const { return m_containingWindowIsVisible; }
</span><span class="cx"> 
</span><ins>+    // These methods are used in WebCore/bindings/objc/DOM.mm.
+    Element* nextFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);
+    Element* previousFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);
+
</ins><span class="cx"> private:
</span><span class="cx">     bool advanceFocusDirectionally(FocusDirection, KeyboardEvent*);
</span><span class="cx">     bool advanceFocusInDocumentOrder(FocusDirection, KeyboardEvent*, bool initialFocus);
</span><span class="lines">@@ -101,9 +105,6 @@
</span><span class="cx">     // See http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1
</span><span class="cx">     Element* findFocusableElement(FocusDirection, FocusNavigationScope, Node* start, KeyboardEvent*);
</span><span class="cx"> 
</span><del>-    Element* nextFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);
-    Element* previousFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);
-
</del><span class="cx">     Element* findElementWithExactTabIndex(Node* start, int tabIndex, KeyboardEvent*, FocusDirection);
</span><span class="cx"> 
</span><span class="cx">     bool advanceFocusDirectionallyInContainer(Node* container, const LayoutRect&amp; startingRect, FocusDirection, KeyboardEvent*);
</span></span></pre></div>
<a id="trunkSourceWebCorepageFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Frame.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Frame.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Frame.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -121,10 +121,18 @@
</span><span class="cx"> #include &quot;TiledBackingStore.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WKContentObservation.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+const unsigned scrollFrequency = 1000 / 60;
+#endif
+
</ins><span class="cx"> DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, (&quot;Frame&quot;));
</span><span class="cx"> 
</span><span class="cx"> static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement)
</span><span class="lines">@@ -163,6 +171,11 @@
</span><span class="cx">     , m_selection(adoptPtr(new FrameSelection(this)))
</span><span class="cx">     , m_eventHandler(adoptPtr(new EventHandler(*this)))
</span><span class="cx">     , m_animationController(std::make_unique&lt;AnimationController&gt;(*this))
</span><ins>+#if PLATFORM(IOS)
+    , m_overflowAutoScrollTimer(this, &amp;Frame::overflowAutoScrollTimerFired)
+    , m_selectionChangeCallbacksDisabled(false)
+    , m_timersPausedCount(0)
+#endif
</ins><span class="cx">     , m_pageZoomFactor(parentPageZoomFactor(this))
</span><span class="cx">     , m_textZoomFactor(parentTextZoomFactor(this))
</span><span class="cx"> #if ENABLE(ORIENTATION_EVENTS)
</span><span class="lines">@@ -197,10 +210,17 @@
</span><span class="cx">     frameCounter.increment();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    // FIXME: We should reconcile the iOS and OpenSource code below.
+    Frame* parent = parentFromOwnerElement(ownerElement);
+#if PLATFORM(IOS)
+    // Pause future timers if this frame is created when page is in pending state.
+    if (parent &amp;&amp; parent-&gt;timersPaused())
+        setTimersPaused(true);
+#else
</ins><span class="cx">     // Pause future ActiveDOMObjects if this frame is being created while the page is in a paused state.
</span><del>-    Frame* parent = parentFromOwnerElement(ownerElement);
</del><span class="cx">     if (parent &amp;&amp; parent-&gt;activeDOMObjectsAndAnimationsSuspended())
</span><span class="cx">         suspendActiveDOMObjectsAndAnimations();
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Frame&gt; Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
</span><span class="lines">@@ -471,6 +491,160 @@
</span><span class="cx">     return matchLabelsAgainstString(labels, element-&gt;getAttribute(idAttr));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void Frame::scrollOverflowLayer(RenderLayer* layer, const IntRect&amp; visibleRect, const IntRect&amp; exposeRect)
+{
+    if (!layer)
+        return;
+
+    RenderBox* box = layer-&gt;renderBox();
+    if (!box)
+        return;
+
+    if (visibleRect.intersects(exposeRect))
+        return;
+
+    int x = layer-&gt;scrollXOffset();
+    int exposeLeft = exposeRect.x();
+    int exposeRight = exposeLeft + exposeRect.width();
+    int clientWidth = box-&gt;clientWidth();
+    if (exposeLeft &lt;= 0)
+        x = std::max(0, x + exposeLeft - clientWidth / 2);
+    else if (exposeRight &gt;= clientWidth)
+        x = std::min(box-&gt;scrollWidth() - clientWidth, x + clientWidth / 2);
+
+    int y = layer-&gt;scrollYOffset();
+    int exposeTop = exposeRect.y();
+    int exposeBottom = exposeTop + exposeRect.height();
+    int clientHeight = box-&gt;clientHeight();
+    if (exposeTop &lt;= 0)
+        y = std::max(0, y + exposeTop - clientHeight / 2);
+    else if (exposeBottom &gt;= clientHeight)
+        y = std::min(box-&gt;scrollHeight() - clientHeight, y + clientHeight / 2);
+
+    layer-&gt;scrollToOffset(IntSize(x, y));
+    selection().setCaretRectNeedsUpdate();
+    selection().updateAppearance();
+}
+
+void Frame::overflowAutoScrollTimerFired(Timer&lt;Frame&gt;*)
+{
+    if (!eventHandler().mousePressed() || checkOverflowScroll(PerformOverflowScroll) == OverflowScrollNone) {
+        if (m_overflowAutoScrollTimer.isActive())
+            m_overflowAutoScrollTimer.stop();
+    }
+}
+
+void Frame::startOverflowAutoScroll(const IntPoint&amp; mousePosition)
+{
+    m_overflowAutoScrollPos = mousePosition;
+
+    if (m_overflowAutoScrollTimer.isActive())
+        return;
+
+    if (checkOverflowScroll(DoNotPerformOverflowScroll) == OverflowScrollNone)
+        return;
+
+    m_overflowAutoScrollTimer.startRepeating(scrollFrequency);
+    m_overflowAutoScrollDelta = 3;
+}
+
+int Frame::checkOverflowScroll(OverflowScrollAction action)
+{
+    Position extent = selection().selection().extent();
+    if (extent.isNull())
+        return OverflowScrollNone;
+
+    RenderObject* renderer = extent.deprecatedNode()-&gt;renderer();
+    if (!renderer)
+        return OverflowScrollNone;
+
+    FrameView* view = this-&gt;view();
+    if (!view)
+        return OverflowScrollNone;
+
+    RenderBlock* containingBlock = renderer-&gt;containingBlock();
+    if (!containingBlock || !containingBlock-&gt;hasOverflowClip())
+        return OverflowScrollNone;
+    RenderLayer* layer = containingBlock-&gt;layer();
+    ASSERT(layer);
+
+    IntRect visibleRect = IntRect(view-&gt;scrollX(), view-&gt;scrollY(), view-&gt;visibleWidth(), view-&gt;visibleHeight());
+    IntPoint position = m_overflowAutoScrollPos;
+    if (visibleRect.contains(position.x(), position.y()))
+        return OverflowScrollNone;
+
+    int scrollType = 0;
+    int deltaX = 0;
+    int deltaY = 0;
+    IntPoint selectionPosition;
+
+    // This constant will make the selection draw a little bit beyond the edge of the visible area.
+    // This prevents a visual glitch, in that you can fail to select a portion of a character that
+    // is being rendered right at the edge of the visible rectangle.
+    // FIXME: This probably needs improvement, and may need to take the font size into account.
+    static const int scrollBoundsAdjustment = 3;
+
+    // FIXME: Make a small buffer at the end of a visible rectangle so that autoscrolling works 
+    // even if the visible extends to the limits of the screen.
+    if (position.x() &lt; visibleRect.x()) {
+        scrollType |= OverflowScrollLeft;
+        if (action == PerformOverflowScroll) {
+            deltaX -= static_cast&lt;int&gt;(m_overflowAutoScrollDelta);
+            selectionPosition.setX(view-&gt;scrollX() - scrollBoundsAdjustment);
+        }
+    } else if (position.x() &gt; visibleRect.maxX()) {
+        scrollType |= OverflowScrollRight;
+        if (action == PerformOverflowScroll) {
+            deltaX += static_cast&lt;int&gt;(m_overflowAutoScrollDelta);
+            selectionPosition.setX(view-&gt;scrollX() + view-&gt;visibleWidth() + scrollBoundsAdjustment);
+        }
+    }
+
+    if (position.y() &lt; visibleRect.y()) {
+        scrollType |= OverflowScrollUp;
+        if (action == PerformOverflowScroll) {
+            deltaY -= static_cast&lt;int&gt;(m_overflowAutoScrollDelta);
+            selectionPosition.setY(view-&gt;scrollY() - scrollBoundsAdjustment);
+        }
+    } else if (position.y() &gt; visibleRect.maxY()) {
+        scrollType |= OverflowScrollDown;
+        if (action == PerformOverflowScroll) {
+            deltaY += static_cast&lt;int&gt;(m_overflowAutoScrollDelta);
+            selectionPosition.setY(view-&gt;scrollY() + view-&gt;visibleHeight() + scrollBoundsAdjustment);
+        }
+    }
+
+    if (action == PerformOverflowScroll &amp;&amp; (deltaX || deltaY)) {
+        layer-&gt;scrollToOffset(IntSize(layer-&gt;scrollXOffset() + deltaX, layer-&gt;scrollYOffset() + deltaY));
+
+        // Handle making selection.
+        VisiblePosition visiblePosition(renderer-&gt;positionForPoint(selectionPosition));
+        if (visiblePosition.isNotNull()) {
+            VisibleSelection visibleSelection = selection().selection();
+            visibleSelection.setExtent(visiblePosition);
+            if (selection().granularity() != CharacterGranularity)
+                visibleSelection.expandUsingGranularity(selection().granularity());
+            if (selection().shouldChangeSelection(visibleSelection))
+                selection().setSelection(visibleSelection);
+        }
+
+        m_overflowAutoScrollDelta *= 1.02f; // Accelerate the scroll
+    }
+    return scrollType;
+}
+
+void Frame::setSelectionChangeCallbacksDisabled(bool selectionChangeCallbacksDisabled)
+{
+    m_selectionChangeCallbacksDisabled = selectionChangeCallbacksDisabled;
+}
+
+bool Frame::selectionChangeCallbacksDisabled() const
+{
+    return m_selectionChangeCallbacksDisabled;
+}
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> void Frame::setPrinting(bool printing, const FloatSize&amp; pageSize, const FloatSize&amp; originalPageSize, float maximumShrinkRatio, AdjustViewSizeOrNot shouldAdjustViewSize)
</span><span class="cx"> {
</span><span class="cx">     // In setting printing, we should not validate resources already cached for the document.
</span><span class="lines">@@ -624,6 +798,11 @@
</span><span class="cx">     if (page() &amp;&amp; page()-&gt;scrollingCoordinator() &amp;&amp; m_view)
</span><span class="cx">         page()-&gt;scrollingCoordinator()-&gt;willDestroyScrollableArea(m_view.get());
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if (WebThreadCountOfObservedContentModifiers() &gt; 0 &amp;&amp; m_page)
+        m_page-&gt;chrome().client().clearContentChangeObservers(this);
+#endif
+
</ins><span class="cx">     script().clearScriptObjects();
</span><span class="cx">     script().updatePlatformScriptObjects();
</span><span class="cx"> }
</span><span class="lines">@@ -708,7 +887,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Frame::createView(const IntSize&amp; viewportSize, const Color&amp; backgroundColor, bool transparent,
</span><del>-    const IntSize&amp; fixedLayoutSize, const IntRect&amp; fixedVisibleContentRect ,
</del><ins>+    const IntSize&amp; fixedLayoutSize, const IntRect&amp; fixedVisibleContentRect,
</ins><span class="cx">     bool useFixedLayout, ScrollbarMode horizontalScrollbarMode, bool horizontalLock,
</span><span class="cx">     ScrollbarMode verticalScrollbarMode, bool verticalLock)
</span><span class="cx"> {
</span><span class="lines">@@ -726,7 +905,11 @@
</span><span class="cx">     if (isMainFrame) {
</span><span class="cx">         frameView = FrameView::create(*this, viewportSize);
</span><span class="cx">         frameView-&gt;setFixedLayoutSize(fixedLayoutSize);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         frameView-&gt;setFixedVisibleContentRect(fixedVisibleContentRect);
</span><ins>+#else
+        UNUSED_PARAM(fixedVisibleContentRect);
+#endif
</ins><span class="cx">         frameView-&gt;setUseFixedLayout(useFixedLayout);
</span><span class="cx">     } else
</span><span class="cx">         frameView = FrameView::create(*this);
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Frame.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Frame.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Frame.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -37,6 +37,11 @@
</span><span class="cx"> #include &quot;UserScriptTypes.h&quot;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;ViewportArguments.h&quot;
+#include &quot;VisibleSelection.h&quot;
+#endif
+
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> #include &quot;FrameWin.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -45,6 +50,13 @@
</span><span class="cx"> #include &quot;TiledBackingStoreClient.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+OBJC_CLASS DOMCSSStyleDeclaration;
+OBJC_CLASS DOMNode;
+OBJC_CLASS NSArray;
+OBJC_CLASS NSString;
+#endif
+
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> typedef struct HBITMAP__* HBITMAP;
</span><span class="cx"> #endif
</span><span class="lines">@@ -63,12 +75,14 @@
</span><span class="cx">     class FrameView;
</span><span class="cx">     class HTMLFrameOwnerElement;
</span><span class="cx">     class HTMLTableCellElement;
</span><ins>+    class HitTestResult;
</ins><span class="cx">     class ImageBuffer;
</span><span class="cx">     class IntRect;
</span><span class="cx">     class MainFrame;
</span><span class="cx">     class Node;
</span><span class="cx">     class Range;
</span><span class="cx">     class RegularExpression;
</span><ins>+    class RenderLayer;
</ins><span class="cx">     class RenderView;
</span><span class="cx">     class RenderWidget;
</span><span class="cx">     class ScriptController;
</span><span class="lines">@@ -77,6 +91,19 @@
</span><span class="cx">     class VisiblePosition;
</span><span class="cx">     class Widget;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    enum {
+        OverflowScrollNone = 0,
+        OverflowScrollLeft = 1 &lt;&lt; 0,
+        OverflowScrollRight = 1 &lt;&lt; 1,
+        OverflowScrollUp = 1 &lt;&lt; 2,
+        OverflowScrollDown = 1 &lt;&lt; 3
+    };
+
+    enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll };
+    typedef Node* (*NodeQualifier)(const HitTestResult&amp;, Node* terminationNode, IntRect* nodeBounds);
+#endif
+
</ins><span class="cx"> #if !USE(TILED_BACKING_STORE)
</span><span class="cx">     class TiledBackingStoreClient { };
</span><span class="cx"> #endif
</span><span class="lines">@@ -96,6 +123,10 @@
</span><span class="cx">         static PassRefPtr&lt;Frame&gt; create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
</span><span class="cx"> 
</span><span class="cx">         void init();
</span><ins>+#if PLATFORM(IOS)
+        // Creates &lt;html&gt;&lt;body style=&quot;...&quot;&gt;&lt;/body&gt;&lt;/html&gt; doing minimal amount of work.
+        void initWithSimpleHTMLDocument(const String&amp; style, const URL&amp;);
+#endif
</ins><span class="cx">         void setView(PassRefPtr&lt;FrameView&gt;);
</span><span class="cx">         void createView(const IntSize&amp;, const Color&amp;, bool,
</span><span class="cx">             const IntSize&amp; fixedLayoutSize = IntSize(), const IntRect&amp; fixedVisibleContentRect = IntRect(),
</span><span class="lines">@@ -165,6 +196,30 @@
</span><span class="cx">         void deviceOrPageScaleFactorChanged();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        const ViewportArguments&amp; viewportArguments() const;
+        void setViewportArguments(const ViewportArguments&amp;);
+
+        Node* deepestNodeAtLocation(const FloatPoint&amp; viewportLocation);
+        Node* nodeRespondingToClickEvents(const FloatPoint&amp; viewportLocation, FloatPoint&amp; adjustedViewportLocation);
+        Node* nodeRespondingToScrollWheelEvents(const FloatPoint&amp; viewportLocation);
+
+        int indexCountOfWordPrecedingSelection(NSString* word) const;
+        NSArray* wordsInCurrentParagraph() const;
+        CGRect renderRectForPoint(CGPoint, bool* isReplaced, float* fontSize) const;
+
+        void setSelectionChangeCallbacksDisabled(bool = true);
+        bool selectionChangeCallbacksDisabled() const;
+
+        enum ViewportOffsetChangeType { IncrementalScrollOffset, CompletedScrollOffset };
+        void viewportOffsetChanged(ViewportOffsetChangeType);
+        bool containsTiledBackingLayers() const;
+
+        void overflowScrollPositionChangedForNode(const IntPoint&amp;, Node*, bool isUserScroll);
+
+        void resetAllGeolocationPermission();
+#endif
+
</ins><span class="cx"> #if ENABLE(ORIENTATION_EVENTS)
</span><span class="cx">         // Orientation is the interface orientation in degrees. Some examples are:
</span><span class="cx">         //  0 is straight up; -90 is when the device is rotated 90 clockwise;
</span><span class="lines">@@ -191,6 +246,33 @@
</span><span class="cx">         float textAutosizingWidth() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        // Scroll the selection in an overflow layer on iOS.
+        void scrollOverflowLayer(RenderLayer* , const IntRect&amp; visibleRect, const IntRect&amp; exposeRect);
+
+        int preferredHeight() const;
+        int innerLineHeight(DOMNode*) const;
+        void updateLayout() const;
+        NSRect caretRect() const;
+        NSRect rectForScrollToVisible() const;
+        NSRect rectForSelection(VisibleSelection&amp;) const;
+        DOMCSSStyleDeclaration* styleAtSelectionStart() const;
+        unsigned formElementsCharacterCount() const;
+        void setTimersPaused(bool);
+        bool timersPaused() const { return m_timersPausedCount; }
+        void dispatchPageHideEventBeforePause();
+        void dispatchPageShowEventBeforeResume();
+        void setRangedSelectionBaseToCurrentSelection();
+        void setRangedSelectionBaseToCurrentSelectionStart();
+        void setRangedSelectionBaseToCurrentSelectionEnd();
+        void clearRangedSelectionInitialExtent();
+        void setRangedSelectionInitialExtentToCurrentSelectionStart();
+        void setRangedSelectionInitialExtentToCurrentSelectionEnd();
+        VisibleSelection rangedSelectionBase() const;
+        VisibleSelection rangedSelectionInitialExtent() const;
+        void recursiveSetUpdateAppearanceEnabled(bool);
+        NSArray* interpretationsForCurrentRoot() const;
+#endif
</ins><span class="cx">         void suspendActiveDOMObjectsAndAnimations();
</span><span class="cx">         void resumeActiveDOMObjectsAndAnimations();
</span><span class="cx">         bool activeDOMObjectsAndAnimationsSuspended() const { return m_activeDOMObjectsAndAnimationsSuspendedCount &gt; 0; }
</span><span class="lines">@@ -224,6 +306,27 @@
</span><span class="cx">         const OwnPtr&lt;EventHandler&gt; m_eventHandler;
</span><span class="cx">         const std::unique_ptr&lt;AnimationController&gt; m_animationController;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        void betterApproximateNode(const IntPoint&amp; testPoint, NodeQualifier, Node*&amp; best, Node* failedNode, IntPoint&amp; bestPoint, IntRect&amp; bestRect, const IntRect&amp; testRect);
+        bool hitTestResultAtViewportLocation(const FloatPoint&amp; viewportLocation, HitTestResult&amp;, IntPoint&amp; center);
+        Node* qualifyingNodeAtViewportLocation(const FloatPoint&amp; viewportLocation, FloatPoint&amp; adjustedViewportLocation, NodeQualifier, bool shouldApproximate);
+
+        void overflowAutoScrollTimerFired(Timer&lt;Frame&gt;*);
+        void startOverflowAutoScroll(const IntPoint&amp;);
+        int checkOverflowScroll(OverflowScrollAction);
+
+        void setTimersPausedInternal(bool);
+
+        Timer&lt;Frame&gt; m_overflowAutoScrollTimer;
+        float m_overflowAutoScrollDelta;
+        IntPoint m_overflowAutoScrollPos;
+        ViewportArguments m_viewportArguments;
+        bool m_selectionChangeCallbacksDisabled;
+        int m_timersPausedCount;
+        VisibleSelection m_rangedSelectionBase;
+        VisibleSelection m_rangedSelectionInitialExtent;
+#endif
+
</ins><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx">         float m_textAutosizingWidth;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/FrameView.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx"> #include &quot;RenderScrollbar.h&quot;
</span><span class="cx"> #include &quot;RenderScrollbarPart.h&quot;
</span><span class="cx"> #include &quot;RenderStyle.h&quot;
</span><ins>+#include &quot;RenderText.h&quot;
</ins><span class="cx"> #include &quot;RenderTheme.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="cx"> #include &quot;RenderWidget.h&quot;
</span><span class="lines">@@ -98,6 +99,19 @@
</span><span class="cx"> #include &quot;TextAutosizer.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;DocumentLoader.h&quot;
+#include &quot;Logging.h&quot;
+#include &quot;MemoryCache.h&quot;
+#include &quot;MemoryPressureHandler.h&quot;
+#include &quot;SystemMemory.h&quot;
+#include &quot;TileCache.h&quot;
+#endif
+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include &quot;HTMLMediaElement.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="lines">@@ -190,6 +204,9 @@
</span><span class="cx">     , m_deferSetNeedsLayouts(0)
</span><span class="cx">     , m_setNeedsLayoutWasDeferred(false)
</span><span class="cx">     , m_scrollCorner(0)
</span><ins>+#if PLATFORM(IOS)
+    , m_useCustomFixedPositionLayoutRect(false)
+#endif
</ins><span class="cx">     , m_shouldAutoSize(false)
</span><span class="cx">     , m_inAutoSize(false)
</span><span class="cx">     , m_didRunAutosize(false)
</span><span class="lines">@@ -392,6 +409,13 @@
</span><span class="cx">     reset();
</span><span class="cx"> 
</span><span class="cx">     setScrollbarsSuppressed(true);
</span><ins>+
+#if PLATFORM(IOS)
+    // To avoid flashes of white, disable tile updates immediately when view is cleared at the beginning of a page load.
+    // Tiling will be re-enabled from UIKit via [WAKWindow setTilingMode:] when we have content to draw.
+    if (TileCache* tileCache = this-&gt;tileCache())
+        tileCache-&gt;setTilingMode(TileCache::Disabled);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FrameView::didFirstLayout() const
</span><span class="lines">@@ -883,6 +907,11 @@
</span><span class="cx">     // visible flash to occur. Instead, stop the deferred repaint timer and repaint immediately.
</span><span class="cx">     flushDeferredRepaints();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if (TileCache* tileCache = this-&gt;tileCache())
+        tileCache-&gt;doPendingRepaints();
+#endif
+
</ins><span class="cx">     renderView-&gt;compositor().flushPendingLayerChanges(rootFrameForFlush == &amp;frame());
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="lines">@@ -894,6 +923,39 @@
</span><span class="cx">         page-&gt;chrome().client().setNeedsOneShotDrawingSynchronization();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+GraphicsLayer* FrameView::graphicsLayerForPlatformWidget(PlatformWidget platformWidget)
+{
+    // To find the Widget that corresponds with platformWidget we have to do a linear
+    // search of our child widgets.
+    Widget* foundWidget = nullptr;
+    for (auto&amp; widget : children()) {
+        if (widget-&gt;platformWidget() != platformWidget)
+            continue;
+        foundWidget = widget.get();
+        break;
+    }
+
+    if (!foundWidget)
+        return nullptr;
+
+    auto* renderWidget = RenderWidget::find(foundWidget);
+    if (!renderWidget)
+        return nullptr;
+
+    RenderLayer* widgetLayer = renderWidget-&gt;layer();
+    if (!widgetLayer || !widgetLayer-&gt;isComposited())
+        return nullptr;
+
+    return widgetLayer-&gt;backing()-&gt;parentForSublayers();
+}
+
+void FrameView::scheduleLayerFlushAllowingThrottling()
+{
+    RenderView* view = this-&gt;renderView();
+    if (!view)
+        return;
+    view-&gt;compositor().scheduleLayerFlush(true /* canThrottle */);
+}
</ins><span class="cx"> #endif // USE(ACCELERATED_COMPOSITING)
</span><span class="cx"> 
</span><span class="cx"> void FrameView::setHeaderHeight(int headerHeight)
</span><span class="lines">@@ -1082,6 +1144,11 @@
</span><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if (updateFixedPositionLayoutRect())
+        allowSubtree = false;
+#endif
+
</ins><span class="cx">     m_layoutTimer.stop();
</span><span class="cx">     m_delayedLayout = false;
</span><span class="cx">     m_setNeedsLayoutWasDeferred = false;
</span><span class="lines">@@ -1198,7 +1265,11 @@
</span><span class="cx">                     if (useFixedLayout() &amp;&amp; !fixedLayoutSize().isEmpty() &amp;&amp; delegatesScrolling())
</span><span class="cx">                         m_lastViewportSize = fixedLayoutSize();
</span><span class="cx">                     else
</span><ins>+#if PLATFORM(IOS)
+                        m_lastViewportSize = actualVisibleContentRect().size();
+#else
</ins><span class="cx">                         m_lastViewportSize = visibleContentRect(IncludeScrollbars).size();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">                     m_lastZoomFactor = root-&gt;style().zoom();
</span><span class="cx"> 
</span><span class="lines">@@ -1313,6 +1384,10 @@
</span><span class="cx">     updateAnnotatedRegions();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+    document.dirtyTouchEventRects();
+#endif
+
</ins><span class="cx">     ASSERT(!root-&gt;needsLayout());
</span><span class="cx"> 
</span><span class="cx">     updateCanBlitOnScrollRecursively();
</span><span class="lines">@@ -1902,6 +1977,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> void FrameView::setFixedVisibleContentRect(const IntRect&amp; visibleContentRect)
</span><span class="cx"> {
</span><span class="cx">     bool visibleContentSizeDidChange = false;
</span><span class="lines">@@ -1927,6 +2003,7 @@
</span><span class="cx">     }
</span><span class="cx">     frame().loader().client().didChangeScrollOffset();
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> void FrameView::setViewportConstrainedObjectsNeedLayout()
</span><span class="cx"> {
</span><span class="lines">@@ -2120,6 +2197,27 @@
</span><span class="cx">     ScrollView::repaintContentRectangle(r, immediate);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static unsigned countRenderedCharactersInRenderObjectWithThreshold(const RenderObject&amp; renderer, unsigned countSoFar, unsigned threshold)
+{
+    // FIXME: Consider writing this using RenderObject::nextInPreOrder() instead of using recursion.
+    if (renderer.isText())
+        countSoFar += toRenderText(renderer).text()-&gt;length();
+
+    for (RenderObject* child = renderer.firstChildSlow(); child; child = child-&gt;nextSibling()) {
+        if (countSoFar &gt;= threshold)
+            break;
+        countSoFar = countRenderedCharactersInRenderObjectWithThreshold(*child, countSoFar, threshold);
+    }
+    return countSoFar;
+}
+
+bool FrameView::renderedCharactersExceed(unsigned threshold)
+{
+    if (!m_frame-&gt;contentRenderer())
+        return false;
+    return countRenderedCharactersInRenderObjectWithThreshold(*m_frame-&gt;contentRenderer(), 0, threshold) &gt;= threshold;
+}
+
</ins><span class="cx"> void FrameView::contentsResized()
</span><span class="cx"> {
</span><span class="cx">     ScrollView::contentsResized();
</span><span class="lines">@@ -2144,6 +2242,18 @@
</span><span class="cx">     if (!frame().view())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if (RenderView* root = m_frame-&gt;contentRenderer()) {
+        if (useCustomFixedPositionLayoutRect() &amp;&amp; hasViewportConstrainedObjects()) {
+            setViewportConstrainedObjectsNeedLayout();
+            // We must eagerly enter compositing mode because fixed position elements
+            // will not have been made compositing via a preceding style change before
+            // m_useCustomFixedPositionLayoutRect was true.
+            root-&gt;compositor().enableCompositingMode();
+        }
+    }
+#endif
+
</ins><span class="cx">     if (!useFixedLayout() &amp;&amp; needsLayout())
</span><span class="cx">         layout();
</span><span class="cx"> 
</span><span class="lines">@@ -2320,6 +2430,10 @@
</span><span class="cx">     if (renderView &amp;&amp; renderView-&gt;layer()-&gt;backing())
</span><span class="cx">         renderView-&gt;layer()-&gt;backing()-&gt;adjustTiledBackingCoverage();
</span><span class="cx"> #endif
</span><ins>+#if PLATFORM(IOS)
+    if (TileCache* tileCache = this-&gt;tileCache())
+        tileCache-&gt;setSpeculativeTileCreationEnabled(!m_frame-&gt;page()-&gt;progress().isMainLoadProgressing());
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FrameView::layoutTimerFired(Timer&lt;FrameView&gt;*)
</span><span class="lines">@@ -2681,6 +2795,14 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // Only send layout-related delegate callbacks synchronously for the main frame to
+    // avoid re-entering layout for the main frame while delivering a layout-related delegate
+    // callback for a subframe.
+    if (frame().isMainFrame())
+        page-&gt;chrome().client().didLayout();
+#endif
+
</ins><span class="cx">     if (milestonesAchieved &amp;&amp; frame().isMainFrame())
</span><span class="cx">         frame().loader().didLayout(milestonesAchieved);
</span><span class="cx"> 
</span><span class="lines">@@ -2733,7 +2855,11 @@
</span><span class="cx">     if (useFixedLayout() &amp;&amp; !fixedLayoutSize().isEmpty() &amp;&amp; delegatesScrolling())
</span><span class="cx">         currentSize = fixedLayoutSize();
</span><span class="cx">     else
</span><ins>+#if PLATFORM(IOS)
+        currentSize = actualVisibleContentRect().size();
+#else
</ins><span class="cx">         currentSize = visibleContentRect(IncludeScrollbars).size();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     float currentZoomFactor = renderView-&gt;style().zoom();
</span><span class="cx">     bool shouldSendResizeEvent = !m_firstLayout &amp;&amp; (currentSize != m_lastViewportSize || currentZoomFactor != m_lastZoomFactor);
</span><span class="lines">@@ -2744,6 +2870,16 @@
</span><span class="cx">     if (!shouldSendResizeEvent)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // Don't send the resize event if the document is loading. Some pages automatically reload
+    // when the window is resized; Safari on iOS often resizes the window while setting up its
+    // viewport. This obviously can cause problems.
+    if (DocumentLoader* documentLoader = frame().loader().documentLoader()) {
+        if (documentLoader-&gt;isLoadingInAPISense())
+            return;
+    }
+#endif
+
</ins><span class="cx">     bool isMainFrame = frame().isMainFrame();
</span><span class="cx">     bool canSendResizeEventSynchronously = isMainFrame &amp;&amp; !isInLayout();
</span><span class="cx"> 
</span><span class="lines">@@ -3423,6 +3559,16 @@
</span><span class="cx">         InspectorInstrumentation::willPaint(renderView);
</span><span class="cx"> 
</span><span class="cx">     bool isTopLevelPainter = !sCurrentPaintTimeStamp;
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Remove PLATFORM(IOS)-guard once we upstream the iOS changes to MemoryPressureHandler.h.
+    if (isTopLevelPainter &amp;&amp; memoryPressureHandler().hasReceivedMemoryPressure()) {
+        LOG(MemoryPressure, &quot;Under memory pressure: %s&quot;, __PRETTY_FUNCTION__);
+
+        // To avoid unnecessary image decoding, we don't prune recently-decoded live resources here since
+        // we might need some live bitmaps on painting.
+        memoryCache()-&gt;prune();
+    }
+#endif
</ins><span class="cx">     if (isTopLevelPainter)
</span><span class="cx">         sCurrentPaintTimeStamp = monotonicallyIncreasingTime();
</span><span class="cx"> 
</span><span class="lines">@@ -3475,6 +3621,14 @@
</span><span class="cx">     m_paintBehavior = oldPaintBehavior;
</span><span class="cx">     m_lastPaintTime = monotonicallyIncreasingTime();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // Painting can lead to decoding of large amounts of bitmaps
+    // If we are low on memory, wipe them out after the paint.
+    // FIXME: Remove PLATFORM(IOS)-guard once we upstream the iOS changes to MemoryPressureHandler.h.
+    if (isTopLevelPainter &amp;&amp; memoryPressureHandler().hasReceivedMemoryPressure())
+        memoryCache()-&gt;pruneLiveResources(true);
+#endif
+
</ins><span class="cx">     // Regions may have changed as a result of the visibility/z-index of element changing.
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
</span><span class="cx">     if (document-&gt;annotatedRegionsDirty())
</span><span class="lines">@@ -4049,6 +4203,43 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx">     
</span><ins>+#if PLATFORM(IOS)
+void FrameView::setUseCustomFixedPositionLayoutRect(bool useCustomFixedPositionLayoutRect)
+{
+    if (m_useCustomFixedPositionLayoutRect == useCustomFixedPositionLayoutRect)
+        return;
+    m_useCustomFixedPositionLayoutRect = useCustomFixedPositionLayoutRect;
+    visibleContentsResized();
+}
+
+void FrameView::setCustomFixedPositionLayoutRect(const IntRect&amp; rect)
+{
+    if (m_useCustomFixedPositionLayoutRect &amp;&amp; m_customFixedPositionLayoutRect == rect)
+        return;
+    m_useCustomFixedPositionLayoutRect = true;
+    m_customFixedPositionLayoutRect = rect;
+    visibleContentsResized();
+}
+
+bool FrameView::updateFixedPositionLayoutRect()
+{
+    if (!m_useCustomFixedPositionLayoutRect)
+        return false;
+
+    IntRect newRect;
+    Page* page = frame().page();
+    if (!page || !page-&gt;chrome().client().fetchCustomFixedPositionLayoutRect(newRect))
+        return false;
+
+    if (newRect != m_customFixedPositionLayoutRect) {
+        m_customFixedPositionLayoutRect = newRect;
+        setViewportConstrainedObjectsNeedLayout();
+        return true;
+    }
+    return false;
+}
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> void FrameView::setScrollingPerformanceLoggingEnabled(bool flag)
</span><span class="cx"> {
</span><span class="cx"> #if USE(ACCELERATED_COMPOSITING)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/FrameView.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -120,6 +120,16 @@
</span><span class="cx"> 
</span><span class="cx">     bool needsFullRepaint() const { return m_needsFullRepaint; }
</span><span class="cx"> 
</span><ins>+    bool renderedCharactersExceed(unsigned threshold);
+
+#if PLATFORM(IOS)
+    bool useCustomFixedPositionLayoutRect() const { return m_useCustomFixedPositionLayoutRect; }
+    void setUseCustomFixedPositionLayoutRect(bool);
+    IntRect customFixedPositionLayoutRect() const { return m_customFixedPositionLayoutRect; }
+    void setCustomFixedPositionLayoutRect(const IntRect&amp;);
+    bool updateFixedPositionLayoutRect();
+#endif
+
</ins><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><span class="cx">     void serviceScriptedAnimations(double monotonicAnimationStartTime);
</span><span class="cx"> #endif
</span><span class="lines">@@ -136,6 +146,9 @@
</span><span class="cx">     // content rendered via the normal painting path.
</span><span class="cx">     void setNeedsOneShotDrawingSynchronization();
</span><span class="cx"> 
</span><ins>+    GraphicsLayer* graphicsLayerForPlatformWidget(PlatformWidget);
+    void scheduleLayerFlushAllowingThrottling();
+
</ins><span class="cx">     virtual TiledBacking* tiledBacking() OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     // In the future when any ScrollableArea can have a node in th ScrollingTree, this should
</span><span class="lines">@@ -192,7 +205,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual float visibleContentScaleFactor() const OVERRIDE;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     virtual void setFixedVisibleContentRect(const IntRect&amp;) OVERRIDE;
</span><ins>+#endif
</ins><span class="cx">     virtual void setScrollPosition(const IntPoint&amp;) OVERRIDE;
</span><span class="cx">     void scrollPositionChangedViaPlatformWidget();
</span><span class="cx">     virtual void updateLayerPositionsAfterScrolling() OVERRIDE;
</span><span class="lines">@@ -631,6 +646,11 @@
</span><span class="cx">     // Renderer to hold our custom scroll corner.
</span><span class="cx">     RenderScrollbarPart* m_scrollCorner;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    bool m_useCustomFixedPositionLayoutRect;
+    IntRect m_customFixedPositionLayoutRect;
+#endif
+
</ins><span class="cx">     // If true, automatically resize the frame view around its content.
</span><span class="cx">     bool m_shouldAutoSize;
</span><span class="cx">     bool m_inAutoSize;
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Navigator.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Navigator.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Navigator.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -132,6 +132,13 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool Navigator::standalone() const
+{
+    return m_frame &amp;&amp; m_frame-&gt;settings().standalone();
+}
+#endif
+
</ins><span class="cx"> void Navigator::getStorageUpdates()
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Remove this method or rename to yieldForStorageUpdates.
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Navigator.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Navigator.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Navigator.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -53,6 +53,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual String userAgent() const;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    bool standalone() const;
+#endif
+
</ins><span class="cx">     // Relinquishes the storage lock, if one exists.
</span><span class="cx">     void getStorageUpdates();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Navigator.idl (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Navigator.idl        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Navigator.idl        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -37,6 +37,11 @@
</span><span class="cx"> 
</span><span class="cx">     readonly attribute boolean onLine;
</span><span class="cx"> 
</span><ins>+    // FIXME: Convert this #if'def to an IDL conditional attribute.
+#if defined(WTF_PLATFORM_IOS) &amp;&amp; WTF_PLATFORM_IOS
+    readonly attribute boolean standalone;
+#endif
+
</ins><span class="cx">     void getStorageUpdates(); // FIXME: Remove this method or rename to yieldForStorageUpdates.
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatorBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/NavigatorBase.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/NavigatorBase.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/NavigatorBase.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -35,8 +35,14 @@
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreSystemInterface.h&quot;
+#endif
+
</ins><span class="cx"> #ifndef WEBCORE_NAVIGATOR_PLATFORM
</span><del>-#if OS(MAC_OS_X) &amp;&amp; (CPU(PPC) || CPU(PPC64))
</del><ins>+#if PLATFORM(IOS)
+#define WEBCORE_NAVIGATOR_PLATFORM &quot;&quot;
+#elif OS(MAC_OS_X) &amp;&amp; (CPU(PPC) || CPU(PPC64))
</ins><span class="cx"> #define WEBCORE_NAVIGATOR_PLATFORM &quot;MacPPC&quot;
</span><span class="cx"> #elif OS(MAC_OS_X) &amp;&amp; (CPU(X86) || CPU(X86_64))
</span><span class="cx"> #define WEBCORE_NAVIGATOR_PLATFORM &quot;MacIntel&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Page.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -48,6 +48,10 @@
</span><span class="cx"> #include &lt;wtf/SchedulePair.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;Settings.h&quot;
+#endif
+
</ins><span class="cx"> namespace JSC {
</span><span class="cx"> class Debugger;
</span><span class="cx"> }
</span><span class="lines">@@ -321,9 +325,16 @@
</span><span class="cx">     StorageNamespace* sessionStorage(bool optionalCreate = true);
</span><span class="cx">     void setSessionStorage(PassRefPtr&lt;StorageNamespace&gt;);
</span><span class="cx"> 
</span><ins>+    // FIXME: We should make Settings::maxParseDuration() platform-independent, remove {has, set}CustomHTMLTokenizerTimeDelay()
+    // and customHTMLTokenizerTimeDelay() and modify theirs callers to update or query Settings::maxParseDuration().
</ins><span class="cx">     void setCustomHTMLTokenizerTimeDelay(double);
</span><ins>+#if PLATFORM(IOS)
+    bool hasCustomHTMLTokenizerTimeDelay() const { return m_settings-&gt;maxParseDuration() != -1; }
+    double customHTMLTokenizerTimeDelay() const { ASSERT(m_settings-&gt;maxParseDuration() != -1); return m_settings-&gt;maxParseDuration(); }
+#else
</ins><span class="cx">     bool hasCustomHTMLTokenizerTimeDelay() const { return m_customHTMLTokenizerTimeDelay != -1; }
</span><span class="cx">     double customHTMLTokenizerTimeDelay() const { ASSERT(m_customHTMLTokenizerTimeDelay != -1); return m_customHTMLTokenizerTimeDelay; }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     void setCustomHTMLTokenizerChunkSize(int);
</span><span class="cx">     bool hasCustomHTMLTokenizerChunkSize() const { return m_customHTMLTokenizerChunkSize != -1; }
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageGroup.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageGroup.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/PageGroup.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -217,6 +217,16 @@
</span><span class="cx">     addVisitedLink(visitedLinkHash(characters, length));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageGroup::removeVisitedLink(const URL&amp; url)
+{
+    LinkHash hash = visitedLinkHash(url.string());
+    ASSERT(m_visitedLinkHashes.contains(hash));
+    m_visitedLinkHashes.remove(hash);
+
+    Page::allVisitedStateChanged(this);
+    pageCache()-&gt;markPagesForVistedLinkStyleRecalc();
+}
+
</ins><span class="cx"> void PageGroup::removeVisitedLinks()
</span><span class="cx"> {
</span><span class="cx">     m_visitedLinksPopulated = false;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageGrouph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageGroup.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageGroup.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/PageGroup.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx">         void addVisitedLink(const URL&amp;);
</span><span class="cx">         void addVisitedLink(const UChar*, size_t);
</span><span class="cx">         void addVisitedLinkHash(LinkHash);
</span><ins>+        void removeVisitedLink(const URL&amp;);
</ins><span class="cx">         void removeVisitedLinks();
</span><span class="cx"> 
</span><span class="cx">         static void setShouldTrackVisitedLinks(bool);
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Settings.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AudioSession.h&quot;
</ins><span class="cx"> #include &quot;BackForwardController.h&quot;
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> #include &quot;CookieStorage.h&quot;
</span><span class="lines">@@ -45,7 +46,9 @@
</span><span class="cx"> #include &quot;StorageMap.h&quot;
</span><span class="cx"> #include &quot;TextAutosizer.h&quot;
</span><span class="cx"> #include &lt;limits&gt;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static void setImageLoadingSettings(Page* page)
</span><span class="lines">@@ -93,6 +96,10 @@
</span><span class="cx"> bool Settings::gShouldRespectPriorityInCSSAttributeSetters = false;
</span><span class="cx"> bool Settings::gLowPowerVideoAudioBufferSizeEnabled = false;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool Settings::gNetworkDataUsageTrackingEnabled = false;
+#endif
+
</ins><span class="cx"> // NOTEs
</span><span class="cx"> //  1) EditingMacBehavior comprises Tiger, Leopard, SnowLeopard and iOS builds, as well as QtWebKit when built on Mac;
</span><span class="cx"> //  2) EditingWindowsBehavior comprises Win32 and WinCE builds, as well as QtWebKit and Chromium when built on Windows;
</span><span class="lines">@@ -146,6 +153,9 @@
</span><span class="cx">     , m_fontGenericFamilies(std::make_unique&lt;FontGenericFamilies&gt;())
</span><span class="cx">     , m_storageBlockingPolicy(SecurityOrigin::AllowAllStorage)
</span><span class="cx">     , m_layoutInterval(layoutScheduleThreshold)
</span><ins>+#if PLATFORM(IOS)
+    , m_maxParseDuration(-1)
+#endif
</ins><span class="cx"> #if ENABLE(TEXT_AUTOSIZING)
</span><span class="cx">     , m_textAutosizingFontScaleFactor(1)
</span><span class="cx"> #if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP
</span><span class="lines">@@ -168,6 +178,15 @@
</span><span class="cx">     , m_usesPageCache(false)
</span><span class="cx">     , m_fontRenderingMode(0)
</span><span class="cx">     , m_isCSSCustomFilterEnabled(false)
</span><ins>+#if PLATFORM(IOS)
+    , m_standalone(false)
+    , m_telephoneNumberParsingEnabled(false)
+    , m_mediaDataLoadsAutomatically(false)
+    , m_shouldTransformsAffectOverflow(true)
+    , m_shouldDispatchJavaScriptWindowOnErrorEvents(false)
+    , m_alwaysUseBaselineOfPrimaryFont(false)
+    , m_alwaysUseAcceleratedOverflowScroll(false)
+#endif
</ins><span class="cx"> #if ENABLE(CSS_STICKY_POSITION)
</span><span class="cx">     , m_cssStickyPositionEnabled(true)
</span><span class="cx"> #endif
</span><span class="lines">@@ -382,7 +401,15 @@
</span><span class="cx"> 
</span><span class="cx"> void Settings::setScriptEnabled(bool isScriptEnabled)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (m_isScriptEnabled == isScriptEnabled)
+        return;
+#endif
+
</ins><span class="cx">     m_isScriptEnabled = isScriptEnabled;
</span><ins>+#if PLATFORM(IOS)
+    m_page-&gt;setNeedsRecalcStyleInAllFrames();
+#endif
</ins><span class="cx">     InspectorInstrumentation::scriptsEnabled(m_page, m_isScriptEnabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -681,4 +708,47 @@
</span><span class="cx">     gLowPowerVideoAudioBufferSizeEnabled = flag;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void Settings::setStandalone(bool standalone)
+{
+    m_standalone = standalone;
+}
+
+void Settings::setAudioSessionCategoryOverride(unsigned sessionCategory)
+{
+    AudioSession::sharedSession().setCategoryOverride(static_cast&lt;AudioSession::CategoryType&gt;(sessionCategory));
+}
+
+unsigned Settings::audioSessionCategoryOverride()
+{
+    return AudioSession::sharedSession().categoryOverride();
+}
+
+void Settings::setNetworkDataUsageTrackingEnabled(bool trackingEnabled)
+{
+    gNetworkDataUsageTrackingEnabled = trackingEnabled;
+}
+
+bool Settings::networkDataUsageTrackingEnabled()
+{
+    return gNetworkDataUsageTrackingEnabled;
+}
+
+static String&amp; sharedNetworkInterfaceNameGlobal()
+{
+    static NeverDestroyed&lt;String&gt; networkInterfaceName;
+    return networkInterfaceName;
+}
+
+void Settings::setNetworkInterfaceName(const String&amp; networkInterfaceName)
+{
+    sharedNetworkInterfaceNameGlobal() = networkInterfaceName;
+}
+
+const String&amp; Settings::networkInterfaceName()
+{
+    return sharedNetworkInterfaceNameGlobal();
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Settings.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -180,6 +180,33 @@
</span><span class="cx">     void setHiddenPageDOMTimerThrottlingEnabled(bool);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: This setting isn't specific to iOS.
+    void setMaxParseDuration(double maxParseDuration) { m_maxParseDuration = maxParseDuration; }
+    double maxParseDuration() const { return m_maxParseDuration; }
+
+    void setStandalone(bool);
+    bool standalone() const { return m_standalone; }
+
+    void setTelephoneNumberParsingEnabled(bool flag) { m_telephoneNumberParsingEnabled = flag; }
+    bool telephoneNumberParsingEnabled() const { return m_telephoneNumberParsingEnabled; }
+
+    void setMediaDataLoadsAutomatically(bool flag) { m_mediaDataLoadsAutomatically = flag; }
+    bool mediaDataLoadsAutomatically() const { return m_mediaDataLoadsAutomatically; }
+
+    void setShouldTransformsAffectOverflow(bool flag) { m_shouldTransformsAffectOverflow = flag; }
+    bool shouldTransformsAffectOverflow() const { return m_shouldTransformsAffectOverflow; }
+
+    void setShouldDispatchJavaScriptWindowOnErrorEvents(bool flag) { m_shouldDispatchJavaScriptWindowOnErrorEvents = flag; }
+    bool shouldDispatchJavaScriptWindowOnErrorEvents() const { return m_shouldDispatchJavaScriptWindowOnErrorEvents; }
+
+    void setAlwaysUseBaselineOfPrimaryFont(bool flag) { m_alwaysUseBaselineOfPrimaryFont = flag; }
+    bool alwaysUseBaselineOfPrimaryFont() const { return m_alwaysUseBaselineOfPrimaryFont; }
+
+    void setAlwaysUseAcceleratedOverflowScroll(bool flag) { m_alwaysUseAcceleratedOverflowScroll = flag; }
+    bool alwaysUseAcceleratedOverflowScroll() const { return m_alwaysUseAcceleratedOverflowScroll; }
+#endif
+
</ins><span class="cx">     void setUsesPageCache(bool);
</span><span class="cx">     bool usesPageCache() const { return m_usesPageCache; }
</span><span class="cx">         
</span><span class="lines">@@ -268,6 +295,17 @@
</span><span class="cx">     static bool isVideoPluginProxyEnabled() { return gVideoPluginProxyEnabled; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    static void setAudioSessionCategoryOverride(unsigned);
+    static unsigned audioSessionCategoryOverride();
+
+    static void setNetworkDataUsageTrackingEnabled(bool);
+    static bool networkDataUsageTrackingEnabled();
+
+    static void setNetworkInterfaceName(const String&amp;);
+    static const String&amp; networkInterfaceName();
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit Settings(Page*);
</span><span class="cx"> 
</span><span class="lines">@@ -281,6 +319,9 @@
</span><span class="cx">     const std::unique_ptr&lt;FontGenericFamilies&gt; m_fontGenericFamilies;
</span><span class="cx">     SecurityOrigin::StorageBlockingPolicy m_storageBlockingPolicy;
</span><span class="cx">     int m_layoutInterval;
</span><ins>+#if PLATFORM(IOS)
+    double m_maxParseDuration;
+#endif
</ins><span class="cx"> #if ENABLE(TEXT_AUTOSIZING)
</span><span class="cx">     float m_textAutosizingFontScaleFactor;
</span><span class="cx">     IntSize m_textAutosizingWindowSizeOverride;
</span><span class="lines">@@ -301,6 +342,16 @@
</span><span class="cx">     bool m_usesPageCache : 1;
</span><span class="cx">     unsigned m_fontRenderingMode : 1;
</span><span class="cx">     bool m_isCSSCustomFilterEnabled : 1;
</span><ins>+#if PLATFORM(IOS)
+    bool m_standalone : 1;
+    bool m_telephoneNumberParsingEnabled : 1;
+    bool m_mediaDataLoadsAutomatically : 1;
+    bool m_shouldTransformsAffectOverflow : 1;
+    bool m_shouldDispatchJavaScriptWindowOnErrorEvents : 1;
+    bool m_alwaysUseBaselineOfPrimaryFont : 1;
+    bool m_allowMultiElementImplicitFormSubmission : 1;
+    bool m_alwaysUseAcceleratedOverflowScroll : 1;
+#endif
</ins><span class="cx"> #if ENABLE(CSS_STICKY_POSITION)
</span><span class="cx">     bool m_cssStickyPositionEnabled : 1;
</span><span class="cx"> #endif
</span><span class="lines">@@ -348,6 +399,9 @@
</span><span class="cx">     static bool gShouldUseHighResolutionTimers;
</span><span class="cx"> #endif
</span><span class="cx">     static bool gShouldRespectPriorityInCSSAttributeSetters;
</span><ins>+#if PLATFORM(IOS)
+    static bool gNetworkDataUsageTrackingEnabled;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     static double gHiddenPageDOMTimerAlignmentInterval;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/Settings.in        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -217,3 +217,5 @@
</span><span class="cx"> 
</span><span class="cx"> # FIXME: Rename to allowMultiElementImplicitFormSubmission once we upstream the iOS changes to WebView.mm.
</span><span class="cx"> allowMultiElementImplicitSubmission initial=false
</span><ins>+
+mediaPlaybackAllowsAirPlay initial=true, conditional=IOS_AIRPLAY
</ins></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSPropertyAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -1212,8 +1212,16 @@
</span><span class="cx">         new LengthPropertyWrapper&lt;Length&gt;(CSSPropertyLineHeight, &amp;RenderStyle::specifiedLineHeight, &amp;RenderStyle::setLineHeight),
</span><span class="cx">         new PropertyWrapper&lt;int&gt;(CSSPropertyOutlineOffset, &amp;RenderStyle::outlineOffset, &amp;RenderStyle::setOutlineOffset),
</span><span class="cx">         new PropertyWrapper&lt;unsigned short&gt;(CSSPropertyOutlineWidth, &amp;RenderStyle::outlineWidth, &amp;RenderStyle::setOutlineWidth),
</span><ins>+
+        // FIXME: We should reconcile the difference in datatype between iOS and OpenSource. On iOS we want these properties to
+        // be float for sub-pixel kerning. See &lt;rdar://problem/5020763&gt;.
+#if !PLATFORM(IOS)
</ins><span class="cx">         new PropertyWrapper&lt;int&gt;(CSSPropertyLetterSpacing, &amp;RenderStyle::letterSpacing, &amp;RenderStyle::setLetterSpacing),
</span><span class="cx">         new PropertyWrapper&lt;int&gt;(CSSPropertyWordSpacing, &amp;RenderStyle::wordSpacing, &amp;RenderStyle::setWordSpacing),
</span><ins>+#else
+        new PropertyWrapper&lt;float&gt;(CSSPropertyLetterSpacing, &amp;RenderStyle::letterSpacing, &amp;RenderStyle::setLetterSpacing),
+        new PropertyWrapper&lt;float&gt;(CSSPropertyWordSpacing, &amp;RenderStyle::wordSpacing, &amp;RenderStyle::setWordSpacing),
+#endif
</ins><span class="cx">         new LengthPropertyWrapper&lt;Length&gt;(CSSPropertyTextIndent, &amp;RenderStyle::textIndent, &amp;RenderStyle::setTextIndent),
</span><span class="cx"> 
</span><span class="cx">         new PropertyWrapper&lt;float&gt;(CSSPropertyWebkitPerspective, &amp;RenderStyle::perspective, &amp;RenderStyle::setPerspective),
</span></span></pre></div>
<a id="trunkSourceWebCorepageiosEventHandlerIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/ios/EventHandlerIOS.mm (0 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ios/EventHandlerIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/page/ios/EventHandlerIOS.mm        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -0,0 +1,503 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;EventHandler.h&quot;
+
+#import &quot;AXObjectCache.h&quot;
+#import &quot;BlockExceptions.h&quot;
+#import &quot;Chrome.h&quot;
+#import &quot;ChromeClient.h&quot;
+#import &quot;FocusController.h&quot;
+#import &quot;Frame.h&quot;
+#import &quot;FrameView.h&quot;
+#import &quot;KeyboardEvent.h&quot;
+#import &quot;MouseEventWithHitTestResults.h&quot;
+#import &quot;Page.h&quot;
+#import &quot;PlatformEventFactoryIOS.h&quot;
+#import &quot;PlatformKeyboardEvent.h&quot;
+#import &quot;RenderWidget.h&quot;
+#import &quot;WAKView.h&quot;
+#import &quot;WAKWindow.h&quot;
+#import &quot;WebEvent.h&quot;
+#import &lt;wtf/NeverDestroyed.h&gt;
+#import &lt;wtf/Noncopyable.h&gt;
+
+#if ENABLE(IOS_TOUCH_EVENTS)
+#import &lt;WebKitAdditions/EventHandlerIOSTouch.cpp&gt;
+#endif
+
+namespace WebCore {
+
+static RetainPtr&lt;WebEvent&gt;&amp; currentEventSlot()
+{
+    NeverDestroyed&lt;RetainPtr&lt;WebEvent&gt;&gt; event;
+    return event;
+}
+
+WebEvent *EventHandler::currentEvent()
+{
+    return currentEventSlot().get();
+}
+
+class CurrentEventScope {
+    WTF_MAKE_NONCOPYABLE(CurrentEventScope);
+public:
+    CurrentEventScope(WebEvent *);
+    ~CurrentEventScope();
+
+private:
+    RetainPtr&lt;WebEvent&gt; m_savedCurrentEvent;
+#ifndef NDEBUG
+    RetainPtr&lt;WebEvent&gt; m_event;
+#endif
+};
+
+inline CurrentEventScope::CurrentEventScope(WebEvent *event)
+    : m_savedCurrentEvent(currentEventSlot())
+#ifndef NDEBUG
+    , m_event(event)
+#endif
+{
+    currentEventSlot() = event;
+}
+
+inline CurrentEventScope::~CurrentEventScope()
+{
+    ASSERT(currentEventSlot() == m_event);
+    currentEventSlot() = m_savedCurrentEvent;
+}
+
+bool EventHandler::wheelEvent(WebEvent *event)
+{
+    Page* page = m_frame.page();
+    if (!page)
+        return false;
+
+    CurrentEventScope scope(event);
+
+    bool eventWasHandled = handleWheelEvent(PlatformEventFactory::createPlatformWheelEvent(event));
+    event.wasHandled = eventWasHandled;
+    return eventWasHandled;
+}
+
+#if ENABLE(IOS_TOUCH_EVENTS)
+void EventHandler::touchEvent(WebEvent *event)
+{
+    CurrentEventScope scope(event);
+
+    event.wasHandled = handleTouchEvent(PlatformEventFactory::createPlatformTouchEvent(event));
+}
+#endif
+
+bool EventHandler::tabsToAllFormControls(KeyboardEvent* event) const
+{
+    Page* page = m_frame.page();
+    if (!page)
+        return false;
+
+    KeyboardUIMode keyboardUIMode = page-&gt;chrome().client().keyboardUIMode();
+    bool handlingOptionTab = isKeyboardOptionTab(event);
+
+    // If tab-to-links is off, option-tab always highlights all controls.
+    if ((keyboardUIMode &amp; KeyboardAccessTabsToLinks) == 0 &amp;&amp; handlingOptionTab)
+        return true;
+
+    // If system preferences say to include all controls, we always include all controls.
+    if (keyboardUIMode &amp; KeyboardAccessFull)
+        return true;
+
+    // Otherwise tab-to-links includes all controls, unless the sense is flipped via option-tab.
+    if (keyboardUIMode &amp; KeyboardAccessTabsToLinks)
+        return !handlingOptionTab;
+
+    return handlingOptionTab;
+}
+
+bool EventHandler::keyEvent(WebEvent *event)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    ASSERT(event.type == WebEventKeyDown || event.type == WebEventKeyUp);
+
+    CurrentEventScope scope(event);
+    bool eventWasHandled = keyEvent(PlatformEventFactory::createPlatformKeyboardEvent(event));
+    event.wasHandled = eventWasHandled;
+    return eventWasHandled;
+
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return false;
+}
+
+void EventHandler::focusDocumentView()
+{
+    Page* page = m_frame.page();
+    if (!page)
+        return;
+
+    if (FrameView* frameView = m_frame.view()) {
+        if (NSView *documentView = frameView-&gt;documentView())
+            page-&gt;chrome().focusNSView(documentView);
+    }
+
+    page-&gt;focusController().setFocusedFrame(&amp;m_frame);
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&amp; event)
+{
+    // Figure out which view to send the event to.
+    RenderObject* target = event.targetNode() ? event.targetNode()-&gt;renderer() : nullptr;
+    if (!target || !target-&gt;isWidget())
+        return false;
+
+    // Double-click events don't exist in Cocoa. Since passWidgetMouseDownEventToWidget() will
+    // just pass currentEvent down to the widget, we don't want to call it for events that
+    // don't correspond to Cocoa events. The mousedown/ups will have already been passed on as
+    // part of the pressed/released handling.
+    return passMouseDownEventToWidget(toRenderWidget(target)-&gt;widget());
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
+{
+    return passMouseDownEventToWidget(renderWidget-&gt;widget());
+}
+
+static bool lastEventIsMouseUp()
+{
+    // Many AppKit widgets run their own event loops and consume events while the mouse is down.
+    // When they finish, currentEvent is the mouseUp that they exited on. We need to update
+    // the WebCore state with this mouseUp, which we never saw. This method lets us detect
+    // that state. Handling this was critical when we used AppKit widgets for form elements.
+    // It's not clear in what cases this is helpful now -- it's possible it can be removed. 
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    WebEvent *currentEventAfterHandlingMouseDown = [WAKWindow currentEvent];
+    return currentEventAfterHandlingMouseDown
+        &amp;&amp; EventHandler::currentEvent() != currentEventAfterHandlingMouseDown
+        &amp;&amp; currentEventAfterHandlingMouseDown.type == WebEventMouseUp
+        &amp;&amp; currentEventAfterHandlingMouseDown.timestamp &gt;= EventHandler::currentEvent().timestamp;
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return false;
+}
+
+bool EventHandler::passMouseDownEventToWidget(Widget* pWidget)
+{
+    // FIXME: This function always returns true. It should be changed either to return
+    // false in some cases or the return value should be removed.
+
+    RefPtr&lt;Widget&gt; widget = pWidget;
+
+    if (!widget) {
+        LOG_ERROR(&quot;hit a RenderWidget without a corresponding Widget, means a frame is half-constructed&quot;);
+        return true;
+    }
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    NSView *nodeView = widget-&gt;platformWidget();
+    ASSERT(nodeView);
+    ASSERT([nodeView superview]);
+    NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:currentEvent().locationInWindow fromView:nil]];
+    if (!view) {
+        // We probably hit the border of a RenderWidget
+        return true;
+    }
+
+    Page* page = m_frame.page();
+    if (!page)
+        return true;
+
+    if (page-&gt;chrome().client().firstResponder() != view) {
+        // Normally [NSWindow sendEvent:] handles setting the first responder.
+        // But in our case, the event was sent to the view representing the entire web page.
+        if ([view acceptsFirstResponder] &amp;&amp; [view needsPanelToBecomeKey])
+            page-&gt;chrome().client().makeFirstResponder(view);
+    }
+
+    // We need to &quot;defer loading&quot; while tracking the mouse, because tearing down the
+    // page while an AppKit control is tracking the mouse can cause a crash.
+
+    // FIXME: In theory, WebCore now tolerates tear-down while tracking the
+    // mouse. We should confirm that, and then remove the deferrsLoading
+    // hack entirely.
+
+    bool wasDeferringLoading = page-&gt;defersLoading();
+    if (!wasDeferringLoading)
+        page-&gt;setDefersLoading(true);
+
+    ASSERT(!m_sendingEventToSubview);
+    m_sendingEventToSubview = true;
+    [view mouseDown:currentEvent()];
+    m_sendingEventToSubview = false;
+    
+    if (!wasDeferringLoading)
+        page-&gt;setDefersLoading(false);
+
+    // Remember which view we sent the event to, so we can direct the release event properly.
+    m_mouseDownView = view;
+    m_mouseDownWasInSubframe = false;
+
+    // Many AppKit widgets run their own event loops and consume events while the mouse is down.
+    // When they finish, currentEvent is the mouseUp that they exited on.  We need to update
+    // the EventHandler state with this mouseUp, which we never saw.
+    // If this event isn't a mouseUp, we assume that the mouseUp will be coming later.  There
+    // is a hole here if the widget consumes both the mouseUp and subsequent events.
+    if (lastEventIsMouseUp())
+        m_mousePressed = false;
+
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return true;
+}
+
+// Note that this does the same kind of check as [target isDescendantOf:superview].
+// There are two differences: This is a lot slower because it has to walk the whole
+// tree, and this works in cases where the target has already been deallocated.
+static bool findViewInSubviews(NSView *superview, NSView *target)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    NSEnumerator *e = [[superview subviews] objectEnumerator];
+    NSView *subview;
+    while ((subview = [e nextObject])) {
+        if (subview == target || findViewInSubviews(subview, target)) {
+            return true;
+        }
+    }
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return false;
+}
+
+NSView *EventHandler::mouseDownViewIfStillGood()
+{
+    // Since we have no way of tracking the lifetime of m_mouseDownView, we have to assume that
+    // it could be deallocated already. We search for it in our subview tree; if we don't find
+    // it, we set it to nil.
+    NSView *mouseDownView = m_mouseDownView;
+    if (!mouseDownView) {
+        return nil;
+    }
+    FrameView* topFrameView = m_frame.view();
+    NSView *topView = topFrameView ? topFrameView-&gt;platformWidget() : nil;
+    if (!topView || !findViewInSubviews(topView, mouseDownView)) {
+        m_mouseDownView = nil;
+        return nil;
+    }
+    return mouseDownView;
+}
+
+bool EventHandler::eventActivatedView(const PlatformMouseEvent&amp;) const
+{
+    return false;
+}
+
+bool EventHandler::eventLoopHandleMouseUp(const MouseEventWithHitTestResults&amp;)
+{
+    NSView *view = mouseDownViewIfStillGood();
+    if (!view)
+        return false;
+
+    if (!m_mouseDownWasInSubframe) {
+        ASSERT(!m_sendingEventToSubview);
+        m_sendingEventToSubview = true;
+        BEGIN_BLOCK_OBJC_EXCEPTIONS;
+        [view mouseUp:currentEvent()];
+        END_BLOCK_OBJC_EXCEPTIONS;
+        m_sendingEventToSubview = false;
+    }

+    return true;
+}
+    
+bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults&amp; event, Frame* subframe, HitTestResult* hoveredNode)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    WebEventType currentEventType = currentEvent().type;
+    switch (currentEventType) {
+        case WebEventMouseMoved: {
+            // Since we're passing in currentNSEvent() here, we can call
+            // handleMouseMoveEvent() directly, since the save/restore of
+            // currentNSEvent() that mouseMoved() does would have no effect.
+            ASSERT(!m_sendingEventToSubview);
+            m_sendingEventToSubview = true;
+            subframe-&gt;eventHandler().handleMouseMoveEvent(currentPlatformMouseEvent(), hoveredNode);
+            m_sendingEventToSubview = false;
+            return true;
+        }
+        case WebEventMouseDown: {
+            Node* node = event.targetNode();
+            if (!node)
+                return false;
+            RenderObject* renderer = node-&gt;renderer();
+            if (!renderer || !renderer-&gt;isWidget())
+                return false;
+            Widget* widget = toRenderWidget(renderer)-&gt;widget();
+            if (!widget || !widget-&gt;isFrameView())
+                return false;
+            if (!passWidgetMouseDownEventToWidget(toRenderWidget(renderer)))
+                return false;
+            m_mouseDownWasInSubframe = true;
+            return true;
+        }
+        case WebEventMouseUp: {
+            if (!m_mouseDownWasInSubframe)
+                return false;
+            ASSERT(!m_sendingEventToSubview);
+            m_sendingEventToSubview = true;
+            subframe-&gt;eventHandler().handleMouseReleaseEvent(currentPlatformMouseEvent());
+            m_sendingEventToSubview = false;
+            return true;
+        }
+        case WebEventKeyDown:
+        case WebEventKeyUp:
+        case WebEventScrollWheel:
+        case WebEventTouchBegin:
+        case WebEventTouchCancel:
+        case WebEventTouchChange:
+        case WebEventTouchEnd:
+            return false;
+    }
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return false;
+}
+
+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent&amp;, Widget* widget)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    if (currentEvent().type != WebEventScrollWheel || m_sendingEventToSubview || !widget)
+        return false;
+
+    NSView* nodeView = widget-&gt;platformWidget();
+    ASSERT(nodeView);
+    ASSERT([nodeView superview]);
+    NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:currentEvent().locationInWindow fromView:nil]];
+    if (!view) {
+        // We probably hit the border of a RenderWidget
+        return false;
+    }
+
+    ASSERT(!m_sendingEventToSubview);
+    m_sendingEventToSubview = true;
+    [view scrollWheel:currentEvent()];
+    m_sendingEventToSubview = false;
+    return true;
+
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return false;
+}
+
+void EventHandler::mouseDown(WebEvent *event)
+{
+    FrameView* v = m_frame.view();
+    if (!v || m_sendingEventToSubview)
+        return;
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    m_frame.loader().resetMultipleFormSubmissionProtection();
+
+    m_mouseDownView = nil;
+
+    CurrentEventScope scope(event);
+
+    event.wasHandled = handleMousePressEvent(currentPlatformMouseEvent());
+
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void EventHandler::mouseUp(WebEvent *event)
+{
+    FrameView* v = m_frame.view();
+    if (!v || m_sendingEventToSubview)
+        return;
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    CurrentEventScope scope(event);
+
+    event.wasHandled = handleMouseReleaseEvent(currentPlatformMouseEvent());
+
+    m_mouseDownView = nil;
+
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void EventHandler::mouseMoved(WebEvent *event)
+{
+    // Reject a mouse moved if the button is down - screws up tracking during autoscroll
+    // These happen because WebKit sometimes has to fake up moved events.
+    if (!m_frame.view() || m_mousePressed || m_sendingEventToSubview)
+        return;
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    m_frame.document()-&gt;updateStyleIfNeeded();
+
+    WKBeginObservingContentChanges(true);
+    CurrentEventScope scope(event);
+    event.wasHandled = mouseMoved(currentPlatformMouseEvent());
+    m_frame.document()-&gt;updateStyleIfNeeded();
+    WKStopObservingContentChanges();
+
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults&amp; mev, Frame* subframe)
+{
+    return passSubframeEventToSubframe(mev, subframe);
+}
+
+bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults&amp; mev, Frame* subframe, HitTestResult* hoveredNode)
+{
+    return passSubframeEventToSubframe(mev, subframe, hoveredNode);
+}
+
+bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&amp; mev, Frame* subframe)
+{
+    return passSubframeEventToSubframe(mev, subframe);
+}
+
+unsigned EventHandler::accessKeyModifiers()
+{
+    // Control+Option key combinations are usually unused on Mac OS X, but not when VoiceOver is enabled.
+    // So, we use Control in this case, even though it conflicts with Emacs-style key bindings.
+    // See &lt;https://bugs.webkit.org/show_bug.cgi?id=21107&gt; for more detail.
+    if (AXObjectCache::accessibilityEnhancedUserInterfaceEnabled())
+        return PlatformKeyboardEvent::CtrlKey;
+
+    return PlatformKeyboardEvent::CtrlKey | PlatformKeyboardEvent::AltKey;
+}
+
+PlatformMouseEvent EventHandler::currentPlatformMouseEvent() const
+{
+    return PlatformEventFactory::createPlatformMouseEvent(currentEvent());
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorepageiosFrameIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/ios/FrameIOS.mm (0 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ios/FrameIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/page/ios/FrameIOS.mm        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -0,0 +1,930 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;Frame.h&quot;
+
+#if PLATFORM(IOS)
+
+#import &quot;AnimationController.h&quot;
+#import &quot;BlockExceptions.h&quot;
+#import &quot;DOMCSSStyleDeclarationInternal.h&quot;
+#import &quot;DOMCore.h&quot;
+#import &quot;DOMInternal.h&quot;
+#import &quot;DOMNodeInternal.h&quot;
+#import &quot;DOMWindow.h&quot;
+#import &quot;Document.h&quot;
+#import &quot;DocumentMarker.h&quot;
+#import &quot;DocumentMarkerController.h&quot;
+#import &quot;Editor.h&quot;
+#import &quot;EditorClient.h&quot;
+#import &quot;EventHandler.h&quot;
+#import &quot;EventNames.h&quot;
+#import &quot;FormController.h&quot;
+#import &quot;FrameSelection.h&quot;
+#import &quot;FrameSnapshottingMac.h&quot;
+#import &quot;FrameView.h&quot;
+#import &quot;HTMLAreaElement.h&quot;
+#import &quot;HTMLDocument.h&quot;
+#import &quot;HTMLElement.h&quot;
+#import &quot;HTMLNames.h&quot;
+#import &quot;HTMLObjectElement.h&quot;
+#import &quot;HitTestRequest.h&quot;
+#import &quot;HitTestResult.h&quot;
+#import &quot;JSDOMWindowBase.h&quot;
+#import &quot;MainFrame.h&quot;
+#import &quot;NodeRenderStyle.h&quot;
+#import &quot;NodeTraversal.h&quot;
+#import &quot;Page.h&quot;
+#import &quot;PageTransitionEvent.h&quot;
+#import &quot;PropertySetCSSStyleDeclaration.h&quot;
+#import &quot;RenderLayer.h&quot;
+#import &quot;RenderLayerCompositor.h&quot;
+#import &quot;RenderTextControl.h&quot;
+#import &quot;RenderView.h&quot;
+#import &quot;TextBoundaries.h&quot;
+#import &quot;TextIterator.h&quot;
+#import &quot;VisiblePosition.h&quot;
+#import &quot;VisibleUnits.h&quot;
+#import &quot;WAKWindow.h&quot;
+#import &quot;WebCoreSystemInterface.h&quot;
+#import &lt;runtime/JSLock.h&gt;
+
+using namespace WebCore::HTMLNames;
+using namespace WTF::Unicode;
+
+using JSC::JSLockHolder;
+
+namespace WebCore {
+
+// Create &lt;html&gt;&lt;body (style=&quot;...&quot;)&gt;&lt;/body&gt;&lt;/html&gt; doing minimal amount of work.
+void Frame::initWithSimpleHTMLDocument(const String&amp; style, const URL&amp; url)
+{
+    m_loader.initForSynthesizedDocument(url);
+
+    RefPtr&lt;HTMLDocument&gt; document = HTMLDocument::createSynthesizedDocument(this, url);
+    document-&gt;setCompatibilityMode(Document::LimitedQuirksMode);
+    document-&gt;createDOMWindow();
+    setDocument(document);
+
+    ExceptionCode ec;
+    RefPtr&lt;Element&gt; rootElement = document-&gt;createElementNS(xhtmlNamespaceURI, ASCIILiteral(&quot;html&quot;), ec);
+
+    RefPtr&lt;Element&gt; body = document-&gt;createElementNS(xhtmlNamespaceURI, ASCIILiteral(&quot;body&quot;), ec);
+    if (!style.isEmpty())
+        body-&gt;setAttribute(HTMLNames::styleAttr, style);
+
+    rootElement-&gt;appendChild(body, ec);
+    document-&gt;appendChild(rootElement, ec);
+}
+
+// FIXME: Extract the common code in indexCountOfWordPrecedingSelection() and wordsInCurrentParagraph() into a shared function.
+int Frame::indexCountOfWordPrecedingSelection(NSString *word) const
+{
+    int result = -1;
+
+    if (!page() || page()-&gt;selection().isNone())
+        return result;
+
+    RefPtr&lt;Range&gt; searchRange(rangeOfContents(*document()));
+    VisiblePosition start(page()-&gt;selection().start(), page()-&gt;selection().affinity());
+    VisiblePosition oneBeforeStart = start.previous();
+
+    setEnd(searchRange.get(), oneBeforeStart.isNotNull() ? oneBeforeStart : start);
+
+    int exception = 0;
+    if (searchRange-&gt;collapsed(exception))
+        return result;
+
+    WordAwareIterator it(searchRange.get());
+    while (!it.atEnd()) {
+        const UChar* chars = it.characters();
+        int length = it.length();
+        if (length &gt; 1 || !isSpaceOrNewline(chars[0])) {
+            int startOfWordBoundary = 0;
+            for (int i = 1; i &lt; length; i++) {
+                if (isSpaceOrNewline(chars[i]) || chars[i] == 0xA0) {
+                    int wordLength = i - startOfWordBoundary;
+                    NSString *chunk = [[NSString alloc] initWithCharactersNoCopy:const_cast&lt;unichar*&gt;(chars) + startOfWordBoundary length:wordLength freeWhenDone:NO];
+                    if ([chunk isEqualToString:word])
+                        ++result;
+                    [chunk release];
+                    startOfWordBoundary += wordLength + 1;
+                }
+            }
+            if (startOfWordBoundary &lt; length) {
+                NSString *chunk = [[NSString alloc] initWithCharactersNoCopy:const_cast&lt;unichar*&gt;(chars) + startOfWordBoundary length:length - startOfWordBoundary freeWhenDone:NO];
+                if ([chunk isEqualToString:word])
+                    ++result;
+                [chunk release];
+            }
+        }
+        it.advance();
+    }
+
+    return result + 1;
+}
+
+// FIXME: Extract the common code in indexCountOfWordPrecedingSelection() and wordsInCurrentParagraph() into a shared function.
+NSArray *Frame::wordsInCurrentParagraph() const
+{
+    document()-&gt;updateLayout();
+
+    if (!page() || !page()-&gt;selection().isCaret())
+        return nil;
+
+    VisiblePosition position(page()-&gt;selection().start(), page()-&gt;selection().affinity());
+    VisiblePosition end(position);
+    if (!isStartOfParagraph(end)) {
+        VisiblePosition previous = end.previous();
+        UChar c(previous.characterAfter());
+        if (!iswpunct(c) &amp;&amp; !isSpaceOrNewline(c) &amp;&amp; c != 0xA0)
+            end = startOfWord(end);
+    }
+    VisiblePosition start(startOfParagraph(end));
+
+    RefPtr&lt;Range&gt; searchRange(rangeOfContents(*document()));
+    setStart(searchRange.get(), start);
+    setEnd(searchRange.get(), end);
+
+    int exception = 0;
+    if (searchRange-&gt;collapsed(exception))
+        return nil;
+
+    NSMutableArray *words = [NSMutableArray array];
+
+    WordAwareIterator it(searchRange.get());
+    while (!it.atEnd()) {
+        const UChar* chars = it.characters();
+        int length = it.length();
+        if (length &gt; 1 || !isSpaceOrNewline(chars[0])) {
+            int startOfWordBoundary = 0;
+            for (int i = 1; i &lt; length; i++) {
+                if (isSpaceOrNewline(chars[i]) || chars[i] == 0xA0) {
+                    int wordLength = i - startOfWordBoundary;
+                    if (wordLength &gt; 0) {
+                        NSString *chunk = [[NSString alloc] initWithCharactersNoCopy:const_cast&lt;unichar*&gt;(chars) + startOfWordBoundary length:wordLength freeWhenDone:NO];
+                        [words addObject:chunk];
+                        [chunk release];
+                    }
+                    startOfWordBoundary += wordLength + 1;
+                }
+            }
+            if (startOfWordBoundary &lt; length) {
+                NSString *chunk = [[NSString alloc] initWithCharactersNoCopy:const_cast&lt;unichar*&gt;(chars) + startOfWordBoundary length:length - startOfWordBoundary freeWhenDone:NO];
+                [words addObject:chunk];
+                [chunk release];
+            }
+        }
+        it.advance();
+    }
+
+    if ([words count] &gt; 0 &amp;&amp; isEndOfParagraph(position) &amp;&amp; !isStartOfParagraph(position)) {
+        VisiblePosition previous = position.previous();
+        UChar c(previous.characterAfter());
+        if (!isSpaceOrNewline(c) &amp;&amp; c != 0xA0)
+            [words removeLastObject];
+    }
+
+    return words;
+}
+
+#define CHECK_FONT_SIZE 0
+#define RECT_LOGGING 0
+
+CGRect Frame::renderRectForPoint(CGPoint point, bool* isReplaced, float* fontSize) const
+{
+    *isReplaced = false;
+    *fontSize = 0;
+
+    if (!m_doc || !m_doc-&gt;renderBox())
+        return CGRectZero;
+
+    // FIXME: why this layer check?
+    RenderLayer* layer = m_doc-&gt;renderBox()-&gt;layer();
+    if (!layer)
+        return CGRectZero;
+
+    HitTestResult result = eventHandler().hitTestResultAtPoint(IntPoint(roundf(point.x), roundf(point.y)));
+
+    Node* node = result.innerNode();
+    if (!node)
+        return CGRectZero;
+
+    RenderObject* hitRenderer = node-&gt;renderer();
+    RenderObject* renderer = hitRenderer;
+#if RECT_LOGGING
+    printf(&quot;\n%f %f\n&quot;, point.x, point.y);
+#endif
+    while (renderer &amp;&amp; !renderer-&gt;isBody() &amp;&amp; !renderer-&gt;isRoot()) {
+#if RECT_LOGGING
+        CGRect rect = renderer-&gt;absoluteBoundingBoxRect(true);
+        if (renderer-&gt;node()) {
+            const char *nodeName = renderer-&gt;node()-&gt;nodeName().ascii().data();
+            printf(&quot;%s %f %f %f %f\n&quot;, nodeName, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
+        }
+#endif
+        if (renderer-&gt;isRenderBlock() || renderer-&gt;isInlineBlockOrInlineTable() || renderer-&gt;isReplaced()) {
+            *isReplaced = renderer-&gt;isReplaced();
+#if CHECK_FONT_SIZE
+            for (RenderObject* textRenderer = hitRenderer; textRenderer; textRenderer = textRenderer-&gt;traverseNext(hitRenderer)) {
+                if (textRenderer-&gt;isText()) {
+                    *fontSize = textRenderer-&gt;font(true).pixelSize();
+                    break;
+                }
+            }
+#endif
+            IntRect targetRect = renderer-&gt;absoluteBoundingBoxRect(true);
+            for (Widget* currView = &amp;(renderer-&gt;view().frameView()); currView &amp;&amp; currView != view(); currView = currView-&gt;parent())
+                targetRect = currView-&gt;convertToContainingView(targetRect);
+
+            return targetRect;
+        }
+        renderer = renderer-&gt;parent();
+    }
+
+    return CGRectZero;
+}
+
+#define ALLOW_SCROLL_LISTENERS 0
+
+static Node* ancestorRespondingToScrollWheelEvents(const HitTestResult&amp; hitTestResult, Node* terminationNode, IntRect* nodeBounds)
+{
+    if (nodeBounds)
+        *nodeBounds = IntRect();
+
+    Node* scrollingAncestor = nullptr;
+    for (Node* node = hitTestResult.innerNode(); node &amp;&amp; node != terminationNode &amp;&amp; !node-&gt;hasTagName(HTMLNames::bodyTag); node = node-&gt;parentNode()) {
+#if ALLOW_SCROLL_LISTENERS
+        if (node-&gt;willRespondToMouseWheelEvents()) {
+            scrollingAncestor = node;
+            continue;
+        }
+#endif
+
+        RenderObject* renderer = node-&gt;renderer();
+        if (!renderer)
+            continue;
+
+        if ((renderer-&gt;isTextField() || renderer-&gt;isTextArea()) &amp;&amp; toRenderTextControl(renderer)-&gt;canScroll()) {
+            scrollingAncestor = node;
+            continue;
+        }
+
+        RenderStyle&amp; style = renderer-&gt;style();
+
+        if (renderer-&gt;hasOverflowClip() &amp;&amp;
+            (style.overflowY() == OAUTO || style.overflowY() == OSCROLL || style.overflowY() == OOVERLAY ||
+             style.overflowX() == OAUTO || style.overflowX() == OSCROLL || style.overflowX() == OOVERLAY))
+            scrollingAncestor = node;
+    }
+
+    return scrollingAncestor;
+}
+
+static Node* ancestorRespondingToClickEvents(const HitTestResult&amp; hitTestResult, Node* terminationNode, IntRect* nodeBounds)
+{
+    bool bodyHasBeenReached = false;
+    bool pointerCursorStillValid = true;
+
+    if (nodeBounds)
+        *nodeBounds = IntRect();
+
+    Node* pointerCursorNode = nullptr;
+    for (Node* node = hitTestResult.innerNode(); node &amp;&amp; node != terminationNode; node = node-&gt;parentNode()) {
+        ASSERT(!node-&gt;isInShadowTree());
+
+        // We only accept pointer nodes before reaching the body tag.
+        if (node-&gt;hasTagName(HTMLNames::bodyTag)) {
+#if USE(UIKIT_EDITING)
+            // Make sure we cover the case of an empty editable body.
+            if (!pointerCursorNode &amp;&amp; node-&gt;isContentEditable())
+                pointerCursorNode = node;
+#endif
+            bodyHasBeenReached = true;
+            pointerCursorStillValid = false;
+        }
+
+        // If we already have a pointer, and we reach a table, don't accept it.
+        if (pointerCursorNode &amp;&amp; (node-&gt;hasTagName(HTMLNames::tableTag) || node-&gt;hasTagName(HTMLNames::tbodyTag)))
+            pointerCursorStillValid = false;
+
+        // If we haven't reached the body, and we are still paying attention to pointer cursors, and the node has a pointer cursor...
+        if (pointerCursorStillValid &amp;&amp; node-&gt;renderStyle() &amp;&amp; node-&gt;renderStyle()-&gt;cursor() == CURSOR_POINTER)
+            pointerCursorNode = node;
+        // We want the lowest unbroken chain of pointer cursors.
+        else if (pointerCursorNode)
+            pointerCursorStillValid = false;
+
+        if (node-&gt;willRespondToMouseClickEvents() || node-&gt;willRespondToMouseMoveEvents()) {
+            // If we're at the body or higher, use the pointer cursor node (which may be null).
+            if (bodyHasBeenReached)
+                node = pointerCursorNode;
+
+            // If we are interested about the frame, use it.
+            if (nodeBounds) {
+                // This is a check to see whether this node is an area element.  The only way this can happen is if this is the first check.
+                if (node == hitTestResult.innerNode() &amp;&amp; node != hitTestResult.innerNonSharedNode() &amp;&amp; node-&gt;hasTagName(HTMLNames::areaTag))
+                    *nodeBounds = pixelSnappedIntRect(toHTMLAreaElement(node)-&gt;computeRect(hitTestResult.innerNonSharedNode()-&gt;renderer()));
+                else if (node &amp;&amp; node-&gt;renderer())
+                    *nodeBounds = node-&gt;renderer()-&gt;absoluteBoundingBoxRect(true);
+            }
+
+            return node;
+        }
+    }
+
+    return nullptr;
+}
+
+void Frame::betterApproximateNode(const IntPoint&amp; testPoint, NodeQualifier nodeQualifierFunction, Node*&amp; best, Node* failedNode, IntPoint&amp; bestPoint, IntRect&amp; bestRect, const IntRect&amp; testRect)
+{
+    IntRect candidateRect;
+    Node* candidate = nodeQualifierFunction(eventHandler().hitTestResultAtPoint(testPoint), failedNode, &amp;candidateRect);
+
+    // Bail if we have no candidate, or the candidate is already equal to our current best node,
+    // or our candidate is the avoidedNode and there is a current best node.
+    if (!candidate || candidate == best)
+        return;
+
+    // The document should never be considered the best alternative.
+    if (candidate-&gt;isDocumentNode())
+        return;
+
+    if (best) {
+        IntRect bestIntersect = intersection(testRect, bestRect);
+        IntRect candidateIntersect = intersection(testRect, candidateRect);
+        // if the candidate intersection is smaller than the current best intersection, bail.
+        if (candidateIntersect.width() * candidateIntersect.height() &lt;= bestIntersect.width() * bestIntersect.height())
+            return;
+    }
+
+    // At this point we either don't have a previous best, or our current candidate has a better intersection.
+    best = candidate;
+    bestPoint = testPoint;
+    bestRect = candidateRect;
+}
+
+bool Frame::hitTestResultAtViewportLocation(const FloatPoint&amp; viewportLocation, HitTestResult&amp; hitTestResult, IntPoint&amp; center)
+{
+    if (!m_doc || !m_doc-&gt;renderView())
+        return false;
+
+    FrameView* view = m_view.get();
+    if (!view)
+        return false;
+
+    center = view-&gt;windowToContents(roundedIntPoint(viewportLocation));
+    hitTestResult = eventHandler().hitTestResultAtPoint(center);
+    return true;
+}
+
+Node* Frame::qualifyingNodeAtViewportLocation(const FloatPoint&amp; viewportLocation, FloatPoint&amp; adjustedViewportLocation, NodeQualifier nodeQualifierFunction, bool shouldApproximate)
+{
+    adjustedViewportLocation = viewportLocation;
+
+    IntPoint testCenter;
+    HitTestResult candidateInfo;
+    if (!hitTestResultAtViewportLocation(viewportLocation, candidateInfo, testCenter))
+        return nullptr;
+
+    IntPoint bestPoint = testCenter;
+
+    // We have the candidate node at the location, check whether it or one of its ancestors passes
+    // the qualifier function, which typically checks if the node responds to a particular event type.
+    Node* approximateNode = nodeQualifierFunction(candidateInfo, 0, 0);
+
+#if USE(UIKIT_EDITING)
+    if (approximateNode &amp;&amp; approximateNode-&gt;isContentEditable()) {
+        // If we are in editable content, we look for the root editable element.
+        approximateNode = approximateNode-&gt;rootEditableElement();
+        // If we have a focusable node, there is no need to approximate.
+        if (approximateNode)
+            shouldApproximate = false;
+    }
+#endif
+    if (approximateNode &amp;&amp; shouldApproximate) {
+        float scale = page() ? page()-&gt;pageScaleFactor() : 1;
+
+        const int defaultMaxRadius = 15;
+        int maxRadius = scale &lt; 1 ? static_cast&lt;int&gt;(defaultMaxRadius / scale) : defaultMaxRadius;
+
+        const float testOffsets[] = {
+            -.3f, -.3f,
+            -.6f, -.6f,
+            +.3f, +.3f,
+            -.9f, -.9f,
+        };
+
+        Node* originalApproximateNode = approximateNode;
+        for (unsigned n = 0; n &lt; WTF_ARRAY_LENGTH(testOffsets); n += 2) {
+            IntSize testOffset(testOffsets[n] * maxRadius, testOffsets[n + 1] * maxRadius);
+            IntPoint testPoint = testCenter + testOffset;
+
+            HitTestResult candidateInfo = eventHandler().hitTestResultAtPoint(testPoint);
+            Node* candidateNode = nodeQualifierFunction(candidateInfo, 0, 0);
+            if (candidateNode &amp;&amp; candidateNode-&gt;isDescendantOf(originalApproximateNode)) {
+                approximateNode = candidateNode;
+                bestPoint = testPoint;
+                break;
+            }
+        }
+    } else if (!approximateNode &amp;&amp; shouldApproximate) {
+        // Grab the closest parent element of our failed candidate node.
+        Node* candidate = candidateInfo.innerNode();
+        Node* failedNode = candidate;
+
+        while (candidate &amp;&amp; !candidate-&gt;isElementNode())
+            candidate = candidate-&gt;parentNode();
+
+        if (candidate)
+            failedNode = candidate;
+
+        // We don't approximate the node if we are dragging, we instead force the user to be precise.
+        float scale = page() ? page()-&gt;pageScaleFactor() : 1;
+
+        const int defaultMaxRadius = 15;
+        int maxRadius = (scale &lt; 1.0) ? static_cast&lt;int&gt;(defaultMaxRadius / scale) : defaultMaxRadius;
+
+        // The center point was tested earlier.
+        const float testOffsets[] = {
+            -.3f, -.3f,
+            +.3f, -.3f,
+            -.3f, +.3f,
+            +.3f, +.3f,
+            -.6f, -.6f,
+            +.6f, -.6f,
+            -.6f, +.6f,
+            +.6f, +.6f,
+            -1.f, 0,
+            +1.f, 0,
+            0, +1.f,
+            0, -1.f,
+        };
+        IntRect bestFrame;
+        IntRect testRect(testCenter, IntSize());
+        testRect.inflate(maxRadius);
+        int currentTestRadius = 0;
+        for (unsigned n = 0; n &lt; WTF_ARRAY_LENGTH(testOffsets); n += 2) {
+            IntSize testOffset(testOffsets[n] * maxRadius, testOffsets[n + 1] * maxRadius);
+            IntPoint testPoint = testCenter + testOffset;
+            int testRadius = std::max(abs(testOffset.width()), abs(testOffset.height()));
+            if (testRadius &gt; currentTestRadius) {
+                // Bail out with the best match within a radius
+                currentTestRadius = testRadius;
+                if (approximateNode)
+                    break;
+            }
+            betterApproximateNode(testPoint, nodeQualifierFunction, approximateNode, failedNode, bestPoint, bestFrame, testRect);
+        }
+    }
+
+    if (approximateNode) {
+        IntPoint p = m_view-&gt;contentsToWindow(bestPoint);
+        adjustedViewportLocation = p;
+#if USE(UIKIT_EDITING)
+        if (approximateNode-&gt;isContentEditable()) {
+            // When in editable content, look for the root editable node again,
+            // since this could be the node found with the approximation.
+            approximateNode = approximateNode-&gt;rootEditableElement();
+        }
+#endif
+    }
+
+    return approximateNode;
+}
+
+Node* Frame::deepestNodeAtLocation(const FloatPoint&amp; viewportLocation)
+{
+    IntPoint center;
+    HitTestResult hitTestResult;
+    if (!hitTestResultAtViewportLocation(viewportLocation, hitTestResult, center))
+        return nullptr;
+
+    return hitTestResult.innerNode();
+}
+
+Node* Frame::nodeRespondingToClickEvents(const FloatPoint&amp; viewportLocation, FloatPoint&amp; adjustedViewportLocation)
+{
+    return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, &amp;ancestorRespondingToClickEvents, true);
+}
+
+Node* Frame::nodeRespondingToScrollWheelEvents(const FloatPoint&amp; viewportLocation)
+{
+    FloatPoint adjustedViewportLocation;
+    return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, &amp;ancestorRespondingToScrollWheelEvents, false);
+}
+
+int Frame::preferredHeight() const
+{
+    Document* document = this-&gt;document();
+    if (!document)
+        return 0;
+
+    document-&gt;updateLayout();
+
+    Node* body = document-&gt;body();
+    if (!body)
+        return 0;
+
+    RenderObject* renderer = body-&gt;renderer();
+    if (!renderer || !renderer-&gt;isRenderBlock())
+        return 0;
+
+    RenderBlock* block = toRenderBlock(renderer);
+    return block-&gt;height() + block-&gt;marginTop() + block-&gt;marginBottom();
+}
+
+int Frame::innerLineHeight(DOMNode* domNode) const
+{
+    if (!domNode)
+        return 0;
+
+    Document* document = this-&gt;document();
+    if (!document)
+        return 0;
+
+    document-&gt;updateLayout();
+
+    Node* node = core(domNode);
+    if (!node)
+        return 0;
+
+    RenderObject* renderer = node-&gt;renderer();
+    if (!renderer)
+        return 0;
+
+    return renderer-&gt;innerLineHeight();
+}
+
+void Frame::updateLayout() const
+{
+    Document* document = this-&gt;document();
+    if (!document)
+        return;
+
+    document-&gt;updateLayout();
+
+    if (FrameView* view = this-&gt;view())
+        view-&gt;adjustViewSize();
+}
+
+NSRect Frame::caretRect() const
+{
+    if (selection().isNone())
+        return CGRectZero;
+    return selection().isCaret() ? selection().absoluteCaretBounds() : VisiblePosition(selection().end()).absoluteCaretBounds();
+}
+
+NSRect Frame::rectForScrollToVisible() const
+{
+    VisibleSelection selection(this-&gt;selection().selection());
+    return rectForSelection(selection);
+}
+
+NSRect Frame::rectForSelection(VisibleSelection&amp; selection) const
+{
+    if (selection.isNone())
+        return CGRectZero;
+
+    if (selection.isCaret())
+        return caretRect();
+
+    EditorClient* client = editor().client();
+    if (client)
+        client-&gt;suppressSelectionNotifications();
+
+    VisibleSelection originalSelection(selection);
+    Position position;
+
+    // The selection controllers below need to be associated with a frame in order
+    // to calculate geometry. This causes them to do more work here than we would
+    // like. Ideally, we would have a sort offline geometry-only mode for selection
+    // controllers so we could do this kind of work as cheaply as possible.
+
+    position = originalSelection.start();
+    selection.setBase(position);
+    selection.setExtent(position);
+    FrameSelection startFrameSelection(const_cast&lt;Frame*&gt;(this));
+    startFrameSelection.suppressCloseTyping();
+    startFrameSelection.setSelection(selection);
+    FloatRect startRect(startFrameSelection.absoluteCaretBounds());
+    startFrameSelection.restoreCloseTyping();
+
+    position = originalSelection.end();
+    selection.setBase(position);
+    selection.setExtent(position);
+    FrameSelection endFrameSelection(const_cast&lt;Frame*&gt;(this));
+    endFrameSelection.suppressCloseTyping();
+    endFrameSelection.setSelection(selection);
+    FloatRect endRect(endFrameSelection.absoluteCaretBounds());
+    endFrameSelection.restoreCloseTyping();
+
+    if (client)
+        client-&gt;restoreSelectionNotifications();
+
+    return unionRect(startRect, endRect);
+}
+
+DOMCSSStyleDeclaration* Frame::styleAtSelectionStart() const
+{
+    Position start = selection().start();
+    RefPtr&lt;EditingStyle&gt; editingStyle = EditingStyle::styleAtSelectionStart(selection().selection());
+    if (!editingStyle)
+        return nullptr;
+    PropertySetCSSStyleDeclaration* propertySetCSSStyleDeclaration = new PropertySetCSSStyleDeclaration(editingStyle-&gt;style());
+    // The auto-generated code for DOMCSSStyleDeclaration derefs its pointer when it is deallocated.
+    return kit(static_cast&lt;CSSStyleDeclaration*&gt;(propertySetCSSStyleDeclaration));
+}
+
+unsigned Frame::formElementsCharacterCount() const
+{
+    Document* document = this-&gt;document();
+    if (!document)
+        return 0;
+    return document-&gt;formController().formElementsCharacterCount();
+}
+
+void Frame::setTimersPaused(bool paused)
+{
+    JSLockHolder lock(JSDOMWindowBase::commonVM());
+    setTimersPausedInternal(paused);
+}
+
+void Frame::setTimersPausedInternal(bool paused)
+{
+    if (paused) {
+        ++m_timersPausedCount;
+        if (m_timersPausedCount == 1) {
+            clearTimers();
+            if (document())
+                document()-&gt;suspendScheduledTasks(ActiveDOMObject::DocumentWillBePaused);
+        }
+    } else {
+        --m_timersPausedCount;
+        ASSERT(m_timersPausedCount &gt;= 0);
+        if (m_timersPausedCount == 0) {
+            if (document())
+                document()-&gt;resumeScheduledTasks(ActiveDOMObject::DocumentWillBePaused);
+
+            // clearTimers() suspended animations and pending relayouts, reschedule if needed.
+            animation().resumeAnimationsForDocument(document());
+
+            if (view())
+                view()-&gt;scheduleRelayout();
+        }
+    }
+
+    // We need to make sure all subframes' states are up to date.
+    for (Frame* frame = tree().firstChild(); frame; frame = frame-&gt;tree().nextSibling())
+        frame-&gt;setTimersPausedInternal(paused);
+}
+
+void Frame::dispatchPageHideEventBeforePause()
+{
+    ASSERT(isMainFrame());
+    if (!isMainFrame())
+        return;
+
+    for (Frame* frame = this; frame; frame = frame-&gt;tree().traverseNext(this))
+        frame-&gt;document()-&gt;domWindow()-&gt;dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, true), document());
+}
+
+void Frame::dispatchPageShowEventBeforeResume()
+{
+    ASSERT(isMainFrame());
+    if (!isMainFrame())
+        return;
+
+    for (Frame* frame = this; frame; frame = frame-&gt;tree().traverseNext(this))
+        frame-&gt;document()-&gt;domWindow()-&gt;dispatchEvent(PageTransitionEvent::create(eventNames().pageshowEvent, true), document());
+}
+
+void Frame::setRangedSelectionBaseToCurrentSelection()
+{
+    m_rangedSelectionBase = selection().selection();
+}
+
+void Frame::setRangedSelectionBaseToCurrentSelectionStart()
+{
+    FrameSelection&amp; frameSelection = selection();
+    m_rangedSelectionBase = VisibleSelection(frameSelection.selection().start(), frameSelection.affinity());
+}
+
+void Frame::setRangedSelectionBaseToCurrentSelectionEnd()
+{
+    FrameSelection&amp; frameSelection = selection();
+    m_rangedSelectionBase = VisibleSelection(frameSelection.selection().end(), frameSelection.affinity());
+}
+
+VisibleSelection Frame::rangedSelectionBase() const
+{
+    return m_rangedSelectionBase;
+}
+
+void Frame::clearRangedSelectionInitialExtent()
+{
+    m_rangedSelectionInitialExtent = VisibleSelection();
+}
+
+void Frame::setRangedSelectionInitialExtentToCurrentSelectionStart()
+{
+    FrameSelection&amp; frameSelection = selection();
+    m_rangedSelectionInitialExtent = VisibleSelection(frameSelection.selection().start(), frameSelection.affinity());
+}
+
+void Frame::setRangedSelectionInitialExtentToCurrentSelectionEnd()
+{
+    FrameSelection&amp; frameSelection = selection();
+    m_rangedSelectionInitialExtent = VisibleSelection(frameSelection.selection().end(), frameSelection.affinity());
+}
+
+VisibleSelection Frame::rangedSelectionInitialExtent() const
+{
+    return m_rangedSelectionInitialExtent;
+}
+
+void Frame::recursiveSetUpdateAppearanceEnabled(bool enabled)
+{
+    selection().setUpdateAppearanceEnabled(enabled);
+    for (Frame* child = tree().firstChild(); child; child = child-&gt;tree().nextSibling())
+        child-&gt;recursiveSetUpdateAppearanceEnabled(enabled);
+}
+
+// FIXME: Break this function up into pieces with descriptive function names so that it's easier to follow.
+NSArray *Frame::interpretationsForCurrentRoot() const
+{
+    if (!document())
+        return nil;
+
+    Element* root = selection().selectionType() == VisibleSelection::NoSelection ? document()-&gt;body() : selection().rootEditableElement();
+    unsigned rootChildCount = root-&gt;childNodeCount();
+    RefPtr&lt;Range&gt; rangeOfRootContents = Range::create(*document(), createLegacyEditingPosition(root, 0), createLegacyEditingPosition(root, rootChildCount));
+
+    Vector&lt;DocumentMarker*&gt; markersInRoot = document()-&gt;markers().markersInRange(rangeOfRootContents.get(), DocumentMarker::DictationPhraseWithAlternatives);
+
+    // There are no phrases with alternatives, so there is just one interpretation.
+    if (markersInRoot.isEmpty())
+        return [NSArray arrayWithObject:plainText(rangeOfRootContents.get())];
+
+    // The number of interpretations will be i1 * i2 * ... * iN, where iX is the number of interpretations for the Xth phrase with alternatives.
+    size_t interpretationsCount = 1;
+
+    for (auto marker : markersInRoot)
+        interpretationsCount *= marker-&gt;alternatives().size() + 1;
+
+    Vector&lt;Vector&lt;UChar&gt;&gt; interpretations;
+    interpretations.grow(interpretationsCount);
+
+    Position precedingTextStartPosition = createLegacyEditingPosition(root, 0);
+
+    unsigned combinationsSoFar = 1;
+
+    Node* pastLastNode = rangeOfRootContents-&gt;pastLastNode();
+    for (Node* node = rangeOfRootContents-&gt;firstNode(); node != pastLastNode; node = NodeTraversal::next(node)) {
+        const Vector&lt;DocumentMarker*&gt;&amp; markers = document()-&gt;markers().markersFor(node, DocumentMarker::MarkerTypes(DocumentMarker::DictationPhraseWithAlternatives));
+        for (auto marker : markers) {
+            // First, add text that precede the marker.
+            if (precedingTextStartPosition != createLegacyEditingPosition(node, marker-&gt;startOffset())) {
+                RefPtr&lt;Range&gt; precedingTextRange = Range::create(*document(), precedingTextStartPosition, createLegacyEditingPosition(node, marker-&gt;startOffset()));
+                String precedingText = plainText(precedingTextRange.get());
+                if (unsigned length = precedingText.length()) {
+                    const UChar* characters = precedingText.characters();
+                    for (size_t i = 0; i &lt; interpretationsCount; ++i)
+                        interpretations.at(i).append(characters, length);
+                }
+            }
+
+            RefPtr&lt;Range&gt; rangeForMarker = Range::create(*document(), createLegacyEditingPosition(node, marker-&gt;startOffset()), createLegacyEditingPosition(node, marker-&gt;endOffset()));
+            String visibleTextForMarker = plainText(rangeForMarker.get());
+            size_t interpretationsCountForCurrentMarker = marker-&gt;alternatives().size() + 1;
+            unsigned visibleTextForMarkerLength = visibleTextForMarker.length();
+            const UChar* visibleTextForMarkerCharacters = visibleTextForMarker.characters();
+            for (size_t i = 0; i &lt; interpretationsCount; ++i) {
+                // Determine text for the ith interpretation. It will either be the visible text, or one of its
+                // alternatives stored in the marker.
+
+                size_t indexOfInterpretationForCurrentMarker = (i / combinationsSoFar) % interpretationsCountForCurrentMarker;
+                if (!indexOfInterpretationForCurrentMarker)
+                    interpretations.at(i).append(visibleTextForMarkerCharacters, visibleTextForMarkerLength);
+                else {
+                    const String&amp; alternative = marker-&gt;alternatives().at(i % marker-&gt;alternatives().size());
+                    interpretations.at(i).append(alternative.characters(), alternative.length());
+                }
+            }
+
+            combinationsSoFar *= interpretationsCountForCurrentMarker;
+
+            precedingTextStartPosition = createLegacyEditingPosition(node, marker-&gt;endOffset());
+        }
+    }
+
+    // Finally, add any text after the last marker.
+    RefPtr&lt;Range&gt; afterLastMarkerRange = Range::create(*document(), precedingTextStartPosition, createLegacyEditingPosition(root, rootChildCount));
+    String textAfterLastMarker = plainText(afterLastMarkerRange.get());
+    const UChar* textAfterLastMarkerCharacters = textAfterLastMarker.characters();
+    if (unsigned length = textAfterLastMarker.length()) {
+        for (size_t i = 0; i &lt; interpretationsCount; ++i)
+            interpretations.at(i).append(textAfterLastMarkerCharacters, length);
+    }
+
+    NSMutableArray *result = [NSMutableArray array];
+    for (size_t i = 0; i &lt; interpretationsCount; ++i)
+        [result addObject:static_cast&lt;NSString *&gt;(String(interpretations.at(i)))];
+
+    return result;
+}
+
+static bool anyFrameHasTiledLayers(Frame* rootFrame)
+{
+    for (Frame* frame = rootFrame; frame; frame = frame-&gt;tree().traverseNext(rootFrame)) {
+        if (frame-&gt;containsTiledBackingLayers())
+            return true;
+    }
+    return false;
+}
+
+void Frame::viewportOffsetChanged(ViewportOffsetChangeType changeType)
+{
+#if USE(ACCELERATED_COMPOSITING)
+    if (changeType == IncrementalScrollOffset) {
+        if (anyFrameHasTiledLayers(this)) {
+            if (RenderView* root = contentRenderer())
+                root-&gt;compositor().didChangeVisibleRect();
+        }
+    }
+
+    if (changeType == CompletedScrollOffset) {
+        if (RenderView* root = contentRenderer())
+            root-&gt;compositor().updateCompositingLayers(CompositingUpdateOnScroll);
+    }
+#endif
+}
+
+bool Frame::containsTiledBackingLayers() const
+{
+#if USE(ACCELERATED_COMPOSITING)
+    if (RenderView* root = contentRenderer())
+        return root-&gt;compositor().hasNonMainLayersWithTiledBacking();
+#endif
+    return false;
+}
+
+void Frame::overflowScrollPositionChangedForNode(const IntPoint&amp; position, Node* node, bool isUserScroll)
+{
+    RenderObject* renderer = node-&gt;renderer();
+    if (!renderer || !renderer-&gt;hasLayer())
+        return;
+
+    RenderLayer* layer = toRenderBoxModelObject(renderer)-&gt;layer();
+
+    layer-&gt;setIsUserScroll(isUserScroll);
+    layer-&gt;scrollToOffsetWithoutAnimation(position);
+    layer-&gt;setIsUserScroll(false);
+    layer-&gt;didEndScroll(); // FIXME: Should we always call this?
+}
+
+void Frame::resetAllGeolocationPermission()
+{
+    if (document()-&gt;domWindow())
+        document()-&gt;domWindow()-&gt;resetAllGeolocationPermission();
+
+    for (Frame* child = tree().firstChild(); child; child = child-&gt;tree().nextSibling())
+        child-&gt;resetAllGeolocationPermission();
+}
+
+#if ENABLE(IOS_TEXT_AUTOSIZING)
+float Frame::textAutosizingWidth() const
+{
+    return m_textAutosizingWidth;
+}
+
+void Frame::setTextAutosizingWidth(float width)
+{
+    m_textAutosizingWidth = width;
+}
+#endif
+
+} // namespace WebCore
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCorepagemacChromeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/ChromeMac.mm (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/ChromeMac.mm        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/mac/ChromeMac.mm        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -23,6 +23,11 @@
</span><span class="cx"> #import &quot;BlockExceptions.h&quot;
</span><span class="cx"> #import &quot;ChromeClient.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WAKResponder.h&quot;
+#include &quot;WAKView.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacPageMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/PageMac.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/PageMac.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/mac/PageMac.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -44,12 +44,14 @@
</span><span class="cx">         m_scheduledRunLoopPairs = adoptPtr(new SchedulePairHashSet);
</span><span class="cx">     m_scheduledRunLoopPairs-&gt;add(pair);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     for (Frame* frame = m_mainFrame.get(); frame; frame = frame-&gt;tree().traverseNext()) {
</span><span class="cx">         if (DocumentLoader* documentLoader = frame-&gt;loader().documentLoader())
</span><span class="cx">             documentLoader-&gt;schedule(pair.get());
</span><span class="cx">         if (DocumentLoader* documentLoader = frame-&gt;loader().provisionalDocumentLoader())
</span><span class="cx">             documentLoader-&gt;schedule(pair.get());
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: make SharedTimerMac use these SchedulePairs.
</span><span class="cx"> }
</span><span class="lines">@@ -63,12 +65,14 @@
</span><span class="cx">     RefPtr&lt;SchedulePair&gt; pair = prpPair;
</span><span class="cx">     m_scheduledRunLoopPairs-&gt;remove(pair);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     for (Frame* frame = m_mainFrame.get(); frame; frame = frame-&gt;tree().traverseNext()) {
</span><span class="cx">         if (DocumentLoader* documentLoader = frame-&gt;loader().documentLoader())
</span><span class="cx">             documentLoader-&gt;unschedule(pair.get());
</span><span class="cx">         if (DocumentLoader* documentLoader = frame-&gt;loader().provisionalDocumentLoader())
</span><span class="cx">             documentLoader-&gt;unschedule(pair.get());
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacSettingsMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/SettingsMac.mm (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/SettingsMac.mm        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/mac/SettingsMac.mm        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool Settings::shouldEnableScreenFontSubstitutionByDefault()
</span><span class="cx"> {
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</ins><span class="cx">     return false;
</span><span class="cx"> #else
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacWebCoreFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/WebCoreFrameView.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/WebCoreFrameView.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebCore/page/mac/WebCoreFrameView.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -25,18 +25,30 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ScrollTypes.h&quot;
</span><span class="cx"> 
</span><ins>+// WTF_PLATFORM_IOS
+#ifdef __cplusplus
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">     class Frame;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> @protocol WebCoreFrameScrollView
</span><ins>+// WTF_PLATFORM_IOS
+#ifdef __cplusplus
</ins><span class="cx"> - (void)setScrollingModes:(WebCore::ScrollbarMode)hMode vertical:(WebCore::ScrollbarMode)vMode andLock:(BOOL)lock;
</span><span class="cx"> - (void)scrollingModes:(WebCore::ScrollbarMode*)hMode vertical:(WebCore::ScrollbarMode*)vMode;
</span><ins>+#else
+- (void)setScrollingModes:(int)hMode vertical:(int)vMode andLock:(BOOL)lock;
+- (void)scrollingModes:(int*)hMode vertical:(int*)vMode;
+#endif
</ins><span class="cx"> - (void)setScrollBarsSuppressed:(BOOL)suppressed repaintOnUnsuppress:(BOOL)repaint;
</span><span class="cx"> - (void)setScrollOrigin:(NSPoint)origin updatePositionAtAll:(BOOL)updatePositionAtAll immediately:(BOOL)updatePositionImmediately;
</span><span class="cx"> - (NSPoint)scrollOrigin;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @protocol WebCoreFrameView
</span><ins>+// WTF_PLATFORM_IOS
+#ifdef __cplusplus
</ins><span class="cx"> - (WebCore::Frame*)_web_frame;
</span><ins>+#endif
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitiosChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/ChangeLog (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/ChangeLog        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebKit/ios/ChangeLog        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2013-12-27  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] Upstream WebCore/page changes
+        https://bugs.webkit.org/show_bug.cgi?id=126180
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebChromeClientIOS.mm: Substitute ENABLE(IOS_TOUCH_EVENTS) for ENABLE(TOUCH_EVENTS).
+
</ins><span class="cx"> 2013-12-23  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Roll out r161043. It broke 32-bit Mac builds.
</span></span></pre></div>
<a id="trunkSourceWebKitiosWebCoreSupportWebChromeClientIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx">     [listener release];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(TOUCH_EVENTS)
</del><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx"> void WebChromeClientIOS::didPreventDefaultForEvent()
</span><span class="cx"> {
</span><span class="cx">     [[webView() _UIKitDelegateForwarder] webViewDidPreventDefaultForEvent:webView()];
</span></span></pre></div>
<a id="trunkSourceWebKitiosWebViewWebPDFViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -28,18 +28,11 @@
</span><span class="cx"> #import &quot;WebPDFViewIOS.h&quot;
</span><span class="cx"> #import &quot;WebDataSourceInternal.h&quot;
</span><span class="cx"> 
</span><del>-#import &lt;WebKit/WebFrameLoadDelegate.h&gt;
-#import &lt;WebKit/WebFrame.h&gt;
-#import &lt;WebKit/WebFramePrivate.h&gt;
-#import &lt;WebKit/WebFrameView.h&gt;
-#import &lt;WebKit/WebNSViewExtras.h&gt;
-#import &lt;WebKit/WebViewPrivate.h&gt;
</del><span class="cx"> #import &quot;WebFrameInternal.h&quot;
</span><span class="cx"> #import &quot;WebJSPDFDoc.h&quot;
</span><ins>+#import &quot;WebKitVersionChecks.h&quot;
</ins><span class="cx"> #import &quot;WebPDFDocumentExtras.h&quot;
</span><span class="cx"> #import &quot;WebPDFViewPlaceholder.h&quot;
</span><del>-#import &quot;WebKitVersionChecks.h&quot;
-
</del><span class="cx"> #import &lt;JavaScriptCore/JSContextRef.h&gt;
</span><span class="cx"> #import &lt;JavaScriptCore/JSStringRef.h&gt;
</span><span class="cx"> #import &lt;JavaScriptCore/JSStringRefCF.h&gt;
</span><span class="lines">@@ -48,7 +41,14 @@
</span><span class="cx"> #import &lt;WebCore/FrameLoader.h&gt;
</span><span class="cx"> #import &lt;WebCore/FrameLoaderClient.h&gt;
</span><span class="cx"> #import &lt;WebCore/GraphicsContext.h&gt;
</span><ins>+#import &lt;WebCore/StringWithDirection.h&gt;
</ins><span class="cx"> #import &lt;WebCore/WKGraphics.h&gt;
</span><ins>+#import &lt;WebKit/WebFrame.h&gt;
+#import &lt;WebKit/WebFrameLoadDelegate.h&gt;
+#import &lt;WebKit/WebFramePrivate.h&gt;
+#import &lt;WebKit/WebFrameView.h&gt;
+#import &lt;WebKit/WebNSViewExtras.h&gt;
+#import &lt;WebKit/WebViewPrivate.h&gt;
</ins><span class="cx"> #import &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/StdLibExtras.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebKit2/ChangeLog        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2013-12-27  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] Upstream WebCore/page changes
+        https://bugs.webkit.org/show_bug.cgi?id=126180
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: Added.
+        * WebProcess/WebPage/WebPage.cpp: Include header &lt;WebCore/HitTestResult.h&gt;.
+
</ins><span class="cx"> 2013-12-27  Gavin Barraclough  &lt;barraclough@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge PageVisibilityState &amp; ViewState::IsVisible in WebKit2
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -155,10 +155,11 @@
</span><span class="cx">     virtual PassOwnPtr&lt;WebCore::ColorChooser&gt; createColorChooser(WebCore::ColorChooserClient*, const WebCore::Color&amp;) OVERRIDE;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-#if ENABLE(TOUCH_EVENTS)
</del><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx">     virtual void didPreventDefaultForEvent() OVERRIDE;
</span><span class="cx"> #endif
</span><ins>+
+#if PLATFORM(IOS)
</ins><span class="cx">     virtual void didReceiveMobileDocType() OVERRIDE;
</span><span class="cx">     virtual void setNeedsScrollNotifications(WebCore::Frame*, bool) OVERRIDE;
</span><span class="cx">     virtual void observedContentChange(WebCore::Frame*) OVERRIDE;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportiosWebChromeClientIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-#if ENABLE(TOUCH_EVENTS)
</del><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx"> void WebChromeClient::didPreventDefaultForEvent()
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (161105 => 161106)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2013-12-27 19:46:00 UTC (rev 161105)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2013-12-27 20:40:28 UTC (rev 161106)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx"> #include &lt;WebCore/HTMLPlugInImageElement.h&gt;
</span><span class="cx"> #include &lt;WebCore/HistoryController.h&gt;
</span><span class="cx"> #include &lt;WebCore/HistoryItem.h&gt;
</span><ins>+#include &lt;WebCore/HitTestResult.h&gt;
</ins><span class="cx"> #include &lt;WebCore/JSDOMWindow.h&gt;
</span><span class="cx"> #include &lt;WebCore/KeyboardEvent.h&gt;
</span><span class="cx"> #include &lt;WebCore/MIMETypeRegistry.h&gt;
</span></span></pre>
</div>
</div>

</body>
</html>