Avoid textContent-related layout thrashing

See https://bugzilla.mozilla.org/show_bug.cgi?id=725221,
https://bugzilla.mozilla.org/show_bug.cgi?id=873425.
This commit is contained in:
John Firebaugh
2013-06-19 13:23:39 -07:00
parent 0689ab7f71
commit 4da529fea5

4
js/lib/d3.v3.js vendored
View File

@@ -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;
};