[wpe-webkit] Smooth Scroll option not working

Carlos Alberto Lopez Perez clopez at igalia.com
Fri Feb 21 05:23:44 PST 2020


On 20/02/2020 12:41, Mohan Reddy wrote:
> Hi ,
> 
> I want to use *scroll-behavior: smooth css * option in my app  , For this I
> used wpewebkit-2.27.90 version  and enabled *ENABLE_SMOOTH_SCROLLING*
>  option.
> After enabling ENABLE_SMOOTH_SCROLLING I faced some compilation issues and
> I fixed all the compilation errors but still I am not able to see smooth
> scrolling effect.
> 
> Is any one tried smooth scrolling option in latest WPE browser?
> 
> I also tried on latest webkit gtk version  :
> https://stackoverflow.com/questions/60315753/smooth-scroll-option-not-working-in-webkitgtk
> 

As far as i can see, the build option ENABLE_SMOOTH_SCROLLING its
enabled by default for GTK and WPE since a long time, at least 2017 or
before. So I don't understand how you can be having compilation problems
with an option enabled by default so long ago.

On the other hand this feature its guarded by a runtime setting that its
disabled by default so you have to enable it for your app if you want to
use it. The property is enable-smooth-scrolling [1].

And finally, I think ENABLE_SMOOTH_SCROLLING its not what you think it
is. I'm not 100% sure of what ENABLE_SMOOTH_SCROLLING does, but I think
it just enables smooth scrolling in general, in any web site, but only
when you scroll with the mouse the scrollbar, so when scrolling manually
the page looks more "smooth".

In your example, you want to use the CSS property "scroll-behavior",
which is a very different thing. Support for that in WebKit its still
experimental. As far as I can see support for that was just introduced
in [3], and its currently guarded by the runtime setting
CSSOMViewSmoothScrollingEnabled that its not exposed to the glib API, so
currently the only way of enabling it its by patching WebKit. I'm also
unsure if its expected to work as it is marked as experimental.

I may suggest you to use some polyfill or JS to achieve the behaviour
you expect, like https://github.com/cferdinandi/smooth-scroll

Regards


[1]
https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html#WebKitSettings--enable-smooth-scrolling
[2] https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior
[3] https://bugs.webkit.org/show_bug.cgi?id=205009

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 897 bytes
Desc: OpenPGP digital signature
URL: <http://lists.webkit.org/pipermail/webkit-wpe/attachments/20200221/c501a829/attachment.bin>


More information about the webkit-wpe mailing list