[EFL][WK2] Make _ref() functions return the object
https://bugs.webkit.org/show_bug.cgi?id=96604

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-13
Reviewed by Gyuyoung Kim.

Make _ref() functions return the ref'd object to
make them more convenient to use. Also fix their
usage to make use of the newly returned value.

This change is consistent with eina_stringshare_ref()
in EFL and g_object_ref() in glib.

* UIProcess/API/efl/ewk_back_forward_list.cpp:
(createEinaList):
* UIProcess/API/efl/ewk_back_forward_list_item.cpp:
(ewk_back_forward_list_item_ref):
* UIProcess/API/efl/ewk_back_forward_list_item.h:
* UIProcess/API/efl/ewk_context.cpp:
(ewk_context_download_job_add):
* UIProcess/API/efl/ewk_download_job.cpp:
(ewk_download_job_ref):
(ewk_download_job_response_set):
* UIProcess/API/efl/ewk_download_job.h:
* UIProcess/API/efl/ewk_form_submission_request.cpp:
(ewk_form_submission_request_ref):
* UIProcess/API/efl/ewk_form_submission_request.h:
* UIProcess/API/efl/ewk_intent.cpp:
(ewk_intent_ref):
* UIProcess/API/efl/ewk_intent.h:
* UIProcess/API/efl/ewk_intent_service.cpp:
(ewk_intent_service_ref):
* UIProcess/API/efl/ewk_intent_service.h:
* UIProcess/API/efl/ewk_navigation_policy_decision.cpp:
(ewk_navigation_policy_decision_ref):
* UIProcess/API/efl/ewk_navigation_policy_decision.h:
* UIProcess/API/efl/ewk_url_request.cpp:
(ewk_url_request_ref):
* UIProcess/API/efl/ewk_url_request.h:
* UIProcess/API/efl/ewk_url_response.cpp:
(ewk_url_response_ref):
* UIProcess/API/efl/ewk_url_response.h:
* UIProcess/API/efl/ewk_url_scheme_request.cpp:
(ewk_url_scheme_request_ref):
* UIProcess/API/efl/ewk_url_scheme_request.h:
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_resource_load_initiated):
* UIProcess/API/efl/ewk_web_resource.cpp:
(ewk_web_resource_ref):
* UIProcess/API/efl/ewk_web_resource.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128413 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][NRWT] Lower timeout value to 6 seconds (12 for debug configuration)
https://bugs.webkit.org/show_bug.cgi?id=96506

Reviewed by Dirk Pranke.

Tools: 

Lower the timeout value to 6 seconds for release configuration and 12 seconds
for debug configuration. These are the same values the Chromium port uses.

Currently the value is lowered only for the DumpRenderTree, WebKitTestRunner (and
the layout tests under WebKit2 generally) requires more attention and gardening
than what the current effort produces.

The unit test is updated as well to test these changes.

* Scripts/webkitpy/layout_tests/port/gtk.py:
(GtkPort.default_timeout_ms):
* Scripts/webkitpy/layout_tests/port/gtk_unittest.py:
(GtkPortTest.test_default_timeout_ms):
(GtkPortTest.assertLinesEqual):

LayoutTests: 

Create a new section for slow tests. Tests listed here pass (or at least
work as expected or reliably) but require more than 6 or 12 seconds to run.

More tests are added into the timeout section. These are primarily tests
that used to take half a minute to run just to be interrupted by the watchdog
in DumpRenderTree and were then reported as text mismatch failures. Now they
will be timing out which is (arguably) a more proper way for them to fail.

* platform/gtk/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Check if WorkerContext is terminated in WebWorkerClientImple::openFileSystem call.
https://bugs.webkit.org/show_bug.cgi?id=96601

Patch by Taiju Tsuiki <tzik@chromium.org> on 2012-09-13
Reviewed by Kent Tamura.

m_webFrame might be already deleted after terminateWorkerContext call.
This patch ensure it be NULL and change to avoid using it.

Test: fast/filesystem/workers/detached-frame-crash.html

* src/WebWorkerClientImpl.cpp:
(WebKit::WebWorkerClientImpl::terminateWorkerContext):
(WebKit::WebWorkerClientImpl::openFileSystem):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions][CSSOM] Implement Element.getRegionFlowRanges
https://bugs.webkit.org/show_bug.cgi?id=78493

Patch by Raul Hudea <rhudea@adobe.com> on 2012-09-13
Reviewed by David Hyatt.

Source/WebCore:

Implement the getRegionFlowRanges function from the CSS Regions spec. It is implemented by iterating over
the content nodes and figuring out which nodes have boundingBox intersecting the region box and figuring out
the start and end positions.

