Refactor checking log channel state in MediaPlayerPrivateGStreamerBase.
https://bugs.webkit.org/show_bug.cgi?id=130241

Reviewed by Philippe Normand.

The channel was passed around only to check its state. Cleaned this up
by adding a method to check whether a log channel is enabled.

* platform/Logging.cpp:
(WebCore::isLogChannelEnabled):
* platform/Logging.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):


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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening

Update expectation of table-detection.html after r165535.

* platform/efl-wk2/accessibility/table-detection-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] test_ewk2_application_cache_manager is flaky
https://bugs.webkit.org/show_bug.cgi?id=130501

Reviewed by Gyuyoung Kim.

* UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
(timerCallback): Return ECORE_CALLBACK_CANCEL to clear the timer.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ARM64] Fix assembler build issues and add cacheFlush support for Linux
https://bugs.webkit.org/show_bug.cgi?id=130502

Reviewed by Michael Saboff.

Add limits.h for INT_MIN in ARM64Assembler(). Delete shouldBlindForSpecificArch(uintptr_t)
because on ARM64 uint64_t and uintptr_t is the same with GCC and Clang as well.
Add cacheFlush support for Linux.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::linuxPageFlush):
(JSC::ARM64Assembler::cacheFlush):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::shouldBlindForSpecificArch):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][GTK] Get CMake to find Freetype2 properly
https://bugs.webkit.org/show_bug.cgi?id=130150

Reviewed by Csaba Osztrogonác.

Newer versions of CMake are not able to find Freetype2 correctly.
FindFreetype2.cmake checks for the version number in freetype.h header, since it seems that bug exists in
freetype2 repo, because a completely different version number is found in freetype2.pc.

.:

* Source/cmake/FindFreetype2.cmake: Added.
* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

* PlatformEfl.cmake:
* PlatformGTK.cmake:

Source/WebKit:

* PlatformEfl.cmake:

Source/WebKit2:

* PlatformEfl.cmake:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: Nested layers with subpixel accumulation paint to wrong position.
https://bugs.webkit.org/show_bug.cgi?id=130153

Reviewed by Simon Fraser.

Subpixels (fractional device pixels here) can accumulate through nested layers. Subpixels
need to be propagated through the layer tree so that painting coordinates match layout coordinates.

Subpixel accumulation through nesting (absolute positioning, 2x display):
non-compositing case:
(nested boxes)  (layout pos) (norm.paint pos) (translate accumulation, subpixel accumulation, final paint pos)
div -> top: 1.3px   1.3px     1.5px      1.5px 0.2px -> snapped 0.0px -> 1.5px
 div -> top: 1.3px   2.6px     2.5px      3.0px 0.4px -> snapped 0.5px -> 2.5px
  div -> top: 1.3px   3.9px     4.0px      4.5px 0.6px -> snapped 0.5px -> 4.0px
   div -> top: 1.3px   5.2px     5.0px      6.0px 0.8px -> snapped 1.0px -> 5.0px

compositing case:
(nested boxes)  (layout pos) (norm.paint pos) (device pixel offset + fractional offset, final pos)
div -> top: 1.3px   1.3px      1.5px      1.0px + 0.3px -> snapped -> 1.5px
 div -> top: 1.3px   2.6px      2.5px      2.5px + 0.1px -> snapped -> 2.5px
  div -> top: 1.3px   3.9px      4.0px      3.5px + 0.4px -> snapped -> 4.0px
   div -> top: 1.3px   5.2px      5.0px      5.0px + 0.2px -> snapped -> 5.0px

Source/WebCore:

Tests: compositing/hidpi-nested-compositing-layers-with-subpixel-accumulation.html
       fast/layers/hidpi-nested-layers-with-subpixel-accumulation.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerByApplyingTransform):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
* rendering/RenderLayerBacking.h:
(WebCore::RenderLayerBacking::devicePixelFractionFromRenderer):

LayoutTests:

* compositing/hidpi-nested-compositing-layers-with-subpixel-accumulation-expected.html: Added.
* compositing/hidpi-nested-compositing-layers-with-subpixel-accumulation.html: Added.
* fast/layers/hidpi-nested-layers-with-subpixel-accumulation-expected.html: Added.
* fast/layers/hidpi-nested-layers-with-subpixel-accumulation.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] The height of a scrollable element flowed inside a scrollable region is not computed correctly
https://bugs.webkit.org/show_bug.cgi?id=129487

Reviewed by Andrei Bucur.

Source/WebCore:

When propagating the layout overflow from the flowed element up to the flow thread itself,
the region's logical bottom padding and the element's logical bottom margin must be taken into consideration.
However, if the flowed element has overflow, the overflow will be painted over the region's padding
and the element's margin, in order to be compatible with the non-regions case.
More info can be found here: http://lists.w3.org/Archives/Public/www-style/2014Jan/0089.html

Tests: fast/regions/scrollable-region-content-size-horiz-bt.html
       fast/regions/scrollable-region-content-size-no-overflow-horiz-bt.html
       fast/regions/scrollable-region-content-size-no-overflow-vert-rl.html
       fast/regions/scrollable-region-content-size-no-overflow.html
       fast/regions/scrollable-region-content-size-relative.html
       fast/regions/scrollable-region-content-size-vert-rl.html
       fast/regions/scrollable-region-content-size-vertical-lr.html
       fast/regions/scrollable-region-content-size.html
       fast/regions/scrollable-region-scrollable-content.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::addRegionsOverflowFromChild):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::rectFlowPortionForBox):

LayoutTests:

Added tests for different situations using scrollable regions and fixed a couple existing tests.

* fast/regions/clip-to-padding-box-margins.html: overflow-x and overflow-y cannot be hidden & visible.
* fast/regions/scrollable-last-region-expected.html: "hack" no longer needed now that the scroll content size is properly computed.
* fast/regions/scrollable-region-content-size-expected.html: Added.
* fast/regions/scrollable-region-content-size-horiz-bt-expected.html: Added.
* fast/regions/scrollable-region-content-size-horiz-bt.html: Added.
* fast/regions/scrollable-region-content-size-no-overflow-expected.html: Added.
* fast/regions/scrollable-region-content-size-no-overflow-horiz-bt-expected.html: Added.
* fast/regions/scrollable-region-content-size-no-overflow-horiz-bt.html: Added.
* fast/regions/scrollable-region-content-size-no-overflow-vert-rl-expected.html: Added.
* fast/regions/scrollable-region-content-size-no-overflow-vert-rl.html: Added.
* fast/regions/scrollable-region-content-size-no-overflow.html: Added.
* fast/regions/scrollable-region-content-size-relative-expected.html: Added.
* fast/regions/scrollable-region-content-size-relative.html: Added.
* fast/regions/scrollable-region-content-size-vert-rl-expected.html: Added.
* fast/regions/scrollable-region-content-size-vert-rl.html: Added.
* fast/regions/scrollable-region-content-size-vertical-lr-expected.html: Added.
* fast/regions/scrollable-region-content-size-vertical-lr.html: Added.
* fast/regions/scrollable-region-content-size.html: Added.
* fast/regions/scrollable-region-scrollable-content-expected.html: Added.
* fast/regions/scrollable-region-scrollable-content.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165964 268f45cc-cd09-0410-ab3c-d52691b4dbfc
"input" event is not fired when changing a select element's value
https://bugs.webkit.org/show_bug.cgi?id=117526

Patch by Lorenzo Tilve <ltilve@igalia.com> on 2014-03-20
Reviewed by Antti Koivisto.

Source/WebCore:

Add a call to dispatch input event when listbox or menulist
values are modified.

According to the spec: "When the user agent is to send select update
notifications, queue a task to first fire a simple even that bubbles
named input at the select element, and then fire a simple event that
bubbles named change at the select element, using the user interaction
task source as the task source."

Tests: fast/forms/select/listbox-oninput-fired.html
       fast/forms/select/menulist-oninput-fired.html

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxOnChange):
(WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):

LayoutTests:

Add tests to verify that input event is dispatched when listbox
or menulist values are modified.

* fast/forms/select/listbox-oninput-fired-expected.txt: Added.
* fast/forms/select/listbox-oninput-fired.html: Added.
* fast/forms/select/menulist-oninput-fired-expected.txt: Added.
* fast/forms/select/menulist-oninput-fired.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r165962.
https://bugs.webkit.org/show_bug.cgi?id=130512

It broke the build (Requested by Ossy on #webkit).

Reverted changeset:

.:

"[EFL][GTK] Get CMake to find Freetype2 properly"
https://bugs.webkit.org/show_bug.cgi?id=130150
http://trac.webkit.org/changeset/165962

Source/WebCore:

"[EFL][GTK] Get CMake to find Freetype2 properly"
https://bugs.webkit.org/show_bug.cgi?id=130150
http://trac.webkit.org/changeset/165962

Source/WebKit:

"[EFL][GTK] Get CMake to find Freetype2 properly"
https://bugs.webkit.org/show_bug.cgi?id=130150
http://trac.webkit.org/changeset/165962

Source/WebKit2:

"[EFL][GTK] Get CMake to find Freetype2 properly"
https://bugs.webkit.org/show_bug.cgi?id=130150
http://trac.webkit.org/changeset/165962

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] [CMake] Do not compile ProxyResolverSoup.cpp
https://bugs.webkit.org/show_bug.cgi?id=130516

Reviewed by Sergio Villar Senin.

* PlatformGTK.cmake: Remove the file from the source list.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove remaining GTK+ unused parameter warnings from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=130518

Reviewed by Sergio Villar Senin.

Fix almost all unused parameter warnings in the WebKit2GTK+ build.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Remove "visibility:hidden" from overflow-scrollable* tests
https://bugs.webkit.org/show_bug.cgi?id=130510

Reviewed by Andrei Bucur.

The visibility hidden option was needed to prevent these tests from failing before the
visual overflow was properly implemented (bug 118665). It is now no longer required.

* fast/regions/overflow-scrollable-rel-pos-fragment-expected.html:
* fast/regions/overflow-scrollable-rel-pos-fragment.html:
* fast/regions/overflow-scrollable-rotated-fragment-expected.html:
* fast/regions/overflow-scrollable-rotated-fragment.html:
* fast/regions/overflow-scrollable-unsplittable-fragment-expected.html:
* fast/regions/overflow-scrollable-unsplittable-fragment.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Blending] Blending operation is not isolated when setting z-index on parent from javascript
https://bugs.webkit.org/show_bug.cgi?id=129307

Patch by Mihai Tica <mitica@adobe.com> on 2014-03-20
Reviewed by Dean Jackson.

Source/WebCore:

Reimplement the logic behind isolating blend modes. The blending operation should be limited to the
contents of the parent stacking context. The proposed solution implies adding logic in updateDescendantDependentFlags,
to track child elements that have blending and create a transparency layer that triggers isolation.

Tests: css3/compositing/blend-mode-background.html
       fast/repaint/blend-mode-isolate-stacking-context.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer): Remove old members, add new members to constructor.
(WebCore::RenderLayer::updateBlendMode): Update parent stacking context isolation on blend mode change.
(WebCore::RenderLayer::updateNonCompositedParentStackingContextHasBlendedChild):
- Set m_hasBlendedElementInChildStackingContext for the non composited parent stacking context.
(WebCore::RenderLayer::dirtyAncestorParentStackingContextHasBlendedElement):
- Set flag so isolation should be considered in updateDescendantDependentFlags.
(WebCore::RenderLayer::nonCompositedParentStackingContextHasBlendedChild):
- Return whether the non composited parent stacking context isolates blending.
(WebCore::RenderLayer::updateDescendantDependentFlags): Add logic for isolating blending.
(WebCore::RenderLayer::addChild): Call to updateNonCompositedParentStackingContextHasBlendedChild if needed.
(WebCore::RenderLayer::removeChild): Call to dirtyAncestorParentStackingContextHasBlendedElement if needed.
(WebCore::RenderLayer::updateStackingContextsAfterStyleChange): Update isolation when a stacking context was set or unset.
(WebCore::RenderLayer::styleChanged): Removed oldStyle parameter from updateBlendMode call.
 Update parent stacking context isolation on blend mode change.
* rendering/RenderLayer.h:
- Add members, getters and setters for tracking whether the element has a blended child:
    - m_hasBlendedElementInChildStackingContext
    - m_hasBlendedElementInChildStackingContextStatusDirty
- Removed m_updateParentStackingContextShouldIsolateBlendingDirty (replaced with m_hasBlendedElementInChildStackingContextStatusDirty)
- Removed m_isolatesBlending (replaced with m_hasBlendedElementInChildStackingContext)
- Updated the isolatesBlending method to return true only when the element is a stacking context and has a blended child.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements): Removed layer.updateParentStackingContextShouldIsolateBlending call.

LayoutTests:

Test if setting or unsetting stacking context or blend mode from script correctly updates blending
isolation.

* css3/compositing/blend-mode-background.html: Added.
* fast/repaint/blend-mode-isolate-stacking-context-expected.txt: Added.
* fast/repaint/blend-mode-isolate-stacking-context.html: Added.
* platform/mac/css3/compositing/blend-mode-background-expected.png: Added.
* platform/mac/css3/compositing/blend-mode-background-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Support MediaDocument when building with PLUGIN_PROXY_FOR_VIDEO
https://bugs.webkit.org/show_bug.cgi?id=130520

Reviewed by Jer Noble.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument): Check the isVideoPluginProxyEnabled setting
    when building with ENABLE_PLUGIN_PROXY_FOR_VIDEO.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Support asynchronous NSTextInputClient
https://bugs.webkit.org/show_bug.cgi?id=130479

Reviewed by Anders Carlsson.

The implementation is currently disabled, pending lower level support.
Most of the code is not under compile time guard however, to facilitate cross-platform
reuse, or at least under a PLATFORM(COCOA) guard to share the code with iOS.

* UIProcess/API/mac/WKView.mm: Added a compile time branch for USE(ASYNC_NSTEXTINPUTCLIENT).
We still implement sync NSTextInputClient here, in order to get assertions when
its methods are unexpectedly called.
The new code first sends an event to input method asynchronously, handling any callbacks
that may arrive. During this time, we no longer care about WKViewInterpretKeyEventsParameters
at all. Once done, we interpret key bindings synchronously, collecting them into
a vector.

* UIProcess/API/mac/WKViewInternal.h: We no longer expose _interpretKeyEvent outside
WKView.

* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
Added async calls and callbacks. Removed unnecessary and slightly harmful .get() when moving
a callback pointer into map. Moved insertDictatedText() and getAttributedSubstringFromRange()
from PLATFORM(COCOA) to PLATFORM(MAC), because they are unused and unimplemented on
iOS, and unlikely to be needed any time soon. Changed USE(APPKIT) to PLATFORM(MAC),
because that's more accurate in this case (nothing depends on AppKit, it's just code
that we only need on Mac).

* UIProcess/WebPageProxy.messages.in: Added messages for new async IM responses.

* UIProcess/ios/WebPageProxyIOS.mm: Removed insertDictatedText() and getAttributedSubstringFromRange().

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::insertDictatedTextAsync):
(WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
(WebKit::WebPageProxy::attributedStringForCharacterRangeCallback):
Added async calls and callbacks that are Mac only.

* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
Added async implementations (which are essentially the same as sync ones, sadly).

* WebProcess/WebPage/WebPage.messages.in: Added async messages, moved some messages
under PLATFORM(MAC).

* WebProcess/WebPage/ios/WebPageIOS.mm: More of deleting functions that are Mac only,
and cannot be easily implemented in WebPage.cpp with shared code.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Clang build fix for the GTK port after r165952.

* wtf/gobject/GMainLoopSource.h: Include the <functional> header for the std::function<> objects.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK Gardening.

Update expectation of accessibility/table-detection.html after r165535.
Update expectation of accessibility/aria-hidden-false-works-in-subtrees.html.

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-03-20

* platform/gtk/accessibility/aria-hidden-false-works-in-subtrees-expected.txt:
* platform/gtk/accessibility/table-detection-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][CMake] Add support for building with Clang
https://bugs.webkit.org/show_bug.cgi?id=130260

Reviewed by Martin Robinson.

.: 

* Source/PlatformGTK.cmake: Run the generate-gtkdoc script with the CFLAGS env set
to the list C compiler flags as constructed by CMake.
* Source/cmake/OptionsCommon.cmake: When building with Clang, use the -Qunused-arguments
compiler option to suppress verbose warnings about arguments that went unused by the driver.
* Source/cmake/OptionsGTK.cmake: Use -fno-omit-frame-pointer for both GCC and Clang.
-fno-tree-dce should be used only for GCC.
* Source/cmake/gtest/CMakeLists.txt: When building with Clang the GTest framework
should be built with GTEST_HAS_TR1_TUPLE macro defined to 0 to avoid build failures.

Tools: 

* TestWebKitAPI/CMakeLists.txt: When building with Clang TestWebKitAPI should be
built with GTEST_HAS_TR1_TUPLE defined to 0 to avoid build failures occuring in the
included GTest framework headers.
* gtk/generate-gtkdoc:
(prepare_environment_for_gtkdoc_generation): Don't modify the CFLAGS env anymore
in case of using Clang since that is now set by the CMake rule.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Canvas methods clip/fill/stroke should not except 0 argument
https://bugs.webkit.org/show_bug.cgi?id=130497

Reviewed by Dean Jackson.

Source/WebCore:

Do not allow nullable argument for fill/stroke/clip.

No new tests. Updated existing tests.

* html/canvas/CanvasRenderingContext2D.idl:

LayoutTests:

Add more exception tests for fill/stroke/clip.

* fast/canvas/canvas-clip-path-expected.txt:
* fast/canvas/canvas-fill-path-expected.txt:
* fast/canvas/canvas-stroke-path-expected.txt:
* fast/canvas/script-tests/canvas-clip-path.js:
* fast/canvas/script-tests/canvas-fill-path.js:
* fast/canvas/script-tests/canvas-stroke-path.js:


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