https://bugs.webkit.org/show_bug.cgi?id=99350
REGRESSION (r131238): Repro crash in 
       WebCore::ScrollingStateTree::removeNode(WebCore::ScrollingStateNode*) 
opening pdf page
-and corresponding-
<rdar://problem/12499839>

Reviewed by Simon Fraser.

We have to null-check node here. It won't be found if  
clearStateTree() was recently called.
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::detachFromStateTree):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Implement Favicons API
https://bugs.webkit.org/show_bug.cgi?id=99087

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

Source/WebCore:

Moved ewk_util from WebKit to WebCore and rename it
to CairoUtilityEfl so that the code can be shared
between WebKit1 and WebKit2. Some related utility
code was also moved from RenderThemeEfl to
CairoUtilityEfl.

No new tests, no behavior change.

* PlatformEfl.cmake:
* platform/efl/RenderThemeEfl.cpp:
* platform/graphics/efl/CairoUtilitiesEfl.cpp: Renamed from Source/WebKit/efl/ewk/ewk_util.cpp.
(WebCore):
(WebCore::evasObjectFromCairoImageSurface):
(WebCore::createSurfaceForBackingStore):
* platform/graphics/efl/CairoUtilitiesEfl.h: Renamed from Source/WebKit/efl/ewk/ewk_util_private.h.
(WebCore):

Source/WebKit:

Remove ewk_util.cpp from PlatformEfl.cmake now that its
code has been moved to WebCore to be reused in WK2.

* PlatformEfl.cmake:

Source/WebKit/efl:

Remove ewk_util now that its code has been moved
to CairoUtilitiesEfl in WebCore.

* ewk/ewk_history.cpp:
(ewk_history_item_icon_object_add):
* ewk/ewk_settings.cpp:
(ewk_settings_icon_database_icon_object_get):

Source/WebKit2:

Add support for favicon API to EFL WK2 port via
Ewk_Favicon_Database. The API can be used to
retrieve the favicon URL and data for a given
page URL.

* PlatformEfl.cmake:
* UIProcess/API/efl/EWebKit2.h:
* UIProcess/API/efl/ewk_context.cpp:
(_Ewk_Context):
(_Ewk_Context::_Ewk_Context):
(_Ewk_Context::~_Ewk_Context):
(ewk_context_favicon_database_get): Add getter to retrieve the favicon
database instance from the context.
* UIProcess/API/efl/ewk_context.h:
* UIProcess/API/efl/ewk_favicon_database.cpp: Added.
(IconChangeCallbackData):
(IconChangeCallbackData::IconChangeCallbackData):
(IconRequestCallbackData):
(IconRequestCallbackData::IconRequestCallbackData):
(_Ewk_Favicon_Database):
(_Ewk_Favicon_Database::_Ewk_Favicon_Database):
(didChangeIconForPageURL):
(getIconSurfaceSynchronously):
(iconDataReadyForPageURL):
(ewk_favicon_database_new):
(ewk_favicon_database_free):
(ewk_favicon_database_icon_url_get):
(AsyncIconRequestResponse):
(AsyncIconRequestResponse::AsyncIconRequestResponse):
(respond_icon_request_idle):
(ewk_favicon_database_async_icon_get):
(ewk_favicon_database_icon_change_callback_add):
(ewk_favicon_database_icon_change_callback_del):
* UIProcess/API/efl/ewk_favicon_database.h: Added.
* UIProcess/API/efl/ewk_favicon_database_private.h: Copied from Source/WebKit2/UIProcess/efl/WebContextEfl.cpp.
* UIProcess/API/efl/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_Ewk_View_Private_Data::~_Ewk_View_Private_Data):
(_ewk_view_on_favicon_changed):
(_ewk_view_initialize):
(ewk_view_url_update):
(ewk_view_icon_url_get): Add a getter to the view to retrieve the icon URL for
the page that is currently shown.
(ewk_view_update_icon):
* UIProcess/API/efl/ewk_view.h: Emit a new "icon,changed" signal on the view whenever
the view's icon has changed.
* UIProcess/API/efl/ewk_view_private.h:
* UIProcess/API/efl/tests/resources/blank.ico: Added.
* UIProcess/API/efl/tests/test_ewk2_context.cpp: Add unit test for new favicon database getter.
(TEST_F):
* UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp: Added unit tests for the new Ewk_Favicon_Database API.
(serverCallback):
(onIconChanged):
(TEST_F):
(onIconDataReady):
(IconRequestData):
(requestFaviconData):
* UIProcess/efl/WebContextEfl.cpp:
(WebKit::WebContext::platformDefaultIconDatabasePath): Return a valid default path for the icon database.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r131327.
http://trac.webkit.org/changeset/131327
https://bugs.webkit.org/show_bug.cgi?id=99353

