Skip to content

Commit

Permalink
1. by bumping version of dependend jsdom to 0.2.19 fixed problems wit…
Browse files Browse the repository at this point in the history
…h using juice with node 9.3 (used node-gyp instead node-waf)

2. fixed problems with inproper construction of test/cases - in .html/.out files was invalid html documents, jsdom automaticly fix them by wrapping using <html><body></body></html> tags, so all test/cases/* were wrong
3. added new test/cases/empty* test to ensure that juice is shy and tidy and conserve unstyled tags and empty documents.
  • Loading branch information
Paweł Marzec committed Nov 25, 2012
1 parent 91c2407 commit 0ccd3fc
Show file tree
Hide file tree
Showing 29 changed files with 59 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
node_modules
*~
2 changes: 1 addition & 1 deletion lib/juice.js
Expand Up @@ -121,7 +121,7 @@ function juice (html, css, options) {
});

var inner = document.innerHTML;

// free the associated memory
// with lazily created parentWindow
document.parentWindow.close();
Expand Down
5 changes: 3 additions & 2 deletions package.json
@@ -1,14 +1,15 @@
{
"name": "juice"
, "version": "0.0.6"
, "version": "0.0.7"
, "description": "Inlines css into html source"
, "contributors": [
{ "name": "Guillermo Rauch", "email": "guillermo@learnboost.com" }
, { "name": "Arian Stolwijk", "email": "arian@aryweb.nl" }
, { "name": "Paweł Marzec", "email": "rork@cojestgrane.pl" }
]
, "dependencies": {
"cssom": "0.2.3"
, "jsdom": "0.2.15"
, "jsdom": "0.2.19"
, "mootools-slick-parser": "1.3.2"
}
, "devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions test/cases/cascading.html
@@ -1,3 +1,4 @@
<html><body>
<ul>
<li>
<ul>
Expand All @@ -9,3 +10,4 @@
</ul>
</li>
</ul>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/cascading.out
@@ -1,3 +1,4 @@
<html><body>
<ul>
<li style="display: block; color: #f00;">
<ul>
Expand All @@ -9,3 +10,4 @@
</ul>
</li>
</ul>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/class+id.html
@@ -1 +1,3 @@
<html><body>
<p id="test" class="woot">Woot</p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/class+id.out
@@ -1 +1,3 @@
<html><body>
<p id="test" class="woot" style="border: 1px solid #f00; display: inline-block;">Woot</p>
</body></html>
3 changes: 3 additions & 0 deletions test/cases/class.html
@@ -1,2 +1,5 @@
<html><body>
<div class="woot">Test</div>
<div class="woot">Test</div>
</body></html>

2 changes: 2 additions & 0 deletions test/cases/class.out
@@ -1,2 +1,4 @@
<html><body>
<div class="woot" style="overflow: hidden;">Test</div>
<div class="woot" style="overflow: hidden;">Test</div>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/css-quotes.html
@@ -1 +1,3 @@
<html><body>
<p>woot</p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/css-quotes.out
@@ -1 +1,3 @@
<html><body>
<p style="background: url(/woot);">woot</p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/direct-descendents.html
@@ -1 +1,3 @@
<html><body>
<p><em><em>woot</em></em></p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/direct-descendents.out
@@ -1 +1,3 @@
<html><body>
<p><em style="background: blue; color: red;"><em style="background: blue;">woot</em></em></p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/id.html
@@ -1 +1,3 @@
<html><body>
<div id="test">woot</div>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/id.out
@@ -1 +1,3 @@
<html><body>
<div id="test" style="display: none;">woot</div>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/ignore-pseudos.html
@@ -1 +1,3 @@
<html><body>
<a href="#">Test</a>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/ignore-pseudos.out
@@ -1 +1,3 @@
<html><body>
<a href="#" style="text-decoration: underline;">Test</a>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/important.html
@@ -1 +1,3 @@
<html><body>
<a id="a" style="color: blue; background: green;">woot</a>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/important.out
@@ -1 +1,3 @@
<html><body>
<a id="a" style="color: red; background: blue; border-style: dashed;">woot</a>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/preserve-events.html
@@ -1,2 +1,4 @@
<html><body>
<a href="#" onclick="return false;">Google</a>
<p onclick="return false;">Google</p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/preserve-events.out
@@ -1,2 +1,4 @@
<html><body>
<a href="#" onclick="return false;">Google</a>
<p onclick="return false;" style="color: red;">Google</p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/regression-selector-newline.html
@@ -1,2 +1,4 @@
<html><body>
<a href="#">Test</a>
<p>Test</p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/regression-selector-newline.out
@@ -1,2 +1,4 @@
<html><body>
<a href="#" style="color: red;">Test</a>
<p style="color: red;">Test</p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/specificity.html
@@ -1,5 +1,7 @@
<html><body>
<div id="wrap" a="b">
<div class="wrap" id="wrap-2">
<div id="a"></div>
</div>
</div>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/specificity.out
@@ -1,5 +1,7 @@
<html><body>
<div id="wrap" a="b">
<div class="wrap" id="wrap-2" style="display: inline-block;">
<div id="a" style="color: red; display: block; background: green; border-color: green;"></div>
</div>
</div>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/style-preservation.html
@@ -1 +1,3 @@
<html><body>
<p style="color: red;">The color should stay intact</p>
</body></html>
3 changes: 3 additions & 0 deletions test/cases/style-preservation.out
@@ -1 +1,4 @@
<html><body>
<p style="color: red; background: blue;">The color should stay intact</p>
</body></html>

2 changes: 2 additions & 0 deletions test/cases/tag.html
@@ -1 +1,3 @@
<html><body>
<p>Test</p>
</body></html>
2 changes: 2 additions & 0 deletions test/cases/tag.out
@@ -1 +1,3 @@
<html><body>
<p style="border: 1px solid #f00; margin: 1px;">Test</p>
</body></html>

0 comments on commit 0ccd3fc

Please sign in to comment.