Tests: fast/regions/get-region-flow-ranges-absolute-pos.html
       fast/regions/get-region-flow-ranges-content-nodes.html
       fast/regions/get-region-flow-ranges-display-none.html
       fast/regions/get-region-flow-ranges-empty-regions.html
       fast/regions/get-region-flow-ranges-fixed-pos.html
       fast/regions/get-region-flow-ranges-horiz-bt.html
       fast/regions/get-region-flow-ranges-inline-only.html
       fast/regions/get-region-flow-ranges-text-vert-lr.html
       fast/regions/get-region-flow-ranges-text.html
       fast/regions/get-region-flow-ranges-vert-lr.html
       fast/regions/get-region-flow-ranges-vert-rl.html
       fast/regions/get-region-flow-ranges-writing-modes-rl-rb-lr.html
       fast/regions/get-region-flow-ranges-writing-modes-tb-rl-lr.html
       fast/regions/get-region-flow-ranges.html

* dom/Element.cpp:
(WebCore::Element::webkitGetRegionFlowRanges):
(WebCore):
* dom/Element.h:
* dom/Element.idl: added the webkitGetRegionFlowRanges method
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats): Use the logicalTopOfFlowThreadContentRect instead of offsetFromLogicalTopOfFirstPage (renamed)
(WebCore::RenderBlock::hasNextPage): Use the logicalTopOfFlowThreadContentRect instead of offsetFromLogicalTopOfFirstPage (renamed)
(WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage): Added a slower path which works without LayoutState
(WebCore::RenderBlock::clampToStartAndEndRegions): Use the logicalTopOfFlowThreadContentRect instead of offsetFromLogicalTopOfFirstPage (renamed)
* rendering/RenderBox.cpp:
(WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats): Use the logicalTopOfFlowThreadContentRect instead of offsetFromLogicalTopOfFirstPage (renamed)
(WebCore::RenderBox::containingBlockAvailableLineWidthInRegion): Use the logicalTopOfFlowThreadContentRect instead of offsetFromLogicalTopOfFirstPage (renamed)
(WebCore::computeInlineStaticDistance): Use the logicalTopOfFlowThreadContentRect instead of offsetFromLogicalTopOfFirstPage (renamed)
* rendering/RenderNamedFlowThread.cpp:
(WebCore::isContainedInNodes):
(WebCore):
(WebCore::boxIntersectsRegion):
(WebCore::RenderNamedFlowThread::getRanges): returns a vector of Ranges that contains Node that are part of a region
* rendering/RenderNamedFlowThread.h:
(RenderNamedFlowThread):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::logicalTopOfFlowThreadContentRect): Returns the logical top of a rectangle inside the flow thread content
(WebCore):
(WebCore::RenderRegion::logicalBottomOfFlowThreadContentRect): Returns the logical bottom of a rectangle inside the flow thread content
(WebCore::RenderRegion::getRanges): proxy the getRanges call to its named flow thread
* rendering/RenderRegion.h:
(RenderRegion):
(WebCore::RenderRegion::logicalTopForFlowThreadContent): Renamed from offsetFromLogicalTopOfFirstPage
(WebCore::RenderRegion::logicalBottomForFlowThreadContent): Returns the logical bottom of the FlowThreadContent rect

LayoutTests:

Add tests for getRegionFlowRanges call.

* fast/regions/get-region-flow-ranges-absolute-pos-expected.txt: Added.
* fast/regions/get-region-flow-ranges-absolute-pos.html: Added.
* fast/regions/get-region-flow-ranges-content-nodes-expected.txt: Added.
* fast/regions/get-region-flow-ranges-content-nodes.html: Added.
* fast/regions/get-region-flow-ranges-display-none-expected.txt: Added.
* fast/regions/get-region-flow-ranges-display-none.html: Added.
* fast/regions/get-region-flow-ranges-empty-regions-expected.txt: Added.
* fast/regions/get-region-flow-ranges-empty-regions.html: Added.
* fast/regions/get-region-flow-ranges-expected.txt: Added.
* fast/regions/get-region-flow-ranges-fixed-pos-expected.txt: Added.
* fast/regions/get-region-flow-ranges-fixed-pos.html: Added.
* fast/regions/get-region-flow-ranges-horiz-bt-expected.txt: Added.
* fast/regions/get-region-flow-ranges-horiz-bt.html: Added.
* fast/regions/get-region-flow-ranges-inline-only-expected.txt: Added.
* fast/regions/get-region-flow-ranges-inline-only.html: Added.
* fast/regions/get-region-flow-ranges-text-expected.txt: Added.
* fast/regions/get-region-flow-ranges-text-vert-lr-expected.txt: Added.
* fast/regions/get-region-flow-ranges-text-vert-lr.html: Added.
* fast/regions/get-region-flow-ranges-text.html: Added.
* fast/regions/get-region-flow-ranges-vert-lr-expected.txt: Added.
* fast/regions/get-region-flow-ranges-vert-lr.html: Added.
* fast/regions/get-region-flow-ranges-vert-rl-expected.txt: Added.
* fast/regions/get-region-flow-ranges-vert-rl.html: Added.
* fast/regions/get-region-flow-ranges-writing-modes-rl-rb-lr-expected.txt: Added.
* fast/regions/get-region-flow-ranges-writing-modes-rl-rb-lr.html: Added.
* fast/regions/get-region-flow-ranges-writing-modes-tb-rl-lr-expected.txt: Added.
* fast/regions/get-region-flow-ranges-writing-modes-tb-rl-lr.html: Added.
* fast/regions/get-region-flow-ranges.html: Added.
* fast/regions/resources/helper.js:
(getName):
(getRangeAt):
(compareArrays):

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

