WebKit Bugzilla
Attachment 347939 Details for
Bug 187026
: Web Inspector: Color picker: can't enter decimal numbers for opacity
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187026-20180823120810.patch (text/plain), 3.75 KB, created by
Devin Rousso
on 2018-08-23 11:08:13 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-08-23 11:08:13 PDT
Size:
3.75 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index dd6b865b5b6a7275b52d2cab410b6e4acb6b6327..9b3c4d6f68597041d85d8566e2856b672648ac20 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,16 @@ >+2018-08-23 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Color picker: can't enter decimal numbers for opacity >+ https://bugs.webkit.org/show_bug.cgi?id=187026 >+ <rdar://problem/41446500> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Views/ColorPicker.js: >+ (WI.ColorPicker): >+ (WI.ColorPicker.createColorInput): >+ (WI.ColorPicker.prototype._handleColorInputInput): >+ > 2018-08-21 Matt Baker <mattbaker@apple.com> > > Web Inspector: Remove TreeOutlineDataGridSynchronizer >diff --git a/Source/WebInspectorUI/UserInterface/Views/ColorPicker.js b/Source/WebInspectorUI/UserInterface/Views/ColorPicker.js >index 3c188ac49600f7ff2ac4e4166dec592d7efc2121..69fcc4cbc4665721729176a8feb25471fb6c5c45 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/ColorPicker.js >+++ b/Source/WebInspectorUI/UserInterface/Views/ColorPicker.js >@@ -44,32 +44,32 @@ WI.ColorPicker = class ColorPicker extends WI.Object > let colorInputsContainerElement = document.createElement("div"); > colorInputsContainerElement.classList.add("color-inputs"); > >- function createColorInput(label, {min: min = 0, max: max = 100, step: step = 1, units} = {}) { >+ let createColorInput = (label, {min, max, step, units} = {}) => { > let containerElement = colorInputsContainerElement.createChild("div"); > > containerElement.append(label); > > let numberInputElement = containerElement.createChild("input"); > numberInputElement.type = "number"; >- numberInputElement.min = min; >- numberInputElement.max = max; >- numberInputElement.step = step; >+ numberInputElement.min = min || 0; >+ numberInputElement.max = max || 100; >+ numberInputElement.step = step || 1; > numberInputElement.addEventListener("input", this._handleColorInputInput.bind(this)); > > if (units && units.length) > containerElement.append(units); > > return {containerElement, numberInputElement}; >- } >+ }; > > this._colorInputs = new Map([ >- ["R", createColorInput.call(this, "R", {max: 255})], >- ["G", createColorInput.call(this, "G", {max: 255})], >- ["B", createColorInput.call(this, "B", {max: 255})], >- ["H", createColorInput.call(this, "H", {max: 360})], >- ["S", createColorInput.call(this, "S", {units: "%"})], >- ["L", createColorInput.call(this, "L", {units: "%"})], >- ["A", createColorInput.call(this, "A"), {max: 1, step: 0.01}] >+ ["R", createColorInput("R", {max: 255})], >+ ["G", createColorInput("G", {max: 255})], >+ ["B", createColorInput("B", {max: 255})], >+ ["H", createColorInput("H", {max: 360})], >+ ["S", createColorInput("S", {units: "%"})], >+ ["L", createColorInput("L", {units: "%"})], >+ ["A", createColorInput("A", {max: 1, step: 0.01})] > ]); > > this._element = document.createElement("div"); >@@ -324,7 +324,11 @@ WI.ColorPicker = class ColorPicker extends WI.Object > return; > } > >- this.color = WI.Color.fromString(colorString); >+ let newColor = WI.Color.fromString(colorString); >+ if (newColor.toString() === this._color.toString()) >+ return; >+ >+ this.color = newColor; > this._color.format = oldFormat; > > this.dispatchEventToListeners(WI.ColorPicker.Event.ColorChanged, {color: this._color});
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 187026
:
343558
|
347939
|
347987