Column balancing support in the region based multicol implementation
https://bugs.webkit.org/show_bug.cgi?id=116033

Source/WebCore:

Start by setting the column height to the flow thread's height divided
by the number of columns. Then stretch the column height until
contents fits without creating overflowing columns, or until the
maximum allowed column height is reached, whichever comes first. This
may require several layout iterations (but normally only a
couple). For each time we stretch, stretch by the least amount
required to make a difference to which box goes where.

Also make sure that the columns get tall enough to honor orphans
and widows settings.

This change takes some tiny steps in preparing for multiple column
set support. There is also some minor cleanup and bugfixing; see
details below.

Patch by Morten Stenshorne <mstensho@opera.com> on 2013-06-13
Reviewed by David Hyatt.

Tests: fast/multicol/newmulticol/balance-images.html
       fast/multicol/newmulticol/balance-maxheight1.html
       fast/multicol/newmulticol/balance-maxheight2.html
       fast/multicol/newmulticol/balance1.html
       fast/multicol/newmulticol/balance2.html
       fast/multicol/newmulticol/balance3.html
       fast/multicol/newmulticol/balance4.html
       fast/multicol/newmulticol/balance5.html
       fast/multicol/newmulticol/balance6.html
       fast/multicol/newmulticol/balance7.html
       fast/multicol/newmulticol/balance8.html
       fast/multicol/newmulticol/balance9.html
       fast/multicol/newmulticol/cell-shrinkback.html
       fast/multicol/newmulticol/columns-shorthand-parsing.html
       fast/multicol/newmulticol/orphans-and-widows-balance.html
       fast/multicol/newmulticol/single-line.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustForUnsplittableChild):
(WebCore::RenderBlock::setPageBreak):
(WebCore):
(WebCore::RenderBlock::updateMinimumPageHeight):
(WebCore::calculateMinimumPageHeight):
(WebCore::RenderBlock::adjustLinePositionForPagination):
(WebCore::RenderBlock::adjustBlockChildForPagination): If no lines
cross the boundaries, we need to report where blocks cross
instead, so that the column balancer knows how much to stretch
columns if necessary.
* rendering/RenderBlock.h:
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnBlock.cpp:
(WebCore::RenderMultiColumnBlock::RenderMultiColumnBlock):
(WebCore::RenderMultiColumnBlock::checkForPaginationLogicalHeightChange):
(WebCore::RenderMultiColumnBlock::relayoutForPagination):
(WebCore::RenderMultiColumnBlock::layoutSpecialExcludedChild):
* rendering/RenderMultiColumnBlock.h:
(WebCore::RenderMultiColumnBlock::columnHeightAvailable):
(WebCore::RenderMultiColumnBlock::requiresBalancing):
(RenderMultiColumnBlock):
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::autoGenerateRegionsToBlockOffset):
(WebCore::RenderMultiColumnFlowThread::setPageBreak):
(WebCore):
(WebCore::RenderMultiColumnFlowThread::updateMinimumPageHeight):
* rendering/RenderMultiColumnFlowThread.h:
(RenderMultiColumnFlowThread):
* rendering/RenderMultiColumnSet.cpp: Get rid of
RenderMultiColumnSet::updateLogicalHeight() override. Make
RenderMultiColumnSet behave more like normal blocks, by having
computeLogicalHeight() calculate logical top in addition to
height, just like any other block.
(WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
(WebCore::RenderMultiColumnSet::heightAdjustedForSetOffset): This
method will become more meaningful once we add support for
multiple column sets.
(WebCore):
(WebCore::RenderMultiColumnSet::pageLogicalTopForOffset):
(WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
(WebCore::RenderMultiColumnSet::calculateBalancedHeight):
(WebCore::RenderMultiColumnSet::recordSpaceShortage):
(WebCore::RenderMultiColumnSet::updateLogicalWidth):
(WebCore::RenderMultiColumnSet::prepareForLayout):
(WebCore::RenderMultiColumnSet::computeLogicalHeight):
(WebCore::RenderMultiColumnSet::columnCount):
(WebCore::RenderMultiColumnSet::columnIndexAtOffset):
repaintFlowThreadContent() could end up in an infinite loop
because columnIndexAtOffset() could return UINT_MAX
(subtracting 1 from unsigned 0, which columnCount() could return),
which an unsigned integer obviously can never become larger
than. Also always call columnIndexAtOffset() if we want to get the
column index for some offset, rather than doing it on our own
sometimes. To make this work also during layout, we cannot just
return the last column created so far if we're past it, since
adding new columns is exactly what we want to do at this point.
* rendering/RenderMultiColumnSet.h:
(RenderMultiColumnSet):

LayoutTests:

Patch by Morten Stenshorne <mstensho@opera.com> on 2013-06-13
Reviewed by David Hyatt.

* fast/multicol/newmulticol/balance-images-expected.txt: Added.
* fast/multicol/newmulticol/balance-images.html: Added.
* fast/multicol/newmulticol/balance-maxheight1-expected.txt: Added.
* fast/multicol/newmulticol/balance-maxheight1.html: Added.
* fast/multicol/newmulticol/balance-maxheight2-expected.txt: Added.
* fast/multicol/newmulticol/balance-maxheight2.html: Added.
* fast/multicol/newmulticol/balance1-expected.txt: Added.
* fast/multicol/newmulticol/balance1.html: Added.
* fast/multicol/newmulticol/balance2-expected.txt: Added.
* fast/multicol/newmulticol/balance2.html: Added.
* fast/multicol/newmulticol/balance3-expected.txt: Added.
* fast/multicol/newmulticol/balance3.html: Added.
* fast/multicol/newmulticol/balance4-expected.txt: Added.
* fast/multicol/newmulticol/balance4.html: Added.
* fast/multicol/newmulticol/balance5-expected.txt: Added.
* fast/multicol/newmulticol/balance5.html: Added.
* fast/multicol/newmulticol/balance6-expected.txt: Added.
* fast/multicol/newmulticol/balance6.html: Added.
* fast/multicol/newmulticol/balance7-expected.txt: Added.
* fast/multicol/newmulticol/balance7.html: Added.
* fast/multicol/newmulticol/balance8-expected.txt: Added.
* fast/multicol/newmulticol/balance8.html: Added.
* fast/multicol/newmulticol/balance9-expected.txt: Added.
* fast/multicol/newmulticol/balance9.html: Added.
* fast/multicol/newmulticol/cell-shrinkback-expected.html: Added.
* fast/multicol/newmulticol/cell-shrinkback.html: Added.
* fast/multicol/newmulticol/columns-shorthand-parsing-expected.html: Added.
* fast/multicol/newmulticol/columns-shorthand-parsing.html: Added.
* fast/multicol/newmulticol/orphans-and-widows-balance-expected.txt: Added.
* fast/multicol/newmulticol/orphans-and-widows-balance.html: Added.
* fast/multicol/newmulticol/single-line-expected.html: Added.
* fast/multicol/newmulticol/single-line.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][Mac] Disable QTKit video on OS X.
https://bugs.webkit.org/show_bug.cgi?id=117591

Reviewed by Tor Arne Vestbø.

Source/WebCore:

Deployment of the same Qt binaries to different
Mac OS X version makes it impossible to link against
the correct WebKitSystemInterface version at build time.

No new tests, no behavioural change.

* WebCore.pri:

Tools:

Deployment of Qt binaries to different Mac OS X
platform version makes it impossible to link against
the correct version of the WebKitSystemInterface library,
so we need to disable QTKit for media elements.

* qmake/mkspecs/features/features.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Background Blending] Gradients don't blend with any of the layers behind.
First, allow the layers behind opaque gradients to be drawn, then add the blending filters
when working with gradients.

