Changeset 229212 in webkit


Ignore:
Timestamp:
Mar 5, 2018 12:33:58 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

Automation: clicking on a disabled option element shouldn't produce an error
https://bugs.webkit.org/show_bug.cgi?id=183284

Reviewed by Brian Burg.

This was expected by selenium, but the WebDriver spec says we should simply do nothing in those cases.

14.1 Element Click.
https://w3c.github.io/webdriver/webdriver-spec.html#element-click

Fixes: imported/w3c/webdriver/tests/element_click/select.py::test_option_disabled

  • WebProcess/Automation/WebAutomationSessionProxy.cpp:

(WebKit::WebAutomationSessionProxy::selectOptionElement):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r229210 r229212  
     12018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Automation: clicking on a disabled option element shouldn't produce an error
     4        https://bugs.webkit.org/show_bug.cgi?id=183284
     5
     6        Reviewed by Brian Burg.
     7
     8        This was expected by selenium, but the WebDriver spec says we should simply do nothing in those cases.
     9
     10        14.1 Element Click.
     11        https://w3c.github.io/webdriver/webdriver-spec.html#element-click
     12
     13        Fixes: imported/w3c/webdriver/tests/element_click/select.py::test_option_disabled
     14
     15        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
     16        (WebKit::WebAutomationSessionProxy::selectOptionElement):
     17
    1182018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp

    r229206 r229212  
    654654    }
    655655
    656     if (selectElement->isDisabledFormControl() || optionElement.isDisabledFormControl()) {
    657         String elementNotSelectableErrorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::ElementNotSelectable);
    658         WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidSelectOptionElement(callbackID, elementNotSelectableErrorType), 0);
    659         return;
    660     }
    661 
    662     // FIXME: According to the spec we should fire mouse over, move and down events, then input and change, and finally mouse up and click.
    663     // optionSelectedByUser() will fire input and change events if needed, but all other events should be fired manually here.
    664     selectElement->optionSelectedByUser(optionElement.index(), true, selectElement->multiple());
     656    if (!selectElement->isDisabledFormControl() && !optionElement.isDisabledFormControl()) {
     657        // FIXME: According to the spec we should fire mouse over, move and down events, then input and change, and finally mouse up and click.
     658        // optionSelectedByUser() will fire input and change events if needed, but all other events should be fired manually here.
     659        selectElement->optionSelectedByUser(optionElement.index(), true, selectElement->multiple());
     660    }
    665661    WebProcess::singleton().parentProcessConnection()->send(Messages::WebAutomationSession::DidSelectOptionElement(callbackID, { }), 0);
    666662}
Note: See TracChangeset for help on using the changeset viewer.