Fix thai symbol rendering slowness

Harfbuzz is constantly trying to load libthai in
src/3rdparty/harfbuzz/src/harfbuzz-thai.c,
making rendering of thai symbols very slow.

Task-number: QTBUG-37665
Change-Id: I30a2a5489271534eeacc205d8106b22130c40c5f
(cherry picked from qtbase/47e6ec0736aa129e181e0b6f02cec884f9832432)
make table page-break logic opt-in via CSS at the row level

The logic implemented by the various patches is optimal when
tables are used for display of data. However, it breaks down
when tables are used for layout (e.g. nested tables, rows with
multi-page content, etc). Due to the nature of the patches,
there was no way to "opt-out" of the functionality and resulted
in broken output for a lot of scenarios.

The current change makes the page-break functionality opt-in
via CSS, which makes it easier to enable/disable at the element
level. You have to declare the following at the row level:

tr { page-break-inside: avoid }

Please note that the defining it at the table or cell level may
have no impact, as the CSS at the row level is only considered.
In case the above is not defined, then the previous pagination
logic in RenderBlockLineLayout is used instead [which was
disabled by the earlier patches].

We still bump tables to the next page in case the caption and
header cannot fit in the current page. Depending on the above
setting for the first row in the body, the first cell height
will also be considered whether to bump the table to the next
page. This should ideally be implemented as a custom CSS
property but that's something for a future change.

Change-Id: I584aac33e15a71664d7bd2708724b422f1dad079
Don't jpeg compress images that were not orginally jpeg compressed, as it generally causes non-photography images to have very visible artifacts.
Add property to override this behaviour.

Change the behaviour of imageDPI such that we can set it to 0 to prevent the rescaling of images (that is, 0 is interpreted as infinity).

Don't waste time compressing the same data several times.
Don't make decisions on which kind of compression to use on the compressed image data by compressing the original data.
Fix invalid pdf files being generated in rare degenerate cases where the compressed version of the scaled image is larger than the compressed version of the unscaled data.
Don't limit the size of jpeg compressed images to 1MB.

Prepare for supporting deflated images with predictor (PNG style compression).