opal-browser 0.1.0.beta1 → 0.2.0.beta1

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.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +60 -0
  3. data/.yardopts +1 -1
  4. data/Gemfile +7 -2
  5. data/LICENSE +19 -0
  6. data/README.md +74 -10
  7. data/config.ru +2 -1
  8. data/index.html.erb +22 -0
  9. data/opal-browser.gemspec +9 -11
  10. data/opal/browser.rb +1 -1
  11. data/opal/browser/animation_frame.rb +66 -9
  12. data/opal/browser/canvas.rb +72 -18
  13. data/opal/browser/canvas/data.rb +1 -1
  14. data/opal/browser/console.rb +3 -37
  15. data/opal/browser/cookies.rb +80 -24
  16. data/opal/browser/css/declaration.rb +0 -5
  17. data/opal/browser/{timeout.rb → delay.rb} +13 -13
  18. data/opal/browser/dom.rb +0 -2
  19. data/opal/browser/dom/attribute.rb +6 -0
  20. data/opal/browser/dom/builder.rb +4 -8
  21. data/opal/browser/dom/character_data.rb +43 -7
  22. data/opal/browser/dom/document.rb +13 -11
  23. data/opal/browser/dom/element.rb +127 -29
  24. data/opal/browser/dom/element/image.rb +23 -0
  25. data/opal/browser/dom/element/offset.rb +27 -10
  26. data/opal/browser/dom/element/scroll.rb +32 -12
  27. data/opal/browser/dom/element/size.rb +29 -0
  28. data/opal/browser/dom/event.rb +88 -75
  29. data/opal/browser/dom/event/animation.rb +16 -4
  30. data/opal/browser/dom/event/audio_processing.rb +6 -4
  31. data/opal/browser/dom/event/base.rb +229 -64
  32. data/opal/browser/dom/event/before_unload.rb +6 -4
  33. data/opal/browser/dom/event/clipboard.rb +6 -4
  34. data/opal/browser/dom/event/close.rb +16 -4
  35. data/opal/browser/dom/event/composition.rb +16 -4
  36. data/opal/browser/dom/event/custom.rb +43 -8
  37. data/opal/browser/dom/event/device_light.rb +6 -4
  38. data/opal/browser/dom/event/device_motion.rb +17 -4
  39. data/opal/browser/dom/event/device_orientation.rb +16 -4
  40. data/opal/browser/dom/event/device_proximity.rb +6 -4
  41. data/opal/browser/dom/event/drag.rb +34 -28
  42. data/opal/browser/dom/event/focus.rb +21 -5
  43. data/opal/browser/dom/event/gamepad.rb +33 -20
  44. data/opal/browser/dom/event/hash_change.rb +6 -4
  45. data/opal/browser/dom/event/keyboard.rb +45 -23
  46. data/opal/browser/dom/event/message.rb +28 -8
  47. data/opal/browser/dom/event/mouse.rb +26 -25
  48. data/opal/browser/dom/event/page_transition.rb +6 -4
  49. data/opal/browser/dom/event/pop_state.rb +16 -4
  50. data/opal/browser/dom/event/progress.rb +16 -4
  51. data/opal/browser/dom/event/sensor.rb +6 -4
  52. data/opal/browser/dom/event/storage.rb +6 -4
  53. data/opal/browser/dom/event/touch.rb +10 -19
  54. data/opal/browser/dom/event/ui.rb +19 -3
  55. data/opal/browser/dom/event/wheel.rb +2 -2
  56. data/opal/browser/dom/mutation_observer.rb +65 -5
  57. data/opal/browser/dom/node.rb +164 -59
  58. data/opal/browser/dom/node_set.rb +4 -0
  59. data/opal/browser/dom/text.rb +16 -1
  60. data/opal/browser/event_source.rb +5 -2
  61. data/opal/browser/history.rb +51 -15
  62. data/opal/browser/http.rb +22 -7
  63. data/opal/browser/http/headers.rb +5 -0
  64. data/opal/browser/http/request.rb +40 -10
  65. data/opal/browser/immediate.rb +123 -9
  66. data/opal/browser/interval.rb +8 -13
  67. data/opal/browser/location.rb +13 -3
  68. data/opal/browser/navigator.rb +9 -6
  69. data/opal/browser/screen.rb +31 -5
  70. data/opal/browser/socket.rb +8 -4
  71. data/opal/browser/storage.rb +118 -33
  72. data/opal/browser/support.rb +232 -0
  73. data/opal/browser/utils.rb +24 -6
  74. data/opal/browser/version.rb +1 -1
  75. data/opal/browser/window.rb +1 -2
  76. data/opal/browser/window/scroll.rb +21 -11
  77. data/opal/browser/window/size.rb +16 -6
  78. data/opal/browser/window/view.rb +23 -5
  79. data/spec/dom/builder_spec.rb +19 -19
  80. data/spec/dom/document_spec.rb +6 -6
  81. data/spec/dom/element_spec.rb +5 -5
  82. data/spec/dom/event_spec.rb +20 -20
  83. data/spec/dom/mutation_observer_spec.rb +5 -5
  84. data/spec/dom/node_spec.rb +39 -27
  85. data/spec/dom_spec.rb +10 -8
  86. data/spec/event_source_spec.rb +12 -12
  87. data/spec/history_spec.rb +24 -15
  88. data/spec/http_spec.rb +18 -17
  89. data/spec/immediate_spec.rb +9 -7
  90. data/spec/runner.rb +114 -0
  91. data/spec/socket_spec.rb +8 -8
  92. data/spec/spec_helper.rb +1 -0
  93. data/spec/storage_spec.rb +6 -6
  94. data/spec/wgxpath.install.js +49 -0
  95. data/spec/window_spec.rb +2 -2
  96. metadata +21 -54
  97. data/opal/browser/compatibility.rb +0 -59
  98. data/opal/browser/compatibility/animation_frame.rb +0 -93
  99. data/opal/browser/compatibility/dom/document/window.rb +0 -15
  100. data/opal/browser/compatibility/dom/element/css.rb +0 -15
  101. data/opal/browser/compatibility/dom/element/matches.rb +0 -31
  102. data/opal/browser/compatibility/dom/element/offset.rb +0 -20
  103. data/opal/browser/compatibility/dom/element/scroll.rb +0 -25
  104. data/opal/browser/compatibility/dom/element/style.rb +0 -15
  105. data/opal/browser/compatibility/dom/mutation_observer.rb +0 -47
  106. data/opal/browser/compatibility/http/request.rb +0 -15
  107. data/opal/browser/compatibility/immediate.rb +0 -107
  108. data/opal/browser/compatibility/window/scroll.rb +0 -27
  109. data/opal/browser/compatibility/window/size.rb +0 -13
  110. data/opal/browser/compatibility/window/view.rb +0 -13
  111. data/opal/browser/dom/compatibility.rb +0 -8
  112. data/opal/browser/http/compatibility.rb +0 -1
  113. data/opal/browser/window/compatibility.rb +0 -3
