<tools/gyp> Allow letting qmake do the link step

This adds a let_qmake_do_the_linking target variable to tell ninja
not to link but rather dump the linking information from gyp in a
file that we'll parse with qmake.

ld expects the -l switches to appear after the dependent object on
the command line. It works if we use QT_PRIVATE to trigger Qt being
added to the link line since it would be appended to LIBS_PRIVATE as
well. But QT will append to LIBS, which is listed first in the
Makefile and would cause undefined symbol errors by following .o
files.

Fix the issue by adding .o files to OBJECTS instead of LIBS_PRIVATE.
This will only work if all Qt-dependent code is listed in the
top-level gyp file, but we've been keeping it layered that way since
the beginning and it should be acceptable to require it.

Change-Id: I3b655ce8d6525fb986ca87fb9c2863a239ebf991
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<tools/grit> GRIT: Allow grd files outside of chromium source dir.

When replacing substrings with values from a dictionary,
the replacements should not be truncated to the length of src_root_dir.

If the basename does not exist as a key in the resource_ids file,
then fall back to an absolute path.

The precedence is like:
file in chromium > file basename > absolute file name.

THIS SHOULD BE UPSTREAMABLE.

Change-Id: I7d1da8c04515807000742aac4a6fa4db7616fd13
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<v8> Prevent V8 from overridding the RuntimeLibrary cflags

Since we're never going to statically link to the runtime library on
Windows (unlike Chromium when built as a monolitic chrome.exe), make
sure that our /M flag setting is also properly set for V8.

Change-Id: I755c3c0bfa27e45b897a2d4d5496103913d1c6c4
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<v8> fix ARMv6 detection for v8.

The linux kernel now reports the processor information
in "model name" and not in "Processor" anymore.
Both should be checked for backwards compatibility.

As described by:
https://code.google.com/p/v8/issues/detail?id=3112#c16

Change-Id: I567a72c18f43a483e7576e880c2d383873f5660f
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<third_party/WebKit> Fix key event crash on Windows.

This fixes the ASSERT that was triggerd on Windows in
PlatformKeyboardEvent::disambiguateKeyDownEvent  because
we do our own conversion from native events to web events.

This is the same way it was handled in the Qt specific
PlatformKeyboardEvent in WebKit.

Change-Id: I177c238bde1e0101b6abe9d5bbe3ba2e47908f1a
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Use ANGLE libraries from the Qt build / installation.

This moves libEGL and libGLESv2 from dependencies to
libraries where needed.

This also adds support for using the correct configuration
of the ANGLE libraries for linking and runtime loading.

Change-Id: I8c3a5eb11517bf03e921b257eeb3a34b7bc841ea
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<third_party/angle> Disable building libEGL.dll and libGLESv2.dll.

This is part of using the ANGLE that is built / installed by Qt.

Change-Id: Ib71d47392690dab6cf874aec13db9e98710de684
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Make localized_error work for us

Essentially cutting away the unnecessary part that depends on
extensions.

Change-Id: I8adbc77dca393ab8480e9cdea3c5c953b52c8aef
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Add FirstVisuallyNonEmptyLayout support for RenderViewObserver

This is needed by the implementation of loadVisuallyCommitted in the QtWebEngine.

Change-Id: Ic0fcdc00f7963ea1088a1ae910bb2dbe26e9e12c
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Remove the content/utility dependency to courgette

We do not need courgette and have it excluded from our snapshot.

The original change doesn't explain why the dependency was added:
https://codereview.chromium.org/25909005/

Change-Id: I7d2c76343d1d223c2135e0b93facc279e74ff91c
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Do not bundle the tracing UI resources

We do not support loading the chrome://tracing WebUI and therefore
we shouldn't bundle those resources in our library.

Change-Id: If3aa4c676b22a55e772f19487e21b4cd48babe65
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Add a hook to provide our own icu data file path

Qt will always use QLibraryInfo to determine where this file was
installed, regardless of the platform.

Change-Id: I79374655356d872b2bc766ec8a33fcba343e9c95
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Disable warnings as errors on Mac and Windows

Since we have little chance of introducing warnings in Chromium code
and that we allow building the code on more various toolchains,
avoid breaking the build for warnings.

We already disable them on os_posix==1 and OS!="mac" by overriding
the werror% gyp variable in qtwebengine_extras.gypi.

Change-Id: Ic233bcd018a9a78a508772dea126435e2226b721
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<tools/gyp> Fix ninja_use_custom_environment_files

We want to use this option to prevent gyp from detecting the MSVC
toolchain by itself. We already require the environment to be setup
according to the desired toolchain for Qt, and we should respect it
when it's time to build QtWebEngine through gyp.

win_tool.py currently expects the environment.<arch> file to be
present. Fix the issue by copying in this file the whole environment
at the gyp invocation time instead of from an invocation of the
setup script when ninja_use_custom_environment_files isn't used.

Change-Id: Iade4c488e1af5cab8306e9070c73d42ec67a955a
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Add ifdefs to exclude ATL and accessibility from the build

ATL currently isn't distributed with MSVS Express, only with the
Professional version. Chromium requires downloading the WDK iso for
express users just to be able to use the ATL version that was shipped
with it.

We can avoid the extra dependency for now by cutting off all the
accessibility code, which is currently the only part of the content
layer depending on ATL. We will use the Qt accessibility code anyway.

Change-Id: Iec25231250ccfc9405fdf342752733814888f348
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Exclude all unneeded components from the build

Including the gyp files forces the resources to be available in the
snapshot to allow grit to succeed.

Add a wrapping condition that explicitly includes supported
components in Qt builds.

Change-Id: I17d477f2bc26b35a0031830af087c81854951389
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<chromium> Exclude the dependency to xscrnsaver

Just having the conditions match triggers pkg-config to be run
which will fail the build even if we won't need the library.

Change-Id: Ic8556f3019ff6c5e76d609e9f67d68ec2a9a392e
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<third_party/WebKit> Fix medium hinting on Linux with fontconfig and freetype

Skia freetype will enforce slight hinting in SkTypeface_FreeType::onFilterRec
when subpixel positioning is enabled. To avoid overriding medium hinting
with slight, we should not enable subpixel positioning for medium hinting
similar to how it is avoided for full hinting as well.

Change-Id: I4a229cf2b8827c11f33789d1c35c2d0eaeaed0ae
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<third_party/WebKit> Apply Qt defaults to scroll animations

This patch applies the Qt scroll animation configuration from WebKit.
This makes the scrolling more responsive and smooth when used with
touchpad scroll gestures or free spinning scroll wheels.

Change-Id: I2f17185f3e95c6bc84608cc4c3945dba2d67faa8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
<third_party/WebKit> Disable annotations in Heap.h.

This patch can be removed again as soon as
we do not need to support XCode <= 5.0 anymore.

Change-Id: Icdcca203f28555029a16ce7f8a806f2844ecb0b4
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>