broke the build (Requested by danakj|gardening on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-15

* DumpRenderTree/chromium/TestEventPrinter.cpp:
* DumpRenderTree/chromium/TestEventPrinter.h:
(TestEventPrinter):
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::dump):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r131306 and r131307.
http://trac.webkit.org/changeset/131306
http://trac.webkit.org/changeset/131307
https://bugs.webkit.org/show_bug.cgi?id=99354

It made layout testing extremely slow again (Requested by
Ossy_night on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-15

Source/WebKit2:

* Shared/API/c/qt/WKImageQt.cpp:
(WKImageCreateQImage):
* Shared/API/c/qt/WKImageQt.h:

Tools:

* WebKitTestRunner/Target.pri:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/TestInvocation.h:
(TestInvocation):
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::WrapperWindow::handleStatusChanged):
(WTR::PlatformWebView::windowSnapshotImage):
* WebKitTestRunner/qt/TestInvocationQt.cpp:
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Partial build fix for Windows after r131308.

* WebKit2Prefix.h:
* WebProcess/WebKitMain.cpp:
(WebKitMain):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Hide useless controls in remote-debugging mode.
https://bugs.webkit.org/show_bug.cgi?id=99300

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2012-10-15
Reviewed by Vsevolod Vlasov.

"Close inspector" and "change docking mode" buttons seem to be rather
useless in remote debugging mode.

* inspector/front-end/inspector.css:
(body.remote .toolbar-item.close-left, body.remote .toolbar-item.close-right):
(body.remote .dock-status-bar-item):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Fix memory leak in TreeOutline
https://bugs.webkit.org/show_bug.cgi?id=99307

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2012-10-15
Reviewed by Alexander Pavlov.

Added cleanup of empty buckets in elements cache.

* inspector/front-end/treeoutline.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Lower the minimum time required to keep a test in the test results json
https://bugs.webkit.org/show_bug.cgi?id=99346

Reviewed by Eric Seidel.

On the run-webkit-tests side, we floor the time. So, 5 seconds is too close to
the 6 second timeout. Lower the time so that we can get a better sense of tests
that are close to timing out.

* TestResultServer/model/jsonresults.py:
* TestResultServer/model/jsonresults_unittest.py:
(JsonResultsTest.test_merge_keep_test_with_all_pass_but_slow_time):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test webaudio/codec-tests/vorbis/vbr-70kbps-44khz.html is failing
https://bugs.webkit.org/show_bug.cgi?id=99357

Unreviewed gardening.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Provide implementation for PageClientImpl::toolTipChanged()
https://bugs.webkit.org/show_bug.cgi?id=98589

Patch by Jinwoo Song <jinwoo7.song@samsung.com> on 2012-10-15
Reviewed by Kenneth Rohde Christiansen.

Implement PageClientImpl::toolTipChanged() to emit signal 'tooltip,text,set' with a tooltip text,
or 'tooltip,text,unset' if tooltip was unset.

* UIProcess/API/efl/PageClientImpl.cpp:
(WebKit::PageClientImpl::toolTipChanged):
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_tooltip_text_set):
* UIProcess/API/efl/ewk_view.h:
* UIProcess/API/efl/ewk_view_private.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions]Add support for auto-height regions (without region-breaks)
https://bugs.webkit.org/show_bug.cgi?id=97533

Reviewed by Julien Chaffraix.

Source/WebCore:

Implement the 2pass layout algorithm for computing the height of regions with auto logical height, without taking region breaks into account.
The algorithm is described in the CSSRegions spec: http://dev.w3.org/csswg/css3-regions/#regions-visual-formatting-steps

When the flow thread contains regions with auto logical height, a 2pass layout algorithm is needed to determine the height of auto logical height regions.
In each step of the layout, the regions are laid out before the flow thread is laid out.

In the first pass of layout (normal layout phase), the content of the flow thread is laid out unconstrained in the regions. The region marked as having auto logical height
displays all the corresponding content from the flow thread (taking min-height and max-height into account), and the height of the content displayed
determines the overridden logical content height. Thus, after the first pass of layout, each auto logical height region will store the logical height
value for the second pass in its overridden logical content height property.

In the second pass of layout (constrained flow threads layout phase), when the content of the flow thread is laid out constrained in the regions, the regions are laid out again and they are using
the overridden logical content height from the first pass to update their logical height. Then, the flow thread content is laid out in the associated region chain,
for which the auto logical height regions have proper logical height.

A future patch will properly take region breaks into account for the first pass of layout.

