[Qt] Port TestRunner::findString to shared interface
https://bugs.webkit.org/show_bug.cgi?id=112147

Reviewed by Jocelyn Turcotte.

Source/WebKit/qt:

Add new find options used by the DRT.

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
* WebCoreSupport/DumpRenderTreeSupportQt.h:
* WebCoreSupport/QWebPageAdapter.cpp:
(QWebPageAdapter::findText):
* WebCoreSupport/QWebPageAdapter.h:
* WidgetApi/qwebpage.cpp:
* WidgetApi/qwebpage.h:

Tools:

This patch also removes DumpRenderTree and some other helper classes from
the WebCore namespace, to which they do not really belong.

* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
(main):
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(DumpRenderTree::DumpRenderTree):
(DumpRenderTree::~DumpRenderTree):
(DumpRenderTree::instance):
(DumpRenderTree::setShouldTimeout):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
(DumpRenderTree):
* DumpRenderTree/qt/EventSenderQt.cpp:
(EventSender::contextClick):
(EventSender::sendEvent):
(EventSender::postEvent):
* DumpRenderTree/qt/EventSenderQt.h:
(EventSender::isGraphicsBased):
* DumpRenderTree/qt/TestRunnerQt.cpp:
(TestRunnerQt::TestRunnerQt):
(TestRunner::findString):
(TestRunnerQt::setMockDeviceOrientation):
(TestRunnerQt::setGeolocationPermission):
(TestRunnerQt::numberOfPendingGeolocationPermissionRequests):
(TestRunnerQt::setMockGeolocationPositionUnavailableError):
(TestRunnerQt::setMockGeolocationPosition):
* DumpRenderTree/qt/TestRunnerQt.h:
(TestRunnerQt):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Touch Hold selection does not scroll text area or other subframe until selection reaches bottom of the page.
https://bugs.webkit.org/show_bug.cgi?id=112259

Patch by Iris Wu <shuwu@blackberry.com> on 2013-03-13
Reviewed by Rob Buis.

PR 267394

While selecting in a subframe, check that the selection reaches
the bottom of the current subframe instead of the page.

Internally Reviewed by Genevieve Mak.

* Api/InRegionScroller.cpp:
(BlackBerry::WebKit::InRegionScrollerPrivate::updateSelectionScrollView):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::selectAtPoint):
(BlackBerry::WebKit::SelectionHandler::ensureSelectedTextVisible):
(BlackBerry::WebKit::SelectionHandler::selectionViewportRect):
(WebKit):
(BlackBerry::WebKit::SelectionHandler::expandSelectionToGranularity):
* WebKitSupport/SelectionHandler.h:
(BlackBerry::WebKit::SelectionHandler::setSelectionViewportRect):
(SelectionHandler):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup dead MediaSource code now that the Chromium-side refactor is complete.
https://bugs.webkit.org/show_bug.cgi?id=110371

Reviewed by Adam Barth.

* public/WebMediaPlayer.h:
(WebKit):
(WebMediaPlayer): Remove old MediaSource methods and default MediaSource load() implementation.
* public/WebMediaPlayerClient.h: Remove old MediaSource methods.
* src/WebMediaPlayerClientImpl.cpp: Remove WebMediaSourceClientImpl & WebSourceBufferImpl classes that
                                    are no longer needed.
* src/WebMediaPlayerClientImpl.h: Remove old MediaSource methods.
(WebMediaPlayerClientImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][Introspection] Fix of gtk doc annotation warnings
https://bugs.webkit.org/show_bug.cgi?id=109182

Patch by Tomas Popela <tpopela@redhat.com> on 2013-03-13
Reviewed by Martin Robinson.

Fixed some gtk doc annotation warnings that appears during
compiling. Also some white characters were removed and some restyling
was done - all the g_signal_new in webkit directory have now the same
style.

