Due to a bug in HTMLCollection::itemBeforeOrAfterCachedItem, HTMLCollection::length may return a wrong value (1 less than the actual length) sometimes on any port that uses V8 bindings or Objective-C bindings. This problem doesn't reproduce with JSC bindings because we call length() first and that sets the correct cached value. http://code.google.com/p/chromium/issues/detail?id=137488
Created attachment 152939 [details] Fixes the bug
Created attachment 152941 [details] Updated for ToT
Created attachment 152943 [details] Fixed per benjaminp's comment on IRC
Comment on attachment 152943 [details] Fixed per benjaminp's comment on IRC offsetOfLastItem + 1 seems reasonable :)
*** Bug 91413 has been marked as a duplicate of this bug. ***
Comment on attachment 152943 [details] Fixed per benjaminp's comment on IRC Clearing flags on attachment: 152943 Committed r122930: <http://trac.webkit.org/changeset/122930>
All reviewed patches have been landed. Closing bug.