| Index: Source/devtools/front_end/DOMExtension.js
|
| diff --git a/Source/devtools/front_end/DOMExtension.js b/Source/devtools/front_end/DOMExtension.js
|
| index b9629db22ae888684218858aa77034103cff8a75..550ba0ad011f136bba8db38c9efb0d2570917bc8 100644
|
| --- a/Source/devtools/front_end/DOMExtension.js
|
| +++ b/Source/devtools/front_end/DOMExtension.js
|
| @@ -570,6 +570,26 @@ Node.prototype.traversePreviousNode = function(stayWithin)
|
| }
|
|
|
| /**
|
| + * @param {*} text
|
| + * @return {boolean} true if was truncated
|
| + */
|
| +Node.prototype.setTextContentTruncatedIfNeeded = function(text)
|
| +{
|
| + // Huge texts in the UI reduce rendering performance drastically.
|
| + // Moreover Blink/WebKit uses <unsigned short> internally for storing text content
|
| + // length, so texts longer than 65535 are inherently displayed incorrectly.
|
| + const maxTextContentLength = 65535;
|
| +
|
| + if (typeof text === "string" && text.length > maxTextContentLength) {
|
| + this.textContent = text.trimEnd(maxTextContentLength);
|
| + return true;
|
| + }
|
| +
|
| + this.textContent = text;
|
| + return false;
|
| +}
|
| +
|
| +/**
|
| * @return {boolean}
|
| */
|
| function isEnterKey(event) {
|
|
|