Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: pkg/web_components/lib/platform.concat.js

Issue 587423002: cherry pick https://github.com/Polymer/ShadowDOM/pull/506 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/web_components/lib/platform.js ('k') | pkg/web_components/lib/platform.concat.js.map » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/web_components/lib/platform.concat.js
diff --git a/pkg/web_components/lib/platform.concat.js b/pkg/web_components/lib/platform.concat.js
index c4009c652dc2debb9d654c91f54def366a7429db..537c4f9a11d62c05ee46babcaf4a540613aa514e 100644
--- a/pkg/web_components/lib/platform.concat.js
+++ b/pkg/web_components/lib/platform.concat.js
@@ -2019,6 +2019,15 @@ window.ShadowDOMPolyfill = {};
}
}
+ // Safari 8 exposes WebIDL attributes as an invalid accessor property. Its
+ // descriptor has {get: undefined, set: undefined}. We therefore ignore the
+ // shape of the descriptor and make all properties read-write.
+ // https://bugs.webkit.org/show_bug.cgi?id=49739
+ var isBrokenSafari = function() {
+ var descr = Object.getOwnPropertyDescriptor(Node.prototype, 'nodeType');
+ return !!descr && 'set' in descr;
+ }();
+
function installProperty(source, target, allowMethod, opt_blacklist) {
var names = getOwnPropertyNames(source);
for (var i = 0; i < names.length; i++) {
@@ -2049,7 +2058,7 @@ window.ShadowDOMPolyfill = {};
else
getter = getGetter(name);
- if (descriptor.writable || descriptor.set) {
+ if (descriptor.writable || descriptor.set || isBrokenSafari) {
if (isEvent)
setter = scope.getEventHandlerSetter(name);
else
« no previous file with comments | « pkg/web_components/lib/platform.js ('k') | pkg/web_components/lib/platform.concat.js.map » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698