Changeset 188229 in webkit


Ignore:
Timestamp:
Aug 10, 2015 1:56:18 PM (9 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Add different types of non-numerical Visual editors for CSS properties
https://bugs.webkit.org/show_bug.cgi?id=147711

Added editors for keyword based CSS properties for use in the Visual style
details panel in the CSS sidebar. Also added images for keyword values that
are simple enough to be conveyed in an image.

Reviewed by Brian Burg.

  • UserInterface/Images/ClearBoth.svg: Added.
  • UserInterface/Images/ClearLeft.svg: Added.
  • UserInterface/Images/ClearRight.svg: Added.
  • UserInterface/Images/FloatLeft.svg: Added.
  • UserInterface/Images/FloatRight.svg: Added.
  • UserInterface/Images/FontStyleItalic.svg: Added.
  • UserInterface/Images/FontStyleNormal.svg: Added.
  • UserInterface/Images/FontVariantSmallCaps.svg: Added.
  • UserInterface/Images/TextAlignCenter.svg: Added.
  • UserInterface/Images/TextAlignJustify.svg: Added.
  • UserInterface/Images/TextAlignLeft.svg: Added.
  • UserInterface/Images/TextAlignRight.svg: Added.
  • UserInterface/Images/TextDecorationLineThrough.svg: Added.
  • UserInterface/Images/TextDecorationOverline.svg: Added.
  • UserInterface/Images/TextDecorationUnderline.svg: Added.
  • UserInterface/Images/TextTransformCapitalize.svg: Added.
  • UserInterface/Images/TextTransformLowercase.svg: Added.
  • UserInterface/Images/TextTransformUppercase.svg: Added.
  • UserInterface/Images/VisualStyleNone.svg: Added.
  • UserInterface/Views/CSSStyleDeclarationTextEditor.js:

(WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches.update):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches):
Changed color swatch title.

  • UserInterface/Views/Slider.js:

(WebInspector.Slider):
(WebInspector.Slider.prototype.set value):
(WebInspector.Slider.prototype.set knobX):
(WebInspector.Slider.prototype.get maxX):
If the given value is below 0, reset it to 0.
(WebInspector.Slider.prototype._handleMousedown):
(WebInspector.Slider.prototype._handleMousemove):
(WebInspector.Slider.prototype.get _maxX): Deleted.

  • UserInterface/Views/VisualStyleColorPicker.css: Added.

(.visual-style-property-container.input-color-picker > .visual-style-property-value-container):
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .visual-style-special-property-placeholder):
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch):
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch:hover):
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch:active):
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch > span):
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > input):
(.visual-style-property-container.input-color-picker.multiple > .visual-style-property-value-container > .visual-style-multiple-property-placeholder):

  • UserInterface/Views/VisualStyleColorPicker.js: Added.

(WebInspector.VisualStyleColorPicker):
(WebInspector.VisualStyleColorPicker.prototype.get value):
(WebInspector.VisualStyleColorPicker.prototype.set value):
(WebInspector.VisualStyleColorPicker.prototype.get placeholder):
(WebInspector.VisualStyleColorPicker.prototype.set placeholder):
(WebInspector.VisualStyleColorPicker.prototype.get synthesizedValue):
(WebInspector.VisualStyleColorPicker.prototype.get hasCompletions):
(WebInspector.VisualStyleColorPicker.prototype.set completions):
(WebInspector.VisualStyleColorPicker.prototype._updateColorSwatch):
(WebInspector.VisualStyleColorPicker.prototype._colorSwatchClicked):
(WebInspector.VisualStyleColorPicker.prototype._colorPickerColorDidChange):
(WebInspector.VisualStyleColorPicker.prototype._completionClicked):
(WebInspector.VisualStyleColorPicker.prototype._textInputKeyDown):
(WebInspector.VisualStyleColorPicker.prototype._textInputKeyUp):
(WebInspector.VisualStyleColorPicker.prototype._showCompletionsIfAble):
(WebInspector.VisualStyleColorPicker.prototype._hideCompletions):
(WebInspector.VisualStyleColorPicker.prototype._toggleTabbingOfSelectableElements):

  • UserInterface/Views/VisualStyleKeywordCheckbox.css: Added.

(.visual-style-property-container.keyword-checkbox > .visual-style-property-value-container):
(.visual-style-property-container.keyword-checkbox > .visual-style-property-value-container > input):
(.visual-style-property-container.keyword-checkbox > .visual-style-property-value-container > div):

  • UserInterface/Views/VisualStyleKeywordCheckbox.js: Added.

