Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r220740 - WebDriver: handle click events on option elements
https://bugs.webkit.org/show_bug.cgi?id=174710 <rdar://problem/33459305> Reviewed by Brian Burg. Source/WebCore: Export WebCore symbols required by WebKit layer. * html/HTMLOptGroupElement.h: * html/HTMLOptionElement.h: Source/WebDriver: Option elements are considered as a special case by the specification. When clicking an option element, we should get its container and use it when scrolling into view and calculating in-view center point instead of the option element itself. Then, we should not emulate a click, but change the selected status of the option element like if it were done by a user action, firing the corresponding events. Now we check whether the element is an option to call selectOptionElement() or performMouseInteraction(). This fixes more than 20 selenium tests. * CommandResult.cpp: (WebDriver::CommandResult::CommandResult): Handle ElementNotSelectable protocol error. (WebDriver::CommandResult::httpStatusCode const): Add ElementNotSelectable. (WebDriver::CommandResult::errorString const): Ditto. * CommandResult.h: * Session.cpp: (WebDriver::Session::selectOptionElement): Ask automation to select the given option element. (WebDriver::Session::elementClick): Call selectOptionElement() or performMouseInteraction() depending on whether the element is an option or not. * Session.h: Source/WebKit: Add selectOptionElement method to automation to select an option element according to the WebDriver specification. 14.1 Element Click. https://w3c.github.io/webdriver/webdriver-spec.html#element-click * UIProcess/Automation/Automation.json: Add selectOptionElement method and ElementNotSelectable error. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::selectOptionElement):Send SelectOptionElement message to the web process. (WebKit::WebAutomationSession::didSelectOptionElement): Notify the driver. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/WebAutomationSession.messages.in: Add DidSelectOptionElement message. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::elementContainer): Helper to get the container of an element according to the spec. (WebKit::WebAutomationSessionProxy::computeElementLayout): Use the container element to scroll the view and compute the in-view center point. (WebKit::WebAutomationSessionProxy::selectOptionElement): Use HTMLSelectElement::optionSelectedByUser(). * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SelectOptionElement message.
- Loading branch information
1 parent
2e5393d
commit 6d450d1
Showing
16 changed files
with
257 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.