summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@gmail.com>2017-03-27 10:41:38 +0300
committerPekka Hyvönen <pekka@vaadin.com>2017-03-27 10:41:38 +0300
commite091687db42991012ee477e662fb844e54c1c419 (patch)
treec019cfb9da9d1febfc016d3e92cb365900f93b38 /client
parent3d018d479acb43301fb2b852586fe6f73b35593f (diff)
downloadvaadin-framework-e091687db42991012ee477e662fb844e54c1c419.tar.gz
vaadin-framework-e091687db42991012ee477e662fb844e54c1c419.zip
Use textContent instead of innerText in TextRenderer (#8936)
* Use textContent instead of innerText in TextRenderer This improves standards compliance and reduces unnecessary layouting. Optimization suggested by Oskar Hýbl, Cleverbee solutions
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/renderers/TextRenderer.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/renderers/TextRenderer.java b/client/src/main/java/com/vaadin/client/renderers/TextRenderer.java
index 061a0337da..ad3aefff98 100644
--- a/client/src/main/java/com/vaadin/client/renderers/TextRenderer.java
+++ b/client/src/main/java/com/vaadin/client/renderers/TextRenderer.java
@@ -15,6 +15,7 @@
*/
package com.vaadin.client.renderers;
+import com.google.gwt.dom.client.Element;
import com.vaadin.client.widget.grid.RendererCellReference;
/**
@@ -27,6 +28,12 @@ public class TextRenderer implements Renderer<String> {
@Override
public void render(RendererCellReference cell, String text) {
- cell.getElement().setInnerText(text);
+ // optimization suggested by Oskar Hýbl, Cleverbee solutions
+ setTextContent(cell.getElement(), text);
}
+
+ private native void setTextContent(Element elem, String text)
+ /*-{
+ elem.textContent = text;
+ }-*/;
}