Changeset 161106 in webkit


Ignore:
Timestamp:
Dec 27, 2013 12:40:28 PM (10 years ago)
Author:
dbates@webkit.org
Message:

[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).

Location:
trunk/Source
Files:
3 added
43 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r161079 r161106  
     12013-12-27  Daniel Bates  <dabates@apple.com>
     2
     3        [iOS] Upstream WebCore/page changes
     4        https://bugs.webkit.org/show_bug.cgi?id=126180
     5
     6        Reviewed by Darin Adler.
     7
     8        * wtf/FeatureDefines.h: Define ENABLE_IOS_TOUCH_EVENTS to be enabled by default
     9        when building iOS with ENABLE(TOUCH_EVENTS).
     10
    1112013-12-25  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
    212
  • trunk/Source/WTF/wtf/FeatureDefines.h

    r160944 r161106  
    6969#endif
    7070
     71#if !defined(ENABLE_CURSOR_SUPPORT)
     72#define ENABLE_CURSOR_SUPPORT 0
     73#endif
     74
    7175#if !defined(ENABLE_DISK_IMAGE_CACHE)
    7276#define ENABLE_DISK_IMAGE_CACHE 1
     
    8589#endif
    8690
     91#if !defined(ENABLE_LETTERPRESS)
     92#define ENABLE_LETTERPRESS 1
     93#endif
     94
    8795#if !defined(ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
    8896#define ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE 1
     
    93101#endif
    94102
    95 #if !defined(ENABLE_LETTERPRESS)
    96 #define ENABLE_LETTERPRESS 1
    97 #endif
    98 
    99103#if !defined(ENABLE_IOS_TEXT_AUTOSIZING)
    100104#define ENABLE_IOS_TEXT_AUTOSIZING 1
     105#endif
     106
     107#if !defined(ENABLE_IOS_TOUCH_EVENTS)
     108#define ENABLE_IOS_TOUCH_EVENTS 1
    101109#endif
    102110
     
    431439#endif
    432440
     441#if !defined(ENABLE_CURSOR_SUPPORT)
     442#define ENABLE_CURSOR_SUPPORT 1
     443#endif
     444
    433445#if !defined(ENABLE_CUSTOM_SCHEME_HANDLER)
    434446#define ENABLE_CUSTOM_SCHEME_HANDLER 0
     
    895907#endif
    896908
     909#if ENABLE(IOS_TOUCH_EVENTS) && !ENABLE(TOUCH_EVENTS)
     910#error "ENABLE(IOS_TOUCH_EVENTS) requires ENABLE(TOUCH_EVENTS)"
     911#endif
     912
    897913#endif /* WTF_FeatureDefines_h */
  • trunk/Source/WebCore/ChangeLog

    r161105 r161106  
     12013-12-27  Daniel Bates  <dabates@apple.com>
     2
     3        [iOS] Upstream WebCore/page changes
     4        https://bugs.webkit.org/show_bug.cgi?id=126180
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCore.xcodeproj/project.pbxproj:
     9        * dom/EventNames.h:
     10        (WebCore::EventNames::isGestureEventType): Added.
     11        * page/AlternativeTextClient.h: Do not define WTF_USE_DICTATION_ALTERNATIVES when building for iOS.
     12        * page/Chrome.cpp:
     13        (WebCore::Chrome::Chrome):
     14        (WebCore::Chrome::dispatchViewportPropertiesDidChange): Added; guarded by PLATFORM(IOS).
     15        (WebCore::Chrome::setCursor): Make this an empty function when building for iOS.
     16        (WebCore::Chrome::setCursorHiddenUntilMouseMoves): Ditto.
     17        (WebCore::Chrome::didReceiveDocType): Added; iOS-specific.
     18        * page/Chrome.h:
     19        (WebCore::Chrome::setDispatchViewportDataDidChangeSuppressed): Added; guarded by PLATFORM(IOS).
     20        * page/ChromeClient.h:
     21        (WebCore::ChromeClient::didFlushCompositingLayers): Added; guarded by PLATFORM(IOS).
     22        (WebCore::ChromeClient::fetchCustomFixedPositionLayoutRect): Added; guarded by PLATFORM(IOS).
     23        (WebCore::ChromeClient::updateViewportConstrainedLayers): Added; guarded by PLATFORM(IOS).
     24        * page/DOMTimer.cpp:
     25        (WebCore::DOMTimer::install): Added iOS-specific code.
     26        (WebCore::DOMTimer::fired): Ditto.
     27        * page/DOMWindow.cpp:
     28        (WebCore::DOMWindow::DOMWindow): Ditto.
     29        (WebCore::DOMWindow::innerHeight): Ditto.
     30        (WebCore::DOMWindow::innerWidth): Ditto.
     31        (WebCore::DOMWindow::scrollX): Ditto.
     32        (WebCore::DOMWindow::scrollY): Ditto.
     33        (WebCore::DOMWindow::scrollBy): Ditto.
     34        (WebCore::DOMWindow::scrollTo): Ditto.
     35        (WebCore::DOMWindow::clearTimeout): Ditto.
     36        (WebCore::DOMWindow::addEventListener): Ditto.
     37        (WebCore::DOMWindow::incrementScrollEventListenersCount): Added; guarded by PLATFORM(IOS).
     38        (WebCore::DOMWindow::decrementScrollEventListenersCount): Added; guarded by PLATFORM(IOS).
     39        (WebCore::DOMWindow::resetAllGeolocationPermission): Added; Also added FIXME comment.
     40        (WebCore::DOMWindow::removeEventListener): Added iOS-specific code.
     41        (WebCore::DOMWindow::dispatchEvent): Modified to prevent dispatching duplicate pageshow and pagehide
     42        events per <http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow>.
     43        (WebCore::DOMWindow::removeAllEventListeners): Added iOS-specific code.
     44        * page/DOMWindow.h:
     45        * page/DOMWindow.idl: Added IOS_GESTURE_EVENTS-guarded attributes: ongesture{change, end, start}. Also
     46        added IOS_TOUCH_EVENTS-guarded attributes: {Touch, TouchList}Constructor.
     47        * page/EditorClient.h:
     48        * page/EventHandler.cpp:
     49        (WebCore::EventHandler::EventHandler): Added iOS-specific code.
     50        (WebCore::EventHandler::clear): Ditto.
     51        (WebCore::EventHandler::startPanScrolling): Make this an empty function when building for iOS.
     52        (WebCore::EventHandler::handleMousePressEvent): Modified to invalidate a click when the clicked node is
     53        null. Also, opt out of code for updating the scrollbars as UIKit manages scrollbars on iOS.
     54        (WebCore::EventHandler::handleMouseMoveEvent): Opt of code for updating the scrollbars and cursor when building on iOS.
     55        (WebCore::hitTestResultInFrame): Made this a file-local static function since it's only used in EventHandler.cpp.
     56        (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled): Added iOS-specific code.
     57        * page/EventHandler.h:
     58        * page/FocusController.h:
     59        * page/Frame.cpp:
     60        (WebCore::Frame::Frame): Added iOS-specific code.
     61        (WebCore::Frame::scrollOverflowLayer): Added; iOS-specific.
     62        (WebCore::Frame::overflowAutoScrollTimerFired): Added; iOS-specific.
     63        (WebCore::Frame::startOverflowAutoScroll): Added; iOS-specific.
     64        (WebCore::Frame::checkOverflowScroll): Added; iOS-specific.
     65        (WebCore::Frame::willDetachPage): Added iOS-specific code.
     66        (WebCore::Frame::createView): Ditto.
     67        (WebCore::Frame::setSelectionChangeCallbacksDisabled): Added; iOS-specific.
     68        (WebCore::Frame::selectionChangeCallbacksDisabled): Added; iOS-specific.
     69        * page/Frame.h:
     70        (WebCore::Frame::timersPaused): Added; guarded by PLATFORM(IOS).
     71        * page/FrameView.cpp:
     72        (WebCore::FrameView::FrameView): Added iOS-specific code.
     73        (WebCore::FrameView::clear): Ditto.
     74        (WebCore::FrameView::flushCompositingStateForThisFrame): Ditto.
     75        (WebCore::FrameView::graphicsLayerForPlatformWidget): Added.
     76        (WebCore::FrameView::scheduleLayerFlushAllowingThrottling): Added.
     77        (WebCore::FrameView::layout): Added iOS-specific code.
     78        (WebCore::countRenderedCharactersInRenderObjectWithThreshold): Added; helper function used by FrameView::renderedCharactersExceed().
     79        Also added FIXME comment.
     80        (WebCore::FrameView::renderedCharactersExceed): Added.
     81        (WebCore::FrameView::visibleContentsResized): Added iOS-specific code.
     82        (WebCore::FrameView::adjustTiledBackingCoverage): Ditto.
     83        (WebCore::FrameView::performPostLayoutTasks): Ditto.
     84        (WebCore::FrameView::sendResizeEventIfNeeded): Ditto.
     85        (WebCore::FrameView::paintContents): Added iOS-specific code. Also added FIXME comments.
     86        (WebCore::FrameView::setUseCustomFixedPositionLayoutRect): Added; iOS-specific.
     87        (WebCore::FrameView::setCustomFixedPositionLayoutRect): Added; iOS-specific.
     88        (WebCore::FrameView::updateFixedPositionLayoutRect): Added; iOS-specific.
     89        * page/FrameView.h:
     90        * page/Navigator.cpp:
     91        (WebCore::Navigator::standalone): Added; iOS-specific.
     92        * page/Navigator.h:
     93        * page/Navigator.idl: Added WTF_PLATFORM_IOS-guarded attribute: standalone. Also added FIXME comment.
     94        * page/NavigatorBase.cpp:
     95        (WebCore::NavigatorBase::platform): Added iOS-specific code.
     96        * page/Page.h:
     97        (WebCore::Page::hasCustomHTMLTokenizerTimeDelay): Added; guarded by PLATFORM(IOS). Also added FIXME comment
     98        to remove this method.
     99        (WebCore::Page::customHTMLTokenizerTimeDelay): Added; guarded by PLATFORM(IOS). Also added FIXME comment
     100        to remove this method.
     101        * page/PageGroup.cpp:
     102        (WebCore::PageGroup::removeVisitedLink): Added.
     103        * page/PageGroup.h:
     104        * page/Settings.cpp:
     105        (WebCore::Settings::Settings):
     106        (WebCore::Settings::setScriptEnabled): Added; guarded by PLATFORM(IOS).
     107        (WebCore::Settings::setStandalone): Added; guarded by PLATFORM(IOS).
     108        (WebCore::Settings::setAudioSessionCategoryOverride): Added; guarded by PLATFORM(IOS).
     109        (WebCore::Settings::audioSessionCategoryOverride): Added; guarded by PLATFORM(IOS).
     110        (WebCore::Settings::setNetworkDataUsageTrackingEnabled): Added; guarded by PLATFORM(IOS).
     111        (WebCore::Settings::networkDataUsageTrackingEnabled): Added; guarded by PLATFORM(IOS).
     112        (WebCore::sharedNetworkInterfaceNameGlobal): Added; guarded by PLATFORM(IOS).
     113        (WebCore::Settings::setNetworkInterfaceName): Added; guarded by PLATFORM(IOS).
     114        (WebCore::Settings::networkInterfaceName): Added; guarded by PLATFORM(IOS).
     115        * page/Settings.h:
     116        (WebCore::Settings::setMaxParseDuration): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
     117        (WebCore::Settings::maxParseDuration): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
     118        (WebCore::Settings::standalone): Added; guarded by PLATFORM(IOS).
     119        (WebCore::Settings::setTelephoneNumberParsingEnabled): Added; guarded by PLATFORM(IOS).
     120        (WebCore::Settings::telephoneNumberParsingEnabled): Added; guarded by PLATFORM(IOS).
     121        (WebCore::Settings::setMediaDataLoadsAutomatically): Added; guarded by PLATFORM(IOS).
     122        (WebCore::Settings::mediaDataLoadsAutomatically): Added; guarded by PLATFORM(IOS).
     123        (WebCore::Settings::setShouldTransformsAffectOverflow): Added; guarded by PLATFORM(IOS).
     124        (WebCore::Settings::shouldTransformsAffectOverflow): Added; guarded by PLATFORM(IOS).
     125        (WebCore::Settings::setShouldDispatchJavaScriptWindowOnErrorEvents): Added; guarded by PLATFORM(IOS).
     126        (WebCore::Settings::shouldDispatchJavaScriptWindowOnErrorEvents): Added; guarded by PLATFORM(IOS).
     127        (WebCore::Settings::setAlwaysUseBaselineOfPrimaryFont): Added; guarded by PLATFORM(IOS).
     128        (WebCore::Settings::alwaysUseBaselineOfPrimaryFont): Added; guarded by PLATFORM(IOS).
     129        (WebCore::Settings::setAlwaysUseAcceleratedOverflowScroll): Added; guarded by PLATFORM(IOS).
     130        (WebCore::Settings::alwaysUseAcceleratedOverflowScroll): Added; guarded by PLATFORM(IOS).
     131        * page/Settings.in: Added IOS_AIRPLAY-guarded setting: mediaPlaybackAllowsAirPlay.
     132        * page/animation/CSSPropertyAnimation.cpp:
     133        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Added iOS-specific code and FIXME comment.
     134        * page/ios/EventHandlerIOS.mm: Added.
     135        * page/ios/FrameIOS.mm: Added.
     136        * page/mac/ChromeMac.mm:
     137        * page/mac/PageMac.cpp:
     138        (WebCore::Page::addSchedulePair): Opt out of code when building for iOS.
     139        (WebCore::Page::removeSchedulePair): Ditto.
     140        * page/mac/SettingsMac.mm:
     141        (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Added iOS-specific code.
     142        * page/mac/WebCoreFrameView.h:
     143
    11442013-12-27  Gavin Barraclough  <barraclough@apple.com>
    2145
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r161066 r161106  
    54675467                CE08C3D1152B599A0021B8C2 /* AlternativeTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */; };
    54685468                CE08C3D2152B599A0021B8C2 /* AlternativeTextController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE08C3D0152B599A0021B8C2 /* AlternativeTextController.h */; settings = {ATTRIBUTES = (); }; };
     5469                FE6938B61045D67E008EABB6 /* EventHandlerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */; };
     5470                FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D3B0CEA936A00D89466 /* FrameIOS.mm */; };
    54695471                CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    54705472                CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */; };
     
    1262212624                CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlternativeTextController.cpp; sourceTree = "<group>"; };
    1262312625                CE08C3D0152B599A0021B8C2 /* AlternativeTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlternativeTextController.h; sourceTree = "<group>"; };
     12626                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventHandlerIOS.mm; sourceTree = "<group>"; };
     12627                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameIOS.mm; sourceTree = "<group>"; };
    1262412628                CE5CB1B314EDAB6F00BB2795 /* EventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSender.h; sourceTree = "<group>"; };
    1262512629                CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AlternativeTextUIController.h; path = mac/AlternativeTextUIController.h; sourceTree = "<group>"; };
     
    1573215736                        children = (
    1573315737                                316FE1060E6E1D8400BF6088 /* animation */,
     15738                                18A6CD6F0D8F2025001DC3CE /* ios */,
    1573415739                                93C09A820B064F05005ABD4D /* mac */,
    1573515740                                1AF62EE114DA22A70041556C /* scrolling */,
     
    2053720542                        );
    2053820543                        path = mediasource;
     20544                        sourceTree = "<group>";
     20545                };
     20546                18A6CD6F0D8F2025001DC3CE /* ios */ = {
     20547                        isa = PBXGroup;
     20548                        children = (
     20549                                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */,
     20550                                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */,
     20551                        );
     20552                        path = ios;
    2053920553                        sourceTree = "<group>";
    2054020554                };
     
    2635126365                                850657030AAB4763002D15C0 /* DOMStyleSheetList.mm in Sources */,
    2635226366                                85ACA99D0A9B575900671E90 /* DOMText.mm in Sources */,
     26367                                FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */,
    2635326368                                933A14AA0B7D1D0900A53FFD /* DOMTextEvent.mm in Sources */,
    2635426369                                188604B30F2E654A000B6443 /* DOMTimer.cpp in Sources */,
     
    2846228477                                0C3F1F5A10C8871200D72CE1 /* WebGLUniformLocation.cpp in Sources */,
    2846328478                                77A17A7712F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp in Sources */,
     28479                                FE6938B61045D67E008EABB6 /* EventHandlerIOS.mm in Sources */,
    2846428480                                31C0FF210E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp in Sources */,
    2846528481                                976D6C7B122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp in Sources */,
  • trunk/Source/WebCore/dom/EventNames.h

    r160679 r161106  
    291291    #undef DOM_EVENT_NAMES_DECLARE
    292292
     293    inline bool isGestureEventType(const AtomicString& eventType) const
     294    {
     295        return eventType == gesturestartEvent || eventType == gesturechangeEvent || eventType == gestureendEvent;
     296    }
     297
    293298    inline bool isTouchEventType(const AtomicString& eventType) const
    294299    {
  • trunk/Source/WebCore/page/AlternativeTextClient.h

    r148531 r161106  
    3232#include <wtf/text/WTFString.h>
    3333
    34 #if PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080)
     34#if !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
    3535// Some platforms provide UI for suggesting alternative dictation text.
    3636#define WTF_USE_DICTATION_ALTERNATIVES 1
    37 #endif // PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080)
     37#endif // !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
    3838
    3939namespace WebCore {
  • trunk/Source/WebCore/page/Chrome.cpp

    r159224 r161106  
    2727#include "DateTimeChooser.h"
    2828#include "Document.h"
     29#include "DocumentType.h"
    2930#include "FileIconLoader.h"
    3031#include "FileChooser.h"
     
    6667    , m_client(client)
    6768    , m_displayID(0)
     69#if PLATFORM(IOS)
     70    , m_isDispatchViewportDataDidChangeSuppressed(false)
     71#endif
    6872{
    6973}
     
    478482#endif
    479483
    480 #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
     484#if ENABLE(DATE_AND_TIME_INPUT_TYPES) && !PLATFORM(IOS)
    481485PassRefPtr<DateTimeChooser> Chrome::openDateTimeChooser(DateTimeChooserClient* client, const DateTimeChooserParameters& parameters)
    482486{
     
    499503void Chrome::dispatchViewportPropertiesDidChange(const ViewportArguments& arguments) const
    500504{
     505#if PLATFORM(IOS)
     506    if (m_isDispatchViewportDataDidChangeSuppressed)
     507        return;
     508#endif
    501509    m_client.dispatchViewportPropertiesDidChange(arguments);
    502510}
     
    504512void Chrome::setCursor(const Cursor& cursor)
    505513{
     514#if ENABLE(CURSOR_SUPPORT)
    506515    m_client.setCursor(cursor);
     516#else
     517    UNUSED_PARAM(cursor);
     518#endif
    507519}
    508520
    509521void Chrome::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
    510522{
     523#if ENABLE(CURSOR_SUPPORT)
    511524    m_client.setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
     525#else
     526    UNUSED_PARAM(hiddenUntilMouseMoves);
     527#endif
    512528}
    513529
     
    603619}
    604620
     621#if PLATFORM(IOS)
     622// FIXME: Make argument, frame, a reference.
     623void Chrome::didReceiveDocType(Frame* frame)
     624{
     625    ASSERT(frame);
     626    if (!frame->isMainFrame())
     627        return;
     628
     629    DocumentType* documentType = frame->document()->doctype();
     630    if (!documentType) {
     631        // FIXME: We should notify the client when <!DOCTYPE> is removed so that
     632        // it can adjust the viewport accordingly. See <rdar://problem/15417894>.
     633        return;
     634    }
     635
     636    if (documentType->publicId().contains("xhtml mobile", false))
     637        m_client.didReceiveMobileDocType();
     638}
     639#endif
     640
    605641void Chrome::registerPopupOpeningObserver(PopupOpeningObserver* observer)
    606642{
  • trunk/Source/WebCore/page/Chrome.h

    r157044 r161106  
    156156    PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color& initialColor);
    157157#endif
    158 #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
    159     PassRefPtr<DateTimeChooser> openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&);
     158
     159#if ENABLE(DATE_AND_TIME_INPUT_TYPES) && !PLATFORM(IOS)
     160    PassRefPtr<DateTimeChooser> openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&)
    160161#endif
    161162
     
    180181    PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
    181182
     183#if PLATFORM(IOS)
     184    // FIXME: Can we come up with a better name for this setter?
     185    void setDispatchViewportDataDidChangeSuppressed(bool dispatchViewportDataDidChangeSuppressed) { m_isDispatchViewportDataDidChangeSuppressed = dispatchViewportDataDidChangeSuppressed; }
     186
     187    void didReceiveDocType(Frame*);
     188#endif
     189
    182190    void registerPopupOpeningObserver(PopupOpeningObserver*);
    183191    void unregisterPopupOpeningObserver(PopupOpeningObserver*);
     
    190198    PlatformDisplayID m_displayID;
    191199    Vector<PopupOpeningObserver*> m_popupOpeningObservers;
     200#if PLATFORM(IOS)
     201    bool m_isDispatchViewportDataDidChangeSuppressed;
     202#endif
    192203};
    193204
  • trunk/Source/WebCore/page/ChromeClient.h

    r159224 r161106  
    4141#include <wtf/Vector.h>
    4242
     43#if PLATFORM(IOS)
     44#include "PlatformLayer.h"
     45#define NSResponder WAKResponder
     46#ifndef __OBJC__
     47class WAKResponder;
     48#else
     49@class WAKResponder;
     50#endif
     51#endif
     52
    4353#if ENABLE(SQL_DATABASE)
    4454#include "DatabaseDetails.h"
     
    6373class GraphicsLayer;
    6474class GraphicsLayerFactory;
     75class HTMLInputElement;
    6576class HitTestResult;
    66 class HTMLInputElement;
    6777class IntRect;
    6878class NavigationAction;
     
    7181class PopupMenuClient;
    7282class SecurityOrigin;
     83class ViewportConstraints;
    7384class Widget;
    7485
     
    157168    virtual PlatformPageClient platformPageClient() const = 0;
    158169    virtual void scrollbarsModeDidChange() const = 0;
     170#if ENABLE(CURSOR_SUPPORT)
    159171    virtual void setCursor(const Cursor&) = 0;
    160172    virtual void setCursorHiddenUntilMouseMoves(bool) = 0;
     173#endif
    161174#if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER)
    162175    virtual void scheduleAnimation() = 0;
     
    213226    virtual String generateReplacementFile(const String& path);
    214227
     228#if ENABLE(IOS_TOUCH_EVENTS)
     229    virtual void didPreventDefaultForEvent() = 0;
     230#endif
     231
     232#if PLATFORM(IOS)
     233    virtual void didReceiveMobileDocType() = 0;
     234    virtual void setNeedsScrollNotifications(Frame*, bool) = 0;
     235    virtual void observedContentChange(Frame*) = 0;
     236    virtual void clearContentChangeObservers(Frame*) = 0;
     237    virtual void notifyRevealedSelectionByScrollingFrame(Frame*) = 0;
     238
     239    enum LayoutType { NormalLayout, Scroll };
     240    virtual void didLayout(LayoutType = NormalLayout) = 0;
     241    virtual void didStartOverflowScroll() = 0;
     242    virtual void didEndOverflowScroll() = 0;
     243
     244    // FIXME: Remove this functionality. This functionality was added to workaround an issue (<rdar://problem/5973875>)
     245    // where the unconfirmed text in a text area would be removed when a person clicks in the text area before a
     246    // suggestion is shown. We should fix this issue in <rdar://problem/5975559>.
     247    virtual void suppressFormNotifications() = 0;
     248    virtual void restoreFormNotifications() = 0;
     249
     250    virtual void didFlushCompositingLayers() { }
     251
     252    virtual bool fetchCustomFixedPositionLayoutRect(IntRect&) { return false; }
     253
     254    // FIXME: Use std::unique_ptr instead of OwnPtr.
     255    virtual void updateViewportConstrainedLayers(HashMap<PlatformLayer*, OwnPtr<ViewportConstraints>>&, HashMap<PlatformLayer*, PlatformLayer*>&) { }
     256
     257    virtual void addOrUpdateScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer, const IntSize& scrollSize, bool allowHorizontalScrollbar, bool allowVerticalScrollbar) = 0;
     258    virtual void removeScrollingLayer(Node*, PlatformLayer* scrollingLayer, PlatformLayer* contentsLayer) = 0;
     259
     260    virtual void webAppOrientationsUpdated() = 0;
     261#endif
     262
    215263#if ENABLE(INPUT_TYPE_COLOR)
    216264    virtual PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color&) = 0;
    217265#endif
    218266
    219 #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
     267#if ENABLE(DATE_AND_TIME_INPUT_TYPES) && !PLATFORM(IOS)
    220268    virtual PassRefPtr<DateTimeChooser> openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&) = 0;
    221269#endif
  • trunk/Source/WebCore/page/DOMTimer.cpp

    r159027 r161106  
    3636#include <wtf/StdLibExtras.h>
    3737
     38#if PLATFORM(IOS)
     39#include "Chrome.h"
     40#include "ChromeClient.h"
     41#include "Frame.h"
     42#include "Page.h"
     43#include "WKContentObservation.h"
     44#endif
     45
    3846namespace WebCore {
    3947
     
    8290    // or if it is a one-time timer and it has fired (DOMTimer::fired).
    8391    DOMTimer* timer = new DOMTimer(context, action, timeout, singleShot);
     92#if PLATFORM(IOS)
     93    if (context->isDocument()) {
     94        Document& document = toDocument(*context);
     95        bool didDeferTimeout = document.frame() && document.frame()->timersPaused();
     96        if (!didDeferTimeout && timeout <= 100 && singleShot) {
     97            WKSetObservedContentChange(WKContentIndeterminateChange);
     98            WebThreadAddObservedContentModifier(timer); // Will only take affect if not already visibility change.
     99        }
     100    }
     101#endif
    84102
    85103    timer->suspendIfNeeded();
     
    105123{
    106124    ScriptExecutionContext* context = scriptExecutionContext();
     125    ASSERT(context);
     126#if PLATFORM(IOS)
     127    Document* document = nullptr;
     128    if (!context->isDocument()) {
     129        document = toDocument(context);
     130        ASSERT(!document->frame()->timersPaused());
     131    }
     132#endif
    107133    timerNestingLevel = m_nestingLevel;
    108134    ASSERT(!isSuspended());
     
    137163    delete this;
    138164
     165#if PLATFORM(IOS)
     166    bool shouldReportLackOfChanges;
     167    bool shouldBeginObservingChanges;
     168    if (document) {
     169        shouldReportLackOfChanges = WebThreadCountOfObservedContentModifiers() == 1;
     170        shouldBeginObservingChanges = WebThreadContainsObservedContentModifier(this);
     171    } else {
     172        shouldReportLackOfChanges = false;
     173        shouldBeginObservingChanges = false;
     174    }
     175
     176    if (shouldBeginObservingChanges) {
     177        WKBeginObservingContentChanges(false);
     178        WebThreadRemoveObservedContentModifier(this);
     179    }
     180#endif
     181
    139182    action->execute(context);
     183
     184#if PLATFORM(IOS)
     185    if (shouldBeginObservingChanges) {
     186        WKStopObservingContentChanges();
     187
     188        if (WKObservedContentChange() == WKContentVisibilityChange || shouldReportLackOfChanges)
     189            if (document && document->page())
     190                document->page()->chrome().client().observedContentChange(document->frame());
     191    }
     192#endif
    140193
    141194    InspectorInstrumentation::didFireTimer(cookie);
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r160671 r161106  
    118118#endif
    119119
     120#if PLATFORM(IOS)
     121#if ENABLE(GEOLOCATION)
     122#include "NavigatorGeolocation.h"
     123#endif
     124#include "WKContentObservation.h"
     125#endif
     126
    120127namespace WebCore {
    121128
     
    372379    , m_shouldPrintWhenFinishedLoading(false)
    373380    , m_suspendedForPageCache(false)
     381    , m_lastPageStatus(PageStatusNone)
     382#if PLATFORM(IOS)
     383    , m_scrollEventListenerCount(0)
     384#endif
     385#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
     386    , m_touchEventListenerCount(0)
     387#endif
    374388{
    375389    ASSERT(frame());
     
    11401154        return 0;
    11411155
     1156#if PLATFORM(IOS)
     1157    return view->mapFromLayoutToCSSUnits(static_cast<int>(view->actualVisibleContentRect().height()));
     1158#else
    11421159    // If the device height is overridden, do not include the horizontal scrollbar into the innerHeight (since it is absent on the real device).
    11431160    bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenHeightOverride(m_frame);
    11441161    return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScrollbars).height()));
     1162#endif
    11451163}
    11461164
     
    11541172        return 0;
    11551173
     1174#if PLATFORM(IOS)
     1175    return view->mapFromLayoutToCSSUnits(static_cast<int>(view->actualVisibleContentRect().width()));
     1176#else
    11561177    // If the device width is overridden, do not include the vertical scrollbar into the innerWidth (since it is absent on the real device).
    11571178    bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(m_frame);
    11581179    return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScrollbars).width()));
     1180#endif
    11591181}
    11601182
     
    11971219    m_frame->document()->updateLayoutIgnorePendingStylesheets();
    11981220
     1221#if PLATFORM(IOS)
     1222    return static_cast<int>(view->actualVisibleContentRect().x() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor()));
     1223#else
    11991224    return view->mapFromLayoutToCSSUnits(view->scrollX());
     1225#endif
    12001226}
    12011227
     
    12141240    m_frame->document()->updateLayoutIgnorePendingStylesheets();
    12151241
     1242#if PLATFORM(IOS)
     1243    return static_cast<int>(view->actualVisibleContentRect().y() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor()));
     1244#else
    12161245    return view->mapFromLayoutToCSSUnits(view->scrollY());
     1246#endif
    12171247}
    12181248
     
    14261456
    14271457    IntSize scaledOffset(view->mapFromCSSToLayoutUnits(x), view->mapFromCSSToLayoutUnits(y));
     1458#if PLATFORM(IOS)
     1459    view->setActualScrollPosition(view->actualVisibleContentRect().location() + scaledOffset);
     1460#else
    14281461    view->scrollBy(scaledOffset);
     1462#endif
    14291463}
    14301464
     
    14401474        return;
    14411475
     1476
     1477#if PLATFORM(IOS)
     1478    int zoomedX = static_cast<int>(x * m_frame->pageZoomFactor() * m_frame->frameScaleFactor());
     1479    int zoomedY = static_cast<int>(y * m_frame->pageZoomFactor() * m_frame->frameScaleFactor());
     1480    view->setActualScrollPosition(IntPoint(zoomedX, zoomedY));
     1481#else
    14421482    IntPoint layoutPos(view->mapFromCSSToLayoutUnits(x), view->mapFromCSSToLayoutUnits(y));
    14431483    view->setScrollPosition(layoutPos);
     1484#endif
    14441485}
    14451486
     
    15221563void DOMWindow::clearTimeout(int timeoutId)
    15231564{
     1565#if PLATFORM(IOS)
     1566    if (m_frame) {
     1567        Document* document = m_frame->document();
     1568        if (timeoutId > 0 && document) {
     1569            DOMTimer* timer = document->findTimeout(timeoutId);
     1570            if (timer && WebThreadContainsObservedContentModifier(timer)) {
     1571                WebThreadRemoveObservedContentModifier(timer);
     1572
     1573                if (!WebThreadCountOfObservedContentModifiers()) {
     1574                    if (Page* page = m_frame->page())
     1575                        page->chrome().client().observedContentChange(m_frame);
     1576                }
     1577            }
     1578        }
     1579    }
     1580#endif
    15241581    ScriptExecutionContext* context = scriptExecutionContext();
    15251582    if (!context)
     
    16091666        addBeforeUnloadEventListener(this);
    16101667#if ENABLE(DEVICE_ORIENTATION)
     1668#if PLATFORM(IOS)
     1669    else if (eventType == eventNames().devicemotionEvent && document())
     1670        document()->deviceMotionController()->addDeviceEventListener(this);
     1671    else if (eventType == eventNames().deviceorientationEvent && document())
     1672        document()->deviceOrientationController()->addDeviceEventListener(this);
     1673#else
    16111674    else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::sharedFeatures().deviceMotionEnabled()) {
    16121675        if (DeviceMotionController* controller = DeviceMotionController::from(page()))
     
    16161679            controller->addDeviceEventListener(this);
    16171680    }
     1681#endif // PLATFORM(IOS)
     1682#endif // ENABLE(DEVICE_ORIENTATION)
     1683#if PLATFORM(IOS)
     1684    else if (eventType == eventNames().scrollEvent)
     1685        incrementScrollEventListenersCount();
     1686#endif
     1687#if ENABLE(IOS_TOUCH_EVENTS)
     1688    else if (eventNames().isTouchEventType(eventType))
     1689        ++m_touchEventListenerCount;
     1690#endif
     1691#if ENABLE(IOS_GESTURE_EVENTS)
     1692    else if (eventNames().isGestureEventType(eventType))
     1693        ++m_touchEventListenerCount;
    16181694#endif
    16191695
     
    16261702
    16271703    return true;
     1704}
     1705
     1706#if PLATFORM(IOS)
     1707void DOMWindow::incrementScrollEventListenersCount()
     1708{
     1709    Document* document = this->document();
     1710    if (++m_scrollEventListenerCount == 1 && document == document->topDocument()) {
     1711        Frame* frame = this->frame();
     1712        if (frame && frame->page())
     1713            frame->page()->chrome().client().setNeedsScrollNotifications(frame, true);
     1714    }
     1715}
     1716
     1717void DOMWindow::decrementScrollEventListenersCount()
     1718{
     1719    Document* document = this->document();
     1720    if (!--m_scrollEventListenerCount && document == document->topDocument()) {
     1721        Frame* frame = this->frame();
     1722        if (frame && frame->page() && !document->inPageCache())
     1723            frame->page()->chrome().client().setNeedsScrollNotifications(frame, false);
     1724    }
     1725}
     1726#endif
     1727
     1728void DOMWindow::resetAllGeolocationPermission()
     1729{
     1730    // FIXME: Remove PLATFORM(IOS)-guard once we upstream the iOS changes to Geolocation.cpp.
     1731#if ENABLE(GEOLOCATION) && PLATFORM(IOS)
     1732    if (m_navigator)
     1733        NavigatorGeolocation::from(m_navigator.get())->resetAllGeolocationPermission();
     1734#endif
    16281735}
    16291736
     
    16451752        removeBeforeUnloadEventListener(this);
    16461753#if ENABLE(DEVICE_ORIENTATION)
     1754#if PLATFORM(IOS)
     1755    else if (eventType == eventNames().devicemotionEvent && document())
     1756        document()->deviceMotionController()->removeDeviceEventListener(this);
     1757    else if (eventType == eventNames().deviceorientationEvent && document())
     1758        document()->deviceOrientationController()->removeDeviceEventListener(this);
     1759#else
    16471760    else if (eventType == eventNames().devicemotionEvent) {
    16481761        if (DeviceMotionController* controller = DeviceMotionController::from(page()))
     
    16511764        if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
    16521765            controller->removeDeviceEventListener(this);
     1766    }
     1767#endif // PLATFORM(IOS)
     1768#endif // ENABLE(DEVICE_ORIENTATION)
     1769#if PLATFORM(IOS)
     1770    else if (eventType == eventNames().scrollEvent)
     1771        decrementScrollEventListenersCount();
     1772#endif
     1773#if ENABLE(IOS_TOUCH_EVENTS)
     1774    else if (eventNames().isTouchEventType(eventType)) {
     1775        ASSERT(m_touchEventListenerCount > 0);
     1776        --m_touchEventListenerCount;
     1777    }
     1778#endif
     1779#if ENABLE(IOS_GESTURE_EVENTS)
     1780    else if (eventNames().isGestureEventType(eventType)) {
     1781        ASSERT(m_touchEventListenerCount > 0);
     1782        --m_touchEventListenerCount;
    16531783    }
    16541784#endif
     
    16931823    RefPtr<Event> event = prpEvent;
    16941824
     1825    // Pausing a page may trigger pagehide and pageshow events. WebCore also implicitly fires these
     1826    // events when closing a WebView. Here we keep track of the state of the page to prevent duplicate,
     1827    // unbalanced events per the definition of the pageshow event:
     1828    // <http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow>.
     1829    if (event->eventInterface() == PageTransitionEventInterfaceType) {
     1830        if (event->type() == eventNames().pageshowEvent) {
     1831            if (m_lastPageStatus == PageStatusShown)
     1832                return true; // Event was previously dispatched; do not fire a duplicate event.
     1833            m_lastPageStatus = PageStatusShown;
     1834        } else if (event->type() == eventNames().pagehideEvent) {
     1835            if (m_lastPageStatus == PageStatusHidden)
     1836                return true; // Event was previously dispatched; do not fire a duplicate event.
     1837            m_lastPageStatus = PageStatusHidden;
     1838        }
     1839    }
     1840
    16951841    event->setTarget(prpTarget ? prpTarget : this);
    16961842    event->setCurrentTarget(this);
     
    17111857
    17121858#if ENABLE(DEVICE_ORIENTATION)
     1859#if PLATFORM(IOS)
     1860    if (Document* document = this->document()) {
     1861        document->deviceMotionController()->removeAllDeviceEventListeners(this);
     1862        document->deviceOrientationController()->removeAllDeviceEventListeners(this);
     1863    }
     1864#else
    17131865    if (DeviceMotionController* controller = DeviceMotionController::from(page()))
    17141866        controller->removeAllDeviceEventListeners(this);
    17151867    if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
    17161868        controller->removeAllDeviceEventListeners(this);
    1717 #endif
     1869#endif // PLATFORM(IOS)
     1870#endif // ENABLE(DEVICE_ORIENTATION)
     1871
     1872#if PLATFORM(IOS)
     1873    if (m_scrollEventListenerCount) {
     1874        m_scrollEventListenerCount = 1;
     1875        decrementScrollEventListenersCount();
     1876    }
     1877#endif
     1878
     1879#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
     1880    m_touchEventListenerCount = 0;
     1881#endif
     1882
    17181883#if ENABLE(TOUCH_EVENTS)
    17191884    if (Document* document = this->document())
  • trunk/Source/WebCore/page/DOMWindow.h

    r160671 r161106  
    398398#endif
    399399
     400#if ENABLE(IOS_GESTURE_EVENTS)
     401        DEFINE_ATTRIBUTE_EVENT_LISTENER(gesturestart);
     402        DEFINE_ATTRIBUTE_EVENT_LISTENER(gesturechange);
     403        DEFINE_ATTRIBUTE_EVENT_LISTENER(gestureend);
     404#endif
     405
    400406#if ENABLE(WEB_TIMING)
    401407        Performance* performance() const;
     408#endif
     409
     410#if PLATFORM(IOS)
     411        void incrementScrollEventListenersCount();
     412        void decrementScrollEventListenersCount();
     413        unsigned scrollEventListenerCount() const { return m_scrollEventListenerCount; }
     414#endif
     415
     416        void resetAllGeolocationPermission();
     417
     418#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
     419        bool hasTouchEventListeners() const { return m_touchEventListenerCount > 0; }
    402420#endif
    403421
     
    458476        String m_defaultStatus;
    459477
     478        enum PageStatus { PageStatusNone, PageStatusShown, PageStatusHidden };
     479        PageStatus m_lastPageStatus;
     480
     481#if PLATFORM(IOS)
     482        unsigned m_scrollEventListenerCount;
     483#endif
     484
     485#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
     486        unsigned m_touchEventListenerCount;
     487#endif
     488
    460489        mutable RefPtr<Storage> m_sessionStorage;
    461490        mutable RefPtr<Storage> m_localStorage;
  • trunk/Source/WebCore/page/DOMWindow.idl

    r159284 r161106  
    286286    [Conditional=TOUCH_EVENTS] attribute EventListener ontouchcancel;
    287287
     288    [Conditional=IOS_GESTURE_EVENTS] attribute EventListener ongesturestart;
     289    [Conditional=IOS_GESTURE_EVENTS] attribute EventListener ongesturechange;
     290    [Conditional=IOS_GESTURE_EVENTS] attribute EventListener ongestureend;
     291
    288292    [Conditional=DEVICE_ORIENTATION] attribute EventListener ondevicemotion;
    289293    [Conditional=DEVICE_ORIENTATION] attribute EventListener ondeviceorientation;
     
    309313    // We just use Document for this.
    310314    attribute DocumentConstructor XMLDocument;
     315
     316    [Conditional=IOS_TOUCH_EVENTS, CustomGetter] attribute TouchConstructor Touch; // Usable with the new operator
     317    [Conditional=IOS_TOUCH_EVENTS, CustomGetter] attribute TouchListConstructor TouchList; // Usable with the new operator
     318
    311319    [Conditional=BLOB] attribute DOMURLConstructor webkitURL; // FIXME: deprecate this.
    312320    attribute MutationObserverConstructor WebKitMutationObserver; // FIXME: Add metrics to determine when we can remove this.
  • trunk/Source/WebCore/page/EditorClient.h

    r159856 r161106  
    4040OBJC_CLASS NSString;
    4141OBJC_CLASS NSURL;
     42#endif
     43
     44#if PLATFORM(IOS)
     45OBJC_CLASS NSArray;
     46OBJC_CLASS NSDictionary;
    4247#endif
    4348
     
    114119    virtual void textDidChangeInTextArea(Element*) = 0;
    115120
     121#if PLATFORM(IOS)
     122    virtual void suppressSelectionNotifications() = 0;
     123    virtual void restoreSelectionNotifications() = 0;
     124    virtual void startDelayingAndCoalescingContentChangeNotifications() = 0;
     125    virtual void stopDelayingAndCoalescingContentChangeNotifications() = 0;
     126    virtual void writeDataToPasteboard(NSDictionary*) = 0;
     127    virtual NSArray* supportedPasteboardTypesForCurrentSelection() = 0;
     128    virtual NSArray* readDataFromPasteboard(NSString* type, int index) = 0;
     129    virtual bool hasRichlyEditableSelection() = 0;
     130    virtual int getPasteboardItemsCount() = 0;
     131    virtual DocumentFragment* documentFragmentFromDelegate(int index) = 0;
     132    virtual bool performsTwoStepPaste(DocumentFragment*) = 0;
     133    virtual int pasteboardChangeCount() = 0;
     134#endif
     135
    116136#if PLATFORM(MAC)
    117137    virtual NSString* userVisibleString(NSURL*) = 0;
  • trunk/Source/WebCore/page/EventHandler.cpp

    r160966 r161106  
    105105
    106106#if ENABLE(TOUCH_EVENTS)
     107#if ENABLE(IOS_TOUCH_EVENTS)
     108#include "PlatformTouchEventIOS.h"
     109#else
    107110#include "PlatformTouchEvent.h"
     111#endif
    108112#include "TouchEvent.h"
    109113#include "TouchList.h"
     
    128132#endif // ENABLE(DRAG_SUPPORT)
    129133
     134#if ENABLE(IOS_GESTURE_EVENTS)
     135const float GestureUnknown = 0;
     136#endif
     137
     138#if ENABLE(IOS_TOUCH_EVENTS)
     139// FIXME: Share this constant with EventHandler and SliderThumbElement.
     140const unsigned InvalidTouchIdentifier = 0;
     141#endif
     142
    130143// Match key code of composition keydown event on windows.
    131144// IE sends VK_PROCESSKEY which has value 229;
     
    143156const double fakeMouseMoveLongInterval = 0.25;
    144157
    145 #if !PLATFORM(IOS)
     158#if ENABLE(CURSOR_SUPPORT)
    146159// The amount of time to wait for a cursor update on style and layout changes
    147160// Set to 50Hz, no need to be faster than common screen refresh rate
     
    191204};
    192205
    193 #if ENABLE(TOUCH_EVENTS)
     206#if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
    194207class SyntheticTouchPoint : public PlatformTouchPoint {
    195208public:
     
    256269    }
    257270};
    258 #endif
     271#endif // ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
    259272
    260273static inline ScrollGranularity wheelGranularityToScrollGranularity(unsigned deltaMode)
     
    321334    , m_selectionInitiationState(HaveNotStartedSelection)
    322335    , m_hoverTimer(this, &EventHandler::hoverTimerFired)
     336#if ENABLE(CURSOR_SUPPORT)
    323337    , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired)
     338#endif
    324339    , m_autoscrollController(adoptPtr(new AutoscrollController))
    325340    , m_mouseDownMayStartAutoscroll(false)
     
    332347    , m_eventHandlerWillResetCapturingMouseEventsElement(nullptr)
    333348    , m_clickCount(0)
     349#if ENABLE(IOS_GESTURE_EVENTS)
     350    , m_gestureInitialDiameter(GestureUnknown)
     351    , m_gestureLastDiameter(GestureUnknown)
     352    , m_gestureInitialRotation(GestureUnknown)
     353    , m_gestureLastRotation(GestureUnknown)
     354#endif
     355#if ENABLE(IOS_TOUCH_EVENTS)
     356    , m_firstTouchID(InvalidTouchIdentifier)
     357#endif
    334358    , m_mousePositionIsUnknown(true)
    335359    , m_mouseDownTimestamp(0)
     
    339363    , m_mouseDownView(nil)
    340364    , m_sendingEventToSubview(false)
     365#if !PLATFORM(IOS)
    341366    , m_activationEventNumber(-1)
    342 #endif
    343 #if ENABLE(TOUCH_EVENTS)
     367#endif // !PLATFORM(IOS)
     368#endif
     369#if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
    344370    , m_originatingTouchPointTargetKey(0)
    345371    , m_touchPressed(false)
     
    375401{
    376402    m_hoverTimer.stop();
     403#if ENABLE(CURSOR_SUPPORT)
    377404    m_cursorUpdateTimer.stop();
     405#endif
    378406    m_fakeMouseMoveEventTimer.stop();
    379407#if ENABLE(CURSOR_VISIBILITY)
     
    391419    m_clickCount = 0;
    392420    m_clickNode = 0;
     421#if ENABLE(IOS_GESTURE_EVENTS)
     422    m_gestureInitialDiameter = GestureUnknown;
     423    m_gestureLastDiameter = GestureUnknown;
     424    m_gestureInitialRotation = GestureUnknown;
     425    m_gestureLastRotation = GestureUnknown;
     426    m_gestureTargets.clear();
     427#endif
     428#if ENABLE(IOS_TOUCH_EVENTS)
     429    m_touches.clear();
     430    m_firstTouchID = InvalidTouchIdentifier;
     431    m_touchEventTargetSubframe = 0;
     432#endif
    393433    m_frameSetBeingResized = 0;
    394434#if ENABLE(DRAG_SUPPORT)
     
    405445    m_latchedWheelEventElement = nullptr;
    406446    m_previousWheelScrolledElement = nullptr;
    407 #if ENABLE(TOUCH_EVENTS)
     447#if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
    408448    m_originatingTouchPointTargets.clear();
    409449    m_originatingTouchPointDocument.clear();
     
    9741014void EventHandler::startPanScrolling(RenderElement* renderer)
    9751015{
     1016#if !PLATFORM(IOS)
    9761017    if (!renderer->isBox())
    9771018        return;
    9781019    m_autoscrollController->startPanScrolling(toRenderBox(renderer), lastKnownMousePosition());
    9791020    invalidateClick();
     1021#endif
    9801022}
    9811023
     
    11791221}
    11801222
     1223#if ENABLE(CURSOR_SUPPORT)
    11811224static bool isSubmitImage(Node* node)
    11821225{
     
    14451488    return pointerCursor();
    14461489}
     1490#endif // ENABLE(CURSOR_SUPPORT)
    14471491
    14481492#if ENABLE(CURSOR_VISIBILITY)
     
    15651609    m_clickNode = mev.targetNode();
    15661610
     1611    if (!m_clickNode) {
     1612        invalidateClick();
     1613        return false;
     1614    }
     1615
    15671616    if (FrameView* view = m_frame.view()) {
    15681617        RenderLayer* layer = m_clickNode->renderer() ? m_clickNode->renderer()->enclosingLayer() : 0;
     
    17271776        m_hoverTimer.stop();
    17281777
     1778#if ENABLE(CURSOR_SUPPORT)
    17291779    m_cursorUpdateTimer.stop();
     1780#endif
    17301781
    17311782    cancelFakeMouseMoveEvent();
     
    17411792        return !dispatchMouseEvent(eventNames().mousemoveEvent, m_frameSetBeingResized.get(), false, 0, mouseEvent, false);
    17421793
     1794    // On iOS, our scrollbars are managed by UIKit.
     1795#if !PLATFORM(IOS)
    17431796    // Send events right to a scrollbar if the mouse is pressed.
    17441797    if (m_lastScrollbarUnderMouse && m_mousePressed)
    17451798        return m_lastScrollbarUnderMouse->mouseMoved(mouseEvent);
     1799#endif
    17461800
    17471801    HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestRequest::DisallowShadowContent | HitTestRequest::AllowFrameScrollbars;
     
    17561810    }
    17571811
    1758 #if ENABLE(TOUCH_EVENTS)
     1812#if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
    17591813    // Treat any mouse move events as readonly if the user is currently touching the screen.
    17601814    if (m_touchPressed)
     
    17711825        Scrollbar* scrollbar = mev.scrollbar();
    17721826        updateLastScrollbarUnderMouse(scrollbar, !m_mousePressed);
     1827
     1828        // On iOS, our scrollbars are managed by UIKit.
     1829#if !PLATFORM(IOS)
    17731830        if (!m_mousePressed && scrollbar)
    17741831            scrollbar->mouseMoved(mouseEvent); // Handle hover effects on platforms that support visual feedback on scrollbar hovering.
     1832#endif
    17751833        if (onlyUpdateScrollbars)
    17761834            return true;
     
    17921850        if (newSubframe->view())
    17931851            swallowEvent |= passMouseMoveEventToSubframe(mev, newSubframe.get(), hoveredNode);
     1852#if ENABLE(CURSOR_SUPPORT)
    17941853    } else {
    17951854        if (FrameView* view = m_frame.view()) {
     
    18001859            }
    18011860        }
     1861#endif
    18021862    }
    18031863   
     
    27152775}
    27162776
     2777#if ENABLE(CURSOR_SUPPORT)
    27172778void EventHandler::scheduleCursorUpdate()
    27182779{
     
    27202781        m_cursorUpdateTimer.startOneShot(cursorUpdateInterval);
    27212782}
     2783#endif
    27222784
    27232785void EventHandler::dispatchFakeMouseMoveEventSoon()
     
    28312893}
    28322894
    2833 #if !PLATFORM(MAC)
     2895#if !PLATFORM(MAC) || PLATFORM(IOS)
    28342896bool EventHandler::needsKeyboardEventDisambiguationQuirks() const
    28352897{
     
    35083570}
    35093571
    3510 #if ENABLE(TOUCH_EVENTS)
    3511 
     3572#if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
    35123573static const AtomicString& eventNameForTouchPointState(PlatformTouchPoint::State state)
    35133574{
     
    35293590}
    35303591
    3531 HitTestResult EventHandler::hitTestResultInFrame(Frame* frame, const LayoutPoint& point, HitTestRequest::HitTestRequestType hitType)
     3592static HitTestResult hitTestResultInFrame(Frame* frame, const LayoutPoint& point, HitTestRequest::HitTestRequestType hitType)
    35323593{
    35333594    HitTestResult result(point);
     
    37453806    return swallowedEvent;
    37463807}
    3747 
     3808#endif // ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
     3809
     3810#if ENABLE(TOUCH_EVENTS)
    37483811bool EventHandler::dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent& event)
    37493812{
     3813#if ENABLE(IOS_TOUCH_EVENTS)
     3814    UNUSED_PARAM(event);
     3815    return false;
     3816#else
    37503817    if (!m_frame.settings().isTouchEventEmulationEnabled())
    37513818        return false;
     
    37663833    SyntheticSingleTouchEvent touchEvent(event);
    37673834    return handleTouchEvent(touchEvent);
    3768 }
    3769 
    3770 #endif
     3835#endif
     3836}
     3837#endif // ENABLE(TOUCH_EVENTS)
    37713838
    37723839void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event)
  • trunk/Source/WebCore/page/EventHandler.h

    r157653 r161106  
    4343#include <wtf/RefPtr.h>
    4444
     45#if PLATFORM(IOS)
     46#ifdef __OBJC__
     47@class WebEvent;
     48@class WAKView;
     49#include "WAKAppKitStubs.h"
     50#else
     51class WebEvent;
     52#endif
     53#endif // PLATFORM(IOS)
     54
    4555#if PLATFORM(MAC) && !defined(__OBJC__)
    4656class NSView;
     
    4959#if ENABLE(TOUCH_EVENTS)
    5060#include <wtf/HashMap.h>
     61#endif
     62
     63#if ENABLE(IOS_TOUCH_EVENTS)
     64#include <wtf/HashSet.h>
     65#include <wtf/Vector.h>
    5166#endif
    5267
     
    7994class Scrollbar;
    8095class TextEvent;
     96class Touch;
    8197class TouchEvent;
    8298class VisibleSelection;
     
    92108extern const int GeneralDragHysteresis;
    93109#endif // ENABLE(DRAG_SUPPORT)
     110
     111#if ENABLE(IOS_GESTURE_EVENTS)
     112extern const float GestureUnknown;
     113#endif
    94114
    95115enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTrailingWhitespace };
     
    145165
    146166    void scheduleHoverStateUpdate();
     167#if ENABLE(CURSOR_SUPPORT)
    147168    void scheduleCursorUpdate();
     169#endif
    148170
    149171    void setResizingFrameSet(HTMLFrameSetElement*);
     
    176198    bool handlePasteGlobalSelection(const PlatformMouseEvent&);
    177199
     200#if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
     201    typedef Vector<RefPtr<Touch>> TouchArray;
     202    typedef HashMap<EventTarget*, TouchArray*> EventTargetTouchMap;
     203    typedef HashSet<RefPtr<EventTarget>> EventTargetSet;
     204#endif
     205
     206#if ENABLE(IOS_TOUCH_EVENTS)
     207    bool dispatchTouchEvent(const PlatformTouchEvent&, const AtomicString&, const EventTargetTouchMap&, float, float);
     208#endif
     209
     210#if ENABLE(IOS_GESTURE_EVENTS)
     211    bool dispatchGestureEvent(const PlatformTouchEvent&, const AtomicString&, const EventTargetSet&, float, float);
     212#endif
     213
     214#if PLATFORM(IOS)
     215    void defaultTouchEventHandler(Node*, TouchEvent*);
     216#endif
     217
    178218#if ENABLE(TOUCH_ADJUSTMENT)
    179219    bool bestClickableNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode);
     
    214254
    215255#if PLATFORM(MAC) && defined(__OBJC__)
     256#if !PLATFORM(IOS)
    216257    void mouseDown(NSEvent *);
    217258    void mouseDragged(NSEvent *);
     
    220261    bool keyEvent(NSEvent *);
    221262    bool wheelEvent(NSEvent *);
    222 
     263#else
     264    void mouseDown(WebEvent *);
     265    void mouseUp(WebEvent *);
     266    void mouseMoved(WebEvent *);
     267    bool keyEvent(WebEvent *);
     268    bool wheelEvent(WebEvent *);
     269#endif
     270
     271#if ENABLE(IOS_TOUCH_EVENTS)
     272    void touchEvent(WebEvent *);
     273#endif
     274
     275#if !PLATFORM(IOS)
    223276    void passMouseMovedEventToScrollbars(NSEvent *);
    224277
    225278    void sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent);
    226 
     279#endif
     280
     281#if !PLATFORM(IOS)
    227282    void setActivationEventNumber(int num) { m_activationEventNumber = num; }
    228283
    229284    static NSEvent *currentNSEvent();
     285#else
     286    static WebEvent *currentEvent();
     287#endif // !PLATFORM(IOS)
     288#endif // PLATFORM(MAC) && defined(__OBJC__)
     289
     290#if PLATFORM(IOS)
     291    void invalidateClick();
    230292#endif
    231293
     
    267329
    268330    void hoverTimerFired(Timer<EventHandler>*);
     331#if ENABLE(CURSOR_SUPPORT)
    269332    void cursorUpdateTimerFired(Timer<EventHandler>*);
     333#endif
    270334
    271335    bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
     
    292356#if ENABLE(TOUCH_EVENTS)
    293357    bool dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent&);
    294     HitTestResult hitTestResultInFrame(Frame*, const LayoutPoint&, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
    295 #endif
    296 
     358#endif
     359
     360#if !PLATFORM(IOS)
    297361    void invalidateClick();
     362#endif
    298363
    299364    Node* nodeUnderMouse() const;
     
    402467
    403468    Timer<EventHandler> m_hoverTimer;
     469#if ENABLE(CURSOR_SUPPORT)
    404470    Timer<EventHandler> m_cursorUpdateTimer;
     471#endif
    405472
    406473    OwnPtr<AutoscrollController> m_autoscrollController;
     
    429496    int m_clickCount;
    430497    RefPtr<Node> m_clickNode;
     498
     499#if ENABLE(IOS_GESTURE_EVENTS)
     500    float m_gestureInitialDiameter;
     501    float m_gestureLastDiameter;
     502    float m_gestureInitialRotation;
     503    float m_gestureLastRotation;
     504#endif
     505
     506#if ENABLE(IOS_TOUCH_EVENTS)
     507    unsigned m_firstTouchID;
     508
     509    TouchArray m_touches;
     510    EventTargetSet m_gestureTargets;
     511    RefPtr<Frame> m_touchEventTargetSubframe;
     512#endif
    431513
    432514#if ENABLE(DRAG_SUPPORT)
     
    453535    RefPtr<Element> m_previousWheelScrolledElement;
    454536
    455 #if PLATFORM(MAC)
     537#if PLATFORM(MAC) || PLATFORM(IOS)
    456538    NSView *m_mouseDownView;
    457539    bool m_sendingEventToSubview;
     540#if !PLATFORM(IOS)
    458541    int m_activationEventNumber;
    459542#endif
    460 #if ENABLE(TOUCH_EVENTS)
     543#endif
     544#if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
    461545    typedef HashMap<int, RefPtr<EventTarget>> TouchTargetMap;
    462546    TouchTargetMap m_originatingTouchPointTargets;
  • trunk/Source/WebCore/page/FocusController.h

    r155731 r161106  
    8383    bool containingWindowIsVisible() const { return m_containingWindowIsVisible; }
    8484
     85    // These methods are used in WebCore/bindings/objc/DOM.mm.
     86    Element* nextFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);
     87    Element* previousFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);
     88
    8589private:
    8690    bool advanceFocusDirectionally(FocusDirection, KeyboardEvent*);
     
    102106    Element* findFocusableElement(FocusDirection, FocusNavigationScope, Node* start, KeyboardEvent*);
    103107
    104     Element* nextFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);
    105     Element* previousFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);
    106 
    107108    Element* findElementWithExactTabIndex(Node* start, int tabIndex, KeyboardEvent*, FocusDirection);
    108109
  • trunk/Source/WebCore/page/Frame.cpp

    r160764 r161106  
    122122#endif
    123123
     124#if PLATFORM(IOS)
     125#include "WKContentObservation.h"
     126#endif
     127
    124128namespace WebCore {
    125129
    126130using namespace HTMLNames;
     131
     132#if PLATFORM(IOS)
     133const unsigned scrollFrequency = 1000 / 60;
     134#endif
    127135
    128136DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame"));
     
    164172    , m_eventHandler(adoptPtr(new EventHandler(*this)))
    165173    , m_animationController(std::make_unique<AnimationController>(*this))
     174#if PLATFORM(IOS)
     175    , m_overflowAutoScrollTimer(this, &Frame::overflowAutoScrollTimerFired)
     176    , m_selectionChangeCallbacksDisabled(false)
     177    , m_timersPausedCount(0)
     178#endif
    166179    , m_pageZoomFactor(parentPageZoomFactor(this))
    167180    , m_textZoomFactor(parentTextZoomFactor(this))
     
    198211#endif
    199212
     213    // FIXME: We should reconcile the iOS and OpenSource code below.
     214    Frame* parent = parentFromOwnerElement(ownerElement);
     215#if PLATFORM(IOS)
     216    // Pause future timers if this frame is created when page is in pending state.
     217    if (parent && parent->timersPaused())
     218        setTimersPaused(true);
     219#else
    200220    // Pause future ActiveDOMObjects if this frame is being created while the page is in a paused state.
    201     Frame* parent = parentFromOwnerElement(ownerElement);
    202221    if (parent && parent->activeDOMObjectsAndAnimationsSuspended())
    203222        suspendActiveDOMObjectsAndAnimations();
     223#endif
    204224}
    205225
     
    472492}
    473493
     494#if PLATFORM(IOS)
     495void Frame::scrollOverflowLayer(RenderLayer* layer, const IntRect& visibleRect, const IntRect& exposeRect)
     496{
     497    if (!layer)
     498        return;
     499
     500    RenderBox* box = layer->renderBox();
     501    if (!box)
     502        return;
     503
     504    if (visibleRect.intersects(exposeRect))
     505        return;
     506
     507    int x = layer->scrollXOffset();
     508    int exposeLeft = exposeRect.x();
     509    int exposeRight = exposeLeft + exposeRect.width();
     510    int clientWidth = box->clientWidth();
     511    if (exposeLeft <= 0)
     512        x = std::max(0, x + exposeLeft - clientWidth / 2);
     513    else if (exposeRight >= clientWidth)
     514        x = std::min(box->scrollWidth() - clientWidth, x + clientWidth / 2);
     515
     516    int y = layer->scrollYOffset();
     517    int exposeTop = exposeRect.y();
     518    int exposeBottom = exposeTop + exposeRect.height();
     519    int clientHeight = box->clientHeight();
     520    if (exposeTop <= 0)
     521        y = std::max(0, y + exposeTop - clientHeight / 2);
     522    else if (exposeBottom >= clientHeight)
     523        y = std::min(box->scrollHeight() - clientHeight, y + clientHeight / 2);
     524
     525    layer->scrollToOffset(IntSize(x, y));
     526    selection().setCaretRectNeedsUpdate();
     527    selection().updateAppearance();
     528}
     529
     530void Frame::overflowAutoScrollTimerFired(Timer<Frame>*)
     531{
     532    if (!eventHandler().mousePressed() || checkOverflowScroll(PerformOverflowScroll) == OverflowScrollNone) {
     533        if (m_overflowAutoScrollTimer.isActive())
     534            m_overflowAutoScrollTimer.stop();
     535    }
     536}
     537
     538void Frame::startOverflowAutoScroll(const IntPoint& mousePosition)
     539{
     540    m_overflowAutoScrollPos = mousePosition;
     541
     542    if (m_overflowAutoScrollTimer.isActive())
     543        return;
     544
     545    if (checkOverflowScroll(DoNotPerformOverflowScroll) == OverflowScrollNone)
     546        return;
     547
     548    m_overflowAutoScrollTimer.startRepeating(scrollFrequency);
     549    m_overflowAutoScrollDelta = 3;
     550}
     551
     552int Frame::checkOverflowScroll(OverflowScrollAction action)
     553{
     554    Position extent = selection().selection().extent();
     555    if (extent.isNull())
     556        return OverflowScrollNone;
     557
     558    RenderObject* renderer = extent.deprecatedNode()->renderer();
     559    if (!renderer)
     560        return OverflowScrollNone;
     561
     562    FrameView* view = this->view();
     563    if (!view)
     564        return OverflowScrollNone;
     565
     566    RenderBlock* containingBlock = renderer->containingBlock();
     567    if (!containingBlock || !containingBlock->hasOverflowClip())
     568        return OverflowScrollNone;
     569    RenderLayer* layer = containingBlock->layer();
     570    ASSERT(layer);
     571
     572    IntRect visibleRect = IntRect(view->scrollX(), view->scrollY(), view->visibleWidth(), view->visibleHeight());
     573    IntPoint position = m_overflowAutoScrollPos;
     574    if (visibleRect.contains(position.x(), position.y()))
     575        return OverflowScrollNone;
     576
     577    int scrollType = 0;
     578    int deltaX = 0;
     579    int deltaY = 0;
     580    IntPoint selectionPosition;
     581
     582    // This constant will make the selection draw a little bit beyond the edge of the visible area.
     583    // This prevents a visual glitch, in that you can fail to select a portion of a character that
     584    // is being rendered right at the edge of the visible rectangle.
     585    // FIXME: This probably needs improvement, and may need to take the font size into account.
     586    static const int scrollBoundsAdjustment = 3;
     587
     588    // FIXME: Make a small buffer at the end of a visible rectangle so that autoscrolling works
     589    // even if the visible extends to the limits of the screen.
     590    if (position.x() < visibleRect.x()) {
     591        scrollType |= OverflowScrollLeft;
     592        if (action == PerformOverflowScroll) {
     593            deltaX -= static_cast<int>(m_overflowAutoScrollDelta);
     594            selectionPosition.setX(view->scrollX() - scrollBoundsAdjustment);
     595        }
     596    } else if (position.x() > visibleRect.maxX()) {
     597        scrollType |= OverflowScrollRight;
     598        if (action == PerformOverflowScroll) {
     599            deltaX += static_cast<int>(m_overflowAutoScrollDelta);
     600            selectionPosition.setX(view->scrollX() + view->visibleWidth() + scrollBoundsAdjustment);
     601        }
     602    }
     603
     604    if (position.y() < visibleRect.y()) {
     605        scrollType |= OverflowScrollUp;
     606        if (action == PerformOverflowScroll) {
     607            deltaY -= static_cast<int>(m_overflowAutoScrollDelta);
     608            selectionPosition.setY(view->scrollY() - scrollBoundsAdjustment);
     609        }
     610    } else if (position.y() > visibleRect.maxY()) {
     611        scrollType |= OverflowScrollDown;
     612        if (action == PerformOverflowScroll) {
     613            deltaY += static_cast<int>(m_overflowAutoScrollDelta);
     614            selectionPosition.setY(view->scrollY() + view->visibleHeight() + scrollBoundsAdjustment);
     615        }
     616    }
     617
     618    if (action == PerformOverflowScroll && (deltaX || deltaY)) {
     619        layer->scrollToOffset(IntSize(layer->scrollXOffset() + deltaX, layer->scrollYOffset() + deltaY));
     620
     621        // Handle making selection.
     622        VisiblePosition visiblePosition(renderer->positionForPoint(selectionPosition));
     623        if (visiblePosition.isNotNull()) {
     624            VisibleSelection visibleSelection = selection().selection();
     625            visibleSelection.setExtent(visiblePosition);
     626            if (selection().granularity() != CharacterGranularity)
     627                visibleSelection.expandUsingGranularity(selection().granularity());
     628            if (selection().shouldChangeSelection(visibleSelection))
     629                selection().setSelection(visibleSelection);
     630        }
     631
     632        m_overflowAutoScrollDelta *= 1.02f; // Accelerate the scroll
     633    }
     634    return scrollType;
     635}
     636
     637void Frame::setSelectionChangeCallbacksDisabled(bool selectionChangeCallbacksDisabled)
     638{
     639    m_selectionChangeCallbacksDisabled = selectionChangeCallbacksDisabled;
     640}
     641
     642bool Frame::selectionChangeCallbacksDisabled() const
     643{
     644    return m_selectionChangeCallbacksDisabled;
     645}
     646#endif // PLATFORM(IOS)
     647
    474648void Frame::setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio, AdjustViewSizeOrNot shouldAdjustViewSize)
    475649{
     
    625799        page()->scrollingCoordinator()->willDestroyScrollableArea(m_view.get());
    626800
     801#if PLATFORM(IOS)
     802    if (WebThreadCountOfObservedContentModifiers() > 0 && m_page)
     803        m_page->chrome().client().clearContentChangeObservers(this);
     804#endif
     805
    627806    script().clearScriptObjects();
    628807    script().updatePlatformScriptObjects();
     
    709888
    710889void Frame::createView(const IntSize& viewportSize, const Color& backgroundColor, bool transparent,
    711     const IntSize& fixedLayoutSize, const IntRect& fixedVisibleContentRect ,
     890    const IntSize& fixedLayoutSize, const IntRect& fixedVisibleContentRect,
    712891    bool useFixedLayout, ScrollbarMode horizontalScrollbarMode, bool horizontalLock,
    713892    ScrollbarMode verticalScrollbarMode, bool verticalLock)
     
    727906        frameView = FrameView::create(*this, viewportSize);
    728907        frameView->setFixedLayoutSize(fixedLayoutSize);
     908#if !PLATFORM(IOS)
    729909        frameView->setFixedVisibleContentRect(fixedVisibleContentRect);
     910#else
     911        UNUSED_PARAM(fixedVisibleContentRect);
     912#endif
    730913        frameView->setUseFixedLayout(useFixedLayout);
    731914    } else
  • trunk/Source/WebCore/page/Frame.h

    r160152 r161106  
    3838#include <wtf/RefCounted.h>
    3939
     40#if PLATFORM(IOS)
     41#include "ViewportArguments.h"
     42#include "VisibleSelection.h"
     43#endif
     44
    4045#if PLATFORM(WIN)
    4146#include "FrameWin.h"
     
    4449#if USE(TILED_BACKING_STORE)
    4550#include "TiledBackingStoreClient.h"
     51#endif
     52
     53#if PLATFORM(IOS)
     54OBJC_CLASS DOMCSSStyleDeclaration;
     55OBJC_CLASS DOMNode;
     56OBJC_CLASS NSArray;
     57OBJC_CLASS NSString;
    4658#endif
    4759
     
    6476    class HTMLFrameOwnerElement;
    6577    class HTMLTableCellElement;
     78    class HitTestResult;
    6679    class ImageBuffer;
    6780    class IntRect;
     
    7083    class Range;
    7184    class RegularExpression;
     85    class RenderLayer;
    7286    class RenderView;
    7387    class RenderWidget;
     
    7791    class VisiblePosition;
    7892    class Widget;
     93
     94#if PLATFORM(IOS)
     95    enum {
     96        OverflowScrollNone = 0,
     97        OverflowScrollLeft = 1 << 0,
     98        OverflowScrollRight = 1 << 1,
     99        OverflowScrollUp = 1 << 2,
     100        OverflowScrollDown = 1 << 3
     101    };
     102
     103    enum OverflowScrollAction { DoNotPerformOverflowScroll, PerformOverflowScroll };
     104    typedef Node* (*NodeQualifier)(const HitTestResult&, Node* terminationNode, IntRect* nodeBounds);
     105#endif
    79106
    80107#if !USE(TILED_BACKING_STORE)
     
    97124
    98125        void init();
     126#if PLATFORM(IOS)
     127        // Creates <html><body style="..."></body></html> doing minimal amount of work.
     128        void initWithSimpleHTMLDocument(const String& style, const URL&);
     129#endif
    99130        void setView(PassRefPtr<FrameView>);
    100131        void createView(const IntSize&, const Color&, bool,
     
    166197#endif
    167198
     199#if PLATFORM(IOS)
     200        const ViewportArguments& viewportArguments() const;
     201        void setViewportArguments(const ViewportArguments&);
     202
     203        Node* deepestNodeAtLocation(const FloatPoint& viewportLocation);
     204        Node* nodeRespondingToClickEvents(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation);
     205        Node* nodeRespondingToScrollWheelEvents(const FloatPoint& viewportLocation);
     206
     207        int indexCountOfWordPrecedingSelection(NSString* word) const;
     208        NSArray* wordsInCurrentParagraph() const;
     209        CGRect renderRectForPoint(CGPoint, bool* isReplaced, float* fontSize) const;
     210
     211        void setSelectionChangeCallbacksDisabled(bool = true);
     212        bool selectionChangeCallbacksDisabled() const;
     213
     214        enum ViewportOffsetChangeType { IncrementalScrollOffset, CompletedScrollOffset };
     215        void viewportOffsetChanged(ViewportOffsetChangeType);
     216        bool containsTiledBackingLayers() const;
     217
     218        void overflowScrollPositionChangedForNode(const IntPoint&, Node*, bool isUserScroll);
     219
     220        void resetAllGeolocationPermission();
     221#endif
     222
    168223#if ENABLE(ORIENTATION_EVENTS)
    169224        // Orientation is the interface orientation in degrees. Some examples are:
     
    192247#endif
    193248
     249#if PLATFORM(IOS)
     250        // Scroll the selection in an overflow layer on iOS.
     251        void scrollOverflowLayer(RenderLayer* , const IntRect& visibleRect, const IntRect& exposeRect);
     252
     253        int preferredHeight() const;
     254        int innerLineHeight(DOMNode*) const;
     255        void updateLayout() const;
     256        NSRect caretRect() const;
     257        NSRect rectForScrollToVisible() const;
     258        NSRect rectForSelection(VisibleSelection&) const;
     259        DOMCSSStyleDeclaration* styleAtSelectionStart() const;
     260        unsigned formElementsCharacterCount() const;
     261        void setTimersPaused(bool);
     262        bool timersPaused() const { return m_timersPausedCount; }
     263        void dispatchPageHideEventBeforePause();
     264        void dispatchPageShowEventBeforeResume();
     265        void setRangedSelectionBaseToCurrentSelection();
     266        void setRangedSelectionBaseToCurrentSelectionStart();
     267        void setRangedSelectionBaseToCurrentSelectionEnd();
     268        void clearRangedSelectionInitialExtent();
     269        void setRangedSelectionInitialExtentToCurrentSelectionStart();
     270        void setRangedSelectionInitialExtentToCurrentSelectionEnd();
     271        VisibleSelection rangedSelectionBase() const;
     272        VisibleSelection rangedSelectionInitialExtent() const;
     273        void recursiveSetUpdateAppearanceEnabled(bool);
     274        NSArray* interpretationsForCurrentRoot() const;
     275#endif
    194276        void suspendActiveDOMObjectsAndAnimations();
    195277        void resumeActiveDOMObjectsAndAnimations();
     
    224306        const OwnPtr<EventHandler> m_eventHandler;
    225307        const std::unique_ptr<AnimationController> m_animationController;
     308
     309#if PLATFORM(IOS)
     310        void betterApproximateNode(const IntPoint& testPoint, NodeQualifier, Node*& best, Node* failedNode, IntPoint& bestPoint, IntRect& bestRect, const IntRect& testRect);
     311        bool hitTestResultAtViewportLocation(const FloatPoint& viewportLocation, HitTestResult&, IntPoint& center);
     312        Node* qualifyingNodeAtViewportLocation(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, NodeQualifier, bool shouldApproximate);
     313
     314        void overflowAutoScrollTimerFired(Timer<Frame>*);
     315        void startOverflowAutoScroll(const IntPoint&);
     316        int checkOverflowScroll(OverflowScrollAction);
     317
     318        void setTimersPausedInternal(bool);
     319
     320        Timer<Frame> m_overflowAutoScrollTimer;
     321        float m_overflowAutoScrollDelta;
     322        IntPoint m_overflowAutoScrollPos;
     323        ViewportArguments m_viewportArguments;
     324        bool m_selectionChangeCallbacksDisabled;
     325        int m_timersPausedCount;
     326        VisibleSelection m_rangedSelectionBase;
     327        VisibleSelection m_rangedSelectionInitialExtent;
     328#endif
    226329
    227330#if ENABLE(IOS_TEXT_AUTOSIZING)
  • trunk/Source/WebCore/page/FrameView.cpp

    r160944 r161106  
    6666#include "RenderScrollbarPart.h"
    6767#include "RenderStyle.h"
     68#include "RenderText.h"
    6869#include "RenderTheme.h"
    6970#include "RenderView.h"
     
    9798#if ENABLE(TEXT_AUTOSIZING)
    9899#include "TextAutosizer.h"
     100#endif
     101
     102#if PLATFORM(IOS)
     103#include "DocumentLoader.h"
     104#include "Logging.h"
     105#include "MemoryCache.h"
     106#include "MemoryPressureHandler.h"
     107#include "SystemMemory.h"
     108#include "TileCache.h"
     109#endif
     110
     111#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     112#include "HTMLMediaElement.h"
    99113#endif
    100114
     
    191205    , m_setNeedsLayoutWasDeferred(false)
    192206    , m_scrollCorner(0)
     207#if PLATFORM(IOS)
     208    , m_useCustomFixedPositionLayoutRect(false)
     209#endif
    193210    , m_shouldAutoSize(false)
    194211    , m_inAutoSize(false)
     
    393410
    394411    setScrollbarsSuppressed(true);
     412
     413#if PLATFORM(IOS)
     414    // To avoid flashes of white, disable tile updates immediately when view is cleared at the beginning of a page load.
     415    // Tiling will be re-enabled from UIKit via [WAKWindow setTilingMode:] when we have content to draw.
     416    if (TileCache* tileCache = this->tileCache())
     417        tileCache->setTilingMode(TileCache::Disabled);
     418#endif
    395419}
    396420
     
    884908    flushDeferredRepaints();
    885909
     910#if PLATFORM(IOS)
     911    if (TileCache* tileCache = this->tileCache())
     912        tileCache->doPendingRepaints();
     913#endif
     914
    886915    renderView->compositor().flushPendingLayerChanges(rootFrameForFlush == &frame());
    887916
     
    895924}
    896925
     926GraphicsLayer* FrameView::graphicsLayerForPlatformWidget(PlatformWidget platformWidget)
     927{
     928    // To find the Widget that corresponds with platformWidget we have to do a linear
     929    // search of our child widgets.
     930    Widget* foundWidget = nullptr;
     931    for (auto& widget : children()) {
     932        if (widget->platformWidget() != platformWidget)
     933            continue;
     934        foundWidget = widget.get();
     935        break;
     936    }
     937
     938    if (!foundWidget)
     939        return nullptr;
     940
     941    auto* renderWidget = RenderWidget::find(foundWidget);
     942    if (!renderWidget)
     943        return nullptr;
     944
     945    RenderLayer* widgetLayer = renderWidget->layer();
     946    if (!widgetLayer || !widgetLayer->isComposited())
     947        return nullptr;
     948
     949    return widgetLayer->backing()->parentForSublayers();
     950}
     951
     952void FrameView::scheduleLayerFlushAllowingThrottling()
     953{
     954    RenderView* view = this->renderView();
     955    if (!view)
     956        return;
     957    view->compositor().scheduleLayerFlush(true /* canThrottle */);
     958}
    897959#endif // USE(ACCELERATED_COMPOSITING)
    898960
     
    10821144            return;
    10831145    }
     1146
     1147#if PLATFORM(IOS)
     1148    if (updateFixedPositionLayoutRect())
     1149        allowSubtree = false;
     1150#endif
    10841151
    10851152    m_layoutTimer.stop();
     
    11991266                        m_lastViewportSize = fixedLayoutSize();
    12001267                    else
     1268#if PLATFORM(IOS)
     1269                        m_lastViewportSize = actualVisibleContentRect().size();
     1270#else
    12011271                        m_lastViewportSize = visibleContentRect(IncludeScrollbars).size();
     1272#endif
    12021273
    12031274                    m_lastZoomFactor = root->style().zoom();
     
    13121383#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
    13131384    updateAnnotatedRegions();
     1385#endif
     1386
     1387#if ENABLE(IOS_TOUCH_EVENTS)
     1388    document.dirtyTouchEventRects();
    13141389#endif
    13151390
     
    19031978}
    19041979
     1980#if !PLATFORM(IOS)
    19051981void FrameView::setFixedVisibleContentRect(const IntRect& visibleContentRect)
    19061982{
     
    19282004    frame().loader().client().didChangeScrollOffset();
    19292005}
     2006#endif
    19302007
    19312008void FrameView::setViewportConstrainedObjectsNeedLayout()
     
    21212198}
    21222199
     2200static unsigned countRenderedCharactersInRenderObjectWithThreshold(const RenderObject& renderer, unsigned countSoFar, unsigned threshold)
     2201{
     2202    // FIXME: Consider writing this using RenderObject::nextInPreOrder() instead of using recursion.
     2203    if (renderer.isText())
     2204        countSoFar += toRenderText(renderer).text()->length();
     2205
     2206    for (RenderObject* child = renderer.firstChildSlow(); child; child = child->nextSibling()) {
     2207        if (countSoFar >= threshold)
     2208            break;
     2209        countSoFar = countRenderedCharactersInRenderObjectWithThreshold(*child, countSoFar, threshold);
     2210    }
     2211    return countSoFar;
     2212}
     2213
     2214bool FrameView::renderedCharactersExceed(unsigned threshold)
     2215{
     2216    if (!m_frame->contentRenderer())
     2217        return false;
     2218    return countRenderedCharactersInRenderObjectWithThreshold(*m_frame->contentRenderer(), 0, threshold) >= threshold;
     2219}
     2220
    21232221void FrameView::contentsResized()
    21242222{
     
    21442242    if (!frame().view())
    21452243        return;
     2244
     2245#if PLATFORM(IOS)
     2246    if (RenderView* root = m_frame->contentRenderer()) {
     2247        if (useCustomFixedPositionLayoutRect() && hasViewportConstrainedObjects()) {
     2248            setViewportConstrainedObjectsNeedLayout();
     2249            // We must eagerly enter compositing mode because fixed position elements
     2250            // will not have been made compositing via a preceding style change before
     2251            // m_useCustomFixedPositionLayoutRect was true.
     2252            root->compositor().enableCompositingMode();
     2253        }
     2254    }
     2255#endif
    21462256
    21472257    if (!useFixedLayout() && needsLayout())
     
    23212431        renderView->layer()->backing()->adjustTiledBackingCoverage();
    23222432#endif
     2433#if PLATFORM(IOS)
     2434    if (TileCache* tileCache = this->tileCache())
     2435        tileCache->setSpeculativeTileCreationEnabled(!m_frame->page()->progress().isMainLoadProgressing());
     2436#endif
    23232437}
    23242438
     
    26822796    }
    26832797
     2798#if PLATFORM(IOS)
     2799    // Only send layout-related delegate callbacks synchronously for the main frame to
     2800    // avoid re-entering layout for the main frame while delivering a layout-related delegate
     2801    // callback for a subframe.
     2802    if (frame().isMainFrame())
     2803        page->chrome().client().didLayout();
     2804#endif
     2805
    26842806    if (milestonesAchieved && frame().isMainFrame())
    26852807        frame().loader().didLayout(milestonesAchieved);
     
    27342856        currentSize = fixedLayoutSize();
    27352857    else
     2858#if PLATFORM(IOS)
     2859        currentSize = actualVisibleContentRect().size();
     2860#else
    27362861        currentSize = visibleContentRect(IncludeScrollbars).size();
     2862#endif
    27372863
    27382864    float currentZoomFactor = renderView->style().zoom();
     
    27442870    if (!shouldSendResizeEvent)
    27452871        return;
     2872
     2873#if PLATFORM(IOS)
     2874    // Don't send the resize event if the document is loading. Some pages automatically reload
     2875    // when the window is resized; Safari on iOS often resizes the window while setting up its
     2876    // viewport. This obviously can cause problems.
     2877    if (DocumentLoader* documentLoader = frame().loader().documentLoader()) {
     2878        if (documentLoader->isLoadingInAPISense())
     2879            return;
     2880    }
     2881#endif
    27462882
    27472883    bool isMainFrame = frame().isMainFrame();
     
    34243560
    34253561    bool isTopLevelPainter = !sCurrentPaintTimeStamp;
     3562#if PLATFORM(IOS)
     3563    // FIXME: Remove PLATFORM(IOS)-guard once we upstream the iOS changes to MemoryPressureHandler.h.
     3564    if (isTopLevelPainter && memoryPressureHandler().hasReceivedMemoryPressure()) {
     3565        LOG(MemoryPressure, "Under memory pressure: %s", __PRETTY_FUNCTION__);
     3566
     3567        // To avoid unnecessary image decoding, we don't prune recently-decoded live resources here since
     3568        // we might need some live bitmaps on painting.
     3569        memoryCache()->prune();
     3570    }
     3571#endif
    34263572    if (isTopLevelPainter)
    34273573        sCurrentPaintTimeStamp = monotonicallyIncreasingTime();
     
    34753621    m_paintBehavior = oldPaintBehavior;
    34763622    m_lastPaintTime = monotonicallyIncreasingTime();
     3623
     3624#if PLATFORM(IOS)
     3625    // Painting can lead to decoding of large amounts of bitmaps
     3626    // If we are low on memory, wipe them out after the paint.
     3627    // FIXME: Remove PLATFORM(IOS)-guard once we upstream the iOS changes to MemoryPressureHandler.h.
     3628    if (isTopLevelPainter && memoryPressureHandler().hasReceivedMemoryPressure())
     3629        memoryCache()->pruneLiveResources(true);
     3630#endif
    34773631
    34783632    // Regions may have changed as a result of the visibility/z-index of element changing.
     
    40504204}
    40514205   
     4206#if PLATFORM(IOS)
     4207void FrameView::setUseCustomFixedPositionLayoutRect(bool useCustomFixedPositionLayoutRect)
     4208{
     4209    if (m_useCustomFixedPositionLayoutRect == useCustomFixedPositionLayoutRect)
     4210        return;
     4211    m_useCustomFixedPositionLayoutRect = useCustomFixedPositionLayoutRect;
     4212    visibleContentsResized();
     4213}
     4214
     4215void FrameView::setCustomFixedPositionLayoutRect(const IntRect& rect)
     4216{
     4217    if (m_useCustomFixedPositionLayoutRect && m_customFixedPositionLayoutRect == rect)
     4218        return;
     4219    m_useCustomFixedPositionLayoutRect = true;
     4220    m_customFixedPositionLayoutRect = rect;
     4221    visibleContentsResized();
     4222}
     4223
     4224bool FrameView::updateFixedPositionLayoutRect()
     4225{
     4226    if (!m_useCustomFixedPositionLayoutRect)
     4227        return false;
     4228
     4229    IntRect newRect;
     4230    Page* page = frame().page();
     4231    if (!page || !page->chrome().client().fetchCustomFixedPositionLayoutRect(newRect))
     4232        return false;
     4233
     4234    if (newRect != m_customFixedPositionLayoutRect) {
     4235        m_customFixedPositionLayoutRect = newRect;
     4236        setViewportConstrainedObjectsNeedLayout();
     4237        return true;
     4238    }
     4239    return false;
     4240}
     4241#endif // PLATFORM(IOS)
     4242
    40524243void FrameView::setScrollingPerformanceLoggingEnabled(bool flag)
    40534244{
  • trunk/Source/WebCore/page/FrameView.h

    r160847 r161106  
    121121    bool needsFullRepaint() const { return m_needsFullRepaint; }
    122122
     123    bool renderedCharactersExceed(unsigned threshold);
     124
     125#if PLATFORM(IOS)
     126    bool useCustomFixedPositionLayoutRect() const { return m_useCustomFixedPositionLayoutRect; }
     127    void setUseCustomFixedPositionLayoutRect(bool);
     128    IntRect customFixedPositionLayoutRect() const { return m_customFixedPositionLayoutRect; }
     129    void setCustomFixedPositionLayoutRect(const IntRect&);
     130    bool updateFixedPositionLayoutRect();
     131#endif
     132
    123133#if ENABLE(REQUEST_ANIMATION_FRAME)
    124134    void serviceScriptedAnimations(double monotonicAnimationStartTime);
     
    136146    // content rendered via the normal painting path.
    137147    void setNeedsOneShotDrawingSynchronization();
     148
     149    GraphicsLayer* graphicsLayerForPlatformWidget(PlatformWidget);
     150    void scheduleLayerFlushAllowingThrottling();
    138151
    139152    virtual TiledBacking* tiledBacking() OVERRIDE;
     
    193206    virtual float visibleContentScaleFactor() const OVERRIDE;
    194207
     208#if !PLATFORM(IOS)
    195209    virtual void setFixedVisibleContentRect(const IntRect&) OVERRIDE;
     210#endif
    196211    virtual void setScrollPosition(const IntPoint&) OVERRIDE;
    197212    void scrollPositionChangedViaPlatformWidget();
     
    632647    RenderScrollbarPart* m_scrollCorner;
    633648
     649#if PLATFORM(IOS)
     650    bool m_useCustomFixedPositionLayoutRect;
     651    IntRect m_customFixedPositionLayoutRect;
     652#endif
     653
    634654    // If true, automatically resize the frame view around its content.
    635655    bool m_shouldAutoSize;
  • trunk/Source/WebCore/page/Navigator.cpp

    r154219 r161106  
    133133}
    134134
     135#if PLATFORM(IOS)
     136bool Navigator::standalone() const
     137{
     138    return m_frame && m_frame->settings().standalone();
     139}
     140#endif
     141
    135142void Navigator::getStorageUpdates()
    136143{
  • trunk/Source/WebCore/page/Navigator.h

    r134188 r161106  
    5454    virtual String userAgent() const;
    5555
     56#if PLATFORM(IOS)
     57    bool standalone() const;
     58#endif
     59
    5660    // Relinquishes the storage lock, if one exists.
    5761    void getStorageUpdates();
  • trunk/Source/WebCore/page/Navigator.idl

    r159061 r161106  
    3838    readonly attribute boolean onLine;
    3939
     40    // FIXME: Convert this #if'def to an IDL conditional attribute.
     41#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
     42    readonly attribute boolean standalone;
     43#endif
     44
    4045    void getStorageUpdates(); // FIXME: Remove this method or rename to yieldForStorageUpdates.
    4146};
  • trunk/Source/WebCore/page/NavigatorBase.cpp

    r127757 r161106  
    3636#endif
    3737
     38#if PLATFORM(IOS)
     39#include "WebCoreSystemInterface.h"
     40#endif
     41
    3842#ifndef WEBCORE_NAVIGATOR_PLATFORM
    39 #if OS(MAC_OS_X) && (CPU(PPC) || CPU(PPC64))
     43#if PLATFORM(IOS)
     44#define WEBCORE_NAVIGATOR_PLATFORM ""
     45#elif OS(MAC_OS_X) && (CPU(PPC) || CPU(PPC64))
    4046#define WEBCORE_NAVIGATOR_PLATFORM "MacPPC"
    4147#elif OS(MAC_OS_X) && (CPU(X86) || CPU(X86_64))
  • trunk/Source/WebCore/page/Page.h

    r160944 r161106  
    4747#if PLATFORM(MAC)
    4848#include <wtf/SchedulePair.h>
     49#endif
     50
     51#if PLATFORM(IOS)
     52#include "Settings.h"
    4953#endif
    5054
     
    322326    void setSessionStorage(PassRefPtr<StorageNamespace>);
    323327
     328    // FIXME: We should make Settings::maxParseDuration() platform-independent, remove {has, set}CustomHTMLTokenizerTimeDelay()
     329    // and customHTMLTokenizerTimeDelay() and modify theirs callers to update or query Settings::maxParseDuration().
    324330    void setCustomHTMLTokenizerTimeDelay(double);
     331#if PLATFORM(IOS)
     332    bool hasCustomHTMLTokenizerTimeDelay() const { return m_settings->maxParseDuration() != -1; }
     333    double customHTMLTokenizerTimeDelay() const { ASSERT(m_settings->maxParseDuration() != -1); return m_settings->maxParseDuration(); }
     334#else
    325335    bool hasCustomHTMLTokenizerTimeDelay() const { return m_customHTMLTokenizerTimeDelay != -1; }
    326336    double customHTMLTokenizerTimeDelay() const { ASSERT(m_customHTMLTokenizerTimeDelay != -1); return m_customHTMLTokenizerTimeDelay; }
     337#endif
    327338
    328339    void setCustomHTMLTokenizerChunkSize(int);
  • trunk/Source/WebCore/page/PageGroup.cpp

    r156769 r161106  
    218218}
    219219
     220void PageGroup::removeVisitedLink(const URL& url)
     221{
     222    LinkHash hash = visitedLinkHash(url.string());
     223    ASSERT(m_visitedLinkHashes.contains(hash));
     224    m_visitedLinkHashes.remove(hash);
     225
     226    Page::allVisitedStateChanged(this);
     227    pageCache()->markPagesForVistedLinkStyleRecalc();
     228}
     229
    220230void PageGroup::removeVisitedLinks()
    221231{
  • trunk/Source/WebCore/page/PageGroup.h

    r157653 r161106  
    7878        void addVisitedLink(const UChar*, size_t);
    7979        void addVisitedLinkHash(LinkHash);
     80        void removeVisitedLink(const URL&);
    8081        void removeVisitedLinks();
    8182
  • trunk/Source/WebCore/page/Settings.cpp

    r160679 r161106  
    2727#include "Settings.h"
    2828
     29#include "AudioSession.h"
    2930#include "BackForwardController.h"
    3031#include "CachedResourceLoader.h"
     
    4647#include "TextAutosizer.h"
    4748#include <limits>
     49#include <wtf/NeverDestroyed.h>
     50
    4851
    4952namespace WebCore {
     
    9396bool Settings::gShouldRespectPriorityInCSSAttributeSetters = false;
    9497bool Settings::gLowPowerVideoAudioBufferSizeEnabled = false;
     98
     99#if PLATFORM(IOS)
     100bool Settings::gNetworkDataUsageTrackingEnabled = false;
     101#endif
    95102
    96103// NOTEs
     
    147154    , m_storageBlockingPolicy(SecurityOrigin::AllowAllStorage)
    148155    , m_layoutInterval(layoutScheduleThreshold)
     156#if PLATFORM(IOS)
     157    , m_maxParseDuration(-1)
     158#endif
    149159#if ENABLE(TEXT_AUTOSIZING)
    150160    , m_textAutosizingFontScaleFactor(1)
     
    169179    , m_fontRenderingMode(0)
    170180    , m_isCSSCustomFilterEnabled(false)
     181#if PLATFORM(IOS)
     182    , m_standalone(false)
     183    , m_telephoneNumberParsingEnabled(false)
     184    , m_mediaDataLoadsAutomatically(false)
     185    , m_shouldTransformsAffectOverflow(true)
     186    , m_shouldDispatchJavaScriptWindowOnErrorEvents(false)
     187    , m_alwaysUseBaselineOfPrimaryFont(false)
     188    , m_alwaysUseAcceleratedOverflowScroll(false)
     189#endif
    171190#if ENABLE(CSS_STICKY_POSITION)
    172191    , m_cssStickyPositionEnabled(true)
     
    383402void Settings::setScriptEnabled(bool isScriptEnabled)
    384403{
     404#if PLATFORM(IOS)
     405    if (m_isScriptEnabled == isScriptEnabled)
     406        return;
     407#endif
     408
    385409    m_isScriptEnabled = isScriptEnabled;
     410#if PLATFORM(IOS)
     411    m_page->setNeedsRecalcStyleInAllFrames();
     412#endif
    386413    InspectorInstrumentation::scriptsEnabled(m_page, m_isScriptEnabled);
    387414}
     
    682709}
    683710
     711#if PLATFORM(IOS)
     712void Settings::setStandalone(bool standalone)
     713{
     714    m_standalone = standalone;
     715}
     716
     717void Settings::setAudioSessionCategoryOverride(unsigned sessionCategory)
     718{
     719    AudioSession::sharedSession().setCategoryOverride(static_cast<AudioSession::CategoryType>(sessionCategory));
     720}
     721
     722unsigned Settings::audioSessionCategoryOverride()
     723{
     724    return AudioSession::sharedSession().categoryOverride();
     725}
     726
     727void Settings::setNetworkDataUsageTrackingEnabled(bool trackingEnabled)
     728{
     729    gNetworkDataUsageTrackingEnabled = trackingEnabled;
     730}
     731
     732bool Settings::networkDataUsageTrackingEnabled()
     733{
     734    return gNetworkDataUsageTrackingEnabled;
     735}
     736
     737static String& sharedNetworkInterfaceNameGlobal()
     738{
     739    static NeverDestroyed<String> networkInterfaceName;
     740    return networkInterfaceName;
     741}
     742
     743void Settings::setNetworkInterfaceName(const String& networkInterfaceName)
     744{
     745    sharedNetworkInterfaceNameGlobal() = networkInterfaceName;
     746}
     747
     748const String& Settings::networkInterfaceName()
     749{
     750    return sharedNetworkInterfaceNameGlobal();
     751}
     752#endif
     753
    684754} // namespace WebCore
  • trunk/Source/WebCore/page/Settings.h

    r160679 r161106  
    181181#endif
    182182
     183#if PLATFORM(IOS)
     184    // FIXME: This setting isn't specific to iOS.
     185    void setMaxParseDuration(double maxParseDuration) { m_maxParseDuration = maxParseDuration; }
     186    double maxParseDuration() const { return m_maxParseDuration; }
     187
     188    void setStandalone(bool);
     189    bool standalone() const { return m_standalone; }
     190
     191    void setTelephoneNumberParsingEnabled(bool flag) { m_telephoneNumberParsingEnabled = flag; }
     192    bool telephoneNumberParsingEnabled() const { return m_telephoneNumberParsingEnabled; }
     193
     194    void setMediaDataLoadsAutomatically(bool flag) { m_mediaDataLoadsAutomatically = flag; }
     195    bool mediaDataLoadsAutomatically() const { return m_mediaDataLoadsAutomatically; }
     196
     197    void setShouldTransformsAffectOverflow(bool flag) { m_shouldTransformsAffectOverflow = flag; }
     198    bool shouldTransformsAffectOverflow() const { return m_shouldTransformsAffectOverflow; }
     199
     200    void setShouldDispatchJavaScriptWindowOnErrorEvents(bool flag) { m_shouldDispatchJavaScriptWindowOnErrorEvents = flag; }
     201    bool shouldDispatchJavaScriptWindowOnErrorEvents() const { return m_shouldDispatchJavaScriptWindowOnErrorEvents; }
     202
     203    void setAlwaysUseBaselineOfPrimaryFont(bool flag) { m_alwaysUseBaselineOfPrimaryFont = flag; }
     204    bool alwaysUseBaselineOfPrimaryFont() const { return m_alwaysUseBaselineOfPrimaryFont; }
     205
     206    void setAlwaysUseAcceleratedOverflowScroll(bool flag) { m_alwaysUseAcceleratedOverflowScroll = flag; }
     207    bool alwaysUseAcceleratedOverflowScroll() const { return m_alwaysUseAcceleratedOverflowScroll; }
     208#endif
     209
    183210    void setUsesPageCache(bool);
    184211    bool usesPageCache() const { return m_usesPageCache; }
     
    269296#endif
    270297
     298#if PLATFORM(IOS)
     299    static void setAudioSessionCategoryOverride(unsigned);
     300    static unsigned audioSessionCategoryOverride();
     301
     302    static void setNetworkDataUsageTrackingEnabled(bool);
     303    static bool networkDataUsageTrackingEnabled();
     304
     305    static void setNetworkInterfaceName(const String&);
     306    static const String& networkInterfaceName();
     307#endif
     308
    271309private:
    272310    explicit Settings(Page*);
     
    282320    SecurityOrigin::StorageBlockingPolicy m_storageBlockingPolicy;
    283321    int m_layoutInterval;
     322#if PLATFORM(IOS)
     323    double m_maxParseDuration;
     324#endif
    284325#if ENABLE(TEXT_AUTOSIZING)
    285326    float m_textAutosizingFontScaleFactor;
     
    302343    unsigned m_fontRenderingMode : 1;
    303344    bool m_isCSSCustomFilterEnabled : 1;
     345#if PLATFORM(IOS)
     346    bool m_standalone : 1;
     347    bool m_telephoneNumberParsingEnabled : 1;
     348    bool m_mediaDataLoadsAutomatically : 1;
     349    bool m_shouldTransformsAffectOverflow : 1;
     350    bool m_shouldDispatchJavaScriptWindowOnErrorEvents : 1;
     351    bool m_alwaysUseBaselineOfPrimaryFont : 1;
     352    bool m_allowMultiElementImplicitFormSubmission : 1;
     353    bool m_alwaysUseAcceleratedOverflowScroll : 1;
     354#endif
    304355#if ENABLE(CSS_STICKY_POSITION)
    305356    bool m_cssStickyPositionEnabled : 1;
     
    349400#endif
    350401    static bool gShouldRespectPriorityInCSSAttributeSetters;
     402#if PLATFORM(IOS)
     403    static bool gNetworkDataUsageTrackingEnabled;
     404#endif
    351405
    352406    static double gHiddenPageDOMTimerAlignmentInterval;
  • trunk/Source/WebCore/page/Settings.in

    r160733 r161106  
    218218# FIXME: Rename to allowMultiElementImplicitFormSubmission once we upstream the iOS changes to WebView.mm.
    219219allowMultiElementImplicitSubmission initial=false
     220
     221mediaPlaybackAllowsAirPlay initial=true, conditional=IOS_AIRPLAY
  • trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp

    r160770 r161106  
    12131213        new PropertyWrapper<int>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset),
    12141214        new PropertyWrapper<unsigned short>(CSSPropertyOutlineWidth, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth),
     1215
     1216        // FIXME: We should reconcile the difference in datatype between iOS and OpenSource. On iOS we want these properties to
     1217        // be float for sub-pixel kerning. See <rdar://problem/5020763>.
     1218#if !PLATFORM(IOS)
    12151219        new PropertyWrapper<int>(CSSPropertyLetterSpacing, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing),
    12161220        new PropertyWrapper<int>(CSSPropertyWordSpacing, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing),
     1221#else
     1222        new PropertyWrapper<float>(CSSPropertyLetterSpacing, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing),
     1223        new PropertyWrapper<float>(CSSPropertyWordSpacing, &RenderStyle::wordSpacing, &RenderStyle::setWordSpacing),
     1224#endif
    12171225        new LengthPropertyWrapper<Length>(CSSPropertyTextIndent, &RenderStyle::textIndent, &RenderStyle::setTextIndent),
    12181226
  • trunk/Source/WebCore/page/mac/ChromeMac.mm

    r154272 r161106  
    2323#import "BlockExceptions.h"
    2424#import "ChromeClient.h"
     25
     26#if PLATFORM(IOS)
     27#include "WAKResponder.h"
     28#include "WAKView.h"
     29#endif
    2530
    2631namespace WebCore {
  • trunk/Source/WebCore/page/mac/PageMac.cpp

    r156543 r161106  
    4545    m_scheduledRunLoopPairs->add(pair);
    4646
     47#if !PLATFORM(IOS)
    4748    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
    4849        if (DocumentLoader* documentLoader = frame->loader().documentLoader())
     
    5152            documentLoader->schedule(pair.get());
    5253    }
     54#endif
    5355
    5456    // FIXME: make SharedTimerMac use these SchedulePairs.
     
    6466    m_scheduledRunLoopPairs->remove(pair);
    6567
     68#if !PLATFORM(IOS)
    6669    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
    6770        if (DocumentLoader* documentLoader = frame->loader().documentLoader())
     
    7073            documentLoader->unschedule(pair.get());
    7174    }
     75#endif
    7276}
    7377
  • trunk/Source/WebCore/page/mac/SettingsMac.mm

    r153696 r161106  
    3131bool Settings::shouldEnableScreenFontSubstitutionByDefault()
    3232{
    33 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     33#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
    3434    return false;
    3535#else
  • trunk/Source/WebCore/page/mac/WebCoreFrameView.h

    r77257 r161106  
    2626#include "ScrollTypes.h"
    2727
     28// WTF_PLATFORM_IOS
     29#ifdef __cplusplus
    2830namespace WebCore {
    2931    class Frame;
    3032}
     33#endif
    3134
    3235@protocol WebCoreFrameScrollView
     36// WTF_PLATFORM_IOS
     37#ifdef __cplusplus
    3338- (void)setScrollingModes:(WebCore::ScrollbarMode)hMode vertical:(WebCore::ScrollbarMode)vMode andLock:(BOOL)lock;
    3439- (void)scrollingModes:(WebCore::ScrollbarMode*)hMode vertical:(WebCore::ScrollbarMode*)vMode;
     40#else
     41- (void)setScrollingModes:(int)hMode vertical:(int)vMode andLock:(BOOL)lock;
     42- (void)scrollingModes:(int*)hMode vertical:(int*)vMode;
     43#endif
    3544- (void)setScrollBarsSuppressed:(BOOL)suppressed repaintOnUnsuppress:(BOOL)repaint;
    3645- (void)setScrollOrigin:(NSPoint)origin updatePositionAtAll:(BOOL)updatePositionAtAll immediately:(BOOL)updatePositionImmediately;
     
    3948
    4049@protocol WebCoreFrameView
     50// WTF_PLATFORM_IOS
     51#ifdef __cplusplus
    4152- (WebCore::Frame*)_web_frame;
     53#endif
    4254@end
  • trunk/Source/WebKit/ios/ChangeLog

    r161049 r161106  
     12013-12-27  Daniel Bates  <dabates@apple.com>
     2
     3        [iOS] Upstream WebCore/page changes
     4        https://bugs.webkit.org/show_bug.cgi?id=126180
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/WebChromeClientIOS.mm: Substitute ENABLE(IOS_TOUCH_EVENTS) for ENABLE(TOUCH_EVENTS).
     9
    1102013-12-23  Andy Estes  <aestes@apple.com>
    211
  • trunk/Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm

    r160106 r161106  
    125125}
    126126
    127 #if ENABLE(TOUCH_EVENTS)
     127#if ENABLE(IOS_TOUCH_EVENTS)
    128128void WebChromeClientIOS::didPreventDefaultForEvent()
    129129{
  • trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm

    r160106 r161106  
    2929#import "WebDataSourceInternal.h"
    3030
    31 #import <WebKit/WebFrameLoadDelegate.h>
    32 #import <WebKit/WebFrame.h>
    33 #import <WebKit/WebFramePrivate.h>
    34 #import <WebKit/WebFrameView.h>
    35 #import <WebKit/WebNSViewExtras.h>
    36 #import <WebKit/WebViewPrivate.h>
    3731#import "WebFrameInternal.h"
    3832#import "WebJSPDFDoc.h"
     33#import "WebKitVersionChecks.h"
    3934#import "WebPDFDocumentExtras.h"
    4035#import "WebPDFViewPlaceholder.h"
    41 #import "WebKitVersionChecks.h"
    42 
    4336#import <JavaScriptCore/JSContextRef.h>
    4437#import <JavaScriptCore/JSStringRef.h>
     
    4942#import <WebCore/FrameLoaderClient.h>
    5043#import <WebCore/GraphicsContext.h>
     44#import <WebCore/StringWithDirection.h>
    5145#import <WebCore/WKGraphics.h>
     46#import <WebKit/WebFrame.h>
     47#import <WebKit/WebFrameLoadDelegate.h>
     48#import <WebKit/WebFramePrivate.h>
     49#import <WebKit/WebFrameView.h>
     50#import <WebKit/WebNSViewExtras.h>
     51#import <WebKit/WebViewPrivate.h>
    5252#import <wtf/Assertions.h>
    5353#import <wtf/RetainPtr.h>
  • trunk/Source/WebKit2/ChangeLog

    r161105 r161106  
     12013-12-27  Daniel Bates  <dabates@apple.com>
     2
     3        [iOS] Upstream WebCore/page changes
     4        https://bugs.webkit.org/show_bug.cgi?id=126180
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebProcess/WebCoreSupport/WebChromeClient.h:
     9        * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: Added.
     10        * WebProcess/WebPage/WebPage.cpp: Include header <WebCore/HitTestResult.h>.
     11
    1122013-12-27  Gavin Barraclough  <barraclough@apple.com>
    213
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

    r159724 r161106  
    156156#endif
    157157
     158#if ENABLE(IOS_TOUCH_EVENTS)
     159    virtual void didPreventDefaultForEvent() OVERRIDE;
     160#endif
     161
    158162#if PLATFORM(IOS)
    159 #if ENABLE(TOUCH_EVENTS)
    160     virtual void didPreventDefaultForEvent() OVERRIDE;
    161 #endif
    162163    virtual void didReceiveMobileDocType() OVERRIDE;
    163164    virtual void setNeedsScrollNotifications(WebCore::Frame*, bool) OVERRIDE;
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm

    r160566 r161106  
    3535namespace WebKit {
    3636
    37 #if ENABLE(TOUCH_EVENTS)
     37#if ENABLE(IOS_TOUCH_EVENTS)
    3838void WebChromeClient::didPreventDefaultForEvent()
    3939{
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r161105 r161106  
    109109#include <WebCore/HistoryController.h>
    110110#include <WebCore/HistoryItem.h>
     111#include <WebCore/HitTestResult.h>
    111112#include <WebCore/JSDOMWindow.h>
    112113#include <WebCore/KeyboardEvent.h>
Note: See TracChangeset for help on using the changeset viewer.