Text dragging can scroll overflow:hidden boxes https://bugs.webkit.org/show_bug.cgi?id=119760

Reviewed by Darin Adler.
Patch by Antonio Gomes <a1.gomes@sisa.samsung.com>

Source/WebCore:

Consider the case of the following HTML:
<div style="overflow:hidden; width: 100px; height: 100px" >
  <input id="input" type="text" size=10 value="any text here!"/>
  <button style="position:relative; top: 100px; left: 100px"/>
</div>

If ones starts a text selection by dragging the mouse from within the input
field, and continues to drag beyong the outer div boundary, the latter will
be scrolled no matter its overflow:hidden style.
That happens because when the autoscroll has started, it gets propagated up
to the current layer's parent layer, instead of the to current layer's enclosing
scrollable layer.

Patch fixes the issue by hardening the way scrolling is
propagated upwards when autoscroll is being performed.

RenderLayer::enclosingScrollableLayer method also got rewritten
in terms of RenderLayer tree traversing, instead of RenderObject tree.
The rewrite adds support for cross frame upwards traversal.

Test: fast/events/autoscroll-upwards-propagation.html

* rendering/RenderLayer.cpp:
(WebCore::parentLayerCrossFrame):
(WebCore::RenderLayer::enclosingScrollableLayer):
(WebCore::RenderLayer::scrollRectToVisible):

LayoutTests:

* fast/events/autoscroll-upwards-propagation-expected.txt: Added.
* fast/events/autoscroll-upwards-propagation.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Harden RenderBox::canBeScrolledAndHasScrollableArea logic https://bugs.webkit.org/show_bug.cgi?id=104373

Reviewed by Simon Fraser.
Patch by Antonio Gomes <a1.gomes@sisa.samsung.com>

Source/WebCore:

Previously if a say div has a overflown content on 'y' but is
styled as "overflow-x: auto; overflow-y: hidden", RenderBox::canBeProgramaticallyScrolled
would still return true. It interfers, among other things, with the way
autoscroll works.

Patch fixes it by adding two helper methods to RenderBox class in order to verify a box'
scrollability in a given axis (x or y); They are used when checking if a given box is in
fact programatically scrollable.

Test: fast/events/autoscroll-overflow-hidden-longhands.html

WebKit autoscroll behavior now matches Firefox and Opera12 (pre-blink)
in that sense.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::canBeProgramaticallyScrolled):
* rendering/RenderBox.h:
(WebCore::RenderBox::hasScrollableOverflowX):
(WebCore::RenderBox::hasScrollableOverflowY):

LayoutTests:

Patch adds a test to ensure autoscrolling only happens on a given
axis if it is scrollable in that direction, according to its style.

* fast/events/autoscroll-overflow-hidden-longhands-expected.txt: Added.
* fast/events/autoscroll-overflow-hidden-longhands.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Font’s fast code path doesn’t handle partial runs correctly when kerning or ligatures are enabled
https://bugs.webkit.org/show_bug.cgi?id=100050

Reviewed by Antti Koivisto.

Source/WebCore:

Always let WidthIterator iterate over an entire TextRun to avoid problems
with pixel rounding or shaping on partial runs.

This fix is necessary for Qt because the complex font-path can not disable
shaping, leading to the complex path painting slighly different from the
fast path, which messes up selection painting.

No change in functionality, no new tests.

* platform/graphics/Font.cpp:
(WebCore::Font::drawText):
(WebCore::Font::drawEmphasisMarks):
(WebCore::Font::selectionRectForText):
(WebCore::Font::offsetForPosition):
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::getGlyphsAndAdvancesForSimpleText):
(WebCore::Font::selectionRectForSimpleText):
(WebCore::Font::offsetForPositionForSimpleText):
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::add):
(GlyphBuffer):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal):
* platform/graphics/WidthIterator.h:
(WidthIterator): Removed now unused advanceOneCharacter method.

LayoutTests:

* fast/text/resources/PTS55F-webfont.ttf: Added.
* fast/text/partial-textruns-expected.html: Added.
* fast/text/partial-textruns.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Remove unused code path in PluginView
https://bugs.webkit.org/show_bug.cgi?id=113173

Patch by Jae Hyun Park <jae.park@company100.net> on 2013-08-21
Reviewed by Anders Carlsson.

m_platformLayer in PluginView has been removed in r121710, but there are
still some leftover code path related to m_platformLayer. This patch
removes unused code path.