Source/WebCore:

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

Patch by Mihai Tica <mitica@adobe.com> on 2013-06-13
Reviewed by Dirk Schulze.

Tests: css3/compositing/background-blend-mode-gradient-color.html
       css3/compositing/background-blend-mode-gradient-gradient.html
       css3/compositing/background-blend-mode-gradient-image.html
       css3/compositing/background-blend-mode-multiple-background-layers.html

* platform/graphics/GeneratorGeneratedImage.cpp:
(WebCore::GeneratorGeneratedImage::draw):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintFillLayers):

LayoutTests:

https://bugs.webkit.org/show_bug.cgi?id=117532
Patch by Mihai Tica <mitica@adobe.com> on 2013-06-13
Reviewed by Dirk Schulze.

* css3/compositing/background-blend-mode-gradient-color-expected.txt: Added.
* css3/compositing/background-blend-mode-gradient-color.html: Added.
* css3/compositing/background-blend-mode-gradient-gradient-expected.txt: Added.
* css3/compositing/background-blend-mode-gradient-gradient.html: Added.
* css3/compositing/background-blend-mode-gradient-image-expected.txt: Added.
* css3/compositing/background-blend-mode-gradient-image.html: Added.
* css3/compositing/background-blend-mode-multiple-background-layers-expected.txt: Added.
* css3/compositing/background-blend-mode-multiple-background-layers.html: Added.
* platform/mac/css3/compositing/background-blend-mode-gradient-color-expected.png: Added.
* platform/mac/css3/compositing/background-blend-mode-gradient-gradient-expected.png: Added.
* platform/mac/css3/compositing/background-blend-mode-gradient-image-expected.png: Added.
* platform/mac/css3/compositing/background-blend-mode-multiple-background-layers-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151547 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Setting overflow:hidden on position:absolute does not repaint hidden content
https://bugs.webkit.org/show_bug.cgi?id=116994

Patch by Yuki Sekiguchi <yuki.sekiguchi@access-company.com> on 2013-06-13
Reviewed by Simon Fraser.

Source/WebCore:

Since a container which has overflow clip of RenderBox which has self painting layer doesn't have a rect of the RenderBox as visual overflow,
the container should not clip request repainting rect of the RenderBox.

Test: fast/repaint/change-overflow-and-display-of-relative.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldUseClipForRepaint): If this has self painting layer, we should not clip for repaint.
* rendering/RenderLayerModelObject.h:

LayoutTests:

* fast/repaint/change-overflow-and-display-of-relative-expected.txt: Added.
* fast/repaint/change-overflow-and-display-of-relative.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151549 268f45cc-cd09-0410-ab3c-d52691b4dbfc