Bug 159192

Summary: Web Inspector: selectElement.options shows unexpected entries in console (named indexes beyond collection length)
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bburg, cdumez, commit-queue, joepeck, keith_miller, malvika.editsoftdigital, mark.lam, mattbaker, mcdado, msaboff, nvasilyev, sbarati, timothy, webkit-bug-importer
Priority: P2 Keywords: DoNotImportToRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
none
Archive of layout-test-results from ews126 for ios-simulator-wk2 none

Description Joseph Pecoraro 2016-06-27 21:16:35 PDT
Summary:
selectElement.options shows unexpected entries in console (named indexes beyond collection length)

Test:
<select id="x">
    <option name="1" id="attr_1" value="1"></option>
</select>

Steps to Reproduce:
1. js> x.options
2. Expand
  => Expected just the 1 option, instead saw the single option duplicated

Notes:
- options.length is (1), and [0] is the one option. However, "named index" ["1"] is because the <option> has a name of 1.
- We will just treat arrayLike objects more like Arrays, even if they are small, only provide values for 0..length
- Note this is special because in a collection the named indexes, though numeric, do not affect length. You can't do that with arrays.
Comment 1 Joseph Pecoraro 2016-06-27 21:21:24 PDT
Created attachment 282208 [details]
[PATCH] Proposed Fix
Comment 2 Build Bot 2016-06-27 22:19:11 PDT
Comment on attachment 282208 [details]
[PATCH] Proposed Fix

Attachment 282208 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1584212

New failing tests:
animations/multiple-backgrounds.html
Comment 3 Build Bot 2016-06-27 22:19:15 PDT
Created attachment 282211 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 4 WebKit Commit Bot 2016-06-28 08:34:10 PDT
Comment on attachment 282208 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 282208

Committed r202568: <http://trac.webkit.org/changeset/202568>
Comment 5 WebKit Commit Bot 2016-06-28 08:34:15 PDT
All reviewed patches have been landed.  Closing bug.