Skip to content

Commit f7071eb

Browse files
authored
Merge pull request #726 from browner12/patch-1
[5.0] Fit content to `<html>` instead of `<body>`
2 parents 6f59695 + 862f343 commit f7071eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Browser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,10 @@ public function fitContent()
270270
{
271271
$this->driver->switchTo()->defaultContent();
272272

273-
$body = $this->driver->findElement(WebDriverBy::tagName('body'));
273+
$html = $this->driver->findElement(WebDriverBy::tagName('html'));
274274

275-
if (! empty($body)) {
276-
$this->resize($body->getSize()->getWidth(), $body->getSize()->getHeight());
275+
if (! empty($html)) {
276+
$this->resize($html->getSize()->getWidth(), $html->getSize()->getHeight());
277277
}
278278

279279
return $this;

0 commit comments

Comments
 (0)