Unreviewed trivial buildfix after r147799.

Add an ifdef guard to ensure Qt uses its own monotonicallyIncreasingTime()
implemenation instead of the GLIB based one.

* wtf/CurrentTime.cpp:
(WTF):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] REGRESSION(r147743): Use the correct `operator new' override in RenderThemeEfl.
https://bugs.webkit.org/show_bug.cgi?id=114166

Reviewed by Alexis Menard.

r147743 disabled GLOBAL_FAST_MALLOC_NEW on the EFL port, but this has
caused some pixel tests in WK1 to crash.

The problem stems from RenderThemeEfl::applyEdjeRTLState() directly
calling `operator new(size_t)' for some allocations.
RefCounted<RenderTheme>, on its turn, has a WTF_MAKE_FAST_ALLOCATED
call which adds some `operator new' overrides to the class. Our direct
calls in applyEdjeRTLState() made the scope resolution rules choose the
WTF_MAKE_FAST_ALLOCATED version (which uses FastMalloc's allocator),
while WTF::deleteOwnedPtr() calls the global `operator delete' (which
uses the system's free() implementation).

* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::applyEdjeRTLState): Explicitly choose the
global `operator new' when calling it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DragImage should not depend on Frame and CachedImage
https://bugs.webkit.org/show_bug.cgi?id=21357

Reviewed by Sam Weinig.

Remove Frame and CachedImage dependencies from DragImage.

* dom/Clipboard.h:
(WebCore): Add forward delcaration for CacheImage since it's not
included anymore in DragImage.h.
* page/DragController.cpp:
(WebCore::DragController::startDrag): Use
Frame::dragImageForSelection() and call
dissolveDragImageToFraction() for the returned DragImage. Pass the
font rendering mode to createDragImageForLink, instead of a Frame
that is only used to get the font rendering mode.
(WebCore::DragController::doImageDrag): Get the suggested filename
for the cached image and pass it to
createDragImageIconForCachedImageFilename().
* platform/DragImage.cpp:
(WebCore::createDragImageForLink): Receive a FontRenderingMode
instead of a Frame.
* platform/DragImage.h:
(WebCore): Remove createDragImageForSelection, change
createDragImageForLink to receive a FontRenderingMode instead of a
frame, and rename createDragImageIconForCachedImage as
createDragImageIconForCachedImageFilename since it nows received
the suggested filename of the cached image.
* platform/blackberry/DragImageBlackBerry.cpp:
(WebCore::createDragImageIconForCachedImageFilename): Adapt to API
changes.
* platform/efl/DragImageEfl.cpp:
(WebCore::createDragImageIconForCachedImageFilename): Ditto.
* platform/gtk/DragImageGtk.cpp:
(WebCore::createDragImageIconForCachedImageFilename): Ditto.
* platform/mac/DragImageMac.mm:
(WebCore::dissolveDragImageToFraction): Return early if the passed
image is NULL.
(WebCore::createDragImageIconForCachedImageFilename): Adapt to API
changes.
(WebCore::createDragImageForLink): Ditto.
* platform/qt/DragImageQt.cpp:
(WebCore::createDragImageIconForCachedImageFilename): Ditto.
* platform/win/DragImageWin.cpp:
(WebCore::createDragImageIconForCachedImageFilename): Ditto.
(WebCore::createDragImageForLink): Ditto.
* platform/wx/DragImageWx.cpp:
(WebCore::createDragImageIconForCachedImageFilename): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][EFL] WebView: Add callbacks to the WKViewClient to remove direct access to page viewport controller
https://bugs.webkit.org/show_bug.cgi?id=110741

Reviewed by Anders Carlsson.

Provided WKViewClient with didRequestScroll, didRenderFrame and didCompletePageTransition
callbacks so that direct access from WebView to page viewport controller is avoided.

Implementation of callbacks is also added to keep the current EFL WK2 functionality.

* UIProcess/API/C/efl/WKView.h:
* UIProcess/efl/PageLoadClientEfl.cpp:
(WebKit::PageLoadClientEfl::didCommitLoadForFrame):

    Moved here code from deleted WebView::didCommitLoad.

* UIProcess/efl/ViewClientEfl.cpp:
(WebKit::ViewClientEfl::didChangeContentsPosition):
(WebKit):
(WebKit::ViewClientEfl::didRenderFrame):
(WebKit::ViewClientEfl::didCompletePageTransition):
(WebKit::ViewClientEfl::ViewClientEfl):
* UIProcess/efl/ViewClientEfl.h:
(ViewClientEfl):
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::pageDidRequestScroll):
(WebKit::WebView::didRenderFrame):
(WebKit::WebView::pageTransitionViewportReady):
* UIProcess/efl/WebViewClient.cpp:
(WebKit::WebViewClient::didChangeContentsPosition):
(WebKit):
(WebKit::WebViewClient::didRenderFrame):
(WebKit::WebViewClient::didCompletePageTransition):
* UIProcess/efl/WebViewClient.h:
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][EFL] HEAD requests changed to GET after 303 redirection
https://bugs.webkit.org/show_bug.cgi?id=110127

Patch by Youenn Fablet <youennf@gmail.com> on 2013-04-08
Reviewed by Martin Robinson.

Source/WebCore:

Made shouldRedirectAsGET always return false for HEAD requests.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::shouldRedirectAsGET):

LayoutTests:

Added tests checking HEAD redirection.
Redirected HEAD requests are expected to remain HEAD requests.
(http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4)

* http/tests/xmlhttprequest/head-redirection-expected.txt: Added.
* http/tests/xmlhttprequest/head-redirection.html: Added.
* http/tests/xmlhttprequest/resources/get_method.php: Added.
* http/tests/xmlhttprequest/resources/redirect_methods.php: Added.
* platform/mac/http/tests/xmlhttprequest/head-redirection-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Provide more specific error description for SocketStreamError
https://bugs.webkit.org/show_bug.cgi?id=114134

Patch by Seokju Kwon <seokju.kwon@gmail.com> on 2013-04-08
Reviewed by Rob Buis.

Pass the reason of a failure to SocketStreamError instance
and notify it via SocketStreamHandleClient::didFailSocketStream().

* platform/network/blackberry/SocketStreamError.h:
(WebCore::SocketStreamError::SocketStreamError):
* platform/network/blackberry/SocketStreamHandleBlackBerry.cpp:
(WebCore::SocketStreamHandle::notifyStatusReceived):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Toggle OverWrite mode when pressing the Insert key
https://bugs.webkit.org/show_bug.cgi?id=113384

Reviewed by Martin Robinson.

Perform an OverWrite command as a response to the emission of the
toggle-overwrite signal. Due to the nature of the command it will
only do that when being on a richly editable web content.

* platform/gtk/KeyBindingTranslator.cpp:
(WebCore::toggleOverwriteCallback):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Enable text tracks from track elements
https://bugs.webkit.org/show_bug.cgi?id=113522

Patch by Brendan Long <b.long@cablelabs.com> on 2013-04-08
Reviewed by Jocelyn Turcotte.

No new tests because they're already there. This just enables the feature.

* Target.pri:
* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore):
* platform/qt/LocalizedStringsQt.cpp:
(WebCore):
(WebCore::textTrackSubtitlesText):
(WebCore::textTrackOffText):
(WebCore::textTrackNoLabelText):

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix; r147892 moved an export definition out of
a protective #ifdef, causing a link error on platforms which do
not define that method.

* WebCore.exp.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove WebCore::(enable|disable)SecureTextInput methods
https://bugs.webkit.org/show_bug.cgi?id=114126

Reviewed by Alexey Proskuryakov.

Remove the enableSecureTextInput and disableSecureTextInput methods and all the codepaths leading to them.
These were used only by the Chromium port and are as such not required anymore.

No new tests - no changes in functionality.

* GNUmakefile.list.am:
* WebCore.order:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(Document):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::focusedOrActiveStateChanged):
* editing/FrameSelection.h:
(FrameSelection):
* html/PasswordInputType.cpp:
* html/PasswordInputType.h:
(PasswordInputType):
* page/Frame.cpp:
(WebCore::Frame::setDocument):
* platform/SecureTextInput.h: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove the unused LayoutTestSupport class
https://bugs.webkit.org/show_bug.cgi?id=114170

Reviewed by Alexey Proskuryakov.

The LayoutTestSupport class is not used by any port anywhere in the code and should be removed.

No new tests - no changes in functionality.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* platform/LayoutTestSupport.cpp: Removed.
* platform/LayoutTestSupport.h: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build with strict GCC 4.8

Unreviewed build fix.

Initialize dragImage to suppress GCC's warning about it being possibly used uninitialized,
which results is a build failure with GCC 4.8 that sets -Werror=maybe-uninitialized.

No new tests needed.

* page/DragController.cpp:
(WebCore::DragController::doImageDrag):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] DOM objects created wrapping a base class have incorrect GObject type
https://bugs.webkit.org/show_bug.cgi?id=113132

Reviewed by Gustavo Noronha Silva.

Source/WebCore:

Some of the DOM methods can create a concrete instance of another
object, but return a base class. GObject bindings provide custom
kit implementations for Node, Element, Event and EvenTarget, so
any concrete HTMLElement wrapped as an HTMLElement ends up
wrapping the right WebCore object but in the wrong GObject type.
This affects not only HTMLElements, but any polymorphic object
wrapped using a base class.
This patch changes the way objects are created, so that all
classes have their own kit implementation, but for polymorphic
objects the kit implementation of the base class is always
used. The kit method of polymorphic base classes use a generic
wrap method instead of the wrapFoo method like all other
classes. In the static code we provide the implementation of the
generic wrap method for every polimorphic base class, falling back
to their wrapFoo method if the concrete object can't be used to
wrap the object.
Both WebKitDOMBinding and WebKitHTMLElementWrapperFactory now provide
implementations of wrap and have been renamed to WebKitDOMPrivate
and WebKitDOMHTMLPrivate.

* bindings/gobject/GNUmakefile.am:
* bindings/gobject/WebKitDOMBinding.cpp: Removed.
* bindings/gobject/WebKitDOMEventTarget.cpp:
(WebKit::kit): Moved kit implementation from WebKitDOMBinding for
consistency with all other objects that have their own kit.
(WebKit::core): Updated to match the core implementation fo all
other objects.
* bindings/gobject/WebKitDOMEventTargetPrivate.h:
(WebCore):
(WebKit):
* bindings/gobject/WebKitDOMHTMLPrivate.cpp: Added.
(WebKit): Use preprocessor macros to define and set the wrap
functions of all HTML elements, removing a lot of boilerplate code
and making it easier to add new wrap functions in the future.
(WebKit::wrap):
* bindings/gobject/WebKitDOMHTMLPrivate.h: Renamed from Source/WebCore/bindings/gobject/WebKitHTMLElementWrapperFactory.h.
(WebCore):
(WebKit):
* bindings/gobject/WebKitDOMObject.cpp:
* bindings/gobject/WebKitDOMPrivate.cpp: Added.
(WebKit):
(WebKit::wrap):
* bindings/gobject/WebKitDOMPrivate.h: Renamed from Source/WebCore/bindings/gobject/WebKitDOMBinding.h.
(WebCore):
(WebKit):
* bindings/gobject/WebKitHTMLElementWrapperFactory.cpp: Removed.
* bindings/scripts/CodeGeneratorGObject.pm:
(IsBaseType): Helper function to check if a type is a base class.
(GetBaseClass): Helper function to get the base class for a given
parent type.
(GenerateFunction): Remove special case for EventTarget since the
kit prototype of EventTarget is in its private header like all
other objects.
(GenerateCFile): Add a kit implementation for all objects.
(IsPolymorphic): Helper function to check if the given type is the
base class of a polymorphic object.
(Generate): Include the private header of the base class for
polymorphic objects.
(WriteData): Remove the special case for WebKitDOMNode since now
all objects has a kit method.
* bindings/scripts/test/GObject/WebKitDOMFloat64Array.cpp:
(WebKit::kit):
* bindings/scripts/test/GObject/WebKitDOMFloat64ArrayPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObjectPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestCallbackPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetterPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestEventConstructorPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestEventTargetPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestException.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestExceptionPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestInterfacePrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestNamedConstructorPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
(WebKit::kit):
* bindings/scripts/test/GObject/WebKitDOMTestNodePrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestObjPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructors.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructorsPrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterfacePrivate.h:
(WebKit):
* bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestTypedefsPrivate.h:
(WebKit):

Source/WebKit/gtk:

Remove WebKitDOMBindindg.h include from several files because it's
been renamed and it was not actually needed.

* WebCoreSupport/ChromeClientGtk.cpp:
* WebCoreSupport/EditorClientGtk.cpp:
* webkit/webkithittestresult.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop skipping first part of test in LayoutTests/media/track/opera/interfaces/TextTrack/cues.html
https://bugs.webkit.org/show_bug.cgi?id=104255

Updated test to match the one hosted by W3C which has corrected the reported error.

Reviewed by Eric Carlson.

* media/track/opera/interfaces/TextTrack/cues-expected.txt:
* media/track/opera/interfaces/TextTrack/cues.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Build Platform as a separate static library
https://bugs.webkit.org/show_bug.cgi?id=114164

Reviewed by Martin Robinson.

.:

* GNUmakefile.am: Add webkit2platform_sources definition.

Source/WebKit2:

This way we reduce a bit the amount of files compiled twice
because of the plugin process.

* GNUmakefile.am:
* GNUmakefile.list.am:
* Platform/gtk/WorkQueueGtk.cpp: Remove unused header.
* Platform/unix/SharedMemoryUnix.cpp: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in WebCore::ElementRuleCollector::collectMatchingRulesForList
https://bugs.webkit.org/show_bug.cgi?id=113458

Patch by Douglas Stockwell <dstockwell@chromium.org> on 2013-04-08
Reviewed by Darin Adler.

Source/WebCore:

A stylesheet which has been invalidated (type changed from "" or
"text/css") was not correctly removed from the list of active
style sheets when its children are changed.

This change releases StyleElement::m_sheet in advance of calling
DocumentStyleSheetCollection::updateActiveStyleSheets.

(StyleElement::clearSheet calls CSSStyleSheet::clearOwnerNode calls
CSSStyleSheet::didMutate calls Document::styleResolverChanged calls
DocumentStyleSheetCollection::updateActiveStyleSheets)

Test: fast/css/style-element-invalidation-crash.html

* dom/StyleElement.cpp:
(WebCore::StyleElement::clearSheet): Release m_sheet before we
  trigger an update of the active style sheets.

LayoutTests:

* fast/css/style-element-invalidation-crash-expected.txt: Added.
* fast/css/style-element-invalidation-crash.html: Added.
* fast/css/stylesheet.innerHTML-calls-didmutate.html: Removed.
* fast/css/stylesheet.innerHTML-calls-didmutate-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r147894): Broke WTFReportBacktrace() on Mac.
<http://webkit.org/b/114174>

Reviewed by Anders Carlsson.

An #elif !OS(ANDROID) block was erroneously removed, turn it into an #else instead since
that path will still be taken for OS(DARWIN).

* wtf/Assertions.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Counter still gets incremented when counter-increment is set to none
https://bugs.webkit.org/show_bug.cgi?id=84985

Patch by Yi Shen <max.hong.shen@gmail.com> on 2013-04-08
Reviewed by Darin Adler.

When the counter-increment is set to none, no counters are incremented.

Source/WebCore:

Tests: New test cases added in fast/css/counters/counter-increment-tests.htm

* css/StyleBuilder.cpp:
(WebCore::ApplyPropertyCounter::applyValue):

LayoutTests:

* fast/css/counters/counter-increment-tests-expected.txt: Added new test cases.
* fast/css/counters/counter-increment-tests.htm: Added new test cases.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Avoid "QFont::setPixelSize: Pixel size <= 0 (0)"
https://bugs.webkit.org/show_bug.cgi?id=114175

Reviewed by Allan Sandfeld Jensen.

QFont doesn't support a 0-size but WebCore does.
Leave our QFont in its default state in this case to avoid the warning.

* platform/graphics/qt/FontPlatformDataQt.cpp:
(WebCore::FontPlatformData::FontPlatformData):


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