Bug 120432 - REGRESSION(r154586): Past names map should only be used when named item is empty
Summary: REGRESSION(r154586): Past names map should only be used when named item is empty
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on: 120277 120328
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-28 11:39 PDT by Ryosuke Niwa
Modified: 2013-08-28 11:58 PDT (History)
5 users (show)

See Also:


Attachments
Fixes the bug (4.27 KB, patch)
2013-08-28 11:56 PDT, Ryosuke Niwa
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-08-28 11:39:22 PDT
When we found any form associated element or associated image elements for a given name, we should not be using the past names map.
i.e. the past names map should only be used if there are not elements matching the name.

This accidentally regressed in http://trac.webkit.org/changeset/154586 because the old code behaved correctly when getNamedElements were called in pairs.
Comment 1 Ryosuke Niwa 2013-08-28 11:56:13 PDT
Created attachment 209913 [details]
Fixes the bug
Comment 2 Anders Carlsson 2013-08-28 11:57:23 PDT
Comment on attachment 209913 [details]
Fixes the bug

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

> Source/WebCore/html/HTMLFormElement.cpp:684
> +    else if (elementFromPast && !namedItems.size())

Please use namedItems.isEmpty() instead.
Comment 3 Ryosuke Niwa 2013-08-28 11:58:50 PDT
Committed r154765: <http://trac.webkit.org/changeset/154765>