Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js

Issue 2573673002: DevTools: enable private field checks as a part of compilation. (Closed)
Patch Set: review comments addressed. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
index adf618e7e7f409f8953b330c0271ab8ae7c1f906..7bbc2e1eb33f501858d9ff34be38ae3037f519bf 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/ViewportDataGrid.js
@@ -221,7 +221,7 @@ UI.ViewportDataGrid = class extends UI.DataGrid {
for (var i = 0; i < this._visibleNodes.length; ++i) {
var oldNode = this._visibleNodes[i];
if (!visibleNodesSet.has(oldNode) && oldNode.attached()) {
- var element = oldNode._element;
+ var element = oldNode.existingElement();
if (element === this._wheelTarget)
this._hiddenWheelTarget = oldNode.abandonElement();
else
@@ -306,18 +306,13 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
* @return {!Element}
*/
element() {
- if (!this._element) {
- this.createElement();
- this.createCells();
+ var existingElement = this.existingElement();
+ var element = existingElement || this.createElement();
+ if (!existingElement || this._stale) {
+ this.createCells(element);
this._stale = false;
}
-
- if (this._stale) {
- this.createCells();
- this._stale = false;
- }
-
- return /** @type {!Element} */ (this._element);
+ return element;
}
/**
@@ -391,7 +386,7 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
_unlink() {
if (this.attached()) {
- this._element.remove();
+ this.existingElement().remove();
this.wasDetached();
}
this.dataGrid = null;
@@ -407,8 +402,8 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
if (!this._expanded)
return;
this._expanded = false;
- if (this._element)
- this._element.classList.remove('expanded');
+ if (this.existingElement())
+ this.existingElement().classList.remove('expanded');
this.dataGrid.scheduleUpdateStructure();
}
@@ -433,7 +428,7 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
* @return {boolean}
*/
attached() {
- return !!(this.dataGrid && this._element && this._element.parentElement);
+ return !!(this.dataGrid && this.existingElement() && this.existingElement().parentElement);
}
/**
@@ -444,7 +439,7 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
this._stale = true;
this.dataGrid.scheduleUpdate();
} else {
- this._element = null;
+ this.resetElement();
}
}
@@ -452,10 +447,10 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
* @return {?Element}
*/
abandonElement() {
- var result = this._element;
+ var result = this.existingElement();
if (result)
result.style.display = 'none';
- this._element = null;
+ this.resetElement();
return result;
}

Powered by Google App Engine
This is Rietveld 408576698