(WebInspector.VisualStyleKeywordCheckbox):
(WebInspector.VisualStyleKeywordCheckbox.prototype.get value):
(WebInspector.VisualStyleKeywordCheckbox.prototype.set value):
(WebInspector.VisualStyleKeywordCheckbox.prototype.get synthesizedValue):
(WebInspector.VisualStyleKeywordCheckbox.prototype._toggleTabbingOfSelectableElements):

  • UserInterface/Views/VisualStyleKeywordIconList.css: Added.

(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:first-child):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:last-child):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:matches(.computed, .selected)):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected svg .stroked):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected svg .filled):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:matches(.computed, .selected) + .keyword-icon):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon > div):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:not(.selected) > div):

  • UserInterface/Views/VisualStyleKeywordIconList.js: Added.

(WebInspector.VisualStyleKeywordIconList.dashToCapital):
(WebInspector.VisualStyleKeywordIconList.createListItem):
(WebInspector.VisualStyleKeywordIconList):
(WebInspector.VisualStyleKeywordIconList.prototype.get value):
(WebInspector.VisualStyleKeywordIconList.prototype.set value):
(WebInspector.VisualStyleKeywordIconList.prototype.get synthesizedValue):
(WebInspector.VisualStyleKeywordIconList.prototype._handleKeywordChanged):

  • UserInterface/Views/VisualStyleKeywordPicker.js: Added.

(WebInspector.VisualStyleKeywordPicker):
(WebInspector.VisualStyleKeywordPicker.prototype.get value):
(WebInspector.VisualStyleKeywordPicker.prototype.set value):
(WebInspector.VisualStyleKeywordPicker.prototype.set placeholder):
(WebInspector.VisualStyleKeywordPicker.prototype.get synthesizedValue):
(WebInspector.VisualStyleKeywordPicker.prototype.updateEditorValues):
(WebInspector.VisualStyleKeywordPicker.prototype._handleKeywordChanged):
(WebInspector.VisualStyleKeywordPicker.prototype._keywordSelectMouseDown):
(WebInspector.VisualStyleKeywordPicker.prototype._addValues):
(WebInspector.VisualStyleKeywordPicker.prototype._addAdvancedValues):
(WebInspector.VisualStyleKeywordPicker.prototype._removeAdvancedValues):
(WebInspector.VisualStyleKeywordPicker.prototype._toggleTabbingOfSelectableElements):

  • UserInterface/Views/VisualStylePropertyNameInput.js: Added.

(WebInspector.VisualStylePropertyNameInput):
(WebInspector.VisualStylePropertyNameInput.prototype.get value):
(WebInspector.VisualStylePropertyNameInput.prototype.set value):
(WebInspector.VisualStylePropertyNameInput.prototype.get synthesizedValue):
(WebInspector.VisualStylePropertyNameInput.prototype.get hasCompletions):
(WebInspector.VisualStylePropertyNameInput.prototype.set completions):
(WebInspector.VisualStylePropertyNameInput.prototype._completionClicked):
(WebInspector.VisualStylePropertyNameInput.prototype._inputKeyDown):
(WebInspector.VisualStylePropertyNameInput.prototype._inputKeyUp):
(WebInspector.VisualStylePropertyNameInput.prototype._hideCompletions):
(WebInspector.VisualStylePropertyNameInput.prototype._toggleTabbingOfSelectableElements):

  • UserInterface/Views/VisualStyleURLInput.js: Added.

(WebInspector.VisualStyleURLInput):
(WebInspector.VisualStyleURLInput.prototype.set get value):
(WebInspector.VisualStyleURLInput.prototype.parseValue):

  • UserInterface/Views/VisualStyleUnitSlider.css: Added.

(.visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider):
(.visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider > img):
(.visual-style-property-container.unit-slider.opacity > .visual-style-property-value-container > .slider):

  • UserInterface/Views/VisualStyleUnitSlider.js: Added.

(WebInspector.VisualStyleUnitSlider):
(WebInspector.VisualStyleUnitSlider.prototype.set value):
(WebInspector.VisualStyleUnitSlider.prototype.get value):
(WebInspector.VisualStyleUnitSlider.prototype.get synthesizedValue):
(WebInspector.VisualStyleUnitSlider.prototype.sliderValueDidChange):

