From c2a85b37901a70fa3134c0dc2adfcff97e7b06e8 Mon Sep 17 00:00:00 2001 From: Fabian Lange Date: Mon, 2 Mar 2015 10:45:28 +0100 Subject: [PATCH] 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 --- .../src/com/vaadin/client/LayoutManager.java | 27 ++++++++++++------- 1 file 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(); -- 2.39.5