Confirmed users
586
edits
Line 27: | Line 27: | ||
* browser.js must ignore viewport-dependent events (including clicks, double-taps, and viewport updates) from java during the period where the browser content document is different from the browser displayed document. Likewise, browser.js must not send any property updates to Java (e.g. resulting from user JS calling scrollTo) during this period. Java may still update its own viewport properties for the compositor's benefit. | * browser.js must ignore viewport-dependent events (including clicks, double-taps, and viewport updates) from java during the period where the browser content document is different from the browser displayed document. Likewise, browser.js must not send any property updates to Java (e.g. resulting from user JS calling scrollTo) during this period. Java may still update its own viewport properties for the compositor's benefit. | ||
* If the viewport size changes, Java must first send a resize notification. browser.js must, upon processing the resize, synchronously notify Java of receiving this event, along with any updated properties (offset, zoom, page size). While processing this event (still on the gecko thread), Java may recalculate properties (offset, zoom, display port margins) and must queue an event back on the gecko thread with the new properties. Drawing must be suppressed between the handling of the initial resize notification and handling of the final property update event. | * If the viewport size changes, Java must first send a resize notification. browser.js must, upon processing the resize, synchronously notify Java of receiving this event, along with any updated properties (offset, zoom, page size). While processing this event (still on the gecko thread), Java may recalculate properties (offset, zoom, display port margins) and must queue an event back on the gecko thread with the new properties. Drawing must be suppressed between the handling of the initial resize notification and handling of the final property update event. | ||
* A display port must always be set on the document element of the document being drawn. The display port is owned by Java, and must be updated whenever it becomes aware that the JS offset or zoom has changed. This includes scenarios such as: (1) when Java sends a viewport update to JS as a result of user performing pan/zoom actions; (2) in response to the synchronous event from browser.js informing Java of a offset/zoom/page size change; (3) when Java is notified by the compositor of a change in the displayed document. | |||
== Implementation Assertions == | == Implementation Assertions == | ||
* The firstPaint flag on the presShell is set by browser.js if and only if the next draw will be of a different document than the previous draw was. It is cleared as close to the composition of that draw as possible. | * The firstPaint flag on the presShell is set by browser.js if and only if the next draw will be of a different document than the previous draw was. It is cleared as close to the composition of that draw as possible. | ||
== Gotchas == | == Gotchas == | ||
Line 36: | Line 36: | ||
=== Paint suppression === | === Paint suppression === | ||
Paint suppression in Gecko works sort of like this: when a new page is loaded, paints on it are suppressed for some time. The start and end of this suppression period are not well defined; the period starts around the time of the first reflow of the document, and ends in either 250ms (or some preffed value) or when some other conditions are hit (like the document reaches the ready state). Also complicating matters is that when paint suppression is enabled on a pres shell, the paint code will simply look for another pres shell to paint. During page load, when the old and new pres shells are still in existence, this results in the old document getting painted during this time. | Paint suppression in Gecko works sort of like this: when a new page is loaded, paints on it are suppressed for some time. The start and end of this suppression period are not well defined; the period starts around the time of the first reflow of the document, and ends in either 250ms (or some preffed value) or when some other conditions are hit (like the document reaches the ready state). Also complicating matters is that when paint suppression is enabled on a pres shell, the paint code will simply look for another pres shell to paint. During page load, when the old and new pres shells are still in existence, this results in the old document getting painted during this time. | ||
=== Display ports === | |||
If no display port is set, then the layer may end up in a non-scrollable state, which can potentially confuse the compositor and interfere with propagating the correct page sizes. Therefore a display port must always be set on the document element of the document being drawn. | |||
== Related bugs for more information == | == Related bugs for more information == |