Bug 129623 - Web Inspector: Gradient.js:120:22: JS ERROR: TypeError: undefined is not an object (evaluating 'stop.offset')
Summary: Web Inspector: Gradient.js:120:22: JS ERROR: TypeError: undefined is not an o...
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: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-03-03 14:50 PST by Timothy Hatcher
Modified: 2014-04-24 01:44 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.09 KB, patch)
2014-03-03 15:12 PST, Timothy Hatcher
no flags Details | Formatted Diff | Diff
Patch (2.09 KB, patch)
2014-03-03 15:24 PST, Timothy Hatcher
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2014-03-03 14:50:15 PST
Seeing Gradient.js:120:22: JS ERROR: TypeError: undefined is not an object (evaluating 'stop.offset') while poking around some internal scripts.
Comment 1 Radar WebKit Bug Importer 2014-03-03 14:50:53 PST
<rdar://problem/16215772>
Comment 2 Timothy Hatcher 2014-03-03 15:00:25 PST
The content seems to be:

        var a = "background-image:", b = "gradient(linear,left top,right bottom,from(#9f9),to(white));", c = "linear-gradient(left top,#9f9, white);";

And the components passed to stopsWithComponents are [["left","top"],["#9f9"],["white"]].
Comment 3 Radar WebKit Bug Importer 2014-03-03 15:01:43 PST
<rdar://problem/16215950>
Comment 4 Timothy Hatcher 2014-03-03 15:06:18 PST
Found in modernizr-2.0.6.min.js
Comment 5 Timothy Hatcher 2014-03-03 15:12:44 PST
Created attachment 225694 [details]
Patch
Comment 6 Joseph Pecoraro 2014-03-03 15:20:30 PST
(In reply to comment #2)
> The content seems to be:
> 
>         var a = "background-image:", b = "gradient(linear,left top,right bottom,from(#9f9),to(white));", c = "linear-gradient(left top,#9f9, white);";
> 
> And the components passed to stopsWithComponents are [["left","top"],["#9f9"],["white"]].

This strikes me as a little weird. The input was "left top", "right bottom". Are we sure we are doing the right thing for these kinds of inputs?
Comment 7 Joseph Pecoraro 2014-03-03 15:20:45 PST
Comment on attachment 225694 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Models/Gradient.js:192
> +        // We don't support any of the legacy linerar gradient formats.

linerar
Comment 8 Timothy Hatcher 2014-03-03 15:24:17 PST
Created attachment 225698 [details]
Patch
Comment 9 Timothy Hatcher 2014-03-03 15:26:17 PST
(In reply to comment #6)
> (In reply to comment #2)
> > The content seems to be:
> > 
> >         var a = "background-image:", b = "gradient(linear,left top,right bottom,from(#9f9),to(white));", c = "linear-gradient(left top,#9f9, white);";
> > 
> > And the components passed to stopsWithComponents are [["left","top"],["#9f9"],["white"]].
> 
> This strikes me as a little weird. The input was "left top", "right bottom". Are we sure we are doing the right thing for these kinds of inputs?

Yeah, the "left" and "top" get sorted and recombined for a switch that looks for "left top". That allows ["top", "left"] to work without the need for case "top left" and all the other permutations.
Comment 10 WebKit Commit Bot 2014-03-03 16:02:58 PST
Comment on attachment 225698 [details]
Patch

Clearing flags on attachment: 225698

Committed r165017: <http://trac.webkit.org/changeset/165017>
Comment 11 WebKit Commit Bot 2014-03-03 16:03:01 PST
All reviewed patches have been landed.  Closing bug.
Comment 12 Antoine Quint 2014-03-04 00:23:39 PST
Thanks for cleaning up after me Tim!
Comment 13 Antoine Quint 2014-04-24 01:44:13 PDT
This fix caused https://bugs.webkit.org/show_bug.cgi?id=132083.