Tests: fast/regions/autoheight-abspos-region.html
       fast/regions/autoheight-floatright-region.html
       fast/regions/autoheight-horizontal-bt.html
       fast/regions/autoheight-inlineblock-normalflow-region.html
       fast/regions/autoheight-maxheight-region.html
       fast/regions/autoheight-minheight-region.html
       fast/regions/autoheight-normalflow-region.html
       fast/regions/autoheight-vertical-lr.html
       fast/regions/autoheight-vertical-rl.html

* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::resetRegionsOverrideLogicalContentHeight):
For all the auto logical height regions, resets their associated overrideLogicalContentHeight.
Those regions are marked as needing layout (along with their ancestors).
(WebCore::FlowThreadController::markAutoLogicalHeightRegionsForLayout):
Mark all the auto logical height regions and their associated flow thread as needing layout (along with their ancestors).
* rendering/FlowThreadController.h:
* rendering/RenderBox.cpp:
Add helper functions to clear out individual logical content width/height.
(WebCore::RenderBox::clearOverrideLogicalContentHeight):
(WebCore::RenderBox::clearOverrideLogicalContentWidth):
(WebCore::RenderBox::clearOverrideSize):
* rendering/RenderBox.h:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::layout):
(WebCore::RenderFlowThread::computeLogicalHeight):
If the flow thread has an auto logical height region for which we did not yet compute the overrideLogicalContentHeight value,
bail out early since we cannot compute the flow thread logical height.
(WebCore::RenderFlowThread::regionAtBlockOffset):
If the offset is inside an auto logical height region for which we did not compute the overrideLogicalContentHeight, then we consider this region tall enough to accommodate all
the content and we return this region. Otherwise, for an auto logical height region, we use either the overrideLogicalContentHeight (if we are in the first layout phase) or
the logicalHeight if we are in the second layout phase (because the overriderLogicalContentHeight was already transferred into region logical height).
(WebCore::RenderFlowThread::pageLogicalHeightForOffset):
(WebCore::RenderFlowThread::pageRemainingLogicalHeightForOffset):
(WebCore::RenderFlowThread::computeOverflowStateForRegions):
(WebCore::RenderFlowThread::resetRegionsOverrideLogicalContentHeight):
(WebCore::RenderFlowThread::markAutoLogicalHeightRegionsForLayout):
(WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
(WebCore::RenderFlowThread::addForcedRegionBreak):
Simulate a region break at the specified offset. It will be extended to properly process the region breaks. At this moment, only one auto height region for a thread
can have its height properly computed.
* rendering/RenderFlowThread.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::boxIntersectsRegion):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::updateLogicalHeight):
If the auto logical height region has an overrideLogicalContentHeight and we are in the second pass of layout,
we use the overrideLogicalContentHeight to update the region logical height.
(WebCore::RenderRegion::needsOverrideLogicalContentHeightComputation):
* rendering/RenderRegion.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
(WebCore::RenderView::layoutContent):
Added a new function to contain the RenderView block layout and flow threads layout.
(WebCore::RenderView::checkLayoutState):
Helper function keeping the original asserts from RenderView, used in more than one place.
(WebCore::RenderView::layout):
* rendering/RenderView.h:
(WebCore::RenderView::normalLayoutPhase):
(WebCore::RenderView::constrainedFlowThreadsLayoutPhase):

LayoutTests:

Added tests for auto-height regions, with different writing modes, with min/max-height.
The bug referenced in the tests is the master bug for auto-height support, 91097.

* fast/regions/autoheight-abspos-region-expected.html: Added.
* fast/regions/autoheight-abspos-region.html: Added.
* fast/regions/autoheight-floatright-region-expected.html: Added.
* fast/regions/autoheight-floatright-region.html: Added.
* fast/regions/autoheight-horizontal-bt-expected.html: Added.
* fast/regions/autoheight-horizontal-bt.html: Added.
* fast/regions/autoheight-inlineblock-normalflow-region-expected.html: Added.
* fast/regions/autoheight-inlineblock-normalflow-region.html: Added.
* fast/regions/autoheight-maxheight-region-expected.html: Added.
* fast/regions/autoheight-maxheight-region.html: Added.
* fast/regions/autoheight-minheight-region-expected.html: Added.
* fast/regions/autoheight-minheight-region.html: Added.
* fast/regions/autoheight-normalflow-region-expected.html: Added.
* fast/regions/autoheight-normalflow-region.html: Added.
* fast/regions/autoheight-vertical-lr-expected.html: Added.
* fast/regions/autoheight-vertical-lr.html: Added.
* fast/regions/autoheight-vertical-rl-expected.html: Added.
* fast/regions/autoheight-vertical-rl.html: Added.
* fast/regions/webkit-named-flow-first-empty-region-index.html: Fix an element style (though the test was passing before).


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