Location:
trunk/Source/WebInspectorUI
Files:
30 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r188226 r188229  
     12015-08-10  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Add different types of non-numerical Visual editors for CSS properties
     4        https://bugs.webkit.org/show_bug.cgi?id=147711
     5
     6        Added editors for keyword based CSS properties for use in the Visual style
     7        details panel in the CSS sidebar.  Also added images for keyword values that
     8        are simple enough to be conveyed in an image.
     9
     10        Reviewed by Brian Burg.
     11
     12        * UserInterface/Images/ClearBoth.svg: Added.
     13        * UserInterface/Images/ClearLeft.svg: Added.
     14        * UserInterface/Images/ClearRight.svg: Added.
     15        * UserInterface/Images/FloatLeft.svg: Added.
     16        * UserInterface/Images/FloatRight.svg: Added.
     17        * UserInterface/Images/FontStyleItalic.svg: Added.
     18        * UserInterface/Images/FontStyleNormal.svg: Added.
     19        * UserInterface/Images/FontVariantSmallCaps.svg: Added.
     20        * UserInterface/Images/TextAlignCenter.svg: Added.
     21        * UserInterface/Images/TextAlignJustify.svg: Added.
     22        * UserInterface/Images/TextAlignLeft.svg: Added.
     23        * UserInterface/Images/TextAlignRight.svg: Added.
     24        * UserInterface/Images/TextDecorationLineThrough.svg: Added.
     25        * UserInterface/Images/TextDecorationOverline.svg: Added.
     26        * UserInterface/Images/TextDecorationUnderline.svg: Added.
     27        * UserInterface/Images/TextTransformCapitalize.svg: Added.
     28        * UserInterface/Images/TextTransformLowercase.svg: Added.
     29        * UserInterface/Images/TextTransformUppercase.svg: Added.
     30        * UserInterface/Images/VisualStyleNone.svg: Added.
     31        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
     32        (WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches.update):
     33        (WebInspector.CSSStyleDeclarationTextEditor.prototype._createColorSwatches):
     34        Changed color swatch title.
     35
     36        * UserInterface/Views/Slider.js:
     37        (WebInspector.Slider):
     38        (WebInspector.Slider.prototype.set value):
     39        (WebInspector.Slider.prototype.set knobX):
     40        (WebInspector.Slider.prototype.get maxX):
     41        If the given value is below 0, reset it to 0.
     42        (WebInspector.Slider.prototype._handleMousedown):
     43        (WebInspector.Slider.prototype._handleMousemove):
     44        (WebInspector.Slider.prototype.get _maxX): Deleted.
     45
     46        * UserInterface/Views/VisualStyleColorPicker.css: Added.
     47        (.visual-style-property-container.input-color-picker > .visual-style-property-value-container):
     48        (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .visual-style-special-property-placeholder):
     49        (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch):
     50        (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch:hover):
     51        (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch:active):
     52        (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .color-swatch > span):
     53        (.visual-style-property-container.input-color-picker > .visual-style-property-value-container > input):
     54        (.visual-style-property-container.input-color-picker.multiple > .visual-style-property-value-container > .visual-style-multiple-property-placeholder):
     55
     56        * UserInterface/Views/VisualStyleColorPicker.js: Added.
     57        (WebInspector.VisualStyleColorPicker):
     58        (WebInspector.VisualStyleColorPicker.prototype.get value):
     59        (WebInspector.VisualStyleColorPicker.prototype.set value):
     60        (WebInspector.VisualStyleColorPicker.prototype.get placeholder):
     61        (WebInspector.VisualStyleColorPicker.prototype.set placeholder):
     62        (WebInspector.VisualStyleColorPicker.prototype.get synthesizedValue):
     63        (WebInspector.VisualStyleColorPicker.prototype.get hasCompletions):
     64        (WebInspector.VisualStyleColorPicker.prototype.set completions):
     65        (WebInspector.VisualStyleColorPicker.prototype._updateColorSwatch):
     66        (WebInspector.VisualStyleColorPicker.prototype._colorSwatchClicked):
     67        (WebInspector.VisualStyleColorPicker.prototype._colorPickerColorDidChange):
     68        (WebInspector.VisualStyleColorPicker.prototype._completionClicked):
     69        (WebInspector.VisualStyleColorPicker.prototype._textInputKeyDown):
     70        (WebInspector.VisualStyleColorPicker.prototype._textInputKeyUp):
     71        (WebInspector.VisualStyleColorPicker.prototype._showCompletionsIfAble):
     72        (WebInspector.VisualStyleColorPicker.prototype._hideCompletions):
     73        (WebInspector.VisualStyleColorPicker.prototype._toggleTabbingOfSelectableElements):
     74
     75        * UserInterface/Views/VisualStyleKeywordCheckbox.css: Added.
     76        (.visual-style-property-container.keyword-checkbox > .visual-style-property-value-container):
     77        (.visual-style-property-container.keyword-checkbox > .visual-style-property-value-container > input):
     78        (.visual-style-property-container.keyword-checkbox > .visual-style-property-value-container > div):
     79
     80        * UserInterface/Views/VisualStyleKeywordCheckbox.js: Added.
     81        (WebInspector.VisualStyleKeywordCheckbox):
     82        (WebInspector.VisualStyleKeywordCheckbox.prototype.get value):
     83        (WebInspector.VisualStyleKeywordCheckbox.prototype.set value):
     84        (WebInspector.VisualStyleKeywordCheckbox.prototype.get synthesizedValue):
     85        (WebInspector.VisualStyleKeywordCheckbox.prototype._toggleTabbingOfSelectableElements):
     86
     87        * UserInterface/Views/VisualStyleKeywordIconList.css: Added.
     88        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container):
     89        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container):
     90        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon):
     91        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:first-child):
     92        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:last-child):
     93        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:matches(.computed, .selected)):
     94        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected):
     95        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected svg .stroked):
     96        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected svg .filled):
     97        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:matches(.computed, .selected) + .keyword-icon):
     98        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon > div):
     99        (.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:not(.selected) > div):
     100
     101        * UserInterface/Views/VisualStyleKeywordIconList.js: Added.
     102        (WebInspector.VisualStyleKeywordIconList.dashToCapital):
     103        (WebInspector.VisualStyleKeywordIconList.createListItem):
     104        (WebInspector.VisualStyleKeywordIconList):
     105        (WebInspector.VisualStyleKeywordIconList.prototype.get value):
     106        (WebInspector.VisualStyleKeywordIconList.prototype.set value):
     107        (WebInspector.VisualStyleKeywordIconList.prototype.get synthesizedValue):
     108        (WebInspector.VisualStyleKeywordIconList.prototype._handleKeywordChanged):
     109
     110        * UserInterface/Views/VisualStyleKeywordPicker.js: Added.
     111        (WebInspector.VisualStyleKeywordPicker):
     112        (WebInspector.VisualStyleKeywordPicker.prototype.get value):
     113        (WebInspector.VisualStyleKeywordPicker.prototype.set value):
     114        (WebInspector.VisualStyleKeywordPicker.prototype.set placeholder):
     115        (WebInspector.VisualStyleKeywordPicker.prototype.get synthesizedValue):
     116        (WebInspector.VisualStyleKeywordPicker.prototype.updateEditorValues):
     117        (WebInspector.VisualStyleKeywordPicker.prototype._handleKeywordChanged):
     118        (WebInspector.VisualStyleKeywordPicker.prototype._keywordSelectMouseDown):
     119        (WebInspector.VisualStyleKeywordPicker.prototype._addValues):
     120        (WebInspector.VisualStyleKeywordPicker.prototype._addAdvancedValues):
     121        (WebInspector.VisualStyleKeywordPicker.prototype._removeAdvancedValues):
     122        (WebInspector.VisualStyleKeywordPicker.prototype._toggleTabbingOfSelectableElements):
     123
     124        * UserInterface/Views/VisualStylePropertyNameInput.js: Added.
     125        (WebInspector.VisualStylePropertyNameInput):
     126        (WebInspector.VisualStylePropertyNameInput.prototype.get value):
     127        (WebInspector.VisualStylePropertyNameInput.prototype.set value):
     128        (WebInspector.VisualStylePropertyNameInput.prototype.get synthesizedValue):
     129        (WebInspector.VisualStylePropertyNameInput.prototype.get hasCompletions):
     130        (WebInspector.VisualStylePropertyNameInput.prototype.set completions):
     131        (WebInspector.VisualStylePropertyNameInput.prototype._completionClicked):
     132        (WebInspector.VisualStylePropertyNameInput.prototype._inputKeyDown):
     133        (WebInspector.VisualStylePropertyNameInput.prototype._inputKeyUp):
     134        (WebInspector.VisualStylePropertyNameInput.prototype._hideCompletions):
     135        (WebInspector.VisualStylePropertyNameInput.prototype._toggleTabbingOfSelectableElements):
     136
     137        * UserInterface/Views/VisualStyleURLInput.js: Added.
     138        (WebInspector.VisualStyleURLInput):
     139        (WebInspector.VisualStyleURLInput.prototype.set get value):
     140        (WebInspector.VisualStyleURLInput.prototype.parseValue):
     141
     142        * UserInterface/Views/VisualStyleUnitSlider.css: Added.
     143        (.visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider):
     144        (.visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider > img):
     145        (.visual-style-property-container.unit-slider.opacity > .visual-style-property-value-container > .slider):
     146
     147        * UserInterface/Views/VisualStyleUnitSlider.js: Added.
     148        (WebInspector.VisualStyleUnitSlider):
     149        (WebInspector.VisualStyleUnitSlider.prototype.set value):
     150        (WebInspector.VisualStyleUnitSlider.prototype.get value):
     151        (WebInspector.VisualStyleUnitSlider.prototype.get synthesizedValue):
     152        (WebInspector.VisualStyleUnitSlider.prototype.sliderValueDidChange):
     153
    11542015-08-10  Devin Rousso  <drousso@apple.com>
    2155
  • trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js

    r188028 r188229  
    881881            createCodeMirrorColorTextMarkers(this._codeMirror, range, function(marker, color, colorString) {
    882882                var swatchElement = document.createElement("span");
    883                 swatchElement.title = WebInspector.UIString("Click to open a colorpicker. Shift-click to change color format.");
     883                swatchElement.title = WebInspector.UIString("Click to select a color. Shift-click to switch color formats.");
    884884                swatchElement.className = WebInspector.CSSStyleDeclarationTextEditor.ColorSwatchElementStyleClassName;
    885885                swatchElement.addEventListener("click", this._colorSwatchClicked.bind(this));
  • trunk/Source/WebInspectorUI/UserInterface/Views/Slider.js

    r182040 r188229  
    3737        this._value = 0;
    3838        this._knobX = 0;
    39         this.__maxX = 0;
     39        this._maxX = 0;
    4040
    4141        this._element.addEventListener("mousedown", this);
     
    6161            return;
    6262
    63         this._value = value;
    64 
    65         this._knobX = Math.round(value * this._maxX);
    66         this._knob.style.webkitTransform = "translate3d(" + this._knobX + "px, 0, 0)";
     63        this.knobX = value;
    6764
    6865        if (this.delegate && typeof this.delegate.sliderValueDidChange === "function")
    6966            this.delegate.sliderValueDidChange(this, value);
     67    }
     68
     69    set knobX(value)
     70    {
     71        this._value = value;
     72        this._knobX = Math.round(value * this.maxX);
     73        this._knob.style.webkitTransform = "translate3d(" + this._knobX + "px, 0, 0)";
     74    }
     75
     76    get maxX()
     77    {
     78        if (this._maxX <= 0 && document.body.contains(this._element))
     79            this._maxX = Math.max(this._element.offsetWidth - Math.ceil(WebInspector.Slider.KnobWidth / 2), 0);
     80
     81        return this._maxX;
    7082    }
    7183
     
    92104    {
    93105        if (event.target !== this._knob)
    94             this.value = (this._localPointForEvent(event).x - 3) / this._maxX;
     106            this.value = (this._localPointForEvent(event).x - 3) / this.maxX;
    95107
    96108        this._startKnobX = this._knobX;
     
    106118    {
    107119        var dx = this._localPointForEvent(event).x - this._startMouseX;
    108         var x = Math.max(Math.min(this._startKnobX + dx, this._maxX), 0);
     120        var x = Math.max(Math.min(this._startKnobX + dx, this.maxX), 0);
    109121
    110         this.value = x / this._maxX;
     122        this.value = x / this.maxX;
    111123    }
    112124
     
    125137        return window.webkitConvertPointFromPageToNode(this._element, new WebKitPoint(event.pageX, event.pageY));
    126138    }
    127 
    128     get _maxX()
    129     {
    130         if (this.__maxX === 0 && document.body.contains(this._element))
    131             this.__maxX = this._element.offsetWidth - Math.ceil(WebInspector.Slider.KnobWidth / 2);
    132 
    133         return this.__maxX;
    134     }
    135139};
    136140
Note: See TracChangeset for help on using the changeset viewer.