| Index: third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js b/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
|
| index dad66fe5f04cfbbb38aab9919c282fb1ef25e603..c5443c50644d19b4d4a82c15dfaca08061ec1046 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/elements/ColorSwatchPopoverIcon.js
|
| @@ -4,18 +4,18 @@
|
| /**
|
| * @unrestricted
|
| */
|
| -WebInspector.BezierPopoverIcon = class {
|
| +Elements.BezierPopoverIcon = class {
|
| /**
|
| - * @param {!WebInspector.StylePropertyTreeElement} treeElement
|
| - * @param {!WebInspector.SwatchPopoverHelper} swatchPopoverHelper
|
| - * @param {!WebInspector.BezierSwatch} swatch
|
| + * @param {!Elements.StylePropertyTreeElement} treeElement
|
| + * @param {!UI.SwatchPopoverHelper} swatchPopoverHelper
|
| + * @param {!UI.BezierSwatch} swatch
|
| */
|
| constructor(treeElement, swatchPopoverHelper, swatch) {
|
| this._treeElement = treeElement;
|
| this._swatchPopoverHelper = swatchPopoverHelper;
|
| this._swatch = swatch;
|
|
|
| - this._swatch.iconElement().title = WebInspector.UIString('Open cubic bezier editor.');
|
| + this._swatch.iconElement().title = Common.UIString('Open cubic bezier editor.');
|
| this._swatch.iconElement().addEventListener('click', this._iconClick.bind(this), false);
|
|
|
| this._boundBezierChanged = this._bezierChanged.bind(this);
|
| @@ -32,13 +32,13 @@ WebInspector.BezierPopoverIcon = class {
|
| return;
|
| }
|
|
|
| - this._bezierEditor = new WebInspector.BezierEditor();
|
| - var cubicBezier = WebInspector.Geometry.CubicBezier.parse(this._swatch.bezierText());
|
| + this._bezierEditor = new UI.BezierEditor();
|
| + var cubicBezier = Common.Geometry.CubicBezier.parse(this._swatch.bezierText());
|
| if (!cubicBezier)
|
| cubicBezier =
|
| - /** @type {!WebInspector.Geometry.CubicBezier} */ (WebInspector.Geometry.CubicBezier.parse('linear'));
|
| + /** @type {!Common.Geometry.CubicBezier} */ (Common.Geometry.CubicBezier.parse('linear'));
|
| this._bezierEditor.setBezier(cubicBezier);
|
| - this._bezierEditor.addEventListener(WebInspector.BezierEditor.Events.BezierChanged, this._boundBezierChanged);
|
| + this._bezierEditor.addEventListener(UI.BezierEditor.Events.BezierChanged, this._boundBezierChanged);
|
| this._swatchPopoverHelper.show(this._bezierEditor, this._swatch.iconElement(), this._onPopoverHidden.bind(this));
|
| this._scrollerElement = this._swatch.enclosingNodeOrSelfWithClass('style-panes-wrapper');
|
| if (this._scrollerElement)
|
| @@ -47,13 +47,13 @@ WebInspector.BezierPopoverIcon = class {
|
| this._originalPropertyText = this._treeElement.property.propertyText;
|
| this._treeElement.parentPane().setEditingStyle(true);
|
| var uiLocation =
|
| - WebInspector.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */);
|
| + Bindings.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */);
|
| if (uiLocation)
|
| - WebInspector.Revealer.reveal(uiLocation, true /* omitFocus */);
|
| + Common.Revealer.reveal(uiLocation, true /* omitFocus */);
|
| }
|
|
|
| /**
|
| - * @param {!WebInspector.Event} event
|
| + * @param {!Common.Event} event
|
| */
|
| _bezierChanged(event) {
|
| this._swatch.setBezierText(/** @type {string} */ (event.data));
|
| @@ -74,7 +74,7 @@ WebInspector.BezierPopoverIcon = class {
|
| if (this._scrollerElement)
|
| this._scrollerElement.removeEventListener('scroll', this._boundOnScroll, false);
|
|
|
| - this._bezierEditor.removeEventListener(WebInspector.BezierEditor.Events.BezierChanged, this._boundBezierChanged);
|
| + this._bezierEditor.removeEventListener(UI.BezierEditor.Events.BezierChanged, this._boundBezierChanged);
|
| delete this._bezierEditor;
|
|
|
| var propertyText = commitEdit ? this._treeElement.renderedPropertyText() : this._originalPropertyText;
|
| @@ -87,20 +87,20 @@ WebInspector.BezierPopoverIcon = class {
|
| /**
|
| * @unrestricted
|
| */
|
| -WebInspector.ColorSwatchPopoverIcon = class {
|
| +Elements.ColorSwatchPopoverIcon = class {
|
| /**
|
| - * @param {!WebInspector.StylePropertyTreeElement} treeElement
|
| - * @param {!WebInspector.SwatchPopoverHelper} swatchPopoverHelper
|
| - * @param {!WebInspector.ColorSwatch} swatch
|
| + * @param {!Elements.StylePropertyTreeElement} treeElement
|
| + * @param {!UI.SwatchPopoverHelper} swatchPopoverHelper
|
| + * @param {!UI.ColorSwatch} swatch
|
| */
|
| constructor(treeElement, swatchPopoverHelper, swatch) {
|
| this._treeElement = treeElement;
|
| - this._treeElement[WebInspector.ColorSwatchPopoverIcon._treeElementSymbol] = this;
|
| + this._treeElement[Elements.ColorSwatchPopoverIcon._treeElementSymbol] = this;
|
| this._swatchPopoverHelper = swatchPopoverHelper;
|
| this._swatch = swatch;
|
|
|
| - var shiftClickMessage = WebInspector.UIString('Shift + Click to change color format.');
|
| - this._swatch.iconElement().title = WebInspector.UIString('Open color picker. %s', shiftClickMessage);
|
| + var shiftClickMessage = Common.UIString('Shift + Click to change color format.');
|
| + this._swatch.iconElement().title = Common.UIString('Open color picker. %s', shiftClickMessage);
|
| this._swatch.iconElement().addEventListener('click', this._iconClick.bind(this));
|
| this._contrastColor = null;
|
|
|
| @@ -109,15 +109,15 @@ WebInspector.ColorSwatchPopoverIcon = class {
|
| }
|
|
|
| /**
|
| - * @param {!WebInspector.StylePropertyTreeElement} treeElement
|
| - * @return {?WebInspector.ColorSwatchPopoverIcon}
|
| + * @param {!Elements.StylePropertyTreeElement} treeElement
|
| + * @return {?Elements.ColorSwatchPopoverIcon}
|
| */
|
| static forTreeElement(treeElement) {
|
| - return treeElement[WebInspector.ColorSwatchPopoverIcon._treeElementSymbol] || null;
|
| + return treeElement[Elements.ColorSwatchPopoverIcon._treeElementSymbol] || null;
|
| }
|
|
|
| /**
|
| - * @param {!WebInspector.Color} color
|
| + * @param {!Common.Color} color
|
| */
|
| setContrastColor(color) {
|
| this._contrastColor = color;
|
| @@ -141,15 +141,15 @@ WebInspector.ColorSwatchPopoverIcon = class {
|
|
|
| var color = this._swatch.color();
|
| var format = this._swatch.format();
|
| - if (format === WebInspector.Color.Format.Original)
|
| + if (format === Common.Color.Format.Original)
|
| format = color.format();
|
| - this._spectrum = new WebInspector.Spectrum();
|
| + this._spectrum = new Components.Spectrum();
|
| this._spectrum.setColor(color, format);
|
| if (this._contrastColor)
|
| this._spectrum.setContrastColor(this._contrastColor);
|
|
|
| - this._spectrum.addEventListener(WebInspector.Spectrum.Events.SizeChanged, this._spectrumResized, this);
|
| - this._spectrum.addEventListener(WebInspector.Spectrum.Events.ColorChanged, this._boundSpectrumChanged);
|
| + this._spectrum.addEventListener(Components.Spectrum.Events.SizeChanged, this._spectrumResized, this);
|
| + this._spectrum.addEventListener(Components.Spectrum.Events.ColorChanged, this._boundSpectrumChanged);
|
| this._swatchPopoverHelper.show(this._spectrum, this._swatch.iconElement(), this._onPopoverHidden.bind(this));
|
| this._scrollerElement = this._swatch.enclosingNodeOrSelfWithClass('style-panes-wrapper');
|
| if (this._scrollerElement)
|
| @@ -158,23 +158,23 @@ WebInspector.ColorSwatchPopoverIcon = class {
|
| this._originalPropertyText = this._treeElement.property.propertyText;
|
| this._treeElement.parentPane().setEditingStyle(true);
|
| var uiLocation =
|
| - WebInspector.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */);
|
| + Bindings.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */);
|
| if (uiLocation)
|
| - WebInspector.Revealer.reveal(uiLocation, true /* omitFocus */);
|
| + Common.Revealer.reveal(uiLocation, true /* omitFocus */);
|
| }
|
|
|
| /**
|
| - * @param {!WebInspector.Event} event
|
| + * @param {!Common.Event} event
|
| */
|
| _spectrumResized(event) {
|
| this._swatchPopoverHelper.reposition();
|
| }
|
|
|
| /**
|
| - * @param {!WebInspector.Event} event
|
| + * @param {!Common.Event} event
|
| */
|
| _spectrumChanged(event) {
|
| - var color = WebInspector.Color.parse(/** @type {string} */ (event.data));
|
| + var color = Common.Color.parse(/** @type {string} */ (event.data));
|
| if (!color)
|
| return;
|
| this._swatch.setColor(color);
|
| @@ -195,7 +195,7 @@ WebInspector.ColorSwatchPopoverIcon = class {
|
| if (this._scrollerElement)
|
| this._scrollerElement.removeEventListener('scroll', this._boundOnScroll, false);
|
|
|
| - this._spectrum.removeEventListener(WebInspector.Spectrum.Events.ColorChanged, this._boundSpectrumChanged);
|
| + this._spectrum.removeEventListener(Components.Spectrum.Events.ColorChanged, this._boundSpectrumChanged);
|
| delete this._spectrum;
|
|
|
| var propertyText = commitEdit ? this._treeElement.renderedPropertyText() : this._originalPropertyText;
|
| @@ -205,27 +205,27 @@ WebInspector.ColorSwatchPopoverIcon = class {
|
| }
|
| };
|
|
|
| -WebInspector.ColorSwatchPopoverIcon._treeElementSymbol =
|
| - Symbol('WebInspector.ColorSwatchPopoverIcon._treeElementSymbol');
|
| +Elements.ColorSwatchPopoverIcon._treeElementSymbol =
|
| + Symbol('Elements.ColorSwatchPopoverIcon._treeElementSymbol');
|
|
|
|
|
| /**
|
| * @unrestricted
|
| */
|
| -WebInspector.ShadowSwatchPopoverHelper = class {
|
| +Elements.ShadowSwatchPopoverHelper = class {
|
| /**
|
| - * @param {!WebInspector.StylePropertyTreeElement} treeElement
|
| - * @param {!WebInspector.SwatchPopoverHelper} swatchPopoverHelper
|
| - * @param {!WebInspector.CSSShadowSwatch} shadowSwatch
|
| + * @param {!Elements.StylePropertyTreeElement} treeElement
|
| + * @param {!UI.SwatchPopoverHelper} swatchPopoverHelper
|
| + * @param {!UI.CSSShadowSwatch} shadowSwatch
|
| */
|
| constructor(treeElement, swatchPopoverHelper, shadowSwatch) {
|
| this._treeElement = treeElement;
|
| - this._treeElement[WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol] = this;
|
| + this._treeElement[Elements.ShadowSwatchPopoverHelper._treeElementSymbol] = this;
|
| this._swatchPopoverHelper = swatchPopoverHelper;
|
| this._shadowSwatch = shadowSwatch;
|
| this._iconElement = shadowSwatch.iconElement();
|
|
|
| - this._iconElement.title = WebInspector.UIString('Open shadow editor.');
|
| + this._iconElement.title = Common.UIString('Open shadow editor.');
|
| this._iconElement.addEventListener('click', this._iconClick.bind(this), false);
|
|
|
| this._boundShadowChanged = this._shadowChanged.bind(this);
|
| @@ -233,11 +233,11 @@ WebInspector.ShadowSwatchPopoverHelper = class {
|
| }
|
|
|
| /**
|
| - * @param {!WebInspector.StylePropertyTreeElement} treeElement
|
| - * @return {?WebInspector.ShadowSwatchPopoverHelper}
|
| + * @param {!Elements.StylePropertyTreeElement} treeElement
|
| + * @return {?Elements.ShadowSwatchPopoverHelper}
|
| */
|
| static forTreeElement(treeElement) {
|
| - return treeElement[WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol] || null;
|
| + return treeElement[Elements.ShadowSwatchPopoverHelper._treeElementSymbol] || null;
|
| }
|
|
|
| /**
|
| @@ -254,9 +254,9 @@ WebInspector.ShadowSwatchPopoverHelper = class {
|
| return;
|
| }
|
|
|
| - this._cssShadowEditor = new WebInspector.CSSShadowEditor();
|
| + this._cssShadowEditor = new UI.CSSShadowEditor();
|
| this._cssShadowEditor.setModel(this._shadowSwatch.model());
|
| - this._cssShadowEditor.addEventListener(WebInspector.CSSShadowEditor.Events.ShadowChanged, this._boundShadowChanged);
|
| + this._cssShadowEditor.addEventListener(UI.CSSShadowEditor.Events.ShadowChanged, this._boundShadowChanged);
|
| this._swatchPopoverHelper.show(this._cssShadowEditor, this._iconElement, this._onPopoverHidden.bind(this));
|
| this._scrollerElement = this._iconElement.enclosingNodeOrSelfWithClass('style-panes-wrapper');
|
| if (this._scrollerElement)
|
| @@ -265,16 +265,16 @@ WebInspector.ShadowSwatchPopoverHelper = class {
|
| this._originalPropertyText = this._treeElement.property.propertyText;
|
| this._treeElement.parentPane().setEditingStyle(true);
|
| var uiLocation =
|
| - WebInspector.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */);
|
| + Bindings.cssWorkspaceBinding.propertyUILocation(this._treeElement.property, false /* forName */);
|
| if (uiLocation)
|
| - WebInspector.Revealer.reveal(uiLocation, true /* omitFocus */);
|
| + Common.Revealer.reveal(uiLocation, true /* omitFocus */);
|
| }
|
|
|
| /**
|
| - * @param {!WebInspector.Event} event
|
| + * @param {!Common.Event} event
|
| */
|
| _shadowChanged(event) {
|
| - this._shadowSwatch.setCSSShadow(/** @type {!WebInspector.CSSShadowModel} */ (event.data));
|
| + this._shadowSwatch.setCSSShadow(/** @type {!Common.CSSShadowModel} */ (event.data));
|
| this._treeElement.applyStyleText(this._treeElement.renderedPropertyText(), false);
|
| }
|
|
|
| @@ -293,7 +293,7 @@ WebInspector.ShadowSwatchPopoverHelper = class {
|
| this._scrollerElement.removeEventListener('scroll', this._boundOnScroll, false);
|
|
|
| this._cssShadowEditor.removeEventListener(
|
| - WebInspector.CSSShadowEditor.Events.ShadowChanged, this._boundShadowChanged);
|
| + UI.CSSShadowEditor.Events.ShadowChanged, this._boundShadowChanged);
|
| delete this._cssShadowEditor;
|
|
|
| var propertyText = commitEdit ? this._treeElement.renderedPropertyText() : this._originalPropertyText;
|
| @@ -303,5 +303,5 @@ WebInspector.ShadowSwatchPopoverHelper = class {
|
| }
|
| };
|
|
|
| -WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol =
|
| - Symbol('WebInspector.ShadowSwatchPopoverHelper._treeElementSymbol');
|
| +Elements.ShadowSwatchPopoverHelper._treeElementSymbol =
|
| + Symbol('Elements.ShadowSwatchPopoverHelper._treeElementSymbol');
|
|
|