derelicte 0.0.6-java → 0.0.7-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca2ba13cf6d6deb2f6eadbde3e261c8c6b3e6f59
4
- data.tar.gz: 812b37cb2f35bb8ea966bbb5fb5e5a33a4cd0315
3
+ metadata.gz: aa1dd5c05414ba885696563f358eb68842f2b4a5
4
+ data.tar.gz: 3be1c863f27285bd59bbf87a8f984d997821351f
5
5
  SHA512:
6
- metadata.gz: 04a6e42250b62d3e8128efc78be98ff6e0db1ee7ec8517ef48f75fcd408a703294e69c17e2284fa86255882430497e98310dcc2e80536fdc34797213587c764a
7
- data.tar.gz: 55afb7e6d439b2cff313e3a279c090b6d76c374336d00883f705663741accd3e8be5a219dfc941aedb709110d37337742f9e78bad9684c01cac4305dea0be7d5
6
+ metadata.gz: c254547a333140932fcf521a8ebc486b4ddd7cd0fb0821c00a2276de763503704b89284b74970ec9490ed8b03c5a41bd7c8009dbee23120b482514c4c30e3f63
7
+ data.tar.gz: fca6348e9a5b6e237770d279f0e6e43d44e4806e4463cf6556b4915b207991b847385bac545f8a5b09e0dfb26eba9f92d17bd7b98bc2a6eec113dca4f3dae792
@@ -19,10 +19,12 @@ module Derelicte
19
19
  rules = assignments.get(element)
20
20
  return nil if rules.nil? || rules.length == 0
21
21
  rule_str = unique_rules(rules).map(&:to_s).map(&:chomp).join
22
+ rule_str << element.get_attribute('style') if element.get_attribute('style')
22
23
  element.set_attribute('style', rule_str)
23
24
  end
24
25
 
25
26
  def assignments
27
+ # assing_declarations_to_dom is a method from the java library
26
28
  @assignments ||= analyzer.assing_declarations_to_dom(doc, "screen", false)
27
29
  end
28
30
 
@@ -1,3 +1,3 @@
1
1
  module Derelicte
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
5
+ <!-- tolerate meta tags without a shortcut close -->
6
+ <meta content="width=device-width" name="viewport" >
7
+ <title>My Stable CU</title>
8
+ </head>
9
+ <body>
10
+ <p>ohai</p>
11
+ <p style="font-size: 18pt;">ohai</p>
12
+ <!-- comments should be fine -->
13
+ <p>&bull; html chars should be okay</p>
14
+ </body>
15
+ </html>
@@ -26,4 +26,14 @@ describe Derelicte::Inliner do
26
26
  expect(inlined_html).to start_with("<!DOCTYPE html>")
27
27
  end
28
28
  end
29
+
30
+ context "existing inline styles" do
31
+ let(:html) { file_contents('inline_style_dom.html') }
32
+
33
+ it "should append to existing inline styles" do
34
+ inlined_html = subject.inline(html, css)
35
+ expect(inlined_html).to include('<p style="color: #ff0000;">ohai</p>')
36
+ expect(inlined_html).to include('<p style="color: #ff0000;font-size: 18pt;">ohai</p>')
37
+ end
38
+ end
29
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: derelicte
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: java
6
6
  authors:
7
7
  - Michael Ries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-10 00:00:00.000000000 Z
11
+ date: 2014-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -111,6 +111,7 @@ files:
111
111
  - spec/files/ink_boilerplate.html
112
112
  - spec/files/ink_hero.css
113
113
  - spec/files/ink_hero.html
114
+ - spec/files/inline_style_dom.html
114
115
  - spec/files/simple_dom.html
115
116
  - spec/files/xhtml_dom.html
116
117
  - spec/lib/derelicte/inliner_job_spec.rb
@@ -148,6 +149,7 @@ test_files:
148
149
  - spec/files/ink_boilerplate.html
149
150
  - spec/files/ink_hero.css
150
151
  - spec/files/ink_hero.html
152
+ - spec/files/inline_style_dom.html
151
153
  - spec/files/simple_dom.html
152
154
  - spec/files/xhtml_dom.html
153
155
  - spec/lib/derelicte/inliner_job_spec.rb