]> source.dussan.org Git - vaadin-framework.git/commit
Fix to LayoutManager size calculations during transform. (#12138)
authorAnna Koskinen <Ansku@users.noreply.github.com>
Fri, 18 Dec 2020 11:16:26 +0000 (13:16 +0200)
committerGitHub <noreply@github.com>
Fri, 18 Dec 2020 11:16:26 +0000 (13:16 +0200)
commitc8e04dc5b30f8967c58df928872ca2e5e2be5c5b
tree6aae4f933e431470906b554053f21d070fe19b97
parent49f70390add1655fc5eb846e7700d00cb57b5048
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
client/src/main/java/com/vaadin/client/LayoutManager.java
client/src/main/java/com/vaadin/client/MeasuredSize.java
client/src/main/java/com/vaadin/client/ui/ui/UIConnector.java
server/src/main/java/com/vaadin/ui/UI.java
shared/src/main/java/com/vaadin/shared/ui/ui/UIState.java
uitest/src/main/java/com/vaadin/tests/components/popupview/PopupViewContentWithExpandRatio.java [new file with mode: 0644]