Working Skelleton

This commit is contained in:
2019-03-11 17:03:55 +01:00
commit 8ed2de006d
6779 changed files with 514323 additions and 0 deletions
+227
View File
@@ -0,0 +1,227 @@
/* Add js reporter for sauce */
jasmine.getEnv().addReporter(new jasmine.JSReporter2());
/* record log messages for testing */
var logMessages = [];
window.less = window.less || {};
var logLevel_debug = 4,
logLevel_info = 3,
logLevel_warn = 2,
logLevel_error = 1;
// The amount of logging in the javascript console.
// 3 - Debug, information and errors
// 2 - Information and errors
// 1 - Errors
// 0 - None
// Defaults to 2
less.loggers = [
{
debug: function(msg) {
if (less.options.logLevel >= logLevel_debug) {
logMessages.push(msg);
}
},
info: function(msg) {
if (less.options.logLevel >= logLevel_info) {
logMessages.push(msg);
}
},
warn: function(msg) {
if (less.options.logLevel >= logLevel_warn) {
logMessages.push(msg);
}
},
error: function(msg) {
if (less.options.logLevel >= logLevel_error) {
logMessages.push(msg);
}
}
}
];
var testLessEqualsInDocument = function () {
testLessInDocument(testSheet);
};
var testLessErrorsInDocument = function (isConsole) {
testLessInDocument(isConsole ? testErrorSheetConsole : testErrorSheet);
};
var testLessInDocument = function (testFunc) {
var links = document.getElementsByTagName('link'),
typePattern = /^text\/(x-)?less$/;
for (var i = 0; i < links.length; i++) {
if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
(links[i].type.match(typePattern)))) {
testFunc(links[i]);
}
}
};
var ieFormat = function(text) {
var styleNode = document.createElement('style');
styleNode.setAttribute('type', 'text/css');
var headNode = document.getElementsByTagName('head')[0];
headNode.appendChild(styleNode);
try {
if (styleNode.styleSheet) {
styleNode.styleSheet.cssText = text;
} else {
styleNode.innerText = text;
}
} catch (e) {
throw new Error("Couldn't reassign styleSheet.cssText.");
}
var transformedText = styleNode.styleSheet ? styleNode.styleSheet.cssText : styleNode.innerText;
headNode.removeChild(styleNode);
return transformedText;
};
var testSheet = function (sheet) {
it(sheet.id + " should match the expected output", function (done) {
var lessOutputId = sheet.id.replace("original-", ""),
expectedOutputId = "expected-" + lessOutputId,
lessOutputObj,
lessOutput,
expectedOutputHref = document.getElementById(expectedOutputId).href,
expectedOutput = loadFile(expectedOutputHref);
// Browser spec generates less on the fly, so we need to loose control
less.pageLoadFinished
.then(function () {
lessOutputObj = document.getElementById(lessOutputId);
lessOutput = lessOutputObj.styleSheet ? lessOutputObj.styleSheet.cssText :
(lessOutputObj.innerText || lessOutputObj.innerHTML);
expectedOutput
.then(function (text) {
if (window.navigator.userAgent.indexOf("MSIE") >= 0 ||
window.navigator.userAgent.indexOf("Trident/") >= 0) {
text = ieFormat(text);
}
expect(lessOutput).toEqual(text);
done();
});
});
});
};
//TODO: do it cleaner - the same way as in css
function extractId(href) {
return href.replace(/^[a-z-]+:\/+?[^\/]+/i, '') // Remove protocol & domain
.replace(/^\//, '') // Remove root /
.replace(/\.[a-zA-Z]+$/, '') // Remove simple extension
.replace(/[^\.\w-]+/g, '-') // Replace illegal characters
.replace(/\./g, ':'); // Replace dots with colons(for valid id)
}
var waitFor = function (waitFunc) {
return new Promise(function (resolve) {
var timeoutId = setInterval(function () {
if (waitFunc()) {
clearInterval(timeoutId);
resolve();
}
}, 5);
});
};
var testErrorSheet = function (sheet) {
it(sheet.id + " should match an error", function (done) {
var lessHref = sheet.href,
id = "less-error-message:" + extractId(lessHref),
errorHref = lessHref.replace(/.less$/, ".txt"),
errorFile = loadFile(errorHref),
actualErrorElement,
actualErrorMsg;
// Less.js sets 10ms timer in order to add error message on top of page.
waitFor(function () {
actualErrorElement = document.getElementById(id);
return actualErrorElement !== null;
}).then(function () {
var innerText = (actualErrorElement.innerHTML
.replace(/<h3>|<\/?p>|<a href="[^"]*">|<\/a>|<ul>|<\/?pre( class="?[^">]*"?)?>|<\/li>|<\/?label>/ig, "")
.replace(/<\/h3>/ig, " ")
.replace(/<li>|<\/ul>|<br>/ig, "\n"))
.replace(/&amp;/ig, "&")
// for IE8
.replace(/\r\n/g, "\n")
.replace(/\. \nin/, ". in");
actualErrorMsg = innerText
.replace(/\n\d+/g, function (lineNo) {
return lineNo + " ";
})
.replace(/\n\s*in /g, " in ")
.replace(/\n{2,}/g, "\n")
.replace(/\nStack Trace\n[\s\S]*/i, "")
.replace(/\n$/, "");
errorFile
.then(function (errorTxt) {
errorTxt = errorTxt
.replace(/\{path\}/g, "")
.replace(/\{pathrel\}/g, "")
.replace(/\{pathhref\}/g, "http://localhost:8081/test/less/errors/")
.replace(/\{404status\}/g, " (404)")
.replace(/\{node\}.*\{\/node\}/g, "")
.replace(/\n$/, "");
expect(actualErrorMsg).toEqual(errorTxt);
if (errorTxt == actualErrorMsg) {
actualErrorElement.style.display = "none";
}
done();
});
});
});
};
var testErrorSheetConsole = function (sheet) {
it(sheet.id + " should match an error", function (done) {
var lessHref = sheet.href,
id = sheet.id.replace(/^original-less:/, "less-error-message:"),
errorHref = lessHref.replace(/.less$/, ".txt"),
errorFile = loadFile(errorHref),
actualErrorElement = document.getElementById(id),
actualErrorMsg = logMessages[logMessages.length - 1]
.replace(/\nStack Trace\n[\s\S]*/, "");
describe("the error", function () {
expect(actualErrorElement).toBe(null);
});
errorFile
.then(function (errorTxt) {
errorTxt
.replace(/\{path\}/g, "")
.replace(/\{pathrel\}/g, "")
.replace(/\{pathhref\}/g, "http://localhost:8081/browser/less/")
.replace(/\{404status\}/g, " (404)")
.replace(/\{node\}.*\{\/node\}/g, "")
.trim();
expect(actualErrorMsg).toEqual(errorTxt);
done();
});
});
};
var loadFile = function (href) {
return new Promise(function (resolve, reject) {
var request = new XMLHttpRequest();
request.open('GET', href, true);
request.onreadystatechange = function () {
if (request.readyState == 4) {
resolve(request.responseText.replace(/\r/g, ""));
}
};
request.send(null);
});
};
jasmine.DEFAULT_TIMEOUT_INTERVAL = 90000;
@@ -0,0 +1,3 @@
.a {
prop: #000000;
}
@@ -0,0 +1,3 @@
.test-height {
height: image-height("../data/image.jpg");
}
@@ -0,0 +1,3 @@
.test-size {
size: image-size("../data/image.jpg");
}
@@ -0,0 +1,3 @@
.test-width {
width: image-width("../data/image.jpg");
}
@@ -0,0 +1,3 @@
.test {
color: red;
}
+4
View File
@@ -0,0 +1,4 @@
@import "modify-this.css";
.modify {
my-url: url("a.png");
}
@@ -0,0 +1,4 @@
@import "modify-again.css";
.modify {
my-url: url("b.png");
}
@@ -0,0 +1,3 @@
.testisimported {
color: gainsboro;
}
@@ -0,0 +1,8 @@
.testisimported {
color: gainsboro;
}
.test {
color1: #ff0000;
color2: #0000ff;
scalar: 10;
}
@@ -0,0 +1,3 @@
.gray-gradient {
background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZ3JhZGllbnQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzk5OTk5OSIgc3RvcC1vcGFjaXR5PSIwIi8+PHN0b3Agb2Zmc2V0PSI2MCUiIHN0b3AtY29sb3I9IiM5OTk5OTkiIHN0b3Atb3BhY2l0eT0iMC4wNSIvPjxzdG9wIG9mZnNldD0iNzAlIiBzdG9wLWNvbG9yPSIjOTk5OTk5IiBzdG9wLW9wYWNpdHk9IjAuMSIvPjxzdG9wIG9mZnNldD0iNzMlIiBzdG9wLWNvbG9yPSIjOTk5OTk5IiBzdG9wLW9wYWNpdHk9IjAuMTUiLz48c3RvcCBvZmZzZXQ9Ijc1JSIgc3RvcC1jb2xvcj0iIzk5OTk5OSIgc3RvcC1vcGFjaXR5PSIwLjIiLz48c3RvcCBvZmZzZXQ9IjgwJSIgc3RvcC1jb2xvcj0iIzk5OTk5OSIgc3RvcC1vcGFjaXR5PSIwLjI1Ii8+PHN0b3Agb2Zmc2V0PSI4NSUiIHN0b3AtY29sb3I9IiM5OTk5OTkiIHN0b3Atb3BhY2l0eT0iMC4zIi8+PHN0b3Agb2Zmc2V0PSI4OCUiIHN0b3AtY29sb3I9IiM5OTk5OTkiIHN0b3Atb3BhY2l0eT0iMC4zNSIvPjxzdG9wIG9mZnNldD0iOTAlIiBzdG9wLWNvbG9yPSIjOTk5OTk5IiBzdG9wLW9wYWNpdHk9IjAuNCIvPjxzdG9wIG9mZnNldD0iOTUlIiBzdG9wLWNvbG9yPSIjOTk5OTk5IiBzdG9wLW9wYWNpdHk9IjAuNDUiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM5OTk5OTkiIHN0b3Atb3BhY2l0eT0iMC41Ii8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWRpZW50KSIgLz48L3N2Zz4=');
}
@@ -0,0 +1,3 @@
.test {
color: #ffffff;
}
@@ -0,0 +1,36 @@
@import "http://localhost:8081/test/browser/less/imports/modify-this.css";
@import "http://localhost:8081/test/browser/less/imports/modify-again.css";
.modify {
my-url: url("http://localhost:8081/test/browser/less/imports/a.png");
}
.modify {
my-url: url("http://localhost:8081/test/browser/less/imports/b.png");
}
@font-face {
src: url("/fonts/garamond-pro.ttf");
src: local(Futura-Medium), url(http://localhost:8081/test/browser/less/relative-urls/fonts.svg#MyGeometricModern) format("svg");
}
#shorthands {
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#misc {
background-image: url(http://localhost:8081/test/browser/less/relative-urls/images/image.jpg);
background: url("#inline-svg");
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
}
#svg-data-uri {
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
}
.comma-delimited {
background: url(http://localhost:8081/test/browser/less/relative-urls/bg.jpg) no-repeat, url(http://localhost:8081/test/browser/less/relative-urls/bg.png) repeat-x top left, url(http://localhost:8081/test/browser/less/relative-urls/bg);
}
.values {
url: url('http://localhost:8081/test/browser/less/relative-urls/Trebuchet');
}
@@ -0,0 +1,35 @@
@import "https://www.github.com/cloudhead/imports/modify-this.css";
@import "https://www.github.com/cloudhead/imports/modify-again.css";
.modify {
my-url: url("https://www.github.com/cloudhead/imports/a.png");
}
.modify {
my-url: url("https://www.github.com/cloudhead/imports/b.png");
}
@font-face {
src: url("/fonts/garamond-pro.ttf");
src: local(Futura-Medium), url(https://www.github.com/cloudhead/less.js/fonts.svg#MyGeometricModern) format("svg");
}
#shorthands {
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#misc {
background-image: url(https://www.github.com/cloudhead/less.js/images/image.jpg);
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
}
#svg-data-uri {
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
}
.comma-delimited {
background: url(https://www.github.com/cloudhead/less.js/bg.jpg) no-repeat, url(https://www.github.com/cloudhead/less.js/bg.png) repeat-x top left, url(https://www.github.com/cloudhead/less.js/bg);
}
.values {
url: url('https://www.github.com/cloudhead/less.js/Trebuchet');
}
+35
View File
@@ -0,0 +1,35 @@
@import "https://localhost/modify-this.css";
@import "https://localhost/modify-again.css";
.modify {
my-url: url("https://localhost/a.png");
}
.modify {
my-url: url("https://localhost/b.png");
}
@font-face {
src: url("/fonts/garamond-pro.ttf");
src: local(Futura-Medium), url(https://localhost/fonts.svg#MyGeometricModern) format("svg");
}
#shorthands {
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#misc {
background-image: url(https://localhost/images/image.jpg);
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
}
#svg-data-uri {
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
}
.comma-delimited {
background: url(https://localhost/bg.jpg) no-repeat, url(https://localhost/bg.png) repeat-x top left, url(https://localhost/bg);
}
.values {
url: url('https://localhost/Trebuchet');
}
+57
View File
@@ -0,0 +1,57 @@
@import "http://localhost:8081/test/browser/less/modify-this.css";
@import "http://localhost:8081/test/browser/less/modify-again.css";
.modify {
my-url: url("http://localhost:8081/test/browser/less/a.png");
}
.modify {
my-url: url("http://localhost:8081/test/browser/less/b.png");
}
.gray-gradient {
background: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%2260%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.05%22%2F%3E%3Cstop%20offset%3D%2270%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.1%22%2F%3E%3Cstop%20offset%3D%2273%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.15%22%2F%3E%3Cstop%20offset%3D%2275%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.2%22%2F%3E%3Cstop%20offset%3D%2280%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.25%22%2F%3E%3Cstop%20offset%3D%2285%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.3%22%2F%3E%3Cstop%20offset%3D%2288%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.35%22%2F%3E%3Cstop%20offset%3D%2290%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.4%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.45%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23999999%22%20stop-opacity%3D%220.5%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
}
@font-face {
src: url("/fonts/garamond-pro.ttf");
src: local(Futura-Medium), url(http://localhost:8081/test/browser/less/fonts.svg#MyGeometricModern) format("svg");
not-a-comment: url(//z);
}
#shorthands {
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#misc {
background-image: url(http://localhost:8081/test/browser/less/images/image.jpg);
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
}
#svg-data-uri {
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
}
.comma-delimited {
background: url(http://localhost:8081/test/browser/less/bg.jpg) no-repeat, url(http://localhost:8081/test/browser/less/bg.png) repeat-x top left, url(http://localhost:8081/test/browser/less/bg);
}
.values {
url: url('http://localhost:8081/test/browser/less/Trebuchet');
}
#data-uri {
uri: url('http://localhost:8081/test/data/image.jpg');
}
#data-uri-guess {
uri: url('http://localhost:8081/test/data/image.jpg');
}
#data-uri-ascii {
uri-1: url('http://localhost:8081/test/data/page.html');
uri-2: url('http://localhost:8081/test/data/page.html');
}
#data-uri-toobig {
uri: url('http://localhost:8081/test/data/data-uri-fail.png');
}
#svg-functions {
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%220%25%22%20stop-color%3D%22%23000000%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%22100%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
background-image: url('data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%201%201%22%20preserveAspectRatio%3D%22none%22%3E%3ClinearGradient%20id%3D%22gradient%22%20gradientUnits%3D%22userSpaceOnUse%22%20x1%3D%220%25%22%20y1%3D%220%25%22%20x2%3D%220%25%22%20y2%3D%22100%25%22%3E%3Cstop%20offset%3D%221%25%22%20stop-color%3D%22%23c4c4c4%22%2F%3E%3Cstop%20offset%3D%223%25%22%20stop-color%3D%22%23ffa500%22%2F%3E%3Cstop%20offset%3D%225%25%22%20stop-color%3D%22%23008000%22%2F%3E%3Cstop%20offset%3D%2295%25%22%20stop-color%3D%22%23ffffff%22%2F%3E%3C%2FlinearGradient%3E%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22url(%23gradient)%22%20%2F%3E%3C%2Fsvg%3E');
}
+391
View File
@@ -0,0 +1,391 @@
/*
This file is part of the Jasmine JSReporter project from Ivan De Marino.
Copyright (C) 2011-2014 Ivan De Marino <http://ivandemarino.me>
Copyright (C) 2014 Alex Treppass <http://alextreppass.co.uk>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL IVAN DE MARINO BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function (jasmine) {
if (!jasmine) {
throw new Error("[Jasmine JSReporter] 'Jasmine' library not found");
}
// ------------------------------------------------------------------------
// Jasmine JSReporter for Jasmine 1.x
// ------------------------------------------------------------------------
/**
* Calculate elapsed time, in Seconds.
* @param startMs Start time in Milliseconds
* @param finishMs Finish time in Milliseconds
* @return Elapsed time in Seconds */
function elapsedSec (startMs, finishMs) {
return (finishMs - startMs) / 1000;
}
/**
* Round an amount to the given number of Digits.
* If no number of digits is given, than '2' is assumed.
* @param amount Amount to round
* @param numOfDecDigits Number of Digits to round to. Default value is '2'.
* @return Rounded amount */
function round (amount, numOfDecDigits) {
numOfDecDigits = numOfDecDigits || 2;
return Math.round(amount * Math.pow(10, numOfDecDigits)) / Math.pow(10, numOfDecDigits);
}
/**
* Create a new array which contains only the failed items.
* @param items Items which will be filtered
* @returns {Array} of failed items */
function failures (items) {
var fs = [], i, v;
for (i = 0; i < items.length; i += 1) {
v = items[i];
if (!v.passed_) {
fs.push(v);
}
}
return fs;
}
/**
* Collect information about a Suite, recursively, and return a JSON result.
* @param suite The Jasmine Suite to get data from
*/
function getSuiteData (suite) {
var suiteData = {
description : suite.description,
durationSec : 0,
specs: [],
suites: [],
passed: true
},
specs = suite.specs(),
suites = suite.suites(),
i, ilen;
// Loop over all the Suite's Specs
for (i = 0, ilen = specs.length; i < ilen; ++i) {
suiteData.specs[i] = {
description : specs[i].description,
durationSec : specs[i].durationSec,
passed : specs[i].results().passedCount === specs[i].results().totalCount,
skipped : specs[i].results().skipped,
passedCount : specs[i].results().passedCount,
failedCount : specs[i].results().failedCount,
totalCount : specs[i].results().totalCount,
failures: failures(specs[i].results().getItems())
};
suiteData.passed = !suiteData.specs[i].passed ? false : suiteData.passed;
suiteData.durationSec += suiteData.specs[i].durationSec;
}
// Loop over all the Suite's sub-Suites
for (i = 0, ilen = suites.length; i < ilen; ++i) {
suiteData.suites[i] = getSuiteData(suites[i]); //< recursive population
suiteData.passed = !suiteData.suites[i].passed ? false : suiteData.passed;
suiteData.durationSec += suiteData.suites[i].durationSec;
}
// Rounding duration numbers to 3 decimal digits
suiteData.durationSec = round(suiteData.durationSec, 4);
return suiteData;
}
var JSReporter = function () {
};
JSReporter.prototype = {
reportRunnerStarting: function (runner) {
// Nothing to do
},
reportSpecStarting: function (spec) {
// Start timing this spec
spec.startedAt = new Date();
},
reportSpecResults: function (spec) {
// Finish timing this spec and calculate duration/delta (in sec)
spec.finishedAt = new Date();
// If the spec was skipped, reportSpecStarting is never called and spec.startedAt is undefined
spec.durationSec = spec.startedAt ? elapsedSec(spec.startedAt.getTime(), spec.finishedAt.getTime()) : 0;
},
reportSuiteResults: function (suite) {
// Nothing to do
},
reportRunnerResults: function (runner) {
var suites = runner.suites(),
i, j, ilen;
// Attach results to the "jasmine" object to make those results easy to scrap/find
jasmine.runnerResults = {
suites: [],
durationSec : 0,
passed : true
};
// Loop over all the Suites
for (i = 0, ilen = suites.length, j = 0; i < ilen; ++i) {
if (suites[i].parentSuite === null) {
jasmine.runnerResults.suites[j] = getSuiteData(suites[i]);
// If 1 suite fails, the whole runner fails
jasmine.runnerResults.passed = !jasmine.runnerResults.suites[j].passed ? false : jasmine.runnerResults.passed;
// Add up all the durations
jasmine.runnerResults.durationSec += jasmine.runnerResults.suites[j].durationSec;
j++;
}
}
// Decorate the 'jasmine' object with getters
jasmine.getJSReport = function () {
if (jasmine.runnerResults) {
return jasmine.runnerResults;
}
return null;
};
jasmine.getJSReportAsString = function () {
return JSON.stringify(jasmine.getJSReport());
};
}
};
// export public
jasmine.JSReporter = JSReporter;
// ------------------------------------------------------------------------
// Jasmine JSReporter for Jasmine 2.0
// ------------------------------------------------------------------------
/*
Simple timer implementation
*/
var Timer = function () {};
Timer.prototype.start = function () {
this.startTime = new Date().getTime();
return this;
};
Timer.prototype.elapsed = function () {
if (this.startTime == null) {
return -1;
}
return new Date().getTime() - this.startTime;
};
/*
Utility methods
*/
var _extend = function (obj1, obj2) {
for (var prop in obj2) {
obj1[prop] = obj2[prop];
}
return obj1;
};
var _clone = function (obj) {
if (obj !== Object(obj)) {
return obj;
}
return _extend({}, obj);
};
jasmine.JSReporter2 = function () {
this.specs = {};
this.suites = {};
this.rootSuites = [];
this.suiteStack = [];
// export methods under jasmine namespace
jasmine.getJSReport = this.getJSReport;
jasmine.getJSReportAsString = this.getJSReportAsString;
};
var JSR = jasmine.JSReporter2.prototype;
// Reporter API methods
// --------------------
JSR.suiteStarted = function (suite) {
suite = this._cacheSuite(suite);
// build up suite tree as we go
suite.specs = [];
suite.suites = [];
suite.passed = true;
suite.parentId = this.suiteStack.slice(this.suiteStack.length - 1)[0];
if (suite.parentId) {
this.suites[suite.parentId].suites.push(suite);
} else {
this.rootSuites.push(suite.id);
}
this.suiteStack.push(suite.id);
suite.timer = new Timer().start();
};
JSR.suiteDone = function (suite) {
suite = this._cacheSuite(suite);
suite.duration = suite.timer.elapsed();
suite.durationSec = suite.duration / 1000;
this.suiteStack.pop();
// maintain parent suite state
var parent = this.suites[suite.parentId];
if (parent) {
parent.passed = parent.passed && suite.passed;
}
// keep report representation clean
delete suite.timer;
delete suite.id;
delete suite.parentId;
delete suite.fullName;
};
JSR.specStarted = function (spec) {
spec = this._cacheSpec(spec);
spec.timer = new Timer().start();
// build up suites->spec tree as we go
spec.suiteId = this.suiteStack.slice(this.suiteStack.length - 1)[0];
this.suites[spec.suiteId].specs.push(spec);
};
JSR.specDone = function (spec) {
spec = this._cacheSpec(spec);
spec.duration = spec.timer.elapsed();
spec.durationSec = spec.duration / 1000;
spec.skipped = spec.status === 'pending';
spec.passed = spec.skipped || spec.status === 'passed';
spec.totalCount = spec.passedExpectations.length + spec.failedExpectations.length;
spec.passedCount = spec.passedExpectations.length;
spec.failedCount = spec.failedExpectations.length;
spec.failures = [];
for (var i = 0, j = spec.failedExpectations.length; i < j; i++) {
var fail = spec.failedExpectations[i];
spec.failures.push({
type: 'expect',
expected: fail.expected,
passed: false,
message: fail.message,
matcherName: fail.matcherName,
trace: {
stack: fail.stack
}
});
}
// maintain parent suite state
var parent = this.suites[spec.suiteId];
if (spec.failed) {
parent.failingSpecs.push(spec);
}
parent.passed = parent.passed && spec.passed;
// keep report representation clean
delete spec.timer;
delete spec.totalExpectations;
delete spec.passedExpectations;
delete spec.suiteId;
delete spec.fullName;
delete spec.id;
delete spec.status;
delete spec.failedExpectations;
};
JSR.jasmineDone = function () {
this._buildReport();
};
JSR.getJSReport = function () {
if (jasmine.jsReport) {
return jasmine.jsReport;
}
};
JSR.getJSReportAsString = function () {
if (jasmine.jsReport) {
return JSON.stringify(jasmine.jsReport);
}
};
// Private methods
// ---------------
JSR._haveSpec = function (spec) {
return this.specs[spec.id] != null;
};
JSR._cacheSpec = function (spec) {
var existing = this.specs[spec.id];
if (existing == null) {
existing = this.specs[spec.id] = _clone(spec);
} else {
_extend(existing, spec);
}
return existing;
};
JSR._haveSuite = function (suite) {
return this.suites[suite.id] != null;
};
JSR._cacheSuite = function (suite) {
var existing = this.suites[suite.id];
if (existing == null) {
existing = this.suites[suite.id] = _clone(suite);
} else {
_extend(existing, suite);
}
return existing;
};
JSR._buildReport = function () {
var overallDuration = 0;
var overallPassed = true;
var overallSuites = [];
for (var i = 0, j = this.rootSuites.length; i < j; i++) {
var suite = this.suites[this.rootSuites[i]];
overallDuration += suite.duration;
overallPassed = overallPassed && suite.passed;
overallSuites.push(suite);
}
jasmine.jsReport = {
passed: overallPassed,
durationSec: overallDuration / 1000,
suites: overallSuites
};
};
})(jasmine);
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
.a {
prop: (3 / #fff);
}
@@ -0,0 +1,2 @@
less: OperationError: Can't subtract or divide a color from a number in {pathhref}console-errors/test-error.less on line null, column 0:
1 prop: (3 / #fff);
@@ -0,0 +1,3 @@
.test-height{
height: image-height("../data/image.jpg")
}
@@ -0,0 +1,4 @@
RuntimeError: error evaluating function `image-height`: Image size functions are not supported in browser version of less in image-height-error.less on line 2, column 11:
1 .test-height{
2 height: image-height("../data/image.jpg")
3 }
@@ -0,0 +1,3 @@
.test-size{
size: image-size("../data/image.jpg")
}
@@ -0,0 +1,4 @@
RuntimeError: error evaluating function `image-size`: Image size functions are not supported in browser version of less in image-size-error.less on line 2, column 9:
1 .test-size{
2 size: image-size("../data/image.jpg")
3 }
@@ -0,0 +1,3 @@
.test-width{
width: image-width("../data/image.jpg")
}
@@ -0,0 +1,4 @@
RuntimeError: error evaluating function `image-width`: Image size functions are not supported in browser version of less in image-width-error.less on line 2, column 10:
1 .test-width{
2 width: image-width("../data/image.jpg")
3 }
@@ -0,0 +1,3 @@
.test {
color: @global-var;
}
@@ -0,0 +1,4 @@
@import "modify-this.css";
.modify {
my-url: url("a.png");
}
@@ -0,0 +1,4 @@
@import "modify-again.css";
.modify {
my-url: url("b.png");
}
@@ -0,0 +1,4 @@
@var2: blue;
.testisimported {
color: gainsboro;
}
@@ -0,0 +1,8 @@
@import "imports/simple2";
@var1: red;
@scale: 10;
.test {
color1: @var1;
color2: @var2;
scalar: @scale
}
@@ -0,0 +1,5 @@
@import "svg-gradient-mixin.less";
.gray-gradient {
.gradient-mixin(#999);
}
@@ -0,0 +1,15 @@
.gradient-mixin(@color) {
background: svg-gradient(to bottom,
fade(@color, 0%) 0%,
fade(@color, 5%) 60%,
fade(@color, 10%) 70%,
fade(@color, 15%) 73%,
fade(@color, 20%) 75%,
fade(@color, 25%) 80%,
fade(@color, 30%) 85%,
fade(@color, 35%) 88%,
fade(@color, 40%) 90%,
fade(@color, 45%) 95%,
fade(@color, 50%) 100%
);
}
@@ -0,0 +1,4 @@
@color: white;
.test {
color: @color;
}
@@ -0,0 +1,34 @@
@import ".././imports/urls.less";
@import "http://localhost:8081/test/browser/less/imports/urls2.less";
@font-face {
src: url("/fonts/garamond-pro.ttf");
src: local(Futura-Medium),
url(fonts.svg#MyGeometricModern) format("svg");
}
#shorthands {
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#misc {
background-image: url(images/image.jpg);
background: url("#inline-svg");
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
}
#svg-data-uri {
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
}
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
}
.values {
@a: 'Trebuchet';
url: url(@a);
}
@@ -0,0 +1,33 @@
@import "../imports/urls.less";
@import "http://localhost:8081/test/browser/less/imports/urls2.less";
@font-face {
src: url("/fonts/garamond-pro.ttf");
src: local(Futura-Medium),
url(fonts.svg#MyGeometricModern) format("svg");
}
#shorthands {
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#misc {
background-image: url(images/image.jpg);
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
}
#svg-data-uri {
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
}
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
}
.values {
@a: 'Trebuchet';
url: url(@a);
}
@@ -0,0 +1,33 @@
@import "../imports/urls.less";
@import "http://localhost:8081/test/browser/less/imports/urls2.less";
@font-face {
src: url("/fonts/garamond-pro.ttf");
src: local(Futura-Medium),
url(fonts.svg#MyGeometricModern) format("svg");
}
#shorthands {
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#misc {
background-image: url(images/image.jpg);
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
}
#svg-data-uri {
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
}
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
}
.values {
@a: 'Trebuchet';
url: url(@a);
}
+65
View File
@@ -0,0 +1,65 @@
@import "imports/urls.less";
@import "http://localhost:8081/test/browser/less/imports/urls2.less";
@import "http://localhost:8081/test/browser/less/nested-gradient-with-svg-gradient/mixin-consumer.less";
@font-face {
src: url("/fonts/garamond-pro.ttf");
src: local(Futura-Medium),
url(fonts.svg#MyGeometricModern) format("svg");
not-a-comment: url(//z);
}
#shorthands {
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#misc {
background-image: url(images/image.jpg);
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
}
#svg-data-uri {
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
}
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
}
.values {
@a: 'Trebuchet';
url: url(@a);
}
#data-uri {
uri: data-uri('image/jpeg;base64', '../../data/image.jpg');
}
#data-uri-guess {
uri: data-uri('../../data/image.jpg');
}
#data-uri-ascii {
uri-1: data-uri('text/html', '../../data/page.html');
uri-2: data-uri('../../data/page.html');
}
#data-uri-toobig {
uri: data-uri('../../data/data-uri-fail.png');
}
#svg-functions {
@colorlist1: black, white;
background-image: svg-gradient(to bottom, @colorlist1);
background-image: svg-gradient(to bottom, black white);
background-image: svg-gradient(to bottom, black, orange 3%, white);
@colorlist2: black, orange 3%, white;
background-image: svg-gradient(to bottom, @colorlist2);
@green_5: green 5%;
@orange_percentage: 3%;
@orange_color: orange;
@colorlist3: (mix(black, white) + #444) 1%, @orange_color @orange_percentage, ((@green_5)), white 95%;
background-image: svg-gradient(to bottom,@colorlist3);
background-image: svg-gradient(to bottom, (mix(black, white) + #444) 1%, @orange_color @orange_percentage, ((@green_5)), white 95%);
}
@@ -0,0 +1,3 @@
var less = {logLevel: 4,
errorReporting: "console",
plugins: [VisitorPlugin]};
@@ -0,0 +1,3 @@
describe("less.js Visitor Plugin", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,51 @@
var less = {logLevel: 4, errorReporting: "console"};
// There originally run inside describe method. However, since they have not
// been inside it, they run at jasmine compile time (not runtime). It all
// worked cause less.js was in async mode and custom phantom runner had
// different setup then grunt-contrib-jasmine. They have been created before
// less.js run, even as they have been defined in spec.
// test inline less in style tags by grabbing an assortment of less files and doing `@import`s
var testFiles = ['charsets', 'colors', 'comments', 'css-3', 'strings', 'media', 'mixins'],
testSheets = [];
// IE 8-10 does not support less in style tags
if (window.navigator.userAgent.indexOf("MSIE") >= 0) {
testFiles.length = 0;
}
// setup style tags with less and link tags pointing to expected css output
for (var i = 0; i < testFiles.length; i++) {
var file = testFiles[i],
lessPath = '/test/less/' + file + '.less',
cssPath = '/test/css/' + file + '.css',
lessStyle = document.createElement('style'),
cssLink = document.createElement('link'),
lessText = '@import "' + lessPath + '";';
lessStyle.type = 'text/less';
lessStyle.id = file;
lessStyle.href = file;
if (lessStyle.styleSheet === undefined) {
lessStyle.appendChild(document.createTextNode(lessText));
}
cssLink.rel = 'stylesheet';
cssLink.type = 'text/css';
cssLink.href = cssPath;
cssLink.id = 'expected-' + file;
var head = document.getElementsByTagName('head')[0];
head.appendChild(lessStyle);
if (lessStyle.styleSheet) {
lessStyle.styleSheet.cssText = lessText;
}
head.appendChild(cssLink);
testSheets[i] = lessStyle;
}
+12
View File
@@ -0,0 +1,12 @@
describe("less.js browser behaviour", function() {
testLessEqualsInDocument();
it("has some log messages", function() {
expect(logMessages.length).toBeGreaterThan(0);
});
for (var i = 0; i < testFiles.length; i++) {
var sheet = testSheets[i];
testSheet(sheet);
}
});
@@ -0,0 +1,5 @@
less.errorReporting = 'console';
describe("less.js error reporting console test", function() {
testLessErrorsInDocument(true);
});
@@ -0,0 +1,4 @@
var less = {
strictUnits: true,
strictMath: true,
logLevel: 4 };
@@ -0,0 +1,3 @@
describe("less.js error tests", function() {
testLessErrorsInDocument();
});
@@ -0,0 +1,4 @@
var less = {logLevel: 4,
errorReporting: "console",
plugins: [AddFilePlugin]
};
@@ -0,0 +1,3 @@
describe("less.js filemanager Plugin", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,7 @@
var less = {
logLevel: 4,
errorReporting: "console",
globalVars: {
"@global-var": "red"
}
};
@@ -0,0 +1,3 @@
describe("less.js global vars", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,5 @@
var less = {
logLevel: 4,
errorReporting: "console",
strictMath: false,
strictUnits: false };
@@ -0,0 +1,3 @@
describe("less.js legacy tests", function() {
testLessEqualsInDocument();
});
+18
View File
@@ -0,0 +1,18 @@
var less = {
logLevel: 4,
errorReporting: "console"
};
less.strictMath = true;
less.functions = {
add: function(a, b) {
return new(less.tree.Dimension)(a.value + b.value);
},
increment: function(a) {
return new(less.tree.Dimension)(a.value + 1);
},
_color: function(str) {
if (str.value === "evil red") {
return new(less.tree.Color)("600");
}
}
};
+7
View File
@@ -0,0 +1,7 @@
console.warn("start spec");
describe("less.js main tests", function() {
testLessEqualsInDocument();
it("the global environment", function() {
expect(window.require).toBe(undefined);
});
});
@@ -0,0 +1,5 @@
/* exported less */
var less = {
logLevel: 4,
errorReporting: "console"
};
@@ -0,0 +1,33 @@
var alreadyRun = false;
describe("less.js modify vars", function () {
beforeEach(function (done) {
// simulating "setUp" or "beforeAll" method
if (alreadyRun) {
done();
return;
}
alreadyRun = true;
less.pageLoadFinished
.then(function () {
less.modifyVars({
var1: "green",
var2: "purple",
scale: 20
}).then(function () {
done();
});
});
});
testLessEqualsInDocument();
it("Should log only 2 XHR requests", function (done) {
var xhrLogMessages = logMessages.filter(function (item) {
return (/XHR: Getting '/).test(item);
});
expect(xhrLogMessages.length).toEqual(2);
done();
});
});
@@ -0,0 +1,4 @@
var less = {logLevel: 4};
less.strictUnits = true;
less.javascriptEnabled = false;
@@ -0,0 +1,3 @@
describe("less.js javascript disabled error tests", function() {
testLessErrorsInDocument();
});
@@ -0,0 +1,5 @@
var less = {logLevel: 4,
errorReporting: "console"};
less.postProcessor = function(styles) {
return 'hr {height:50px;}\n' + styles;
};
@@ -0,0 +1,3 @@
describe("less.js postProcessor (deprecated)", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,3 @@
var less = {logLevel: 4,
errorReporting: "console",
plugins: [postProcessorPlugin]};
@@ -0,0 +1,3 @@
describe("less.js postProcessor Plugin", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,3 @@
var less = {logLevel: 4,
errorReporting: "console",
plugins: [preProcessorPlugin]};
@@ -0,0 +1,3 @@
describe("less.js preProcessor Plugin", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,3 @@
var less = {logLevel: 1,
errorReporting: "console"};
less.env = "production";
@@ -0,0 +1,5 @@
describe("less.js production behaviour", function() {
it("doesn't log any messages", function() {
expect(logMessages.length).toEqual(0);
});
});
@@ -0,0 +1,3 @@
var less = {logLevel: 4,
errorReporting: "console"};
less.relativeUrls = true;
@@ -0,0 +1,3 @@
describe("less.js browser test - relative url's", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,3 @@
var less = {logLevel: 4,
errorReporting: "console"};
less.rootpath = "https://localhost/";
@@ -0,0 +1,4 @@
var less = {logLevel: 4,
errorReporting: "console"};
less.rootpath = "https://www.github.com/cloudhead/less.js/";
less.relativeUrls = true;
@@ -0,0 +1,3 @@
describe("less.js browser test - rootpath and relative url's", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,3 @@
describe("less.js browser test - rootpath url's", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,5 @@
var less = {
logLevel: 4,
errorReporting: "console",
strictMath: true,
strictUnits: true };
@@ -0,0 +1,3 @@
describe("less.js strict units tests", function() {
testLessEqualsInDocument();
});
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner</title>
<!-- generate script tags for tests -->
<% var generateScriptTags = function(allScripts) { allScripts.forEach(function(script){ %>
<script src="<%= script %>"></script>
<% }); }; %>
<!-- generate script tags for tests -->
<% var toArray = function(scripts) {
%>[<%
scripts.forEach(function(scriptUrl, index){
%>"<%= scriptUrl %>"<%
if (index !== scripts.length -1) {
%>,<%
}
});
%>]<%
}; %>
<!-- for each test, generate CSS/LESS link tags -->
<% scripts.src.forEach(function(fullLessName) {
var pathParts = fullLessName.split('/');
var fullCssName = fullLessName.replace(/less/g, 'css');
var lessName = pathParts[pathParts.length - 1];
var name = lessName.split('.')[0]; %>
<!-- the tags to be generated -->
<link id="original-less:test-less-<%= name %>" title="test-less-<%= name %>" rel="stylesheet/less" type="text/css" href="<%= fullLessName %>">
<link id="expected-less:test-less-<%= name %>" rel="stylesheet" type="text/css" href="<%= fullCssName %>">
<% }); %>
<!-- generate grunt-contrib-jasmine link tags -->
<% css.forEach(function(style){ %>
<link rel="stylesheet" type="text/css" href="<%= style %>">
<% }) %>
<script>
function loadScript(url,callback){
var script = document.createElement('script');
if(document.documentMode === 8){
script.onreadystatechange = function(){
if (script.readyState === 'loaded'){
if (callback){callback()};
};
};
} else {
script.onload = function(){
if (callback){callback()};
};
};
script.src = url;
document.body.appendChild(script);
};
// allow sauce to query for the jasmine report
// because we have to load the page before starting the test, so the thing
// sauce queries for might not be setup yet
window.jasmine = { getJSReport: function() { } };
setTimeout(function() {
var jasmine = <% toArray([].concat(scripts.polyfills, scripts.jasmine, scripts.boot)) %>,
helpers = <% toArray(scripts.helpers) %>,
vendor = <% toArray(scripts.vendor) %>,
specs = <% toArray(scripts.specs) %>,
reporters = <% toArray([].concat(scripts.reporters)) %>,
allScripts = jasmine.concat(helpers).concat(vendor).concat(specs).concat(reporters);
function addNextScript() {
// for sauce, see above. Additional step needed between loading jasmine and loading
// the js reporter
if (!jasmine.getJSReport) {
jasmine.getJSReport = function() {};
}
if (allScripts.length) {
var scriptSrc = allScripts.shift();
loadScript(scriptSrc, addNextScript);
} else {
window.onload();
}
}
addNextScript();
},1000);
</script>
</head>
<body>
<!-- content -->
</body>
</html>
+72
View File
@@ -0,0 +1,72 @@
/*jshint latedef: nofunc */
// This is used to copy a folder (the test/less/* files & sub-folders), adding a BOM to the start of each LESS and CSS file.
// This is a based on the copySync method from fs-extra (https://github.com/jprichardson/node-fs-extra/).
module.exports = function() {
var path = require('path'),
fs = require('fs');
var BUF_LENGTH = 64 * 1024;
var _buff = new Buffer(BUF_LENGTH);
function copyFolderWithBom(src, dest) {
var stats = fs.lstatSync(src);
var destFolder = path.dirname(dest);
var destFolderExists = fs.existsSync(destFolder);
var performCopy = false;
if (stats.isFile()) {
if (!destFolderExists) {
fs.mkdirSync(destFolder);
}
if (src.match(/\.(css|less)$/)) {
copyFileAddingBomSync(src, dest);
} else {
copyFileSync(src, dest);
}
}
else if (stats.isDirectory()) {
if (!fs.existsSync(destFolder)) {
fs.mkdirSync(destFolder);
}
if (!fs.existsSync(dest)) {
fs.mkdirSync(dest);
}
fs.readdirSync(src).forEach(function(d) {
if (d !== 'bom') {
copyFolderWithBom(path.join(src, d), path.join(dest, d));
}
});
}
}
function copyFileAddingBomSync(srcFile, destFile) {
var contents = fs.readFileSync(srcFile, { encoding: 'utf8' });
if (!contents.length || contents.charCodeAt(0) !== 0xFEFF) {
contents = '\ufeff' + contents;
}
fs.writeFileSync(destFile, contents, { encoding: 'utf8' });
}
function copyFileSync(srcFile, destFile) {
var fdr = fs.openSync(srcFile, 'r');
var stat = fs.fstatSync(fdr);
var fdw = fs.openSync(destFile, 'w', stat.mode);
var bytesRead = 1;
var pos = 0;
while (bytesRead > 0) {
bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
fs.writeSync(fdw, _buff, 0, bytesRead);
pos += bytesRead;
}
fs.closeSync(fdr);
fs.closeSync(fdw);
}
return {
copyFolderWithBom: copyFolderWithBom
};
};
+1
View File
@@ -0,0 +1 @@
@charset "UTF-8";
+87
View File
@@ -0,0 +1,87 @@
#yelow #short {
color: #fea;
}
#yelow #long {
color: #ffeeaa;
}
#yelow #rgba {
color: rgba(255, 238, 170, 0.1);
}
#yelow #argb {
color: #1affeeaa;
}
#blue #short {
color: #00f;
}
#blue #long {
color: #0000ff;
}
#blue #rgba {
color: rgba(0, 0, 255, 0.1);
}
#blue #argb {
color: #1a0000ff;
}
#alpha #hsla {
color: rgba(61, 45, 41, 0.6);
}
#overflow .a {
color: #000000;
}
#overflow .b {
color: #ffffff;
}
#overflow .c {
color: #ffffff;
}
#overflow .d {
color: #00ff00;
}
#overflow .e {
color: rgba(0, 31, 255, 0.42);
}
#grey {
color: #c8c8c8;
}
#333333 {
color: #333333;
}
#808080 {
color: #808080;
}
#00ff00 {
color: #00ff00;
}
.lightenblue {
color: #3333ff;
}
.darkenblue {
color: #0000cc;
}
.unknowncolors {
color: blue2;
border: 2px solid superred;
}
.transparent {
color: transparent;
background-color: rgba(0, 0, 0, 0);
}
#alpha #fromvar {
opacity: 0.7;
}
#alpha #short {
opacity: 1;
}
#alpha #long {
opacity: 1;
}
#alpha #rgba {
opacity: 0.2;
}
#alpha #hsl {
opacity: 1;
}
#percentage {
color: 255;
border-color: rgba(255, 0, 0, 0.5);
}
+82
View File
@@ -0,0 +1,82 @@
/******************\
* *
* Comment Header *
* *
\******************/
/*
Comment
*/
/*
* Comment Test
*
* - cloudhead (http://cloudhead.net)
*
*/
/* Colors
* ------
* #EDF8FC (background blue)
* #166C89 (darkest blue)
*
* Text:
* #333 (standard text) // A comment within a comment!
* #1F9EC9 (standard link)
*
*/
/* @group Variables
------------------- */
#comments,
.comments {
/**/
color: red;
/* A C-style comment */
/* A C-style comment */
background-color: orange;
font-size: 12px;
/* lost comment */
content: "content";
border: 1px solid black;
padding: 0;
margin: 2em;
}
/* commented out
#more-comments {
color: grey;
}
*/
.selector,
.lots,
.comments {
color: #808080, /* blue */ #ffa500;
-webkit-border-radius: 2px /* webkit only */;
-moz-border-radius: 8px /* moz only with operation */;
}
.test {
color: 1px;
}
.sr-only-focusable {
clip: auto;
}
@-webkit-keyframes hover {
0% {
color: red;
}
}
#last {
color: #0000ff;
}
/* */
/* { */
/* */
/* */
/* */
#div {
color: #A33;
}
/* } */
/*by block */
#output-block {
comment: /* // Not commented out // */;
}
/*comment on last line*/
+18
View File
@@ -0,0 +1,18 @@
@-webkit-keyframes hover {
/* Safari and Chrome */
}
.bg {
background-image: linear-gradient(#333 /*{comment}*/, #111);
}
#planadvisor,
.first,
.planning {
margin: 10px;
total-width: (1 * 6em * 12) + (2em * 12);
}
.some-inline-comments {
a: yes /* comment */;
b: red /* comment */;
c: yes /* comment */;
d: red /* comment */;
}
@@ -0,0 +1,35 @@
#colours {
color1: #fea;
color2: #ffeeaa;
color3: rgba(255, 238, 170, 0.1);
string: "#ffeeaa";
/* comments are stripped */
/*! but not this type
Note preserved whitespace
*/
}
dimensions {
val: 0.1px;
val: 0em;
val: 4cm;
val: 0.2;
val: 5;
angles-must-have-unit: 0deg;
durations-must-have-unit: 0s;
length-doesnt-have-unit: 0px;
width: auto\9;
}
@page {
marks: none;
@top-left-corner {
vertical-align: top;
}
@top-left {
vertical-align: top;
}
}
.shadow ^ .dom,
body ^^ .shadow {
display: done;
}
+157
View File
@@ -0,0 +1,157 @@
.comma-delimited {
text-shadow: -1px -1px 1px red, 6px 5px 5px yellow;
-moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset, 0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
-webkit-transform: rotate(0deg);
}
@font-face {
font-family: Headline;
unicode-range: U+??????, U+0???, U+0-7F, U+A5;
}
.other {
-moz-transform: translate(0, 11em) rotate(-90deg);
transform: rotateX(45deg);
}
.item[data-cra_zy-attr1b-ut3=bold] {
font-weight: bold;
}
p:not([class*="lead"]) {
color: black;
}
input[type="text"].class#id[attr=32]:not(1) {
color: white;
}
div#id.class[a=1][b=2].class:not(1) {
color: white;
}
ul.comma > li:not(:only-child)::after {
color: white;
}
ol.comma > li:nth-last-child(2)::after {
color: white;
}
li:nth-child(4n+1),
li:nth-child(-5n),
li:nth-child(-n+2) {
color: white;
}
a[href^="http://"] {
color: black;
}
a[href$="http://"] {
color: black;
}
form[data-disabled] {
color: black;
}
p::before {
color: black;
}
#issue322 {
-webkit-animation: anim2 7s infinite ease-in-out;
}
@-webkit-keyframes frames {
0% {
border: 1px;
}
5.5% {
border: 2px;
}
100% {
border: 3px;
}
}
@keyframes fontbulger1 {
to {
font-size: 15px;
}
from,
to {
font-size: 12px;
}
0%,
100% {
font-size: 12px;
}
}
.units {
font: 1.2rem/2rem;
font: 8vw/9vw;
font: 10vh/12vh;
font: 12vm/15vm;
font: 12vmin/15vmin;
font: 1.2ch/1.5ch;
}
@supports ( box-shadow: 2px 2px 2px black ) or
( -moz-box-shadow: 2px 2px 2px black ) {
.outline {
box-shadow: 2px 2px 2px black;
-moz-box-shadow: 2px 2px 2px black;
}
}
@-x-document url-prefix(""github.com"") {
h1 {
color: red;
}
}
@viewport {
font-size: 10px;
}
@namespace foo url(http://www.example.com);
foo|h1 {
color: blue;
}
foo|* {
color: yellow;
}
|h1 {
color: red;
}
*|h1 {
color: green;
}
h1 {
color: green;
}
.upper-test {
UpperCaseProperties: allowed;
}
@host {
div {
display: block;
}
}
::distributed(input::placeholder) {
color: #b3b3b3;
}
.shadow ^ .dom,
body ^^ .shadow {
display: done;
}
:host(.sel .a),
:host-context(.sel .b),
.sel /deep/ .b,
::content .sel {
type: shadow-dom;
}
/deep/ b {
c: 'd';
}
/deep/ b[e] {
f: 'g';
}
#issue2066 {
background: url('/images/icon-team.svg') 0 0 / contain;
}
@counter-style triangle {
system: cyclic;
symbols: ;
suffix: " ";
}
@-ms-viewport {
}
@unknown foo 42 (bar) {
x {
y: z;
}
}
@unknown foo 43;
+24
View File
@@ -0,0 +1,24 @@
.escape\|random\|char {
color: red;
}
.mixin\!tUp {
font-weight: bold;
}
.\34 04 {
background: red;
}
.\34 04 strong {
color: #ff00ff;
font-weight: bold;
}
.trailingTest\+ {
color: red;
}
/* This hideous test of hideousness checks for the selector "blockquote" with various permutations of hex escapes */
\62\6c\6f \63 \6B \0071 \000075o\74 e {
color: silver;
}
[ng\:cloak],
ng\:form {
display: none;
}
+37
View File
@@ -0,0 +1,37 @@
.light {
color: green;
}
.see-the {
color: green;
}
.hide-the {
color: green;
}
.multiple-conditions-1 {
color: red;
}
.inheritance .test {
color: black;
}
.inheritance:hover {
color: pink;
}
.clsWithGuard {
dispaly: none;
}
.dont-split-me-up {
width: 1px;
color: red;
height: 1px;
}
+ .dont-split-me-up {
sibling: true;
}
.scope-check {
sub-prop: 2px;
prop: 1px;
}
.scope-check-2 {
sub-prop: 2px;
prop: 1px;
}
+95
View File
@@ -0,0 +1,95 @@
@charset "utf-8";
div {
color: black;
}
div {
width: 99%;
}
* {
min-width: 45em;
}
h1,
h2 > a > p,
h3 {
color: none;
}
div.class {
color: blue;
}
div#id {
color: green;
}
.class#id {
color: purple;
}
.one.two.three {
color: grey;
}
@media print {
* {
font-size: 3em;
}
}
@media screen {
* {
font-size: 10px;
}
}
@font-face {
font-family: 'Garamond Pro';
}
a:hover,
a:link {
color: #999;
}
p,
p:first-child {
text-transform: none;
}
q:lang(no) {
quotes: none;
}
p + h1 {
font-size: 2.2em;
}
#shorthands {
border: 1px solid #000;
font: 12px/16px Arial;
font: 100%/16px Arial;
margin: 1px 0;
padding: 0 auto;
}
#more-shorthands {
margin: 0;
padding: 1px 0 2px 0;
font: normal small / 20px 'Trebuchet MS', Verdana, sans-serif;
font: 0/0 a;
border-radius: 0.5px;
}
.misc {
-moz-border-radius: 2px;
display: -moz-inline-stack;
width: .1em;
background-color: #009998;
background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), to(#0000ff));
margin: ;
filter: alpha(opacity=100);
width: auto\9;
}
.misc .nested-multiple {
multiple-semi-colons: yes;
}
#important {
color: red !important;
width: 100%!important;
height: 20px ! important;
}
@font-face {
font-family: font-a;
}
@font-face {
font-family: font-b;
}
.æøå {
margin: 0;
}
+4
View File
@@ -0,0 +1,4 @@
@charset "ISO-8859-1";
.tst3 {
color: grey;
}
+50
View File
@@ -0,0 +1,50 @@
@charset "UTF-8";
/* line 1, {pathimport}test.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000031}}
/* @charset "ISO-8859-1"; */
/* line 23, {pathimport}test.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000323}}
.tst3 {
color: grey;
}
/* line 15, {path}linenumbers.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000315}}
.test1 {
color: black;
}
/* line 6, {path}linenumbers.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\000036}}
.test2 {
color: red;
}
@media all {
/* line 5, {pathimport}test.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000035}}
.tst {
color: black;
}
}
@media all and screen {
/* line 7, {pathimport}test.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000037}}
.tst {
color: red;
}
/* line 9, {pathimport}test.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000039}}
.tst .tst3 {
color: white;
}
}
/* line 18, {pathimport}test.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000318}}
.tst2 {
color: white;
}
/* line 27, {path}linenumbers.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000327}}
.test {
color: red;
width: 2;
}
@@ -0,0 +1,41 @@
@charset "UTF-8";
/* line 1, {pathimport}test.less */
/* @charset "ISO-8859-1"; */
/* line 23, {pathimport}test.less */
.tst3 {
color: grey;
}
/* line 15, {path}linenumbers.less */
.test1 {
color: black;
}
/* line 6, {path}linenumbers.less */
.test2 {
color: red;
}
@media all {
/* line 5, {pathimport}test.less */
.tst {
color: black;
}
}
@media all and screen {
/* line 7, {pathimport}test.less */
.tst {
color: red;
}
/* line 9, {pathimport}test.less */
.tst .tst3 {
color: white;
}
}
/* line 18, {pathimport}test.less */
.tst2 {
color: white;
}
/* line 27, {path}linenumbers.less */
.test {
color: red;
width: 2;
}
@@ -0,0 +1,41 @@
@charset "UTF-8";
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000031}}
/* @charset "ISO-8859-1"; */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000323}}
.tst3 {
color: grey;
}
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000315}}
.test1 {
color: black;
}
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\000036}}
.test2 {
color: red;
}
@media all {
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000035}}
.tst {
color: black;
}
}
@media all and screen {
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000037}}
.tst {
color: red;
}
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000039}}
.tst .tst3 {
color: white;
}
}
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000318}}
.tst2 {
color: white;
}
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000327}}
.test {
color: red;
width: 2;
}
+30
View File
@@ -0,0 +1,30 @@
@charset "UTF-8";
.tst3 {
color: grey;
}
.test1 {
color: black;
}
.test2 {
color: red;
}
@media all {
.tst {
color: black;
}
}
@media all and screen {
.tst {
color: red;
}
.tst .tst3 {
color: white;
}
}
.tst2 {
color: white;
}
.test {
color: red;
width: 2;
}
+76
View File
@@ -0,0 +1,76 @@
.wrap-selector {
color: black;
one: 1px;
four: magic-frame;
visible-one: visible;
visible-two: visible;
}
.wrap-selector {
color: red;
visible-one: visible;
visible-two: visible;
}
.wrap-selector {
color: black;
background: white;
visible-one: visible;
visible-two: visible;
}
header {
background: blue;
}
@media screen and (min-width: 1200) {
header {
background: red;
}
}
html.lt-ie9 header {
background: red;
}
.wrap-selector {
test: extra-wrap;
visible-one: visible;
visible-two: visible;
}
.wrap-selector .wrap-selector {
test: wrapped-twice;
visible-one: visible;
visible-two: visible;
}
.wrap-selector {
test-func: 90;
test-arithmetic: 18px;
visible-one: visible;
visible-two: visible;
}
.without-mixins {
b: 1;
}
@media (orientation: portrait) and tv {
.my-selector {
background-color: black;
}
}
@media (orientation: portrait) and widescreen and print and tv {
.triple-wrapped-mq {
triple: true;
}
}
@media (orientation: portrait) and widescreen and tv {
.triple-wrapped-mq {
triple: true;
}
}
@media (orientation: portrait) and tv {
.triple-wrapped-mq {
triple: true;
}
}
.a {
test: test;
}
.argument-default {
default: works;
direct: works;
named: works;
}
+107
View File
@@ -0,0 +1,107 @@
.parent {
color: green;
}
@document url-prefix() {
.child {
color: red;
}
}
@supports (sandwitch: butter) {
.inside {
property: value;
}
}
@supports (sandwitch: bread) {
.in1 .in2 {
property: value;
}
}
@supports (sandwitch: ham) {
property: value;
}
@supports (font-family: weirdFont) {
@font-face {
font-family: something;
src: made-up-url;
}
}
@font-face {
@supports not (-webkit-font-smoothing: subpixel-antialiased) {
font-family: something;
src: made-up-url;
}
}
@supports (property: value) {
@media (max-size: 2px) {
@supports (whatever: something) {
property: value;
}
}
}
@supports (property: value) {
@media (max-size: 2px) {
@supports (whatever: something) {
property: value;
}
}
}
@media print {
html {
in-html: visible;
}
@supports (upper: test) {
in-supports: first;
div {
in-div: visible;
}
@supports not (-webkit-font-smoothing: subpixel-antialiased) {
in-supports: second;
}
}
}
@media print and screen {
html div {
font-weight: 400;
}
html div nested {
property: value;
}
}
@media print and (max-size: 2px) {
.in1 {
stay: here;
}
@supports not (-webkit-font-smoothing: subpixel-antialiased) {
@supports (whatever: something) {
property: value;
}
}
}
html {
font-weight: 300;
-webkit-font-smoothing: subpixel-antialiased;
}
@supports not (-webkit-font-smoothing: subpixel-antialiased) {
font-weight: 400;
nested {
property: value;
}
}
.onTop {
animation: "textscale";
font-family: something;
}
@font-face {
font-family: something;
src: made-up-url;
}
@keyframes "textscale" {
0% {
font-size: 1em;
}
100% {
font-size: 2em;
}
}
View File
@@ -0,0 +1,3 @@
.a {
error: 4px;
}
@@ -0,0 +1,3 @@
.a {
error: 11px;
}
@@ -0,0 +1,3 @@
.a {
error: 0.33333333px;
}
@@ -0,0 +1,3 @@
.someclass {
font-weight: bold;
}
@@ -0,0 +1,4 @@
/* Test */
.a {
error: 1em;
}
@@ -0,0 +1,3 @@
div {
percentage: 94.11764706%;
}

Some files were not shown because too many files have changed in this diff Show More