* webkit/webkitdownload.cpp:
(webkit_download_class_init):
* webkit/webkitfavicondatabase.cpp:
(webkit_favicon_database_class_init):
* webkit/webkitgeolocationpolicydecision.cpp:
* webkit/webkitglobals.cpp:
* webkit/webkithittestresult.h:
* webkit/webkiticondatabase.cpp:
(webkit_icon_database_class_init):
* webkit/webkitsecurityorigin.cpp:
* webkit/webkitsecurityorigin.h:
* webkit/webkitsoupauthdialog.cpp:
* webkit/webkitspellchecker.cpp:
* webkit/webkitviewportattributes.cpp:
(webkit_viewport_attributes_class_init):
* webkit/webkitwebdatabase.cpp:
* webkit/webkitwebframe.cpp:
(webkit_web_frame_class_init):
* webkit/webkitwebframe.h:
* webkit/webkitwebinspector.cpp:
(webkit_web_inspector_class_init):
* webkit/webkitwebnavigationaction.cpp:
(webkit_web_navigation_action_class_init):
* webkit/webkitwebplugindatabase.cpp:
* webkit/webkitwebpolicydecision.cpp:
* webkit/webkitwebresource.cpp:
(webkit_web_resource_class_init):
* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):
* webkit/webkitwebview.cpp:
(webkit_web_view_class_init):
(webkit_web_view_apply_zoom_level):
* webkit/webkitwebwindowfeatures.cpp:
(webkit_web_window_features_equal):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [CodeMirror] bug with LineWidgets
https://bugs.webkit.org/show_bug.cgi?id=111978

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-03-13
Reviewed by Vsevolod Vlasov.

Implement CodeMirrorTextEditor.beginUpdates and
CodeMirrorTextEditor.endUpdates and surround decoration creation
with the beginUpdates/endUpdates calls.

No new tests.

* inspector/front-end/CodeMirrorTextEditor.js:
(WebInspector.CodeMirrorTextEditor):
(WebInspector.CodeMirrorTextEditor.prototype.beginUpdates):
(WebInspector.CodeMirrorTextEditor.prototype.endUpdates):
* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame.prototype.addMessageToSource):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [CodeMirror] Handle "enter" key in {|} situation
https://bugs.webkit.org/show_bug.cgi?id=112153

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-03-13
Reviewed by Vsevolod Vlasov.

Add a keymap to handle "Enter" key and override it in case of {|}
situation.

No new tests.

* inspector/front-end/CodeMirrorTextEditor.js:
(WebInspector.CodeMirrorTextEditor):
(WebInspector.CodeMirrorTextEditor.BlockIndentController):
(WebInspector.CodeMirrorTextEditor.BlockIndentController.prototype.Enter):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix body background image geometry calculation
https://bugs.webkit.org/show_bug.cgi?id=112226

Reviewed by Stephen Chenney.

Source/WebCore:

Images that depend on a container size require a call to set the container size before
rendering, and a call to look up the correct image during painting.

The body's renderer is special in that it may not be the renderer that actually paints its
background. This patch fixes a bug where the correct RenderObject was used for looking up
the image, but not for setting the container size. This fixes SVG background images on body.

Test: svg/as-background-image/svg-as-background-body.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):

    This change introduces clientForBackgroundImage in the background geometry calculation.
    This is very similar to how the client is looked up in paintFillLayerExtended.

* rendering/RenderBoxModelObject.h:

    The new signature for calculateBackgroundImageGeometry now mirrors
    paintFillLayerExtended, containing a parameter for the correct background renderer.

(RenderBoxModelObject):

LayoutTests:

This test is required to have a repeating background, as we optimize non-repeating
backgrounds so the bug is not hit. A light green color is used so the text is still
readable, and gridlines are present to prove the correct container size is being used.

* svg/as-background-image/svg-as-background-body-expected.html: Added.
* svg/as-background-image/svg-as-background-body.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: coalesce repeating timeline records
https://bugs.webkit.org/show_bug.cgi?id=112168

Reviewed by Vsevolod Vlasov.

- coalesce repeating top-level timeline events;
- drive-by: only show categories that actually took time in aggregated stats;

