Skip to content

Commit fff9a8e

Browse files
committed
Element::css() works differently
1 parent 5dd9678 commit fff9a8e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/WebDriver/Element.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
* @method array location() Determine an element's location on the page.
4343
* @method array location_in_view() Determine an element's location on the screen once it has been scrolled into view.
4444
* @method array size() Determine an element's size in pixels.
45-
* @method string css($propertyName) Query the value of an element's computed CSS property.
4645
*/
4746
final class Element extends Container
4847
{
@@ -66,7 +65,6 @@ protected function methods()
6665
'location' => array('GET'),
6766
'location_in_view' => array('GET'),
6867
'size' => array('GET'),
69-
'css' => array('GET'),
7068
);
7169
}
7270

@@ -114,6 +112,20 @@ public function getID()
114112
return $this->id;
115113
}
116114

115+
/**
116+
* Query the value of an element’s computed CSS property: /session/:sessionId/element/:id/css/:propertyName
117+
*
118+
* @param string $propertyName
119+
*
120+
* @return mixed
121+
*/
122+
public function css($propertyName)
123+
{
124+
$result = $this->curl('GET', "/css/$propertyName");
125+
126+
return $result['value'];
127+
}
128+
117129
/**
118130
* {@inheritdoc}
119131
*/

0 commit comments

Comments
 (0)