WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
59789
Web Inspector: CSS editing breaks when entering "color: rgb(1"
https://bugs.webkit.org/show_bug.cgi?id=59789
Summary
Web Inspector: CSS editing breaks when entering "color: rgb(1"
Pavel Feldman
Reported
2011-04-29 02:34:56 PDT
It throws error in the devtools console and does not work.
Attachments
Patch
(6.32 KB, patch)
2011-04-29 02:51 PDT
,
Pavel Feldman
no flags
Details
Formatted Diff
Diff
Patch
(20.67 KB, patch)
2011-04-29 07:25 PDT
,
Pavel Feldman
no flags
Details
Formatted Diff
Diff
Patch
(20.42 KB, patch)
2011-04-29 08:20 PDT
,
Pavel Feldman
no flags
Details
Formatted Diff
Diff
Patch
(20.43 KB, patch)
2011-04-29 08:23 PDT
,
Pavel Feldman
yurys
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Pavel Feldman
Comment 1
2011-04-29 02:51:22 PDT
Created
attachment 91656
[details]
Patch
Alexander Pavlov (apavlov)
Comment 2
2011-04-29 03:11:43 PDT
Comment on
attachment 91656
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=91656&action=review
> LayoutTests/inspector/styles/styles-add-invalid-property.html:31 > + treeElement.valueElement.textContent = "rgb(";
This should be "rgb(1", as per the failing case in the reported issue.
Pavel Feldman
Comment 3
2011-04-29 07:25:26 PDT
Created
attachment 91677
[details]
Patch
Alexander Pavlov (apavlov)
Comment 4
2011-04-29 07:44:00 PDT
Comment on
attachment 91677
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=91677&action=review
These are the primary issues I noticed.
> LayoutTests/inspector/styles/styles-commit-editing.html:25 > + treeElement.valueElement.textContent = "rgb(1";
doesn't the following sequence work? treeElement.valueElement.textContent = "rgb("; treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("U+0031")); This could save us a fortune (and a ForTest method).
> Source/WebCore/inspector/front-end/StylesSidebarPane.js:1644 > + } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || event.keyIdentifier === "Escape")
A better approach is to fix this to check a single event.keyIdentifier === "U+001B". This way we won't have to add two hacks.
> Source/WebCore/inspector/front-end/StylesSidebarPane.js:1941 > + return typeof this.originalPropertyText === "string";
If you don't use any other type than "string", why is the original condition changed?
> Source/WebCore/inspector/front-end/inspector.js:1555 > +
a new blank line might not be necessary
Pavel Feldman
Comment 5
2011-04-29 08:20:00 PDT
Created
attachment 91684
[details]
Patch
Pavel Feldman
Comment 6
2011-04-29 08:23:53 PDT
Created
attachment 91685
[details]
Patch
Pavel Feldman
Comment 7
2011-04-29 08:25:31 PDT
(In reply to
comment #4
)
> (From update of
attachment 91677
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=91677&action=review
> > These are the primary issues I noticed. > > > LayoutTests/inspector/styles/styles-commit-editing.html:25 > > + treeElement.valueElement.textContent = "rgb(1"; > > doesn't the following sequence work? > treeElement.valueElement.textContent = "rgb("; > treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("U+0031")); >
I need this to be processed synchronously, while key event handler only schedules a timer.
> This could save us a fortune (and a ForTest method). > > > Source/WebCore/inspector/front-end/StylesSidebarPane.js:1644 > > + } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || event.keyIdentifier === "Escape") > > A better approach is to fix this to check a single event.keyIdentifier === "U+001B". This way we won't have to add two hacks. >
Done.
> > Source/WebCore/inspector/front-end/StylesSidebarPane.js:1941 > > + return typeof this.originalPropertyText === "string"; > > If you don't use any other type than "string", why is the original condition changed? >
I like searching for this.originalPropertyText occurrences more + it is compiler friendly.
> > Source/WebCore/inspector/front-end/inspector.js:1555 > > + > > a new blank line might not be necessary
Done.
Pavel Feldman
Comment 8
2011-04-29 08:35:31 PDT
Committed
r85324
: <
http://trac.webkit.org/changeset/85324
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug