Web Inspector: Don't throw exceptions in WebInspector.Color
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Feb 2013 09:39:32 +0000 (09:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Feb 2013 09:39:32 +0000 (09:39 +0000)
commit3b8e343f4f244f3b4007b2aee7eefd4446539f8f
tree25dca180e173b9b7315603652a55bd983e85233c
parent84b34329ee99e723438c8ad10e9a7758a060379d
Web Inspector: Don't throw exceptions in WebInspector.Color
https://bugs.webkit.org/show_bug.cgi?id=104835

Source/WebCore:

Patch by John J. Barton <johnjbarton@chromium.org> on 2013-02-11
Reviewed by Vsevolod Vlasov.

WebInspector.Color.parse() returns a Color from a string, or null;
Ctor calls now call parse();
In the StylesSideBarPane, test null rather than catch(e).

Added case to inspector/styles/styles-invalid-color-values.html

* inspector/front-end/Color.js:
(WebInspector.Color):
(WebInspector.Color.parse):
(WebInspector.Color.fromRGBA):
(WebInspector.Color.fromRGB):
(WebInspector.Color.prototype.toString):
(WebInspector.Color.prototype._parse.this.alpha.set 0):
(WebInspector.Color.prototype._parse.this.nickname.set 2):
(WebInspector.Color.prototype._parse.this.hsla.set 1):
(WebInspector.Color.prototype._parse.this.rgba.set 0):
(WebInspector.Color.prototype._parse.set WebInspector):
(WebInspector.Color.prototype._parse):
* inspector/front-end/Spectrum.js:
(WebInspector.Spectrum.prototype.get color):
* inspector/front-end/StylesSidebarPane.js:

LayoutTests:

Patch by John J. Barton <johnjbarton@chromium.org> on 2013-02-11
Reviewed by Vsevolod Vlasov.

Added case to test parsing 'none' from border style

* inspector/styles/styles-invalid-color-values-expected.txt:
* inspector/styles/styles-invalid-color-values.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/styles/styles-invalid-color-values-expected.txt
LayoutTests/inspector/styles/styles-invalid-color-values.html
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/Color.js
Source/WebCore/inspector/front-end/Spectrum.js
Source/WebCore/inspector/front-end/StylesSidebarPane.js