No new tests, removing unused code paths.

* plugins/PluginView.h:
(PluginView):
* plugins/qt/PluginViewQt.cpp:
(WebCore::PluginView::updatePluginWidget):
(WebCore::PluginView::paint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120109> [curl] only include WebCoreBundleWin on Windows

Patch by Róbert Sipka <sipka@inf.u-szeged.hu> on 2013-08-21
Reviewed by Brent Fulgham.

The WebCoreBundleWin is a windows specific file, it is only needed on Windows.

* platform/network/curl/ResourceHandleManager.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Suppress irrelevant or known leaks for Valgrind
https://bugs.webkit.org/show_bug.cgi?id=119448

Patch by Brian Holt <brian.holt@samsung.com> on 2013-08-21
Reviewed by Martin Robinson.

Add a suppressions file to suppress known leaks for Valgrind.
Valgrind also takes longer when using suppressions and
times out unless the driver timeout is increased.

* Scripts/valgrind/suppressions.txt: Added.
* Scripts/webkitpy/port/gtk.py:
(GtkPort.driver_stop_timeout):
(GtkPort.setup_environ_for_server):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120106> Fix V_DFGOperation_EJPP signature in DFG.

Patch by Julien Brianceau <jbrianceau@nds.com> on 2013-08-21
Reviewed by Geoffrey Garen.

* dfg/DFGOperations.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
In RenderTableCell::paintCollapsedBorders() check surrounding cells using physical rather than logical direction
https://bugs.webkit.org/show_bug.cgi?id=120074

Reviewed by David Hyatt.

No new tests, covered by existing tests.

The functions cellAbove(), cellBelow() etc. check the logical rather than the physical direction but they're being
used to decide the painting of the physical borders of the cell. As we paint all four sides of every cell, and
the borders of adjoining cells twice over, this has no impact on painting currently but making the check consistent
in its treatment of physical and logical direction will help with webkit.org/b/119759 and make the code less confusing
to the next guy.

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::cellAtLeft):
(WebCore::RenderTableCell::cellAtRight):
(WebCore::RenderTableCell::cellAtTop):
(WebCore::RenderTableCell::cellAtBottom):
(WebCore::RenderTableCell::paintCollapsedBorders):
* rendering/RenderTableCell.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120113> [Windows] Enable CSS_IMAGE_SET

Reviewed by Anders Carlsson.

* win/tools/vsprops/FeatureDefines.props: Enable CSS_IMAGE_SET feature.
* win/tools/vsprops/FeatureDefinesCairo.props: Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120113> [Windows] Enable CSS_IMAGE_SET

Reviewed by Anders Carlsson.

We can now activate:
fast/css/image-set-parsing.html
fast/css/image-set-parsing-invalid.html

* WebCore.vcxproj/WebCore.vcxproj: Add missing image set implementation files.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* css/CSSAllInOne.cpp: Add missing CSSImageSetValue.cpp
* rendering/style/StyleAllInOne.cpp: Add missing StyeCachedImageSet.cpp



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120113> Enable CSS_IMAGE_SET

Reviewed by Anders Carlsson.

* platform/win/TestExpectations: Turn on two CSS_IMAGE_SET-based tests that
now pass on Windows.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120116> [GTK] Fix a typo in ActivateFontsGtk.cpp

Reviewed by Andreas Kling.

* WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
(WTR::initializeFontConfigSetting): Fix a typo - inititialize -> initialize.
(WTR::activateFonts): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed gardening. One more CSS_IMAGE_SET test can be activated.

* platform/win/TestExpectations: We can reactivate cssom/cssvalue-comparison.html



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
../WebInspectorUI: <http://webkit.org/b/120098> [Windows] Enable the New Web Inspector

Reviewed by Brian Weinstein.

Add a new project to copy files to the appropriate spots in the
Windows port.

* WebInspectorUI.vcxproj: Added.
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj: Added.
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters: Added.
* WebInspectorUI.vcxproj/WebInspectorUIPostBuild.cmd: Added.
* WebInspectorUI.vcxproj/WebInspectorUIPreBuild.cmd: Added.

../WebKit: <https://webkit.org/b/120098> [Windows] Enable the new Web Inspector

Reviewed by Brian Weinstein.

* WebKit.vcxproj/WebKit.sln: Add reference to the new WebInspectorUI
project so that it will be included in new distributions.

