WebKit Bugzilla
Attachment 368760 Details for
Bug 197488
: Disable software keyboard for a math field textarea on desmos.com
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes the bug
bug-197488-20190501214619.patch (text/plain), 3.46 KB, created by
Ryosuke Niwa
on 2019-05-01 21:46:20 PDT
(
hide
)
Description:
Fixes the bug
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2019-05-01 21:46:20 PDT
Size:
3.46 KB
patch
obsolete
>Subversion Revision: 244819 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c8378ad3b8819ea6723d401d2e01babcfa6da141..0b3ce0271ec36b9483d92e816a6657766ceeed8a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-05-01 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Disable software keyboard for a math field textarea on desmos.com >+ https://bugs.webkit.org/show_bug.cgi?id=197488 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Treat a textarea inside a math field span as if it had inputmode content attribute set to none to suppress >+ the software keyboard on desmos.com as it interferes with website's own UI. >+ >+ * html/HTMLElement.cpp: >+ (WebCore::HTMLElement::canonicalInputMode const): >+ * page/Quirks.cpp: >+ (WebCore::Quirks::needsInputModeNoneImplicitly const): >+ * page/Quirks.h: >+ > 2019-04-30 Ryosuke Niwa <rniwa@webkit.org> > > [iOS] Element::focus and Element::scrollIntoView do not clamp scroll positions >diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp >index 6163c3c1d5e91a436bdc0c0c2b280dff8a08e6fb..e3ee808cf3ee0d1ee1ecf0f7723e66220cc1e163 100644 >--- a/Source/WebCore/html/HTMLElement.cpp >+++ b/Source/WebCore/html/HTMLElement.cpp >@@ -1108,7 +1108,12 @@ void HTMLElement::setAutocorrect(bool autocorrect) > > InputMode HTMLElement::canonicalInputMode() const > { >- return inputModeForAttributeValue(attributeWithoutSynchronization(inputmodeAttr)); >+ auto mode = inputModeForAttributeValue(attributeWithoutSynchronization(inputmodeAttr)); >+ if (mode == InputMode::Unspecified) { >+ if (document().quirks().needsInputModeNoneImplicitly(*this)) >+ return InputMode::None; >+ } >+ return mode; > } > > const AtomicString& HTMLElement::inputMode() const >diff --git a/Source/WebCore/page/Quirks.cpp b/Source/WebCore/page/Quirks.cpp >index 57c0546dfdd4b2eddeb81eb92440467c8fa3ab71..b4c7466bcc4ecd9b0bf6664f5fc49293634b7f74 100644 >--- a/Source/WebCore/page/Quirks.cpp >+++ b/Source/WebCore/page/Quirks.cpp >@@ -265,4 +265,24 @@ bool Quirks::shouldDisablePointerEventsQuirk() const > return false; > } > >+bool Quirks::needsInputModeNoneImplicitly(const HTMLElement& element) const >+{ >+#if PLATFORM(IOS_FAMILY) >+ if (!needsQuirks()) >+ return false; >+ >+ if (!element.hasTagName(HTMLNames::textareaTag)) >+ return false; >+ >+ auto& url = m_document->url(); >+ auto host = url.host(); >+ if (!host.endsWithIgnoringASCIICase(".desmos.com")) >+ return false; >+ >+ return element.parentElement() && element.parentElement()->classNames().contains("dcg-mq-textarea"); >+#else >+ return false; >+#endif >+} >+ > } >diff --git a/Source/WebCore/page/Quirks.h b/Source/WebCore/page/Quirks.h >index 6fb60a03caede84e68d115a68a372539a98f5b8e..a9771f9b8a87422e9f6d61a84dfa18f1fcd220e1 100644 >--- a/Source/WebCore/page/Quirks.h >+++ b/Source/WebCore/page/Quirks.h >@@ -30,6 +30,7 @@ > namespace WebCore { > > class Document; >+class HTMLElement; > > class Quirks { > WTF_MAKE_NONCOPYABLE(Quirks); WTF_MAKE_FAST_ALLOCATED; >@@ -47,6 +48,7 @@ public: > bool hasWebSQLSupportQuirk() const; > bool shouldDispatchSimulatedMouseEvents() const; > bool shouldDisablePointerEventsQuirk() const; >+ bool needsInputModeNoneImplicitly(const HTMLElement&) const; > > WEBCORE_EXPORT bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const; > WEBCORE_EXPORT bool isTouchBarUpdateSupressedForHiddenContentEditable() const;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
wenson_hsieh
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197488
: 368760 |
368794