Project

General

Profile

Bug #6014

Oscillation in Chrome at various zoom levels with layouts (WPaintedWidget w/Areas)

Added by Bruce Toll almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
10/17/2017
Due date:
% Done:

0%

Estimated time:

Description

With github Wt 4.0.0-17-g2f671efb, there are edge cases in which a layout containing a WPaintedWidget with an area map can oscillate between two heights at some combinations of window size and zoom-level using the chrome or chromium browsers. Similarly, an oscillation can be observed with a WCartesianChart that uses tooltips (other than deferred or XHTML).

Attached, are test programs that drive the issue for WPaintedWidget and WCartesianChart, respectively. The test programs have minor differences that may make them useful in verifying a bug fix. Testing was done with Windows 7 Chrome 61.0.3163.100, and Debian Stretch Chromium 61.0.3163.100. The programs are both sensitive to window geometry (height), so it may take some experimentation to get them to oscillate in different environments. The test programs open a window and suggest a starting zoom-level that oscillates in my test environment.

I believe the underlying issue is probably related to rounding of fractional pixel widths in StdGridLayoutImpl2.js. In any case, successive calls to Wt.layouts2.adjust set slightly different height values. This can be verified by stopping the server when the oscillation is occurring and looking at the most recent Wt.layout2.adjust calls sent by the server. Repeating these in the console will toggle between two heights.

To get the oscillation behavior, there still needs to be some sort of feedback loop. In the case of WPaintedWidget with areas, it is the update to the areas. I have attached a third file with a patch that crudely disables the update to the areas (which may not be necessary?) and that seems to prevent the oscillation in this case; it is intended for testing.

A better fix would probably address the instability in StdGridLayoutImpl2.js. It might also be worth considering some sort of cycle detection on resizes, either on the client or on the server. A throttle on resize events might also be helpful in reducing server/bandwidth load in normal usage and as a further defense against an unintended feedback loop. I'm happy to help out with testing (or a patch, if you provide some direction).

NOTE: I did not observe oscillations with other browsers that I tested, including recent W7 Firefox and IE11. However, there is a somewhat related issue with Chrome oscillations in WTableView that I plan to report separately.


Files

No data to display

Also available in: Atom PDF