commit | d2b1aa629306ed1c57e9c77c3450c35b19a0daa4 | [log] [tgz] |
---|---|---|
author | rdayal@google.com <rdayal@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Fri Jun 08 15:00:19 2012 +0000 |
committer | rdayal@google.com <rdayal@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Fri Jun 08 15:00:19 2012 +0000 |
tree | ac849db706900dc8e4ac47a64e387ed389050515 | |
parent | ab7cc359e46ec78961cc2c3d82d831c5d7565b01 [diff] |
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