Changeset 189845 in webkit


Ignore:
Timestamp:
Sep 15, 2015 9:22:21 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Picking unchanged for font-size does not reset back to the unchanged value
https://bugs.webkit.org/show_bug.cgi?id=148351

Patch by Devin Rousso <Devin Rousso> on 2015-09-15
Reviewed by Brian Burg.

Visual number editors now save any new values in the special placeholder element
to display it whenever the "Unchanged" option is selected by the user.

  • UserInterface/Views/VisualStyleNumberInputBox.js:

(WebInspector.VisualStyleNumberInputBox.prototype.set value):
(WebInspector.VisualStyleNumberInputBox.prototype.set units):
(WebInspector.VisualStyleNumberInputBox.prototype._setNumberInputIsEditable):
(WebInspector.VisualStyleNumberInputBox.prototype._keywordChanged):
(WebInspector.VisualStyleNumberInputBox.prototype._valueNumberInputKeyDown.adjustValue):
(WebInspector.VisualStyleNumberInputBox.prototype._valueNumberInputKeyDown):

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r189828 r189845  
     12015-09-15  Devin Rousso  <dcrousso+webkit@gmail.com>
     2
     3        Web Inspector: Picking unchanged for font-size does not reset back to the unchanged value
     4        https://bugs.webkit.org/show_bug.cgi?id=148351
     5
     6        Reviewed by Brian Burg.
     7
     8        Visual number editors now save any new values in the special placeholder element
     9        to display it whenever the "Unchanged" option is selected by the user.
     10
     11        * UserInterface/Views/VisualStyleNumberInputBox.js:
     12        (WebInspector.VisualStyleNumberInputBox.prototype.set value):
     13        (WebInspector.VisualStyleNumberInputBox.prototype.set units):
     14        (WebInspector.VisualStyleNumberInputBox.prototype._setNumberInputIsEditable):
     15        (WebInspector.VisualStyleNumberInputBox.prototype._keywordChanged):
     16        (WebInspector.VisualStyleNumberInputBox.prototype._valueNumberInputKeyDown.adjustValue):
     17        (WebInspector.VisualStyleNumberInputBox.prototype._valueNumberInputKeyDown):
     18
    1192015-09-15  Brian Burg  <bburg@apple.com>
    220
  • trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleNumberInputBox.js

    r189210 r189845  
    112112            return;
    113113
    114         if (this._updatedValues.propertyMissing && isNaN(value)) {
    115             this._unchangedOptionElement.selected = true;
    116             this._numberInputIsEditable = false;
    117             this.contentElement.classList.remove("number-input-editable");
    118             this.specialPropertyPlaceholderElement.hidden = false;
    119             return;
     114        if (this._updatedValues.propertyMissing) {
     115            if (value || this._updatedValues.placeholder)
     116                this.specialPropertyPlaceholderElement.textContent = (value || this._updatedValues.placeholder) + (this._updatedValues.units || "");
     117
     118            if (isNaN(value)) {
     119                this._unchangedOptionElement.selected = true;
     120                this._setNumberInputIsEditable();
     121                this.specialPropertyPlaceholderElement.hidden = false;
     122                return;
     123            }
    120124        }
    121125
     
    129133
    130134        if (!isNaN(value)) {
    131             this._numberInputIsEditable = true;
    132             this.contentElement.classList.add("number-input-editable");
     135            this._setNumberInputIsEditable(true);
    133136            this._valueNumberInputElement.value = Math.round(value * 100) / 100;
    134137            this._markUnitsContainerIfInputHasValue();
     
    137140
    138141        if (this.valueIsSupportedKeyword(value)) {
    139             this._numberInputIsEditable = false;
    140             this.contentElement.classList.remove("number-input-editable");
     142            this._setNumberInputIsEditable();
    141143            this._keywordSelectElement.value = value;
    142144            return;
     
    170172            this._addAdvancedUnits();
    171173
    172         this._numberInputIsEditable = true;
    173         this.contentElement.classList.add("number-input-editable");
     174        this._setNumberInputIsEditable(true);
    174175        this._keywordSelectElement.value = unit;
    175176        this._unitsElementTextContent = unit;
     
    230231        this._unitsElement.textContent = text;
    231232        this._markUnitsContainerIfInputHasValue();
     233    }
     234
     235    _setNumberInputIsEditable(flag)
     236    {
     237        this._numberInputIsEditable = flag || false;
     238        this.contentElement.classList.toggle("number-input-editable", this._numberInputIsEditable);
    232239    }
    233240
     
    247254
    248255            this._unitsElementTextContent = this._keywordSelectElement.value;
    249             this._numberInputIsEditable = selectedKeywordIsUnit;
    250             this.contentElement.classList.toggle("number-input-editable", selectedKeywordIsUnit);
    251         }
     256            this._setNumberInputIsEditable(selectedKeywordIsUnit);
     257        } else
     258            this._setNumberInputIsEditable(false);
    252259
    253260        this._valueDidChange();
     
    273280                newValue = 0;
    274281
     282            this._updatedValues.propertyMissing = false;
    275283            this.value = Math.round(newValue * 100) / 100;
    276284            this._valueDidChange();
Note: See TracChangeset for help on using the changeset viewer.