Bug 143539 - Web Inspector: Regression: Showing of color swatches no longer works in Details Sidebar
Summary: Web Inspector: Regression: Showing of color swatches no longer works in Detai...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-04-08 16:15 PDT by Tobias Reiss
Modified: 2015-04-08 18:03 PDT (History)
8 users (show)

See Also:


Attachments
patch (1.89 KB, patch)
2015-04-08 16:24 PDT, Tobias Reiss
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Reiss 2015-04-08 16:15:48 PDT
I introduced a regression by trying to fix an ESLint issue. The ESLint report was correct but the fix was wrong.

Commit that introduced the regression:
http://svn.webkit.org/repository/webkit/trunk@182142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://github.com/WebKit/webkit/commit/b18ef637e495d9f64bca6e431d7ec71df8bc062d#diff-97910c4c4acd4a860a96c6592a3ab666L1013
Comment 1 Radar WebKit Bug Importer 2015-04-08 16:16:22 PDT
<rdar://problem/20474687>
Comment 2 Tobias Reiss 2015-04-08 16:24:02 PDT
Created attachment 250393 [details]
patch
Comment 3 Timothy Hatcher 2015-04-08 16:34:03 PDT
Comment on attachment 250393 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250393&action=review

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:396
> +                this._codeMirror.setUniqueBookmark(codeMirrorTextMarker.find().from, swatchElement);

I think codeMirrorTextMarker.find() can return null/undefined. Maybe this need a null check and early return?
Comment 4 Tobias Reiss 2015-04-08 16:52:47 PDT
Comment on attachment 250393 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250393&action=review

>> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:396
>> +                this._codeMirror.setUniqueBookmark(codeMirrorTextMarker.find().from, swatchElement);
> 
> I think codeMirrorTextMarker.find() can return null/undefined. Maybe this need a null check and early return?

Nit: If that's the case I would rather create a new bug because I just re-enabled the code that was here before I removed it. Just without the variable declaration that initially triggered the ESLint report. I can investigate into the missing null check afterwards, if that's okay for you?
Comment 5 Timothy Hatcher 2015-04-08 17:14:56 PDT
Comment on attachment 250393 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250393&action=review

>>> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:396
>>> +                this._codeMirror.setUniqueBookmark(codeMirrorTextMarker.find().from, swatchElement);
>> 
>> I think codeMirrorTextMarker.find() can return null/undefined. Maybe this need a null check and early return?
> 
> Nit: If that's the case I would rather create a new bug because I just re-enabled the code that was here before I removed it. Just without the variable declaration that initially triggered the ESLint report. I can investigate into the missing null check afterwards, if that's okay for you?

Fair enough.
Comment 6 WebKit Commit Bot 2015-04-08 18:03:11 PDT
Comment on attachment 250393 [details]
patch

Clearing flags on attachment: 250393

Committed r182576: <http://trac.webkit.org/changeset/182576>
Comment 7 WebKit Commit Bot 2015-04-08 18:03:19 PDT
All reviewed patches have been landed.  Closing bug.