* English.lproj/localizedStrings.js:
* inspector/front-end/TimelineFrameController.js:
(WebInspector.TimelineFrameController.prototype._innerAddRecord):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._highlightRect):
(WebInspector.TimelineCalculator.prototype.computeBarGraphPercentages):
* inspector/front-end/TimelinePresentationModel.js:
(WebInspector.TimelinePresentationModel.prototype.reset):
(WebInspector.TimelinePresentationModel.prototype._innerAddRecord):
(WebInspector.TimelinePresentationModel.prototype._updateAncestorStats):
(WebInspector.TimelinePresentationModel.prototype._findCoalescedParent):
(WebInspector.TimelinePresentationModel.prototype._replaceWithCoalescedRecord):
(WebInspector.TimelinePresentationModel.Record):
(WebInspector.TimelinePresentationModel.adoptRecord):
(WebInspector.TimelinePresentationModel.insertRetrospectiveRecord):
(WebInspector.TimelinePresentationModel.Record.prototype.get selfTime):
(WebInspector.TimelinePresentationModel.Record.prototype._generatePopupContentWithImagePreview):
(WebInspector.TimelinePresentationModel.Record.prototype._getRecordDetails):
(WebInspector.TimelinePresentationModel.Record.prototype.calculateAggregatedStats):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Break after doesn't work correctly with auto-height regions
https://bugs.webkit.org/show_bug.cgi?id=112241

Reviewed by David Hyatt.

Source/WebCore:

The change correctly returns the break position during the normal layout phase for
auto-height regions. The problem doesn't exist during the constrained layout phase
so it only affects the size of the auto-height regions by incorrectly positioning
the content inside the flow.

Test: fast/regions/autoheight-break-after.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::applyAfterBreak): Include the margin offset in the returned break position.

LayoutTests:

This reference test verifies the correct break positioned is computed when there are auto-height regions during
the normal layout phase.
The test includes an auto-height region, a region with a specified size and an auto-height region. The first
region ends with a paragraph with a forced break after. During the normal layout phase, if the paragraph margin
is not included in the break offset, the next paragraph is incorrectly positioned and it will result in an
incorrectly sized last region.
In the constrained layout phase, the break position is returned correctly, the paragraph is positioned further down
causing overflow in the auto-height region.

* fast/regions/autoheight-break-after-expected.html: Added.
* fast/regions/autoheight-break-after.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Calling WebInspectorClient::highlight() during a fade-out animation of the PageOverlay won't stop its animation
https://bugs.webkit.org/show_bug.cgi?id=112271

Reviewed by Tim Horton.

Add a new stopFadeOutAnimation() on PageOverlay that we call when
WebInspectorClient::highlight() is called and a page overlay
is already available. This ensures that any fade-out animation
is cleared before proceeding with showing the page overlay
for the new highlight.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::highlight):
* WebProcess/WebPage/PageOverlay.cpp:
(WebKit::PageOverlay::stopFadeOutAnimation):
(WebKit):
* WebProcess/WebPage/PageOverlay.h:
(PageOverlay):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge MainResourceLoader's didFinishLoading and dataReceived into DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=109952

Reviewed by Antti Koivisto.

No new tests, refactor only.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::responseReceived):
(WebCore::DocumentLoader::receivedData):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentLoader.h:
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::responseReceived): Move content filtering to
    DocumentLoader.
(WebCore::MainResourceLoader::dataReceived): Mostly moved to DocumentLoader.
(WebCore::MainResourceLoader::didFinishLoading): Mostly moved to DocumentLoader.
* loader/MainResourceLoader.h: Expose some variables that haven't been moved
    to DocumentLoader yet.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
.: Expose symbols for internals
https://bugs.webkit.org/show_bug.cgi?id=112194

Reviewed by Alexey Proskuryakov.

* Source/autotools/symbols.filter:

Source/WebCore: REGRESSION(r137607): Redirecting a post to a get then reloading triggers resubmit warning
https://bugs.webkit.org/show_bug.cgi?id=112194

Reviewed by Alexey Proskuryakov.

Test: http/tests/navigation/post-redirect-get-reload.php

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequest): Matching urls aren't a reliable way of checking whether
    we are in a redirect. Check redirectResponse.isNull() instead.
* testing/Internals.cpp:
(WebCore::Internals::forceReload): Expose a means of forcing a reload like one a user generates for testing.
    Note that testRunner.queueReload() does this, but is not supported after the initial load completes,
    which makes it unsuitable for this case.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit/win: Expose symbols for internals
https://bugs.webkit.org/show_bug.cgi?id=112194

Reviewed by Alexey Proskuryakov.

* WebKit.vcproj/WebKitExports.def.in:

LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=112194.

Reviewed by Alexey Proskuryakov.

* http/tests/navigation/post-redirect-get-reload-expected.txt: Added.
* http/tests/navigation/post-redirect-get-reload.php: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r143542): -webkit-align-items: center with overflow: auto/scroll has extra bottom padding
https://bugs.webkit.org/show_bug.cgi?id=112047

