RESOLVED FIXED 84571
[BlackBerry] Input Range element expects mouse events
https://bugs.webkit.org/show_bug.cgi?id=84571
Summary [BlackBerry] Input Range element expects mouse events
Charles Wei
Reported 2012-04-23 00:35:01 PDT
Some shadow elements expects the mouse events to operate on them to change their state/value, like SliderThumbElement, MediaControlTimelineElement. If we don't convert touch events to mouse events for them, then they won't work when touch and move on them.
Attachments
Patch (3.59 KB, patch)
2012-04-23 00:42 PDT, Charles Wei
no flags
Patch (5.17 KB, patch)
2012-04-24 07:36 PDT, Charles Wei
no flags
Patch (5.16 KB, patch)
2012-04-24 07:59 PDT, Charles Wei
no flags
Patch (3.60 KB, patch)
2012-04-25 03:36 PDT, Charles Wei
no flags
Charles Wei
Comment 1 2012-04-23 00:42:54 PDT
Antonio Gomes
Comment 2 2012-04-23 07:16:59 PDT
Comment on attachment 138303 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=138303&action=review It needs more info, and perhaps more discussion, I think. > Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp:78 > - while (element->isInShadowTree()) > - element = toElement(element->shadowAncestorNode()); > + if (element->isInShadowTree()) > + return true; could you explain what does this patch fix, charles?
Antonio Gomes
Comment 3 2012-04-23 07:30:06 PDT
Comment on attachment 138303 [details] Patch Ok, I think I understood the problem. Lets discuss on IRC a different approach
Charles Wei
Comment 4 2012-04-24 07:36:34 PDT
Antonio Gomes
Comment 5 2012-04-24 07:40:44 PDT
Comment on attachment 138559 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=138559&action=review > Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp:79 > +static bool isRangeControlElement(Element* element) > +{ > + if (element->hasTagName(HTMLNames::inputTag)) { > + HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element); > + if (inputElement->isRangeControl()) > + return true; > + } > + return false; > +} lets write this as static bool isRangeControlElement(Element* elemenet) { assert(element); if (!element->hastagname(htmlnames::inputtag)) return; htmlinputelement inputelement = static_cast<htmlinputelement*>(element); return inputelement->israngecontrol(); } note the assert and the early return.
Charles Wei
Comment 6 2012-04-24 07:59:36 PDT
Charles Wei
Comment 7 2012-04-24 08:01:27 PDT
Comment on attachment 138562 [details] Patch Addressed the comments from the reviewer and commit it.
Antonio Gomes
Comment 8 2012-04-24 08:07:04 PDT
Comment on attachment 138562 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=138562&action=review > Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp:93 > - // Make sure we are not operating a shadow node here, since the webpages > - // aren't able to attach event listeners to shadow content. > + // If the shadow tree contains a Range Control, like the MediaControlTimeline, > + // MediaContolVolumeElement, etc, they expect natual elements. Otherwise, we > + // won't operate on the shadow node, because the webpages aren't able to attach > + // listeners to shadow content. > ASSERT(element); > - while (element->isInShadowTree()) > + while (element->isInShadowTree()) { > element = toElement(element->shadowAncestorNode()); > - > + > + if (isRangeControlElement(element)) > + return true; > + } maybe we should do a do-while here instead? so we test the original 'element'? also, maybe we could move the block above to shouldConvertTouchToMouse enterily
Antonio Gomes
Comment 9 2012-04-24 08:26:01 PDT
Comment on attachment 138562 [details] Patch ok, we can clean up as a follow up.
WebKit Review Bot
Comment 10 2012-04-24 08:57:43 PDT
Comment on attachment 138562 [details] Patch Clearing flags on attachment: 138562 Committed r115065: <http://trac.webkit.org/changeset/115065>
WebKit Review Bot
Comment 11 2012-04-24 08:57:48 PDT
All reviewed patches have been landed. Closing bug.
Antonio Gomes
Comment 12 2012-04-24 10:23:43 PDT
reopening for cleaning things up further. see comment #8
Charles Wei
Comment 13 2012-04-25 03:36:20 PDT
WebKit Review Bot
Comment 14 2012-04-25 19:01:56 PDT
Comment on attachment 138774 [details] Patch Clearing flags on attachment: 138774 Committed r115280: <http://trac.webkit.org/changeset/115280>
WebKit Review Bot
Comment 15 2012-04-25 19:02:02 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.