Skip to content

Commit

Permalink
Merge pull request #726 from browner12/patch-1
Browse files Browse the repository at this point in the history
[5.0] Fit content to `<html>` instead of `<body>`
  • Loading branch information
taylorotwell authored Jan 27, 2020
2 parents 6f59695 + 862f343 commit f7071eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,10 @@ public function fitContent()
{
$this->driver->switchTo()->defaultContent();

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

if (! empty($body)) {
$this->resize($body->getSize()->getWidth(), $body->getSize()->getHeight());
if (! empty($html)) {
$this->resize($html->getSize()->getWidth(), $html->getSize()->getHeight());
}

return $this;
Expand Down

0 comments on commit f7071eb

Please sign in to comment.