Bug 159192 - Web Inspector: selectElement.options shows unexpected entries in console (named indexes beyond collection length)
Summary: Web Inspector: selectElement.options shows unexpected entries in console (nam...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: DoNotImportToRadar
Depends on:
Blocks:
 
Reported: 2016-06-27 21:16 PDT by Joseph Pecoraro
Modified: 2019-05-02 16:22 PDT (History)
15 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (6.50 KB, patch)
2016-06-27 21:21 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews126 for ios-simulator-wk2 (3.32 MB, application/zip)
2016-06-27 22:19 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.