- From: Glen Huang <curvedmark@gmail.com>
- Date: Fri, 7 Aug 2015 06:50:45 +0800
- To: Matthew Robb <matthewwrobb@gmail.com>
- Cc: public-webapps <public-webapps@w3.org>, Brian Kardell <bkardell@gmail.com>
@William @Matthew
Ah, thanks. Now I think prollyfill is prolly a good name. :)
@Brian
Actually, I had this pattern in mind:
When no browsers ship the API:
```
if (HTMLElement.prototype.foo) {
HTMLElement.prototype._foo = HTMLElement.prototype.foo;
} else {
HTMLElement.prototype._foo = polyfill;
};
```
When at least two browsers ship this API:
```
if (!HTMLElement.prototype.foo) {
HTMLElement.prototype.foo = polyfill;
}
HTMLElement.prototype._foo = function() {
console.warn("deprecated");
return this.foo();
};
```
Received on Thursday, 6 August 2015 22:51:17 UTC