../WebKit/win: <https://webkit.org/b/120098> [Windows] Enable the New Web Inspector

Reviewed by Brian Weinstein.

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorClient::openInspectorFrontend): Use the new inspector
if present in the WebKit distribution.
(WebInspectorFrontendClient::localizedStringsURL): Use the new
Web Inspector's localized strings (if present).


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        REGRESSION (r145458?): WebProcess doesn't respect UI process localization
        https://bugs.webkit.org/show_bug.cgi?id=120096

        Reviewed by Darin Adler.

        We used to get into a situation where CFBundle thought that we had no good localization,
        and used one passed as default. This is never the case with mixed localizations,
        so default is just ignored now.

        I think that the previous behavior was a bit of a hack. As WebProcess is not localized,
        it's more honest to say that we want mixed localizations, and force the language
        to match UI process localization.

        * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessEntryPoint.h:
        (WebKit::ChildProcessMain): Don't set default localization, it's not taken into
        consideration unless all other attempts to compute bundle localization fail.

        * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::createProcess): Pass
        UI process localization as -AppleLanguages argument, so that Core Foundation uses
        that instead of actual user languages. We want to match UI process localization.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed gardening: WebInspector should always be enabled for WinLauncher.

* WinLauncher/WinLauncher.cpp:
(setToDefaultPreferences): Activate Developer Extras on Release (as well as Debug) builds.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r127163): Respect clearance set on ancestors when placing floats
https://bugs.webkit.org/show_bug.cgi?id=119979

Reviewed by David Hyatt.

Source/WebCore:

If a float has a self-collapsing ancestor with clearance then it needs to respect
that clearance when placing itself on the line.

Test: fast/block/margin-collapse/self-collapsing-block-with-float-descendant.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::marginOffsetForSelfCollapsingBlock):
* rendering/RenderBlock.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
* rendering/RenderBox.h:
(WebCore::RenderBox::previousInFlowSiblingBox):

LayoutTests:

* fast/block/margin-collapse/self-collapsing-block-with-float-descendant-expected.html: Added.
* fast/block/margin-collapse/self-collapsing-block-with-float-descendant.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow opacity to apply to custom scrollbars
https://bugs.webkit.org/show_bug.cgi?id=120104

Source/WebCore:

Reviewed by David Hyatt.

Opacity was ignored custom scrollbar pseudoelements because custom scrollbar
renderers never create layers, and opacity is normally handled by the RenderLayer code.

Fix by having RenderScrollbarTheme and RenderScrollbarPart do the transparency
layers necessary for opacity. RenderScrollbarPart handles opacity for individual
parts.

Because ScrollbarThemeComposite::paint() renders the parts on after another (with
no nesting), opacity handling for the entire scrollbar needs special-casing.
This is done by willPaintScrollbar()/didPaintScrollbar() on the theme.
RenderScrollbarTheme consults the opacity the scrollbar (which we get from
the ScrollbarBGPart renderer) to decide whether to set up a transparency layer.

Test: scrollbars/scrollbar-parts-opacity.html

* platform/ScrollbarThemeComposite.cpp:
(WebCore::ScrollbarThemeComposite::paint):
* platform/ScrollbarThemeComposite.h:
(WebCore::ScrollbarThemeComposite::willPaintScrollbar):
(WebCore::ScrollbarThemeComposite::didPaintScrollbar):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::opacity):
* rendering/RenderScrollbar.h:
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::paintIntoRect):
* rendering/RenderScrollbarTheme.cpp:
(WebCore::RenderScrollbarTheme::willPaintScrollbar):
(WebCore::RenderScrollbarTheme::didPaintScrollbar):
* rendering/RenderScrollbarTheme.h:

LayoutTests:

Reviewed by David Hyatt.

Ref test for custom scrollbars with opacity on the bar itself,
and on the thumb.

* scrollbars/scrollbar-parts-opacity-expected.html: Added.
* scrollbars/scrollbar-parts-opacity.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120118> Frame::animation() should return a reference.

Reviewed by Anders Carlsson.

Frame::m_animationController is never null.
Also changed RenderObject::animation() to return a reference since it's just a wrapper
around RenderObject::frame()->animation() with no null checking of frame().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/120099> Assertion failure in JSC::SlotVisitor::copyLater when marking DataView

Mark fast/canvas/webgl/array-message-passing.html as crashing on debug, for now.

* platform/mac/TestExpectations:


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