Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 88fff59

Browse files
andrewnicolsOndraM
authored andcommitted
Pass W3C Compliance to RemoteTargetLocator
1 parent 574684f commit 88fff59

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/Remote/RemoteTargetLocator.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ class RemoteTargetLocator implements WebDriverTargetLocator
3333
* @var WebDriver
3434
*/
3535
protected $driver;
36+
/**
37+
* @var bool
38+
*/
39+
protected $isW3cCompliant;
3640

37-
public function __construct($executor, $driver)
41+
public function __construct($executor, $driver, $isW3cCompliant = false)
3842
{
3943
$this->executor = $executor;
4044
$this->driver = $driver;
45+
$this->isW3cCompliant = $isW3cCompliant;
4146
}
4247

4348
/**
@@ -112,8 +117,6 @@ public function activeElement()
112117
$response = $this->driver->execute(DriverCommand::GET_ACTIVE_ELEMENT, []);
113118
$method = new RemoteExecuteMethod($this->driver);
114119

115-
$isW3cCompliant = ($this->driver instanceof RemoteWebDriver) ? $this->driver->isW3cCompliant() : false;
116-
117-
return new RemoteWebElement($method, JsonWireCompat::getElement($response), $isW3cCompliant);
120+
return new RemoteWebElement($method, JsonWireCompat::getElement($response), $this->isW3cCompliant);
118121
}
119122
}

lib/Remote/RemoteWebDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ public function navigate()
432432
*/
433433
public function switchTo()
434434
{
435-
return new RemoteTargetLocator($this->getExecuteMethod(), $this);
435+
return new RemoteTargetLocator($this->getExecuteMethod(), $this, $this->isW3cCompliant);
436436
}
437437

438438
/**

0 commit comments

Comments
 (0)