Remove unused microbenchmarks. Change-Id: I6f9fa0f0c18bed447d98b81e4955c02420a24eb7
diff --git a/reference/BUILD b/reference/BUILD deleted file mode 100644 index 58d3816..0000000 --- a/reference/BUILD +++ /dev/null
@@ -1,20 +0,0 @@ -# Copyright 2012 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -# Description: -# -# Unused code kept around for reference. - -# Google owns the copyright -licenses(["unencumbered"])
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/Microbenchmarks.gwt.xml b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/Microbenchmarks.gwt.xml deleted file mode 100644 index 7b85430..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/Microbenchmarks.gwt.xml +++ /dev/null
@@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module rename-to='microbenchmarks'> - <inherits name='com.google.gwt.user.User'/> - <inherits name='com.google.gwt.user.theme.standard.Standard'/> - - <!-- Specify the app entry point class. --> - <entry-point class='com.google.gwt.reference.microbenchmark.client.Microbenchmarks'/> - - <!-- Specify the paths for translatable code --> - <source path='client'/> - - <!-- Deferred binding for Util. --> - <replace-with class="com.google.gwt.reference.microbenchmark.client.UtilImplTrident"> - <when-type-is class="com.google.gwt.reference.microbenchmark.client.UtilImpl" /> - <any> - <when-property-is name="user.agent" value="ie6" /> - <when-property-is name="user.agent" value="ie8" /> - <when-property-is name="user.agent" value="ie9" /> - </any> - </replace-with> - -</module>
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/EmptyBinder.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/EmptyBinder.java deleted file mode 100644 index 0f39b9b..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/EmptyBinder.java +++ /dev/null
@@ -1,45 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Widget; - -/** - * Creates an empty HTMLPanel via UiBinder. - */ -public class EmptyBinder extends Composite { - - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("HTMLPanel UiBinder"); - } - - @Override - public Widget make() { - return new EmptyBinder(); - } - } - interface Binder extends UiBinder<Widget, EmptyBinder> {} - - private static final Binder BINDER = GWT.create(Binder.class); - - private EmptyBinder() { - initWidget(BINDER.createAndBindUi(this)); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/EmptyBinder.ui.xml b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/EmptyBinder.ui.xml deleted file mode 100644 index 42de1b2..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/EmptyBinder.ui.xml +++ /dev/null
@@ -1,4 +0,0 @@ -<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' - xmlns:gwt='urn:import:com.google.gwt.user.client.ui'> - <gwt:HTMLPanel/> -</ui:UiBinder>
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmark.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmark.java deleted file mode 100644 index a44cf50..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmark.java +++ /dev/null
@@ -1,38 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.user.client.ui.Widget; - -/** - * Implemented by the Microbenchmarks run from {@link Microbenchmarks}. - */ -public interface Microbenchmark { - /** - * @return The user visible name of this benchmark - */ - String getName(); - - /** - * @return The widget to display for this benchmark - */ - Widget getWidget(); - - /** - * Run the benchmark. - */ - void run(); -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/MicrobenchmarkSurvey.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/MicrobenchmarkSurvey.java deleted file mode 100644 index f37ee1a..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/MicrobenchmarkSurvey.java +++ /dev/null
@@ -1,414 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.core.client.Duration; -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.Document; -import com.google.gwt.event.dom.client.BlurEvent; -import com.google.gwt.event.dom.client.BlurHandler; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.Cookies; -import com.google.gwt.user.client.Window; -import com.google.gwt.user.client.Window.ClosingEvent; -import com.google.gwt.user.client.Window.ClosingHandler; -import com.google.gwt.user.client.ui.CheckBox; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.Grid; -import com.google.gwt.user.client.ui.InlineLabel; -import com.google.gwt.user.client.ui.PopupPanel; -import com.google.gwt.user.client.ui.RootPanel; -import com.google.gwt.user.client.ui.ScrollPanel; -import com.google.gwt.user.client.ui.TextBox; -import com.google.gwt.user.client.ui.Widget; - -import java.util.Collections; -import java.util.Date; -import java.util.List; - -/** - * An implementation of {@link Microbenchmark} that surveys multiple timed - * tests. - */ -public class MicrobenchmarkSurvey implements Microbenchmark { - - /** - * A single runnable test that makes up the survey. - */ - static abstract class NanoTest { - - private final String name; - - /** - * Construct a new {@link NanoTest}. - * - * @param name the display name - */ - public NanoTest(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - /** - * Get the widget to display in a popup when the user clicks on the test - * name. - * - * @return the popup widget, or null not to show one - */ - public Widget getPopup() { - return null; - } - - /** - * Run the test. - */ - public abstract void runTest(); - - /** - * Setup the test before starting the timer. Override this method to prepare - * the test before it starts running. - */ - public void setup() { - // No-op by default. - } - - /** - * Tear down the test after stopping the timer. Override this method to - * cleanup the test after it completes. - */ - public void teardown() { - // No-op by default. - } - } - - /** - * A nano test that makes a widget and attaches it to the {@link RootPanel}. - */ - static abstract class WidgetMaker extends NanoTest { - - private final RootPanel root = RootPanel.get(); - private Widget popupWidget; - private Widget w; - - public WidgetMaker(String name) { - super(name); - } - - @Override - public Widget getPopup() { - if (popupWidget == null) { - popupWidget = make(); - } - return popupWidget; - } - - @Override - public void runTest() { - w = make(); - root.add(w); - - /* - * Force a layout by finding the body's offsetTop and height. We avoid - * doing setTimeout(0), which would allow paint to happen, to keep the - * test synchronous and because different browsers round that zero to - * different minimums. Layout should be the bulk of the time. - */ - Document.get().getBody().getOffsetTop(); - Document.get().getBody().getOffsetHeight(); - w.getOffsetHeight(); - } - - @Override - public void teardown() { - // Clean up to keep the dom. Attached widgets will affect later tests. - root.remove(w); - } - - /** - * Make the widget to test. - * - * @return the widget - */ - protected abstract Widget make(); - } - - /** - * A nano test that updates an existing widget that is already attached to the - * {@link RootPanel}. - * - * @param <W> the widget type - */ - static abstract class WidgetUpdater<W extends Widget> extends MicrobenchmarkSurvey.NanoTest { - - private final RootPanel root = RootPanel.get(); - private W w; - - public WidgetUpdater(String name) { - super(name); - } - - @Override - public Widget getPopup() { - return ensureWidget(); - } - - @Override - public void setup() { - root.add(ensureWidget()); - } - - @Override - public void runTest() { - updateWidget(w); - } - - @Override - public void teardown() { - root.remove(w); - } - - /** - * Make the widget to test. - * - * @return the widget - */ - protected abstract W make(); - - /** - * Update the widget. - * - * @param w the widget to update - */ - protected abstract void updateWidget(W w); - - private W ensureWidget() { - if (w == null) { - w = make(); - } - return w; - } - } - - interface Binder extends UiBinder<Widget, MicrobenchmarkSurvey> { - } - - private static final Binder BINDER = GWT.create(Binder.class); - - private static final String COOKIE = "gwt_microb_survey"; - - private static final int DEFAULT_INSTANCES = 100; - - public static native void log(String msg) /*-{ - var logger = $wnd.console; - if (logger) { - logger.log(msg); - if (logger.markTimeline) { - logger.markTimeline(msg); - } - } - }-*/; - - @UiField(provided = true) - Grid grid; - @UiField - CheckBox includeLargeWidget; - @UiField - TextBox number; - @UiField - Widget root; - final String name; - private final List<NanoTest> nanos; - - /** - * Construct a new {@link MicrobenchmarkSurvey} micro benchmark. - * - * @param name the name of the benchmark - * @param nanos the {@link NanoTest}s that make up the survey - */ - public MicrobenchmarkSurvey(String name, List<NanoTest> nanos) { - this.name = name; - this.nanos = Collections.unmodifiableList(nanos); - - int instances = DEFAULT_INSTANCES; - try { - instances = Integer.parseInt(Cookies.getCookie(COOKIE)); - } catch (NumberFormatException ignored) { - } - - // Initialize the grid. - grid = new Grid(nanos.size() + 2, 3); - grid.setText(0, 0, "median"); - grid.setText(0, 1, "mean"); - - int row = 1; - for (final NanoTest nano : nanos) { - grid.setText(row, 0, "0"); - grid.setText(row, 1, "0"); - InlineLabel a = new InlineLabel(); - a.setText(nano.getName()); - a.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - Widget toDisplay = nano.getPopup(); - if (toDisplay != null) { - PopupPanel popup = new PopupPanel(true, true); - ScrollPanel container = new ScrollPanel(toDisplay); - container.setPixelSize(500, 500); - popup.setWidget(container); - popup.center(); - } - } - }); - // TODO: popup. - grid.setWidget(row, 2, a); - row++; - } - - // Create the widget. - root = BINDER.createAndBindUi(this); - number.setVisibleLength(7); - number.setValue("" + instances); - number.addBlurHandler(new BlurHandler() { - public void onBlur(BlurEvent event) { - saveInstances(); - } - }); - - Window.addWindowClosingHandler(new ClosingHandler() { - public void onWindowClosing(ClosingEvent event) { - saveInstances(); - } - }); - } - - public String getName() { - return name; - } - - public Widget getWidget() { - return root; - } - - public void run() { - RootPanel root = RootPanel.get(); - - // Add a large widget to the root to reflect a typical application. - FlowPanel largeWidget = null; - if (includeLargeWidget.getValue()) { - largeWidget = new FlowPanel(); - TestWidgetBinder.Maker widgetMaker = new TestWidgetBinder.Maker(); - for (int i = 0; i < 100; i++) { - largeWidget.add(widgetMaker.make()); - } - root.add(largeWidget); - } - - int nanosCount = nanos.size(); - double[] times = new double[nanosCount]; - - int column = grid.getColumnCount(); - grid.resizeColumns(column + 1); - grid.setText(0, column, "Run " + (column - 3)); - - final int instances = getInstances(); - boolean forward = false; - for (int i = 0; i < instances; ++i) { - forward = !forward; - for (int m = 0; m < nanosCount; m++) { - /* - * Alternate the order that we invoke the makers to cancel out the - * performance impact of adding elements to the DOM, which would cause - * later tests to run more slowly than earlier tests. - */ - NanoTest nano = nanos.get(forward ? m : (nanosCount - 1 - m)); - nano.setup(); - - // Execute the test. - log(i + ": " + nano.name); - double start = Duration.currentTimeMillis(); - nano.runTest(); - - // Record the end time. - double thisTime = Duration.currentTimeMillis() - start; - times[m] += thisTime; - - // Cleanup after the test. - nano.teardown(); - } - } - - // Record the times. - double allTimes = 0; - for (int m = 0; m < nanosCount; ++m) { - record(m + 1, times[m]); - allTimes += times[m]; - } - grid.setText(grid.getRowCount() - 1, grid.getColumnCount() - 1, Util.format(allTimes)); - - // Cleanup the dom. - if (largeWidget != null) { - root.remove(largeWidget); - } - } - - private int getInstances() { - try { - int instances = Integer.parseInt(number.getValue()); - return instances; - } catch (NumberFormatException ignored) { - return 0; - } - } - - private void record(int row, double thisTime) { - final int columns = grid.getColumnCount(); - grid.setText(row, columns - 1, Util.format(thisTime)); - - double max = 0, min = 0, mean = 0; - - for (int column = 3; column < columns; column++) { - double value = Double.parseDouble(grid.getText(row, column)); - mean += value; - max = Math.max(max, value); - if (min == 0) { - min = max; - } else { - min = Math.min(min, value); - } - } - - double range = max - min; - double halfRange = range / 2; - double median = min + halfRange; - grid.setText(row, 0, Util.format(Util.roundToTens(median))); - - mean = mean / (columns - 3); - grid.setText(row, 1, Util.format(Util.roundToTens(mean))); - } - - @SuppressWarnings("deprecation") - private void saveInstances() { - String value = number.getValue(); - Date expires = new Date(); - expires.setYear(expires.getYear() + 3); - Cookies.setCookie(COOKIE, value, expires); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/MicrobenchmarkSurvey.ui.xml b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/MicrobenchmarkSurvey.ui.xml deleted file mode 100644 index ba226d6..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/MicrobenchmarkSurvey.ui.xml +++ /dev/null
@@ -1,26 +0,0 @@ -<ui:UiBinder - xmlns:ui='urn:ui:com.google.gwt.uibinder' - xmlns:g='urn:import:com.google.gwt.user.client.ui'> - - <g:HTMLPanel - ui:field="root"> - <b> - Time for creating, attaching and detaching - <g:TextBox - ui:field="number" - visibleLength="7" /> - instances, in MS - </b> - <br /> - - <g:CheckBox - ui:field="includeLargeWidget">Click to include a large widget on the page while running the - test</g:CheckBox> - <br /> - <br /> - - <g:Grid - ui:field="grid" /> - </g:HTMLPanel> - -</ui:UiBinder>
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmarks.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmarks.java deleted file mode 100644 index 5669374..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmarks.java +++ /dev/null
@@ -1,163 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.core.client.Duration; -import com.google.gwt.core.client.EntryPoint; -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.core.client.Scheduler.ScheduledCommand; -import com.google.gwt.dom.client.Element; -import com.google.gwt.event.dom.client.ChangeEvent; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.reference.microbenchmark.client.MicrobenchmarkSurvey.NanoTest; -import com.google.gwt.reference.microbenchmark.client.MicrobenchmarkSurvey.WidgetMaker; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.uibinder.client.UiHandler; -import com.google.gwt.user.client.ui.Button; -import com.google.gwt.user.client.ui.DeckPanel; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.HTMLPanel; -import com.google.gwt.user.client.ui.ListBox; -import com.google.gwt.user.client.ui.RootPanel; -import com.google.gwt.user.client.ui.SimplePanel; -import com.google.gwt.user.client.ui.UIObject; -import com.google.gwt.user.client.ui.Widget; - -import java.util.ArrayList; -import java.util.List; - -/** - * Offers up a selection of {@link Microbenchmark} implementations to run. - */ -public class Microbenchmarks implements EntryPoint { - - interface Binder extends UiBinder<Widget, Microbenchmarks> {} - private static final Binder BINDER = GWT.create(Binder.class); - - private final Microbenchmark[] benchmarks; - - double elapsedMs = 0; - @UiField ListBox listBox; - @UiField DeckPanel deck; - @UiField Button button; - @UiField Element running; - @UiField Element runs; - @UiField Element sum; - - public Microbenchmarks() { - // Add entries for new widget benchmarks here. - List<NanoTest> widgetMakers = new ArrayList<NanoTest>(); - widgetMakers.add(new WidgetMaker("SimplePanel") { - @Override - public Widget make() { - return new SimplePanel(); - } - }); - widgetMakers.add(new WidgetMaker("FlowPanel") { - @Override - public Widget make() { - return new FlowPanel(); - } - }); - widgetMakers.add(new WidgetMaker("HTMLPanel") { - @Override - public Widget make() { - return new HTMLPanel(""); - } - }); - widgetMakers.add(new EmptyBinder.Maker()); - widgetMakers.add(new TestEmptyDomViaApi.Maker()); - widgetMakers.add(new TestEmptyDom.Maker()); - widgetMakers.add(new TestEmptyCursorDomCrawl.Maker()); - widgetMakers.add(new TestEmptyRealisticDomCrawl.Maker()); - widgetMakers.add(new TestDomViaApi.Maker()); - widgetMakers.add(new TestDomInnerHtmlById.Maker()); - if (Util.hasQSA) { - widgetMakers.add(new TestDomInnerHtmlQuerySelectorAll.Maker()); - } - widgetMakers.add(new TestCursorDomCrawl.Maker()); - widgetMakers.add(new TestRealisticDomCrawl.Maker()); - widgetMakers.add(new TestDomBinder.Maker()); - widgetMakers.add(new TestFlows.Maker()); - widgetMakers.add(new TestManualHTMLPanel.Maker()); - widgetMakers.add(new TestWidgetBinder.Maker()); - - // Add entries for table creation benchmarks here. - List<NanoTest> tableMakers = new ArrayList<NanoTest>(); - tableMakers.add(new TestCreateTableInnerHtml.Maker()); - tableMakers.add(new TestCreateTablePrecreatedInnerHtml.Maker()); - tableMakers.add(new TestCreateTableDom.Maker()); - tableMakers.add(new TestCreateTableDomWithEvents.Maker()); - - // Add entries for table update benchmarks here. - List<NanoTest> tableUpdaters = new ArrayList<NanoTest>(); - tableUpdaters.add(new TestCreateTableInnerHtml.Updater()); - tableUpdaters.add(new TestCreateTablePrecreatedInnerHtml.Updater()); - tableUpdaters.add(new TestCreateTableDom.Updater()); - tableUpdaters.add(new TestCreateTableDomWithEvents.Updater()); - - // Combine all table tests. - List<NanoTest> allTableTests = new ArrayList<MicrobenchmarkSurvey.NanoTest>(); - allTableTests.addAll(tableMakers); - allTableTests.addAll(tableUpdaters); - - benchmarks = new Microbenchmark[4]; - benchmarks[0] = new MicrobenchmarkSurvey("Widget Creation Survey", widgetMakers); - benchmarks[1] = new MicrobenchmarkSurvey("Table Creation and Update Survey", allTableTests); - benchmarks[2] = new MicrobenchmarkSurvey("Table Creation Survey", tableMakers); - benchmarks[3] = new MicrobenchmarkSurvey("Table Update Survey", tableUpdaters); - } - - @UiHandler("listBox") - public void onChange(@SuppressWarnings("unused") ChangeEvent ignored) { - int index = listBox.getSelectedIndex(); - deck.showWidget(index); - } - - @UiHandler("button") - public void onClick(@SuppressWarnings("unused") ClickEvent ignored) { - final int index = listBox.getSelectedIndex(); - UIObject.setVisible(running, true); - button.setEnabled(false); - Scheduler.get().scheduleDeferred(new ScheduledCommand() { - public void execute() { - double start = Duration.currentTimeMillis(); - benchmarks[index].run(); - double end = Duration.currentTimeMillis(); - UIObject.setVisible(running, false); - button.setEnabled(true); - double run = end - start; - runs.setInnerText(runs.getInnerText() + Util.format(run) + " "); - elapsedMs += run; - sum.setInnerText("(" + Util.format(elapsedMs) + ")"); - } - }); - } - - public void onModuleLoad() { - Widget root = BINDER.createAndBindUi(this); - - for (Microbenchmark benchmark : benchmarks) { - listBox.addItem(benchmark.getName()); - deck.add(benchmark.getWidget()); - } - - deck.showWidget(0); - RootPanel.get().add(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmarks.ui.xml b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmarks.ui.xml deleted file mode 100644 index 70c51e4..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Microbenchmarks.ui.xml +++ /dev/null
@@ -1,17 +0,0 @@ -<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' - xmlns:gwt='urn:import:com.google.gwt.user.client.ui'> - - <gwt:HTMLPanel> - <div style='margin-left:1em; margin-top:1em;'> - Select Benchmark: <gwt:ListBox ui:field='listBox'/> - <gwt:Button ui:field='button'>Run</gwt:Button> - <span ui:field='runs'/><span ui:field='sum'/> - <span style="display:none; color:gray; font-style:oblique" - ui:field='running'>Running...</span> - </div> - <br/><hr/><br/> - <div style='margin-left:1em;'> - <gwt:DeckPanel ui:field='deck'/> - </div> - </gwt:HTMLPanel> -</ui:UiBinder>
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableDom.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableDom.java deleted file mode 100644 index 31332e6..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableDom.java +++ /dev/null
@@ -1,117 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.TableCellElement; -import com.google.gwt.dom.client.TableElement; -import com.google.gwt.dom.client.TableRowElement; -import com.google.gwt.dom.client.TableSectionElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestCreateTableDom extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Create " + Util.TABLE_ROW_COUNT + "x" + Util.TABLE_COLUMN_COUNT - + " table via DOM api calls, no widgets"); - } - - @Override - public Widget make() { - return new TestCreateTableDom(); - } - } - - public static class Updater extends MicrobenchmarkSurvey.WidgetUpdater<TestCreateTableDom> { - Updater() { - this("Replace rows in " + Util.TABLE_ROW_COUNT + "x" + Util.TABLE_COLUMN_COUNT - + " table via DOM api calls, no widgets"); - } - - Updater(String name) { - super(name); - } - - @Override - protected TestCreateTableDom make() { - return new TestCreateTableDom(); - } - - @Override - protected void updateWidget(TestCreateTableDom w) { - // Remove the old rows. - int rowCount = w.tableBody.getRows().getLength(); - for (int i = 0; i < rowCount; i++) { - w.tableBody.deleteRow(0); - } - - // Add new rows. - w.fillTableBodyRows(); - } - } - - private final TableElement table; - private final TableSectionElement tableBody; - - TestCreateTableDom() { - // This table should match the structure defined in Util#createTableHtml(). - table = Document.get().createTableElement(); - tableBody = Document.get().createTBodyElement(); - table.appendChild(tableBody); - fillTableBodyRows(); - setElement(table); - } - - /** - * Create the contents of a cell. - * - * @param row the row index - * @param column the column index - * @return the cell contents as an element - */ - Element createCellContents(int row, int column) { - DivElement div = Document.get().createDivElement(); - div.setInnerHTML("Cell " + row + ":" + column); - return div; - } - - /** - * Fill the table body element with rows. - */ - private void fillTableBodyRows() { - for (int row = 0; row < Util.TABLE_ROW_COUNT; row++) { - TableRowElement tr = Document.get().createTRElement(); - tableBody.appendChild(tr); - if (row % 2 == 0) { - tr.addClassName("evenRow"); - } else { - tr.addClassName("oddRow"); - } - for (int column = 0; column < Util.TABLE_COLUMN_COUNT; column++) { - TableCellElement td = Document.get().createTDElement(); - td.setAlign("center"); - td.setVAlign("middle"); - td.appendChild(createCellContents(row, column)); - tr.appendChild(td); - } - } - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableDomWithEvents.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableDomWithEvents.java deleted file mode 100644 index 11be2be..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableDomWithEvents.java +++ /dev/null
@@ -1,57 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.Element; -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestCreateTableDomWithEvents extends TestCreateTableDom { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - - Maker() { - super("Create " + Util.TABLE_ROW_COUNT + "x" + Util.TABLE_COLUMN_COUNT - + " table via DOM api calls, no widgets, sink events on each cell"); - } - - @Override - public Widget make() { - return new TestCreateTableDomWithEvents(); - } - } - - public static class Updater extends TestCreateTableDom.Updater { - Updater() { - super("Replace rows in " + Util.TABLE_ROW_COUNT + "x" + Util.TABLE_COLUMN_COUNT - + " table via DOM api calls, no widgets, sink events on each cell"); - } - - @Override - protected TestCreateTableDom make() { - return new TestCreateTableDomWithEvents(); - } - } - - @Override - Element createCellContents(int row, int column) { - Element div = super.createCellContents(row, column); - Event.sinkEvents(div, Event.ONCLICK); - return div; - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java deleted file mode 100644 index 10c936e..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTableInnerHtml.java +++ /dev/null
@@ -1,67 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.TableElement; -import com.google.gwt.dom.client.TableSectionElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestCreateTableInnerHtml extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Create " + Util.TABLE_ROW_COUNT + "x" + Util.TABLE_COLUMN_COUNT - + " table via innerHTML built with StringBuilder, no widgets"); - } - - @Override - public Widget make() { - return new TestCreateTableInnerHtml(); - } - } - - public static class Updater extends MicrobenchmarkSurvey.WidgetUpdater<TestCreateTableInnerHtml> { - Updater() { - super("Update " + Util.TABLE_ROW_COUNT + "x" + Util.TABLE_COLUMN_COUNT - + " tbody via innerHTML built with StringBuilder, no widgets"); - } - - @Override - protected TestCreateTableInnerHtml make() { - return new TestCreateTableInnerHtml(); - } - - @Override - protected void updateWidget(TestCreateTableInnerHtml w) { - w.replaceAllRows(); - } - } - - private final TableElement table; - private final TableSectionElement tableBody; - - private TestCreateTableInnerHtml() { - table = Util.fromHtml(Util.createTableHtml()).cast(); - setElement(table); - tableBody = table.getTBodies().getItem(0).cast(); - } - - private void replaceAllRows() { - Util.replaceTableBodyRows(tableBody, Util.createTableRowsHtml()); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTablePrecreatedInnerHtml.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTablePrecreatedInnerHtml.java deleted file mode 100644 index c99a8cf..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCreateTablePrecreatedInnerHtml.java +++ /dev/null
@@ -1,74 +0,0 @@ -/* - * Copyright 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.TableElement; -import com.google.gwt.dom.client.TableSectionElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestCreateTablePrecreatedInnerHtml extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - - private final String tableHtml = Util.createTableHtml(); - - Maker() { - super("Create " + Util.TABLE_ROW_COUNT + "x" + Util.TABLE_COLUMN_COUNT - + " tbody via precreated innerHTML String, no widgets"); - } - - @Override - public Widget make() { - return new TestCreateTablePrecreatedInnerHtml(tableHtml); - } - } - - public static class Updater extends - MicrobenchmarkSurvey.WidgetUpdater<TestCreateTablePrecreatedInnerHtml> { - - private final String tableRowsHtml = Util.createTableRowsHtml(); - - Updater() { - super("Update " + Util.TABLE_ROW_COUNT + "x" + Util.TABLE_COLUMN_COUNT - + " table via precreated innerHTML String, no widgets"); - } - - @Override - protected TestCreateTablePrecreatedInnerHtml make() { - return new TestCreateTablePrecreatedInnerHtml(Util.createTableHtml()); - } - - @Override - protected void updateWidget(TestCreateTablePrecreatedInnerHtml w) { - w.replaceAllRows(tableRowsHtml); - } - } - - private final TableElement table; - private final TableSectionElement tableBody; - - private TestCreateTablePrecreatedInnerHtml(String tableHtml) { - table = Util.fromHtml(tableHtml).cast(); - setElement(table); - tableBody = table.getTBodies().getItem(0).cast(); - } - - private void replaceAllRows(String tableRowsHtml) { - Util.replaceTableBodyRows(tableBody, tableRowsHtml); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCursorDomCrawl.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCursorDomCrawl.java deleted file mode 100644 index 0717a69..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestCursorDomCrawl.java +++ /dev/null
@@ -1,52 +0,0 @@ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestCursorDomCrawl extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Text heavy UI via innerHTML, no widgets, get children by idealized crawl"); - } - - @Override - public Widget make() { - return new TestCursorDomCrawl(); - } - } - - Element elm; - DivElement div1; - DivElement div2; - DivElement div3; - DivElement div4; - SpanElement span1; - SpanElement span2; - - private TestCursorDomCrawl() { - Element root = Util.fromHtml(Util.TEXTY_OUTER_HTML); - - Element cursor = root; - div1 = (cursor = cursor.getFirstChildElement()).cast(); - assert div1.getId().equals("div1"); - div2 = (cursor = cursor.getFirstChildElement()).cast(); - assert div2.getId().equals("div2"); - span1 = (cursor = cursor.getNextSiblingElement()).cast(); - assert span1.getId().equals("span1"); - - cursor = div1.getNextSiblingElement(); - div3 = (cursor = cursor.getFirstChildElement()).cast(); - assert div3.getId().equals("div3"); - div4 = (cursor = cursor.getFirstChildElement()).cast(); - assert div4.getId().equals("div4"); - span2 = (cursor = cursor.getNextSiblingElement()).cast(); - assert span2.getId().equals("span2"); - - setElement(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomBinder.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomBinder.java deleted file mode 100644 index 32a9d7d..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomBinder.java +++ /dev/null
@@ -1,55 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestDomBinder extends Widget { - - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Text heavy UI via UiBinder, no widgets"); - } - - @Override - public Widget make() { - return new TestDomBinder(); - } - } - interface Binder extends UiBinder<Element, TestDomBinder> {} - @UiField DivElement div1; - @UiField DivElement div2; - @UiField DivElement div3; - @UiField DivElement div4; - - @UiField SpanElement span1; - @UiField SpanElement span2; - - private static final Binder BINDER = GWT.create(Binder.class); - - private TestDomBinder() { - setElement(BINDER.createAndBindUi(this)); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomBinder.ui.xml b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomBinder.ui.xml deleted file mode 100644 index 592a756..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomBinder.ui.xml +++ /dev/null
@@ -1,14 +0,0 @@ -<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'> - <div>Div root start - <div ui:field='div1'>Div1 - <div ui:field='div2'>Div2</div> - <span ui:field='span1'>Span1</span> - Div1 end</div> - <div>Div anon start - <div ui:field='div3'>Div3 - <div ui:field='div4'>Div4</div> - <span ui:field='span2'>Span2</span> - Div3 end</div> - Div anon end</div> - Div root end</div> -</ui:UiBinder>
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomInnerHtmlById.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomInnerHtmlById.java deleted file mode 100644 index 207e673..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomInnerHtmlById.java +++ /dev/null
@@ -1,70 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestDomInnerHtmlById extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Text heavy UI via innerHTML, no widgets, getElementById"); - } - - @Override - public Widget make() { - return new TestDomInnerHtmlById(); - } - } - - Element root; - DivElement div1; - DivElement div2; - DivElement div3; - - DivElement div4; - SpanElement span1; - - SpanElement span2; - - private TestDomInnerHtmlById() { - root = Util.fromHtml(Util.TEXTY_OUTER_HTML); - - Document.get().getBody().appendChild(root); - div1 = Document.get().getElementById("div1").cast(); - div2 = Document.get().getElementById("div2").cast(); - div3 = Document.get().getElementById("div3").cast(); - div4 = Document.get().getElementById("div4").cast(); - span1 = Document.get().getElementById("span1").cast(); - span2 = Document.get().getElementById("span2").cast(); - - Document.get().getBody().removeChild(root); - div1.removeAttribute("id"); - div2.removeAttribute("id"); - div3.removeAttribute("id"); - div4.removeAttribute("id"); - span1.removeAttribute("id"); - span2.removeAttribute("id"); - - setElement(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomInnerHtmlQuerySelectorAll.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomInnerHtmlQuerySelectorAll.java deleted file mode 100644 index f7bfb79..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomInnerHtmlQuerySelectorAll.java +++ /dev/null
@@ -1,79 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.core.client.JsArray; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestDomInnerHtmlQuerySelectorAll extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Text heavy UI via innerHTML, no widgets, querySelectorAll"); - } - - @Override - public Widget make() { - return new TestDomInnerHtmlQuerySelectorAll(); - } - } - - Element root; - DivElement div1; - DivElement div2; - DivElement div3; - - DivElement div4; - SpanElement span1; - - SpanElement span2; - - private TestDomInnerHtmlQuerySelectorAll() { - root = Util.fromHtml(Util.TEXTY_OUTER_HTML); - - String query = "#div1, #div2, #div3, #div4, #span1, #span2"; - JsArray<Element> response = Util.querySelectorAll(root, query); - assert 6 == response.length() : "response length should be 6: " + response.length(); - - div1 = response.get(0).cast(); - div2 = response.get(1).cast(); - span1 = response.get(2).cast(); - div3 = response.get(3).cast(); - div4 = response.get(4).cast(); - span2 = response.get(5).cast(); - - assert div1.getId().equals("div1"); - assert div2.getId().equals("div2"); - assert span1.getId().equals("span1"); - assert div3.getId().equals("div3"); - assert div4.getId().equals("div4"); - assert span2.getId().equals("span2"); - - div1.removeAttribute("id"); - div2.removeAttribute("id"); - span1.removeAttribute("id"); - div3.removeAttribute("id"); - div4.removeAttribute("id"); - span2.removeAttribute("id"); - - setElement(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomViaApi.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomViaApi.java deleted file mode 100644 index 6699f82..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestDomViaApi.java +++ /dev/null
@@ -1,86 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestDomViaApi extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Text heavy UI via DOM api calls, no widgets"); - } - - @Override - public Widget make() { - return new TestDomViaApi(); - } - } - - DivElement root; - DivElement div1; - DivElement div2; - DivElement div3; - DivElement div4; - SpanElement span1; - SpanElement span2; - - private TestDomViaApi() { - Document d = Document.get(); - root = d.createDivElement(); - root.appendChild(d.createTextNode("Div root")); - - div1 = d.createDivElement(); - Util.addText(div1, "Div1"); - root.appendChild(div1); - - div2 = d.createDivElement(); - Util.addText(div2, "Div2"); - div1.appendChild(div2); - - span1 = d.createSpanElement(); - Util.addText(span1, "Span1"); - div1.appendChild(span1); - - DivElement anon = d.createDivElement(); - Util.addText(anon, "Div anon"); - root.appendChild(anon); - - div3 = d.createDivElement(); - Util.addText(div3, "Div3"); - anon.appendChild(div3); - - div4 = d.createDivElement(); - Util.addText(div4, "Div4"); - div3.appendChild(div4); - - span2 = d.createSpanElement(); - Util.addText(span2, "Span2"); - div3.appendChild(span2); - - Util.addText(div1, " Div1 end"); - Util.addText(div3, " Div3 end"); - Util.addText(anon, " Div anon end"); - Util.addText(root, " Div root end"); - - setElement(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyCursorDomCrawl.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyCursorDomCrawl.java deleted file mode 100644 index 4611d76..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyCursorDomCrawl.java +++ /dev/null
@@ -1,52 +0,0 @@ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestEmptyCursorDomCrawl extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Empty UI via innerHTML, no widgets, get children by idealized crawl"); - } - - @Override - public Widget make() { - return new TestEmptyCursorDomCrawl(); - } - } - - Element elm; - DivElement div1; - DivElement div2; - DivElement div3; - DivElement div4; - SpanElement span1; - SpanElement span2; - - private TestEmptyCursorDomCrawl() { - Element root = Util.fromHtml(Util.EMPTY_OUTER_HTML); - - Element cursor = root; - div1 = (cursor = cursor.getFirstChildElement()).cast(); - assert div1.getId().equals("div1"); - div2 = (cursor = cursor.getFirstChildElement()).cast(); - assert div2.getId().equals("div2"); - span1 = (cursor = cursor.getNextSiblingElement()).cast(); - assert span1.getId().equals("span1"); - - cursor = div1.getNextSiblingElement(); - div3 = (cursor = cursor.getFirstChildElement()).cast(); - assert div3.getId().equals("div3"); - div4 = (cursor = cursor.getFirstChildElement()).cast(); - assert div4.getId().equals("div4"); - span2 = (cursor = cursor.getNextSiblingElement()).cast(); - assert span2.getId().equals("span2"); - - setElement(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyDom.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyDom.java deleted file mode 100644 index e642b7f..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyDom.java +++ /dev/null
@@ -1,70 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestEmptyDom extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Empty UI via innerHTML, no widgets, get children by id"); - } - - @Override - public Widget make() { - return new TestEmptyDom(); - } - } - - Element root; - DivElement div1; - DivElement div2; - DivElement div3; - - DivElement div4; - SpanElement span1; - - SpanElement span2; - - private TestEmptyDom() { - root = Util.fromHtml(Util.EMPTY_OUTER_HTML); - - Document.get().getBody().appendChild(root); - div1 = Document.get().getElementById("div1").cast(); - div2 = Document.get().getElementById("div2").cast(); - div3 = Document.get().getElementById("div3").cast(); - div4 = Document.get().getElementById("div4").cast(); - span1 = Document.get().getElementById("span1").cast(); - span2 = Document.get().getElementById("span2").cast(); - - Document.get().getBody().removeChild(root); - div1.removeAttribute("id"); - div2.removeAttribute("id"); - div3.removeAttribute("id"); - div4.removeAttribute("id"); - span1.removeAttribute("id"); - span2.removeAttribute("id"); - - setElement(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyDomViaApi.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyDomViaApi.java deleted file mode 100644 index 38672e7..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyDomViaApi.java +++ /dev/null
@@ -1,74 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestEmptyDomViaApi extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Empty UI via DOM api calls, no widgets"); - } - - @Override - public Widget make() { - return new TestEmptyDomViaApi(); - } - } - - DivElement root; - DivElement div1; - DivElement div2; - DivElement div3; - DivElement div4; - SpanElement span1; - SpanElement span2; - - private TestEmptyDomViaApi() { - Document d = Document.get(); - root = d.createDivElement(); - root.appendChild(d.createTextNode("Div root")); - - div1 = d.createDivElement(); - root.appendChild(div1); - - div2 = d.createDivElement(); - div1.appendChild(div2); - - span1 = d.createSpanElement(); - div1.appendChild(span1); - - DivElement anon = d.createDivElement(); - root.appendChild(anon); - - div3 = d.createDivElement(); - anon.appendChild(div3); - - div4 = d.createDivElement(); - div3.appendChild(div4); - - span2 = d.createSpanElement(); - div3.appendChild(span2); - - setElement(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyRealisticDomCrawl.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyRealisticDomCrawl.java deleted file mode 100644 index 909bd68..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestEmptyRealisticDomCrawl.java +++ /dev/null
@@ -1,51 +0,0 @@ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestEmptyRealisticDomCrawl extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Empty UI via innerHTML, no widgets, get children by nav from root"); - } - - @Override - public Widget make() { - return new TestEmptyRealisticDomCrawl(); - } - } - - Element elm; - DivElement div1; - DivElement div2; - DivElement div3; - DivElement div4; - SpanElement span1; - - SpanElement span2; - - private TestEmptyRealisticDomCrawl() { - Element root = Util.fromHtml(Util.EMPTY_OUTER_HTML); - - div1 = root.getFirstChildElement().cast(); - assert div1.getId().equals("div1"); - div2 = root.getFirstChildElement().getFirstChildElement().cast(); - assert div2.getId().equals("div2"); - span1 = root.getFirstChildElement().getFirstChildElement().getNextSiblingElement().cast(); - assert span1.getId().equals("span1"); - - div3 = root.getFirstChildElement().getNextSiblingElement().getFirstChildElement().cast(); - assert div3.getId().equals("div3"); - div4 = root.getFirstChildElement().getNextSiblingElement().getFirstChildElement().getFirstChildElement().cast(); - assert div4.getId().equals("div4"); - span2 = root.getFirstChildElement().getNextSiblingElement().getFirstChildElement().getFirstChildElement().getNextSiblingElement().cast(); - assert span2.getId().equals("span2"); - - setElement(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestFlows.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestFlows.java deleted file mode 100644 index 5d7acbc..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestFlows.java +++ /dev/null
@@ -1,62 +0,0 @@ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.InlineLabel; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestFlows extends Composite { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Text heavy UI via FlowPanels (DIVs) and InlineLabels (SPANs)"); - } - - @Override - public Widget make() { - return new TestFlows(); - } - } - - private TestFlows() { - FlowPanel root = new FlowPanel(); - Util.addText(root.getElement(), "Div root"); - - FlowPanel div1 = new FlowPanel(); - Util.addText(div1.getElement(), "Div1"); - root.add(div1); - - FlowPanel div2 = new FlowPanel(); - Util.addText(div2.getElement(), "Div2"); - div1.add(div2); - - InlineLabel span1 = new InlineLabel(); - span1.setText("Span1"); - div1.add(span1); - - FlowPanel anon = new FlowPanel(); - Util.addText(anon.getElement(), "Div anon"); - root.add(anon); - - FlowPanel div3 = new FlowPanel(); - Util.addText(div3.getElement(), "Div3"); - anon.add(div3); - - FlowPanel div4 = new FlowPanel(); - Util.addText(div4.getElement(), "Div4"); - div3.add(div4); - - InlineLabel span2 = new InlineLabel(); - span2.setText("Span2"); - div3.add(span2); - - Util.addText(div1.getElement(), " Div1 end"); - Util.addText(div3.getElement(), " Div3 end"); - Util.addText(anon.getElement(), " Div anon end"); - Util.addText(root.getElement(), " Div root end"); - - initWidget(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestManualHTMLPanel.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestManualHTMLPanel.java deleted file mode 100644 index d3d813d..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestManualHTMLPanel.java +++ /dev/null
@@ -1,43 +0,0 @@ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.HTMLPanel; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestManualHTMLPanel extends Composite { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Text heavy UI via typical manual HTMLPanel usage"); - } - - @Override - public Widget make() { - return new TestManualHTMLPanel(); - } - } - DivElement div1; - DivElement div2; - DivElement div3; - DivElement div4; - SpanElement span1; - - - SpanElement span2; - - private TestManualHTMLPanel() { - HTMLPanel p = new HTMLPanel(Util.TEXTY_INNER_HTML); - initWidget(p); - - div1 = p.getElementById("div1").cast(); - div2 = p.getElementById("div2").cast(); - div3 = p.getElementById("div3").cast(); - div4 = p.getElementById("div4").cast(); - span1 = p.getElementById("span1").cast(); - span2 = p.getElementById("span2").cast(); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestRealisticDomCrawl.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestRealisticDomCrawl.java deleted file mode 100644 index e8facdc..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestRealisticDomCrawl.java +++ /dev/null
@@ -1,51 +0,0 @@ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestRealisticDomCrawl extends Widget { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Text heavy UI via innerHTML, no widgets, get children by nav from root"); - } - - @Override - public Widget make() { - return new TestRealisticDomCrawl(); - } - } - - Element elm; - DivElement div1; - DivElement div2; - DivElement div3; - DivElement div4; - SpanElement span1; - - SpanElement span2; - - private TestRealisticDomCrawl() { - Element root = Util.fromHtml(Util.TEXTY_OUTER_HTML); - - div1 = root.getFirstChildElement().cast(); - assert div1.getId().equals("div1"); - div2 = root.getFirstChildElement().getFirstChildElement().cast(); - assert div2.getId().equals("div2"); - span1 = root.getFirstChildElement().getFirstChildElement().getNextSiblingElement().cast(); - assert span1.getId().equals("span1"); - - div3 = root.getFirstChildElement().getNextSiblingElement().getFirstChildElement().cast(); - assert div3.getId().equals("div3"); - div4 = root.getFirstChildElement().getNextSiblingElement().getFirstChildElement().getFirstChildElement().cast(); - assert div4.getId().equals("div4"); - span2 = root.getFirstChildElement().getNextSiblingElement().getFirstChildElement().getFirstChildElement().getNextSiblingElement().cast(); - assert span2.getId().equals("span2"); - - setElement(root); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestWidgetBinder.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestWidgetBinder.java deleted file mode 100644 index 6dc3a44..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestWidgetBinder.java +++ /dev/null
@@ -1,54 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Widget; - -/** - * Run by {@link MicrobenchmarkSurvey}, see name for details. - */ -public class TestWidgetBinder extends Composite { - public static class Maker extends MicrobenchmarkSurvey.WidgetMaker { - Maker() { - super("Text heavy UI with HTMLPanel via UiBinder"); - } - - @Override - public Widget make() { - return new TestWidgetBinder(); - } - } - interface Binder extends UiBinder<Widget, TestWidgetBinder> {} - @UiField DivElement div1; - @UiField DivElement div2; - @UiField DivElement div3; - @UiField DivElement div4; - - @UiField SpanElement span1; - @UiField SpanElement span2; - - private static final Binder BINDER = GWT.create(Binder.class); - - private TestWidgetBinder() { - initWidget(BINDER.createAndBindUi(this)); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestWidgetBinder.ui.xml b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestWidgetBinder.ui.xml deleted file mode 100644 index 2bf108d..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/TestWidgetBinder.ui.xml +++ /dev/null
@@ -1,15 +0,0 @@ -<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' - xmlns:gwt='urn:import:com.google.gwt.user.client.ui'> - <gwt:HTMLPanel>Div root start - <div ui:field='div1'>Div1 - <div ui:field='div2'>Div2</div> - <span ui:field='span1'>Span1</span> - Div1 end</div> - <div>Div anon start - <div ui:field='div3'>Div3 - <div ui:field='div4'>Div4</div> - <span ui:field='span2'>Span2</span> - Div3 end</div> - Div anon end</div> - Div root end</gwt:HTMLPanel> -</ui:UiBinder>
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Util.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Util.java deleted file mode 100644 index 469db17..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/Util.java +++ /dev/null
@@ -1,124 +0,0 @@ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.JsArray; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.Node; -import com.google.gwt.dom.client.TableSectionElement; -import com.google.gwt.i18n.client.NumberFormat; - -class Util { - private static final DivElement detachedDiv = Document.get().createDivElement(); - - static final boolean hasQSA = hasQSA(); - - static final String EMPTY_OUTER_HTML = "<div>" + Util.EMPTY_INNER_HTML + "</div>"; - - static final String EMPTY_INNER_HTML = "<div id='div1'>" - + "<div id='div2'></div>" - + "<span id='span1'></span>" - + "</div>" - + "<div>" - + "<div id='div3'>" - + "<div id='div4'></div>" - + "<span id='span2'></span>" - + "</div>" - + "</div>"; - - static final int TABLE_ROW_COUNT = 40; - - static final int TABLE_COLUMN_COUNT = 10; - - static final String TEXTY_OUTER_HTML = "<div>" + Util.TEXTY_INNER_HTML + "</div>"; - - static final String TEXTY_INNER_HTML = "Div root start" - + "<div id='div1'>Div1 start" - + "<div id='div2'>Div2</div>" - + "<span id='span1'>Span1</span>" - + "Div1 end</div>" - + "<div>Div anon start" - + "<div id='div3'>Div3" - + "<div id='div4'>Div4</div>" - + "<span id='span2'>Span2</span>" - + "Div 3 end</div>" - + "Div anon end</div>" - + "Div root end"; - - private static int uniqueId = 0; - private static UtilImpl impl = GWT.create(UtilImpl.class); - - static void addText(Element elm, String text) { - elm.appendChild(Document.get().createTextNode(text)); - } - - static String createTableHtml() { - StringBuilder sb = new StringBuilder(); - sb.append("<table><tbody>"); - sb.append(createTableRowsHtml()); - sb.append("</tbody></table>"); - return sb.toString(); - } - - static String createTableRowsHtml() { - // Assign a unique ID to ensure that we actually change the content. - uniqueId++; - StringBuilder sb = new StringBuilder(); - for (int row = 0; row < Util.TABLE_ROW_COUNT; row++) { - if (row % 2 == 0) { - sb.append("<tr class=\"evenRow\">"); - } else { - sb.append("<tr class=\"oddRow\">"); - } - for (int column = 0; column < Util.TABLE_COLUMN_COUNT; column++) { - sb.append("<td align=\"center\" valign=\"middle\"><div>"); - sb.append(uniqueId + " - Cell " + row + ":" + column); - sb.append("</div></td>"); - } - sb.append("</tr>"); - } - return sb.toString(); - } - - static String format(double median) { - return NumberFormat.getFormat("0").format(median); - } - - static Element fromHtml(String html) { - Util.detachedDiv.setInnerHTML(html); - Element e = Util.detachedDiv.getFirstChildElement(); - e.getParentElement().removeChild(e); - return e; - } - - static String outerHtml(Element e) { - String string = "<" + e.getNodeName() + ">" - + e.getInnerHTML() - + "</" + e.getNodeName() + ">"; - return string; - } - - static native JsArray<Element> querySelectorAll(Node root, String selector) /*-{ - return root.querySelectorAll(selector); - }-*/; - - /** - * Replace all of the rows in the specified tbody. - * - * @param tbody the tbody element - * @param rowHtml the HTML that represents the rows - */ - static void replaceTableBodyRows(TableSectionElement tbody, String rowHtml) { - impl.replaceTableBodyRows(tbody, rowHtml); - } - - static long roundToTens(double median) { - return Math.round(median/10)*10; - } - - private static native boolean hasQSA() /*-{ - var qsa = document.querySelectorAll; - return !(null == qsa); - }-*/; -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/UtilImpl.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/UtilImpl.java deleted file mode 100644 index 5e50ef5..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/UtilImpl.java +++ /dev/null
@@ -1,13 +0,0 @@ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.TableSectionElement; - -/** - * Implementation of {@link Util}. - */ -class UtilImpl { - - void replaceTableBodyRows(TableSectionElement tbody, String rowHtml) { - tbody.setInnerHTML(rowHtml); - } -}
diff --git a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/UtilImplTrident.java b/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/UtilImplTrident.java deleted file mode 100644 index efe9429..0000000 --- a/reference/Microbenchmarks/src/com/google/gwt/reference/microbenchmark/client/UtilImplTrident.java +++ /dev/null
@@ -1,44 +0,0 @@ -package com.google.gwt.reference.microbenchmark.client; - -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.TableElement; -import com.google.gwt.dom.client.TableSectionElement; - -/** - * IE implementation of Util. - */ -class UtilImplTrident extends UtilImpl { - - private final com.google.gwt.user.client.Element tmpElem = Document.get().createDivElement() - .cast(); - - /** - * IE doesn't support innerHTML on tbody, nor does it support removing or - * replacing a tbody. The only solution is to remove and replace the rows - * themselves. - */ - @Override - void replaceTableBodyRows(TableSectionElement tbody, String rowHtml) { - // Remove all children. - Element child = tbody.getFirstChildElement(); - while (child != null) { - Element next = child.getNextSiblingElement(); - tbody.removeChild(child); - child = next; - } - - // Convert the row html to child elements. - tmpElem.setInnerHTML("<table><tbody>" + rowHtml + "</tbody></table>"); - TableElement tableElem = tmpElem.getFirstChildElement().cast(); - TableSectionElement newRows = tableElem.getTBodies().getItem(0); - - // Add new child elements. - child = newRows.getFirstChildElement(); - while (child != null) { - Element next = child.getNextSiblingElement(); - tbody.appendChild(child); - child = next; - } - } -}
diff --git a/reference/Microbenchmarks/war/Microbenchmarks.html b/reference/Microbenchmarks/war/Microbenchmarks.html deleted file mode 100644 index d6dfde5..0000000 --- a/reference/Microbenchmarks/war/Microbenchmarks.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE HTML> - -<html> - <head> - <meta http-equiv="content-type" content="text/html; charset=UTF-8"> - - <!-- --> - <!-- Any title is fine --> - <!-- --> - <title>Microbenchmarks</title> - - <!-- --> - <!-- This script loads your compiled module. --> - <!-- If you add any GWT meta tags, they must --> - <!-- be added before this line. --> - <!-- --> - <script type="text/javascript" language="javascript" src="microbenchmarks/microbenchmarks.nocache.js"></script> - </head> - - <!-- --> - <!-- The body can have arbitrary html, or --> - <!-- you can leave the body empty if you want --> - <!-- to create a completely dynamic UI. --> - <!-- --> - <body> - - <!-- RECOMMENDED if your web app will not function without JavaScript enabled --> - <noscript> - <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> - Your web browser must have JavaScript enabled - in order for this application to display correctly. - </div> - </noscript> - </body> -</html>
diff --git a/reference/Microbenchmarks/war/WEB-INF/web.xml b/reference/Microbenchmarks/war/WEB-INF/web.xml deleted file mode 100644 index b5dbf31..0000000 --- a/reference/Microbenchmarks/war/WEB-INF/web.xml +++ /dev/null
@@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<web-app> - - <!-- Default page to serve --> - <welcome-file-list> - <welcome-file>Microbenchmarks.html</welcome-file> - </welcome-file-list> - -</web-app>