6363 */
6464final class Session extends Container
6565{
66- /**
67- * @var boolean
68- */
69- private $ w3c ;
70-
7166 /**
7267 * @var array
7368 */
@@ -237,7 +232,12 @@ public function deleteCookie($cookieName)
237232 */
238233 public function window ()
239234 {
240- return new Window ($ this ->url . '/window ' );
235+ // legacy window methods
236+ if ( ! $ this ->w3c ) {
237+ return call_user_func_array (array ($ this , 'legacyWindow ' ), func_get_args ());
238+ }
239+
240+ return new Window ($ this ->w3c , $ this ->url . '/window ' );
241241 }
242242
243243 /**
@@ -267,7 +267,7 @@ public function legacyWindow()
267267 }
268268
269269 // chaining
270- return new LegacyWindow ($ this ->url . '/window ' , $ arg );
270+ return new LegacyWindow ($ this ->w3c , $ this -> url . '/window ' , $ arg );
271271 }
272272
273273 /**
@@ -314,7 +314,7 @@ public function frame()
314314 }
315315
316316 // chaining
317- return new Frame ($ this ->url . '/frame ' );
317+ return new Frame ($ this ->w3c , $ this -> url . '/frame ' );
318318 }
319319
320320 /**
@@ -347,7 +347,7 @@ public function timeouts()
347347 }
348348
349349 // chaining
350- return new Timeouts ($ this ->url . '/timeouts ' );
350+ return new Timeouts ($ this ->w3c , $ this -> url . '/timeouts ' );
351351 }
352352
353353 /**
@@ -358,7 +358,7 @@ public function timeouts()
358358 */
359359 public function ime ()
360360 {
361- return new Ime ($ this ->url . '/ime ' );
361+ return new Ime ($ this ->w3c , $ this -> url . '/ime ' );
362362 }
363363
364364 /**
@@ -383,7 +383,7 @@ public function activeElement()
383383 */
384384 public function touch ()
385385 {
386- return new Touch ($ this ->url . '/touch ' );
386+ return new Touch ($ this ->w3c , $ this -> url . '/touch ' );
387387 }
388388
389389 /**
@@ -416,7 +416,7 @@ public function session_storage()
416416 */
417417 public function application_cache ()
418418 {
419- return new ApplicationCache ($ this ->url . '/application_cache ' );
419+ return new ApplicationCache ($ this ->w3c , $ this -> url . '/application_cache ' );
420420 }
421421
422422 /**
@@ -444,7 +444,7 @@ public function log()
444444 }
445445
446446 // chaining
447- return new Log ($ this ->url . '/log ' );
447+ return new Log ($ this ->w3c , $ this -> url . '/log ' );
448448 }
449449
450450 /**
@@ -455,7 +455,7 @@ public function log()
455455 */
456456 public function alert ()
457457 {
458- return new Alert ($ this ->url . '/alert ' );
458+ return new Alert ($ this ->w3c , $ this -> url . '/alert ' );
459459 }
460460
461461 /**
@@ -474,7 +474,7 @@ public function execute()
474474 return $ result ['value ' ];
475475 }
476476
477- return new Execute ($ this ->url . '/execute ' );
477+ return new Execute ($ this ->w3c , $ this -> url . '/execute ' );
478478 }
479479
480480 /**
@@ -487,26 +487,6 @@ public function setCapabilities($capabilities)
487487 $ this ->capabilities = $ capabilities ;
488488 }
489489
490- /**
491- * Set w3c
492- *
493- * @param boolean $w3c
494- */
495- public function setW3c ($ w3c )
496- {
497- $ this ->w3c = $ w3c ;
498- }
499-
500- /**
501- * Get w3c
502- *
503- * @return boolean
504- */
505- public function getW3c ()
506- {
507- return $ this ->w3c ;
508- }
509-
510490 /**
511491 * {@inheritdoc}
512492 */
0 commit comments