Changeset 259762 in webkit
- Timestamp:
- Apr 8, 2020, 3:41:44 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 29 added
- 35 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/editing/editable-region (added)
-
LayoutTests/editing/editable-region/fixed-and-absolute-contenteditable-scrolled-expected.txt (added)
-
LayoutTests/editing/editable-region/fixed-and-absolute-contenteditable-scrolled.html (added)
-
LayoutTests/editing/editable-region/float-contenteditable-expected.txt (added)
-
LayoutTests/editing/editable-region/float-contenteditable.html (added)
-
LayoutTests/editing/editable-region/hit-test-basic-expected.txt (added)
-
LayoutTests/editing/editable-region/hit-test-basic.html (added)
-
LayoutTests/editing/editable-region/hit-test-fixed-expected.txt (added)
-
LayoutTests/editing/editable-region/hit-test-fixed.html (added)
-
LayoutTests/editing/editable-region/hit-test-overlap-expected.txt (added)
-
LayoutTests/editing/editable-region/hit-test-overlap.html (added)
-
LayoutTests/editing/editable-region/iframe-expected.txt (added)
-
LayoutTests/editing/editable-region/iframe.html (added)
-
LayoutTests/editing/editable-region/input-basic-expected.txt (added)
-
LayoutTests/editing/editable-region/input-basic.html (added)
-
LayoutTests/editing/editable-region/out-hanging-child-of-contenteditable-expected.txt (added)
-
LayoutTests/editing/editable-region/out-hanging-child-of-contenteditable.html (added)
-
LayoutTests/editing/editable-region/overflow-scroll-text-field-and-contenteditable-expected.txt (added)
-
LayoutTests/editing/editable-region/overflow-scroll-text-field-and-contenteditable.html (added)
-
LayoutTests/editing/editable-region/relative-inside-fixed-contenteditable-scrolled-expected.txt (added)
-
LayoutTests/editing/editable-region/relative-inside-fixed-contenteditable-scrolled.html (added)
-
LayoutTests/editing/editable-region/relative-inside-transformed-contenteditable-expected.txt (added)
-
LayoutTests/editing/editable-region/relative-inside-transformed-contenteditable.html (added)
-
LayoutTests/editing/editable-region/resources (added)
-
LayoutTests/editing/editable-region/resources/hit-test-utilities.js (added)
-
LayoutTests/editing/editable-region/transformed-scrolled-on-top-of-fixed-contenteditables-expected.txt (added)
-
LayoutTests/editing/editable-region/transformed-scrolled-on-top-of-fixed-contenteditables.html (added)
-
LayoutTests/platform/ios/TestExpectations (modified) (1 diff)
-
LayoutTests/resources/ui-helper.js (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Source/WebCore/PAL/ChangeLog (modified) (1 diff)
-
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Source/WebCore/dom/Document.h (modified) (2 diffs)
-
Source/WebCore/page/Frame.cpp (modified) (1 diff)
-
Source/WebCore/rendering/EventRegion.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/EventRegion.h (modified) (5 diffs)
-
Source/WebCore/rendering/RenderBlock.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderElement.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayer.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerBacking.cpp (modified) (3 diffs)
-
Source/WebCore/style/StyleTreeResolver.cpp (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (modified) (3 diffs)
-
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (modified) (1 diff)
-
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h (modified) (1 diff)
-
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (modified) (1 diff)
-
Source/WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (modified) (1 diff)
-
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (modified) (1 diff)
-
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig (modified) (2 diffs)
-
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm (modified) (4 diffs)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/editable-region-composited-and-non-composited-overlap.html (added)
-
Tools/TestWebKitAPI/ios/editable-region-composited-and-non-composited-overlap.html (added)
-
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h (modified) (1 diff)
-
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r259761 r259762 1 2020-04-08 Daniel Bates <dabates@apple.com> 2 3 Track editable elements on screen 4 https://bugs.webkit.org/show_bug.cgi?id=209888 5 <rdar://problem/61196886> 6 7 Reviewed by Simon Fraser. 8 9 Add some tests. Some of these tests were derived from a torture test page written by Simon Fraser. 10 11 * TestExpectations: Skip directory editing/editable-region everywhere. I will unskip this in the iOS TestExpectations file. 12 * editing/editable-region/fixed-and-absolute-contenteditable-scrolled-expected.txt: Added. 13 * editing/editable-region/fixed-and-absolute-contenteditable-scrolled.html: Added. 14 * editing/editable-region/float-contenteditable-expected.txt: Added. 15 * editing/editable-region/float-contenteditable.html: Added. 16 * editing/editable-region/hit-test-basic-expected.txt: Added. 17 * editing/editable-region/hit-test-basic.html: Added. 18 * editing/editable-region/hit-test-fixed-expected.txt: Added. 19 * editing/editable-region/hit-test-fixed.html: Added. 20 * editing/editable-region/hit-test-overlap-expected.txt: Added. 21 * editing/editable-region/hit-test-overlap.html: Added. 22 * editing/editable-region/iframe-expected.txt: Added. 23 * editing/editable-region/iframe.html: Added. 24 * editing/editable-region/input-basic-expected.txt: Added. 25 * editing/editable-region/input-basic.html: Added. 26 * editing/editable-region/out-hanging-child-of-contenteditable-expected.txt: Added. 27 * editing/editable-region/out-hanging-child-of-contenteditable.html: Added. 28 * editing/editable-region/overflow-scroll-text-field-and-contenteditable-expected.txt: Added. 29 * editing/editable-region/overflow-scroll-text-field-and-contenteditable.html: Added. 30 * editing/editable-region/relative-inside-fixed-contenteditable-scrolled-expected.txt: Added. 31 * editing/editable-region/relative-inside-fixed-contenteditable-scrolled.html: Added. 32 * editing/editable-region/relative-inside-transformed-contenteditable-expected.txt: Added. 33 * editing/editable-region/relative-inside-transformed-contenteditable.html: Added. 34 * editing/editable-region/resources/hit-test-utilities.js: Added. 35 (async shouldHaveEditableElementsInRect): 36 (async shouldNotHaveEditableElementsInRect): 37 (shouldNotHaveEditableElementsInRectForElement): 38 * editing/editable-region/transformed-scrolled-on-top-of-fixed-contenteditables-expected.txt: Added. 39 * editing/editable-region/transformed-scrolled-on-top-of-fixed-contenteditables.html: Added. 40 * platform/ios/TestExpectations: Unskip editing/editable-region. 41 * resources/ui-helper.js: 42 (window.UIHelper.mayContainEditableElementsInRect): Added. Convenience function that turns around 43 and calls the UIScriptController function of the same name and returns a boolean instead of a string. 44 1 45 2020-04-08 Daniel Bates <dabates@apple.com> 2 46 -
trunk/LayoutTests/TestExpectations
r259703 r259762 18 18 editing/mac [ Skip ] 19 19 editing/caret/ios [ Skip ] 20 editing/editable-region [ Skip ] 20 21 editing/input/ios [ Skip ] 21 22 editing/find [ Skip ] -
trunk/LayoutTests/platform/ios/TestExpectations
r259702 r259762 9 9 accessibility/ios-simulator [ Pass ] 10 10 displaylists [ Pass ] 11 editing/editable-region [ Pass ] 11 12 editing/deleting/ios [ Pass ] 12 13 http/tests/quicklook [ Pass ] -
trunk/LayoutTests/resources/ui-helper.js
r259669 r259762 1168 1168 uiController.singleTapAtPoint(${x}, ${y}, incrementProgress); 1169 1169 })();`, resolve); 1170 }); 1171 } 1172 1173 static mayContainEditableElementsInRect(x, y, width, height) 1174 { 1175 if (!this.isWebKit2() || !this.isIOSFamily()) 1176 return Promise.resolve(false); 1177 1178 return new Promise(resolve => { 1179 testRunner.runUIScript(` 1180 (function() { 1181 uiController.doAfterPresentationUpdate(function() { 1182 uiController.uiScriptComplete(uiController.mayContainEditableElementsInRect(${x}, ${y}, ${width}, ${height})); 1183 }) 1184 })();`, result => resolve(result === "true")); 1170 1185 }); 1171 1186 } -
trunk/Source/JavaScriptCore/ChangeLog
r259747 r259762 1 2020-04-08 Daniel Bates <dabates@apple.com> 2 3 Track editable elements on screen 4 https://bugs.webkit.org/show_bug.cgi?id=209888 5 <rdar://problem/61196886> 6 7 Reviewed by Simon Fraser. 8 9 Add feature define to track editable elements on screen (enabled by default on iOS and iOS Simulator). 10 11 * Configurations/FeatureDefines.xcconfig: 12 1 13 2020-04-08 Yusuke Suzuki <ysuzuki@apple.com> 2 14 -
trunk/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
r258772 r259762 146 146 ENABLE_DRAG_SUPPORT_maccatalyst = ENABLE_DRAG_SUPPORT; 147 147 148 ENABLE_EDITABLE_REGION = $(ENABLE_EDITABLE_REGION_$(WK_PLATFORM_NAME)); 149 ENABLE_EDITABLE_REGION_iphoneos = ENABLE_EDITABLE_REGION; 150 ENABLE_EDITABLE_REGION_iphonesimulator = ENABLE_EDITABLE_REGION; 151 148 152 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); 149 153 ENABLE_ENCRYPTED_MEDIA_iphoneos = ENABLE_ENCRYPTED_MEDIA; … … 418 422 ENABLE_XSLT = ENABLE_XSLT; 419 423 420 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_E NCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);424 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_EDITABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT); -
trunk/Source/WebCore/ChangeLog
r259761 r259762 1 2020-04-08 Daniel Bates <dabates@apple.com> 2 3 Track editable elements on screen 4 https://bugs.webkit.org/show_bug.cgi?id=209888 5 <rdar://problem/61196886> 6 7 Reviewed by Simon Fraser. 8 9 Amend EventRegion to store a region of all the hit test visible rects of editable elements 10 on the page. This data will be sent over to the UI process so that it can quickly determine 11 if a search rect would intersect any editable elements. 12 13 An element is considered editable if it has CSS -webkit-user-modify value that isn't read-only. 14 Note that the value of the HTML content attribute contenteditable is internally converted to 15 its -webkit-user-modify equivalent (e.g. contenteditable="true" <=> "-webkit-user-modify: read-write"). 16 17 Tests: editing/editable-region/fixed-and-absolute-contenteditable-scrolled.html 18 editing/editable-region/float-contenteditable.html 19 editing/editable-region/hit-test-basic.html 20 editing/editable-region/hit-test-fixed.html 21 editing/editable-region/hit-test-overlap.html 22 editing/editable-region/iframe.html 23 editing/editable-region/input-basic.html 24 editing/editable-region/out-hanging-child-of-contenteditable.html 25 editing/editable-region/overflow-scroll-text-field-and-contenteditable.html 26 editing/editable-region/relative-inside-fixed-contenteditable-scrolled.html 27 editing/editable-region/relative-inside-transformed-contenteditable.html 28 editing/editable-region/transformed-scrolled-on-top-of-fixed-contenteditables.html 29 30 * Configurations/FeatureDefines.xcconfig: Add feature define to track editable elements on 31 screen (enabled by default on iOS and iOS Simulator). 32 * dom/Document.h: 33 (WebCore::Document::mayHaveEditableElements const): 34 (WebCore::Document::setMayHaveEditableElements): 35 Add some state to each document to track whether it may have an editable element or not. This 36 value represents a "maybe" because it is only set and never unset. It is set if the style resolver 37 saw an element with an editable style. This flag is used as a performance optimization to avoid 38 creating an event region if there are no editable elements on the page. 39 40 * page/Frame.cpp: 41 (WebCore::Frame::invalidateContentEventRegionsIfNeeded): Check if there are any editable elements. 42 If so, invalidate the event region. 43 * rendering/EventRegion.cpp: 44 (WebCore::EventRegion::operator== const): Update for editable region. 45 (WebCore::EventRegion::unite): If the specified style has a writable CSS user-modify value then 46 unite the region with the editable region. 47 (WebCore::EventRegion::translate): Update for editable region. 48 (WebCore::EventRegion::containsEditableElementsInRect const): Added. Check if the specified rect 49 intersects the editable region. If it does then that means there are one or more editable elements 50 whose bounds intersect that rect. Otherwise, there are none. 51 (WebCore::EventRegion::dump const): Update for editable region. 52 * rendering/EventRegion.h: 53 (WebCore::EventRegion::intersects const): Added. 54 (WebCore::EventRegion::rectsForEditableElements const): Return the rects in the editable region. 55 (WebCore::EventRegion::encode const): Encode the editable region. 56 (WebCore::EventRegion::decode): Decode the editable region. 57 * rendering/RenderBlock.cpp: 58 (WebCore::RenderBlock::paintObject): Traverse descendants if the page has any editable elements 59 so that we find all of them. 60 * rendering/RenderElement.cpp: 61 (WebCore::RenderElement::styleWillChange): Amend the event region invalidation criterion to look 62 for a change in writability. If there was a change (e.g. read-only to read-write) then invalidate 63 the event region to force a re-computation of it. 64 * rendering/RenderLayer.cpp: 65 (WebCore::RenderLayer::invalidateEventRegion): If the document has editable elements then we need 66 to create an event region. 67 * rendering/RenderLayerBacking.cpp: 68 (WebCore::RenderLayerBacking::updateEventRegion): Update the region if there are editable elements. 69 (WebCore::RenderLayerBacking::paintDebugOverlays): Paint the editable elements in the debug overlay. 70 For now, I piggybacked (like was done for touch-action regions) on the non-fast scrollable region 71 flag (not shown in the patch). I will look to add a dedicated debug overlay flag in a follow up patch. 72 * style/StyleTreeResolver.cpp: 73 (WebCore::Style::TreeResolver::resolveElement): Mark the document as having an editable element if 74 the style for the element being resolved is writable. 75 1 76 2020-04-08 Daniel Bates <dabates@apple.com> 2 77 -
trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig
r258772 r259762 146 146 ENABLE_DRAG_SUPPORT_maccatalyst = ENABLE_DRAG_SUPPORT; 147 147 148 ENABLE_EDITABLE_REGION = $(ENABLE_EDITABLE_REGION_$(WK_PLATFORM_NAME)); 149 ENABLE_EDITABLE_REGION_iphoneos = ENABLE_EDITABLE_REGION; 150 ENABLE_EDITABLE_REGION_iphonesimulator = ENABLE_EDITABLE_REGION; 151 148 152 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); 149 153 ENABLE_ENCRYPTED_MEDIA_iphoneos = ENABLE_ENCRYPTED_MEDIA; … … 418 422 ENABLE_XSLT = ENABLE_XSLT; 419 423 420 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_E NCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);424 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_EDITABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT); -
trunk/Source/WebCore/PAL/ChangeLog
r259754 r259762 1 2020-04-08 Daniel Bates <dabates@apple.com> 2 3 Track editable elements on screen 4 https://bugs.webkit.org/show_bug.cgi?id=209888 5 <rdar://problem/61196886> 6 7 Reviewed by Simon Fraser. 8 9 Add feature define to track editable elements on screen (enabled by default on iOS and iOS Simulator). 10 11 * Configurations/FeatureDefines.xcconfig: 12 1 13 2020-04-08 Adrian Perez de Castro <aperez@igalia.com> 2 14 -
trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
r258772 r259762 146 146 ENABLE_DRAG_SUPPORT_maccatalyst = ENABLE_DRAG_SUPPORT; 147 147 148 ENABLE_EDITABLE_REGION = $(ENABLE_EDITABLE_REGION_$(WK_PLATFORM_NAME)); 149 ENABLE_EDITABLE_REGION_iphoneos = ENABLE_EDITABLE_REGION; 150 ENABLE_EDITABLE_REGION_iphonesimulator = ENABLE_EDITABLE_REGION; 151 148 152 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); 149 153 ENABLE_ENCRYPTED_MEDIA_iphoneos = ENABLE_ENCRYPTED_MEDIA; … … 418 422 ENABLE_XSLT = ENABLE_XSLT; 419 423 420 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_E NCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);424 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_EDITABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT); -
trunk/Source/WebCore/dom/Document.h
r259761 r259762 1252 1252 void setMayHaveElementsWithNonAutoTouchAction() { m_mayHaveElementsWithNonAutoTouchAction = true; } 1253 1253 #endif 1254 #if ENABLE(EDITABLE_REGION) 1255 bool mayHaveEditableElements() const { return m_mayHaveEditableElements; } 1256 void setMayHaveEditableElements() { m_mayHaveEditableElements = true; } 1257 #endif 1254 1258 1255 1259 void didAddTouchEventHandler(Node&); … … 1864 1868 bool m_mayHaveElementsWithNonAutoTouchAction { false }; 1865 1869 #endif 1870 #if ENABLE(EDITABLE_REGION) 1871 bool m_mayHaveEditableElements { false }; 1872 #endif 1866 1873 std::unique_ptr<EventTargetSet> m_wheelEventTargets; 1867 1874 -
trunk/Source/WebCore/page/Frame.cpp
r259761 r259762 310 310 if (!m_page || !m_doc || !m_doc->renderView()) 311 311 return; 312 bool hasTouchActionElements = false; 313 bool hasEditableElements = false; 312 314 #if PLATFORM(IOS) 313 if (!m_doc->mayHaveElementsWithNonAutoTouchAction()) 314 return; 315 hasTouchActionElements = m_doc->mayHaveElementsWithNonAutoTouchAction(); 315 316 #endif 317 #if ENABLE(EDITABLE_REGION) 318 hasEditableElements = m_doc->mayHaveEditableElements(); 319 #endif 320 if (!hasTouchActionElements && !hasEditableElements) 321 return; 316 322 if (!m_doc->renderView()->compositor().viewNeedsToInvalidateEventRegionOfEnclosingCompositingLayerForRepaint()) 317 323 return; -
trunk/Source/WebCore/rendering/EventRegion.cpp
r258539 r259762 101 101 if (m_touchActionRegions != other.m_touchActionRegions) 102 102 return false; 103 #if ENABLE(EDITABLE_REGION) 104 if (m_editableRegion != other.m_editableRegion) 105 return false; 106 #endif 103 107 return m_region == other.m_region; 104 108 } … … 109 113 110 114 uniteTouchActions(region, style.effectiveTouchActions()); 115 116 #if ENABLE(EDITABLE_REGION) 117 if (style.userModify() != UserModify::ReadOnly) 118 m_editableRegion.unite(region); 119 #endif 111 120 } 112 121 … … 117 126 for (auto& touchActionRegion : m_touchActionRegions) 118 127 touchActionRegion.translate(offset); 128 129 #if ENABLE(EDITABLE_REGION) 130 m_editableRegion.translate(offset); 131 #endif 119 132 } 120 133 … … 206 219 } 207 220 221 #if ENABLE(EDITABLE_REGION) 222 223 bool EventRegion::containsEditableElementsInRect(const IntRect& rect) const 224 { 225 return m_editableRegion.intersects(rect); 226 } 227 228 #endif 229 208 230 void EventRegion::dump(TextStream& ts) const 209 231 { … … 223 245 ts << indent << ")\n"; 224 246 } 247 248 #if ENABLE(EDITABLE_REGION) 249 if (!m_editableRegion.isEmpty()) { 250 ts << indent << "(editable region" << m_editableRegion; 251 ts << indent << ")\n"; 252 } 253 #endif 225 254 } 226 255 -
trunk/Source/WebCore/rendering/EventRegion.h
r258539 r259762 71 71 bool contains(const IntPoint& point) const { return m_region.contains(point); } 72 72 bool contains(const IntRect& rect) const { return m_region.contains(rect); } 73 bool intersects(const IntRect& rect) const { return m_region.intersects(rect); } 73 74 74 75 const Region& region() const { return m_region; } … … 78 79 79 80 const Region* regionForTouchAction(TouchAction) const; 81 82 #if ENABLE(EDITABLE_REGION) 83 WEBCORE_EXPORT bool containsEditableElementsInRect(const IntRect&) const; 84 Vector<IntRect, 1> rectsForEditableElements() const { return m_editableRegion.rects(); } 85 #endif 80 86 81 87 template<class Encoder> void encode(Encoder&) const; … … 91 97 Region m_region; 92 98 Vector<Region> m_touchActionRegions; 99 #if ENABLE(EDITABLE_REGION) 100 Region m_editableRegion; 101 #endif 93 102 }; 94 103 … … 100 109 encoder << m_region; 101 110 encoder << m_touchActionRegions; 111 #if ENABLE(EDITABLE_REGION) 112 encoder << m_editableRegion; 113 #endif 102 114 } 103 115 … … 120 132 eventRegion.m_touchActionRegions = WTFMove(*touchActionRegions); 121 133 134 #if ENABLE(EDITABLE_REGION) 135 Optional<Region> editableRegion; 136 decoder >> editableRegion; 137 if (!editableRegion) 138 return WTF::nullopt; 139 eventRegion.m_editableRegion = WTFMove(*editableRegion); 140 #endif 141 122 142 return eventRegion; 123 143 } -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r259761 r259762 1258 1258 bool needsTraverseDescendants = hasVisualOverflow() || containsFloats() || !paintInfo.eventRegionContext->contains(enclosingIntRect(borderRect)) || view().needsEventRegionUpdateForNonCompositedFrame(); 1259 1259 #if PLATFORM(IOS_FAMILY) 1260 needsTraverseDescendants = needsTraverseDescendants || document().mayHaveElementsWithNonAutoTouchAction(); 1260 needsTraverseDescendants |= document().mayHaveElementsWithNonAutoTouchAction(); 1261 #endif 1262 #if ENABLE(EDITABLE_REGION) 1263 needsTraverseDescendants |= document().mayHaveEditableElements(); 1261 1264 #endif 1262 1265 if (!needsTraverseDescendants) -
trunk/Source/WebCore/rendering/RenderElement.cpp
r259761 r259762 740 740 if (m_style.effectiveTouchActions() != newStyle.effectiveTouchActions()) 741 741 return true; 742 #if ENABLE(EDITABLE_REGION) 743 bool wasEditable = m_style.userModify() != UserModify::ReadOnly; 744 bool isEditable = newStyle.userModify() != UserModify::ReadOnly; 745 if (wasEditable != isEditable) 746 return true; 747 #endif 742 748 return false; 743 749 }; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r259761 r259762 7021 7021 if (renderer().document().mayHaveElementsWithNonAutoTouchAction()) 7022 7022 return true; 7023 #if ENABLE(EDITABLE_REGION) 7024 // UI side editable elements resolution. 7025 if (renderer().document().mayHaveEditableElements()) 7026 return true; 7027 #endif 7023 7028 return false; 7024 7029 }; -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r259761 r259762 1621 1621 bool needsEventRegionUpdateForNonCompositedFrame = renderer().view().needsEventRegionUpdateForNonCompositedFrame(); 1622 1622 bool hasTouchActionElements = false; 1623 bool hasEditableElements = false; 1623 1624 #if PLATFORM(IOS_FAMILY) 1624 1625 hasTouchActionElements = renderer().document().mayHaveElementsWithNonAutoTouchAction(); 1625 1626 #endif 1626 if (!hasTouchActionElements && !needsEventRegionUpdateForNonCompositedFrame) { 1627 #if ENABLE(EDITABLE_REGION) 1628 hasEditableElements = renderer().document().mayHaveEditableElements(); 1629 #endif 1630 if (!hasTouchActionElements && !hasEditableElements && !needsEventRegionUpdateForNonCompositedFrame) { 1627 1631 if (m_owningLayer.isRenderViewLayer()) 1628 1632 return; … … 3069 3073 3070 3074 // The interactive part. 3075 // Paint rects for touch action. 3071 3076 auto& eventRegion = graphicsLayer->eventRegion(); 3072 3077 Color regionColor(0, 0, 255, 50); … … 3096 3101 context.fillRect(rect); 3097 3102 } 3103 3104 #if ENABLE(EDITABLE_REGION) 3105 // Paint rects for editable elements. 3106 context.setFillColor({ 128, 0, 128, 50 }); 3107 for (auto rect : eventRegion.rectsForEditableElements()) 3108 context.fillRect(rect); 3109 #endif 3098 3110 } 3099 3111 -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r258148 r259762 250 250 m_document.setMayHaveElementsWithNonAutoTouchAction(); 251 251 #endif 252 #if ENABLE(EDITABLE_REGION) 253 if (update.style->userModify() != UserModify::ReadOnly) 254 m_document.setMayHaveEditableElements(); 255 #endif 252 256 253 257 return { WTFMove(update), descendantsToResolve, WTFMove(beforeUpdate), WTFMove(afterUpdate) }; -
trunk/Source/WebKit/ChangeLog
r259761 r259762 1 2020-04-08 Daniel Bates <dabates@apple.com> 2 3 Track editable elements on screen 4 https://bugs.webkit.org/show_bug.cgi?id=209888 5 <rdar://problem/61196886> 6 7 Reviewed by Simon Fraser. 8 9 Speed up -_requestTextInputContextsInRect when the rect does not intersect any editable 10 elements by over 4450 times on reddit.com! Another way of saying this is that it reduces 11 the time from an average of 303.252ms to 0.0680625ms in a Production build. 12 13 This speed up is accomplished by having the web process track the rects of the editable 14 elements on the page and send this information as a region data structure over to the UI 15 process as part of the EventRegion object. This region is used to determine if there 16 *may* be an editable element inside the rectangele. It never reports a false negative, 17 but it can report a false positive: a rectangle is over an editable element when it 18 actually isn't, (e.g. there is a non-composited element with a higher z-order than the 19 editable element that intersects the search rect). 20 21 * Configurations/FeatureDefines.xcconfig: Add feature define to track editable elements on 22 screen (enabled by default on iOS and iOS Simulator). 23 * UIProcess/API/Cocoa/WKWebView.mm: 24 (-[WKWebView _mayContainEditableElementsInRect:]): Added. 25 (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): Checks if the search 26 rects hits an editable element in a RemoteLayerTree node's editable region. If it does 27 not hit any then we know there are no editable elements and return immediately. If it 28 does hit something then we still need to ask the web process to perform a hit test to 29 find the actual elements, respecting z-ordering (which is lost when these elements' rects 30 are united to form the editable region). 31 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 32 * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: 33 * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: 34 (WebKit::collectDescendantViewsInRect): Added. 35 (WebKit::mayContainEditableElementsInRect): Added. 36 1 37 2020-04-08 Daniel Bates <dabates@apple.com> 2 38 -
trunk/Source/WebKit/Configurations/FeatureDefines.xcconfig
r258772 r259762 146 146 ENABLE_DRAG_SUPPORT_maccatalyst = ENABLE_DRAG_SUPPORT; 147 147 148 ENABLE_EDITABLE_REGION = $(ENABLE_EDITABLE_REGION_$(WK_PLATFORM_NAME)); 149 ENABLE_EDITABLE_REGION_iphoneos = ENABLE_EDITABLE_REGION; 150 ENABLE_EDITABLE_REGION_iphonesimulator = ENABLE_EDITABLE_REGION; 151 148 152 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); 149 153 ENABLE_ENCRYPTED_MEDIA_iphoneos = ENABLE_ENCRYPTED_MEDIA; … … 418 422 ENABLE_XSLT = ENABLE_XSLT; 419 423 420 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_E NCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);424 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_EDITABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT); -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r259523 r259762 150 150 #if PLATFORM(IOS_FAMILY) 151 151 #import "RemoteLayerTreeDrawingAreaProxy.h" 152 #import "RemoteLayerTreeViews.h" 152 153 #import "RemoteScrollingCoordinatorProxy.h" 153 154 #import "UIKitSPI.h" … … 2092 2093 } 2093 2094 2095 - (BOOL)_mayContainEditableElementsInRect:(CGRect)rect 2096 { 2097 #if ENABLE(EDITABLE_REGION) 2098 #if PLATFORM(IOS_FAMILY) 2099 if (![self usesStandardContentView]) 2100 return NO; 2101 #endif 2102 CGRect rectInRootViewCoordinates = [self _convertRectToRootViewCoordinates:rect]; 2103 return WebKit::mayContainEditableElementsInRect(_contentView.get(), rectInRootViewCoordinates); 2104 #else 2105 return NO; 2106 #endif 2107 } 2108 2094 2109 - (void)_requestTextInputContextsInRect:(CGRect)rectInWebViewCoordinates completionHandler:(void(^)(NSArray<_WKTextInputContext *> *))completionHandler 2095 2110 { … … 2100 2115 } 2101 2116 #endif 2117 #if ENABLE(EDITABLE_REGION) 2118 if (![self _mayContainEditableElementsInRect:rectInWebViewCoordinates]) { 2119 completionHandler(@[]); 2120 return; 2121 } 2122 #endif 2102 2123 2103 2124 CGRect rectInRootViewCoordinates = [self _convertRectToRootViewCoordinates:rectInWebViewCoordinates]; 2125 2104 2126 auto weakSelf = WeakObjCPtr<WKWebView>(self); 2105 2127 _page->textInputContextsInRect(rectInRootViewCoordinates, [weakSelf, capturedCompletionHandler = makeBlockPtr(completionHandler)] (const Vector<WebCore::ElementContext>& contexts) { -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
r259523 r259762 336 336 - (void)_closeAllMediaPresentations; 337 337 338 - (BOOL)_mayContainEditableElementsInRect:(CGRect)rect; 338 339 - (void)_requestTextInputContextsInRect:(CGRect)rect completionHandler:(void(^)(NSArray<_WKTextInputContext *> *))completionHandler WK_API_AVAILABLE(macos(10.15), ios(13.0)); 339 340 - (void)_focusTextInputContext:(_WKTextInputContext *)textInputElement completionHandler:(void(^)(BOOL))completionHandler WK_API_AVAILABLE(macos(10.15), ios(13.0)); -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h
r258148 r259762 82 82 UIScrollView *findActingScrollParent(UIScrollView *, const RemoteLayerTreeHost&); 83 83 84 #if ENABLE(EDITABLE_REGION) 85 bool mayContainEditableElementsInRect(UIView *rootView, const WebCore::FloatRect&); 86 #endif 87 84 88 } 85 89 -
trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm
r258772 r259762 77 77 } 78 78 79 #if ENABLE(EDITABLE_REGION) 80 81 static void collectDescendantViewsInRect(Vector<UIView *, 16>& viewsInRect, UIView *parent, CGRect rect) 82 { 83 if (parent.clipsToBounds && !CGRectIntersectsRect(parent.bounds, rect)) 84 return; 85 86 for (UIView *view in parent.subviews) { 87 CGRect subviewRect = [view convertRect:rect fromView:parent]; 88 89 auto intersectsRect = [&] { 90 // FIXME: isUserInteractionEnabled is mostly redundant with event regions for web content layers. 91 // It is currently only needed for scroll views. 92 if (!view.isUserInteractionEnabled) 93 return false; 94 95 if (CGRectIsEmpty(view.frame)) 96 return false; 97 98 if (!CGRectIntersectsRect(subviewRect, view.bounds)) 99 return false; 100 101 if (![view isKindOfClass:WKCompositingView.class]) 102 return true; 103 auto* node = RemoteLayerTreeNode::forCALayer(view.layer); 104 return node->eventRegion().intersects(WebCore::IntRect { subviewRect }); 105 }(); 106 107 if (intersectsRect) 108 viewsInRect.append(view); 109 110 if (!view.subviews) 111 return; 112 113 collectDescendantViewsInRect(viewsInRect, view, subviewRect); 114 }; 115 } 116 117 bool mayContainEditableElementsInRect(UIView *rootView, const WebCore::FloatRect& rect) 118 { 119 Vector<UIView *, 16> viewsInRect; 120 collectDescendantViewsInRect(viewsInRect, rootView, rect); 121 if (viewsInRect.isEmpty()) 122 return false; 123 for (auto *view : WTF::makeReversedRange(viewsInRect)) { 124 if (![view isKindOfClass:WKCompositingView.class]) 125 continue; 126 WebCore::IntRect rectToTest { [view convertRect:rect fromView:rootView] }; 127 if (auto* node = RemoteLayerTreeNode::forCALayer(view.layer); node && node->eventRegion().containsEditableElementsInRect(rectToTest)) 128 return true; 129 } 130 return false; 131 } 132 133 #endif // ENABLE(EDITABLE_REGION) 134 79 135 static bool isScrolledBy(WKChildScrollView* scrollView, UIView *hitView) 80 136 { -
trunk/Source/WebKitLegacy/mac/ChangeLog
r259726 r259762 1 2020-04-08 Daniel Bates <dabates@apple.com> 2 3 Track editable elements on screen 4 https://bugs.webkit.org/show_bug.cgi?id=209888 5 <rdar://problem/61196886> 6 7 Reviewed by Simon Fraser. 8 9 Add feature define to track editable elements on screen (enabled by default on iOS and iOS Simulator). 10 11 * Configurations/FeatureDefines.xcconfig: 12 1 13 2020-04-08 Truitt Savell <tsavell@apple.com> 2 14 -
trunk/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig
r258772 r259762 146 146 ENABLE_DRAG_SUPPORT_maccatalyst = ENABLE_DRAG_SUPPORT; 147 147 148 ENABLE_EDITABLE_REGION = $(ENABLE_EDITABLE_REGION_$(WK_PLATFORM_NAME)); 149 ENABLE_EDITABLE_REGION_iphoneos = ENABLE_EDITABLE_REGION; 150 ENABLE_EDITABLE_REGION_iphonesimulator = ENABLE_EDITABLE_REGION; 151 148 152 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); 149 153 ENABLE_ENCRYPTED_MEDIA_iphoneos = ENABLE_ENCRYPTED_MEDIA; … … 418 422 ENABLE_XSLT = ENABLE_XSLT; 419 423 420 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_E NCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);424 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_EDITABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT); -
trunk/Tools/ChangeLog
r259746 r259762 1 2020-04-08 Daniel Bates <dabates@apple.com> 2 3 Track editable elements on screen 4 https://bugs.webkit.org/show_bug.cgi?id=209888 5 <rdar://problem/61196886> 6 7 Reviewed by Simon Fraser. 8 9 Add more unit tests for -_requestTextInputContextsInRect. Also add test infrastructure to 10 be able to verify that WebKit::mayContainEditableElementsInRect() works. 11 12 * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: 13 * TestRunnerShared/UIScriptContext/UIScriptController.h: 14 (WTR::UIScriptController::mayContainEditableElementsInRect): 15 Expose an internal function to test WebKit::mayContainEditableElementsInRect(). 16 17 * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Add feature define. 18 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 19 * TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm: 20 (webViewLoadHTMLStringAndWaitForAllFramesToPaint): Renamed; formerly webViewLoadHTMLStringAndWaitForDOMLoadEvent. 21 Also make it wait for the next presentation update after we paint. 22 (TEST): 23 (squareCenteredAtPoint): Added. 24 (webViewLoadHTMLStringAndWaitForDOMLoadEvent): Deleted; renamed webViewLoadHTMLStringAndWaitForAllFramesToPaint(). 25 * TestWebKitAPI/Tests/WebKitCocoa/editable-region-composited-and-non-composited-overlap.html: Added. 26 * TestWebKitAPI/ios/editable-region-composited-and-non-composited-overlap.html: Added. 27 * WebKitTestRunner/ios/UIScriptControllerIOS.h: 28 * WebKitTestRunner/ios/UIScriptControllerIOS.mm: 29 (WTR::UIScriptControllerIOS::mayContainEditableElementsInRect): Added. 30 1 31 2020-04-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 32 -
trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
r259669 r259762 309 309 readonly attribute DOMString scrollingTreeAsText; 310 310 311 boolean mayContainEditableElementsInRect(unsigned long x, unsigned long y, unsigned long width, unsigned long height); 312 311 313 object propertiesOfLayerWithID(unsigned long long layerID); 312 314 -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
r259669 r259762 120 120 virtual void installTapGestureOnWindow(JSValueRef) { notImplemented(); } 121 121 122 // Editable region 123 124 virtual bool mayContainEditableElementsInRect(unsigned, unsigned, unsigned, unsigned) { notImplemented(); return false; } 125 122 126 // Compositing 123 127 -
trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig
r258772 r259762 146 146 ENABLE_DRAG_SUPPORT_maccatalyst = ENABLE_DRAG_SUPPORT; 147 147 148 ENABLE_EDITABLE_REGION = $(ENABLE_EDITABLE_REGION_$(WK_PLATFORM_NAME)); 149 ENABLE_EDITABLE_REGION_iphoneos = ENABLE_EDITABLE_REGION; 150 ENABLE_EDITABLE_REGION_iphonesimulator = ENABLE_EDITABLE_REGION; 151 148 152 ENABLE_ENCRYPTED_MEDIA = $(ENABLE_ENCRYPTED_MEDIA_$(WK_PLATFORM_NAME)); 149 153 ENABLE_ENCRYPTED_MEDIA_iphoneos = ENABLE_ENCRYPTED_MEDIA; … … 418 422 ENABLE_XSLT = ENABLE_XSLT; 419 423 420 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_E NCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);424 FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_EDITABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT); -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r259622 r259762 1002 1002 CEBCA13A1E3A807A00C73293 /* page-without-csp.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CEBCA1371E3A803400C73293 /* page-without-csp.html */; }; 1003 1003 CEBCA13B1E3A807A00C73293 /* page-without-csp-iframe.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CEBCA1361E3A803400C73293 /* page-without-csp-iframe.html */; }; 1004 CEDA12412437C9FB00C28A9E /* editable-region-composited-and-non-composited-overlap.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CEDA12402437C9EA00C28A9E /* editable-region-composited-and-non-composited-overlap.html */; }; 1004 1005 D34E08761E4E42E1005FF14A /* WKWebViewGetContents.mm in Sources */ = {isa = PBXBuildFile; fileRef = D3BE5E341E4CE85E00FD563A /* WKWebViewGetContents.mm */; }; 1005 1006 DF4B273921A47728009BD1CA /* WKNSDictionaryEmptyDictionaryCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = DF4B273821A47727009BD1CA /* WKNSDictionaryEmptyDictionaryCrash.mm */; }; … … 1299 1300 9984FACE1CFFB090008D198C /* editable-body.html in Copy Resources */, 1300 1301 F4D9818F2196B920008230FC /* editable-nested-lists.html in Copy Resources */, 1302 CEDA12412437C9FB00C28A9E /* editable-region-composited-and-non-composited-overlap.html in Copy Resources */, 1301 1303 F44D06451F395C26001A0E29 /* editor-state-test-harness.html in Copy Resources */, 1302 1304 51C8E1A91F27F49600BF731B /* EmptyGrandfatheredResourceLoadStatistics.plist in Copy Resources */, … … 2611 2613 CEBCA1361E3A803400C73293 /* page-without-csp-iframe.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "page-without-csp-iframe.html"; sourceTree = "<group>"; }; 2612 2614 CEBCA1371E3A803400C73293 /* page-without-csp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "page-without-csp.html"; sourceTree = "<group>"; }; 2615 CEDA12402437C9EA00C28A9E /* editable-region-composited-and-non-composited-overlap.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = "editable-region-composited-and-non-composited-overlap.html"; path = "ios/editable-region-composited-and-non-composited-overlap.html"; sourceTree = SOURCE_ROOT; }; 2613 2616 D3BE5E341E4CE85E00FD563A /* WKWebViewGetContents.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewGetContents.mm; sourceTree = "<group>"; }; 2614 2617 DC69AA621CF77C6500C6272F /* ScopedLambda.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScopedLambda.cpp; sourceTree = "<group>"; }; … … 3695 3698 children = ( 3696 3699 0F16BED72304A1D100B4A167 /* composited.html */, 3700 CEDA12402437C9EA00C28A9E /* editable-region-composited-and-non-composited-overlap.html */, 3697 3701 CE6D0EE22426B8ED002AD901 /* insert-text.html */, 3698 3702 0F340777230382540060A1A0 /* overflow-scroll.html */, -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm
r259551 r259762 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 152 152 153 153 // Consider moving this to TestWKWebView if it could be useful to other tests. 154 static void webViewLoadHTMLStringAndWaitFor DOMLoadEvent(TestWKWebView *webView, NSString *htmlString)154 static void webViewLoadHTMLStringAndWaitForAllFramesToPaint(TestWKWebView *webView, NSString *htmlString) 155 155 { 156 156 ASSERT(webView); // Make passing a nil web view a more obvious failure than a hang. … … 159 159 [webView loadHTMLString:htmlString baseURL:nil]; 160 160 TestWebKitAPI::Util::run(&didFireDOMLoadEvent); 161 [webView waitForNextPresentationUpdate]; 161 162 } 162 163 … … 168 169 NSArray<_WKTextInputContext *> *contexts; 169 170 170 webViewLoadHTMLStringAndWaitFor DOMLoadEvent(webView.get(), applyIframe(@"<input type='text' style='width: 50px; height: 50px;'>"));171 webViewLoadHTMLStringAndWaitForAllFramesToPaint(webView.get(), applyIframe(@"<input type='text' style='width: 50px; height: 50px;'>")); 171 172 contexts = [webView synchronouslyRequestTextInputContextsInRect:[webView bounds]]; 172 173 EXPECT_EQ(1UL, contexts.count); 173 174 EXPECT_EQ(CGRectMake(0, 200, 50, 50), contexts[0].boundingRect); 174 175 175 webViewLoadHTMLStringAndWaitFor DOMLoadEvent(webView.get(), applyIframe(@"<textarea style='width: 100px; height: 100px;'></textarea>"));176 webViewLoadHTMLStringAndWaitForAllFramesToPaint(webView.get(), applyIframe(@"<textarea style='width: 100px; height: 100px;'></textarea>")); 176 177 contexts = [webView synchronouslyRequestTextInputContextsInRect:[webView bounds]]; 177 178 EXPECT_EQ(1UL, contexts.count); 178 179 EXPECT_EQ(CGRectMake(0, 200, 100, 100), contexts[0].boundingRect); 179 180 180 webViewLoadHTMLStringAndWaitFor DOMLoadEvent(webView.get(), applyIframe(@"<div contenteditable style='width: 100px; height: 100px;'></div>"));181 webViewLoadHTMLStringAndWaitForAllFramesToPaint(webView.get(), applyIframe(@"<div contenteditable style='width: 100px; height: 100px;'></div>")); 181 182 contexts = [webView synchronouslyRequestTextInputContextsInRect:[webView bounds]]; 182 183 EXPECT_EQ(1UL, contexts.count); 183 184 EXPECT_EQ(CGRectMake(0, 200, 100, 100), contexts[0].boundingRect); 185 } 186 187 static CGRect squareCenteredAtPoint(float x, float y, float length) 188 { 189 return CGRectMake(x - length / 2, y - length / 2, length, length); 190 } 191 192 TEST(RequestTextInputContext, NonCompositedOverlap) 193 { 194 RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 195 RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 196 197 NSArray<_WKTextInputContext *> *contexts; 198 199 [webView synchronouslyLoadTestPageNamed:@"editable-region-composited-and-non-composited-overlap"]; 200 201 // Search rect fully contained in non-composited <div>. 202 contexts = [webView synchronouslyRequestTextInputContextsInRect:CGRectMake(270, 150, 10, 10)]; 203 EXPECT_EQ(0UL, contexts.count); 204 contexts = [webView synchronouslyRequestTextInputContextsInRect:CGRectMake(170, 150, 10, 10)]; 205 EXPECT_EQ(0UL, contexts.count); 206 207 // Search rect overlaps both the non-composited <div> and the editable element. 208 contexts = [webView synchronouslyRequestTextInputContextsInRect:squareCenteredAtPoint(270, 150, 200)]; 209 EXPECT_EQ(1UL, contexts.count); 210 } 211 212 TEST(RequestTextInputContext, CompositedOverlap) 213 { 214 RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 215 RetainPtr<TestWKWebView> webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); 216 217 NSArray<_WKTextInputContext *> *contexts; 218 219 [webView synchronouslyLoadTestPageNamed:@"editable-region-composited-and-non-composited-overlap"]; 220 221 // Search rect fully contained in composited <div>. 222 contexts = [webView synchronouslyRequestTextInputContextsInRect:CGRectMake(270, 400, 10, 10)]; 223 EXPECT_EQ(0UL, contexts.count); 224 contexts = [webView synchronouslyRequestTextInputContextsInRect:CGRectMake(170, 400, 10, 10)]; 225 EXPECT_EQ(0UL, contexts.count); 226 227 // Search rect overlaps both the composited <div> and the editable element. 228 contexts = [webView synchronouslyRequestTextInputContextsInRect:squareCenteredAtPoint(270, 400, 200)]; 229 EXPECT_EQ(1UL, contexts.count); 184 230 } 185 231 -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h
r259669 r259762 143 143 void installTapGestureOnWindow(JSValueRef) override; 144 144 145 bool mayContainEditableElementsInRect(unsigned x, unsigned y, unsigned width, unsigned height) override; 146 145 147 void setDidStartFormControlInteractionCallback(JSValueRef) override; 146 148 void setDidEndFormControlInteractionCallback(JSValueRef) override; -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
r259669 r259762 837 837 } 838 838 839 bool UIScriptControllerIOS::mayContainEditableElementsInRect(unsigned x, unsigned y, unsigned width, unsigned height) 840 { 841 return [webView() _mayContainEditableElementsInRect:CGRectMake(x, y, width, height)]; 842 } 843 839 844 static UIDeviceOrientation toUIDeviceOrientation(DeviceOrientation* orientation) 840 845 {
Note:
See TracChangeset
for help on using the changeset viewer.