Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 55
Registered: ‎09-05-2013
My Device: Z10
Accepted Solution

WebView vs Native Browser

Hello, 

I am testing Cascades WebView and I noticed that its scrolling and zooming performance is not as good as the native BlackBerry browser (which I guess is written in Cascades). The problem is that the native browser disable the page rendering (backing store I guess) when the scrolling is started and enable when stopped. Now, how can I have the same perfomance with Cascades WebView? Is there any way to control the rendering of Webview?

Developer
Posts: 932
Registered: ‎03-20-2013
My Device: Red LE Developer Z10

Re: WebView vs Native Browser

I can't answer the main part of your question, but I can tell you with certainty (based on comments here by BlackBerry employees) that the BlackBerry Browser is written in HTML5.



Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
New Developer
Posts: 55
Registered: ‎09-05-2013
My Device: Z10

Re: WebView vs Native Browser

I didn't know that,this means that the native browser uses a dfferent web engine( altough if you you go to html5test.com, you get the same score with Cascades Webview ).Do you know if the native browser is based on WebKit2?

Developer
Posts: 932
Registered: ‎03-20-2013
My Device: Red LE Developer Z10

Re: WebView vs Native Browser

Don't confuse the UI with the renderer. AFAIK both the BlackBerry Browser and WebView use the same WebKit renderer (sorry, I don't know which version). It is the UI of the BB Browser (which would include scrolling behaviour) that is built with HTML5.



Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
New Developer
Posts: 55
Registered: ‎09-05-2013
My Device: Z10

Re: WebView vs Native Browser

[ Edited ]

Sorry, I forgot to say that if you do a sunspider javascript test with the browser and webview, you get different results (the browser is faster), that is why I think the engine is different.

Developer
Posts: 932
Registered: ‎03-20-2013
My Device: Red LE Developer Z10

Re: WebView vs Native Browser

That is very possible. Although I pointed out in my last post that the renderer and UI in a browser are not the same thing, in fact there are three distinct parts to a browser that are often assumed to be one and the same... the renderer, the UI, and the JavaScript engine. Any one of the three can be modified without affecting the other two.

 

It is possible that BlackBerry has been tweaking the JavaScript engine in the BB Browser app for better performance since the original BB10 release, while leaving the one in WebView untouched to avoid breaking third-party apps. Remember that there is code in the WebView JavaScript engine to allow native code to interact with it, and this probably doesn't exist in the full browser engine, so I would expect the two engines to be at least slightly different.



Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
New Developer
Posts: 55
Registered: ‎09-05-2013
My Device: Z10

Re: WebView vs Native Browser

Thank you for clarifying the situation, probably it's like you said, but then it's impossible to reach the browser performance with Cascades Webview since we don't have access to its source code, am I right?

Developer
Posts: 932
Registered: ‎03-20-2013
My Device: Red LE Developer Z10

Re: WebView vs Native Browser

Yes, that would be a fair assessment. There are some known differences between the two renderers. For instance, WebView just ignores "anchor hashes" on the tail of a URL, whereas the BB Browser jumps to the anchor as it should. To make WebView treat anchor hashes properly you have to execute additional code after the page has finished loading. For this reason I think it is fair to say the although they are both based on WebKit, the two are definitely not identical.

 

If you feel you got a useful answer to your question, please remember to accept one of your or my posts as the solution.

 

Cheers.



Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
Developer
Posts: 932
Registered: ‎03-20-2013
My Device: Red LE Developer Z10

Re: WebView vs Native Browser

One thing that occurred to me after my last post is that if you really need control over your renderer there is nothing stopping anyone from download WebKit source code and compiling it for BB10. I don't think anyone is doing this since WebView is pretty powerful, despite its shortcomings, but it should be possible, and then you can tweak it for performance to your heart's content.



Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.
New Developer
Posts: 55
Registered: ‎09-05-2013
My Device: Z10

Re: WebView vs Native Browser

I was thinking about that too (qtwebkit) , but would be the app be accepted in the BB World then?