summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorFabian Lange <lange.fabian@gmail.com>2015-03-02 10:45:28 +0100
committerVaadin Code Review <review@vaadin.com>2015-03-11 08:55:58 +0000
commitc2a85b37901a70fa3134c0dc2adfcff97e7b06e8 (patch)
treeb5fef42959471cf68627a8e31466c7fcffa0c8ef /client
parentb2db17740aa8e7b33b208c73559c1d5d3461c192 (diff)
downloadvaadin-framework-c2a85b37901a70fa3134c0dc2adfcff97e7b06e8.tar.gz
vaadin-framework-c2a85b37901a70fa3134c0dc2adfcff97e7b06e8.zip
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
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/LayoutManager.java27
1 files changed, 18 insertions, 9 deletions
diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java
index f77b61a5a3..dfcf2cb5bb 100644
--- a/client/src/com/vaadin/client/LayoutManager.java
+++ b/client/src/com/vaadin/client/LayoutManager.java
@@ -605,15 +605,7 @@ public class LayoutManager {
ComponentConnector componentConnector = (ComponentConnector) connectorMap
.getConnector(connectorId);
- // Delay the overflow fix if the involved connectors might still
- // change
- boolean connectorChangesExpected = !currentDependencyTree
- .noMoreChangesExpected(componentConnector);
- boolean parentChangesExcpected = componentConnector.getParent() instanceof ComponentConnector
- && !currentDependencyTree
- .noMoreChangesExpected((ComponentConnector) componentConnector
- .getParent());
- if (connectorChangesExpected || parentChangesExcpected) {
+ if (delayOverflowFix(componentConnector)) {
delayedOverflowFixes.add(connectorId);
continue;
}
@@ -732,6 +724,23 @@ public class LayoutManager {
return measureCount;
}
+ /*
+ * Delay the overflow fix if the involved connectors might still change
+ */
+ private boolean delayOverflowFix(ComponentConnector componentConnector) {
+ if (!currentDependencyTree.noMoreChangesExpected(componentConnector)) {
+ return true;
+ }
+ ServerConnector parent = componentConnector.getParent();
+ if (parent instanceof ComponentConnector
+ && !currentDependencyTree
+ .noMoreChangesExpected((ComponentConnector) parent)) {
+ return true;
+ }
+
+ return false;
+ }
+
private void measureConnector(ComponentConnector connector) {
Profiler.enter("LayoutManager.measureConnector");
Element element = connector.getWidget().getElement();