Fix 4729. Make StyleInjector.flush public.

Patch by: stephen.haberman
Review at http://gwt-code-reviews.appspot.com/1614806

Review by: rchandia@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@11032 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/dom/client/StyleInjector.java b/user/src/com/google/gwt/dom/client/StyleInjector.java
index 1e09481..0905d2f 100644
--- a/user/src/com/google/gwt/dom/client/StyleInjector.java
+++ b/user/src/com/google/gwt/dom/client/StyleInjector.java
@@ -213,6 +213,19 @@
   private static boolean needsInjection = false;
 
   /**
+   * Flushes any pending stylesheets to the document.
+   * <p>
+   * This can be useful if you used CssResource.ensureInjected but
+   * now in the same event loop want to measure widths based on the
+   * new styles. 
+   * <p>
+   * Note that calling this method excessively will decrease performance.
+   */
+  public static void flush() {
+    inject(true);
+  }
+
+  /**
    * Add a stylesheet to the document.
    * 
    * @param css the CSS contents of the stylesheet