Changeset 161106 in webkit
- Timestamp:
- Dec 27, 2013 12:40:28 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 added
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r161079 r161106 1 2013-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 1 11 2013-12-25 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 12 -
trunk/Source/WTF/wtf/FeatureDefines.h
r160944 r161106 69 69 #endif 70 70 71 #if !defined(ENABLE_CURSOR_SUPPORT) 72 #define ENABLE_CURSOR_SUPPORT 0 73 #endif 74 71 75 #if !defined(ENABLE_DISK_IMAGE_CACHE) 72 76 #define ENABLE_DISK_IMAGE_CACHE 1 … … 85 89 #endif 86 90 91 #if !defined(ENABLE_LETTERPRESS) 92 #define ENABLE_LETTERPRESS 1 93 #endif 94 87 95 #if !defined(ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE) 88 96 #define ENABLE_IOS_AUTOCORRECT_AND_AUTOCAPITALIZE 1 … … 93 101 #endif 94 102 95 #if !defined(ENABLE_LETTERPRESS)96 #define ENABLE_LETTERPRESS 197 #endif98 99 103 #if !defined(ENABLE_IOS_TEXT_AUTOSIZING) 100 104 #define ENABLE_IOS_TEXT_AUTOSIZING 1 105 #endif 106 107 #if !defined(ENABLE_IOS_TOUCH_EVENTS) 108 #define ENABLE_IOS_TOUCH_EVENTS 1 101 109 #endif 102 110 … … 431 439 #endif 432 440 441 #if !defined(ENABLE_CURSOR_SUPPORT) 442 #define ENABLE_CURSOR_SUPPORT 1 443 #endif 444 433 445 #if !defined(ENABLE_CUSTOM_SCHEME_HANDLER) 434 446 #define ENABLE_CUSTOM_SCHEME_HANDLER 0 … … 895 907 #endif 896 908 909 #if ENABLE(IOS_TOUCH_EVENTS) && !ENABLE(TOUCH_EVENTS) 910 #error "ENABLE(IOS_TOUCH_EVENTS) requires ENABLE(TOUCH_EVENTS)" 911 #endif 912 897 913 #endif /* WTF_FeatureDefines_h */ -
trunk/Source/WebCore/ChangeLog
r161105 r161106 1 2013-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 1 144 2013-12-27 Gavin Barraclough <barraclough@apple.com> 2 145 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r161066 r161106 5467 5467 CE08C3D1152B599A0021B8C2 /* AlternativeTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */; }; 5468 5468 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 */; }; 5469 5471 CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5470 5472 CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */; }; … … 12622 12624 CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlternativeTextController.cpp; sourceTree = "<group>"; }; 12623 12625 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>"; }; 12624 12628 CE5CB1B314EDAB6F00BB2795 /* EventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSender.h; sourceTree = "<group>"; }; 12625 12629 CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AlternativeTextUIController.h; path = mac/AlternativeTextUIController.h; sourceTree = "<group>"; }; … … 15732 15736 children = ( 15733 15737 316FE1060E6E1D8400BF6088 /* animation */, 15738 18A6CD6F0D8F2025001DC3CE /* ios */, 15734 15739 93C09A820B064F05005ABD4D /* mac */, 15735 15740 1AF62EE114DA22A70041556C /* scrolling */, … … 20537 20542 ); 20538 20543 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; 20539 20553 sourceTree = "<group>"; 20540 20554 }; … … 26351 26365 850657030AAB4763002D15C0 /* DOMStyleSheetList.mm in Sources */, 26352 26366 85ACA99D0A9B575900671E90 /* DOMText.mm in Sources */, 26367 FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */, 26353 26368 933A14AA0B7D1D0900A53FFD /* DOMTextEvent.mm in Sources */, 26354 26369 188604B30F2E654A000B6443 /* DOMTimer.cpp in Sources */, … … 28462 28477 0C3F1F5A10C8871200D72CE1 /* WebGLUniformLocation.cpp in Sources */, 28463 28478 77A17A7712F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp in Sources */, 28479 FE6938B61045D67E008EABB6 /* EventHandlerIOS.mm in Sources */, 28464 28480 31C0FF210E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp in Sources */, 28465 28481 976D6C7B122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp in Sources */, -
trunk/Source/WebCore/dom/EventNames.h
r160679 r161106 291 291 #undef DOM_EVENT_NAMES_DECLARE 292 292 293 inline bool isGestureEventType(const AtomicString& eventType) const 294 { 295 return eventType == gesturestartEvent || eventType == gesturechangeEvent || eventType == gestureendEvent; 296 } 297 293 298 inline bool isTouchEventType(const AtomicString& eventType) const 294 299 { -
trunk/Source/WebCore/page/AlternativeTextClient.h
r148531 r161106 32 32 #include <wtf/text/WTFString.h> 33 33 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 35 35 // Some platforms provide UI for suggesting alternative dictation text. 36 36 #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 38 38 39 39 namespace WebCore { -
trunk/Source/WebCore/page/Chrome.cpp
r159224 r161106 27 27 #include "DateTimeChooser.h" 28 28 #include "Document.h" 29 #include "DocumentType.h" 29 30 #include "FileIconLoader.h" 30 31 #include "FileChooser.h" … … 66 67 , m_client(client) 67 68 , m_displayID(0) 69 #if PLATFORM(IOS) 70 , m_isDispatchViewportDataDidChangeSuppressed(false) 71 #endif 68 72 { 69 73 } … … 478 482 #endif 479 483 480 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 484 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) && !PLATFORM(IOS) 481 485 PassRefPtr<DateTimeChooser> Chrome::openDateTimeChooser(DateTimeChooserClient* client, const DateTimeChooserParameters& parameters) 482 486 { … … 499 503 void Chrome::dispatchViewportPropertiesDidChange(const ViewportArguments& arguments) const 500 504 { 505 #if PLATFORM(IOS) 506 if (m_isDispatchViewportDataDidChangeSuppressed) 507 return; 508 #endif 501 509 m_client.dispatchViewportPropertiesDidChange(arguments); 502 510 } … … 504 512 void Chrome::setCursor(const Cursor& cursor) 505 513 { 514 #if ENABLE(CURSOR_SUPPORT) 506 515 m_client.setCursor(cursor); 516 #else 517 UNUSED_PARAM(cursor); 518 #endif 507 519 } 508 520 509 521 void Chrome::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves) 510 522 { 523 #if ENABLE(CURSOR_SUPPORT) 511 524 m_client.setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves); 525 #else 526 UNUSED_PARAM(hiddenUntilMouseMoves); 527 #endif 512 528 } 513 529 … … 603 619 } 604 620 621 #if PLATFORM(IOS) 622 // FIXME: Make argument, frame, a reference. 623 void 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 605 641 void Chrome::registerPopupOpeningObserver(PopupOpeningObserver* observer) 606 642 { -
trunk/Source/WebCore/page/Chrome.h
r157044 r161106 156 156 PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color& initialColor); 157 157 #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&) 160 161 #endif 161 162 … … 180 181 PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const; 181 182 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 182 190 void registerPopupOpeningObserver(PopupOpeningObserver*); 183 191 void unregisterPopupOpeningObserver(PopupOpeningObserver*); … … 190 198 PlatformDisplayID m_displayID; 191 199 Vector<PopupOpeningObserver*> m_popupOpeningObservers; 200 #if PLATFORM(IOS) 201 bool m_isDispatchViewportDataDidChangeSuppressed; 202 #endif 192 203 }; 193 204 -
trunk/Source/WebCore/page/ChromeClient.h
r159224 r161106 41 41 #include <wtf/Vector.h> 42 42 43 #if PLATFORM(IOS) 44 #include "PlatformLayer.h" 45 #define NSResponder WAKResponder 46 #ifndef __OBJC__ 47 class WAKResponder; 48 #else 49 @class WAKResponder; 50 #endif 51 #endif 52 43 53 #if ENABLE(SQL_DATABASE) 44 54 #include "DatabaseDetails.h" … … 63 73 class GraphicsLayer; 64 74 class GraphicsLayerFactory; 75 class HTMLInputElement; 65 76 class HitTestResult; 66 class HTMLInputElement;67 77 class IntRect; 68 78 class NavigationAction; … … 71 81 class PopupMenuClient; 72 82 class SecurityOrigin; 83 class ViewportConstraints; 73 84 class Widget; 74 85 … … 157 168 virtual PlatformPageClient platformPageClient() const = 0; 158 169 virtual void scrollbarsModeDidChange() const = 0; 170 #if ENABLE(CURSOR_SUPPORT) 159 171 virtual void setCursor(const Cursor&) = 0; 160 172 virtual void setCursorHiddenUntilMouseMoves(bool) = 0; 173 #endif 161 174 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 162 175 virtual void scheduleAnimation() = 0; … … 213 226 virtual String generateReplacementFile(const String& path); 214 227 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 215 263 #if ENABLE(INPUT_TYPE_COLOR) 216 264 virtual PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color&) = 0; 217 265 #endif 218 266 219 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) 267 #if ENABLE(DATE_AND_TIME_INPUT_TYPES) && !PLATFORM(IOS) 220 268 virtual PassRefPtr<DateTimeChooser> openDateTimeChooser(DateTimeChooserClient*, const DateTimeChooserParameters&) = 0; 221 269 #endif -
trunk/Source/WebCore/page/DOMTimer.cpp
r159027 r161106 36 36 #include <wtf/StdLibExtras.h> 37 37 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 38 46 namespace WebCore { 39 47 … … 82 90 // or if it is a one-time timer and it has fired (DOMTimer::fired). 83 91 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 84 102 85 103 timer->suspendIfNeeded(); … … 105 123 { 106 124 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 107 133 timerNestingLevel = m_nestingLevel; 108 134 ASSERT(!isSuspended()); … … 137 163 delete this; 138 164 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 139 182 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 140 193 141 194 InspectorInstrumentation::didFireTimer(cookie); -
trunk/Source/WebCore/page/DOMWindow.cpp
r160671 r161106 118 118 #endif 119 119 120 #if PLATFORM(IOS) 121 #if ENABLE(GEOLOCATION) 122 #include "NavigatorGeolocation.h" 123 #endif 124 #include "WKContentObservation.h" 125 #endif 126 120 127 namespace WebCore { 121 128 … … 372 379 , m_shouldPrintWhenFinishedLoading(false) 373 380 , 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 374 388 { 375 389 ASSERT(frame()); … … 1140 1154 return 0; 1141 1155 1156 #if PLATFORM(IOS) 1157 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->actualVisibleContentRect().height())); 1158 #else 1142 1159 // If the device height is overridden, do not include the horizontal scrollbar into the innerHeight (since it is absent on the real device). 1143 1160 bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenHeightOverride(m_frame); 1144 1161 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScrollbars).height())); 1162 #endif 1145 1163 } 1146 1164 … … 1154 1172 return 0; 1155 1173 1174 #if PLATFORM(IOS) 1175 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->actualVisibleContentRect().width())); 1176 #else 1156 1177 // If the device width is overridden, do not include the vertical scrollbar into the innerWidth (since it is absent on the real device). 1157 1178 bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOverride(m_frame); 1158 1179 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::ExcludeScrollbars).width())); 1180 #endif 1159 1181 } 1160 1182 … … 1197 1219 m_frame->document()->updateLayoutIgnorePendingStylesheets(); 1198 1220 1221 #if PLATFORM(IOS) 1222 return static_cast<int>(view->actualVisibleContentRect().x() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor())); 1223 #else 1199 1224 return view->mapFromLayoutToCSSUnits(view->scrollX()); 1225 #endif 1200 1226 } 1201 1227 … … 1214 1240 m_frame->document()->updateLayoutIgnorePendingStylesheets(); 1215 1241 1242 #if PLATFORM(IOS) 1243 return static_cast<int>(view->actualVisibleContentRect().y() / (m_frame->pageZoomFactor() * m_frame->frameScaleFactor())); 1244 #else 1216 1245 return view->mapFromLayoutToCSSUnits(view->scrollY()); 1246 #endif 1217 1247 } 1218 1248 … … 1426 1456 1427 1457 IntSize scaledOffset(view->mapFromCSSToLayoutUnits(x), view->mapFromCSSToLayoutUnits(y)); 1458 #if PLATFORM(IOS) 1459 view->setActualScrollPosition(view->actualVisibleContentRect().location() + scaledOffset); 1460 #else 1428 1461 view->scrollBy(scaledOffset); 1462 #endif 1429 1463 } 1430 1464 … … 1440 1474 return; 1441 1475 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 1442 1482 IntPoint layoutPos(view->mapFromCSSToLayoutUnits(x), view->mapFromCSSToLayoutUnits(y)); 1443 1483 view->setScrollPosition(layoutPos); 1484 #endif 1444 1485 } 1445 1486 … … 1522 1563 void DOMWindow::clearTimeout(int timeoutId) 1523 1564 { 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 1524 1581 ScriptExecutionContext* context = scriptExecutionContext(); 1525 1582 if (!context) … … 1609 1666 addBeforeUnloadEventListener(this); 1610 1667 #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 1611 1674 else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::sharedFeatures().deviceMotionEnabled()) { 1612 1675 if (DeviceMotionController* controller = DeviceMotionController::from(page())) … … 1616 1679 controller->addDeviceEventListener(this); 1617 1680 } 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; 1618 1694 #endif 1619 1695 … … 1626 1702 1627 1703 return true; 1704 } 1705 1706 #if PLATFORM(IOS) 1707 void 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 1717 void 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 1728 void 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 1628 1735 } 1629 1736 … … 1645 1752 removeBeforeUnloadEventListener(this); 1646 1753 #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 1647 1760 else if (eventType == eventNames().devicemotionEvent) { 1648 1761 if (DeviceMotionController* controller = DeviceMotionController::from(page())) … … 1651 1764 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 1652 1765 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; 1653 1783 } 1654 1784 #endif … … 1693 1823 RefPtr<Event> event = prpEvent; 1694 1824 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 1695 1841 event->setTarget(prpTarget ? prpTarget : this); 1696 1842 event->setCurrentTarget(this); … … 1711 1857 1712 1858 #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 1713 1865 if (DeviceMotionController* controller = DeviceMotionController::from(page())) 1714 1866 controller->removeAllDeviceEventListeners(this); 1715 1867 if (DeviceOrientationController* controller = DeviceOrientationController::from(page())) 1716 1868 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 1718 1883 #if ENABLE(TOUCH_EVENTS) 1719 1884 if (Document* document = this->document()) -
trunk/Source/WebCore/page/DOMWindow.h
r160671 r161106 398 398 #endif 399 399 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 400 406 #if ENABLE(WEB_TIMING) 401 407 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; } 402 420 #endif 403 421 … … 458 476 String m_defaultStatus; 459 477 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 460 489 mutable RefPtr<Storage> m_sessionStorage; 461 490 mutable RefPtr<Storage> m_localStorage; -
trunk/Source/WebCore/page/DOMWindow.idl
r159284 r161106 286 286 [Conditional=TOUCH_EVENTS] attribute EventListener ontouchcancel; 287 287 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 288 292 [Conditional=DEVICE_ORIENTATION] attribute EventListener ondevicemotion; 289 293 [Conditional=DEVICE_ORIENTATION] attribute EventListener ondeviceorientation; … … 309 313 // We just use Document for this. 310 314 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 311 319 [Conditional=BLOB] attribute DOMURLConstructor webkitURL; // FIXME: deprecate this. 312 320 attribute MutationObserverConstructor WebKitMutationObserver; // FIXME: Add metrics to determine when we can remove this. -
trunk/Source/WebCore/page/EditorClient.h
r159856 r161106 40 40 OBJC_CLASS NSString; 41 41 OBJC_CLASS NSURL; 42 #endif 43 44 #if PLATFORM(IOS) 45 OBJC_CLASS NSArray; 46 OBJC_CLASS NSDictionary; 42 47 #endif 43 48 … … 114 119 virtual void textDidChangeInTextArea(Element*) = 0; 115 120 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 116 136 #if PLATFORM(MAC) 117 137 virtual NSString* userVisibleString(NSURL*) = 0; -
trunk/Source/WebCore/page/EventHandler.cpp
r160966 r161106 105 105 106 106 #if ENABLE(TOUCH_EVENTS) 107 #if ENABLE(IOS_TOUCH_EVENTS) 108 #include "PlatformTouchEventIOS.h" 109 #else 107 110 #include "PlatformTouchEvent.h" 111 #endif 108 112 #include "TouchEvent.h" 109 113 #include "TouchList.h" … … 128 132 #endif // ENABLE(DRAG_SUPPORT) 129 133 134 #if ENABLE(IOS_GESTURE_EVENTS) 135 const float GestureUnknown = 0; 136 #endif 137 138 #if ENABLE(IOS_TOUCH_EVENTS) 139 // FIXME: Share this constant with EventHandler and SliderThumbElement. 140 const unsigned InvalidTouchIdentifier = 0; 141 #endif 142 130 143 // Match key code of composition keydown event on windows. 131 144 // IE sends VK_PROCESSKEY which has value 229; … … 143 156 const double fakeMouseMoveLongInterval = 0.25; 144 157 145 #if !PLATFORM(IOS)158 #if ENABLE(CURSOR_SUPPORT) 146 159 // The amount of time to wait for a cursor update on style and layout changes 147 160 // Set to 50Hz, no need to be faster than common screen refresh rate … … 191 204 }; 192 205 193 #if ENABLE(TOUCH_EVENTS) 206 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) 194 207 class SyntheticTouchPoint : public PlatformTouchPoint { 195 208 public: … … 256 269 } 257 270 }; 258 #endif 271 #endif // ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) 259 272 260 273 static inline ScrollGranularity wheelGranularityToScrollGranularity(unsigned deltaMode) … … 321 334 , m_selectionInitiationState(HaveNotStartedSelection) 322 335 , m_hoverTimer(this, &EventHandler::hoverTimerFired) 336 #if ENABLE(CURSOR_SUPPORT) 323 337 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) 338 #endif 324 339 , m_autoscrollController(adoptPtr(new AutoscrollController)) 325 340 , m_mouseDownMayStartAutoscroll(false) … … 332 347 , m_eventHandlerWillResetCapturingMouseEventsElement(nullptr) 333 348 , 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 334 358 , m_mousePositionIsUnknown(true) 335 359 , m_mouseDownTimestamp(0) … … 339 363 , m_mouseDownView(nil) 340 364 , m_sendingEventToSubview(false) 365 #if !PLATFORM(IOS) 341 366 , 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) 344 370 , m_originatingTouchPointTargetKey(0) 345 371 , m_touchPressed(false) … … 375 401 { 376 402 m_hoverTimer.stop(); 403 #if ENABLE(CURSOR_SUPPORT) 377 404 m_cursorUpdateTimer.stop(); 405 #endif 378 406 m_fakeMouseMoveEventTimer.stop(); 379 407 #if ENABLE(CURSOR_VISIBILITY) … … 391 419 m_clickCount = 0; 392 420 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 393 433 m_frameSetBeingResized = 0; 394 434 #if ENABLE(DRAG_SUPPORT) … … 405 445 m_latchedWheelEventElement = nullptr; 406 446 m_previousWheelScrolledElement = nullptr; 407 #if ENABLE(TOUCH_EVENTS) 447 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) 408 448 m_originatingTouchPointTargets.clear(); 409 449 m_originatingTouchPointDocument.clear(); … … 974 1014 void EventHandler::startPanScrolling(RenderElement* renderer) 975 1015 { 1016 #if !PLATFORM(IOS) 976 1017 if (!renderer->isBox()) 977 1018 return; 978 1019 m_autoscrollController->startPanScrolling(toRenderBox(renderer), lastKnownMousePosition()); 979 1020 invalidateClick(); 1021 #endif 980 1022 } 981 1023 … … 1179 1221 } 1180 1222 1223 #if ENABLE(CURSOR_SUPPORT) 1181 1224 static bool isSubmitImage(Node* node) 1182 1225 { … … 1445 1488 return pointerCursor(); 1446 1489 } 1490 #endif // ENABLE(CURSOR_SUPPORT) 1447 1491 1448 1492 #if ENABLE(CURSOR_VISIBILITY) … … 1565 1609 m_clickNode = mev.targetNode(); 1566 1610 1611 if (!m_clickNode) { 1612 invalidateClick(); 1613 return false; 1614 } 1615 1567 1616 if (FrameView* view = m_frame.view()) { 1568 1617 RenderLayer* layer = m_clickNode->renderer() ? m_clickNode->renderer()->enclosingLayer() : 0; … … 1727 1776 m_hoverTimer.stop(); 1728 1777 1778 #if ENABLE(CURSOR_SUPPORT) 1729 1779 m_cursorUpdateTimer.stop(); 1780 #endif 1730 1781 1731 1782 cancelFakeMouseMoveEvent(); … … 1741 1792 return !dispatchMouseEvent(eventNames().mousemoveEvent, m_frameSetBeingResized.get(), false, 0, mouseEvent, false); 1742 1793 1794 // On iOS, our scrollbars are managed by UIKit. 1795 #if !PLATFORM(IOS) 1743 1796 // Send events right to a scrollbar if the mouse is pressed. 1744 1797 if (m_lastScrollbarUnderMouse && m_mousePressed) 1745 1798 return m_lastScrollbarUnderMouse->mouseMoved(mouseEvent); 1799 #endif 1746 1800 1747 1801 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestRequest::DisallowShadowContent | HitTestRequest::AllowFrameScrollbars; … … 1756 1810 } 1757 1811 1758 #if ENABLE(TOUCH_EVENTS) 1812 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) 1759 1813 // Treat any mouse move events as readonly if the user is currently touching the screen. 1760 1814 if (m_touchPressed) … … 1771 1825 Scrollbar* scrollbar = mev.scrollbar(); 1772 1826 updateLastScrollbarUnderMouse(scrollbar, !m_mousePressed); 1827 1828 // On iOS, our scrollbars are managed by UIKit. 1829 #if !PLATFORM(IOS) 1773 1830 if (!m_mousePressed && scrollbar) 1774 1831 scrollbar->mouseMoved(mouseEvent); // Handle hover effects on platforms that support visual feedback on scrollbar hovering. 1832 #endif 1775 1833 if (onlyUpdateScrollbars) 1776 1834 return true; … … 1792 1850 if (newSubframe->view()) 1793 1851 swallowEvent |= passMouseMoveEventToSubframe(mev, newSubframe.get(), hoveredNode); 1852 #if ENABLE(CURSOR_SUPPORT) 1794 1853 } else { 1795 1854 if (FrameView* view = m_frame.view()) { … … 1800 1859 } 1801 1860 } 1861 #endif 1802 1862 } 1803 1863 … … 2715 2775 } 2716 2776 2777 #if ENABLE(CURSOR_SUPPORT) 2717 2778 void EventHandler::scheduleCursorUpdate() 2718 2779 { … … 2720 2781 m_cursorUpdateTimer.startOneShot(cursorUpdateInterval); 2721 2782 } 2783 #endif 2722 2784 2723 2785 void EventHandler::dispatchFakeMouseMoveEventSoon() … … 2831 2893 } 2832 2894 2833 #if !PLATFORM(MAC) 2895 #if !PLATFORM(MAC) || PLATFORM(IOS) 2834 2896 bool EventHandler::needsKeyboardEventDisambiguationQuirks() const 2835 2897 { … … 3508 3570 } 3509 3571 3510 #if ENABLE(TOUCH_EVENTS) 3511 3572 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) 3512 3573 static const AtomicString& eventNameForTouchPointState(PlatformTouchPoint::State state) 3513 3574 { … … 3529 3590 } 3530 3591 3531 HitTestResult EventHandler::hitTestResultInFrame(Frame* frame, const LayoutPoint& point, HitTestRequest::HitTestRequestType hitType)3592 static HitTestResult hitTestResultInFrame(Frame* frame, const LayoutPoint& point, HitTestRequest::HitTestRequestType hitType) 3532 3593 { 3533 3594 HitTestResult result(point); … … 3745 3806 return swallowedEvent; 3746 3807 } 3747 3808 #endif // ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) 3809 3810 #if ENABLE(TOUCH_EVENTS) 3748 3811 bool EventHandler::dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent& event) 3749 3812 { 3813 #if ENABLE(IOS_TOUCH_EVENTS) 3814 UNUSED_PARAM(event); 3815 return false; 3816 #else 3750 3817 if (!m_frame.settings().isTouchEventEmulationEnabled()) 3751 3818 return false; … … 3766 3833 SyntheticSingleTouchEvent touchEvent(event); 3767 3834 return handleTouchEvent(touchEvent); 3768 } 3769 3770 #endif 3835 #endif 3836 } 3837 #endif // ENABLE(TOUCH_EVENTS) 3771 3838 3772 3839 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) -
trunk/Source/WebCore/page/EventHandler.h
r157653 r161106 43 43 #include <wtf/RefPtr.h> 44 44 45 #if PLATFORM(IOS) 46 #ifdef __OBJC__ 47 @class WebEvent; 48 @class WAKView; 49 #include "WAKAppKitStubs.h" 50 #else 51 class WebEvent; 52 #endif 53 #endif // PLATFORM(IOS) 54 45 55 #if PLATFORM(MAC) && !defined(__OBJC__) 46 56 class NSView; … … 49 59 #if ENABLE(TOUCH_EVENTS) 50 60 #include <wtf/HashMap.h> 61 #endif 62 63 #if ENABLE(IOS_TOUCH_EVENTS) 64 #include <wtf/HashSet.h> 65 #include <wtf/Vector.h> 51 66 #endif 52 67 … … 79 94 class Scrollbar; 80 95 class TextEvent; 96 class Touch; 81 97 class TouchEvent; 82 98 class VisibleSelection; … … 92 108 extern const int GeneralDragHysteresis; 93 109 #endif // ENABLE(DRAG_SUPPORT) 110 111 #if ENABLE(IOS_GESTURE_EVENTS) 112 extern const float GestureUnknown; 113 #endif 94 114 95 115 enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTrailingWhitespace }; … … 145 165 146 166 void scheduleHoverStateUpdate(); 167 #if ENABLE(CURSOR_SUPPORT) 147 168 void scheduleCursorUpdate(); 169 #endif 148 170 149 171 void setResizingFrameSet(HTMLFrameSetElement*); … … 176 198 bool handlePasteGlobalSelection(const PlatformMouseEvent&); 177 199 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 178 218 #if ENABLE(TOUCH_ADJUSTMENT) 179 219 bool bestClickableNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode); … … 214 254 215 255 #if PLATFORM(MAC) && defined(__OBJC__) 256 #if !PLATFORM(IOS) 216 257 void mouseDown(NSEvent *); 217 258 void mouseDragged(NSEvent *); … … 220 261 bool keyEvent(NSEvent *); 221 262 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) 223 276 void passMouseMovedEventToScrollbars(NSEvent *); 224 277 225 278 void sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent); 226 279 #endif 280 281 #if !PLATFORM(IOS) 227 282 void setActivationEventNumber(int num) { m_activationEventNumber = num; } 228 283 229 284 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(); 230 292 #endif 231 293 … … 267 329 268 330 void hoverTimerFired(Timer<EventHandler>*); 331 #if ENABLE(CURSOR_SUPPORT) 269 332 void cursorUpdateTimerFired(Timer<EventHandler>*); 333 #endif 270 334 271 335 bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0); … … 292 356 #if ENABLE(TOUCH_EVENTS) 293 357 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) 297 361 void invalidateClick(); 362 #endif 298 363 299 364 Node* nodeUnderMouse() const; … … 402 467 403 468 Timer<EventHandler> m_hoverTimer; 469 #if ENABLE(CURSOR_SUPPORT) 404 470 Timer<EventHandler> m_cursorUpdateTimer; 471 #endif 405 472 406 473 OwnPtr<AutoscrollController> m_autoscrollController; … … 429 496 int m_clickCount; 430 497 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 431 513 432 514 #if ENABLE(DRAG_SUPPORT) … … 453 535 RefPtr<Element> m_previousWheelScrolledElement; 454 536 455 #if PLATFORM(MAC) 537 #if PLATFORM(MAC) || PLATFORM(IOS) 456 538 NSView *m_mouseDownView; 457 539 bool m_sendingEventToSubview; 540 #if !PLATFORM(IOS) 458 541 int m_activationEventNumber; 459 542 #endif 460 #if ENABLE(TOUCH_EVENTS) 543 #endif 544 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS) 461 545 typedef HashMap<int, RefPtr<EventTarget>> TouchTargetMap; 462 546 TouchTargetMap m_originatingTouchPointTargets; -
trunk/Source/WebCore/page/FocusController.h
r155731 r161106 83 83 bool containingWindowIsVisible() const { return m_containingWindowIsVisible; } 84 84 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 85 89 private: 86 90 bool advanceFocusDirectionally(FocusDirection, KeyboardEvent*); … … 102 106 Element* findFocusableElement(FocusDirection, FocusNavigationScope, Node* start, KeyboardEvent*); 103 107 104 Element* nextFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);105 Element* previousFocusableElement(FocusNavigationScope, Node* start, KeyboardEvent*);106 107 108 Element* findElementWithExactTabIndex(Node* start, int tabIndex, KeyboardEvent*, FocusDirection); 108 109 -
trunk/Source/WebCore/page/Frame.cpp
r160764 r161106 122 122 #endif 123 123 124 #if PLATFORM(IOS) 125 #include "WKContentObservation.h" 126 #endif 127 124 128 namespace WebCore { 125 129 126 130 using namespace HTMLNames; 131 132 #if PLATFORM(IOS) 133 const unsigned scrollFrequency = 1000 / 60; 134 #endif 127 135 128 136 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame")); … … 164 172 , m_eventHandler(adoptPtr(new EventHandler(*this))) 165 173 , 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 166 179 , m_pageZoomFactor(parentPageZoomFactor(this)) 167 180 , m_textZoomFactor(parentTextZoomFactor(this)) … … 198 211 #endif 199 212 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 200 220 // Pause future ActiveDOMObjects if this frame is being created while the page is in a paused state. 201 Frame* parent = parentFromOwnerElement(ownerElement);202 221 if (parent && parent->activeDOMObjectsAndAnimationsSuspended()) 203 222 suspendActiveDOMObjectsAndAnimations(); 223 #endif 204 224 } 205 225 … … 472 492 } 473 493 494 #if PLATFORM(IOS) 495 void 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 530 void Frame::overflowAutoScrollTimerFired(Timer<Frame>*) 531 { 532 if (!eventHandler().mousePressed() || checkOverflowScroll(PerformOverflowScroll) == OverflowScrollNone) { 533 if (m_overflowAutoScrollTimer.isActive()) 534 m_overflowAutoScrollTimer.stop(); 535 } 536 } 537 538 void 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 552 int 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 637 void Frame::setSelectionChangeCallbacksDisabled(bool selectionChangeCallbacksDisabled) 638 { 639 m_selectionChangeCallbacksDisabled = selectionChangeCallbacksDisabled; 640 } 641 642 bool Frame::selectionChangeCallbacksDisabled() const 643 { 644 return m_selectionChangeCallbacksDisabled; 645 } 646 #endif // PLATFORM(IOS) 647 474 648 void Frame::setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio, AdjustViewSizeOrNot shouldAdjustViewSize) 475 649 { … … 625 799 page()->scrollingCoordinator()->willDestroyScrollableArea(m_view.get()); 626 800 801 #if PLATFORM(IOS) 802 if (WebThreadCountOfObservedContentModifiers() > 0 && m_page) 803 m_page->chrome().client().clearContentChangeObservers(this); 804 #endif 805 627 806 script().clearScriptObjects(); 628 807 script().updatePlatformScriptObjects(); … … 709 888 710 889 void Frame::createView(const IntSize& viewportSize, const Color& backgroundColor, bool transparent, 711 const IntSize& fixedLayoutSize, const IntRect& fixedVisibleContentRect 890 const IntSize& fixedLayoutSize, const IntRect& fixedVisibleContentRect, 712 891 bool useFixedLayout, ScrollbarMode horizontalScrollbarMode, bool horizontalLock, 713 892 ScrollbarMode verticalScrollbarMode, bool verticalLock) … … 727 906 frameView = FrameView::create(*this, viewportSize); 728 907 frameView->setFixedLayoutSize(fixedLayoutSize); 908 #if !PLATFORM(IOS) 729 909 frameView->setFixedVisibleContentRect(fixedVisibleContentRect); 910 #else 911 UNUSED_PARAM(fixedVisibleContentRect); 912 #endif 730 913 frameView->setUseFixedLayout(useFixedLayout); 731 914 } else -
trunk/Source/WebCore/page/Frame.h
r160152 r161106 38 38 #include <wtf/RefCounted.h> 39 39 40 #if PLATFORM(IOS) 41 #include "ViewportArguments.h" 42 #include "VisibleSelection.h" 43 #endif 44 40 45 #if PLATFORM(WIN) 41 46 #include "FrameWin.h" … … 44 49 #if USE(TILED_BACKING_STORE) 45 50 #include "TiledBackingStoreClient.h" 51 #endif 52 53 #if PLATFORM(IOS) 54 OBJC_CLASS DOMCSSStyleDeclaration; 55 OBJC_CLASS DOMNode; 56 OBJC_CLASS NSArray; 57 OBJC_CLASS NSString; 46 58 #endif 47 59 … … 64 76 class HTMLFrameOwnerElement; 65 77 class HTMLTableCellElement; 78 class HitTestResult; 66 79 class ImageBuffer; 67 80 class IntRect; … … 70 83 class Range; 71 84 class RegularExpression; 85 class RenderLayer; 72 86 class RenderView; 73 87 class RenderWidget; … … 77 91 class VisiblePosition; 78 92 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 79 106 80 107 #if !USE(TILED_BACKING_STORE) … … 97 124 98 125 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 99 130 void setView(PassRefPtr<FrameView>); 100 131 void createView(const IntSize&, const Color&, bool, … … 166 197 #endif 167 198 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 168 223 #if ENABLE(ORIENTATION_EVENTS) 169 224 // Orientation is the interface orientation in degrees. Some examples are: … … 192 247 #endif 193 248 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 194 276 void suspendActiveDOMObjectsAndAnimations(); 195 277 void resumeActiveDOMObjectsAndAnimations(); … … 224 306 const OwnPtr<EventHandler> m_eventHandler; 225 307 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 226 329 227 330 #if ENABLE(IOS_TEXT_AUTOSIZING) -
trunk/Source/WebCore/page/FrameView.cpp
r160944 r161106 66 66 #include "RenderScrollbarPart.h" 67 67 #include "RenderStyle.h" 68 #include "RenderText.h" 68 69 #include "RenderTheme.h" 69 70 #include "RenderView.h" … … 97 98 #if ENABLE(TEXT_AUTOSIZING) 98 99 #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" 99 113 #endif 100 114 … … 191 205 , m_setNeedsLayoutWasDeferred(false) 192 206 , m_scrollCorner(0) 207 #if PLATFORM(IOS) 208 , m_useCustomFixedPositionLayoutRect(false) 209 #endif 193 210 , m_shouldAutoSize(false) 194 211 , m_inAutoSize(false) … … 393 410 394 411 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 395 419 } 396 420 … … 884 908 flushDeferredRepaints(); 885 909 910 #if PLATFORM(IOS) 911 if (TileCache* tileCache = this->tileCache()) 912 tileCache->doPendingRepaints(); 913 #endif 914 886 915 renderView->compositor().flushPendingLayerChanges(rootFrameForFlush == &frame()); 887 916 … … 895 924 } 896 925 926 GraphicsLayer* 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 952 void FrameView::scheduleLayerFlushAllowingThrottling() 953 { 954 RenderView* view = this->renderView(); 955 if (!view) 956 return; 957 view->compositor().scheduleLayerFlush(true /* canThrottle */); 958 } 897 959 #endif // USE(ACCELERATED_COMPOSITING) 898 960 … … 1082 1144 return; 1083 1145 } 1146 1147 #if PLATFORM(IOS) 1148 if (updateFixedPositionLayoutRect()) 1149 allowSubtree = false; 1150 #endif 1084 1151 1085 1152 m_layoutTimer.stop(); … … 1199 1266 m_lastViewportSize = fixedLayoutSize(); 1200 1267 else 1268 #if PLATFORM(IOS) 1269 m_lastViewportSize = actualVisibleContentRect().size(); 1270 #else 1201 1271 m_lastViewportSize = visibleContentRect(IncludeScrollbars).size(); 1272 #endif 1202 1273 1203 1274 m_lastZoomFactor = root->style().zoom(); … … 1312 1383 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION) 1313 1384 updateAnnotatedRegions(); 1385 #endif 1386 1387 #if ENABLE(IOS_TOUCH_EVENTS) 1388 document.dirtyTouchEventRects(); 1314 1389 #endif 1315 1390 … … 1903 1978 } 1904 1979 1980 #if !PLATFORM(IOS) 1905 1981 void FrameView::setFixedVisibleContentRect(const IntRect& visibleContentRect) 1906 1982 { … … 1928 2004 frame().loader().client().didChangeScrollOffset(); 1929 2005 } 2006 #endif 1930 2007 1931 2008 void FrameView::setViewportConstrainedObjectsNeedLayout() … … 2121 2198 } 2122 2199 2200 static 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 2214 bool FrameView::renderedCharactersExceed(unsigned threshold) 2215 { 2216 if (!m_frame->contentRenderer()) 2217 return false; 2218 return countRenderedCharactersInRenderObjectWithThreshold(*m_frame->contentRenderer(), 0, threshold) >= threshold; 2219 } 2220 2123 2221 void FrameView::contentsResized() 2124 2222 { … … 2144 2242 if (!frame().view()) 2145 2243 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 2146 2256 2147 2257 if (!useFixedLayout() && needsLayout()) … … 2321 2431 renderView->layer()->backing()->adjustTiledBackingCoverage(); 2322 2432 #endif 2433 #if PLATFORM(IOS) 2434 if (TileCache* tileCache = this->tileCache()) 2435 tileCache->setSpeculativeTileCreationEnabled(!m_frame->page()->progress().isMainLoadProgressing()); 2436 #endif 2323 2437 } 2324 2438 … … 2682 2796 } 2683 2797 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 2684 2806 if (milestonesAchieved && frame().isMainFrame()) 2685 2807 frame().loader().didLayout(milestonesAchieved); … … 2734 2856 currentSize = fixedLayoutSize(); 2735 2857 else 2858 #if PLATFORM(IOS) 2859 currentSize = actualVisibleContentRect().size(); 2860 #else 2736 2861 currentSize = visibleContentRect(IncludeScrollbars).size(); 2862 #endif 2737 2863 2738 2864 float currentZoomFactor = renderView->style().zoom(); … … 2744 2870 if (!shouldSendResizeEvent) 2745 2871 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 2746 2882 2747 2883 bool isMainFrame = frame().isMainFrame(); … … 3424 3560 3425 3561 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 3426 3572 if (isTopLevelPainter) 3427 3573 sCurrentPaintTimeStamp = monotonicallyIncreasingTime(); … … 3475 3621 m_paintBehavior = oldPaintBehavior; 3476 3622 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 3477 3631 3478 3632 // Regions may have changed as a result of the visibility/z-index of element changing. … … 4050 4204 } 4051 4205 4206 #if PLATFORM(IOS) 4207 void FrameView::setUseCustomFixedPositionLayoutRect(bool useCustomFixedPositionLayoutRect) 4208 { 4209 if (m_useCustomFixedPositionLayoutRect == useCustomFixedPositionLayoutRect) 4210 return; 4211 m_useCustomFixedPositionLayoutRect = useCustomFixedPositionLayoutRect; 4212 visibleContentsResized(); 4213 } 4214 4215 void 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 4224 bool 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 4052 4243 void FrameView::setScrollingPerformanceLoggingEnabled(bool flag) 4053 4244 { -
trunk/Source/WebCore/page/FrameView.h
r160847 r161106 121 121 bool needsFullRepaint() const { return m_needsFullRepaint; } 122 122 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 123 133 #if ENABLE(REQUEST_ANIMATION_FRAME) 124 134 void serviceScriptedAnimations(double monotonicAnimationStartTime); … … 136 146 // content rendered via the normal painting path. 137 147 void setNeedsOneShotDrawingSynchronization(); 148 149 GraphicsLayer* graphicsLayerForPlatformWidget(PlatformWidget); 150 void scheduleLayerFlushAllowingThrottling(); 138 151 139 152 virtual TiledBacking* tiledBacking() OVERRIDE; … … 193 206 virtual float visibleContentScaleFactor() const OVERRIDE; 194 207 208 #if !PLATFORM(IOS) 195 209 virtual void setFixedVisibleContentRect(const IntRect&) OVERRIDE; 210 #endif 196 211 virtual void setScrollPosition(const IntPoint&) OVERRIDE; 197 212 void scrollPositionChangedViaPlatformWidget(); … … 632 647 RenderScrollbarPart* m_scrollCorner; 633 648 649 #if PLATFORM(IOS) 650 bool m_useCustomFixedPositionLayoutRect; 651 IntRect m_customFixedPositionLayoutRect; 652 #endif 653 634 654 // If true, automatically resize the frame view around its content. 635 655 bool m_shouldAutoSize; -
trunk/Source/WebCore/page/Navigator.cpp
r154219 r161106 133 133 } 134 134 135 #if PLATFORM(IOS) 136 bool Navigator::standalone() const 137 { 138 return m_frame && m_frame->settings().standalone(); 139 } 140 #endif 141 135 142 void Navigator::getStorageUpdates() 136 143 { -
trunk/Source/WebCore/page/Navigator.h
r134188 r161106 54 54 virtual String userAgent() const; 55 55 56 #if PLATFORM(IOS) 57 bool standalone() const; 58 #endif 59 56 60 // Relinquishes the storage lock, if one exists. 57 61 void getStorageUpdates(); -
trunk/Source/WebCore/page/Navigator.idl
r159061 r161106 38 38 readonly attribute boolean onLine; 39 39 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 40 45 void getStorageUpdates(); // FIXME: Remove this method or rename to yieldForStorageUpdates. 41 46 }; -
trunk/Source/WebCore/page/NavigatorBase.cpp
r127757 r161106 36 36 #endif 37 37 38 #if PLATFORM(IOS) 39 #include "WebCoreSystemInterface.h" 40 #endif 41 38 42 #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)) 40 46 #define WEBCORE_NAVIGATOR_PLATFORM "MacPPC" 41 47 #elif OS(MAC_OS_X) && (CPU(X86) || CPU(X86_64)) -
trunk/Source/WebCore/page/Page.h
r160944 r161106 47 47 #if PLATFORM(MAC) 48 48 #include <wtf/SchedulePair.h> 49 #endif 50 51 #if PLATFORM(IOS) 52 #include "Settings.h" 49 53 #endif 50 54 … … 322 326 void setSessionStorage(PassRefPtr<StorageNamespace>); 323 327 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(). 324 330 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 325 335 bool hasCustomHTMLTokenizerTimeDelay() const { return m_customHTMLTokenizerTimeDelay != -1; } 326 336 double customHTMLTokenizerTimeDelay() const { ASSERT(m_customHTMLTokenizerTimeDelay != -1); return m_customHTMLTokenizerTimeDelay; } 337 #endif 327 338 328 339 void setCustomHTMLTokenizerChunkSize(int); -
trunk/Source/WebCore/page/PageGroup.cpp
r156769 r161106 218 218 } 219 219 220 void 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 220 230 void PageGroup::removeVisitedLinks() 221 231 { -
trunk/Source/WebCore/page/PageGroup.h
r157653 r161106 78 78 void addVisitedLink(const UChar*, size_t); 79 79 void addVisitedLinkHash(LinkHash); 80 void removeVisitedLink(const URL&); 80 81 void removeVisitedLinks(); 81 82 -
trunk/Source/WebCore/page/Settings.cpp
r160679 r161106 27 27 #include "Settings.h" 28 28 29 #include "AudioSession.h" 29 30 #include "BackForwardController.h" 30 31 #include "CachedResourceLoader.h" … … 46 47 #include "TextAutosizer.h" 47 48 #include <limits> 49 #include <wtf/NeverDestroyed.h> 50 48 51 49 52 namespace WebCore { … … 93 96 bool Settings::gShouldRespectPriorityInCSSAttributeSetters = false; 94 97 bool Settings::gLowPowerVideoAudioBufferSizeEnabled = false; 98 99 #if PLATFORM(IOS) 100 bool Settings::gNetworkDataUsageTrackingEnabled = false; 101 #endif 95 102 96 103 // NOTEs … … 147 154 , m_storageBlockingPolicy(SecurityOrigin::AllowAllStorage) 148 155 , m_layoutInterval(layoutScheduleThreshold) 156 #if PLATFORM(IOS) 157 , m_maxParseDuration(-1) 158 #endif 149 159 #if ENABLE(TEXT_AUTOSIZING) 150 160 , m_textAutosizingFontScaleFactor(1) … … 169 179 , m_fontRenderingMode(0) 170 180 , 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 171 190 #if ENABLE(CSS_STICKY_POSITION) 172 191 , m_cssStickyPositionEnabled(true) … … 383 402 void Settings::setScriptEnabled(bool isScriptEnabled) 384 403 { 404 #if PLATFORM(IOS) 405 if (m_isScriptEnabled == isScriptEnabled) 406 return; 407 #endif 408 385 409 m_isScriptEnabled = isScriptEnabled; 410 #if PLATFORM(IOS) 411 m_page->setNeedsRecalcStyleInAllFrames(); 412 #endif 386 413 InspectorInstrumentation::scriptsEnabled(m_page, m_isScriptEnabled); 387 414 } … … 682 709 } 683 710 711 #if PLATFORM(IOS) 712 void Settings::setStandalone(bool standalone) 713 { 714 m_standalone = standalone; 715 } 716 717 void Settings::setAudioSessionCategoryOverride(unsigned sessionCategory) 718 { 719 AudioSession::sharedSession().setCategoryOverride(static_cast<AudioSession::CategoryType>(sessionCategory)); 720 } 721 722 unsigned Settings::audioSessionCategoryOverride() 723 { 724 return AudioSession::sharedSession().categoryOverride(); 725 } 726 727 void Settings::setNetworkDataUsageTrackingEnabled(bool trackingEnabled) 728 { 729 gNetworkDataUsageTrackingEnabled = trackingEnabled; 730 } 731 732 bool Settings::networkDataUsageTrackingEnabled() 733 { 734 return gNetworkDataUsageTrackingEnabled; 735 } 736 737 static String& sharedNetworkInterfaceNameGlobal() 738 { 739 static NeverDestroyed<String> networkInterfaceName; 740 return networkInterfaceName; 741 } 742 743 void Settings::setNetworkInterfaceName(const String& networkInterfaceName) 744 { 745 sharedNetworkInterfaceNameGlobal() = networkInterfaceName; 746 } 747 748 const String& Settings::networkInterfaceName() 749 { 750 return sharedNetworkInterfaceNameGlobal(); 751 } 752 #endif 753 684 754 } // namespace WebCore -
trunk/Source/WebCore/page/Settings.h
r160679 r161106 181 181 #endif 182 182 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 183 210 void setUsesPageCache(bool); 184 211 bool usesPageCache() const { return m_usesPageCache; } … … 269 296 #endif 270 297 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 271 309 private: 272 310 explicit Settings(Page*); … … 282 320 SecurityOrigin::StorageBlockingPolicy m_storageBlockingPolicy; 283 321 int m_layoutInterval; 322 #if PLATFORM(IOS) 323 double m_maxParseDuration; 324 #endif 284 325 #if ENABLE(TEXT_AUTOSIZING) 285 326 float m_textAutosizingFontScaleFactor; … … 302 343 unsigned m_fontRenderingMode : 1; 303 344 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 304 355 #if ENABLE(CSS_STICKY_POSITION) 305 356 bool m_cssStickyPositionEnabled : 1; … … 349 400 #endif 350 401 static bool gShouldRespectPriorityInCSSAttributeSetters; 402 #if PLATFORM(IOS) 403 static bool gNetworkDataUsageTrackingEnabled; 404 #endif 351 405 352 406 static double gHiddenPageDOMTimerAlignmentInterval; -
trunk/Source/WebCore/page/Settings.in
r160733 r161106 218 218 # FIXME: Rename to allowMultiElementImplicitFormSubmission once we upstream the iOS changes to WebView.mm. 219 219 allowMultiElementImplicitSubmission initial=false 220 221 mediaPlaybackAllowsAirPlay initial=true, conditional=IOS_AIRPLAY -
trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp
r160770 r161106 1213 1213 new PropertyWrapper<int>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset), 1214 1214 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) 1215 1219 new PropertyWrapper<int>(CSSPropertyLetterSpacing, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing), 1216 1220 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 1217 1225 new LengthPropertyWrapper<Length>(CSSPropertyTextIndent, &RenderStyle::textIndent, &RenderStyle::setTextIndent), 1218 1226 -
trunk/Source/WebCore/page/mac/ChromeMac.mm
r154272 r161106 23 23 #import "BlockExceptions.h" 24 24 #import "ChromeClient.h" 25 26 #if PLATFORM(IOS) 27 #include "WAKResponder.h" 28 #include "WAKView.h" 29 #endif 25 30 26 31 namespace WebCore { -
trunk/Source/WebCore/page/mac/PageMac.cpp
r156543 r161106 45 45 m_scheduledRunLoopPairs->add(pair); 46 46 47 #if !PLATFORM(IOS) 47 48 for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) { 48 49 if (DocumentLoader* documentLoader = frame->loader().documentLoader()) … … 51 52 documentLoader->schedule(pair.get()); 52 53 } 54 #endif 53 55 54 56 // FIXME: make SharedTimerMac use these SchedulePairs. … … 64 66 m_scheduledRunLoopPairs->remove(pair); 65 67 68 #if !PLATFORM(IOS) 66 69 for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) { 67 70 if (DocumentLoader* documentLoader = frame->loader().documentLoader()) … … 70 73 documentLoader->unschedule(pair.get()); 71 74 } 75 #endif 72 76 } 73 77 -
trunk/Source/WebCore/page/mac/SettingsMac.mm
r153696 r161106 31 31 bool Settings::shouldEnableScreenFontSubstitutionByDefault() 32 32 { 33 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 109033 #if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 34 34 return false; 35 35 #else -
trunk/Source/WebCore/page/mac/WebCoreFrameView.h
r77257 r161106 26 26 #include "ScrollTypes.h" 27 27 28 // WTF_PLATFORM_IOS 29 #ifdef __cplusplus 28 30 namespace WebCore { 29 31 class Frame; 30 32 } 33 #endif 31 34 32 35 @protocol WebCoreFrameScrollView 36 // WTF_PLATFORM_IOS 37 #ifdef __cplusplus 33 38 - (void)setScrollingModes:(WebCore::ScrollbarMode)hMode vertical:(WebCore::ScrollbarMode)vMode andLock:(BOOL)lock; 34 39 - (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 35 44 - (void)setScrollBarsSuppressed:(BOOL)suppressed repaintOnUnsuppress:(BOOL)repaint; 36 45 - (void)setScrollOrigin:(NSPoint)origin updatePositionAtAll:(BOOL)updatePositionAtAll immediately:(BOOL)updatePositionImmediately; … … 39 48 40 49 @protocol WebCoreFrameView 50 // WTF_PLATFORM_IOS 51 #ifdef __cplusplus 41 52 - (WebCore::Frame*)_web_frame; 53 #endif 42 54 @end -
trunk/Source/WebKit/ios/ChangeLog
r161049 r161106 1 2013-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 1 10 2013-12-23 Andy Estes <aestes@apple.com> 2 11 -
trunk/Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm
r160106 r161106 125 125 } 126 126 127 #if ENABLE( TOUCH_EVENTS)127 #if ENABLE(IOS_TOUCH_EVENTS) 128 128 void WebChromeClientIOS::didPreventDefaultForEvent() 129 129 { -
trunk/Source/WebKit/ios/WebView/WebPDFViewIOS.mm
r160106 r161106 29 29 #import "WebDataSourceInternal.h" 30 30 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>37 31 #import "WebFrameInternal.h" 38 32 #import "WebJSPDFDoc.h" 33 #import "WebKitVersionChecks.h" 39 34 #import "WebPDFDocumentExtras.h" 40 35 #import "WebPDFViewPlaceholder.h" 41 #import "WebKitVersionChecks.h"42 43 36 #import <JavaScriptCore/JSContextRef.h> 44 37 #import <JavaScriptCore/JSStringRef.h> … … 49 42 #import <WebCore/FrameLoaderClient.h> 50 43 #import <WebCore/GraphicsContext.h> 44 #import <WebCore/StringWithDirection.h> 51 45 #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> 52 52 #import <wtf/Assertions.h> 53 53 #import <wtf/RetainPtr.h> -
trunk/Source/WebKit2/ChangeLog
r161105 r161106 1 2013-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 1 12 2013-12-27 Gavin Barraclough <barraclough@apple.com> 2 13 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r159724 r161106 156 156 #endif 157 157 158 #if ENABLE(IOS_TOUCH_EVENTS) 159 virtual void didPreventDefaultForEvent() OVERRIDE; 160 #endif 161 158 162 #if PLATFORM(IOS) 159 #if ENABLE(TOUCH_EVENTS)160 virtual void didPreventDefaultForEvent() OVERRIDE;161 #endif162 163 virtual void didReceiveMobileDocType() OVERRIDE; 163 164 virtual void setNeedsScrollNotifications(WebCore::Frame*, bool) OVERRIDE; -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm
r160566 r161106 35 35 namespace WebKit { 36 36 37 #if ENABLE( TOUCH_EVENTS)37 #if ENABLE(IOS_TOUCH_EVENTS) 38 38 void WebChromeClient::didPreventDefaultForEvent() 39 39 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r161105 r161106 109 109 #include <WebCore/HistoryController.h> 110 110 #include <WebCore/HistoryItem.h> 111 #include <WebCore/HitTestResult.h> 111 112 #include <WebCore/JSDOMWindow.h> 112 113 #include <WebCore/KeyboardEvent.h>
Note: See TracChangeset
for help on using the changeset viewer.