Removing expectation for fast/canvas/canvas-css-crazy.html, the test
was fixed in r128411.

Marking fast/events/popup-blocking-timers.html as slow and adding a
timeout expectation for touchadjustment/iframe-boundary.html.

* platform/gtk/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: NMI: migrate core instrumentation code to WTF namespace
https://bugs.webkit.org/show_bug.cgi?id=96511

Reviewed by Yury Semikhatsky.

After moving core NMI code to WTF namespace I removed forward declarations
of MemoryObjectInfo and MemoryInstrumentation from WebCore headers and add
forward declaration into wtf/Forward.h

Source/WebCore:

* bindings/v8/DOMDataStore.h:
(WebCore):
* bindings/v8/ScriptProfiler.h:
(WebCore):
* bindings/v8/V8DOMMap.h:
(WebCore):
* bindings/v8/V8PerIsolateData.h:
(WebCore):
* bindings/v8/V8ValueCache.h:
(WebCore):
* css/CSSProperty.h:
* css/CSSRule.h:
(WebCore):
* css/CSSSelectorList.h:
(WebCore):
* css/CSSStyleDeclaration.h:
(WebCore):
* css/CSSStyleSheet.h:
(WebCore):
* css/CSSValue.h:
* css/MediaList.h:
(WebCore):
* css/MediaQuery.h:
* css/MediaQueryExp.h:
* css/StylePropertySet.h:
(WebCore):
* css/StyleResolver.h:
* css/StyleRule.h:
(WebCore):
* css/StyleRuleImport.h:
(WebCore):
* css/StyleSheetContents.h:
(WebCore):
* css/WebKitCSSKeyframeRule.h:
* css/WebKitCSSKeyframesRule.h:
(WebCore):
* css/WebKitCSSMixFunctionValue.h:
* dom/DocumentEventQueue.h:
(WebCore):
* dom/ElementAttributeData.h:
(WebCore):
* dom/Event.h:
(WebCore):
* dom/Node.h:
(WebCore):
* dom/WebCoreMemoryInstrumentation.cpp:
(WTF):
(WTF::WebCore::KURL):
* dom/WebCoreMemoryInstrumentation.h:
(WebCore):
(WTF):
* inspector/MemoryInstrumentationImpl.h:
* loader/DocumentLoader.h:
(WebCore):
* loader/FrameLoader.h:
(WebCore):
* loader/ResourceLoader.h:
(WebCore):
* loader/SubstituteData.h:
* loader/cache/CachedCSSStyleSheet.h:
(WebCore):
* loader/cache/CachedRawResource.h:
(WebCore):
* loader/cache/CachedResource.h:
(WebCore):
* loader/cache/CachedResourceHandle.h:
* loader/cache/CachedResourceLoader.h:
(WebCore):
* loader/cache/CachedScript.h:
(WebCore):
* loader/cache/CachedShader.h:
* loader/cache/CachedXSLStyleSheet.h:
(WebCore):
* loader/cache/MemoryCache.h:
(WebCore):
* page/Frame.h:
(WebCore):
* platform/SharedBuffer.h:
* platform/graphics/CrossfadeGeneratedImage.h:
(WebCore):
* platform/graphics/Image.h:
(WebCore):
* platform/network/FormData.h:
(WebCore):
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* rendering/style/RenderStyle.h:
(WebCore):
* rendering/style/StyleRareInheritedData.h:
(WebCore):
* rendering/style/StyleRareNonInheritedData.h:
(WebCore):

Source/WTF:

* wtf/Forward.h:
(WTF):
* wtf/MemoryInstrumentation.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Memory leaks in Qt's TestRunner
https://bugs.webkit.org/show_bug.cgi?id=96603

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-09-13
Reviewed by Csaba Osztrogonác.

Fix memory leaks in Qt's TestRunner code by adopting WKString
created with WKStringCreateWithUTF8CString().

* WebKitTestRunner/qt/TestControllerQt.cpp:
(WTR::TestController::initializeInjectedBundlePath):
(WTR::TestController::initializeTestPluginDirectory):

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

