[Pkg-javascript-commits] [less.js] 258/285: firefox support

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:24:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.0.0
in repository less.js.

commit d37b55029f98fa88e303aa59a9919e6bac7d8912
Author: Luke Page <luke.a.page at gmail.com>
Date:   Sun Nov 2 10:45:55 2014 +0000

    firefox support
---
 test/browser/common.js | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/test/browser/common.js b/test/browser/common.js
index 0292f62..f97b665 100644
--- a/test/browser/common.js
+++ b/test/browser/common.js
@@ -108,6 +108,20 @@ var waitFor = function (waitFunc) {
     });
 };
 
+function getInnerText(el) {
+    var text = "";
+    if (typeof window.getSelection != "undefined") {
+        var sel = window.getSelection();
+        sel.removeAllRanges();
+        var range = document.createRange();
+        range.selectNodeContents(el);
+        sel.addRange(range);
+        text = sel.toString();
+        sel.removeAllRanges();
+    }
+    return text;
+}
+
 var testErrorSheet = function (sheet) {
     it(sheet.id + " should match an error", function (done) {
         var lessHref = sheet.href,
@@ -122,7 +136,12 @@ var testErrorSheet = function (sheet) {
             actualErrorElement = document.getElementById(id);
             return actualErrorElement !== null;
         }).then(function () {
-                actualErrorMsg = actualErrorElement.innerText
+                var innerText = actualErrorElement.innerText ||
+                    (actualErrorElement.innerHTML
+                        .replace(/<h3>|<\/?p>|<a href="[^"]*">|<\/a>|<ul>|<pre class="[^"]*">|<\/pre>|<\/li>|<\/?label>/g, "")
+                        .replace(/<\/h3>/g, " ")
+                        .replace(/<li>|<\/ul>/g, "\n"));
+                actualErrorMsg = innerText
                     .replace(/\n\d+/g, function (lineNo) {
                         return lineNo + " ";
                     })

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list