Bug 39162

Summary: ':valid' CSS selector should not be applied to some form controls
Product: WebKit Reporter: Kent Tamura <tkent>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, adele, darin, eric, ojan, webkit.review.bot, yael
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch (rev.2) none

Description Kent Tamura 2010-05-15 08:23:07 PDT
<input type=submit> <input type=image> <progress> should not match to :valid pseudo selector.
Comment 1 Kent Tamura 2010-05-15 08:46:15 PDT
Created attachment 56155 [details]
Patch
Comment 2 Yael 2010-05-15 10:07:57 PDT
Thank you for fixing this, Kent.
Comment 3 Eric Seidel (no email) 2010-05-16 00:43:40 PDT
Comment on attachment 56155 [details]
Patch

Why remove the #if?
 #if ENABLE(PROGRESS_TAG)
862861         tagList.add(progressTag.localName().impl());
863  #endif
Comment 4 Yael 2010-05-16 05:18:32 PDT
(In reply to comment #3)
> (From update of attachment 56155 [details])
> Why remove the #if?
>  #if ENABLE(PROGRESS_TAG)
> 862861         tagList.add(progressTag.localName().impl());
> 863  #endif

Since progress is added to the tag names, the HTML parser will not create a progress element for ports that don't support the progress flag, unless it is also added to the tag list. If added to the tag list, the parser will create a "regular" HTML element when the flag is turned off.
Please see ruby and datalist, they are also added to the taglist unconditionally.
However video is not, and in ports that don't enable the video flag, the HTML parser is not creating a video element at all.
Comment 5 Darin Adler 2010-05-17 10:11:01 PDT
Comment on attachment 56155 [details]
Patch

> -    virtual bool isOptionalFormControl() const { return true; }

I don't see any comment or test case about this change. What's the deal with this?
Comment 6 Kent Tamura 2010-05-17 17:23:29 PDT
(In reply to comment #5)
> (From update of attachment 56155 [details])
> > -    virtual bool isOptionalFormControl() const { return true; }
> 
> I don't see any comment or test case about this change. What's the deal with this?

This change should not be included in this patch.  I'll revert it.
It fixes a bug that ':optional' CSS selector should not be applied to <button> and <progress>.
Comment 7 Kent Tamura 2010-05-17 17:41:58 PDT
Created attachment 56295 [details]
Patch (rev.2)
Comment 8 Kent Tamura 2010-05-17 20:57:20 PDT
Landed as r59645.
Comment 9 WebKit Review Bot 2010-05-17 21:14:55 PDT
http://trac.webkit.org/changeset/59645 might have broken GTK Linux 32-bit Release and Qt Linux Release
Comment 10 Kent Tamura 2010-05-17 21:25:57 PDT
(In reply to comment #9)
> http://trac.webkit.org/changeset/59645 might have broken GTK Linux 32-bit Release and Qt Linux Release

I forgot to update another test.  Fixed by r59647.