@@ -4,32 +4,32 @@ require 'browser/history'
4
4
  describe Browser::History do
5
5
  describe '#current' do
6
6
  it 'should return the current location' do
7
- $window.history.current.should == '/'
7
+ expect($window.history.current).to eq('/')
8
8
  end
9
9
  end
10
10
 
11
11
  describe '#push' do
12
12
  it 'should change location' do
13
- $window.history.current.should == '/'
13
+ expect($window.history.current).to eq('/')
14
14
  $window.history.push('/lol')
15
- $window.history.current.should == '/lol'
15
+ expect($window.history.current).to eq('/lol')
16
16
  $window.history.push('/')
17
- $window.history.current.should == '/'
17
+ expect($window.history.current).to eq('/')
18
18
  end
19
19
  end
20
20
 
21
21
  describe '#back' do
22
22
  async 'should go back once' do
23
- $window.history.current.should == '/'
23
+ expect($window.history.current).to eq('/')
24
24
  $window.history.push('/wut')
25
- $window.history.current.should == '/wut'
25
+ expect($window.history.current).to eq('/wut')
26
26
 
27
27
  $window.on 'pop:state' do |e|
28
- run_async {
29
- $window.history.current.should == '/'
30
- }
31
-
32
28
  e.off
29
+
30
+ async {
31
+ expect($window.history.current).to eq('/')
32
+ }
33
33
  end
34
34
 
35
35
  $window.history.back
@@ -37,12 +37,21 @@ describe Browser::History do
37
37
  end
38
38
 
39
39
  describe '#state' do
40
- it 'gets the right state' do
40
+ async 'gets the right state' do
41
41
  $window.history.push('/wut', 42)
42
- $window.history.state.should == 42
42
+ $window.history.state.should eq(42)
43
43
  $window.history.push('/omg', 23)
44
- $window.history.state.should == 23
44
+ $window.history.state.should eq(23)
45
+
46
+ $window.on 'pop:state' do |e|
47
+ e.off
48
+
49
+ async {
50
+ expect(true).to eq(true)
51
+ }
52
+ end
53
+
45
54
  $window.history.back(2)
46
55
  end
47
- end
48
- end
56
+ end if Browser.supports? 'History.state'
57
+ end if Browser::History.supported?
@@ -1,3 +1,4 @@
1
+ require 'spec_helper'
1
2
  require 'browser/http'
2
3
 
3
4
  describe Browser::HTTP do
@@ -8,11 +9,11 @@ describe Browser::HTTP do
8
9
  describe '.get' do
9
10
  async 'fetches a path' do