Rebaselining two tests after r128375.

* platform/gtk/TestExpectations:
* platform/gtk/fast/table/height-percent-test-vertical-expected.png: Added.
* platform/gtk/fast/table/height-percent-test-vertical-expected.txt:
* platform/gtk/fast/writing-mode/percentage-height-orthogonal-writing-modes-quirks-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][WTR] More efficient string handling in InjectedBundlePage
https://bugs.webkit.org/show_bug.cgi?id=96609

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-13
Reviewed by Kenneth Rohde Christiansen.

Update StringBuilder usage in InjectedBundlePage to follow
the latest recommandations for efficient string handling:
http://trac.webkit.org/wiki/EfficientStrings

This involves using appendLiteral() or appendNumber()
instead of append() whenever possible.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::dumpPath):
(WTR::rangeToStr):
(WTR::styleDecToStr):
(WTR::frameToStr):
(WTR::dumpResourceURL):
(WTR):
(WTR::dumpFrameDescriptionSuitableForTestResult):
(WTR::dumpRequestDescriptionSuitableForTestResult):
(WTR::dumpResponseDescriptionSuitableForTestResult):
(WTR::dumpErrorDescriptionSuitableForTestResult):
(WTR::InjectedBundlePage::didReceiveIntentForFrame):
(WTR::InjectedBundlePage::registerIntentServiceForFrame):
(WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
(WTR::InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame):
(WTR::InjectedBundlePage::didCommitLoadForFrame):
(WTR::InjectedBundlePage::didFinishProgress):
(WTR::dumpFrameScrollPosition):
(WTR::dumpFrameText):
(WTR::dumpDescendantFramesText):
(WTR::InjectedBundlePage::didFinishLoadForFrame):
(WTR::InjectedBundlePage::didReceiveTitleForFrame):
(WTR::InjectedBundlePage::didCancelClientRedirectForFrame):
(WTR::InjectedBundlePage::willPerformClientRedirectForFrame):
(WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
(WTR::InjectedBundlePage::didHandleOnloadEventsForFrame):
(WTR::InjectedBundlePage::willSendRequestForFrame):
(WTR::InjectedBundlePage::didReceiveResponseForResource):
(WTR::InjectedBundlePage::didFinishLoadForResource):
(WTR::InjectedBundlePage::didFailLoadForResource):
(WTR::InjectedBundlePage::shouldCacheResponse):
(WTR::InjectedBundlePage::decidePolicyForNavigationAction):
(WTR::InjectedBundlePage::willAddMessageToConsole):
(WTR::InjectedBundlePage::willSetStatusbarText):
(WTR::InjectedBundlePage::willRunJavaScriptAlert):
(WTR::InjectedBundlePage::willRunJavaScriptConfirm):
(WTR::InjectedBundlePage::willRunJavaScriptPrompt):
(WTR::InjectedBundlePage::didReachApplicationCacheOriginQuota):
(WTR::InjectedBundlePage::shouldBeginEditing):
(WTR::InjectedBundlePage::shouldEndEditing):
(WTR::InjectedBundlePage::shouldInsertNode):
(WTR::InjectedBundlePage::shouldInsertText):
(WTR::InjectedBundlePage::shouldDeleteRange):
(WTR::InjectedBundlePage::shouldChangeSelectedRange):
(WTR::InjectedBundlePage::shouldApplyStyle):
(WTR::InjectedBundlePage::didBeginEditing):
(WTR::InjectedBundlePage::didEndEditing):
(WTR::InjectedBundlePage::didChange):
(WTR::InjectedBundlePage::didChangeSelection):
(WTR::InjectedBundlePage::supportsFullScreen):
(WTR::InjectedBundlePage::enterFullScreenForElement):
(WTR::InjectedBundlePage::exitFullScreenForElement):
(WTR::InjectedBundlePage::beganEnterFullScreen):
(WTR::InjectedBundlePage::beganExitFullScreen):
(WTR::InjectedBundlePage::closeFullScreen):
(WTR::dumpBackForwardListItem):
(WTR::InjectedBundlePage::dumpBackForwardList):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] GStreamer detection does not work when cross-compiling
https://bugs.webkit.org/show_bug.cgi?id=96608

Patch by Simon Hausmann <simon.hausmann@nokia.com> on 2012-09-13
Reviewed by Kenneth Rohde Christiansen.

When cross-compiling it is not safe to just use system(pkg-config),
because there is a high probability that it will find packages in the
host system instead of in the target one. Instead use qmake's new
packagesExist() function that takes care of this delicate aspect of
cross compilation by setting PKG_CONFIG_SYSROOT_DIR and
PKG_CONFIG_LIBDIR accordingly.

* qmake/mkspecs/features/features.prf:

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