[go: nahoru, domu]

Fix internal bindings in ui/

These were some left-over fixes that regressed while doing phase 3 of
ESM. It includes fixing the typedefs in ui-legacy to be in the proper
file and exported.

Bug: 1006759
Change-Id: Ie398fcec632bcaf6462b44581213f5e6c45882de
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2055066
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
diff --git a/front_end/ui/ViewManager.js b/front_end/ui/ViewManager.js
index fbd238e..11f0699 100644
--- a/front_end/ui/ViewManager.js
+++ b/front_end/ui/ViewManager.js
@@ -3,6 +3,8 @@
 // found in the LICENSE file.
 
 import * as Common from '../common/common.js';
+
+import * as ARIAUtils from './ARIAUtils.js';
 import {ContextMenu} from './ContextMenu.js';  // eslint-disable-line no-unused-vars
 import {Icon} from './Icon.js';
 import {Events as TabbedPaneEvents, TabbedPane} from './TabbedPane.js';
@@ -178,8 +180,8 @@
     this.element.classList.add('flex-auto', 'view-container', 'overflow-auto');
     this._view = view;
     this.element.tabIndex = -1;
-    UI.ARIAUtils.markAsTabpanel(this.element);
-    UI.ARIAUtils.setAccessibleName(this.element, ls`${view.title()} panel`);
+    ARIAUtils.markAsTabpanel(this.element);
+    ARIAUtils.setAccessibleName(this.element, ls`${view.title()} panel`);
     this.setDefaultFocusedElement(this.element);
   }
 
@@ -240,19 +242,19 @@
     this.registerRequiredCSS('ui/viewContainers.css');
 
     this._titleElement = createElementWithClass('div', 'expandable-view-title');
-    UI.ARIAUtils.markAsButton(this._titleElement);
+    ARIAUtils.markAsButton(this._titleElement);
     this._titleExpandIcon = Icon.create('smallicon-triangle-right', 'title-expand-icon');
     this._titleElement.appendChild(this._titleExpandIcon);
     const titleText = view.title();
     this._titleElement.createTextChild(titleText);
-    UI.ARIAUtils.setAccessibleName(this._titleElement, titleText);
-    UI.ARIAUtils.setExpanded(this._titleElement, false);
+    ARIAUtils.setAccessibleName(this._titleElement, titleText);
+    ARIAUtils.setExpanded(this._titleElement, false);
     this._titleElement.tabIndex = 0;
     self.onInvokeElement(this._titleElement, this._toggleExpanded.bind(this));
     this._titleElement.addEventListener('keydown', this._onTitleKeyDown.bind(this), false);
     this.contentElement.insertBefore(this._titleElement, this.contentElement.firstChild);
 
-    UI.ARIAUtils.setControls(this._titleElement, this.contentElement.createChild('slot'));
+    ARIAUtils.setControls(this._titleElement, this.contentElement.createChild('slot'));
     this._view = view;
     view[_ExpandableContainerWidget._symbol] = this;
   }
@@ -298,7 +300,7 @@
       return this._materialize();
     }
     this._titleElement.classList.add('expanded');
-    UI.ARIAUtils.setExpanded(this._titleElement, true);
+    ARIAUtils.setExpanded(this._titleElement, true);
     this._titleExpandIcon.setIconType('smallicon-triangle-down');
     return this._materialize().then(() => this._widget.show(this.element));
   }
@@ -308,7 +310,7 @@
       return;
     }
     this._titleElement.classList.remove('expanded');
-    UI.ARIAUtils.setExpanded(this._titleElement, false);
+    ARIAUtils.setExpanded(this._titleElement, false);
     this._titleExpandIcon.setIconType('smallicon-triangle-right');
     this._materialize().then(() => this._widget.detach());
   }
@@ -511,7 +513,7 @@
   /**
    * @override
    * @param {!View} view
-   * @param {?UI.View=} insertBefore
+   * @param {?View=} insertBefore
    */
   appendView(view, insertBefore) {
     if (this._tabbedPane.hasTab(view.viewId())) {
@@ -559,7 +561,7 @@
   /**
    * @override
    * @param {!View} view
-   * @param {?UI.View=} insertBefore
+   * @param {?View=} insertBefore
    * @param {boolean=} userGesture
    * @param {boolean=} omitFocus
    * @return {!Promise}
@@ -662,7 +664,7 @@
   /**
    * @override
    * @param {!View} view
-   * @param {?UI.View=} insertBefore
+   * @param {?View=} insertBefore
    */
   appendView(view, insertBefore) {
     const oldLocation = view[_Location.symbol];
@@ -688,7 +690,7 @@
   /**
    * @override
    * @param {!View} view
-   * @param {?UI.View=} insertBefore
+   * @param {?View=} insertBefore
    * @return {!Promise}
    */
   showView(view, insertBefore) {