<!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 <http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow>.
(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 <WebCore/HitTestResult.h>.
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 <dabates@apple.com>
+
+ [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 <thiago.lacerda@openbossa.org>
</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 "ENABLE(REMOTE_INSPECTOR) requires ENABLE(INSPECTOR)"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS) && !ENABLE(TOUCH_EVENTS)
+#error "ENABLE(IOS_TOUCH_EVENTS) requires ENABLE(TOUCH_EVENTS)"
+#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 <dabates@apple.com>
+
+ [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 <http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow>.
+ (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 <barraclough@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge PageVisibilityState & 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 = "<group>"; };
</span><span class="cx">                 CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlternativeTextController.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 CE08C3D0152B599A0021B8C2 /* AlternativeTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlternativeTextController.h; sourceTree = "<group>"; };
</span><ins>+                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventHandlerIOS.mm; sourceTree = "<group>"; };
+                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameIOS.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 CE5CB1B314EDAB6F00BB2795 /* EventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSender.h; sourceTree = "<group>"; };
</span><span class="cx">                 CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AlternativeTextUIController.h; path = mac/AlternativeTextUIController.h; sourceTree = "<group>"; };
</span><span class="cx">                 CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AlternativeTextUIController.mm; path = mac/AlternativeTextUIController.mm; sourceTree = "<group>"; };
</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 = "<group>";
</span><span class="cx">                 };
</span><ins>+                18A6CD6F0D8F2025001DC3CE /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */,
+                                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */,
+                        );
+                        path = ios;
+                        sourceTree = "<group>";
+                };
</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& eventType) const
+ {
+ return eventType == gesturestartEvent || eventType == gesturechangeEvent || eventType == gestureendEvent;
+ }
+
</ins><span class="cx"> inline bool isTouchEventType(const AtomicString& 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 <wtf/Vector.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><del>-#if PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080)
</del><ins>+#if !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 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) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080)
</del><ins>+#endif // !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 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 "DNS.h"
</span><span class="cx"> #include "DateTimeChooser.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "DocumentType.h"
</ins><span class="cx"> #include "FileIconLoader.h"
</span><span class="cx"> #include "FileChooser.h"
</span><span class="cx"> #include "FileList.h"
</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) && !PLATFORM(IOS)
</ins><span class="cx"> PassRefPtr<DateTimeChooser> Chrome::openDateTimeChooser(DateTimeChooserClient* client, const DateTimeChooserParameters& 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& 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& 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->isMainFrame())
+ return;
+
+ DocumentType* documentType = frame->document()->doctype();
+ if (!documentType) {
+ // FIXME: We should notify the client when <!DOCTYPE> is removed so that
+ // it can adjust the viewport accordingly. See <rdar://problem/15417894>.
+ return;
+ }
+
+ if (documentType->publicId().contains("xhtml mobile", 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<ColorChooser> createColorChooser(ColorChooserClient*, const Color& initialColor);
</span><span class="cx"> #endif
</span><del>-#if ENABLE(DATE_AND_TIME_INPUT_TYPES)
- PassRefPtr<DateTimeChooser> openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&);
</del><ins>+
+#if ENABLE(DATE_AND_TIME_INPUT_TYPES) && !PLATFORM(IOS)
+ PassRefPtr<DateTimeChooser> openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&)
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
</span><span class="lines">@@ -179,6 +180,13 @@
</span><span class="cx"> PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
</span><span class="cx"> PassRefPtr<SearchPopupMenu> 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& m_client;
</span><span class="cx"> PlatformDisplayID m_displayID;
</span><span class="cx"> Vector<PopupOpeningObserver*> 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 <wtf/PassOwnPtr.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#include "PlatformLayer.h"
+#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 "DatabaseDetails.h"
</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&) 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&) = 0;
</span><span class="cx"> virtual void setCursorHiddenUntilMouseMoves(bool) = 0;
</span><ins>+#endif
</ins><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME) && !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& path, String& generatedFilename);
</span><span class="cx"> virtual String generateReplacementFile(const String& 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 (<rdar://problem/5973875>)
+ // 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 <rdar://problem/5975559>.
+ virtual void suppressFormNotifications() = 0;
+ virtual void restoreFormNotifications() = 0;
+
+ virtual void didFlushCompositingLayers() { }
+
+ virtual bool fetchCustomFixedPositionLayoutRect(IntRect&) { return false; }
+
+ // FIXME: Use std::unique_ptr instead of OwnPtr.
+ virtual void updateViewportConstrainedLayers(HashMap<PlatformLayer*, OwnPtr<ViewportConstraints>>&, HashMap<PlatformLayer*, PlatformLayer*>&) { }
+
+ virtual void addOrUpdateScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer, const IntSize& 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<ColorChooser> createColorChooser(ColorChooserClient*, const Color&) = 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) && !PLATFORM(IOS)
</ins><span class="cx"> virtual PassRefPtr<DateTimeChooser> openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&) = 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 <wtf/HashSet.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#include "Chrome.h"
+#include "ChromeClient.h"
+#include "Frame.h"
+#include "Page.h"
+#include "WKContentObservation.h"
+#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->isDocument()) {
+ Document& document = toDocument(*context);
+ bool didDeferTimeout = document.frame() && document.frame()->timersPaused();
+ if (!didDeferTimeout && timeout <= 100 && singleShot) {
+ WKSetObservedContentChange(WKContentIndeterminateChange);
+ WebThreadAddObservedContentModifier(timer); // Will only take affect if not already visibility change.
+ }
+ }
+#endif
</ins><span class="cx">
</span><span class="cx"> timer->suspendIfNeeded();
</span><span class="cx"> InspectorInstrumentation::didInstallTimer(context, timer->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->isDocument()) {
+ document = toDocument(context);
+ ASSERT(!document->frame()->timersPaused());
+ }
+#endif
</ins><span class="cx"> timerNestingLevel = m_nestingLevel;
</span><span class="cx"> ASSERT(!isSuspended());
</span><span class="cx"> ASSERT(!context->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->execute(context);
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+ if (shouldBeginObservingChanges) {
+ WKStopObservingContentChanges();
+
+ if (WKObservedContentChange() == WKContentVisibilityChange || shouldReportLackOfChanges)
+ if (document && document->page())
+ document->page()->chrome().client().observedContentChange(document->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 "RequestAnimationFrameCallback.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#if ENABLE(GEOLOCATION)
+#include "NavigatorGeolocation.h"
+#endif
+#include "WKContentObservation.h"
+#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->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->mapFromLayoutToCSSUnits(static_cast<int>(view->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->mapFromLayoutToCSSUnits(static_cast<int>(view->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->mapFromLayoutToCSSUnits(static_cast<int>(view->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->mapFromLayoutToCSSUnits(static_cast<int>(view->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->document()->updateLayoutIgnorePendingStylesheets();
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+ return static_cast<int>(view->actualVisibleContentRect().x() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor()));
+#else
</ins><span class="cx"> return view->mapFromLayoutToCSSUnits(view->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->document()->updateLayoutIgnorePendingStylesheets();
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+ return static_cast<int>(view->actualVisibleContentRect().y() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor()));
+#else
</ins><span class="cx"> return view->mapFromLayoutToCSSUnits(view->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->mapFromCSSToLayoutUnits(x), view->mapFromCSSToLayoutUnits(y));
</span><ins>+#if PLATFORM(IOS)
+ view->setActualScrollPosition(view->actualVisibleContentRect().location() + scaledOffset);
+#else
</ins><span class="cx"> view->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<int>(x * m_frame->pageZoomFactor() * m_frame->frameScaleFactor());
+ int zoomedY = static_cast<int>(y * m_frame->pageZoomFactor() * m_frame->frameScaleFactor());
+ view->setActualScrollPosition(IntPoint(zoomedX, zoomedY));
+#else
</ins><span class="cx"> IntPoint layoutPos(view->mapFromCSSToLayoutUnits(x), view->mapFromCSSToLayoutUnits(y));
</span><span class="cx"> view->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->document();
+ if (timeoutId > 0 && document) {
+ DOMTimer* timer = document->findTimeout(timeoutId);
+ if (timer && WebThreadContainsObservedContentModifier(timer)) {
+ WebThreadRemoveObservedContentModifier(timer);
+
+ if (!WebThreadCountOfObservedContentModifiers()) {
+ if (Page* page = m_frame->page())
+ page->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 && 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 && document())
+ document()->deviceMotionController()->addDeviceEventListener(this);
+ else if (eventType == eventNames().deviceorientationEvent && document())
+ document()->deviceOrientationController()->addDeviceEventListener(this);
+#else
</ins><span class="cx"> else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::sharedFeatures().deviceMotionEnabled()) {
</span><span class="cx"> if (DeviceMotionController* controller = DeviceMotionController::from(page()))
</span><span class="cx"> controller->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->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->document();
+ if (++m_scrollEventListenerCount == 1 && document == document->topDocument()) {
+ Frame* frame = this->frame();
+ if (frame && frame->page())
+ frame->page()->chrome().client().setNeedsScrollNotifications(frame, true);
+ }
+}
+
+void DOMWindow::decrementScrollEventListenersCount()
+{
+ Document* document = this->document();
+ if (!--m_scrollEventListenerCount && document == document->topDocument()) {
+ Frame* frame = this->frame();
+ if (frame && frame->page() && !document->inPageCache())
+ frame->page()->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) && PLATFORM(IOS)
+ if (m_navigator)
+ NavigatorGeolocation::from(m_navigator.get())->resetAllGeolocationPermission();
+#endif
+}
+
</ins><span class="cx"> bool DOMWindow::removeEventListener(const AtomicString& 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 && 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 && document())
+ document()->deviceMotionController()->removeDeviceEventListener(this);
+ else if (eventType == eventNames().deviceorientationEvent && document())
+ document()->deviceOrientationController()->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->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->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 > 0);
+ --m_touchEventListenerCount;
+ }
+#endif
+#if ENABLE(IOS_GESTURE_EVENTS)
+ else if (eventNames().isGestureEventType(eventType)) {
+ ASSERT(m_touchEventListenerCount > 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<EventTarget> protect(*this);
</span><span class="cx"> RefPtr<Event> 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:
+ // <http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow>.
+ if (event->eventInterface() == PageTransitionEventInterfaceType) {
+ if (event->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->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->setTarget(prpTarget ? prpTarget : this);
</span><span class="cx"> event->setCurrentTarget(this);
</span><span class="cx"> event->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->document()) {
+ document->deviceMotionController()->removeAllDeviceEventListeners(this);
+ document->deviceOrientationController()->removeAllDeviceEventListeners(this);
+ }
+#else
</ins><span class="cx"> if (DeviceMotionController* controller = DeviceMotionController::from(page()))
</span><span class="cx"> controller->removeAllDeviceEventListeners(this);
</span><span class="cx"> if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
</span><span class="cx"> controller->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->document())
</span><span class="cx"> document->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 > 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<Storage> m_sessionStorage;
</span><span class="cx"> mutable RefPtr<Storage> m_localStorage;
</span><span class="cx"> mutable RefPtr<DOMApplicationCache> 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< RefPtr<ArchiveResource>>&) = 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 "PlatformTouchEventIOS.h"
+#else
</ins><span class="cx"> #include "PlatformTouchEvent.h"
</span><ins>+#endif
</ins><span class="cx"> #include "TouchEvent.h"
</span><span class="cx"> #include "TouchList.h"
</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) && !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) && !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, &EventHandler::hoverTimerFired)
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx"> , m_cursorUpdateTimer(this, &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) && !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) && !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->isBox())
</span><span class="cx"> return;
</span><span class="cx"> m_autoscrollController->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 &toFrameView(widget)->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 && isHTMLInputElement(node) && toHTMLInputElement(node)->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->renderer() ? m_clickNode->renderer()->enclosingLayer() : 0;
</span><span class="cx"> IntPoint p = view->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 && m_mousePressed)
</span><span class="cx"> return m_lastScrollbarUnderMouse->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) && !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 && scrollbar)
</span><span class="cx"> scrollbar->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->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->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) && !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx"> static const AtomicString& 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& point, HitTestRequest::HitTestRequestType hitType)
</del><ins>+static HitTestResult hitTestResultInFrame(Frame* frame, const LayoutPoint& 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) && !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx">
</span><ins>+#if ENABLE(TOUCH_EVENTS)
</ins><span class="cx"> bool EventHandler::dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent& 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& 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 <wtf/OwnPtr.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#ifdef __OBJC__
+@class WebEvent;
+@class WAKView;
+#include "WAKAppKitStubs.h"
+#else
+class WebEvent;
+#endif
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> #if PLATFORM(MAC) && !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 <wtf/HashMap.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+#include <wtf/HashSet.h>
+#include <wtf/Vector.h>
+#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&);
</span><span class="cx">
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
+ typedef Vector<RefPtr<Touch>> TouchArray;
+ typedef HashMap<EventTarget*, TouchArray*> EventTargetTouchMap;
+ typedef HashSet<RefPtr<EventTarget>> EventTargetSet;
+#endif
+
+#if ENABLE(IOS_TOUCH_EVENTS)
+ bool dispatchTouchEvent(const PlatformTouchEvent&, const AtomicString&, const EventTargetTouchMap&, float, float);
+#endif
+
+#if ENABLE(IOS_GESTURE_EVENTS)
+ bool dispatchGestureEvent(const PlatformTouchEvent&, const AtomicString&, const EventTargetSet&, 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& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode);
</span><span class="cx"> bool bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& 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) && 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) && 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&, bool shiftKey);
</span><span class="cx">
</span><span class="cx"> void hoverTimerFired(Timer<EventHandler>*);
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx"> void cursorUpdateTimerFired(Timer<EventHandler>*);
</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&);
</span><del>- HitTestResult hitTestResultInFrame(Frame*, const LayoutPoint&, 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<EventHandler> m_hoverTimer;
</span><ins>+#if ENABLE(CURSOR_SUPPORT)
</ins><span class="cx"> Timer<EventHandler> m_cursorUpdateTimer;
</span><ins>+#endif
</ins><span class="cx">
</span><span class="cx"> OwnPtr<AutoscrollController> 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<Node> 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<Frame> m_touchEventTargetSubframe;
+#endif
+
</ins><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx"> RefPtr<Element> 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<Element> 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) && !ENABLE(IOS_TOUCH_EVENTS)
</ins><span class="cx"> typedef HashMap<int, RefPtr<EventTarget>> TouchTargetMap;
</span><span class="cx"> TouchTargetMap m_originatingTouchPointTargets;
</span><span class="cx"> RefPtr<Document> 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& 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 "TiledBackingStore.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#include "WKContentObservation.h"
+#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, ("Frame"));
</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<AnimationController>(*this))
</span><ins>+#if PLATFORM(IOS)
+ , m_overflowAutoScrollTimer(this, &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 && parent->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 && parent->activeDOMObjectsAndAnimationsSuspended())
</span><span class="cx"> suspendActiveDOMObjectsAndAnimations();
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<Frame> Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
</span><span class="lines">@@ -471,6 +491,160 @@
</span><span class="cx"> return matchLabelsAgainstString(labels, element->getAttribute(idAttr));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+void Frame::scrollOverflowLayer(RenderLayer* layer, const IntRect& visibleRect, const IntRect& exposeRect)
+{
+ if (!layer)
+ return;
+
+ RenderBox* box = layer->renderBox();
+ if (!box)
+ return;
+
+ if (visibleRect.intersects(exposeRect))
+ return;
+
+ int x = layer->scrollXOffset();
+ int exposeLeft = exposeRect.x();
+ int exposeRight = exposeLeft + exposeRect.width();
+ int clientWidth = box->clientWidth();
+ if (exposeLeft <= 0)
+ x = std::max(0, x + exposeLeft - clientWidth / 2);
+ else if (exposeRight >= clientWidth)
+ x = std::min(box->scrollWidth() - clientWidth, x + clientWidth / 2);
+
+ int y = layer->scrollYOffset();
+ int exposeTop = exposeRect.y();
+ int exposeBottom = exposeTop + exposeRect.height();
+ int clientHeight = box->clientHeight();
+ if (exposeTop <= 0)
+ y = std::max(0, y + exposeTop - clientHeight / 2);
+ else if (exposeBottom >= clientHeight)
+ y = std::min(box->scrollHeight() - clientHeight, y + clientHeight / 2);
+
+ layer->scrollToOffset(IntSize(x, y));
+ selection().setCaretRectNeedsUpdate();
+ selection().updateAppearance();
+}
+
+void Frame::overflowAutoScrollTimerFired(Timer<Frame>*)
+{
+ if (!eventHandler().mousePressed() || checkOverflowScroll(PerformOverflowScroll) == OverflowScrollNone) {
+ if (m_overflowAutoScrollTimer.isActive())
+ m_overflowAutoScrollTimer.stop();
+ }
+}
+
+void Frame::startOverflowAutoScroll(const IntPoint& 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()->renderer();
+ if (!renderer)
+ return OverflowScrollNone;
+
+ FrameView* view = this->view();
+ if (!view)
+ return OverflowScrollNone;
+
+ RenderBlock* containingBlock = renderer->containingBlock();
+ if (!containingBlock || !containingBlock->hasOverflowClip())
+ return OverflowScrollNone;
+ RenderLayer* layer = containingBlock->layer();
+ ASSERT(layer);
+
+ IntRect visibleRect = IntRect(view->scrollX(), view->scrollY(), view->visibleWidth(), view->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() < visibleRect.x()) {
+ scrollType |= OverflowScrollLeft;
+ if (action == PerformOverflowScroll) {
+ deltaX -= static_cast<int>(m_overflowAutoScrollDelta);
+ selectionPosition.setX(view->scrollX() - scrollBoundsAdjustment);
+ }
+ } else if (position.x() > visibleRect.maxX()) {
+ scrollType |= OverflowScrollRight;
+ if (action == PerformOverflowScroll) {
+ deltaX += static_cast<int>(m_overflowAutoScrollDelta);
+ selectionPosition.setX(view->scrollX() + view->visibleWidth() + scrollBoundsAdjustment);
+ }
+ }
+
+ if (position.y() < visibleRect.y()) {
+ scrollType |= OverflowScrollUp;
+ if (action == PerformOverflowScroll) {
+ deltaY -= static_cast<int>(m_overflowAutoScrollDelta);
+ selectionPosition.setY(view->scrollY() - scrollBoundsAdjustment);
+ }
+ } else if (position.y() > visibleRect.maxY()) {
+ scrollType |= OverflowScrollDown;
+ if (action == PerformOverflowScroll) {
+ deltaY += static_cast<int>(m_overflowAutoScrollDelta);
+ selectionPosition.setY(view->scrollY() + view->visibleHeight() + scrollBoundsAdjustment);
+ }
+ }
+
+ if (action == PerformOverflowScroll && (deltaX || deltaY)) {
+ layer->scrollToOffset(IntSize(layer->scrollXOffset() + deltaX, layer->scrollYOffset() + deltaY));
+
+ // Handle making selection.
+ VisiblePosition visiblePosition(renderer->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& pageSize, const FloatSize& 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() && page()->scrollingCoordinator() && m_view)
</span><span class="cx"> page()->scrollingCoordinator()->willDestroyScrollableArea(m_view.get());
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+ if (WebThreadCountOfObservedContentModifiers() > 0 && m_page)
+ m_page->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& viewportSize, const Color& backgroundColor, bool transparent,
</span><del>- const IntSize& fixedLayoutSize, const IntRect& fixedVisibleContentRect ,
</del><ins>+ const IntSize& fixedLayoutSize, const IntRect& 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->setFixedLayoutSize(fixedLayoutSize);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> frameView->setFixedVisibleContentRect(fixedVisibleContentRect);
</span><ins>+#else
+ UNUSED_PARAM(fixedVisibleContentRect);
+#endif
</ins><span class="cx"> frameView->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 "UserScriptTypes.h"
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#include "ViewportArguments.h"
+#include "VisibleSelection.h"
+#endif
+
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> #include "FrameWin.h"
</span><span class="cx"> #endif
</span><span class="lines">@@ -45,6 +50,13 @@
</span><span class="cx"> #include "TiledBackingStoreClient.h"
</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 << 0,
+ OverflowScrollRight = 1 << 1,
+ OverflowScrollUp = 1 << 2,
+ OverflowScrollDown = 1 << 3
+ };
+
+ enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll };
+ typedef Node* (*NodeQualifier)(const HitTestResult&, 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<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
</span><span class="cx">
</span><span class="cx"> void init();
</span><ins>+#if PLATFORM(IOS)
+ // Creates <html><body style="..."></body></html> doing minimal amount of work.
+ void initWithSimpleHTMLDocument(const String& style, const URL&);
+#endif
</ins><span class="cx"> void setView(PassRefPtr<FrameView>);
</span><span class="cx"> void createView(const IntSize&, const Color&, bool,
</span><span class="cx"> const IntSize& fixedLayoutSize = IntSize(), const IntRect& 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& viewportArguments() const;
+ void setViewportArguments(const ViewportArguments&);
+
+ Node* deepestNodeAtLocation(const FloatPoint& viewportLocation);
+ Node* nodeRespondingToClickEvents(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);
+ Node* nodeRespondingToScrollWheelEvents(const FloatPoint& 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&, 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& visibleRect, const IntRect& exposeRect);
+
+ int preferredHeight() const;
+ int innerLineHeight(DOMNode*) const;
+ void updateLayout() const;
+ NSRect caretRect() const;
+ NSRect rectForScrollToVisible() const;
+ NSRect rectForSelection(VisibleSelection&) 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 > 0; }
</span><span class="lines">@@ -224,6 +306,27 @@
</span><span class="cx"> const OwnPtr<EventHandler> m_eventHandler;
</span><span class="cx"> const std::unique_ptr<AnimationController> m_animationController;
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+ void betterApproximateNode(const IntPoint& testPoint, NodeQualifier, Node*& best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect);
+ bool hitTestResultAtViewportLocation(const FloatPoint& viewportLocation, HitTestResult&, IntPoint& center);
+ Node* qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, NodeQualifier, bool shouldApproximate);
+
+ void overflowAutoScrollTimerFired(Timer<Frame>*);
+ void startOverflowAutoScroll(const IntPoint&);
+ int checkOverflowScroll(OverflowScrollAction);
+
+ void setTimersPausedInternal(bool);
+
+ Timer<Frame> 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 "RenderScrollbar.h"
</span><span class="cx"> #include "RenderScrollbarPart.h"
</span><span class="cx"> #include "RenderStyle.h"
</span><ins>+#include "RenderText.h"
</ins><span class="cx"> #include "RenderTheme.h"
</span><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "RenderWidget.h"
</span><span class="lines">@@ -98,6 +99,19 @@
</span><span class="cx"> #include "TextAutosizer.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#include "DocumentLoader.h"
+#include "Logging.h"
+#include "MemoryCache.h"
+#include "MemoryPressureHandler.h"
+#include "SystemMemory.h"
+#include "TileCache.h"
+#endif
+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include "HTMLMediaElement.h"
+#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->tileCache())
+ tileCache->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->tileCache())
+ tileCache->doPendingRepaints();
+#endif
+
</ins><span class="cx"> renderView->compositor().flushPendingLayerChanges(rootFrameForFlush == &frame());
</span><span class="cx">
</span><span class="cx"> return true;
</span><span class="lines">@@ -894,6 +923,39 @@
</span><span class="cx"> page->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& widget : children()) {
+ if (widget->platformWidget() != platformWidget)
+ continue;
+ foundWidget = widget.get();
+ break;
+ }
+
+ if (!foundWidget)
+ return nullptr;
+
+ auto* renderWidget = RenderWidget::find(foundWidget);
+ if (!renderWidget)
+ return nullptr;
+
+ RenderLayer* widgetLayer = renderWidget->layer();
+ if (!widgetLayer || !widgetLayer->isComposited())
+ return nullptr;
+
+ return widgetLayer->backing()->parentForSublayers();
+}
+
+void FrameView::scheduleLayerFlushAllowingThrottling()
+{
+ RenderView* view = this->renderView();
+ if (!view)
+ return;
+ view->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() && !fixedLayoutSize().isEmpty() && 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->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->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& 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& renderer, unsigned countSoFar, unsigned threshold)
+{
+ // FIXME: Consider writing this using RenderObject::nextInPreOrder() instead of using recursion.
+ if (renderer.isText())
+ countSoFar += toRenderText(renderer).text()->length();
+
+ for (RenderObject* child = renderer.firstChildSlow(); child; child = child->nextSibling()) {
+ if (countSoFar >= threshold)
+ break;
+ countSoFar = countRenderedCharactersInRenderObjectWithThreshold(*child, countSoFar, threshold);
+ }
+ return countSoFar;
+}
+
+bool FrameView::renderedCharactersExceed(unsigned threshold)
+{
+ if (!m_frame->contentRenderer())
+ return false;
+ return countRenderedCharactersInRenderObjectWithThreshold(*m_frame->contentRenderer(), 0, threshold) >= 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->contentRenderer()) {
+ if (useCustomFixedPositionLayoutRect() && 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->compositor().enableCompositingMode();
+ }
+ }
+#endif
+
</ins><span class="cx"> if (!useFixedLayout() && needsLayout())
</span><span class="cx"> layout();
</span><span class="cx">
</span><span class="lines">@@ -2320,6 +2430,10 @@
</span><span class="cx"> if (renderView && renderView->layer()->backing())
</span><span class="cx"> renderView->layer()->backing()->adjustTiledBackingCoverage();
</span><span class="cx"> #endif
</span><ins>+#if PLATFORM(IOS)
+ if (TileCache* tileCache = this->tileCache())
+ tileCache->setSpeculativeTileCreationEnabled(!m_frame->page()->progress().isMainLoadProgressing());
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FrameView::layoutTimerFired(Timer<FrameView>*)
</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->chrome().client().didLayout();
+#endif
+
</ins><span class="cx"> if (milestonesAchieved && 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() && !fixedLayoutSize().isEmpty() && 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->style().zoom();
</span><span class="cx"> bool shouldSendResizeEvent = !m_firstLayout && (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->isLoadingInAPISense())
+ return;
+ }
+#endif
+
</ins><span class="cx"> bool isMainFrame = frame().isMainFrame();
</span><span class="cx"> bool canSendResizeEventSynchronously = isMainFrame && !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 && memoryPressureHandler().hasReceivedMemoryPressure()) {
+ LOG(MemoryPressure, "Under memory pressure: %s", __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()->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 && memoryPressureHandler().hasReceivedMemoryPressure())
+ memoryCache()->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->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& rect)
+{
+ if (m_useCustomFixedPositionLayoutRect && 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->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&);
+ 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&) OVERRIDE;
</span><ins>+#endif
</ins><span class="cx"> virtual void setScrollPosition(const IntPoint&) 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 && m_frame->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) && 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 <wtf/StdLibExtras.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#include "WebCoreSystemInterface.h"
+#endif
+
</ins><span class="cx"> #ifndef WEBCORE_NAVIGATOR_PLATFORM
</span><del>-#if OS(MAC_OS_X) && (CPU(PPC) || CPU(PPC64))
</del><ins>+#if PLATFORM(IOS)
+#define WEBCORE_NAVIGATOR_PLATFORM ""
+#elif OS(MAC_OS_X) && (CPU(PPC) || CPU(PPC64))
</ins><span class="cx"> #define WEBCORE_NAVIGATOR_PLATFORM "MacPPC"
</span><span class="cx"> #elif OS(MAC_OS_X) && (CPU(X86) || CPU(X86_64))
</span><span class="cx"> #define WEBCORE_NAVIGATOR_PLATFORM "MacIntel"
</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 <wtf/SchedulePair.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#include "Settings.h"
+#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<StorageNamespace>);
</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->maxParseDuration() != -1; }
+ double customHTMLTokenizerTimeDelay() const { ASSERT(m_settings->maxParseDuration() != -1); return m_settings->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& url)
+{
+ LinkHash hash = visitedLinkHash(url.string());
+ ASSERT(m_visitedLinkHashes.contains(hash));
+ m_visitedLinkHashes.remove(hash);
+
+ Page::allVisitedStateChanged(this);
+ pageCache()->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&);
</span><span class="cx"> void addVisitedLink(const UChar*, size_t);
</span><span class="cx"> void addVisitedLinkHash(LinkHash);
</span><ins>+ void removeVisitedLink(const URL&);
</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 "config.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx">
</span><ins>+#include "AudioSession.h"
</ins><span class="cx"> #include "BackForwardController.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="cx"> #include "CookieStorage.h"
</span><span class="lines">@@ -45,7 +46,9 @@
</span><span class="cx"> #include "StorageMap.h"
</span><span class="cx"> #include "TextAutosizer.h"
</span><span class="cx"> #include <limits>
</span><ins>+#include <wtf/NeverDestroyed.h>
</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<FontGenericFamilies>())
</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->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<AudioSession::CategoryType>(sessionCategory));
+}
+
+unsigned Settings::audioSessionCategoryOverride()
+{
+ return AudioSession::sharedSession().categoryOverride();
+}
+
+void Settings::setNetworkDataUsageTrackingEnabled(bool trackingEnabled)
+{
+ gNetworkDataUsageTrackingEnabled = trackingEnabled;
+}
+
+bool Settings::networkDataUsageTrackingEnabled()
+{
+ return gNetworkDataUsageTrackingEnabled;
+}
+
+static String& sharedNetworkInterfaceNameGlobal()
+{
+ static NeverDestroyed<String> networkInterfaceName;
+ return networkInterfaceName;
+}
+
+void Settings::setNetworkInterfaceName(const String& networkInterfaceName)
+{
+ sharedNetworkInterfaceNameGlobal() = networkInterfaceName;
+}
+
+const String& 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&);
+ static const String& 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<FontGenericFamilies> 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<Length>(CSSPropertyLineHeight, &RenderStyle::specifiedLineHeight, &RenderStyle::setLineHeight),
</span><span class="cx"> new PropertyWrapper<int>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset),
</span><span class="cx"> new PropertyWrapper<unsigned short>(CSSPropertyOutlineWidth, &RenderStyle::outlineWidth, &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 <rdar://problem/5020763>.
+#if !PLATFORM(IOS)
</ins><span class="cx"> new PropertyWrapper<int>(CSSPropertyLetterSpacing, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing),
</span><span class="cx"> new PropertyWrapper<int>(CSSPropertyWordSpacing, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing),
</span><ins>+#else
+ new PropertyWrapper<float>(CSSPropertyLetterSpacing, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing),
+ new PropertyWrapper<float>(CSSPropertyWordSpacing, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing),
+#endif
</ins><span class="cx"> new LengthPropertyWrapper<Length>(CSSPropertyTextIndent, &RenderStyle::textIndent, &RenderStyle::setTextIndent),
</span><span class="cx">
</span><span class="cx"> new PropertyWrapper<float>(CSSPropertyWebkitPerspective, &RenderStyle::perspective, &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 "config.h"
+#import "EventHandler.h"
+
+#import "AXObjectCache.h"
+#import "BlockExceptions.h"
+#import "Chrome.h"
+#import "ChromeClient.h"
+#import "FocusController.h"
+#import "Frame.h"
+#import "FrameView.h"
+#import "KeyboardEvent.h"
+#import "MouseEventWithHitTestResults.h"
+#import "Page.h"
+#import "PlatformEventFactoryIOS.h"
+#import "PlatformKeyboardEvent.h"
+#import "RenderWidget.h"
+#import "WAKView.h"
+#import "WAKWindow.h"
+#import "WebEvent.h"
+#import <wtf/NeverDestroyed.h>
+#import <wtf/Noncopyable.h>
+
+#if ENABLE(IOS_TOUCH_EVENTS)
+#import <WebKitAdditions/EventHandlerIOSTouch.cpp>
+#endif
+
+namespace WebCore {
+
+static RetainPtr<WebEvent>& currentEventSlot()
+{
+ NeverDestroyed<RetainPtr<WebEvent>> event;
+ return event;
+}
+
+WebEvent *EventHandler::currentEvent()
+{
+ return currentEventSlot().get();
+}
+
+class CurrentEventScope {
+ WTF_MAKE_NONCOPYABLE(CurrentEventScope);
+public:
+ CurrentEventScope(WebEvent *);
+ ~CurrentEventScope();
+
+private:
+ RetainPtr<WebEvent> m_savedCurrentEvent;
+#ifndef NDEBUG
+ RetainPtr<WebEvent> 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->chrome().client().keyboardUIMode();
+ bool handlingOptionTab = isKeyboardOptionTab(event);
+
+ // If tab-to-links is off, option-tab always highlights all controls.
+ if ((keyboardUIMode & KeyboardAccessTabsToLinks) == 0 && handlingOptionTab)
+ return true;
+
+ // If system preferences say to include all controls, we always include all controls.
+ if (keyboardUIMode & KeyboardAccessFull)
+ return true;
+
+ // Otherwise tab-to-links includes all controls, unless the sense is flipped via option-tab.
+ if (keyboardUIMode & 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->documentView())
+ page->chrome().focusNSView(documentView);
+ }
+
+ page->focusController().setFocusedFrame(&m_frame);
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
+{
+ // Figure out which view to send the event to.
+ RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : nullptr;
+ if (!target || !target->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)->widget());
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
+{
+ return passMouseDownEventToWidget(renderWidget->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
+ && EventHandler::currentEvent() != currentEventAfterHandlingMouseDown
+ && currentEventAfterHandlingMouseDown.type == WebEventMouseUp
+ && currentEventAfterHandlingMouseDown.timestamp >= 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<Widget> widget = pWidget;
+
+ if (!widget) {
+ LOG_ERROR("hit a RenderWidget without a corresponding Widget, means a frame is half-constructed");
+ return true;
+ }
+
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+ NSView *nodeView = widget->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->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] && [view needsPanelToBecomeKey])
+ page->chrome().client().makeFirstResponder(view);
+ }
+
+ // We need to "defer loading" 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->defersLoading();
+ if (!wasDeferringLoading)
+ page->setDefersLoading(true);
+
+ ASSERT(!m_sendingEventToSubview);
+ m_sendingEventToSubview = true;
+ [view mouseDown:currentEvent()];
+ m_sendingEventToSubview = false;
+
+ if (!wasDeferringLoading)
+ page->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->platformWidget() : nil;
+ if (!topView || !findViewInSubviews(topView, mouseDownView)) {
+ m_mouseDownView = nil;
+ return nil;
+ }
+ return mouseDownView;
+}
+
+bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
+{
+ return false;
+}
+
+bool EventHandler::eventLoopHandleMouseUp(const MouseEventWithHitTestResults&)
+{
+ 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& 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->eventHandler().handleMouseMoveEvent(currentPlatformMouseEvent(), hoveredNode);
+ m_sendingEventToSubview = false;
+ return true;
+ }
+ case WebEventMouseDown: {
+ Node* node = event.targetNode();
+ if (!node)
+ return false;
+ RenderObject* renderer = node->renderer();
+ if (!renderer || !renderer->isWidget())
+ return false;
+ Widget* widget = toRenderWidget(renderer)->widget();
+ if (!widget || !widget->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->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&, Widget* widget)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+ if (currentEvent().type != WebEventScrollWheel || m_sendingEventToSubview || !widget)
+ return false;
+
+ NSView* nodeView = widget->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()->updateStyleIfNeeded();
+
+ WKBeginObservingContentChanges(true);
+ CurrentEventScope scope(event);
+ event.wasHandled = mouseMoved(currentPlatformMouseEvent());
+ m_frame.document()->updateStyleIfNeeded();
+ WKStopObservingContentChanges();
+
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+ return passSubframeEventToSubframe(mev, subframe);
+}
+
+bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode)
+{
+ return passSubframeEventToSubframe(mev, subframe, hoveredNode);
+}
+
+bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& 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 <https://bugs.webkit.org/show_bug.cgi?id=21107> 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 "config.h"
+#import "Frame.h"
+
+#if PLATFORM(IOS)
+
+#import "AnimationController.h"
+#import "BlockExceptions.h"
+#import "DOMCSSStyleDeclarationInternal.h"
+#import "DOMCore.h"
+#import "DOMInternal.h"
+#import "DOMNodeInternal.h"
+#import "DOMWindow.h"
+#import "Document.h"
+#import "DocumentMarker.h"
+#import "DocumentMarkerController.h"
+#import "Editor.h"
+#import "EditorClient.h"
+#import "EventHandler.h"
+#import "EventNames.h"
+#import "FormController.h"
+#import "FrameSelection.h"
+#import "FrameSnapshottingMac.h"
+#import "FrameView.h"
+#import "HTMLAreaElement.h"
+#import "HTMLDocument.h"
+#import "HTMLElement.h"
+#import "HTMLNames.h"
+#import "HTMLObjectElement.h"
+#import "HitTestRequest.h"
+#import "HitTestResult.h"
+#import "JSDOMWindowBase.h"
+#import "MainFrame.h"
+#import "NodeRenderStyle.h"
+#import "NodeTraversal.h"
+#import "Page.h"
+#import "PageTransitionEvent.h"
+#import "PropertySetCSSStyleDeclaration.h"
+#import "RenderLayer.h"
+#import "RenderLayerCompositor.h"
+#import "RenderTextControl.h"
+#import "RenderView.h"
+#import "TextBoundaries.h"
+#import "TextIterator.h"
+#import "VisiblePosition.h"
+#import "VisibleUnits.h"
+#import "WAKWindow.h"
+#import "WebCoreSystemInterface.h"
+#import <runtime/JSLock.h>
+
+using namespace WebCore::HTMLNames;
+using namespace WTF::Unicode;
+
+using JSC::JSLockHolder;
+
+namespace WebCore {
+
+// Create <html><body (style="...")></body></html> doing minimal amount of work.
+void Frame::initWithSimpleHTMLDocument(const String& style, const URL& url)
+{
+ m_loader.initForSynthesizedDocument(url);
+
+ RefPtr<HTMLDocument> document = HTMLDocument::createSynthesizedDocument(this, url);
+ document->setCompatibilityMode(Document::LimitedQuirksMode);
+ document->createDOMWindow();
+ setDocument(document);
+
+ ExceptionCode ec;
+ RefPtr<Element> rootElement = document->createElementNS(xhtmlNamespaceURI, ASCIILiteral("html"), ec);
+
+ RefPtr<Element> body = document->createElementNS(xhtmlNamespaceURI, ASCIILiteral("body"), ec);
+ if (!style.isEmpty())
+ body->setAttribute(HTMLNames::styleAttr, style);
+
+ rootElement->appendChild(body, ec);
+ document->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()->selection().isNone())
+ return result;
+
+ RefPtr<Range> searchRange(rangeOfContents(*document()));
+ VisiblePosition start(page()->selection().start(), page()->selection().affinity());
+ VisiblePosition oneBeforeStart = start.previous();
+
+ setEnd(searchRange.get(), oneBeforeStart.isNotNull() ? oneBeforeStart : start);
+
+ int exception = 0;
+ if (searchRange->collapsed(exception))
+ return result;
+
+ WordAwareIterator it(searchRange.get());
+ while (!it.atEnd()) {
+ const UChar* chars = it.characters();
+ int length = it.length();
+ if (length > 1 || !isSpaceOrNewline(chars[0])) {
+ int startOfWordBoundary = 0;
+ for (int i = 1; i < length; i++) {
+ if (isSpaceOrNewline(chars[i]) || chars[i] == 0xA0) {
+ int wordLength = i - startOfWordBoundary;
+ NSString *chunk = [[NSString alloc] initWithCharactersNoCopy:const_cast<unichar*>(chars) + startOfWordBoundary length:wordLength freeWhenDone:NO];
+ if ([chunk isEqualToString:word])
+ ++result;
+ [chunk release];
+ startOfWordBoundary += wordLength + 1;
+ }
+ }
+ if (startOfWordBoundary < length) {
+ NSString *chunk = [[NSString alloc] initWithCharactersNoCopy:const_cast<unichar*>(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()->updateLayout();
+
+ if (!page() || !page()->selection().isCaret())
+ return nil;
+
+ VisiblePosition position(page()->selection().start(), page()->selection().affinity());
+ VisiblePosition end(position);
+ if (!isStartOfParagraph(end)) {
+ VisiblePosition previous = end.previous();
+ UChar c(previous.characterAfter());
+ if (!iswpunct(c) && !isSpaceOrNewline(c) && c != 0xA0)
+ end = startOfWord(end);
+ }
+ VisiblePosition start(startOfParagraph(end));
+
+ RefPtr<Range> searchRange(rangeOfContents(*document()));
+ setStart(searchRange.get(), start);
+ setEnd(searchRange.get(), end);
+
+ int exception = 0;
+ if (searchRange->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 > 1 || !isSpaceOrNewline(chars[0])) {
+ int startOfWordBoundary = 0;
+ for (int i = 1; i < length; i++) {
+ if (isSpaceOrNewline(chars[i]) || chars[i] == 0xA0) {
+ int wordLength = i - startOfWordBoundary;
+ if (wordLength > 0) {
+ NSString *chunk = [[NSString alloc] initWithCharactersNoCopy:const_cast<unichar*>(chars) + startOfWordBoundary length:wordLength freeWhenDone:NO];
+ [words addObject:chunk];
+ [chunk release];
+ }
+ startOfWordBoundary += wordLength + 1;
+ }
+ }
+ if (startOfWordBoundary < length) {
+ NSString *chunk = [[NSString alloc] initWithCharactersNoCopy:const_cast<unichar*>(chars) + startOfWordBoundary length:length - startOfWordBoundary freeWhenDone:NO];
+ [words addObject:chunk];
+ [chunk release];
+ }
+ }
+ it.advance();
+ }
+
+ if ([words count] > 0 && isEndOfParagraph(position) && !isStartOfParagraph(position)) {
+ VisiblePosition previous = position.previous();
+ UChar c(previous.characterAfter());
+ if (!isSpaceOrNewline(c) && 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->renderBox())
+ return CGRectZero;
+
+ // FIXME: why this layer check?
+ RenderLayer* layer = m_doc->renderBox()->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->renderer();
+ RenderObject* renderer = hitRenderer;
+#if RECT_LOGGING
+ printf("\n%f %f\n", point.x, point.y);
+#endif
+ while (renderer && !renderer->isBody() && !renderer->isRoot()) {
+#if RECT_LOGGING
+ CGRect rect = renderer->absoluteBoundingBoxRect(true);
+ if (renderer->node()) {
+ const char *nodeName = renderer->node()->nodeName().ascii().data();
+ printf("%s %f %f %f %f\n", nodeName, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
+ }
+#endif
+ if (renderer->isRenderBlock() || renderer->isInlineBlockOrInlineTable() || renderer->isReplaced()) {
+ *isReplaced = renderer->isReplaced();
+#if CHECK_FONT_SIZE
+ for (RenderObject* textRenderer = hitRenderer; textRenderer; textRenderer = textRenderer->traverseNext(hitRenderer)) {
+ if (textRenderer->isText()) {
+ *fontSize = textRenderer->font(true).pixelSize();
+ break;
+ }
+ }
+#endif
+ IntRect targetRect = renderer->absoluteBoundingBoxRect(true);
+ for (Widget* currView = &(renderer->view().frameView()); currView && currView != view(); currView = currView->parent())
+ targetRect = currView->convertToContainingView(targetRect);
+
+ return targetRect;
+ }
+ renderer = renderer->parent();
+ }
+
+ return CGRectZero;
+}
+
+#define ALLOW_SCROLL_LISTENERS 0
+
+static Node* ancestorRespondingToScrollWheelEvents(const HitTestResult& hitTestResult, Node* terminationNode, IntRect* nodeBounds)
+{
+ if (nodeBounds)
+ *nodeBounds = IntRect();
+
+ Node* scrollingAncestor = nullptr;
+ for (Node* node = hitTestResult.innerNode(); node && node != terminationNode && !node->hasTagName(HTMLNames::bodyTag); node = node->parentNode()) {
+#if ALLOW_SCROLL_LISTENERS
+ if (node->willRespondToMouseWheelEvents()) {
+ scrollingAncestor = node;
+ continue;
+ }
+#endif
+
+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ continue;
+
+ if ((renderer->isTextField() || renderer->isTextArea()) && toRenderTextControl(renderer)->canScroll()) {
+ scrollingAncestor = node;
+ continue;
+ }
+
+ RenderStyle& style = renderer->style();
+
+ if (renderer->hasOverflowClip() &&
+ (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& hitTestResult, Node* terminationNode, IntRect* nodeBounds)
+{
+ bool bodyHasBeenReached = false;
+ bool pointerCursorStillValid = true;
+
+ if (nodeBounds)
+ *nodeBounds = IntRect();
+
+ Node* pointerCursorNode = nullptr;
+ for (Node* node = hitTestResult.innerNode(); node && node != terminationNode; node = node->parentNode()) {
+ ASSERT(!node->isInShadowTree());
+
+ // We only accept pointer nodes before reaching the body tag.
+ if (node->hasTagName(HTMLNames::bodyTag)) {
+#if USE(UIKIT_EDITING)
+ // Make sure we cover the case of an empty editable body.
+ if (!pointerCursorNode && node->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 && (node->hasTagName(HTMLNames::tableTag) || node->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 && node->renderStyle() && node->renderStyle()->cursor() == CURSOR_POINTER)
+ pointerCursorNode = node;
+ // We want the lowest unbroken chain of pointer cursors.
+ else if (pointerCursorNode)
+ pointerCursorStillValid = false;
+
+ if (node->willRespondToMouseClickEvents() || node->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() && node != hitTestResult.innerNonSharedNode() && node->hasTagName(HTMLNames::areaTag))
+ *nodeBounds = pixelSnappedIntRect(toHTMLAreaElement(node)->computeRect(hitTestResult.innerNonSharedNode()->renderer()));
+ else if (node && node->renderer())
+ *nodeBounds = node->renderer()->absoluteBoundingBoxRect(true);
+ }
+
+ return node;
+ }
+ }
+
+ return nullptr;
+}
+
+void Frame::betterApproximateNode(const IntPoint& testPoint, NodeQualifier nodeQualifierFunction, Node*& best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect)
+{
+ IntRect candidateRect;
+ Node* candidate = nodeQualifierFunction(eventHandler().hitTestResultAtPoint(testPoint), failedNode, &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->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() <= 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& viewportLocation, HitTestResult& hitTestResult, IntPoint& center)
+{
+ if (!m_doc || !m_doc->renderView())
+ return false;
+
+ FrameView* view = m_view.get();
+ if (!view)
+ return false;
+
+ center = view->windowToContents(roundedIntPoint(viewportLocation));
+ hitTestResult = eventHandler().hitTestResultAtPoint(center);
+ return true;
+}
+
+Node* Frame::qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& 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 && approximateNode->isContentEditable()) {
+ // If we are in editable content, we look for the root editable element.
+ approximateNode = approximateNode->rootEditableElement();
+ // If we have a focusable node, there is no need to approximate.
+ if (approximateNode)
+ shouldApproximate = false;
+ }
+#endif
+ if (approximateNode && shouldApproximate) {
+ float scale = page() ? page()->pageScaleFactor() : 1;
+
+ const int defaultMaxRadius = 15;
+ int maxRadius = scale < 1 ? static_cast<int>(defaultMaxRadius / scale) : defaultMaxRadius;
+
+ const float testOffsets[] = {
+ -.3f, -.3f,
+ -.6f, -.6f,
+ +.3f, +.3f,
+ -.9f, -.9f,
+ };
+
+ Node* originalApproximateNode = approximateNode;
+ for (unsigned n = 0; n < 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 && candidateNode->isDescendantOf(originalApproximateNode)) {
+ approximateNode = candidateNode;
+ bestPoint = testPoint;
+ break;
+ }
+ }
+ } else if (!approximateNode && shouldApproximate) {
+ // Grab the closest parent element of our failed candidate node.
+ Node* candidate = candidateInfo.innerNode();
+ Node* failedNode = candidate;
+
+ while (candidate && !candidate->isElementNode())
+ candidate = candidate->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()->pageScaleFactor() : 1;
+
+ const int defaultMaxRadius = 15;
+ int maxRadius = (scale < 1.0) ? static_cast<int>(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 < 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 > 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->contentsToWindow(bestPoint);
+ adjustedViewportLocation = p;
+#if USE(UIKIT_EDITING)
+ if (approximateNode->isContentEditable()) {
+ // When in editable content, look for the root editable node again,
+ // since this could be the node found with the approximation.
+ approximateNode = approximateNode->rootEditableElement();
+ }
+#endif
+ }
+
+ return approximateNode;
+}
+
+Node* Frame::deepestNodeAtLocation(const FloatPoint& viewportLocation)
+{
+ IntPoint center;
+ HitTestResult hitTestResult;
+ if (!hitTestResultAtViewportLocation(viewportLocation, hitTestResult, center))
+ return nullptr;
+
+ return hitTestResult.innerNode();
+}
+
+Node* Frame::nodeRespondingToClickEvents(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation)
+{
+ return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, &ancestorRespondingToClickEvents, true);
+}
+
+Node* Frame::nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation)
+{
+ FloatPoint adjustedViewportLocation;
+ return qualifyingNodeAtViewportLocation(viewportLocation, adjustedViewportLocation, &ancestorRespondingToScrollWheelEvents, false);
+}
+
+int Frame::preferredHeight() const
+{
+ Document* document = this->document();
+ if (!document)
+ return 0;
+
+ document->updateLayout();
+
+ Node* body = document->body();
+ if (!body)
+ return 0;
+
+ RenderObject* renderer = body->renderer();
+ if (!renderer || !renderer->isRenderBlock())
+ return 0;
+
+ RenderBlock* block = toRenderBlock(renderer);
+ return block->height() + block->marginTop() + block->marginBottom();
+}
+
+int Frame::innerLineHeight(DOMNode* domNode) const
+{
+ if (!domNode)
+ return 0;
+
+ Document* document = this->document();
+ if (!document)
+ return 0;
+
+ document->updateLayout();
+
+ Node* node = core(domNode);
+ if (!node)
+ return 0;
+
+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ return 0;
+
+ return renderer->innerLineHeight();
+}
+
+void Frame::updateLayout() const
+{
+ Document* document = this->document();
+ if (!document)
+ return;
+
+ document->updateLayout();
+
+ if (FrameView* view = this->view())
+ view->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->selection().selection());
+ return rectForSelection(selection);
+}
+
+NSRect Frame::rectForSelection(VisibleSelection& selection) const
+{
+ if (selection.isNone())
+ return CGRectZero;
+
+ if (selection.isCaret())
+ return caretRect();
+
+ EditorClient* client = editor().client();
+ if (client)
+ client->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<Frame*>(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<Frame*>(this));
+ endFrameSelection.suppressCloseTyping();
+ endFrameSelection.setSelection(selection);
+ FloatRect endRect(endFrameSelection.absoluteCaretBounds());
+ endFrameSelection.restoreCloseTyping();
+
+ if (client)
+ client->restoreSelectionNotifications();
+
+ return unionRect(startRect, endRect);
+}
+
+DOMCSSStyleDeclaration* Frame::styleAtSelectionStart() const
+{
+ Position start = selection().start();
+ RefPtr<EditingStyle> editingStyle = EditingStyle::styleAtSelectionStart(selection().selection());
+ if (!editingStyle)
+ return nullptr;
+ PropertySetCSSStyleDeclaration* propertySetCSSStyleDeclaration = new PropertySetCSSStyleDeclaration(editingStyle->style());
+ // The auto-generated code for DOMCSSStyleDeclaration derefs its pointer when it is deallocated.
+ return kit(static_cast<CSSStyleDeclaration*>(propertySetCSSStyleDeclaration));
+}
+
+unsigned Frame::formElementsCharacterCount() const
+{
+ Document* document = this->document();
+ if (!document)
+ return 0;
+ return document->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()->suspendScheduledTasks(ActiveDOMObject::DocumentWillBePaused);
+ }
+ } else {
+ --m_timersPausedCount;
+ ASSERT(m_timersPausedCount >= 0);
+ if (m_timersPausedCount == 0) {
+ if (document())
+ document()->resumeScheduledTasks(ActiveDOMObject::DocumentWillBePaused);
+
+ // clearTimers() suspended animations and pending relayouts, reschedule if needed.
+ animation().resumeAnimationsForDocument(document());
+
+ if (view())
+ view()->scheduleRelayout();
+ }
+ }
+
+ // We need to make sure all subframes' states are up to date.
+ for (Frame* frame = tree().firstChild(); frame; frame = frame->tree().nextSibling())
+ frame->setTimersPausedInternal(paused);
+}
+
+void Frame::dispatchPageHideEventBeforePause()
+{
+ ASSERT(isMainFrame());
+ if (!isMainFrame())
+ return;
+
+ for (Frame* frame = this; frame; frame = frame->tree().traverseNext(this))
+ frame->document()->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, true), document());
+}
+
+void Frame::dispatchPageShowEventBeforeResume()
+{
+ ASSERT(isMainFrame());
+ if (!isMainFrame())
+ return;
+
+ for (Frame* frame = this; frame; frame = frame->tree().traverseNext(this))
+ frame->document()->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pageshowEvent, true), document());
+}
+
+void Frame::setRangedSelectionBaseToCurrentSelection()
+{
+ m_rangedSelectionBase = selection().selection();
+}
+
+void Frame::setRangedSelectionBaseToCurrentSelectionStart()
+{
+ FrameSelection& frameSelection = selection();
+ m_rangedSelectionBase = VisibleSelection(frameSelection.selection().start(), frameSelection.affinity());
+}
+
+void Frame::setRangedSelectionBaseToCurrentSelectionEnd()
+{
+ FrameSelection& 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& frameSelection = selection();
+ m_rangedSelectionInitialExtent = VisibleSelection(frameSelection.selection().start(), frameSelection.affinity());
+}
+
+void Frame::setRangedSelectionInitialExtentToCurrentSelectionEnd()
+{
+ FrameSelection& 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->tree().nextSibling())
+ child->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()->body() : selection().rootEditableElement();
+ unsigned rootChildCount = root->childNodeCount();
+ RefPtr<Range> rangeOfRootContents = Range::create(*document(), createLegacyEditingPosition(root, 0), createLegacyEditingPosition(root, rootChildCount));
+
+ Vector<DocumentMarker*> markersInRoot = document()->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->alternatives().size() + 1;
+
+ Vector<Vector<UChar>> interpretations;
+ interpretations.grow(interpretationsCount);
+
+ Position precedingTextStartPosition = createLegacyEditingPosition(root, 0);
+
+ unsigned combinationsSoFar = 1;
+
+ Node* pastLastNode = rangeOfRootContents->pastLastNode();
+ for (Node* node = rangeOfRootContents->firstNode(); node != pastLastNode; node = NodeTraversal::next(node)) {
+ const Vector<DocumentMarker*>& markers = document()->markers().markersFor(node, DocumentMarker::MarkerTypes(DocumentMarker::DictationPhraseWithAlternatives));
+ for (auto marker : markers) {
+ // First, add text that precede the marker.
+ if (precedingTextStartPosition != createLegacyEditingPosition(node, marker->startOffset())) {
+ RefPtr<Range> precedingTextRange = Range::create(*document(), precedingTextStartPosition, createLegacyEditingPosition(node, marker->startOffset()));
+ String precedingText = plainText(precedingTextRange.get());
+ if (unsigned length = precedingText.length()) {
+ const UChar* characters = precedingText.characters();
+ for (size_t i = 0; i < interpretationsCount; ++i)
+ interpretations.at(i).append(characters, length);
+ }
+ }
+
+ RefPtr<Range> rangeForMarker = Range::create(*document(), createLegacyEditingPosition(node, marker->startOffset()), createLegacyEditingPosition(node, marker->endOffset()));
+ String visibleTextForMarker = plainText(rangeForMarker.get());
+ size_t interpretationsCountForCurrentMarker = marker->alternatives().size() + 1;
+ unsigned visibleTextForMarkerLength = visibleTextForMarker.length();
+ const UChar* visibleTextForMarkerCharacters = visibleTextForMarker.characters();
+ for (size_t i = 0; i < 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& alternative = marker->alternatives().at(i % marker->alternatives().size());
+ interpretations.at(i).append(alternative.characters(), alternative.length());
+ }
+ }
+
+ combinationsSoFar *= interpretationsCountForCurrentMarker;
+
+ precedingTextStartPosition = createLegacyEditingPosition(node, marker->endOffset());
+ }
+ }
+
+ // Finally, add any text after the last marker.
+ RefPtr<Range> 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 < interpretationsCount; ++i)
+ interpretations.at(i).append(textAfterLastMarkerCharacters, length);
+ }
+
+ NSMutableArray *result = [NSMutableArray array];
+ for (size_t i = 0; i < interpretationsCount; ++i)
+ [result addObject:static_cast<NSString *>(String(interpretations.at(i)))];
+
+ return result;
+}
+
+static bool anyFrameHasTiledLayers(Frame* rootFrame)
+{
+ for (Frame* frame = rootFrame; frame; frame = frame->tree().traverseNext(rootFrame)) {
+ if (frame->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->compositor().didChangeVisibleRect();
+ }
+ }
+
+ if (changeType == CompletedScrollOffset) {
+ if (RenderView* root = contentRenderer())
+ root->compositor().updateCompositingLayers(CompositingUpdateOnScroll);
+ }
+#endif
+}
+
+bool Frame::containsTiledBackingLayers() const
+{
+#if USE(ACCELERATED_COMPOSITING)
+ if (RenderView* root = contentRenderer())
+ return root->compositor().hasNonMainLayersWithTiledBacking();
+#endif
+ return false;
+}
+
+void Frame::overflowScrollPositionChangedForNode(const IntPoint& position, Node* node, bool isUserScroll)
+{
+ RenderObject* renderer = node->renderer();
+ if (!renderer || !renderer->hasLayer())
+ return;
+
+ RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
+
+ layer->setIsUserScroll(isUserScroll);
+ layer->scrollToOffsetWithoutAnimation(position);
+ layer->setIsUserScroll(false);
+ layer->didEndScroll(); // FIXME: Should we always call this?
+}
+
+void Frame::resetAllGeolocationPermission()
+{
+ if (document()->domWindow())
+ document()->domWindow()->resetAllGeolocationPermission();
+
+ for (Frame* child = tree().firstChild(); child; child = child->tree().nextSibling())
+ child->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 "BlockExceptions.h"
</span><span class="cx"> #import "ChromeClient.h"
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#include "WAKResponder.h"
+#include "WAKView.h"
+#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->add(pair);
</span><span class="cx">
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
</span><span class="cx"> if (DocumentLoader* documentLoader = frame->loader().documentLoader())
</span><span class="cx"> documentLoader->schedule(pair.get());
</span><span class="cx"> if (DocumentLoader* documentLoader = frame->loader().provisionalDocumentLoader())
</span><span class="cx"> documentLoader->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<SchedulePair> pair = prpPair;
</span><span class="cx"> m_scheduledRunLoopPairs->remove(pair);
</span><span class="cx">
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
</span><span class="cx"> if (DocumentLoader* documentLoader = frame->loader().documentLoader())
</span><span class="cx"> documentLoader->unschedule(pair.get());
</span><span class="cx"> if (DocumentLoader* documentLoader = frame->loader().provisionalDocumentLoader())
</span><span class="cx"> documentLoader->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 >= 1090
</del><ins>+#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 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 "ScrollTypes.h"
</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 <dabates@apple.com>
+
+ [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 <aestes@apple.com>
</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 "WebPDFViewIOS.h"
</span><span class="cx"> #import "WebDataSourceInternal.h"
</span><span class="cx">
</span><del>-#import <WebKit/WebFrameLoadDelegate.h>
-#import <WebKit/WebFrame.h>
-#import <WebKit/WebFramePrivate.h>
-#import <WebKit/WebFrameView.h>
-#import <WebKit/WebNSViewExtras.h>
-#import <WebKit/WebViewPrivate.h>
</del><span class="cx"> #import "WebFrameInternal.h"
</span><span class="cx"> #import "WebJSPDFDoc.h"
</span><ins>+#import "WebKitVersionChecks.h"
</ins><span class="cx"> #import "WebPDFDocumentExtras.h"
</span><span class="cx"> #import "WebPDFViewPlaceholder.h"
</span><del>-#import "WebKitVersionChecks.h"
-
</del><span class="cx"> #import <JavaScriptCore/JSContextRef.h>
</span><span class="cx"> #import <JavaScriptCore/JSStringRef.h>
</span><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="lines">@@ -48,7 +41,14 @@
</span><span class="cx"> #import <WebCore/FrameLoader.h>
</span><span class="cx"> #import <WebCore/FrameLoaderClient.h>
</span><span class="cx"> #import <WebCore/GraphicsContext.h>
</span><ins>+#import <WebCore/StringWithDirection.h>
</ins><span class="cx"> #import <WebCore/WKGraphics.h>
</span><ins>+#import <WebKit/WebFrame.h>
+#import <WebKit/WebFrameLoadDelegate.h>
+#import <WebKit/WebFramePrivate.h>
+#import <WebKit/WebFrameView.h>
+#import <WebKit/WebNSViewExtras.h>
+#import <WebKit/WebViewPrivate.h>
</ins><span class="cx"> #import <wtf/Assertions.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> #import <wtf/StdLibExtras.h>
</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 <dabates@apple.com>
+
+ [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 <WebCore/HitTestResult.h>.
+
</ins><span class="cx"> 2013-12-27 Gavin Barraclough <barraclough@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge PageVisibilityState & 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<WebCore::ColorChooser> createColorChooser(WebCore::ColorChooserClient*, const WebCore::Color&) 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 <WebCore/HTMLPlugInImageElement.h>
</span><span class="cx"> #include <WebCore/HistoryController.h>
</span><span class="cx"> #include <WebCore/HistoryItem.h>
</span><ins>+#include <WebCore/HitTestResult.h>
</ins><span class="cx"> #include <WebCore/JSDOMWindow.h>
</span><span class="cx"> #include <WebCore/KeyboardEvent.h>
</span><span class="cx"> #include <WebCore/MIMETypeRegistry.h>
</span></span></pre>
</div>
</div>
</body>
</html>