[ChromeDriver] Update sendKeysToElement focus behavior when targeting contenteditable element.
This change updates chromedriver to call focus.js if the element is a non-text element. This is specifically to fix some cases where browser based text editors use <body contenteditable=true> to create a text area of sorts. Before this change, but after https://crrev.com/674640, we were not resetting focus to the body element as it was considered already focused. This results in sendkeys being lost. We now call focus on any non-text elements, which still abides by the W3C SendKeys spec change incoming https://github.com/w3c/webdriver/issues/1430 as carat preservation behavior is only specified for text-type inputs. Additionally, this change also updates focus.js javascript to not move carat after a focus. Which was erroneously not updated in https://crrev.com/674640 Bug: chromedriver:3006 Change-Id: Ie4d4bab3eb45aec64a586cbfa786968601a06189 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1700475 Commit-Queue: Stanley Hon <stahon@microsoft.com> Reviewed-by:John Chen <johnchen@chromium.org> Cr-Commit-Position: refs/heads/master@{#678908}
Showing
Please register or sign in to comment