Changeset 240122 in webkit


Ignore:
Timestamp:
Jan 17, 2019 11:34:29 AM (5 years ago)
Author:
jiewen_tan@apple.com
Message:

[Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable
https://bugs.webkit.org/show_bug.cgi?id=193478
<rdar://problem/34368591>

Reviewed by Brent Fulgham.

By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention
as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This
is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only
website that assumes submit buttons are focusable, and will prohibit users from completing immigration
forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to
HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable.

This quirk is for ceac.state.gov specifically, and therefore no tests.

  • html/HTMLFormControlElement.cpp:

(WebCore::HTMLFormControlElement::isMouseFocusable const):
(WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const):

  • html/HTMLFormControlElement.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r240121 r240122  
     12019-01-17  Jiewen Tan  <jiewen_tan@apple.com>
     2
     3        [Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable
     4        https://bugs.webkit.org/show_bug.cgi?id=193478
     5        <rdar://problem/34368591>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention
     10        as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This
     11        is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only
     12        website that assumes submit buttons are focusable, and will prohibit users from completing immigration
     13        forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to
     14        HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable.
     15
     16        This quirk is for ceac.state.gov specifically, and therefore no tests.
     17
     18        * html/HTMLFormControlElement.cpp:
     19        (WebCore::HTMLFormControlElement::isMouseFocusable const):
     20        (WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const):
     21        * html/HTMLFormControlElement.h:
     22
    1232019-01-17  Alex Christensen  <achristensen@webkit.org>
    224
  • trunk/Source/WebCore/html/HTMLFormControlElement.cpp

    r238038 r240122  
    4141#include "RenderBox.h"
    4242#include "RenderTheme.h"
     43#include "Settings.h"
    4344#include "StyleTreeResolver.h"
    4445#include "ValidationMessage.h"
     
    373374    return HTMLElement::isMouseFocusable();
    374375#else
     376    if (needsMouseFocusableQuirk())
     377        return HTMLElement::isMouseFocusable();
    375378    return false;
    376379#endif
     
    656659}
    657660
     661// FIXME: We should remove the quirk once <rdar://problem/47334655> is fixed.
     662bool HTMLFormControlElement::needsMouseFocusableQuirk() const
     663{
     664#if PLATFORM(MAC)
     665    if (!document().settings().needsSiteSpecificQuirks())
     666        return false;
     667
     668    auto host = document().url().host();
     669    return equalLettersIgnoringASCIICase(host, "ceac.state.gov") || host.endsWithIgnoringASCIICase(".ceac.state.gov");
     670#else
     671    return false;
     672#endif
     673}
     674
    658675} // namespace Webcore
  • trunk/Source/WebCore/html/HTMLFormControlElement.h

    r232335 r240122  
    178178    HTMLFormControlElement* asFormNamedItem() final { return this; }
    179179
     180    bool needsMouseFocusableQuirk() const;
     181
    180182    std::unique_ptr<ValidationMessage> m_validationMessage;
    181183    unsigned m_disabled : 1;
Note: See TracChangeset for help on using the changeset viewer.