webkit_remote_unstable 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92207ab762337f22db4f10bcd26525d254c02f4d
4
- data.tar.gz: d22bb09a90c7c0c0978657b0ffcab3549054588d
3
+ metadata.gz: ddea31c96294c2deeac85282e91ce9abc45e3b4a
4
+ data.tar.gz: 8af36de81856d249a115c2fee54bbc153c2b0731
5
5
  SHA512:
6
- metadata.gz: a15fc42945c824463215ec5573e5c19c8788562c78cc901816155b9ed8ad0c258e7125b3ccb3b2639aee13ffad76106953ff0ef3e01f0c2396e6248901f7f895
7
- data.tar.gz: 001ec141a3a3ad5e44957a3e44e76ee9f67ad437f8c36e7295ffe65fc2e293cb6f1100a83d5f992fdfe480aa0c754318a9545b38248ec04043809cfe172744a7
6
+ metadata.gz: 0c48641c571519df6b44dea28d6e0224861c17136cb683610a3dc48f48155c21ac29a9d23a0d5588bb150c031a31cef2138dfab5e211b8f610ff724fee80070a
7
+ data.tar.gz: 7a5114edfa387271b276b76e4b32f2f4b1cb6e92f1899cd425fe9018cd4872b9efb1e4863d2257c48ab7213ab5fd4ddc33a1352992d53d6df441e59c1d868210
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source 'http://rubygems.org'
2
- gem 'webkit_remote', '>= 0.5.2'
2
+ gem 'webkit_remote', '>= 0.5.3'
3
3
 
4
4
  group :development do
5
5
  gem 'bundler', '>= 1.5.3'
@@ -64,7 +64,7 @@ GEM
64
64
  multi_json
65
65
  simplecov-html (~> 0.8.0)
66
66
  simplecov-html (0.8.0)
67
- webkit_remote (0.5.2)
67
+ webkit_remote (0.5.3)
68
68
  posix-spawn (>= 0.3.8)
69
69
  ws_sync_client (>= 0.1.1)
70
70
  websocket (1.1.2)
@@ -87,5 +87,5 @@ DEPENDENCIES
87
87
  rack-contrib (>= 1.1.0)
88
88
  rdoc (>= 4.1.1)
89
89
  simplecov (>= 0.8.2)
90
- webkit_remote (>= 0.5.2)
90
+ webkit_remote (>= 0.5.3)
91
91
  yard (>= 0.8.7.3)
data/README.md CHANGED
@@ -18,6 +18,7 @@ remote debugging protocol.
18
18
 
19
19
  * Overriding device attributes
20
20
  * CSS computed styles
21
+ * DOM focusing, hit testing, and box model information
21
22
 
22
23
 
23
24
  ## Requirements
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -37,6 +37,14 @@ class DomNode
37
37
  WebkitRemote::Client::DomBoxModel.new result['model']
38
38
  end
39
39
 
40
+ # Causes this node to receive the input focus.
41
+ #
42
+ # @return [WebkitRemote::Client] self
43
+ def focus
44
+ @client.rpc.call 'DOM.focus', nodeId: @remote_id
45
+ self
46
+ end
47
+
40
48
  # @private Called by the DomNode constructor.
41
49
  def initialize_unstable
42
50
  @box_model = nil
@@ -22,5 +22,12 @@
22
22
  </head>
23
23
  <body>
24
24
  <p id="box_test">Box model test</p>
25
+ <button type="button" id="focus_test">Focus test</button>
26
+ <script type="text/javascript">
27
+ var node = document.querySelector("#focus_test");
28
+ node.addEventListener("focus", function (event) {
29
+ console.log("Focus received.");
30
+ });
31
+ </script>
25
32
  </body>
26
33
  </html>
@@ -31,6 +31,20 @@ describe WebkitRemote::Client::Dom do
31
31
  end
32
32
  end
33
33
 
34
+ describe 'DomNode#focus' do
35
+ before do
36
+ @node = @client.dom_root.query_selector '#focus_test'
37
+ @client.console_events = true
38
+ end
39
+
40
+ it 'gets the focus to the correct node' do
41
+ @node.focus
42
+ skip "For some reason, DOM.focus doesn't work."
43
+ events = @client.wait_for type: WebkitRemote::Event::ConsoleMessage
44
+ events.last.message.text.must_equal('Focus received.')
45
+ end
46
+ end
47
+
34
48
  describe '#dom_node_at' do
35
49
  before do
36
50
  @node = @client.dom_root.query_selector '#box_test'
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "webkit_remote_unstable"
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Victor Costan"]
@@ -49,7 +49,7 @@ Gem::Specification.new do |s|
49
49
  s.specification_version = 4
50
50
 
51
51
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
- s.add_runtime_dependency(%q<webkit_remote>, [">= 0.5.2"])
52
+ s.add_runtime_dependency(%q<webkit_remote>, [">= 0.5.3"])
53
53
  s.add_development_dependency(%q<bundler>, [">= 1.5.3"])
54
54
  s.add_development_dependency(%q<debugger>, [">= 1.6.6"])
55
55
  s.add_development_dependency(%q<jeweler>, [">= 2.0.1"])
@@ -61,7 +61,7 @@ Gem::Specification.new do |s|
61
61
  s.add_development_dependency(%q<simplecov>, [">= 0.8.2"])
62
62
  s.add_development_dependency(%q<yard>, [">= 0.8.7.3"])
63
63
  else
64
- s.add_dependency(%q<webkit_remote>, [">= 0.5.2"])
64
+ s.add_dependency(%q<webkit_remote>, [">= 0.5.3"])
65
65
  s.add_dependency(%q<bundler>, [">= 1.5.3"])
66
66
  s.add_dependency(%q<debugger>, [">= 1.6.6"])
67
67
  s.add_dependency(%q<jeweler>, [">= 2.0.1"])
@@ -74,7 +74,7 @@ Gem::Specification.new do |s|
74
74
  s.add_dependency(%q<yard>, [">= 0.8.7.3"])
75
75
  end
76
76
  else
77
- s.add_dependency(%q<webkit_remote>, [">= 0.5.2"])
77
+ s.add_dependency(%q<webkit_remote>, [">= 0.5.3"])
78
78
  s.add_dependency(%q<bundler>, [">= 1.5.3"])
79
79
  s.add_dependency(%q<debugger>, [">= 1.6.6"])
80
80
  s.add_dependency(%q<jeweler>, [">= 2.0.1"])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webkit_remote_unstable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Costan
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.2
19
+ version: 0.5.3
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.2
26
+ version: 0.5.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement