blackberry / WebWorks

BlackBerry WebWorks for Smartphones is a platform for building deeply integrated web applications for BlackBerry smartphones
http://developer.blackberry.com/html5
268 stars 51 forks source link

Focus Based Navigation Improvements #49

Closed tneil closed 12 years ago

tneil commented 12 years ago

Background

Currently the focus based navigation mode is entirely written in Java. The overall goal of the focus based navigation (known as navMode) is to provide highlight navigation of items via the trackpad for both non-touch and touch based devices.

With the new architecture of the BB6+ devices that use a native WebKit instance, this causes severe performance degradation. On BB6+ devices you see lots of "echoing" when scrolling where the scroll movements will be "re-played".

This is a result of the IPC channel between Java and Native when interacting with the DOM of the page in the browser. All DOM calculations and event raising currently happens in Java which turns into synchronous IPC calls to the Native WebKit browser. This IPC channel creates a delay thus causing the echo.

Goal

We want to move this logic from Java down into JavaScript where it performs much better. The only touch points with Java should be events that are raised from the Trackpad down into asynchronous "scroll" events in the JavaScript thread. All touch points with the DOM need to be in JavaScript.

All functionality of navMode is intended to be kept except for those items explicitly called out in the "Limitations" section.

Limitations

The implementation in Java has a unique ability to raise "pseudo classes" in CSS by triggering the CSS hover for a DOM element. When moving the logic to JavaScript this functionality will be lost.

All styling of DOM elements to indicate that they are focused/unfocused must be done through style changes triggered by mouseover and mouseout events on the DOM element.

This is somewhat less convenient than using :hover pseudo classes because of their simplicity and cascading nature.

This also means that the default hover CSS effect (draw blue outline around DOM element) will also not be supported in the re-write

On BB5 CSS hover event perform better than mouse events through JavaScript. To attain the desired performance on BB6+ devices, some performance on BB5 will be sacrificed.

Challenges

There may be some occasions where we are not able to trigger certain events from JavaScript to produce the desired result.

One such example would be clicking on a <select> box and having it pop open for the user to interact with. This may need to be handled by actually trapping this click and providing a UI for the user to then select the item. Same goes for other UI controls such as date edits.

This will all be uncovered as we do the work and work through the issues with their possible solutions.

Stretch Goals

There were some aspects of navMode that were not possible with the Java implementation. One of these was the ability to handle scrollable div's and scroll content within the div. We are hopeful that we can also tackle this as a stretch goal for the improvements.

kwallis commented 12 years ago

Main items pulled in. Stretch Goals are not in scope for this release.

darioalessandro commented 12 years ago

Hi guys:

When are you planning to push this fix to the repository?

regards.

kwallis commented 12 years ago

Hi Dario. The changes are in our working repository here: http://github.com/blackberry-webworks/WebWorks/commit/ed8a08f6bd945b5886a65 82281bf5dcee83cc18d

It will be picked up in the WebWorks for Smartphone v2.3 coming very soon.

Ken Wallis Manager ­ BlackBerry WebWorks

Research In Motion (905) 629-4746 x14369

-----Original Message----- From: Dario Lencina <reply+i-1496302-6161e0436b1fd7219704a3e8fe67676fe24a6518-498318@reply.gith ub.com> Date: Thu, 5 Jan 2012 14:39:28 -0800 To: Ken Wallis kwallis@rim.com Subject: Re: [WebWorks] Focus Based Navigation Improvements (#49)

Hi guys:

When are you planning to push this fix to the repository?

regards.


Reply to this email directly or view it on GitHub: https://github.com/blackberry/WebWorks/issues/49#issuecomment-3377647


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

darioalessandro commented 12 years ago

Thank you very much!

Keep up the great work.