WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
VERIFIED FIXED
4059
Some values used with setAttribute() cause the attribute to be removed (null strings vs. empty strings)
https://bugs.webkit.org/show_bug.cgi?id=4059
Summary
Some values used with setAttribute() cause the attribute to be removed (null ...
Vicki Murley
Reported
2005-07-18 14:06:15 PDT
This bug is also in Radar as <
rdar://3885811
> Summary: Some values used with setAttribute() will cause the attribute to be removed. In the test case provided, an <input type='text'> tag has an attribute named startval and its value is an empty string. The <input> tag does not have a value attribute, but when the value attribute is queried indicates that it is an empty string, length of zero and type of string. When the <input> value is used as the value parameter for a setAttribute() call on the <input> tag for the startval attribute, Safari removes the startval attribute from the <input> tag. In testing with other <input> attributes, found that size and defaultValue also displayed this behavior (when they were not included in the html). When the value attribute was included in the html, the startval attribute was not removed. Steps to reproduce: Attached is zattribute.htm which duplicates the issue. Install zattribute.htm to a webserver and execute via the command line to observe the results. Expected results: I expected Safari to not remove the attribute on the <input> tag. Actual results: Safari removed the attribute from the <input> tag. Workaround: If the value attribute was placed on the <input> tag, everything would have worked OK. Isolation: Fails on Safari. Works OK on Firefox (Macintosh & Windows), Netscape 7.x (Macintosh & Windows) and Internet Explorer. Darin Adler: This has something to do with empty strings vs. null strings in our DOM implementations.
Attachments
test case
(1.39 KB, text/html)
2005-07-18 14:06 PDT
,
Vicki Murley
no flags
Details
Build WebKit r9638 on Mac OS X 10.4.5 with Xcode 2.2.1
(15.01 KB, patch)
2006-03-12 09:55 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v1 (test case only)
(4.25 KB, patch)
2006-03-12 10:08 PST
,
David Kilzer (:ddkilzer)
mjs
: review+
Details
Formatted Diff
Diff
Test results output from r9638
(1.72 KB, text/html)
2006-03-12 10:14 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Patch to fix ChangeLog entry
(865 bytes, patch)
2006-03-15 06:10 PST
,
David Kilzer (:ddkilzer)
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Vicki Murley
Comment 1
2005-07-18 14:06:39 PDT
Created
attachment 3006
[details]
test case
David Kilzer (:ddkilzer)
Comment 2
2006-01-20 06:23:34 PST
This appears to be working in ToT for Subversion revision
r12256
.
David Kilzer (:ddkilzer)
Comment 3
2006-03-12 09:55:15 PST
Created
attachment 7027
[details]
Build WebKit r9638 on Mac OS X 10.4.5 with Xcode 2.2.1 In order to write a failing test case, I needed to build an older version of WebKit than what was available on the oldest nightly. (WebKit-CVS-2005-10-01 03-27-01 GMT.dmg did not exhibit this bug.) This patch is what was required to build WebKit r9638 on Mac OS X 10.4.5 with Xcode 2.2.1. (I chose this revision because I thought r9639 might have fixed the problem, although this probably isn't the case after writing another test case.) Note that this patch includes the build fix from r9641 in WebKit/WebView.subproj/WebFrame.m. Also note that there are "problems" when running this version of WebKit with Safari 2.0.3. Clicking links causes 100% CPU usage and closing windows simply doesn't work. However, it was sufficient to write a failing test case. I'm including it in case others want to duplicate the work.
David Kilzer (:ddkilzer)
Comment 4
2006-03-12 10:08:31 PST
Created
attachment 7029
[details]
Patch v1 (test case only) Patch with only test case and changelog entry. The bug was fixed between r9638 (2005-07-09) and the first nightly build (WebKit-CVS-2005-10-01 03-27-01 GMT.dmg).
David Kilzer (:ddkilzer)
Comment 5
2006-03-12 10:14:10 PST
Created
attachment 7030
[details]
Test results output from r9638
Maciej Stachowiak
Comment 6
2006-03-12 13:26:46 PST
Comment on
attachment 7029
[details]
Patch v1 (test case only) r=me good to land this test
Darin Adler
Comment 7
2006-03-14 04:24:28 PST
I think it's
r10084
that fixed this.
David Kilzer (:ddkilzer)
Comment 8
2006-03-15 05:44:41 PST
(In reply to
comment #7
)
> I think it's
r10084
that fixed this.
I updated to
r10083
and built WebKit. This revision still fails as seen in
Attachment 7030
[details]
. I updated to
r10084
(actually
r10086
since it had build fixes for
r10084
), rebuilt, and confirmed that this revision DID fix this bug!
David Kilzer (:ddkilzer)
Comment 9
2006-03-15 06:10:10 PST
Created
attachment 7085
[details]
Patch to fix ChangeLog entry Fix LayoutTests/ChangeLog entry per information found in
Comment 8
. Does this matter?
David Kilzer (:ddkilzer)
Comment 10
2006-03-15 07:11:59 PST
(In reply to
comment #8
)
> I updated to
r10084
(actually
r10086
since it had build fixes for
r10084
), > rebuilt, and confirmed that this revision DID fix this bug!
Revision
r10084
fixed
Bug 4313
.
Darin Adler
Comment 11
2006-03-15 10:20:28 PST
Comment on
attachment 7085
[details]
Patch to fix ChangeLog entry No, it doesn't matter, but I guess we can fix this anyway.
David Kilzer (:ddkilzer)
Comment 12
2006-03-19 06:07:13 PST
Verified fixed (test checked into svn and passes on
r13385
).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug