コード例 #1
0
 /**
  * Add stylesheet data to the document as though it were declared before any stylesheet previously
  * created by {@link #injectStylesheet(String)}.
  *
  * <p>The returned StyleElement cannot be implemented consistently across all browsers.
  * Specifically, <strong>applications that need to run on Internet Explorer should not use this
  * method. Call {@link #injectAtStart(String, boolean)} instead.</strong>
  *
  * @param contents the CSS contents of the stylesheet
  * @return the StyleElement that contains the newly-injected CSS (unreliable on Internet Explorer)
  */
 public static StyleElement injectStylesheetAtStart(String contents) {
   toInjectAtStart.unshift(contents);
   return flush(toInjectAtStart);
 }
コード例 #2
0
 /**
  * Add stylesheet data to the document as though it were declared before all stylesheets
  * previously created by {@link #inject(String)}.
  *
  * @param css the CSS contents of the stylesheet
  * @param immediate if <code>true</code> the DOM will be updated immediately instead of just
  *     before returning to the event loop. Using this option excessively will decrease
  *     performance, especially if used with an inject-css-on-init coding pattern
  */
 public static void injectAtStart(String css, boolean immediate) {
   toInjectAtStart.unshift(css);
   inject(immediate);
 }