[WK2] add setNeedsDisplay in DrawingArea to mark whole layer as dirty.
https://bugs.webkit.org/show_bug.cgi?id=110299

Patch by Huang Dongsung <luxtella@company100.net> on 2013-02-20
Reviewed by Anders Carlsson.

Currently, we call setNeedsDisplay with the size of WebPage to mark whole
backing store as dirty. However, the size of non compositing layer can be
inconsistent with the size of WebPage. For example, in Coordinated Graphics, the
size of non compositing layer is contents size.

So, WebPage should not assume the size of non compositing layer, and should just
call setNeedsDisplay when marking whole layer as dirty.

In addition, this patch renames from setNeedsDisplay() with a rect argument to
setNeedsDisplayInRect(), which matches to the terms of GraphicsLayer.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::invalidateContentsAndRootView):
(WebKit::WebChromeClient::invalidateContentsForSlowScroll):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::restoreViewState):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplay):
(WebKit):
(WebKit::CoordinatedLayerTreeHost::setNonCompositedContentsNeedDisplayInRect):
(WebKit::CoordinatedLayerTreeHost::scrollNonCompositedContents):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
(CoordinatedLayerTreeHost):
* WebProcess/WebPage/DrawingArea.h:
(DrawingArea):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setNeedsDisplay):
(WebKit):
(WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
(WebKit::DrawingAreaImpl::scroll):
(WebKit::DrawingAreaImpl::forceRepaint):
(WebKit::DrawingAreaImpl::didUninstallPageOverlay):
(WebKit::DrawingAreaImpl::setPageOverlayNeedsDisplay):
(WebKit::DrawingAreaImpl::resumePainting):
* WebProcess/WebPage/DrawingAreaImpl.h:
(DrawingAreaImpl):
* WebProcess/WebPage/LayerTreeHost.h:
(LayerTreeHost):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setSize):
(WebKit::WebPage::setDrawsBackground):
(WebKit::WebPage::setDrawsTransparentBackground):
(WebKit::WebPage::resumeActiveDOMObjectsAndAnimations):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay):
(WebKit):
(WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplayInRect):
(WebKit::LayerTreeHostGtk::scrollNonCompositedContents):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
(LayerTreeHostGtk):
* WebProcess/WebPage/mac/LayerTreeHostMac.h:
(LayerTreeHostMac):
* WebProcess/WebPage/mac/LayerTreeHostMac.mm:
(WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplay):
(WebKit):
(WebKit::LayerTreeHostMac::setNonCompositedContentsNeedDisplayInRect):
(WebKit::LayerTreeHostMac::scrollNonCompositedContents):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
(RemoteLayerTreeDrawingArea):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setNeedsDisplay):
(WebKit):
(WebKit::RemoteLayerTreeDrawingArea::setNeedsDisplayInRect):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
(TiledCoreAnimationDrawingArea):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::setNeedsDisplay):
(WebKit):
(WebKit::TiledCoreAnimationDrawingArea::setNeedsDisplayInRect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143472 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Remove idbFactory from WebKitPlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=106457

Reviewed by Adam Barth.

Now that https://codereview.chromium.org/12230054 has landed, the
idbFactory method is no longer needed. (Embedders must now call
the new setIDBFactory method upon initialization.) Part of a
larger refactoring series; see tracking bug 82948.

* public/platform/WebKitPlatformSupport.h:
(WebKit):
* src/IDBFactoryBackendProxy.cpp:
(WebKit::IDBFactoryBackendProxy::IDBFactoryBackendProxy):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Remove m_viewportSize in WebPage.
https://bugs.webkit.org/show_bug.cgi?id=110311

Patch by Huang Dongsung <luxtella@company100.net> on 2013-02-20
Reviewed by Anders Carlsson.

EFL and Qt use m_viewSize as a contents size while Apple use it as a viewport
size, so EFL and Qt introduced m_viewportSize to make WebPage know a viewport
size.

EFL and Qt use m_viewSize as a contents size because the size of non compositing
layer is contents size, and EFL and Qt mark whole non compositing layer as dirty
using m_viewSize. Bug 110299 (http://webkit.org/b/110299) changes that it is not
necessary to know m_viewSize when marking whole non compositing layer as dirty.
So we can make EFL and Qt use m_viewSize as a viewport size also.

This patch removes m_viewportSize and related methods to increase readability.

* UIProcess/API/qt/raw/qrawwebview.cpp:
(QRawWebView::setSize):
* UIProcess/PageViewportController.cpp:
(WebKit::PageViewportController::didChangeViewportSize):
* UIProcess/WebPageProxy.cpp:
(WebKit):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::pageRect):
(WebKit::WebChromeClient::contentsSizeChanged):
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::updateBackingStoreState):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setSize):
(WebKit::WebPage::sendViewportAttributesChanged):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebPage/WebPage.messages.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
input element with placeholder text and width set to 100% on focus causes overflow even after losing focus
https://bugs.webkit.org/show_bug.cgi?id=109020

