LayoutUnit should round half consistently, not away from zero
https://bugs.webkit.org/show_bug.cgi?id=107208

Reviewed by Eric Seidel.

Source/WebCore:

The current implementation of LayoutUnit::round() always rounds half away from zero. This can result in
a shift of 1 pixel moving an element aligned at a half-pixel by 2. This problem is particularly common with
RenderLayers, which pass the sub-pixel accumulation into their renderers after translating the graphics
context passed in by their rounded location. This changes round() to always round 0.5 up.

Test: fast/sub-pixel/sub-pixel-root-layer.html

* platform/LayoutUnit.h:
(WebCore::LayoutUnit::round): Always round 0.5 up.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents): We no longer need to prevent rootLayers from passing in a
sub-pixel offset. This eliminates the shifting of elements when applying translateZ(0) or similar.

Tools:

* TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp: Updating to reflect and
cover this change in rounding behavior.

LayoutTests:

* fast/sub-pixel/sub-pixel-root-layer-expected.html: Added.
* fast/sub-pixel/sub-pixel-root-layer.html: Added.
* platform/chromium-linux/fast/regions/overflow-moving-below-floats-in-variable-width-regions-expected.png:
* platform/chromium-linux/fast/regions/overflow-size-change-in-variable-width-regions-expected.png:
* platform/chromium-linux/fast/regions/overflow-size-change-with-stacking-context-expected.png:
* platform/chromium-win/fast/regions/overflow-moving-below-floats-in-variable-width-regions-expected.txt:
* platform/chromium-win/fast/regions/overflow-size-change-in-variable-width-regions-expected.txt:
* platform/chromium-win/fast/regions/overflow-size-change-with-stacking-context-expected.txt:
* platform/chromium/TestExpectations:
* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Text Autosizing: don't autosize headers with multiple inline links.
https://bugs.webkit.org/show_bug.cgi?id=106792

Patch by Tim Volodine <timvolodine@chromium.org> on 2013-01-18
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

This patch includes code for detecting rows of links typically seen
in headers or footers of webpages. Such rows of links should not be
autosized.

The heuristics to detect such rows of links are based on the appearance
of headers in most websites: i.e. links are inline, there are at least three
of them, they should have the same font size with possibly only short textual
separators between them (max 3 characters) and there should be no line breaks
(i.e. <br> elements) between them.

Tests: fast/text-autosizing/header-li-links-autosizing.html
       fast/text-autosizing/header-links-autosizing-different-fontsize.html
       fast/text-autosizing/header-links-autosizing.html

* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::containerShouldBeAutosized):
(WebCore::TextAutosizer::containerIsRowOfLinks):
(WebCore):
* rendering/TextAutosizer.h:

LayoutTests:

* fast/text-autosizing/header-li-links-autosizing-expected.html: Added.
* fast/text-autosizing/header-li-links-autosizing.html: Added.
* fast/text-autosizing/header-links-autosizing-different-fontsize-expected.html: Added.
* fast/text-autosizing/header-links-autosizing-different-fontsize.html: Added.
* fast/text-autosizing/header-links-autosizing-expected.html: Added.
* fast/text-autosizing/header-links-autosizing.html: Added.

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