Reviewed by Ojan Vafai.

Source/WebCore:

Add a new pass for computing the client bottom edge that runs after we've repositioned children
due to wrap-reverse, flex-end or vertical centering.

Test: css3/flexbox/negative-overflow.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock): Remove the code to use clientLogicalBottom() that was computed before
repositioning. The repositioning can change the edge.
(WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning): Compute the new bottom based on the final position
of flex items.
* rendering/RenderFlexibleBox.h:
(RenderFlexibleBox):

LayoutTests:

* css3/flexbox/negative-overflow-expected.txt: Added.
* css3/flexbox/negative-overflow.html: Added.
* resources/check-layout.js: Add attributes for checking scroll width and scroll height.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean out some stale chromium TestExpectations entries.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Build fixes after 145552
https://bugs.webkit.org/show_bug.cgi?id=112267

Patch by Zan Dobersek <zdobersek@igalia.com> on 2013-03-13
Reviewed by Gustavo Noronha Silva.

Source/Platform:

* GNUmakefile.am: Include the same-level GNUmakefile.list.am.
Fix a typo in the inline visibility compiler flag.

Source/WebKit2:

* GNUmakefile.am: Narrow down the dependency CFLAGS list to only ones that are actually needed
to build the platformgtk_sources into libPlatformGtk2.la. At the moment this means only
GTK+-2.0 CFLAGS are used.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add new Skia code suppression flags

Unreviewed build update.

* skia_webkit.gyp: Add 'SK_DISABLE_BLUR_ROUNDING', 'SK_IGNORE_SUBPIXEL_AXIS_ALIGN_FIX',
    'SK_IGNORE_PICTURE_RECORD_SAVE_LAYER_OPT', 'SK_IGNORE_FAST_RECT_BLUR', 'SK_IGNORE_CUBIC_STROKE_FIX'


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] MediaStream API: Cleaning away deprecated and unused states
https://bugs.webkit.org/show_bug.cgi?id=112258

Reviewed by Adam Barth.

* chromium/public/WebRTCPeerConnectionHandler.h:
(WebRTCPeerConnectionHandler):
* chromium/public/WebRTCPeerConnectionHandlerClient.h:
(WebRTCPeerConnectionHandlerClient):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Better error handling in NetworkStateNotifierEfl
https://bugs.webkit.org/show_bug.cgi?id=112184

Reviewed by Kenneth Rohde Christiansen.

Improve error handling in for system calls in NetworkStateNotifierEfl.
- EINTR errors are now properly handled for close() and recv() syscalls
- recv() errors are now correctly detected, for e.g. if the socket was
closed unexpectedly.
- Make sure m_fdHandler is reset when the callback returns
ECORE_CALLBACK_CANCEL to avoid double free in destructor. m_fdHandler
gets destroyed when the callback returns ECORE_CALLBACK_CANCEL.
- Keep netlink socket file descriptor as a class member so that we can
close() it in the class destructor, even if m_fdHandler has already
been destroyed.

No new tests, no behavior change for layout tests.

* platform/network/NetworkStateNotifier.h:
(NetworkStateNotifier):
* platform/network/efl/NetworkStateNotifierEfl.cpp:
(WebCore::NetworkStateNotifier::readSocketCallback):
(WebCore::NetworkStateNotifier::~NetworkStateNotifier):
(WebCore::NetworkStateNotifier::NetworkStateNotifier):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix a path in TestExpectations.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SchedulePair.cpp is CF-specific
https://bugs.webkit.org/show_bug.cgi?id=112204

Patch by James Robinson <jamesr@chromium.org> on 2013-03-13
Reviewed by Oliver Hunt.

This renames SchedulePair.cpp SchedulePairCF.cpp, since it depends on CF, and excludes it from chromium's gyp
files.

* WTF.gyp/WTF.gyp:
  Add CF to the exclusion filter for the Chromium port.
* WTF.gypi:
  Add SchedulePairCF.cpp
* WTF.xcodeproj/project.pbxproj:
  Update project file to point to new .cpp location
* wtf/SchedulePairCF.cpp: Renamed from Source/WTF/wtf/SchedulePair.cpp.

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