[Webkit-unassigned] [Bug 48450] [Qt] Extend the Platform Plugin to define the padding of HitTestResult
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Nov 2 16:28:41 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=48450
Kenneth Rohde Christiansen <kenneth at webkit.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #72761|1 |0
is obsolete| |
--- Comment #16 from Kenneth Rohde Christiansen <kenneth at webkit.org> 2010-11-02 16:28:40 PST ---
(From update of attachment 72761)
View in context: https://bugs.webkit.org/attachment.cgi?id=72761&action=review
> WebKit/qt/examples/platformplugin/WebPlugin.cpp:226
> +unsigned TouchInteraction::hitTestPaddingForTouch(const PaddingDirection direction) const
> +{
> + switch (direction) {
> + case Down:
> + return bottomPadding;
> + case Left:
> + return leftPadding;
> + case Right:
> + return rightPadding;
> + case Up:
> + return topPadding;
> + default:
> + Q_ASSERT(0);
> + return 0;
> + }
> +}
I don't understand why you make such a complicated example, but well :-) I would just have done
return 10; // Use 10 as padding in each direction.
> WebKit/qt/examples/platformplugin/WebPlugin.h:102
> +{
> + Q_OBJECT
> +public:
> + TouchInteraction()
> + : bottomPadding(10)
> + , leftPadding(10)
> + , rightPadding(10)
> + , topPadding(10)
> + {}
> +
> + unsigned hitTestPaddingForTouch(const PaddingDirection) const;
> +
> +private:
> + unsigned bottomPadding;
> + unsigned leftPadding;
> + unsigned rightPadding;
> + unsigned topPadding;
This seems a bit overengineered... in real life you mostly want the same padding in each direction, but maybe a bit more padding in the top, but that could easily be implemented just in the histTestPaddingForTouch method
like
if (direction == PaddingDirection::Up)
return 15;
return 8;
or similar.
> WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h:123
> + Touch
Is Touch a good name here... maybe TouchInteraction ? I'm just thinking out loud... maybe others have comments.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list