From 58ab17bf9e21cd5c5266f3f7c1de80eedc1821dd Mon Sep 17 00:00:00 2001 From: Luiza Pagliari Date: Tue, 28 Apr 2015 05:31:07 -0700 Subject: [PATCH] Fix the way Content Collector gets the node class. Fixes #2640 --- src/static/js/contentcollector.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 857e171fb..5c1e8efbf 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -71,8 +71,9 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas }, nodeAttr: function(n, a) { - if(n.getAttribute == null) return null; - return n.getAttribute(a); + if(n.getAttribute != null) return n.getAttribute(a); + if(n.attribs != null) return n.attribs[a]; + return null; }, optNodeInnerHTML: function(n) { @@ -516,7 +517,7 @@ function makeContentCollector(collectStyles, abrowser, apool, domInterface, clas else if (!isEmpty) { var styl = dom.nodeAttr(node, "style"); - var cls = dom.nodeProp(node, "className"); + var cls = dom.nodeAttr(node, "class"); var isPre = (tname == "pre"); if ((!isPre) && abrowser.safari) {