]> source.dussan.org Git - vaadin-framework.git/commitdiff
LayoutManager uses shortcut when delaying overflow fixes (#16963).
authorFabian Lange <lange.fabian@gmail.com>
Mon, 2 Mar 2015 09:45:28 +0000 (10:45 +0100)
committerVaadin Code Review <review@vaadin.com>
Wed, 11 Mar 2015 08:55:58 +0000 (08:55 +0000)
This change introduces an extracted method which will quick return if
a component needs a delayedOverflowFix.

Change-Id: I0d6ab100964a59e2f445a81271863a8212538d4d

client/src/com/vaadin/client/LayoutManager.java

index f77b61a5a37d8e0410dd51a3f4e2ce316c062fcf..dfcf2cb5bb2f2abbfdddfb5f798fc33e75be77e4 100644 (file)
@@ -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();