Bug 108141

Summary: FeatureObserver: Input types are counted unexpectedly in a page with Modernizr
Product: WebKit Reporter: Kent Tamura <tkent>
Component: FormsAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, haraken, mifenton, ojan.autocc, rniwa, spottabathini, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Kent Tamura 2013-01-28 18:06:10 PST
http://modernizr.com/docs/#inputtypes

If the Input Types feature of Modernizr is loaded, FeatureObserver detects that all of the types are used.  It's not information which we want.
Comment 1 Kent Tamura 2013-01-28 19:24:22 PST
Modernizr's code follows.  It appends input elements to document.body, and attaches renderers.  Probably we should count "attached && visibility!=hidden"?

    function A() {
        e.inputtypes = function(a) {
            for (var d = 0, e, f, h, i = a.length; d < i; d++)
                k.setAttribute("type", f = a[d]),
                e = k.type !== "text",
                e && (k.value = l,
                      k.style.cssText = "position:absolute;visibility:hidden;",
                      /^range$/.test(f) && k.style.WebkitAppearance !== c ? (g.appendChild(k), h = b.defaultView, e = h.getComputedStyle && h.getComputedStyle(k, null).WebkitAppearance !== "textfield" && k.offsetHeight !== 0, g.removeChild(k)) : /^(search|tel)$/.test(f) || (/^(url|email)$/.test(f) ? e = k.checkValidity && k.checkValidity() === !1 : e = k.value != l)),
                o[a[d]] = !!e;
            return o
        }("search tel url email datetime date month week time datetime-local number range color".split(" "))
    }
Comment 2 Kent Tamura 2013-01-28 21:09:03 PST
Created attachment 185145 [details]
Patch
Comment 3 Kentaro Hara 2013-01-28 21:22:51 PST
Comment on attachment 185145 [details]
Patch

Makes sense to me.
Comment 4 Build Bot 2013-01-28 23:20:18 PST
Comment on attachment 185145 [details]
Patch

Attachment 185145 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://queues.webkit.org/results/16183019
Comment 5 Kent Tamura 2013-01-28 23:48:57 PST
Created attachment 185176 [details]
Patch for landing

Include NodeRenderStyle.h
Comment 6 WebKit Review Bot 2013-01-29 02:02:56 PST
Comment on attachment 185176 [details]
Patch for landing

Clearing flags on attachment: 185176

Committed r141086: <http://trac.webkit.org/changeset/141086>
Comment 7 WebKit Review Bot 2013-01-29 02:03:01 PST
All reviewed patches have been landed.  Closing bug.