Reviewed by David Hyatt.

Source/WebCore:

Tests: fast/forms/input-placeholder-layout-view.html
       fast/forms/textarea-placeholder-layout-view.html

Placeholder elements don't affect layout so shouldn't contribute overflow either.

* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):

LayoutTests:

* fast/forms/input-placeholder-layout-view-expected.html: Added.
* fast/forms/input-placeholder-layout-view.html: Added.
* fast/forms/textarea-placeholder-layout-view-expected.html: Added.
* fast/forms/textarea-placeholder-layout-view.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make intrinsic width values work for positioned elements
https://bugs.webkit.org/show_bug.cgi?id=110264

Reviewed by Tony Chang.

Source/WebCore:

Tests: fast/css-intrinsic-dimensions/intrinsic-sized-absolutes.html
       fast/css-intrinsic-dimensions/width-shrinks-avoid-floats.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeIntrinsicLogicalWidthUsing):
(WebCore::RenderBox::computeLogicalWidthInRegionUsing):
Move the computation of intrinsic widths out into a helper function so that
computePositionedLogicalWidthUsing can use it. As per the current spec,
fill-available measures shrink to avoid floats. http://dev.w3.org/csswg/css3-sizing/

(WebCore::RenderBox::computePositionedLogicalWidth):
Compute intrinsic min-widths in addition to non-zero ones. Intrinsic widths
return true for isZero. width and max-width don't need modifying since they already
call computePositionedLogicalWidthUsing for intrinsic widths.

(WebCore::RenderBox::computePositionedLogicalWidthUsing):
Compute intrinsic widths and use a Fixed length for the rest of the positioned width
computation. Doesn't include bordersPlusPadding because the caller, expected the content
width and adds in the bordersPlusPadding later.

* rendering/RenderBox.h:

LayoutTests:

* fast/css-intrinsic-dimensions/intrinsic-sized-absolutes-expected.txt: Added.
* fast/css-intrinsic-dimensions/intrinsic-sized-absolutes.html: Added.
* fast/css-intrinsic-dimensions/width-shrinks-avoid-floats-expected.txt: Added.
* fast/css-intrinsic-dimensions/width-shrinks-avoid-floats.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove stretchesToMinIntrinsicLogicalWidth
https://bugs.webkit.org/show_bug.cgi?id=110266

Reviewed by Emil Eklund.

This was only used by fieldsets and now we have a way to express this
concept in CSS.

* WebCore.order:
* css/html.css:
Make fieldsets min-width: -webkit-min-content.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInRegion):
(WebCore::RenderBox::computePositionedLogicalWidth):
* rendering/RenderBox.h:
Remove all calls to stretchesToMinIntrinsicLogicalWidth.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143479 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] use a WebTestProxyBase pointer to identify the window we need the history for
https://bugs.webkit.org/show_bug.cgi?id=110346

Reviewed by Adam Barth.

Using an index is very brittle, as the TestRunner API does not define
any ordering of windows.

Also, make TestRunner::shouldDumpBackForwardList() so content shell can
trigger the capturing in the browser process before generating the
text dump.

* DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
(WebTestRunner):
(WebTestRunner::WebTestDelegate::captureHistoryForWindow):
* DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):
* DumpRenderTree/chromium/TestRunner/src/WebTestProxy.cpp:
(WebTestRunner::WebTestProxyBase::captureTree):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::captureHistoryForWindow):
* DumpRenderTree/chromium/WebViewHost.h:
(WebViewHost):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
No caret on empty contenteditable element with negative text-indent
https://bugs.webkit.org/show_bug.cgi?id=108633

Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: fast/repaint/paint-caret-in-div-with-negative-indent.html

When an editable element has a negative text indent we won't paint the caret when the
element is empty because it falls outside the element's border box. To ensure the caret is painted,
account for any negative indent with our overflow.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeOverflow):

LayoutTests:

* fast/repaint/paint-caret-in-div-with-negative-indent-expected.png: Added.
* fast/repaint/paint-caret-in-div-with-negative-indent-expected.txt: Added.
* fast/repaint/paint-caret-in-div-with-negative-indent.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[New Multicolumn] Column gap is computed incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=110360.

Reviewed by Simon Fraser.

Source/WebCore: 

Test: fast/multicol/newmulticol/layers-split-across-columns.html.

* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::columnGap):
Make sure we ask the RenderMultiColumnBlock for the gap rather than our
own style, since we don't actually have the gap value in our style.
        
(WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
* rendering/RenderMultiColumnSet.h:
Fix another spot where the columnGap was an int. It should be a LayoutUnit.

LayoutTests: 

* fast/multicol/newmulticol/layers-split-across-columns-expected.html: Added.
* fast/multicol/newmulticol/layers-split-across-columns.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[New Multicolumn] RenderMultiColumnFlowThreads should establish a BFC.
https://bugs.webkit.org/show_bug.cgi?id=110366.

Reviewed by Antti Koivisto.

Source/WebCore: 

RenderFlowThreads should establish a block formatting context always.
CSS Regions have named flow thread that they absolutely position, and so
they got this for free by being absolutely positioned.
        
RenderMultiColumnFlowThreads, however, are relative positioned, so we need
to just add an isRenderFlowThread case specifically so we're not dependent
on the positioning scheme used for the flow thread to establish the BFC.
        
Test: fast/multicol/newmulticol/float-*.html.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::MarginInfo::MarginInfo):

LayoutTests: 

* fast/multicol/newmulticol/float-avoidance-expected.html: Added.
* fast/multicol/newmulticol/float-avoidance.html: Added.
* fast/multicol/newmulticol/float-multicol-expected.html: Added.
* fast/multicol/newmulticol/float-multicol.html: Added.
* fast/multicol/newmulticol/float-paginate-complex-expected.html: Added.
* fast/multicol/newmulticol/float-paginate-complex.html: Added.
* fast/multicol/newmulticol/float-paginate-empty-lines-expected.html: Added.
* fast/multicol/newmulticol/float-paginate-empty-lines.html: Added.
* fast/multicol/newmulticol/float-paginate-expected.html: Added.
* fast/multicol/newmulticol/float-paginate.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        ResourceHandle::loadResourceSynchronously should have blob support in cross-platform code
        https://bugs.webkit.org/show_bug.cgi?id=110364

        Reviewed by Anders Carlsson.

        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::loadResourceSynchronously):
        Added a cross-platform version to keep blob-related logic in one place.

        * platform/network/blackberry/ResourceHandleBlackBerry.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/qt/ResourceHandleQt.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/win/ResourceHandleWin.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        Renamed loadResourceSynchronously to platformLoadResourceSynchronously,
        removed blob handling from platforms that had it.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Moar hardening
https://bugs.webkit.org/show_bug.cgi?id=110275

Reviewed by Mark Hahnenberg.

We now poison objects when they get freed, and verify that
any object that is being freed is not poisoned.  If the
object looks like it's poisoned we validate the freelist,
and ensure the object is not already present.  If it is
we crash.

On allocation, we ensure that the object being allocated
is poisoned, then clear the poisoning fields.