10
11
  Browser::HTTP.get(path).then {|res|
11
- run_async {
12
- res.text.should == 'lol'
12
+ async {
13
+ expect(res.text).to eq('lol')
13
14
  }
14
15
  }.rescue {
15
- run_async {
16
+ async {
16
17
  fail
17
18
  }
18
19
  }
@@ -21,18 +22,18 @@ describe Browser::HTTP do
21
22
 
22
23
  describe '.get!' do
23
24
  it 'fetches a path' do
24
- Browser::HTTP.get!(path).text.should == 'lol'
25
+ expect(Browser::HTTP.get!(path).text).to eq('lol')
25
26
  end
26
27
  end
27
28
 
28
29
  describe '.post' do
29
30
  async 'sends parameters properly' do
30
31
  Browser::HTTP.post(path, lol: 'wut').then {|res|
31
- run_async {
32
- res.text.should == 'ok'
32
+ async {
33
+ expect(res.text).to eq('ok')
33
34
  }
34
35
  }.rescue {
35
- run_async {
36
+ async {
36
37
  fail
37
38
  }
38
39
  }
@@ -41,18 +42,18 @@ describe Browser::HTTP do
41
42
 
42
43
  describe '.post!' do
43
44
  it 'sends parameters properly' do
44
- Browser::HTTP.post!(path, lol: 'wut').text.should == 'ok'
45
+ expect(Browser::HTTP.post!(path, lol: 'wut').text).to eq('ok')
45
46
  end
46
47
  end
47
48
 
48
49
  describe '.put' do
49
50
  async 'sends parameters properly' do
50
51
  Browser::HTTP.put(path, lol: 'wut').then {|res|
51
- run_async {
52
- res.text.should == 'ok'
52
+ async {
53
+ expect(res.text).to eq('ok')
53
54
  }
54
55
  }.rescue {
55
- run_async {
56
+ async {
56
57
  fail
57
58
  }
58
59
  }
@@ -61,18 +62,18 @@ describe Browser::HTTP do
61
62
 
62
63
  describe '.put!' do
63
64
  it 'sends parameters properly' do
64
- Browser::HTTP.put!(path, lol: 'wut').text.should == 'ok'
65
+ expect(Browser::HTTP.put!(path, lol: 'wut').text).to eq('ok')
65
66
  end
66
67
  end
67
68
 
68
69
  describe '.delete' do
69
70
  async 'fetches a path' do
70
71
  Browser::HTTP.delete(path).then {|res|
71
- run_async {
72
- res.text.should == 'lol'
72
+ async {
73
+ expect(res.text).to eq('lol')
73
74
  }
74
75
  }.rescue {
75
- run_async {
76
+ async {
76
77
  fail
77
78
  }
78
79
  }
@@ -81,7 +82,7 @@ describe Browser::HTTP do
81
82
 
82
83
  describe '.delete!' do
83
84
  it 'fetches a path' do
84
- Browser::HTTP.delete!(path).text.should == 'lol'
85
+ expect(Browser::HTTP.delete!(path).text).to eq('lol')
85
86
  end
86
87
  end
87
- end
88
+ end if Browser::HTTP.supported?
@@ -1,12 +1,14 @@
1
1
  require 'spec_helper'
2
2
  require 'browser/immediate'
3
3
 
4
- describe Browser::Immediate do
5
- async 'defers a proc' do
6
- proc {|a|
7
- run_async {
8
- a.should == 42
9
- }
10
- }.defer(42)
4
+ describe Proc do
5
+ describe '#defer' do
6
+ async 'defers the parameters' do
7
+ proc {|a|
8
+ async {
9
+ expect(a).to eq(42)
10
+ }
11
+ }.defer(42)
12
+ end
11
13
  end
12
14
  end
@@ -0,0 +1,114 @@
1
+ #! /usr/bin/env ruby
2
+ require 'selenium/webdriver'
3
+ require 'rest_client'
4
+ require 'json'
5
+
6
+ # setup tunnel
7
+ begin
8
+ File.open('tunnel.jar', 'w') {|f|
9
+ f.write RestClient.get('http://www.browserstack.com/BrowserStackTunnel.jar').to_str
10
+ }
11
+
12
+ tunnel = IO.popen 'java -jar tunnel.jar $BS_AUTHKEY localhost,9292,0 -tunnelIdentifier $TRAVIS_JOB_ID'
13
+
14
+ loop do
15
+ break if tunnel.gets.start_with? 'You can now access'
16
+ end
17
+ end
18
+
19
+ # configure based on environment variables
20
+ hub = "http://#{ENV['BS_USERNAME']}:#{ENV['BS_AUTHKEY']}@hub.browserstack.com/wd/hub"
21
+ plan = "https://#{ENV['BS_USERNAME']}:#{ENV['BS_AUTHKEY']}@www.browserstack.com/automate/plan.json"
22
+ cap = Selenium::WebDriver::Remote::Capabilities.new
23
+
24
+ cap['platform'] = ENV['SELENIUM_PLATFORM'] || 'ANY'
25
+ cap['browser'] = ENV['SELENIUM_BROWSER'] || 'chrome'
26
+ cap['browser_version'] = ENV['SELENIUM_VERSION'] if ENV['SELENIUM_VERSION']
27
+
28
+ cap['browserstack.tunnelIdentifier'] = ENV['TRAVIS_JOB_ID']
29
+ cap['browserstack.tunnel'] = 'true'
30
+ cap['browserstack.debug'] = 'false'
31
+
32
+ print 'Loading...'
33
+
34
+ # wait until there's a spot in the parallel jobs
35
+ begin
36
+ loop do
37
+ state = JSON.parse(RestClient.get(plan).to_str)
38
+
39
+ if state["parallel_sessions_running"] < state["parallel_sessions_max_allowed"]
40
+ break
41
+ end
42
+
43
+ print '.'
44
+ sleep 30
45
+ end
46
+
47
+ browser = Selenium::WebDriver.for(:remote, url: hub, desired_capabilities: cap)
48
+ browser.navigate.to('http://localhost:9292')
49
+ rescue Selenium::WebDriver::Error::UnknownError
50
+ retry
51
+ end
52
+
53
+ # if we don't quit the browser it will stall
54
+ at_exit {
55
+ browser.quit
56
+ }
57
+
58
+ # the title is a good way to know if anything went wrong while fetching the
59
+ # page
60
+ Selenium::WebDriver::Wait.new(timeout: 30, interval: 5).until {
61
+ not browser.title.strip.empty?
62
+ }
63
+
64
+ unless browser.title =~ /Opal Browser/
65
+ puts "\rThe page failed loading."
66
+ exit 1
67
+ end
68
+
69
+ # wait until the specs are running or there has been an error in the loading of
70
+ # the specs
71
+ begin
72
+ Selenium::WebDriver::Wait.new(timeout: 30, interval: 5).until {
73
+ (browser['rspec-error'] rescue false) ||
74
+ (browser[class: 'rspec-report'] rescue false)
75
+ }
76
+
77
+ if element = browser['rspec-error'] rescue nil
78
+ puts "\r#{element.text}"
79
+ exit 1
80
+ end
81
+ rescue Selenium::WebDriver::Error::TimeOutError; end
82
+
83
+ print "\rRunning specs..."
84
+
85
+ # wait until the specs have finished, thus changing the content of #totals
86
+ Selenium::WebDriver::Wait.new(timeout: 1200, interval: 30).until {
87
+ print '.'
88
+
89
+ not browser['totals'].text.strip.empty?
90
+ }
91
+
92
+ totals = browser['totals'].text
93
+ duration = browser[css: '#duration strong'].text
94
+
95
+ print "\r#{totals} in #{duration}"
96
+
97
+ # take a screenshot and upload it to imgur
98
+ begin
99
+ browser.save_screenshot('screenshot.png')
100
+ response = RestClient.post('https://api.imgur.com/3/upload',
101
+ { image: File.open('screenshot.png') },
102
+ { 'Authorization' => 'Client-ID 1979876fe2a097e' })
103
+
104
+ print " ("
105
+ print JSON.parse(response.to_str)['data']['link']
106
+ puts ")"
107
+ rescue Exception
108
+ puts
109
+ end
110
+
111
+ # no failures, happy times
112
+ unless totals =~ / 0 failures/
113
+ exit 1
114
+ end
@@ -8,8 +8,8 @@ describe Browser::Socket do
8
8
  async 'creates a socket' do
9
9
  Browser::Socket.new ws do |s|
10
10
  s.on :open do |e|
11
- run_async {
12
- e.target.should be_kind_of Browser::Socket
11
+ async {
12
+ expect(e.target).to be_a(Browser::Socket)
13
13
  }
14
14
  end
15
15
  end
@@ -18,8 +18,8 @@ describe Browser::Socket do
18
18
  async 'receives messages' do
19
19
  Browser::Socket.new ws do |s|
20
20
  s.on :message do |e|
21
- run_async {
22
- e.data.should == 'lol'
21
+ async {
22
+ expect(e.data).to eq('lol')
23
23
  }
24
24
  end
25
25
  end
@@ -28,15 +28,15 @@ describe Browser::Socket do
28
28
  async 'sends messages' do
29
29
  Browser::Socket.new ws do |s|
30
30
  s.on :message do |e|
31
+ e.off
32
+
31
33
  s.print 'omg'
32
34
 
33
35
  s.on :message do |e|
34
- run_async {
35
- e.data.should == 'omg'
36
+ async {
37
+ expect(e.data).to eq('omg')
36
38
  }
37
39
  end
38
-
39
- e.off
40
40
  end
41
41
  end
42
42
  end
@@ -1,5 +1,6 @@
1
1
  require 'json2'
2
2
  require 'sizzle'
3
+ require 'wgxpath.install'
3
4
 
4
5
  require 'browser'
5
6
  require 'browser/console'
@@ -4,23 +4,23 @@ require 'browser/storage'
4
4
  describe Browser::Window do
5
5
  describe '#storage' do
6
6
  it 'creates a new storage' do
7
- $window.storage.should be_kind_of Browser::Storage
7
+ expect($window.storage).to be_a(Browser::Storage)
8
8
  end
9
9
 
10
10
  it 'creates a storage with the proper name' do
11
- $window.storage.name.should == :default
12
- $window.storage(:spec).name.should == :spec
11
+ expect($window.storage.name).to eq(:default)
12
+ expect($window.storage(:spec).name).to eq(:spec)
13
13
  end
14
14
  end
15
15
 
16
16
  describe '#session_storage' do
17
17
  it 'creates a new session storage' do
18
- $window.session_storage.should be_kind_of Browser::SessionStorage
18
+ expect($window.session_storage).to be_a(Browser::SessionStorage)
19
19
  end
20
20
 
21
21
  it 'creates a session storage with the proper name' do
22
- $window.session_storage.name.should == :default
23
- $window.session_storage(:spec).name.should == :spec
22
+ expect($window.session_storage.name).to eq(:default)
23
+ expect($window.session_storage(:spec).name).to eq(:spec)
24
24
  end
25
25
  end
26
26
  end
@@ -0,0 +1,49 @@
1
+ (function(){function h(a){return function(){return this[a]}}function k(a){return function(){return a}}var l=this;
2
+ function aa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
3
+ else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function m(a){return"string"==typeof a}function ba(a,b,c){return a.call.apply(a.bind,arguments)}function ca(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}
4
+ function n(a,b,c){n=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ba:ca;return n.apply(null,arguments)}function da(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}function r(a){var b=s;function c(){}c.prototype=b.prototype;a.t=b.prototype;a.prototype=new c}
5
+ Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return n.apply(null,c)}return n(this,a)};function t(a,b,c){this.a=a;this.b=b||1;this.d=c||1};var u,ea,fa,ga;function ha(){return l.navigator?l.navigator.userAgent:null}ga=fa=ea=u=!1;var w;if(w=ha()){var ia=l.navigator;u=0==w.lastIndexOf("Opera",0);ea=!u&&(-1!=w.indexOf("MSIE")||-1!=w.indexOf("Trident"));fa=!u&&-1!=w.indexOf("WebKit");ga=!u&&!fa&&!ea&&"Gecko"==ia.product}var y=ea,ja=ga,ka=fa;function la(){var a=l.document;return a?a.documentMode:void 0}var ma;
6
+ n:{var na="",oa;if(u&&l.opera)var pa=l.opera.version,na="function"==typeof pa?pa():pa;else if(ja?oa=/rv\:([^\);]+)(\)|;)/:y?oa=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:ka&&(oa=/WebKit\/(\S+)/),oa)var qa=oa.exec(ha()),na=qa?qa[1]:"";if(y){var ra=la();if(ra>parseFloat(na)){ma=String(ra);break n}}ma=na}var sa=ma,ta={};
7
+ function ua(a){if(!ta[a]){for(var b=0,c=String(sa).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),d=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",p=d[f]||"",q=RegExp("(\\d*)(\\D*)","g"),x=RegExp("(\\d*)(\\D*)","g");do{var v=q.exec(g)||["","",""],J=x.exec(p)||["","",""];if(0==v[0].length&&0==J[0].length)break;b=((0==v[1].length?0:parseInt(v[1],10))<(0==J[1].length?0:parseInt(J[1],10))?-1:(0==v[1].length?0:parseInt(v[1],10))>
8
+ (0==J[1].length?0:parseInt(J[1],10))?1:0)||((0==v[2].length)<(0==J[2].length)?-1:(0==v[2].length)>(0==J[2].length)?1:0)||(v[2]<J[2]?-1:v[2]>J[2]?1:0)}while(0==b)}ta[a]=0<=b}}var va=l.document,wa=va&&y?la()||("CSS1Compat"==va.compatMode?parseInt(sa,10):5):void 0;var z=y&&!(y&&9<=wa),xa=y&&!(y&&8<=wa);function A(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function ya(a,b){var c=xa&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new A(b,a,b.nodeName,c)};function za(a){this.b=a;this.a=0}function Aa(a){a=a.match(Ba);for(var b=0;b<a.length;b++)Ca.test(a[b])&&a.splice(b,1);return new za(a)}var Ba=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Ca=/^\s/;function B(a,b){return a.b[a.a+(b||0)]}function C(a){return a.b[a.a++]};var D=Array.prototype,Da=D.indexOf?function(a,b,c){return D.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(m(a))return m(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},E=D.forEach?function(a,b,c){D.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=m(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},Ea=D.filter?function(a,b,c){return D.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=m(a)?
9
+ a.split(""):a,p=0;p<d;p++)if(p in g){var q=g[p];b.call(c,q,p,a)&&(e[f++]=q)}return e},F=D.reduce?function(a,b,c,d){d&&(b=n(b,d));return D.reduce.call(a,b,c)}:function(a,b,c,d){var e=c;E(a,function(c,g){e=b.call(d,e,c,g,a)});return e},Fa=D.some?function(a,b,c){return D.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=m(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1};
10
+ function Ga(a,b){var c;n:{c=a.length;for(var d=m(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break n}c=-1}return 0>c?null:m(a)?a.charAt(c):a[c]}function Ha(a){return D.concat.apply(D,arguments)}function Ia(a,b,c){return 2>=arguments.length?D.slice.call(a,b):D.slice.call(a,b,c)};!ja&&!y||y&&y&&9<=wa||ja&&ua("1.9.1");y&&ua("9");function Ja(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
11
+ function Ka(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(y&&!(y&&9<=wa)){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?La(a,b):!c&&Ja(e,b)?-1*Ma(a,b):!d&&Ja(f,a)?Ma(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType?a:
12
+ a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(l.Range.START_TO_END,d)}function Ma(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return La(d,a)}function La(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};function G(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(z&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),z&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b}
13
+ function H(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}xa&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function Na(a,b,c,d,e){return(z?Oa:Pa).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new I)}
14
+ function Oa(a,b,c,d,e){if(a instanceof K||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Qa(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],p=0;b=f[p++];)H(b,c,d)&&g.push(b);f=g}for(p=0;b=f[p++];)"*"==a&&"!"==b.tagName||L(e,b);return e}Ra(a,b,c,d,e);return e}
15
+ function Pa(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!y?(b=b.getElementsByName(d),E(b,function(b){a.a(b)&&L(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),E(b,function(b){b.className==d&&a.a(b)&&L(e,b)})):a instanceof M?Ra(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.d()),E(b,function(a){H(a,c,d)&&L(e,a)}));return e}
16
+ function Sa(a,b,c,d,e){var f;if((a instanceof K||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Qa(a);if("*"!=g&&(f=Ea(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=Ea(f,function(a){return H(a,c,d)}));E(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||L(e,a)});return e}return Ta(a,b,c,d,e)}function Ta(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)H(b,c,d)&&a.a(b)&&L(e,b);return e}
17
+ function Ra(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)H(b,c,d)&&a.a(b)&&L(e,b),Ra(a,b,c,d,e)}function Qa(a){if(a instanceof M){if(8==a.b)return"!";if(null===a.b)return"*"}return a.d()};function I(){this.b=this.a=null;this.i=0}function Ua(a){this.b=a;this.a=this.d=null}function Va(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;)c.b==d.b||c.b instanceof A&&d.b instanceof A&&c.b.a==d.b.a?(f=c,c=c.a,d=d.a):0<Ka(c.b,d.b)?(f=d,d=d.a):(f=c,c=c.a),(f.d=e)?e.a=f:a.a=f,e=f,g++;for(f=c||d;f;)f.d=e,e=e.a=f,g++,f=f.a;a.b=e;a.i=g;return a}function Wa(a,b){var c=new Ua(b);c.a=a.a;a.b?a.a.d=c:a.a=a.b=c;a.a=c;a.i++}
18
+ function L(a,b){var c=new Ua(b);c.d=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.i++}function Xa(a){return(a=a.a)?a.b:null}function Ya(a){return(a=Xa(a))?G(a):""}function N(a,b){return new Za(a,!!b)}function Za(a,b){this.d=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function O(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.d:b.a;return c.b};function $a(a){switch(a.nodeType){case 1:return da(ab,a);case 9:return $a(a.documentElement);case 2:return a.ownerElement?$a(a.ownerElement):bb;case 11:case 10:case 6:case 12:return bb;default:return a.parentNode?$a(a.parentNode):bb}}function bb(){return null}function ab(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?ab(a.parentNode,b):null};function s(a){this.g=a;this.b=this.f=!1;this.d=null}function P(a){return"\n "+a.toString().split("\n").join("\n ")}function cb(a,b){a.f=b}function db(a,b){a.b=b}function Q(a,b){var c=a.a(b);return c instanceof I?+Ya(c):+c}function R(a,b){var c=a.a(b);return c instanceof I?Ya(c):""+c}function S(a,b){var c=a.a(b);return c instanceof I?!!c.i:!!c};function eb(a,b,c){s.call(this,a.g);this.c=a;this.e=b;this.j=c;this.f=b.f||c.f;this.b=b.b||c.b;this.c==fb&&(c.b||c.f||4==c.g||0==c.g||!b.d?b.b||b.f||4==b.g||0==b.g||!c.d||(this.d={name:c.d.name,l:b}):this.d={name:b.d.name,l:c})}r(eb);
19
+ function T(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof I&&c instanceof I){e=N(b);for(d=O(e);d;d=O(e))for(b=N(c),f=O(b);f;f=O(b))if(a(G(d),G(f)))return!0;return!1}if(b instanceof I||c instanceof I){b instanceof I?e=b:(e=c,c=b);e=N(e);b=typeof c;for(d=O(e);d;d=O(e)){switch(b){case "number":d=+G(d);break;case "boolean":d=!!G(d);break;case "string":d=G(d);break;default:throw Error("Illegal primitive type for comparison.");}if(a(d,c))return!0}return!1}return e?"boolean"==typeof b||"boolean"==typeof c?
20
+ a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}eb.prototype.a=function(a){return this.c.k(this.e,this.j,a)};eb.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+P(this.e);return a+=P(this.j)};function gb(a,b,c,d){this.a=a;this.p=b;this.g=c;this.k=d}gb.prototype.toString=h("a");var hb={};function U(a,b,c,d){if(hb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new gb(a,b,c,d);return hb[a.toString()]=a}
21
+ U("div",6,1,function(a,b,c){return Q(a,c)/Q(b,c)});U("mod",6,1,function(a,b,c){return Q(a,c)%Q(b,c)});U("*",6,1,function(a,b,c){return Q(a,c)*Q(b,c)});U("+",5,1,function(a,b,c){return Q(a,c)+Q(b,c)});U("-",5,1,function(a,b,c){return Q(a,c)-Q(b,c)});U("<",4,2,function(a,b,c){return T(function(a,b){return a<b},a,b,c)});U(">",4,2,function(a,b,c){return T(function(a,b){return a>b},a,b,c)});U("<=",4,2,function(a,b,c){return T(function(a,b){return a<=b},a,b,c)});
22
+ U(">=",4,2,function(a,b,c){return T(function(a,b){return a>=b},a,b,c)});var fb=U("=",3,2,function(a,b,c){return T(function(a,b){return a==b},a,b,c,!0)});U("!=",3,2,function(a,b,c){return T(function(a,b){return a!=b},a,b,c,!0)});U("and",2,2,function(a,b,c){return S(a,c)&&S(b,c)});U("or",1,2,function(a,b,c){return S(a,c)||S(b,c)});function ib(a,b){if(b.a.length&&4!=a.g)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");s.call(this,a.g);this.c=a;this.e=b;this.f=a.f;this.b=a.b}r(ib);ib.prototype.a=function(a){a=this.c.a(a);return jb(this.e,a)};ib.prototype.toString=function(){var a;a="Filter:"+P(this.c);return a+=P(this.e)};function kb(a,b){if(b.length<a.o)throw Error("Function "+a.h+" expects at least"+a.o+" arguments, "+b.length+" given");if(null!==a.n&&b.length>a.n)throw Error("Function "+a.h+" expects at most "+a.n+" arguments, "+b.length+" given");a.s&&E(b,function(b,d){if(4!=b.g)throw Error("Argument "+d+" to function "+a.h+" is not of type Nodeset: "+b);});s.call(this,a.g);this.e=a;this.c=b;cb(this,a.f||Fa(b,function(a){return a.f}));db(this,a.r&&!b.length||a.q&&!!b.length||Fa(b,function(a){return a.b}))}r(kb);
23
+ kb.prototype.a=function(a){return this.e.k.apply(null,Ha(a,this.c))};kb.prototype.toString=function(){var a="Function: "+this.e;if(this.c.length)var b=F(this.c,function(a,b){return a+P(b)},"Arguments:"),a=a+P(b);return a};function lb(a,b,c,d,e,f,g,p,q){this.h=a;this.g=b;this.f=c;this.r=d;this.q=e;this.k=f;this.o=g;this.n=void 0!==p?p:g;this.s=!!q}lb.prototype.toString=h("h");var mb={};
24
+ function V(a,b,c,d,e,f,g,p){if(mb.hasOwnProperty(a))throw Error("Function already created: "+a+".");mb[a]=new lb(a,b,c,d,!1,e,f,g,p)}V("boolean",2,!1,!1,function(a,b){return S(b,a)},1);V("ceiling",1,!1,!1,function(a,b){return Math.ceil(Q(b,a))},1);V("concat",3,!1,!1,function(a,b){var c=Ia(arguments,1);return F(c,function(b,c){return b+R(c,a)},"")},2,null);V("contains",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return-1!=b.indexOf(a)},2);V("count",1,!1,!1,function(a,b){return b.a(a).i},1,1,!0);
25
+ V("false",2,!1,!1,k(!1),0);V("floor",1,!1,!1,function(a,b){return Math.floor(Q(b,a))},1);V("id",4,!1,!1,function(a,b){function c(a){if(z){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return Ga(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=R(b,a).split(/\s+/),f=[];E(d,function(a){a=c(a);!a||0<=Da(f,a)||f.push(a)});f.sort(Ka);var g=new I;E(f,function(a){L(g,a)});return g},1);V("lang",2,!1,!1,k(!1),1);
26
+ V("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.d},0);V("local-name",3,!1,!0,function(a,b){var c=b?Xa(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);V("name",3,!1,!0,function(a,b){var c=b?Xa(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);V("namespace-uri",3,!0,!1,k(""),0,1,!0);V("normalize-space",3,!1,!0,function(a,b){return(b?R(b,a):G(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);
27
+ V("not",2,!1,!1,function(a,b){return!S(b,a)},1);V("number",1,!1,!0,function(a,b){return b?Q(b,a):+G(a.a)},0,1);V("position",1,!0,!1,function(a){return a.b},0);V("round",1,!1,!1,function(a,b){return Math.round(Q(b,a))},1);V("starts-with",2,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);return 0==b.lastIndexOf(a,0)},2);V("string",3,!1,!0,function(a,b){return b?R(b,a):G(a.a)},0,1);V("string-length",1,!1,!0,function(a,b){return(b?R(b,a):G(a.a)).length},0,1);
28
+ V("substring",3,!1,!1,function(a,b,c,d){c=Q(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?Q(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=R(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);V("substring-after",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
29
+ V("substring-before",3,!1,!1,function(a,b,c){b=R(b,a);a=R(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);V("sum",1,!1,!1,function(a,b){for(var c=N(b.a(a)),d=0,e=O(c);e;e=O(c))d+=+G(e);return d},1,1,!0);V("translate",3,!1,!1,function(a,b,c,d){b=R(b,a);c=R(c,a);var e=R(d,a);a=[];for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);V("true",2,!1,!1,k(!0),0);function M(a,b){this.e=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function nb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}M.prototype.a=function(a){return null===this.b||this.b==a.nodeType};M.prototype.d=h("e");M.prototype.toString=function(){var a="Kind Test: "+this.e;null===this.c||(a+=P(this.c));return a};function ob(a){s.call(this,3);this.c=a.substring(1,a.length-1)}r(ob);ob.prototype.a=h("c");ob.prototype.toString=function(){return"Literal: "+this.c};function K(a,b){this.h=a.toLowerCase();this.c=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}K.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.h&&this.h!=a.nodeName.toLowerCase()?!1:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};K.prototype.d=h("h");K.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.h};function pb(a){s.call(this,1);this.c=a}r(pb);pb.prototype.a=h("c");pb.prototype.toString=function(){return"Number: "+this.c};function qb(a,b){s.call(this,a.g);this.e=a;this.c=b;this.f=a.f;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.m||c.c!=rb||(c=c.j,"*"!=c.d()&&(this.d={name:c.d(),l:null}))}}r(qb);function sb(){s.call(this,4)}r(sb);sb.prototype.a=function(a){var b=new I;a=a.a;9==a.nodeType?L(b,a):L(b,a.ownerDocument);return b};sb.prototype.toString=k("Root Helper Expression");function tb(){s.call(this,4)}r(tb);tb.prototype.a=function(a){var b=new I;L(b,a.a);return b};tb.prototype.toString=k("Context Helper Expression");
30
+ qb.prototype.a=function(a){var b=this.e.a(a);if(!(b instanceof I))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.i;c++){var e=a[c],f=N(b,e.c.a),g;if(e.f||e.c!=ub)if(e.f||e.c!=vb)for(g=O(f),b=e.a(new t(g));null!=(g=O(f));)g=e.a(new t(g)),b=Va(b,g);else g=O(f),b=e.a(new t(g));else{for(g=O(f);(b=O(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new t(g))}}return b};
31
+ qb.prototype.toString=function(){var a;a="Path Expression:"+P(this.e);if(this.c.length){var b=F(this.c,function(a,b){return a+P(b)},"Steps:");a+=P(b)}return a};function wb(a,b){this.a=a;this.b=!!b}
32
+ function jb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=N(b),f=b.i,g,p=0;g=O(e);p++){var q=a.b?f-p:p+1;g=d.a(new t(g,q,f));if("number"==typeof g)q=q==g;else if("string"==typeof g||"boolean"==typeof g)q=!!g;else if(g instanceof I)q=0<g.i;else throw Error("Predicate.evaluate returned an unexpected type.");if(!q){q=e;g=q.d;var x=q.a;if(!x)throw Error("Next must be called at least once before remove.");var v=x.d,x=x.a;v?v.a=x:g.a=x;x?x.d=v:g.b=v;g.i--;q.a=null}}return b}
33
+ wb.prototype.toString=function(){return F(this.a,function(a,b){return a+P(b)},"Predicates:")};function W(a,b,c,d){s.call(this,4);this.c=a;this.j=b;this.e=c||new wb([]);this.m=!!d;b=0<this.e.a.length?this.e.a[0].d:null;a.b&&b&&(a=b.name,a=z?a.toLowerCase():a,this.d={name:a,l:b.l});n:{a=this.e;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.f||1==c.g||0==c.g){a=!0;break n}a=!1}this.f=a}r(W);
34
+ W.prototype.a=function(a){var b=a.a,c=null,c=this.d,d=null,e=null,f=0;c&&(d=c.name,e=c.l?R(c.l,a):null,f=1);if(this.m)if(this.f||this.c!=xb)if(a=N((new W(yb,new M("node"))).a(a)),b=O(a))for(c=this.k(b,d,e,f);null!=(b=O(a));)c=Va(c,this.k(b,d,e,f));else c=new I;else c=Na(this.j,b,d,e),c=jb(this.e,c,f);else c=this.k(a.a,d,e,f);return c};W.prototype.k=function(a,b,c,d){a=this.c.d(this.j,a,b,c);return a=jb(this.e,a,d)};
35
+ W.prototype.toString=function(){var a;a="Step:"+P("Operator: "+(this.m?"//":"/"));this.c.h&&(a+=P("Axis: "+this.c));a+=P(this.j);if(this.e.a.length){var b=F(this.e.a,function(a,b){return a+P(b)},"Predicates:");a+=P(b)}return a};function zb(a,b,c,d){this.h=a;this.d=b;this.a=c;this.b=d}zb.prototype.toString=h("h");var Ab={};function X(a,b,c,d){if(Ab.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new zb(a,b,c,!!d);return Ab[a]=b}
36
+ X("ancestor",function(a,b){for(var c=new I,d=b;d=d.parentNode;)a.a(d)&&Wa(c,d);return c},!0);X("ancestor-or-self",function(a,b){var c=new I,d=b;do a.a(d)&&Wa(c,d);while(d=d.parentNode);return c},!0);
37
+ var rb=X("attribute",function(a,b){var c=new I,d=a.d();if("style"==d&&b.style&&z)return L(c,new A(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof M&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)z?f.nodeValue&&L(c,ya(b,f)):L(c,f);else(f=e.getNamedItem(d))&&(z?f.nodeValue&&L(c,ya(b,f)):L(c,f));return c},!1),xb=X("child",function(a,b,c,d,e){return(z?Sa:Ta).call(null,a,b,m(c)?c:null,m(d)?d:null,e||new I)},!1,!0);X("descendant",Na,!1,!0);
38
+ var yb=X("descendant-or-self",function(a,b,c,d){var e=new I;H(b,c,d)&&a.a(b)&&L(e,b);return Na(a,b,c,d,e)},!1,!0),ub=X("following",function(a,b,c,d){var e=new I;do for(var f=b;f=f.nextSibling;)H(f,c,d)&&a.a(f)&&L(e,f),e=Na(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);X("following-sibling",function(a,b){for(var c=new I,d=b;d=d.nextSibling;)a.a(d)&&L(c,d);return c},!1);X("namespace",function(){return new I},!1);
39
+ var Bb=X("parent",function(a,b){var c=new I;if(9==b.nodeType)return c;if(2==b.nodeType)return L(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&L(c,d);return c},!1),vb=X("preceding",function(a,b,c,d){var e=new I,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,p=f.length;g<p;g++){var q=[];for(b=f[g];b=b.previousSibling;)q.unshift(b);for(var x=0,v=q.length;x<v;x++)b=q[x],H(b,c,d)&&a.a(b)&&L(e,b),e=Na(a,b,c,d,e)}return e},!0,!0);
40
+ X("preceding-sibling",function(a,b){for(var c=new I,d=b;d=d.previousSibling;)a.a(d)&&Wa(c,d);return c},!0);var Cb=X("self",function(a,b){var c=new I;a.a(b)&&L(c,b);return c},!1);function Db(a){s.call(this,1);this.c=a;this.f=a.f;this.b=a.b}r(Db);Db.prototype.a=function(a){return-Q(this.c,a)};Db.prototype.toString=function(){return"Unary Expression: -"+P(this.c)};function Eb(a){s.call(this,4);this.c=a;cb(this,Fa(this.c,function(a){return a.f}));db(this,Fa(this.c,function(a){return a.b}))}r(Eb);Eb.prototype.a=function(a){var b=new I;E(this.c,function(c){c=c.a(a);if(!(c instanceof I))throw Error("Path expression must evaluate to NodeSet.");b=Va(b,c)});return b};Eb.prototype.toString=function(){return F(this.c,function(a,b){return a+P(b)},"Union Expression:")};function Fb(a,b){this.a=a;this.b=b}function Gb(a){for(var b,c=[];;){Y(a,"Missing right hand side of binary expression.");b=Hb(a);var d=C(a.a);if(!d)break;var e=(d=hb[d]||null)&&d.p;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].p;)b=new eb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new eb(c.pop(),c.pop(),b);return b}function Y(a,b){if(a.a.b.length<=a.a.a)throw Error(b);}function Ib(a,b){var c=C(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);}
41
+ function Jb(a){a=C(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Kb(a){a=C(a.a);if(2>a.length)throw Error("Unclosed literal string");return new ob(a)}function Lb(a){var b=C(a.a),c=b.indexOf(":");if(-1==c)return new K(b);var d=b.substring(0,c);a=a.b(d);if(!a)throw Error("Namespace prefix not declared: "+d);b=b.substr(c+1);return new K(b,a)}
42
+ function Mb(a){var b,c=[],d;if("/"==B(a.a)||"//"==B(a.a)){b=C(a.a);d=B(a.a);if("/"==b&&(a.a.b.length<=a.a.a||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new sb;d=new sb;Y(a,"Missing next location step.");b=Nb(a,b);c.push(b)}else{n:{b=B(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":C(a.a);b=Gb(a);Y(a,'unclosed "("');Ib(a,")");break;case '"':case "'":b=Kb(a);break;default:if(isNaN(+b))if(!nb(b)&&/(?![0-9])[\w]/.test(d)&&
43
+ "("==B(a.a,1)){b=C(a.a);b=mb[b]||null;C(a.a);for(d=[];")"!=B(a.a);){Y(a,"Missing function argument list.");d.push(Gb(a));if(","!=B(a.a))break;C(a.a)}Y(a,"Unclosed function argument list.");Jb(a);b=new kb(b,d)}else{b=null;break n}else b=new pb(+C(a.a))}"["==B(a.a)&&(d=new wb(Ob(a)),b=new ib(b,d))}if(b)if("/"==B(a.a)||"//"==B(a.a))d=b;else return b;else b=Nb(a,"/"),d=new tb,c.push(b)}for(;"/"==B(a.a)||"//"==B(a.a);)b=C(a.a),Y(a,"Missing next location step."),b=Nb(a,b),c.push(b);return new qb(d,c)}
44
+ function Nb(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==B(a.a))return d=new W(Cb,new M("node")),C(a.a),d;if(".."==B(a.a))return d=new W(Bb,new M("node")),C(a.a),d;var f;if("@"==B(a.a))f=rb,C(a.a),Y(a,"Missing attribute name");else if("::"==B(a.a,1)){if(!/(?![0-9])[\w]/.test(B(a.a).charAt(0)))throw Error("Bad token: "+C(a.a));c=C(a.a);f=Ab[c]||null;if(!f)throw Error("No axis with name: "+c);C(a.a);Y(a,"Missing node name")}else f=xb;c=B(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("==
45
+ B(a.a,1)){if(!nb(c))throw Error("Invalid node type: "+c);c=C(a.a);if(!nb(c))throw Error("Invalid type name: "+c);Ib(a,"(");Y(a,"Bad nodetype");e=B(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Kb(a);Y(a,"Bad nodetype");Jb(a);c=new M(c,g)}else c=Lb(a);else if("*"==c)c=Lb(a);else throw Error("Bad token: "+C(a.a));e=new wb(Ob(a),f.a);return d||new W(f,c,e,"//"==b)}
46
+ function Ob(a){for(var b=[];"["==B(a.a);){C(a.a);Y(a,"Missing predicate expression.");var c=Gb(a);b.push(c);Y(a,"Unclosed predicate expression.");Ib(a,"]")}return b}function Hb(a){if("-"==B(a.a))return C(a.a),new Db(Hb(a));var b=Mb(a);if("|"!=B(a.a))a=b;else{for(b=[b];"|"==C(a.a);)Y(a,"Missing next union location path."),b.push(Mb(a));a.a.a--;a=new Eb(b)}return a};function Pb(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Aa(a);if(c.b.length<=c.a)throw Error("Invalid XPath expression.");b?"function"==aa(b)||(b=n(b.lookupNamespaceURI,b)):b=k(null);var d=Gb(new Fb(c,b));if(!(c.b.length<=c.a))throw Error("Bad token: "+C(c));this.evaluate=function(a,b){var c=d.a(new t(a));return new Z(c,b)}}
47
+ function Z(a,b){if(0==b)if(a instanceof I)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof I))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof I?Ya(a):""+a;break;case 1:this.numberValue=a instanceof I?+Ya(a):+a;break;case 3:this.booleanValue=a instanceof I?0<a.i:!!a;break;case 4:case 5:case 6:case 7:var d=
48
+ N(a);c=[];for(var e=O(d);e;e=O(d))c.push(e instanceof A?e.a:e);this.snapshotLength=a.i;this.invalidIteratorState=!1;break;case 8:case 9:d=Xa(a);this.singleNodeValue=d instanceof A?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length||
49
+ 0>a?null:c[a]}}Z.ANY_TYPE=0;Z.NUMBER_TYPE=1;Z.STRING_TYPE=2;Z.BOOLEAN_TYPE=3;Z.UNORDERED_NODE_ITERATOR_TYPE=4;Z.ORDERED_NODE_ITERATOR_TYPE=5;Z.UNORDERED_NODE_SNAPSHOT_TYPE=6;Z.ORDERED_NODE_SNAPSHOT_TYPE=7;Z.ANY_UNORDERED_NODE_TYPE=8;Z.FIRST_ORDERED_NODE_TYPE=9;function Qb(a){this.lookupNamespaceURI=$a(a)};function Rb(a){a=a||l;var b=a.document;b.evaluate||(a.XPathResult=Z,b.evaluate=function(a,b,e,f){return(new Pb(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new Pb(a,b)},b.createNSResolver=function(a){return new Qb(a)})}var Sb=["wgxpath","install"],$=l;Sb[0]in $||!$.execScript||$.execScript("var "+Sb[0]);for(var Tb;Sb.length&&(Tb=Sb.shift());)Sb.length||void 0===Rb?$=$[Tb]?$[Tb]:$[Tb]={}:$[Tb]=Rb;})()
@@ -3,8 +3,8 @@ require 'spec_helper'
3
3
  describe Browser::Window do
4
4
  describe '#document' do
5
5
  it 'should return `document`' do
6
- $window.document.should == `document`
7
- $window.document.class.should == Browser::DOM::Document
6
+ expect($window.document).to eq(`document`)
7
+ expect($window.document.class).to eq(Browser::DOM::Document)
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta1
4
+ version: 0.2.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - meh.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-27 00:00:00.000000000 Z
11
+ date: 2014-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.5
19
+ version: 0.6.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.5.5
26
+ version: 0.6.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: paggio
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,34 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: opal-rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
41
  description:
70
42
  email: meh@schizofreni.co
71
43
  executables: []
@@ -73,11 +45,14 @@ extensions: []
73
45
  extra_rdoc_files: []
74
46
  files:
75
47
  - ".gitignore"
48
+ - ".travis.yml"
76
49
  - ".yardopts"
77
50
  - Gemfile
51
+ - LICENSE
78
52
  - README.md
79
53
  - Rakefile
80
54
  - config.ru
55
+ - index.html.erb
81
56
  - lib/opal/browser.rb
82
57
  - opal-browser.gemspec
83
58
  - opal/browser.rb
@@ -87,20 +62,6 @@ files:
87
62
  - opal/browser/canvas/gradient.rb
88
63
  - opal/browser/canvas/style.rb
89
64
  - opal/browser/canvas/text.rb
90
- - opal/browser/compatibility.rb
91
- - opal/browser/compatibility/animation_frame.rb
92
- - opal/browser/compatibility/dom/document/window.rb
93
- - opal/browser/compatibility/dom/element/css.rb
94
- - opal/browser/compatibility/dom/element/matches.rb
95
- - opal/browser/compatibility/dom/element/offset.rb
96
- - opal/browser/compatibility/dom/element/scroll.rb
97
- - opal/browser/compatibility/dom/element/style.rb
98
- - opal/browser/compatibility/dom/mutation_observer.rb
99
- - opal/browser/compatibility/http/request.rb
100
- - opal/browser/compatibility/immediate.rb
101
- - opal/browser/compatibility/window/scroll.rb
102
- - opal/browser/compatibility/window/size.rb
103
- - opal/browser/compatibility/window/view.rb
104
65
  - opal/browser/console.rb
105
66
  - opal/browser/cookies.rb
106
67
  - opal/browser/css.rb
@@ -109,20 +70,22 @@ files:
109
70
  - opal/browser/css/rule/style.rb
110
71
  - opal/browser/css/style_sheet.rb
111
72
  - opal/browser/css/unit.rb
73
+ - opal/browser/delay.rb
112
74
  - opal/browser/dom.rb
113
75
  - opal/browser/dom/attribute.rb
114
76
  - opal/browser/dom/builder.rb
115
77
  - opal/browser/dom/cdata.rb
116
78
  - opal/browser/dom/character_data.rb
117
79
  - opal/browser/dom/comment.rb
118
- - opal/browser/dom/compatibility.rb
119
80
  - opal/browser/dom/document.rb
120
81
  - opal/browser/dom/document_fragment.rb
121
82
  - opal/browser/dom/element.rb
83
+ - opal/browser/dom/element/image.rb
122
84
  - opal/browser/dom/element/input.rb
123
85
  - opal/browser/dom/element/offset.rb
124
86
  - opal/browser/dom/element/position.rb
125
87
  - opal/browser/dom/element/scroll.rb
88
+ - opal/browser/dom/element/size.rb
126
89
  - opal/browser/dom/event.rb
127
90
  - opal/browser/dom/event/animation.rb
128
91
  - opal/browser/dom/event/audio_processing.rb
@@ -160,7 +123,6 @@ files:
160
123
  - opal/browser/history.rb
161
124
  - opal/browser/http.rb
162
125
  - opal/browser/http/binary.rb
163
- - opal/browser/http/compatibility.rb
164
126
  - opal/browser/http/headers.rb
165
127
  - opal/browser/http/parameters.rb
166
128
  - opal/browser/http/request.rb
@@ -172,11 +134,10 @@ files:
172
134
  - opal/browser/screen.rb
173
135
  - opal/browser/socket.rb
174
136
  - opal/browser/storage.rb
175
- - opal/browser/timeout.rb
137
+ - opal/browser/support.rb
176
138
  - opal/browser/utils.rb
177
139
  - opal/browser/version.rb
178
140
  - opal/browser/window.rb
179
- - opal/browser/window/compatibility.rb
180
141
  - opal/browser/window/scroll.rb
181
142
  - opal/browser/window/size.rb
182
143
  - opal/browser/window/view.rb
@@ -192,13 +153,16 @@ files:
192
153
  - spec/http_spec.rb
193
154
  - spec/immediate_spec.rb
194
155
  - spec/json2.js
156
+ - spec/runner.rb
195
157
  - spec/sizzle.js
196
158
  - spec/socket_spec.rb
197
159
  - spec/spec_helper.rb
198
160
  - spec/storage_spec.rb
161
+ - spec/wgxpath.install.js
199
162
  - spec/window_spec.rb
200
163
  homepage: http://github.com/opal/opal-browser
201
- licenses: []
164
+ licenses:
165
+ - MIT
202
166
  metadata: {}
203
167
  post_install_message:
204
168
  rdoc_options: []
@@ -216,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
180
  version: 1.3.1
217
181
  requirements: []
218
182
  rubyforge_project:
219
- rubygems_version: 2.1.5
183
+ rubygems_version: 2.2.0
220
184
  signing_key:
221
185
  specification_version: 4
222
186
  summary: Browser support for Opal.
@@ -233,8 +197,11 @@ test_files:
233
197
  - spec/http_spec.rb
234
198
  - spec/immediate_spec.rb
235
199
  - spec/json2.js
200
+ - spec/runner.rb
236
201
  - spec/sizzle.js
237
202
  - spec/socket_spec.rb
238
203
  - spec/spec_helper.rb
239
204
  - spec/storage_spec.rb
205
+ - spec/wgxpath.install.js
240
206
  - spec/window_spec.rb
207
+ has_rdoc: