[EFL] Refactor theme to choose whether to support foreground color of selection
https://bugs.webkit.org/show_bug.cgi?id=102037

Patch by Ryuan Choi <ryuan.choi@gmail.com> on 2012-11-28
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

If foreground selection color is supported, selected text is painted to
SelectionForegroundColor instead of text color. If not, text can be painted
to text color.

However, EFL port does not have a way to disable support of foreground
selection color. So this patch refactors color classes of theme from
active and inactive to foreground and background in order to disable support
of foreground selection color when foreground color class is not specified.

* platform/efl/RenderThemeEfl.cpp:
(WebCore::fillColorsFromEdjeClass):
Returned false without error message when colorClass is not specified.
(WebCore::RenderThemeEfl::setColorFromThemeClass):
(WebCore::RenderThemeEfl::loadTheme):
(WebCore::RenderThemeEfl::RenderThemeEfl):
(WebCore::RenderThemeEfl::supportsSelectionForegroundColors):
(WebCore):
* platform/efl/RenderThemeEfl.h:
(RenderThemeEfl):

Source/WebKit/efl:

* DefaultTheme/default.edc:
Refactored color classes from active/inactive to foreground/background.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Use mutex locker in wakeUp() to ensure thread-safety.
https://bugs.webkit.org/show_bug.cgi?id=101132

Patch by Byungwoo Lee <bw80.lee@samsung.com> on 2012-11-28
Reviewed by Gyuyoung Kim.

Add mutex locker for the ecore pipe to ensure thread-safety of
RunLoop::wakeUp().

RunLoop::wakeUp() can be called by multiple thread. It uses
ecore_pipe_write() function but the function is not thread-safe.

* platform/RunLoop.h:
(RunLoop):
* platform/efl/RunLoopEfl.cpp:
(WebCore::RunLoop::wakeUp):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] add flaky results after r135935
https://bugs.webkit.org/show_bug.cgi?id=103514

Unreviewed gardening: add flaky results after r135935 enabled
loads of reftests. Also move the existing flaky results from efl
to efl-wk2 since this does not concern WK1.

Patch by Jussi Kukkonen <jussi.kukkonen@intel.com> on 2012-11-28

* platform/efl-wk2/TestExpectations:
* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Remove setVersion from WK API
https://bugs.webkit.org/show_bug.cgi?id=103456

Reviewed by Darin Fisher.

These are the last vestiges of this ancient API. The bulk of the
removal was done in bug 94972.

* public/WebIDBCallbacks.h:
* public/WebIDBDatabase.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r135962): ASSERTION FAILED: !m_pedningSyncBackingStores.contains(layer)
https://bugs.webkit.org/show_bug.cgi?id=103498

Reviewed by Kenneth Rohde Christiansen.

We hit the !m_pedningSyncBackingStores.contains(layer) assertion
in LayerTreeRenderer when 2 asynchronous backing store operations
are pending. The current code checks if the layer already has a
backing store in its guard but this is insufficient as it is not
checking the m_pendingSyncBackingStores hash for pending backing
store changes.

In this patch, we improve the guards in createBackingStoreIfNeeded()
and removeBackingStoreIfNeeded() to check not only if the layer has
already a backing store but also check m_pendingSyncBackingStores
for pending changes. This is safer and it allows for optimizations
in the cases where we have both a removal and a creation pending.
In those cases, we can simply cancel the pending operation instead
of queueing a new one.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::getBackingStore):
(WebKit::LayerTreeRenderer::createBackingStoreIfNeeded):
(WebKit::LayerTreeRenderer::removeBackingStoreIfNeeded):
(WebKit::LayerTreeRenderer::commitPendingBackingStoreOperations):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix .libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::validationMessageBadInputForNumberText().
https://bugs.webkit.org/show_bug.cgi?id=103509

Patch by Anton Obzhirov <a.obzhirov@samsung.com> on 2012-11-28
Reviewed by Philippe Normand.

GTK build fix after r136001.

* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::validationMessageBadInputForNumberText):
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add support for PlatformWebView::simulateSpacebarKeyPress() in TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=103123

Patch by Sudarsana Nagineni <sudarsana.nagineni@intel.com> on 2012-11-28
Reviewed by Laszlo Gombos.

Add support for PlatformWebView::simulateSpacebarKeyPress().
This functionality is needed by WebKit2 API test MouseMoveAfterCrash
which is going to be unskipped in bug #103252.

* TestWebKitAPI/efl/PlatformUtilities.cpp:
(TestWebKitAPI::Util::sleep):
* TestWebKitAPI/efl/PlatformWebView.cpp: Use usleep() instead of
sleep().
(TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
(TestWebKitAPI):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix gesture scrolling when the target-element of scroll-begin is removed
https://bugs.webkit.org/show_bug.cgi?id=103355

Patch by Sadrul Habib Chowdhury <sadrul@chromium.org> on 2012-11-28
Reviewed by Antonio Gomes.

Source/WebCore:

When a touch-scroll starts, the node under the touch-point gets latched, and
subsequent scroll-update events are dispatched to that node. But if the node is
removed while the gesture event is in progress (e.g. in a dynamically updated
list), then the scrolling stops, although there are enough elements to still
enable scrolling. So instead of latching on to the node immediately under the
touch point, latch on to the scrollable node under the touch point.

Test: fast/events/touch/gesture/touch-gesture-scroll-remove-node.html

* page/EventHandler.cpp:
(WebCore::getClosestScrollableNodeInDocumentIfPossible):
(WebCore):
(WebCore::EventHandler::handleWheelEvent):

LayoutTests:

Added a test that starts a touch-scroll, removes the initial element under the
touch-point, and scrolls some more, to test that the scrolling happens correctly
after the element is removed.

* fast/events/touch/gesture/touch-gesture-scroll-remove-node-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-remove-node.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Allow plugins to opt-in to receive synthetic mouse events out of touch events.
https://bugs.webkit.org/show_bug.cgi?id=103092

Patch by Sadrul Habib Chowdhury <sadrul@chromium.org> on 2012-11-28
Reviewed by Tony Chang.

Source/WebKit/chromium:

A plugin can now request to receive raw touch events, or to receive mouse events synthesized
from the touch events, or to not receive any touch events at all.

* public/WebPluginContainer.h:
(WebPluginContainer):
* src/WebInputEventConversion.cpp:
(WebKit::updateWebMouseEventFromWebCoreMouseEvent):
(WebKit::WebMouseEventBuilder::WebMouseEventBuilder):
(WebKit):
* src/WebInputEventConversion.h:
(WebMouseEventBuilder):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::setIsAcceptingTouchEvents):
(WebKit):
(WebKit::WebPluginContainerImpl::requestTouchEventType):
(WebKit::WebPluginContainerImpl::WebPluginContainerImpl):
(WebKit::WebPluginContainerImpl::~WebPluginContainerImpl):
* src/WebPluginContainerImpl.h:
(WebPluginContainerImpl):

Tools:

Update the test web-plugin to be able to opt-in to receive synthesized mouse events created
from touch events.

* DumpRenderTree/chromium/TestWebPlugin.cpp:
(parseTouchEventRequestType):
(TestWebPlugin::TestWebPlugin):
(TestWebPlugin::initialize):
* DumpRenderTree/chromium/TestWebPlugin.h:
(TestWebPlugin):

LayoutTests:

Add test for synthesized mouse events from touch (and update existing tests).

* platform/chromium/plugins/touch-events-details.html:
* platform/chromium/plugins/touch-events-synthesized-expected.txt: Added.
* platform/chromium/plugins/touch-events-synthesized.html: Copied from LayoutTests/platform/chromium/plugins/touch-events.html.
* platform/chromium/plugins/touch-events.html:
* platform/chromium/plugins/transformed-events.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removed extra definition of GLXContext.
https://bugs.webkit.org/show_bug.cgi?id=103500

Patch by Denis Nomiyama <d.nomiyama@samsung.com> on 2012-11-28
Reviewed by Martin Robinson.

A minor cleanup to remove a spare definition of GLXContext in GLContextGLX.h.

No new tests. This doesn't change any behavior.

* platform/graphics/glx/GLContextGLX.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[v8] 4% regression in dom_traverse tests
https://bugs.webkit.org/show_bug.cgi?id=102858

Unreviewed.

This patch is a manual rollout of
http://trac.webkit.org/changeset/134729. We can't do a mechanical
rollout because V8DOMWrapper::getCachedWrapper no longer exists.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r135962): m_pendingSyncBackingStores needs to be cleared in LayerTreeRenderer::purgeGLResources()
https://bugs.webkit.org/show_bug.cgi?id=103527

Reviewed by Jocelyn Turcotte.

Make sure m_pendingSyncBackingStores is cleared in
LayerTreeRenderer::purgeGLResources() to avoid trying to assign
backing store to layers after everything has been invalidated.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::purgeGLResources):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][Win] Enable usage of QTWEBKIT_PLUGIN_PATH.
https://bugs.webkit.org/show_bug.cgi?id=103529

This patch enables the same behavior for Windows
as it is currently implemented for all other operating
systems supported by Qt.
Directories listed in the environment variable
QTWEBKIT_PLUGIN_PATH are being searched for additional
plugins.
The only difference is that directories on Windows
need to be separated by a semicolon instead of a colon.

Reviewed by Kenneth Rohde Christiansen.

* plugins/win/PluginDatabaseWin.cpp:
(WebCore):
(WebCore::addQtWebKitPluginPath):
(WebCore::PluginDatabase::defaultPluginDirectories):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test svg/animations/mpath-remove-from-dependents-on-delete-crash.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=103375

Unreviewed test update.

According to the original bug, at least 4 iterations were required to
crash (without the fix). To make the test faster, I've reduced the max
iteration count to 5, rather than 10. This may not fix the timeoout
issue because it might be a real timeout, not just a slow test.

* svg/animations/mpath-remove-from-dependents-on-delete-crash.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Calling .removeCue() for a cue that was never added should raise a NOT_FOUND_ERR
https://bugs.webkit.org/show_bug.cgi?id=103412

Patch by Antoine Quint <graouts@apple.com> on 2012-11-28
Reviewed by Eric Carlson.

Source/WebCore:

Updating the .removeCue() implementation to match the latest spec. This means we now
raise a NOT_FOUND_ERR exception when trying to remove a cue that wasn't present in the
cue list instead of a INVALID_STATE_ERR exception like the spec used to mandate.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::removeCue):

LayoutTests:

Updating the .removeCue() test checking on the exception to be NOT_FOUND_ERR instead
of INVALID_STATE_ERR.

* media/track/track-add-remove-cue-expected.txt:
* media/track/track-add-remove-cue.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, land updated Chromium results after track limiter removal.

* fast/forms/range/range-thumb-height-percentage-expected.txt:
* platform/chromium-mac-lion/media/video-empty-source-expected.png:
* platform/chromium-mac-snowleopard/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Removed.
* platform/chromium-mac-snowleopard/fast/forms/range/slider-thumb-stylability-expected.txt: Removed.
* platform/chromium-mac-snowleopard/fast/repaint/slider-thumb-float-expected.txt: Removed.
* platform/chromium-mac-snowleopard/media/video-empty-source-expected.png:
* platform/chromium-mac/fast/dom/HTMLInputElement/input-slider-update-expected.txt: Added.
* platform/chromium-mac/fast/forms/box-shadow-override-expected.txt:
* platform/chromium-mac/fast/forms/input-appearance-height-expected.txt:
* platform/chromium-mac/fast/forms/range/input-appearance-range-expected.txt: Added.
* platform/chromium-mac/fast/forms/range/range-thumb-height-percentage-expected.txt: Renamed from LayoutTests/platform/chromium/fast/forms/range/range-thumb-height-percentage-expected.txt.
* platform/chromium-mac/fast/forms/range/slider-padding-expected.txt: Added.
* platform/chromium-mac/fast/forms/range/slider-thumb-shared-style-expected.txt:
* platform/chromium-mac/fast/forms/range/slider-thumb-stylability-expected.txt:
* platform/chromium-mac/fast/hidpi/video-controls-in-hidpi-expected.txt:
* platform/chromium-mac/fast/layers/video-layer-expected.txt:
* platform/chromium-mac/fast/repaint/slider-thumb-drag-release-expected.txt: Added.
* platform/chromium-mac/fast/repaint/slider-thumb-float-expected.txt: Removed.
* platform/chromium-mac/media/audio-controls-rendering-expected.txt:
* platform/chromium-mac/media/audio-repaint-expected.txt:
* platform/chromium-mac/media/controls-after-reload-expected.txt:
* platform/chromium-mac/media/controls-strict-expected.txt:
* platform/chromium-mac/media/controls-styling-expected.txt:
* platform/chromium-mac/media/controls-styling-strict-expected.txt:
* platform/chromium-mac/media/controls-without-preload-expected.txt:
* platform/chromium-mac/media/media-controls-clone-expected.txt:
* platform/chromium-mac/media/media-document-audio-repaint-expected.txt:
* platform/chromium-mac/media/video-controls-rendering-expected.txt:
* platform/chromium-mac/media/video-display-toggle-expected.txt:
* platform/chromium-mac/media/video-empty-source-expected.png:
* platform/chromium-mac/media/video-empty-source-expected.txt:
* platform/chromium-mac/media/video-no-audio-expected.txt:
* platform/chromium-mac/media/video-playing-and-pause-expected.txt:
* platform/chromium-mac/media/video-zoom-controls-expected.txt:
* platform/chromium-mac/platform/chromium/virtual/gpu/fast/hidpi/video-controls-in-hidpi-expected.txt:
* platform/chromium-win-xp/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Removed.
* platform/chromium-win-xp/fast/forms/range/slider-thumb-stylability-expected.txt: Removed.
* platform/chromium-win-xp/fast/repaint/slider-thumb-float-expected.txt: Removed.
* platform/chromium-win/fast/dom/HTMLInputElement/input-slider-update-expected.txt:
* platform/chromium-win/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt:
* platform/chromium-win/fast/forms/box-shadow-override-expected.txt:
* platform/chromium-win/fast/forms/input-appearance-height-expected.txt:
* platform/chromium-win/fast/forms/range/input-appearance-range-expected.txt:
* platform/chromium-win/fast/forms/range/range-thumb-height-percentage-expected.txt:
* platform/chromium-win/fast/forms/range/slider-padding-expected.txt:
* platform/chromium-win/fast/forms/range/slider-thumb-shared-style-expected.txt:
* platform/chromium-win/fast/forms/range/slider-thumb-stylability-expected.txt:
* platform/chromium-win/fast/multicol/client-rects-expected.txt:
* platform/chromium-win/fast/repaint/slider-thumb-drag-release-expected.txt:
* platform/chromium-win/fast/repaint/slider-thumb-float-expected.txt:
* platform/chromium-win/media/video-empty-source-expected.txt:
* platform/chromium/TestExpectations:
* platform/chromium/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Renamed from LayoutTests/platform/chromium-mac/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt.
* platform/chromium/fast/forms/range/slider-thumb-shared-style-expected.txt: Removed.
* platform/chromium/fast/multicol/client-rects-expected.txt: Added.
* platform/chromium/fast/repaint/slider-thumb-float-expected.txt: Renamed from LayoutTests/platform/mac/fast/repaint/slider-thumb-float-expected.txt.
* platform/mac/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Removed.
* platform/mac/fast/forms/range/slider-thumb-stylability-expected.txt: Removed.
* platform/win-future/fast/forms/range/range-thumb-height-percentage-expected.txt: Copied from LayoutTests/fast/forms/range/range-thumb-height-percentage-expected.txt.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Handle pinch correctly in slow-scrolling area
https://bugs.webkit.org/show_bug.cgi?id=102740

Reviewed by James Robinson.

With the nonmodal gesture event model, pinch zoom gestures involve
interleaved pinch and scroll events. This caused a bug on slow-scroll
areas: the scroll events were sent to the main thread and
the pinch events were handled in the impl thread.

This patch makes it so that scroll events are always handled in the impl
thread if a pinch is active.

* src/WebCompositorInputHandlerImpl.cpp:
(WebKit::WebCompositorInputHandlerImpl::WebCompositorInputHandlerImpl):
(WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal):
* src/WebCompositorInputHandlerImpl.h:
* tests/WebCompositorInputHandlerImplTest.cpp:
(WebKit::TEST_F):
(WebKit):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136029 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed. Mark http/tests/media/video-buffered-range-contains-currentTime.html as requiring an image rebaseline.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move empty loading to DocumentLoader, simplify FrameLoader::init()
https://bugs.webkit.org/show_bug.cgi?id=101512

Reviewed by Adam Barth.

Source/WebCore:

No new tests, though several outputs changed because we no longer send resource
    load callbacks for empty loads.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::~DocumentLoader):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::clearMainResourceLoader):
(WebCore::DocumentLoader::isLoadingInAPISense):
(WebCore::DocumentLoader::documentURL):
(WebCore::DocumentLoader::isLoadingMainResource):
(WebCore::DocumentLoader::maybeLoadEmpty):
(WebCore):
(WebCore::DocumentLoader::startLoadingMainResource): Handle empty main resource
     loads directly here.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::serverRedirectSourceForHistory):
(DocumentLoader):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameLoader): Initialize some variables whose values
    were previously being reset in init(). Given that the FrameLoader is in
    an inconsistent state before init() is called anyway, there doesn't seem
    to be a disadvantage to just initializing them to their post-init() values.
(WebCore::FrameLoader::init): Just call startLoadingMainResource(), instead of
    doing a bunch of direct calls to functions FrameLoader shouldn't know about.
* loader/FrameLoaderStateMachine.cpp:
(WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine):
* loader/FrameLoaderStateMachine.h:
* loader/MainResourceLoader.cpp: Throughout, remove the concept of an empty load.
(WebCore::MainResourceLoader::loadNow): This only returned true when an empty
    load got deferred, which won't happen now. Return void and always treat
    as returning false.
* loader/MainResourceLoader.h:
(MainResourceLoader):

Tools:

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::updateForCommittedLoad): This function doesn't play nicely with empty urls and incorrectly
    interprets them as a non-empty load. This change is required for
     http/tests/navigation/new-window-redirect-history.html to continue to pass in chromium.
* TestWebKitAPI/Tests/WebKit2/AboutBlankLoad.cpp: This test relies on a callback that no longer
     is sent for about:blank loads.  Hook into didFinishLoadForFrame() instead.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::TEST):

LayoutTests:

Don't expect resource load callbacks for empty loads.

* http/tests/inspector/network/network-iframe-load-and-delete.html:
* http/tests/loading/redirect-methods-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add unit tests for ChromeClientImpl::getNavigationPolicy
https://bugs.webkit.org/show_bug.cgi?id=102424

Reviewed by Adam Barth.

This tests a bunch of basic scenarios regarding what will produce a
popup, a new foreground/background tab, or a new window.

* WebKit.gypi: Added test file.
* src/WebViewImpl.h:
(WebViewImpl): Added friend declaration for setCurrentInputEventForTest.
* tests/ChromeClientImplTest.cpp: Added.


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