# WebKit Bugs

Published articles for WebKit Bugs.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## On native, single-input, multiple file uploads

DevFeed: [On native, single-input, multiple file uploads](<https://devfeed.tech/articles/on-native-single-input-multiple-file-uploads-51948.md>)

Original publisher: [Read original article](<https://lea.verou.me/2009/03/regarding-native-single-input-multiple-file-uploads/>)

Author: Lea Verou

Published: 2009-03-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Lea Verou's blog](<https://devfeed.tech/sources/lea-verou-s-blog.md>)

Topics: [Web Development](<https://devfeed.tech/topics/web-development.md>), [browser](<https://devfeed.tech/topics/browser.md>), [WebKit](<https://devfeed.tech/topics/webkit.md>), [if statement](<https://devfeed.tech/topics/if-statement.md>), [Internet Explorer](<https://devfeed.tech/topics/internet-explorer.md>)

Tags: [articles](<https://devfeed.tech/tags/articles.md>), [blog](<https://devfeed.tech/tags/blog.md>), [browser](<https://devfeed.tech/tags/browser.md>), [browsers](<https://devfeed.tech/tags/browsers.md>), [bug](<https://devfeed.tech/tags/bug.md>), [development](<https://devfeed.tech/tags/development.md>), [feature](<https://devfeed.tech/tags/feature.md>), [feature-detection](<https://devfeed.tech/tags/feature-detection.md>), [features](<https://devfeed.tech/tags/features.md>), [file](<https://devfeed.tech/tags/file.md>), [files](<https://devfeed.tech/tags/files.md>), [flexible](<https://devfeed.tech/tags/flexible.md>), [forms](<https://devfeed.tech/tags/forms.md>), [html](<https://devfeed.tech/tags/html.md>), [input](<https://devfeed.tech/tags/input.md>), [js](<https://devfeed.tech/tags/js.md>), [min](<https://devfeed.tech/tags/min.md>), [multiple](<https://devfeed.tech/tags/multiple.md>), [native](<https://devfeed.tech/tags/native.md>), [news](<https://devfeed.tech/tags/news.md>), [opera](<https://devfeed.tech/tags/opera.md>), [properties](<https://devfeed.tech/tags/properties.md>), [safari](<https://devfeed.tech/tags/safari.md>), [select](<https://devfeed.tech/tags/select.md>), [standard](<https://devfeed.tech/tags/standard.md>), [uploads](<https://devfeed.tech/tags/uploads.md>), [webkit](<https://devfeed.tech/tags/webkit.md>), [webkit-bugs](<https://devfeed.tech/tags/webkit-bugs.md>)

### AI overview

The excerpt describes two native ways to allow multiple file selection in one file input: Safari 4's `multiple` attribute and Opera's Web Forms 2.0 `min`/`max` attributes. It gives feature checks for each and combines them by enabling whichever supported mechanism is detected, with a preferred workaround left for other browsers. The author recommends fallbacks where neither is supported. Safari 4's `multiple` property was not then exposed for detection; the excerpt says the WebKit team had fixed a reported bug and that support was expected in a later nightly build. Mozilla implementation is presented as pending a Bugzilla request.

### Source excerpt

If you are following the current news on web development, you probably heard that the new Safari 4 has a great feature: It natively allows the user to select multiple files via a single input control, if you specify a value for the attribute multiple: <input type="file" multiple> or, in XHTML: <input type="file" multiple="multiple" /> You might not know that Opera supported multiple file uploads for a while now, based on the earlier Web Forms 2.0 standard in a slightly different (and more flexible) format: <input type="file" min="1" max="9999″ /> Can we use those currently? Sure we can, but we should provide fallbacks for the other browsers. Using these features will put pressure on the other browser vendors to implement them as well and generally, native is always better. How can we find out whether the browser supports them? Opera Opera supports accessing those min and max properties as properties of the element. So, it's quite trivial to check whether Opera-style multiple inputs are supported: var supportsMin = (function(){ var fi = document.createElement('input'); fi.type = 'file'; return fi.min === '' && fi.max === ''; })(); Safari 4 In Safari 4 the check would be equally simple, if it supported accessing the multiple attribute as a property. Then we could easily check whether it's boolean and conclude that Safari-style multiple inputs are supported: var supportsMultiple = (function(){ var fi = document.createElement('input'); fi.type = 'file'; // The second check is probably redundant but what if in the future an implementor // decides to make the file inputs to handle multiple selections by default? // Yeah, it's not likely, but it's not entirely impossible. return fi.multiple === false || fi.multiple === true; })(); However, that's currently not the case. The good news are that I reported this as a bug today, and the Webkit team fixed it, so it will be possible in the next Webkit nightly! Combining the two You can easily combine these two together with the w

## Find the vendor prefix of the current browser

DevFeed: [Find the vendor prefix of the current browser](<https://devfeed.tech/articles/find-the-vendor-prefix-of-the-current-browser-51936.md>)

Original publisher: [Read original article](<https://lea.verou.me/2009/02/find-the-vendor-prefix-of-the-current-browser/>)

Author: Lea Verou

Published: 2009-02-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Lea Verou's blog](<https://devfeed.tech/sources/lea-verou-s-blog.md>)

Topics: [browser](<https://devfeed.tech/topics/browser.md>), [CSS](<https://devfeed.tech/topics/css.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>), [WebKit](<https://devfeed.tech/topics/webkit.md>), [web-standards](<https://devfeed.tech/topics/web-standards.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [browser](<https://devfeed.tech/tags/browser.md>), [bug](<https://devfeed.tech/tags/bug.md>), [css](<https://devfeed.tech/tags/css.md>), [css-properties](<https://devfeed.tech/tags/css-properties.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [js](<https://devfeed.tech/tags/js.md>), [original](<https://devfeed.tech/tags/original.md>), [vendor-prefixes](<https://devfeed.tech/tags/vendor-prefixes.md>), [webkit](<https://devfeed.tech/tags/webkit.md>), [webkit-bugs](<https://devfeed.tech/tags/webkit-bugs.md>)

### AI overview

A tutorial explains how to detect the current browser's vendor prefix in JavaScript by inspecting supported style properties. It covers CSS-to-JavaScript property-name conversion, a cached detection function, and a WebKit-specific enumeration issue.

### Source excerpt

As you probably know already, when browsers implement an experimental or proprietary CSS property, they prefix it with their "vendor prefix", so that 1) it doesn't collide with other properties and 2) you can choose whether to use it or not in that particular browser, since it's support might be wrong or incomplete. When writing CSS you probably just include all properties and rest in peace, since browsers ignore properties they don't know. However, when changing a style via javascript it's quite a waste to do that. Instead of iterating over all possible vendor prefixes every time to test if a prefixed version of a specific property is supported, we can create a function that returns the current browser's prefix and caches the result, so that no redundant iterations are performed afterwards. How can we create such a function though? Things to consider The way CSS properties are converted their JS counterparts: Every character after a dash is capitalized, and all others are lowercase. The only exception is the new -ms- prefixed properties: Microsoft did it again and made their JS counterparts start with a lowercase m! Vendor prefixes always start with a dash and end with a dash Normal CSS properties never start with a dash Algorithm Iterate over all supported properties and find one that starts with a known prefix. Return the prefix. If no property that starts with a known prefix was found, return the empty string. JavaScript code function getVendorPrefix() { var regex = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/; var someScript = document.getElementsByTagName('script')[0]; for(var prop in someScript.style) { if(regex.test(prop)) { // test is faster than match, so it's better to perform // that on the lot and match only when necessary return prop.match(regex)[0]; } } // Nothing found so far? return ''; } Caution: Don't try to use someScript.style.hasOwnProperty(prop). It's missing on purpose, since if these properties aren't set on the particular element, hasOwnPropert