* wtf/FastMalloc.cpp:
(WTF::internalEntropyValue):
(WTF):
(WTF::freedObjectStartPoison):
(WTF::freedObjectEndPoison):
(TCMalloc_ThreadCache_FreeList):
(WTF::TCMalloc_ThreadCache_FreeList::Validate):
(WTF::TCMalloc_Central_FreeList::Populate):
(WTF::TCMalloc_ThreadCache::Allocate):
(WTF::TCMalloc_ThreadCache::Deallocate):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup the SQLTransaction and SQLTransactionBackend state dispatch
to only honor a state transition request if the associated database
hasn't been interrupted.
https://bugs.webkit.org/show_bug.cgi?id=110247.

Reviewed by Antti Koivisto.

No new tests.

* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::performPendingCallback):
(WebCore::SQLTransaction::computeNextStateAndCleanupIfNeeded):
* Modules/webdatabase/SQLTransaction.h:
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::computeNextStateAndCleanupIfNeeded):
(WebCore::SQLTransactionBackend::performNextStep):
* Modules/webdatabase/SQLTransactionBackend.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderLayerBacking should initialize TiledBacking's isInWindow state with Page's isInWindow, not isOnscreen
https://bugs.webkit.org/show_bug.cgi?id=110370
<rdar://problem/13254006>

Reviewed by Simon Fraser.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make the test land in r143482 less platform-specific

Add outline:none to the test so platform-specific outlines don't kick in and
make us require separate results for Mac and Linux.

Unreviewed, gardening.

* fast/repaint/paint-caret-in-div-with-negative-indent-expected.png:
* fast/repaint/paint-caret-in-div-with-negative-indent.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Move WebKitPlatformSupport declaration to Platform.h
https://bugs.webkit.org/show_bug.cgi?id=110262

Reviewed by Adam Barth.

In preparation for removing WebKitPlatformSupport.h entirely (once
downstream references to that file have been updated). Part of a
larger refactoring series; see tracking bug 82948.

Source/Platform:

* chromium/public/Platform.h:
(WebKitPlatformSupport):
(WebKit::WebKitPlatformSupport::~WebKitPlatformSupport):
(WebKit):

Source/WebKit/chromium:

* public/platform/WebKitPlatformSupport.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed gardening.

Patch by Ian Vollick <vollick@chromium.org> on 2013-02-20

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[SVG] Update of element referenced by multiple 'use' nodes is absurdly slow
https://bugs.webkit.org/show_bug.cgi?id=97905

Reviewed by Dirk Schulze.

Rebuilding the shadow and instance trees of dependent use nodes recursively can be
extremely inefficient with non-trivial dependency graphs (the trees are not constructed
in topological order).

To avoid redundant buildShadowAndInstanceTree() invokations, separate the invalidation
phase from the actual tree (re)building phase, and only descend into the dependency DAG
during the invalidation phase (recursion also stops at nodes that have been previously
invalidated).

No new tests: functional coverage provided by existing tests, perfomance tracked by
PerformanceTests/SVG/SvgNestedUse.html.

* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::buildPendingResource):
(WebCore::SVGUseElement::buildShadowAndInstanceTree):
(WebCore::SVGUseElement::invalidateShadowTree):
(WebCore):
(WebCore::SVGUseElement::invalidateDependentShadowTrees):
* svg/SVGUseElement.h:
(SVGUseElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unnecessary includes for Platform.h from headers
https://bugs.webkit.org/show_bug.cgi?id=110300

Patch by Laszlo Gombos <l.gombos@samsung.com> on 2013-02-20
Reviewed by Alexey Proskuryakov.

Source/WebCore:

wtf/Platform.h only need to be included in a few places directly
as it is included in config.h. Remove the unnecessay duplicate as
it can be confusing.

No new tests, no change in functionality.

* platform/SecureTextInput.h:
* platform/audio/Biquad.h:
* platform/audio/FFTFrame.h:
* platform/graphics/cpu/arm/filters/FEBlendNEON.h:
* platform/graphics/cpu/arm/filters/NEONHelpers.h:
* platform/graphics/filters/FELighting.h:

Source/WebKit2:

wtf/Platform.h only need to be included in a few places directly
as it is included in config.h. Remove the unnecessay duplicate as
it can be confusing.

* Shared/PrintInfo.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed gardening.

Patch by Ian Vollick <vollick@chromium.org> on 2013-02-20

* platform/chromium/TestExpectations:

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