Issue 1:
Electron Version: 2.0.2

Operating System (Platform and Version): macOS 10.13.4

Last known working Electron version: 1.7.12

This has been noticed when trying to upgrade VS Code to Electron 2.0.2 in microsoft/vscode#52196

Expected Behavior

Characters with opacity in a monospace font should be rendered without duplication (in the next whitespace).

Actual behavior

Characters with opacity in a monospace font are rendered doubled when followed by whitespace.

To Reproduce

Using https://github.com/electron/fiddle , here is the HTML code needed to reproduce in the renderer:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>

<style>
.squiggly-inline-unnecessary {
opacity: 0.6;
}
.view-line {
font-family: "Monaco";
font-weight: normal;
font-size: 14px;
line-height: 21px;
letter-spacing: 0px;
}
</style>

<div style="top:21px;height:21px;" class="view-line"><span>
<span class="mtk1">&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span class="mtk5 squiggly-inline-unnecessary">const</span>
<span class="mtk1 squiggly-inline-unnecessary">&nbsp;</span>
<span class="mtk13 squiggly-inline-unnecessary">a</span>
<span class="mtk1 squiggly-inline-unnecessary">&nbsp;</span>
<span class="mtk17 squiggly-inline-unnecessary">=</span>
<span class="mtk1 squiggly-inline-unnecessary">&nbsp;</span>
<span class="mtk9 squiggly-inline-unnecessary">`hdshhdasha;</span>
</span></div>

<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
Chromium <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.

<script>
// You can also require other files to run in this process
require('./renderer.js')
</script>
</body>
</html>

The above should render the text:

const a = `hdshhdasha;

Screenshots

Notice how a and = are doubled:

Additional Information

This does not reproduce when running with --disable-gpu.

This does not reproduce when removing the opacity.

This does not reproduce when using two &nbsp;s in a <span>.

This does not reproduce on Chrome 67.

This does not reproduce on all macOS machines we have tried, but it reproduces on some Windows machines.

fyi @bpasero @chrmarti

Issue 2:
Electron version: 1.7.6

Operating system: Windows 10

Expected behavior

Every time some the user clicks a button that downloads a file in the browser the event "will-download" should be fired.

Actual behavior

Behavior 1. The event "will-download" is fired only for the first time some file is downloaded from the browser. If I click again to download a file the event is not fired anymore.

Behavior 2. If I close and open the browser again (even without ending the application) the event if fired more than once (two, three, fore times) when I click in a button for download.

How to reproduce

I have this code in my project where I open a window in which the user can search and download some stuff:

let myBrowser = new BrowserWindow({ width: 1300, height: 1000, webPreferences: { nodeIntegration: false } })
myBrowser.setMenu(null)
myBrowser.loadURL('http://localhost/myurl.html')
var ses = myBrowser.webContents.session
ses.on('will-download', (event, item, webContents) => {
var fileName = item.getFilename()
var url = item.getURL()
item.setSavePath(store.get('myFolder') + '/' + fileName)
//DO SOME STUFF WITH THE FILE NAME
})

I don't prevent the download from beeing downloaded because all of what I need to do is save in a document the name and url of the file, and set the path to save the file.