⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181612 in webkit


Ignore:
Timestamp:
Mar 16, 2015, 9:41:31 PM (11 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: Better Console Previews for Arrays / Small Objects
https://bugs.webkit.org/show_bug.cgi?id=142322

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

  • inspector/InjectedScriptSource.js:

Create deep valuePreviews for simple previewable objects,
such as arrays with 5 values, or basic objects with
3 properties.

Source/WebInspectorUI:

  • UserInterface/Views/ObjectPreviewView.js:

If there is a sub-preview, show the sub-preview.

  • UserInterface/Views/ObjectTreeView.js:

(WebInspector.ObjectTreeView):
For an ObjectTree that is not a root (e.g. one inside of
an array/set/map property tree element) allow it to be
expanded even if the preview is lossless.

LayoutTests:

  • inspector/model/remote-object-expected.txt:
  • inspector/model/remote-object.html:

Include a test with cyclic values, and update
results which now have sub-previews.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r181611 r181612  
     12015-03-16  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Better Console Previews for Arrays / Small Objects
     4        https://bugs.webkit.org/show_bug.cgi?id=142322
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * inspector/model/remote-object-expected.txt:
     9        * inspector/model/remote-object.html:
     10        Include a test with cyclic values, and update
     11        results which now have sub-previews.
     12
    1132015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/LayoutTests/inspector/model/remote-object-expected.txt

    r181516 r181612  
    593593    "_subtype": "array",
    594594    "_description": "Array",
    595     "_lossless": false,
     595    "_lossless": true,
    596596    "_overflow": false,
    597597    "_size": 3,
     
    601601        "_type": "object",
    602602        "_subtype": "array",
    603         "_value": "Array"
     603        "_valuePreview": {
     604          "_type": "object",
     605          "_subtype": "array",
     606          "_description": "Array",
     607          "_lossless": true,
     608          "_overflow": false,
     609          "_size": 1,
     610          "_properties": [
     611            {
     612              "_name": "0",
     613              "_type": "number",
     614              "_value": "1"
     615            }
     616          ],
     617          "_entries": null
     618        }
    604619      },
    605620      {
     
    607622        "_type": "object",
    608623        "_subtype": "array",
    609         "_value": "Array"
     624        "_valuePreview": {
     625          "_type": "object",
     626          "_subtype": "array",
     627          "_description": "Array",
     628          "_lossless": true,
     629          "_overflow": false,
     630          "_size": 1,
     631          "_properties": [
     632            {
     633              "_name": "0",
     634              "_type": "number",
     635              "_value": "2"
     636            }
     637          ],
     638          "_entries": null
     639        }
    610640      },
    611641      {
     
    613643        "_type": "object",
    614644        "_subtype": "array",
    615         "_value": "Array"
     645        "_valuePreview": {
     646          "_type": "object",
     647          "_subtype": "array",
     648          "_description": "Array",
     649          "_lossless": true,
     650          "_overflow": false,
     651          "_size": 1,
     652          "_properties": [
     653            {
     654              "_name": "0",
     655              "_type": "number",
     656              "_value": "3"
     657            }
     658          ],
     659          "_entries": null
     660        }
    616661      }
    617662    ],
     
    679724    "_subtype": "array",
    680725    "_description": "Array",
    681     "_lossless": false,
     726    "_lossless": true,
    682727    "_overflow": false,
    683728    "_size": 3,
     
    686731        "_name": "0",
    687732        "_type": "object",
    688         "_value": "Object"
     733        "_valuePreview": {
     734          "_type": "object",
     735          "_description": "Object",
     736          "_lossless": true,
     737          "_overflow": false,
     738          "_properties": [
     739            {
     740              "_name": "a",
     741              "_type": "number",
     742              "_value": "1"
     743            }
     744          ],
     745          "_entries": null
     746        }
    689747      },
    690748      {
    691749        "_name": "1",
    692750        "_type": "object",
    693         "_value": "Object"
     751        "_valuePreview": {
     752          "_type": "object",
     753          "_description": "Object",
     754          "_lossless": true,
     755          "_overflow": false,
     756          "_properties": [
     757            {
     758              "_name": "b",
     759              "_type": "number",
     760              "_value": "2"
     761            }
     762          ],
     763          "_entries": null
     764        }
    694765      },
    695766      {
    696767        "_name": "2",
    697768        "_type": "object",
    698         "_value": "Object"
     769        "_valuePreview": {
     770          "_type": "object",
     771          "_description": "Object",
     772          "_lossless": true,
     773          "_overflow": false,
     774          "_properties": [
     775            {
     776              "_name": "c",
     777              "_type": "number",
     778              "_value": "2"
     779            }
     780          ],
     781          "_entries": null
     782        }
    699783      }
    700784    ],
     
    715799    "_subtype": "array",
    716800    "_description": "Array",
    717     "_lossless": false,
     801    "_lossless": true,
    718802    "_overflow": false,
    719803    "_size": 1,
     
    723807        "_type": "object",
    724808        "_subtype": "array",
    725         "_value": "Array"
     809        "_valuePreview": {
     810          "_type": "object",
     811          "_subtype": "array",
     812          "_description": "Array",
     813          "_lossless": true,
     814          "_overflow": false,
     815          "_size": 3,
     816          "_properties": [
     817            {
     818              "_name": "0",
     819              "_type": "object",
     820              "_valuePreview": {
     821                "_type": "object",
     822                "_description": "Object",
     823                "_lossless": true,
     824                "_overflow": false,
     825                "_properties": [
     826                  {
     827                    "_name": "a",
     828                    "_type": "number",
     829                    "_value": "1"
     830                  }
     831                ],
     832                "_entries": null
     833              }
     834            },
     835            {
     836              "_name": "1",
     837              "_type": "object",
     838              "_valuePreview": {
     839                "_type": "object",
     840                "_description": "Object",
     841                "_lossless": true,
     842                "_overflow": false,
     843                "_properties": [
     844                  {
     845                    "_name": "b",
     846                    "_type": "number",
     847                    "_value": "2"
     848                  }
     849                ],
     850                "_entries": null
     851              }
     852            },
     853            {
     854              "_name": "2",
     855              "_type": "object",
     856              "_valuePreview": {
     857                "_type": "object",
     858                "_description": "Object",
     859                "_lossless": true,
     860                "_overflow": false,
     861                "_properties": [
     862                  {
     863                    "_name": "c",
     864                    "_type": "number",
     865                    "_value": "2"
     866                  }
     867                ],
     868                "_entries": null
     869              }
     870            }
     871          ],
     872          "_entries": null
     873        }
    726874      }
    727875    ],
     
    15481696        "_type": "symbol",
    15491697        "_value": "Symbol(sym)"
     1698      }
     1699    ],
     1700    "_entries": null
     1701  }
     1702}
     1703
     1704-----------------------------------------------------
     1705EXPRESSION: o = {a:1}; o.b = o; o
     1706{
     1707  "_type": "object",
     1708  "_objectId": "<filtered>",
     1709  "_description": "Object",
     1710  "_preview": {
     1711    "_type": "object",
     1712    "_description": "Object",
     1713    "_lossless": false,
     1714    "_overflow": false,
     1715    "_properties": [
     1716      {
     1717        "_name": "a",
     1718        "_type": "number",
     1719        "_value": "1"
     1720      },
     1721      {
     1722        "_name": "b",
     1723        "_type": "object",
     1724        "_value": "Object"
    15501725      }
    15511726    ],
     
    29493124    "_subtype": "iterator",
    29503125    "_description": "ArrayIterator",
     3126    "_lossless": true,
     3127    "_overflow": false,
     3128    "_properties": [
     3129      {
     3130        "_name": "array",
     3131        "_type": "object",
     3132        "_subtype": "array",
     3133        "_valuePreview": {
     3134          "_type": "object",
     3135          "_subtype": "array",
     3136          "_description": "Array",
     3137          "_lossless": true,
     3138          "_overflow": false,
     3139          "_size": 0,
     3140          "_properties": [],
     3141          "_entries": null
     3142        },
     3143        "_internal": true
     3144      },
     3145      {
     3146        "_name": "kind",
     3147        "_type": "string",
     3148        "_value": "value",
     3149        "_internal": true
     3150      }
     3151    ],
     3152    "_entries": []
     3153  }
     3154}
     3155
     3156-----------------------------------------------------
     3157EXPRESSION: [1][Symbol.iterator]()
     3158{
     3159  "_type": "object",
     3160  "_subtype": "iterator",
     3161  "_objectId": "<filtered>",
     3162  "_description": "ArrayIterator",
     3163  "_preview": {
     3164    "_type": "object",
     3165    "_subtype": "iterator",
     3166    "_description": "ArrayIterator",
     3167    "_lossless": true,
     3168    "_overflow": false,
     3169    "_properties": [
     3170      {
     3171        "_name": "array",
     3172        "_type": "object",
     3173        "_subtype": "array",
     3174        "_valuePreview": {
     3175          "_type": "object",
     3176          "_subtype": "array",
     3177          "_description": "Array",
     3178          "_lossless": true,
     3179          "_overflow": false,
     3180          "_size": 1,
     3181          "_properties": [
     3182            {
     3183              "_name": "0",
     3184              "_type": "number",
     3185              "_value": "1"
     3186            }
     3187          ],
     3188          "_entries": null
     3189        },
     3190        "_internal": true
     3191      },
     3192      {
     3193        "_name": "kind",
     3194        "_type": "string",
     3195        "_value": "value",
     3196        "_internal": true
     3197      }
     3198    ],
     3199    "_entries": [
     3200      {
     3201        "_value": {
     3202          "_type": "number",
     3203          "_description": "1",
     3204          "_lossless": true,
     3205          "_overflow": false,
     3206          "_properties": null,
     3207          "_entries": null
     3208        }
     3209      }
     3210    ]
     3211  }
     3212}
     3213
     3214-----------------------------------------------------
     3215EXPRESSION: [1, 'two', 3, 'four', 5, 'size'][Symbol.iterator]()
     3216{
     3217  "_type": "object",
     3218  "_subtype": "iterator",
     3219  "_objectId": "<filtered>",
     3220  "_description": "ArrayIterator",
     3221  "_preview": {
     3222    "_type": "object",
     3223    "_subtype": "iterator",
     3224    "_description": "ArrayIterator",
    29513225    "_lossless": false,
    2952     "_overflow": false,
     3226    "_overflow": true,
    29533227    "_properties": [
    29543228      {
     
    29663240      }
    29673241    ],
    2968     "_entries": []
    2969   }
    2970 }
    2971 
    2972 -----------------------------------------------------
    2973 EXPRESSION: [1][Symbol.iterator]()
     3242    "_entries": [
     3243      {
     3244        "_value": {
     3245          "_type": "number",
     3246          "_description": "1",
     3247          "_lossless": true,
     3248          "_overflow": false,
     3249          "_properties": null,
     3250          "_entries": null
     3251        }
     3252      },
     3253      {
     3254        "_value": {
     3255          "_type": "string",
     3256          "_description": "two",
     3257          "_lossless": true,
     3258          "_overflow": false,
     3259          "_properties": null,
     3260          "_entries": null
     3261        }
     3262      },
     3263      {
     3264        "_value": {
     3265          "_type": "number",
     3266          "_description": "3",
     3267          "_lossless": true,
     3268          "_overflow": false,
     3269          "_properties": null,
     3270          "_entries": null
     3271        }
     3272      },
     3273      {
     3274        "_value": {
     3275          "_type": "string",
     3276          "_description": "four",
     3277          "_lossless": true,
     3278          "_overflow": false,
     3279          "_properties": null,
     3280          "_entries": null
     3281        }
     3282      },
     3283      {
     3284        "_value": {
     3285          "_type": "number",
     3286          "_description": "5",
     3287          "_lossless": true,
     3288          "_overflow": false,
     3289          "_properties": null,
     3290          "_entries": null
     3291        }
     3292      }
     3293    ]
     3294  }
     3295}
     3296
     3297-----------------------------------------------------
     3298EXPRESSION: [1, 'two', 3, 'four', 5, 'size'].keys()
    29743299{
    29753300  "_type": "object",
     
    29823307    "_description": "ArrayIterator",
    29833308    "_lossless": false,
    2984     "_overflow": false,
     3309    "_overflow": true,
    29853310    "_properties": [
    29863311      {
     
    29943319        "_name": "kind",
    29953320        "_type": "string",
    2996         "_value": "value",
     3321        "_value": "key",
    29973322        "_internal": true
    29983323      }
    29993324    ],
    30003325    "_entries": [
     3326      {
     3327        "_value": {
     3328          "_type": "number",
     3329          "_description": "0",
     3330          "_lossless": true,
     3331          "_overflow": false,
     3332          "_properties": null,
     3333          "_entries": null
     3334        }
     3335      },
    30013336      {
    30023337        "_value": {
     
    30083343          "_entries": null
    30093344        }
     3345      },
     3346      {
     3347        "_value": {
     3348          "_type": "number",
     3349          "_description": "2",
     3350          "_lossless": true,
     3351          "_overflow": false,
     3352          "_properties": null,
     3353          "_entries": null
     3354        }
     3355      },
     3356      {
     3357        "_value": {
     3358          "_type": "number",
     3359          "_description": "3",
     3360          "_lossless": true,
     3361          "_overflow": false,
     3362          "_properties": null,
     3363          "_entries": null
     3364        }
     3365      },
     3366      {
     3367        "_value": {
     3368          "_type": "number",
     3369          "_description": "4",
     3370          "_lossless": true,
     3371          "_overflow": false,
     3372          "_properties": null,
     3373          "_entries": null
     3374        }
    30103375      }
    30113376    ]
     
    30143379
    30153380-----------------------------------------------------
    3016 EXPRESSION: [1, 'two', 3, 'four', 5, 'size'][Symbol.iterator]()
     3381EXPRESSION: [1, 'two', 3, 'four', 5, 'size'].entries()
    30173382{
    30183383  "_type": "object",
     
    30373402        "_name": "kind",
    30383403        "_type": "string",
    3039         "_value": "value",
    3040         "_internal": true
    3041       }
    3042     ],
    3043     "_entries": [
    3044       {
    3045         "_value": {
    3046           "_type": "number",
    3047           "_description": "1",
    3048           "_lossless": true,
    3049           "_overflow": false,
    3050           "_properties": null,
    3051           "_entries": null
    3052         }
    3053       },
    3054       {
    3055         "_value": {
    3056           "_type": "string",
    3057           "_description": "two",
    3058           "_lossless": true,
    3059           "_overflow": false,
    3060           "_properties": null,
    3061           "_entries": null
    3062         }
    3063       },
    3064       {
    3065         "_value": {
    3066           "_type": "number",
    3067           "_description": "3",
    3068           "_lossless": true,
    3069           "_overflow": false,
    3070           "_properties": null,
    3071           "_entries": null
    3072         }
    3073       },
    3074       {
    3075         "_value": {
    3076           "_type": "string",
    3077           "_description": "four",
    3078           "_lossless": true,
    3079           "_overflow": false,
    3080           "_properties": null,
    3081           "_entries": null
    3082         }
    3083       },
    3084       {
    3085         "_value": {
    3086           "_type": "number",
    3087           "_description": "5",
    3088           "_lossless": true,
    3089           "_overflow": false,
    3090           "_properties": null,
    3091           "_entries": null
    3092         }
    3093       }
    3094     ]
    3095   }
    3096 }
    3097 
    3098 -----------------------------------------------------
    3099 EXPRESSION: [1, 'two', 3, 'four', 5, 'size'].keys()
    3100 {
    3101   "_type": "object",
    3102   "_subtype": "iterator",
    3103   "_objectId": "<filtered>",
    3104   "_description": "ArrayIterator",
    3105   "_preview": {
    3106     "_type": "object",
    3107     "_subtype": "iterator",
    3108     "_description": "ArrayIterator",
    3109     "_lossless": false,
    3110     "_overflow": true,
    3111     "_properties": [
    3112       {
    3113         "_name": "array",
    3114         "_type": "object",
    3115         "_subtype": "array",
    3116         "_value": "Array",
    3117         "_internal": true
    3118       },
    3119       {
    3120         "_name": "kind",
    3121         "_type": "string",
    3122         "_value": "key",
    3123         "_internal": true
    3124       }
    3125     ],
    3126     "_entries": [
    3127       {
    3128         "_value": {
    3129           "_type": "number",
    3130           "_description": "0",
    3131           "_lossless": true,
    3132           "_overflow": false,
    3133           "_properties": null,
    3134           "_entries": null
    3135         }
    3136       },
    3137       {
    3138         "_value": {
    3139           "_type": "number",
    3140           "_description": "1",
    3141           "_lossless": true,
    3142           "_overflow": false,
    3143           "_properties": null,
    3144           "_entries": null
    3145         }
    3146       },
    3147       {
    3148         "_value": {
    3149           "_type": "number",
    3150           "_description": "2",
    3151           "_lossless": true,
    3152           "_overflow": false,
    3153           "_properties": null,
    3154           "_entries": null
    3155         }
    3156       },
    3157       {
    3158         "_value": {
    3159           "_type": "number",
    3160           "_description": "3",
    3161           "_lossless": true,
    3162           "_overflow": false,
    3163           "_properties": null,
    3164           "_entries": null
    3165         }
    3166       },
    3167       {
    3168         "_value": {
    3169           "_type": "number",
    3170           "_description": "4",
    3171           "_lossless": true,
    3172           "_overflow": false,
    3173           "_properties": null,
    3174           "_entries": null
    3175         }
    3176       }
    3177     ]
    3178   }
    3179 }
    3180 
    3181 -----------------------------------------------------
    3182 EXPRESSION: [1, 'two', 3, 'four', 5, 'size'].entries()
    3183 {
    3184   "_type": "object",
    3185   "_subtype": "iterator",
    3186   "_objectId": "<filtered>",
    3187   "_description": "ArrayIterator",
    3188   "_preview": {
    3189     "_type": "object",
    3190     "_subtype": "iterator",
    3191     "_description": "ArrayIterator",
    3192     "_lossless": false,
    3193     "_overflow": true,
    3194     "_properties": [
    3195       {
    3196         "_name": "array",
    3197         "_type": "object",
    3198         "_subtype": "array",
    3199         "_value": "Array",
    3200         "_internal": true
    3201       },
    3202       {
    3203         "_name": "kind",
    3204         "_type": "string",
    32053404        "_value": "key+value",
    32063405        "_internal": true
     
    36853884    "_subtype": "iterator",
    36863885    "_description": "ArgumentsIterator",
    3687     "_lossless": false,
     3886    "_lossless": true,
    36883887    "_overflow": false,
    36893888    "_properties": [
     
    36923891        "_type": "object",
    36933892        "_subtype": "array",
    3694         "_value": "Arguments",
     3893        "_valuePreview": {
     3894          "_type": "object",
     3895          "_subtype": "array",
     3896          "_description": "Arguments",
     3897          "_lossless": true,
     3898          "_overflow": false,
     3899          "_size": 2,
     3900          "_properties": [
     3901            {
     3902              "_name": "0",
     3903              "_type": "number",
     3904              "_value": "1"
     3905            },
     3906            {
     3907              "_name": "1",
     3908              "_type": "string",
     3909              "_value": "two"
     3910            }
     3911          ],
     3912          "_entries": null
     3913        },
    36953914        "_internal": true
    36963915      }
     
    38404059    "_type": "object",
    38414060    "_description": "Promise",
    3842     "_lossless": false,
     4061    "_lossless": true,
    38434062    "_overflow": false,
    38444063    "_properties": [
     
    38524071        "_name": "result",
    38534072        "_type": "object",
    3854         "_value": "Object",
     4073        "_valuePreview": {
     4074          "_type": "object",
     4075          "_description": "Object",
     4076          "_lossless": true,
     4077          "_overflow": false,
     4078          "_properties": [
     4079            {
     4080              "_name": "result",
     4081              "_type": "number",
     4082              "_value": "1"
     4083            }
     4084          ],
     4085          "_entries": null
     4086        },
    38554087        "_internal": true
    38564088      }
  • trunk/LayoutTests/inspector/model/remote-object.html

    r181516 r181612  
    9292        {expression: "({a: 1, b: 0, c: -0})"},
    9393        {expression: "({a: 1, b: \"string\", c: /regex/, d: Symbol('sym')})"},
     94        {expression: "o = {a:1}; o.b = o; o"}, // Cyclic.
    9495        {expression: "({a:function a(){}, b:function b(){}, get getter(){}, set setter(v){}})"},
    9596        {expression: "function Foo() {}; new Foo"},
  • trunk/Source/JavaScriptCore/ChangeLog

    r181611 r181612  
     12015-03-16  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Better Console Previews for Arrays / Small Objects
     4        https://bugs.webkit.org/show_bug.cgi?id=142322
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * inspector/InjectedScriptSource.js:
     9        Create deep valuePreviews for simple previewable objects,
     10        such as arrays with 5 values, or basic objects with
     11        3 properties.
     12
    1132015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js

    r181516 r181612  
    991991            }
    992992
     993            if (preview.entries)
     994                return preview;
     995
    993996            // Properties.
    994997            var descriptors = injectedScript._propertyDescriptors(object, InjectedScript.CollectionMode.AllProperties);
     
    996999            if (propertiesThreshold.indexes < 0 || propertiesThreshold.properties < 0)
    9971000                return preview;
    998 
    999             // FIXME: Iterator entries.
    10001001        } catch (e) {
    10011002            preview.lossless = false;
     
    10891090            if (secondLevelKeys === null || secondLevelKeys) {
    10901091                var subPreview = this._generatePreview(value, secondLevelKeys || undefined, undefined);
     1092                property.valuePreview = subPreview;
     1093                if (!subPreview.lossless)
     1094                    preview.lossless = false;
     1095                if (subPreview.overflow)
     1096                    preview.overflow = true;
     1097            } else if (this._isPreviewableObject(value)) {
     1098                var subPreview = this._createObjectPreviewForValue(value);
    10911099                property.valuePreview = subPreview;
    10921100                if (!subPreview.lossless)
     
    11461154    },
    11471155
     1156    _isPreviewableObject: function(object)
     1157    {
     1158        return this._isPreviewableObjectInternal(object, new Set, 1);
     1159    },
     1160
     1161    _isPreviewableObjectInternal: function(object, knownObjects, depth)
     1162    {
     1163        // Deep object.
     1164        if (depth > 3)
     1165            return false;
     1166
     1167        // Primitive.
     1168        if (injectedScript.isPrimitiveValue(object) || isSymbol(object))
     1169            return true;
     1170
     1171        // Cyclic objects.
     1172        if (knownObjects.has(object))
     1173            return false;
     1174
     1175        ++depth;
     1176        knownObjects.add(object);
     1177
     1178        // Arrays are simple if they have 5 or less simple objects.
     1179        var subtype = injectedScript._subtype(object);
     1180        if (subtype === "array") {
     1181            var length = object.length;
     1182            if (length > 5)
     1183                return false;
     1184            for (var i = 0; i < length; ++i) {
     1185                if (!this._isPreviewableObjectInternal(object[i], knownObjects, depth))
     1186                    return false;
     1187            }
     1188            return true;
     1189        }
     1190
     1191        // Not a basic object.
     1192        if (object.__proto__ && object.__proto__.__proto__)
     1193            return false;
     1194
     1195        // Objects are simple if they have 3 or less simple properties.
     1196        var ownPropertyNames = Object.getOwnPropertyNames(object);
     1197        if (ownPropertyNames.length > 3)
     1198            return false;
     1199        for (var propertyName of ownPropertyNames) {
     1200            if (!this._isPreviewableObjectInternal(object[propertyName], knownObjects, depth))
     1201                return false;
     1202        }
     1203
     1204        return true;
     1205    },
     1206
    11481207    _abbreviateString: function(string, maxLength, middle)
    11491208    {
  • trunk/Source/WebInspectorUI/ChangeLog

    r181610 r181612  
     12015-03-16  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Better Console Previews for Arrays / Small Objects
     4        https://bugs.webkit.org/show_bug.cgi?id=142322
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Views/ObjectPreviewView.js:
     9        If there is a sub-preview, show the sub-preview.
     10
     11        * UserInterface/Views/ObjectTreeView.js:
     12        (WebInspector.ObjectTreeView):
     13        For an ObjectTree that is not a root (e.g. one inside of
     14        an array/set/map property tree element) allow it to be
     15        expanded even if the preview is lossless.
     16
    1172015-03-16  Nikita Vasilyev  <nvasilyev@apple.com>
    218
  • trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js

    r181203 r181612  
    212212            }
    213213
    214             element.appendChild(WebInspector.FormattedValue.createElementForPropertyPreview(property));
     214            if (property.valuePreview)
     215                this._appendPreview(element, property.valuePreview);
     216            else
     217                element.appendChild(WebInspector.FormattedValue.createElementForPropertyPreview(property));
    215218        }
    216219
  • trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js

    r181186 r181612  
    5050        this._element.appendChild(this._previewView.element);
    5151
    52         if (this._previewView.lossless && !forceExpanding) {
     52        if (this._previewView.lossless && !this._propertyPath.parent && !forceExpanding) {
    5353            this._hasLosslessPreview = true;
    5454            this.element.classList.add("lossless-preview");
Note: See TracChangeset for help on using the changeset viewer.