WebKit Bugzilla
Attachment 358641 Details for
Bug 193259
: Editable images sometimes don't become focused when tapped
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193259-20190108150421.patch (text/plain), 2.98 KB, created by
Tim Horton
on 2019-01-08 15:04:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2019-01-08 15:04:22 PST
Size:
2.98 KB
patch
obsolete
>Subversion Revision: 239676 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3b718d102b27c05fb479747b9368f58f924e93e2..3946ea5eb2adf0a9884f5c530490e3b5aa02f33f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-01-08 Tim Horton <timothy_horton@apple.com> >+ >+ Editable images sometimes don't become focused when tapped >+ https://bugs.webkit.org/show_bug.cgi?id=193259 >+ <rdar://problem/47038424> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Often when tapping an editable image inside an editable text area, the >+ text area's selection will change instead of focusing the editable image. >+ >+ No new tests; I have had no luck writing a test that reliably failed >+ beforehand (the "sometimes" is a problem). >+ >+ * html/HTMLImageElement.cpp: >+ (WebCore::HTMLImageElement::defaultEventHandler): >+ * html/HTMLImageElement.h: >+ Override mousedown on editable images, focus the image, and prevent >+ the default behavior. >+ > 2019-01-07 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes. >diff --git a/Source/WebCore/html/HTMLImageElement.cpp b/Source/WebCore/html/HTMLImageElement.cpp >index 7fb2713ad5810c21d9a018276c7caa63c31d4ed8..2e728aee61a226da17a50533ccb68d6689eb5f4c 100644 >--- a/Source/WebCore/html/HTMLImageElement.cpp >+++ b/Source/WebCore/html/HTMLImageElement.cpp >@@ -31,6 +31,7 @@ > #include "EditableImageReference.h" > #include "Editor.h" > #include "ElementIterator.h" >+#include "EventNames.h" > #include "FrameView.h" > #include "HTMLAnchorElement.h" > #include "HTMLAttachmentElement.h" >@@ -46,6 +47,7 @@ > #include "MediaList.h" > #include "MediaQueryEvaluator.h" > #include "NodeTraversal.h" >+#include "PlatformMouseEvent.h" > #include "RenderImage.h" > #include "RenderView.h" > #include "RuntimeEnabledFeatures.h" >@@ -839,4 +841,14 @@ void HTMLImageElement::copyNonAttributePropertiesFromElement(const Element& sour > Element::copyNonAttributePropertiesFromElement(source); > } > >+void HTMLImageElement::defaultEventHandler(Event& event) >+{ >+ if (hasEditableImageAttribute() && event.type() == eventNames().mousedownEvent && is<MouseEvent>(event) && downcast<MouseEvent>(event).button() == LeftButton) { >+ focus(); >+ event.setDefaultHandled(); >+ return; >+ } >+ HTMLElement::defaultEventHandler(event); >+} >+ > } >diff --git a/Source/WebCore/html/HTMLImageElement.h b/Source/WebCore/html/HTMLImageElement.h >index ad6aa9387e4494036b56ca9be5424b937a22488e..8995cbf370e177da61c53ddb15e20925578b457c 100644 >--- a/Source/WebCore/html/HTMLImageElement.h >+++ b/Source/WebCore/html/HTMLImageElement.h >@@ -121,6 +121,8 @@ public: > WEBCORE_EXPORT GraphicsLayer::EmbeddedViewID editableImageViewID() const; > WEBCORE_EXPORT bool hasEditableImageAttribute() const; > >+ void defaultEventHandler(Event&) final; >+ > protected: > HTMLImageElement(const QualifiedName&, Document&, HTMLFormElement* = 0); >
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193259
: 358641