- Electron version: 0.37.2
- Operating system: OS X 10.11.3 

https://github.com/atom/electron/pull/4700 added support for the `visibilitychange` event (thank you @zcbenz!), but that event doesn't make its way into `<webview>`s, which are always "visible" regardless of their host page's `document.visibilityState`.

Tested using the following setup

Host page:

``` coffee
console.log "<webview> host page initial visibilityState =", document.visibilityState

document.addEventListener "visibilitychange", ->
  console.log "<webview> host page visibilitychange event, visibilityState =", document.visibilityState
```

`<webview>`:

``` coffee
console.log "<webview> initial visibilityState =", document.visibilityState

addEventListener "visibilitychange", ->
  console.log "<webview> visibilitychange, visibilityState =", document.visibilityState

setInterval ->
  console.log "<webview> visibilityState =", document.visibilityState
, 3000
```

Host page logs:

```
<webview> host page initial visibilityState = visible
<webview> host page visibilitychange event, visibilityState = hidden
<webview> host page visibilitychange event, visibilityState = visible
```

`<webview>` logs:

```
<webview> initial visibilityState = visible
(24) <webview> visibilityState = visible
```

atom/browser/web_contents_preferences.cc
#include "atom/browser/web_contents_preferences.h"
#include <algorithm>
#include <string>
#include <vector>
#include "atom/browser/native_window.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/options_switches.h"
#include "base/command_line.h"
#include "base/strings/string_number_conversions.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/web_preferences.h"
#include "native_mate/dictionary.h"
#include "net/base/filename_util.h"
#if defined(OS_WIN)
#include "ui/gfx/switches.h"
#endif
DEFINE_WEB_CONTENTS_USER_DATA_KEY(atom::WebContentsPreferences);
namespace atom {
std::vector<WebContentsPreferences*> WebContentsPreferences::instances_;
WebContentsPreferences::WebContentsPreferences(