Fix to LayoutManager size calculations during transform. (#12138)
* Fix to LayoutManager size calculations during transform.
- ComputedStyle is slower but more reliable than using
getBoundingClientRect, which does not work as expected if a transform
has been applied to the element or one of its parents. This is a problem
e.g. with PopupView, where getBoundingClientRect will return too small
size (or even zero size) for all the popup contents while the opening
animation is active. ComputedStyle ignores the transform and returns the
expected value.
- The presence of the element in DOM must be checked before the size is
requested from ComputedStyle, if the element has disappeared from DOM
without a warning and calculation is attempted anyway, the browser gets
stuck.
- Possibility to configure LayoutManager to use the less reliable
calculations for applications where the slight performance difference is
more important than layout issues within elements that have transform
animations.
- Manual test, problem isn't reproducible by TestBench.
Fixes: #11187
commit 11c3f8bd9e - Test and its UI class
are added (both V8 and V7). Required functionality should be available
via modern GWT version.
commit 729dbf96fe - About update release
notes. No need to be included.
commit 675f38349c - V8 already contains
correct Import-Packages section which uses osgi.javax.servlet.version
variable whise version is 3.0.0 at the moment.
commit 5da7c052f5 - Use Vaadin plugin
7.7.0 from 7.7.0.alpha1. Is not applicable.
commit 1df80001ab - Updated tutorial to
Vaadin 7.7.0. Is not applicable. The tutorial already contains correct
links and updated source code snippets.
commit 8b4f0ed8a8 - set-property-fallback
name="user.agent" value="safari". Is already there.
commit 28ed04e827 - Fix animation end
listeners so they are always removed. Is already there.
commit 408253bc3f - Use servlet context
classloader when finding servlet class for websockets. Is already there.
commit 7a6f250d89 - Fire actions before
removing menu from the DOM. Is already there.
commit 9b66c6eb9b - Do not run test on IE8
as IE8 is broken. Transplanted.
commit 3faa43ff39 - Discard for DateField
when the data source contains null. It is not applicable for V8 (There
is no anymore discard method in DateField (and no datasource suport in
field)). Transplanted for DateField in compatibility.
commit e0c1f91a3d - Fix ComboBox paging
when number of items equals page length. It's already done by another
fix which replaced ComboBox in compatibility package to the V7 version.
commit 83a1b8a096 - Update DOM and update
escalator row count in the correct order. Transplanted.
commit 45f2fba8ff - Prevent editor from
being canceled while it is being saved. Transplanted to compatibility
package. Is not applicable to modern Grid.
commit ad67f7f43a - Delete broken
stylesheet and revert to default style until a new stylesheet is
created. Is already there.
commit c970a78d42 - Always show loading
indicator for JavaScript RPC. Transplanted.
commit 2aad341606 - Make test independent
of any converters present in the factory. It's already there.
commit c9ad48430b - Do not include
yuicompressor for Sass compiler. Transplanted. Exclusion is added into
vaadin/pom.xml
commit 52d01a68e9 - Test for Firefox
download disconnecting push channel. Transplanted.
commit 4bc375d1d2 - Handle encoded URL
characters correctly when constructing widget set name. Transplanted.
commit 17ba88eaf8 - Update version to
7.7-SNAPSHOT. Is not applicable.
commit 47b7b13e5c - Ensure Firefox always
updates the grid scrollbar. Transplanted. Made changes in the logic to
the test for modern Grid component.
commit 4d851ba21d - Calculate column
widths immediately if there is data. Transplanted to both client side
modules.
commit 8f0b1a1dd0 - Skip Maven enforcer
plugin during demo validation. Transplanted (one build file is
affected).
commit 62815353e1 - Build demos from 7.7
branch (now for master branch). FW8 demos are added (one build file is
affected).
commit 815d72115d - Make test pass on all
browsers. Transplanted to both V7 and V8 version tests.
commit 516c428ca1 - Use widget set
specified by init parameter. Transplanted to the one UIProvider class.
commit b00c580ed7 - Use correct column
index when calculating min width during resize. Transplanted into both
client side classes (main and compatibility) as is. Test for V7 is
transplanted as is. Test for V8 is written from scratch based on V7
version.
commit 7dd91cf057 - Fix regression that
broke widget set compilation in 7.7.1. It's already there.
commit c665731b0b - Ensure temporary
layout manager state is cleared at the end of a layout phase.
Transplanted to the one LayoutManager class.
commit 57a965251a - Fix assertion error
when column widths are calculated. Transplanted to both versions of the
client Grid widget.
commit c5c52684eb - Format Java files
using Eclipse Neon and Vaadin settings. Only formatting changes. Is not
transplanted.
f5d06d8771 - Change javadoc to a style
Eclipse formatter can handle. Transplanted to both versions of the
client Grid widget.
commit 6033e13c20 - Make initially
disabled grid work when enabled. Transplanted to both client side
modules.
commit a2d6e4fb4b - Use
requestAnimationFrame when scrolling in Grid. Transplanted to both
client side modules.
commit fe9438e7b7 - Specify branch also
for Sampler. Is not applicable for master branch.
commit 1ec5d8ef7c - Update to Chrome 53.
Is already there.
commit 961851bfbc - Updated link to new
step 1 video in tutorial. Is already there.
commit 41dc2fe161 - Revert "Use widget set
specified by init parameter. Transplanted to the one UIProvider class.
commit 092b4f7f31 - Use widget set
specified by init parameter. Transplanted to the common server side
classes.
commit 977cec7e31 - Fix widget set builder
to create widget set in correct location. Transplanted to the one
ClassPathExplorer class file.
commit 6c12ad89ea - Format project pom
files using correct settings. Is not transplanted: only formatting
changes for POM files.
commit 0aad93ecc1 - Add tests for
widgetset compilation in different modes. Transplanted. New test
projects.
commit 0a3a1ef832 - Use
versions-maven-plugin 2.3 to avoid NPE while setting project version. Is
already there.
Change-Id: Ie3a5088f25de1772f01ea30c4a5eba0b169ee0ab
Adds functions for skipping child component layout measuring.
Removes unnecessary code from VScrollTable.
1. case: no components
- render time without the fix: ~105ms
- render time with fix: ~105ms
2. case: 2 button and 2 textfield cols
- render time without the fix: ~279ms
- render time with fix: ~240ms (~17% faster)
3. case: 3 button and 3 textfield cols
- render time without the fix: ~350ms
- render time with fix: ~281ms (~20% faster)
Change-Id: I6025f8ee2fd438d228ff3b65f43535961cf12c0b
This change removes the method LayoutDependenyTree.setNeedsMeasure which
takes a connectorId as first param.
In all places where it is used, the ComponentConnector is actually known,
so this change avoids looking it up over and over again.
Also The lookup would need to lookup the ConnectorMap every time.
Change-Id: I2593b0bede05cd69889ba68aac854cfba43f70b1
LayoutManager uses shortcut when delaying overflow fixes (#16963).
This change introduces an extracted method which will quick return if
a component needs a delayedOverflowFix.
Change-Id: I0d6ab100964a59e2f445a81271863a8212538d4d
LayoutManager reuses shortcut Element instance for measure (#16964).
This change prevents the duplicate getter chain lookup
connector.getWidget().getElement() on the very hot measureConnector
method.
Change-Id: Ia59c9ef2e6bbcf9402424bc565bc9ee3977e3c6e
Fix for 'Aborting layout after 100 passess' (#13359)
'Aborting layout after 100 passes.' is caused by LayoutManager falling
into a loop on rounding fractional layout slot sizes up and down while
trying to fit layout's content in the space available. LayoutManager
round always up, that causes this issue with IE9+ and Chrome. This
change helps LayoutManager to round fractional sizes down for browsers
that causes problems if rounded up.
Browsers may fall into the loop especially with a zoom level other than
100%. Not with any zoom level though. Problematic zoom level varies by
browser. OrderedLayoutExpandTest uses zoom levels other than 100%. Test
for Chrome is the only one that really is able to reproduce error
without the fix. IE9/10 would too, but the zoom level could not be set
exactly to the required 95% for IE. Test works best as a regression test
for other browsers.
Change-Id: Ie840b074df5fed5ea3b15fba9a6fd372a5c0b76a
Revert "Assert that connector needing layout is attached (#11698)"
This reverts commit cb7b02d4e5
The assert is not a good idea because it is triggered when a connector registers a dependency in its init method.
Merge: no
Change-Id: I1f5a99af8f0af7b3329a1a596073ba09e55e18dc
Revert "Assert that connector needing layout is attached (#11698)"
This reverts commit cb7b02d4e5
The assert is not a good idea because it is triggered when a connector registers a dependency in its init method.
Change-Id: I3709c4749927e0333b7557cf553080b770639e50
* Unless there's a ElementResizeListener or a registered dependency,
only ManagedLayouts and children of ManagedLayouts are measured
* Add assertions to help detect situations where measurements are
requested for elements that are not measured
Change-Id: Idde40476040880afd069147074083b60550d9404