From 4da529fea57ba4da96ff0dc7d3701ff9913bbb73 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 19 Jun 2013 13:23:39 -0700 Subject: [PATCH] Avoid textContent-related layout thrashing See https://bugzilla.mozilla.org/show_bug.cgi?id=725221, https://bugzilla.mozilla.org/show_bug.cgi?id=873425. --- js/lib/d3.v3.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/lib/d3.v3.js b/js/lib/d3.v3.js index 8fd4ca883..3008e5005 100644 --- a/js/lib/d3.v3.js +++ b/js/lib/d3.v3.js @@ -958,8 +958,8 @@ d3_selectionPrototype.text = function(value) { return arguments.length ? this.each(typeof value === "function" ? function() { var v = value.apply(this, arguments); this.textContent = v == null ? "" : v; } : value == null - ? function() { this.textContent = ""; } - : function() { this.textContent = value; }) + ? function() { if (this.textContent !== "") this.textContent = ""; } + : function() { if (this.textContent !== value) this.textContent = value; }) : this.node().textContent; };