From e54a07f99fc21657c373428e77f74c76f9c8fdd5 Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Sat, 27 May 2017 23:59:14 -0700 Subject: [PATCH] fix #1445 Firefox has object method named watch. Would affect other attribute names that happen to be the same as native object methods. --- modules/clipboard.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/clipboard.js b/modules/clipboard.js index dbd0b8b0c5..35dc2dc5c6 100644 --- a/modules/clipboard.js +++ b/modules/clipboard.js @@ -216,11 +216,12 @@ function matchAttributor(node, delta) { formats[attr.attrName] = attr.value(node); if (formats[attr.attrName]) return; } - if (ATTRIBUTE_ATTRIBUTORS[name] != null) { - attr = ATTRIBUTE_ATTRIBUTORS[name]; + attr = ATTRIBUTE_ATTRIBUTORS[name]; + if (attr != null && attr.attrName === name) { formats[attr.attrName] = attr.value(node) || undefined; } - if (STYLE_ATTRIBUTORS[name] != null) { + attr = STYLE_ATTRIBUTORS[name] + if (attr != null && attr.attrName === name) { attr = STYLE_ATTRIBUTORS[name]; formats[attr.attrName] = attr.value(node) || undefined; }