Remove comment thread prerendering
This should not be necessary anymore since all comments are "pre-rendered" in the gr-diff-host. I compared before and after with the Chrome profiler for the file [1] of the original report [2], and could not find a difference. [1] /c/chromiumos/third_party/coreboot/+/257398/25/src/soc/mediatek/mt8173/dramc_pi_calibration_api.c [2] https://bugs.chromium.org/p/gerrit/issues/detail?id=4335 Change-Id: If030867ddf0d7e8aba1252c06242965eca5c08c0
This commit is contained in:
@@ -156,10 +156,6 @@ limitations under the License.
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._layers = layers;
|
this._layers = layers;
|
||||||
|
|
||||||
this.async(() => {
|
|
||||||
this._preRenderThread();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render(comments, prefs) {
|
render(comments, prefs) {
|
||||||
@@ -448,25 +444,6 @@ limitations under the License.
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* In pages with large diffs, creating the first comment thread can be
|
|
||||||
* slow because nested Polymer elements (particularly
|
|
||||||
* iron-autogrow-textarea) add style elements to the document head,
|
|
||||||
* which, in turn, triggers a reflow on the page. Create a hidden
|
|
||||||
* thread, attach it to the page, and remove it so the stylesheet will
|
|
||||||
* already exist and the user's comment will be quick to load.
|
|
||||||
* @see https://gerrit-review.googlesource.com/c/82213/
|
|
||||||
*/
|
|
||||||
_preRenderThread() {
|
|
||||||
const thread = document.createElement('gr-diff-comment-thread');
|
|
||||||
thread.setAttribute('hidden', true);
|
|
||||||
thread.addDraft();
|
|
||||||
const parent = Polymer.dom(this.root);
|
|
||||||
parent.appendChild(thread);
|
|
||||||
Polymer.dom.flush();
|
|
||||||
parent.removeChild(thread);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {boolean} whether any of the lines in _groups are longer
|
* @return {boolean} whether any of the lines in _groups are longer
|
||||||
* than SYNTAX_MAX_LINE_LENGTH.
|
* than SYNTAX_MAX_LINE_LENGTH.
|
||||||
|
Reference in New Issue
Block a user