This fix allows the latest WebKit 612.1 to compile with Visual Studio 2017. For 
the jfx mainline, our current toolchain for Windows is VS2019 16.9.3, but we 
would like to continue to allow developers to build with VS 2017.

The JavaFX 11 code line still uses VS2017 (15.9.24), so we must fix this in the 
`jfx11u` code line in any case. Fixing it mainline first and then backporting 
it will allow the native WebKit code to remain in sync between mainline and 
jfx11u as well as keeping JavaFX buildable on VS2017 for a while longer.

As noted in the JBS bug report, eventually we will need to upgrade all code 
lines to a minimum of VS2019 for building WebKit, but this fix allows us to 
delay that for a while longer.

## Notes to Reviewers

There were two problems that needed to be fixed:

*  `WebCore/inspector/InspectorOverlay.cpp` fails to compile with an error that 
"conversion from 'const int' to 'float' requires a narrowing conversion". The 
fix is to initialize the two `constexpr` variables with float constants instead 
of integer constants.
* `jfxwebkit.dll` fails to link with 4 duplicate symbols due to VS2017's 
incomplete (or buggy) support for inline constant variables. The fix is to move 
the definition of those 4 constant variables from `Node.h` to `Node.cpp` and 
define them as runtime constants. 

I qualified both changes with `#if PLATFORM(JAVA)` so our local modifications 
are clearly identified. I could have further qualified the second of these two 
changes (there's no point in doing it for the first) with `&& OS(WINDOWS)` but 
chose to be consistent on all OS platforms.

-------------

Commit messages:
 - Minor cleanup to move comments within #if PLATFORM(JAVA) block
 - 8270479: WebKit 612.1 build fails with Visual Studio 2017

Changes: https://git.openjdk.java.net/jfx/pull/576/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=576&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8270479
  Stats: 21 lines in 3 files changed: 21 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jfx/pull/576.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/576/head:pull/576

PR: https://git.openjdk.java.net/jfx/pull/576

Reply via email to