Ensure that cursor rectangle is always valid.

The cursor rectangle is given an invalid size when the user clicks on
an input field; the reported size is 0 pixel wide.
The cursor is then converted to a QRect, which is invalid if rectangle
width is 0.
This can interefere with input methods that check for cursorRect
validity before reporting a cursorRect change.

Make sure that a cursor rectangle with at least one valid dimension
becomes a valid QRect.

Task-number: QTBUG-35996

Change-Id: I4026f1136cfb006efc5d7915f0f10c1b5187c730
Signed-off-by: Luca Ottaviano <lottaviano@develer.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Bump MODULE_VERSION to 5.2.2

Change-Id: Ic00000a7fe9f261301096ac25aade719f2656201
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Merge remote-tracking branch 'origin/release' into stable

Change-Id: I82f158687d0b5da3e85c025d720111b6b1414010
Make sure the correct position for the plugin is used when showing

When the plugin was windowed then it was always being shown at 0x0 of
the containing window rather than the correct position of the plugin
inside the containing window. This enesures it is placed correctly in
that case.

Task-number: QTBUG-31730
             QTBUG-33053
             QTBUG-32546

Change-Id: I5ce0321924d288437d483002e9cb6dd1c98b6863
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Do not notifyFinished on resources never loaded

If autoload images is disabled, the CachedImage element never starts
loading but still needs loading. We therefore need to check both
isLoading() and stillNeedsLoad() to determine if loading is complete.

This fixes a serious memory leak when autoload images is disabled.

Task-number: QTBUG-34494
Change-Id: I36811179d95e23651fabe484fbde08e2881d822b
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Forward devicePixelRatio to WebCore Page

The device pixel ratio must be set on Page for CSS image set and CSS
media queries to work correctly.

Task-number: QTBUG-36190
Change-Id: I76694c1375194f35df7f62e942bc8565f065a3bc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Apply device pixel ratio to transparency layers

The transparency layers are currently created with taking hiDPI into
account. This means that any CSS opacity causes a shift in rendering
quality.

This patch forwards the device pixelratio for any QPaintDevice to
transparency layers created for that device.

Change-Id: Ie65f76771a4cc59bc714a9b89511cab1f7617abc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Don't pollute .prl & .pc files with private dependencies

Also change the creating_module check in needToLink to make sure that
only the main module will try to link directly with the WebCore and
JavaScriptCore static libraries.

Task-number: QTBUG-35774
Initial-patch-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Change-Id: Ib5992e112803679837249400e98cb8c22636096d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Fix RenderGeometryMap.cpp ASSERT on Google Plus

The assert roundedIntPoint(result) == roundedIntPoint(rendererMappedResult)
is triggered on Google Plus. The cause appears to be premature rounding
leading a wrong result.

The fix is a to remove the early rounding. This follows a similar fix
in upstream WebKit r142638 where the same problem was fixed for the
other mapToContainer method.

Change-Id: Ifae91c204f2043b3f07682dc7bed711a6cb38c91
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Fix assert in BitmapTextureImageBuffer::applyFilters()

While WebCore should not give a BitmapTextureImageBuffer any filters
applyFilters() will still be called with an empty list of filters.

We should therefore not assert that applyFilters is never called by
that is only ever called with an empty list of filters to apply.

Change-Id: Ic24b735f1fc92e2a57c7ef068a8c7d712f0fc31f
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix assert in m_stack.isEmpty() in GraphicsContext::~GraphicsContext()

Save and restore is not balanced in GraphicsContext. This causes
the log error "ERROR void GraphicsContext::restore() stack is empty"
and assert in the GraphicsContext destructor.

The cause is a mismatch of GraphicsContexts being saved and restored by
TextureMapperImageBuffer beginClip and endClip. This patch fixes endClip
to restore the currentContext beginClip saved.

Change-Id: Ief0100dd26c7eded04734167e86712a81f1a7674
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Fix transform of accelerated layers on hiDPI painters

A mismatch of reading combinedTransform but setting worldTransform
means that the pattern of only storing and restoring the transform
when temporarily overriding it, causes the hiDPI transform that
combinedTransform contains to be applied multiple times.

Task-number: QTBUG-36508
Change-Id: I512f0752016f55935595ef259913660b4ee78ae7
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
TextureMapperGL must take hiDPI transform into account

Since TextureMapperGL does its own native rendering it must itself
apply the all transforms QPainter would normally do behind the scenes.

Task-number: QTBUG-36508
Change-Id: Id4a0ee64ff7ac5c5cb51e45ffd2e4e25ed7fce74
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
8 bytes memory leaks in WebProcessMainQt.cpp when proxy is initialized

https://bugs.webkit.org/show_bug.cgi?id=118515

Patch by Minju Kim <pmuarteo@gmail.com> on 2013-09-25
Reviewed by Christophe Dumez.

* WebProcess/qt/WebProcessMainQt.cpp:
(WebKit::initializeProxy): Handled EnvHttpProxyFactory by using OwnPtr
to avoid memory leak when it isn't handled by NetworkProxyFactory

Change-Id: I51833871d8e11441ffe60d51629814e64f77d792
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Fix memory leaks in platform/image-encoders/JPEGImageEncoder.cpp

https://bugs.webkit.org/show_bug.cgi?id=118781

Reviewed by Brent Fulgham.

We can find the function "jpeg_finish_compress" call the function "jpeg_abort" at the end.
And the comments of "jpeg_abort" is "Abort processing of a JPEG compression operation,
but don't destroy the object itself". (We can find these in the "jcapimin.c" of jpeg)
So the compression object destroy need be called.
No new tests because this doesn't change functionality.

* platform/image-encoders/JPEGImageEncoder.cpp:
(WebCore::compressRGBABigEndianToJPEG):

Change-Id: Ic58b53c4e6bada7e92e09825be9e770f1c5445c1
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158280 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Update device pixel ratio on screen change

This patch makes QWebPage listen to QWindow::screenChangedEvent
and update the device pixel ratio when it is received.

Task-number: QTBUG-36190
Change-Id: Ia28571ef241a3a2f970876f6e474b01c1ac001e1
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Fix build with QT_NO_GRAPHICSVIEW

Change-Id: Ia909a560db58d6cdc6ec4bbac879249eb5e286ef
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
[mips] Wrong register usage in LLInt.

Fix register usage and add PIC header to all LLInt operations.
This patch is taken from https://bugs.webkit.org/show_bug.cgi?id=125168.

It fixes the crash of fast/js/exception-propagate-from-dfg-to-llint test
on mips architecture.

Change-Id: I98ad3b5766451cab48a76f7e028b210f9ebe99ed
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>