Correctly maintain the "isInWindow" state for all TiledBackings
https://bugs.webkit.org/show_bug.cgi?id=133095

Reviewed by Tim Horton.

We never updated the "isInWindow" state for TiledBacking that wasn't the RenderView's
backing. Fix it by having RenderLayerCompositor::setIsInWindow() recurse through all
layers (if necessary), updating their state. Also set the state on newly created
TiledBackings.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTiledBackingUsageChanged):
(WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::pageTiledBacking): Deleted.
* rendering/RenderLayerCompositor.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Scrolling pages with large TiledBacking content layers creates way too many tiles
https://bugs.webkit.org/show_bug.cgi?id=133101

Reviewed by Tim Horton.

Fix the GraphicsLayerCA::adjustTiledLayerVisibleRect() logic to avoid making giant rects if the old
and new visible rects don't overlap.

* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):
* platform/graphics/ca/mac/TileController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Test gardening: skip some failing tests on not-X86.


Source/JavaScriptCore: 
* tests/mozilla/mozilla-tests.yaml:

LayoutTests: 
* js/script-tests/function-apply-many-args.js:



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

Rebaseline affected tests by changes on integral snapping of inlines
introduced at r169048.

Patch by Lorenzo Tilve <ltilve@igalia.com> on 2014-05-20

* platform/gtk/css1/box_properties/float_on_text_elements-expected.txt:
* platform/gtk/css1/text_properties/text_indent-expected.txt:
* platform/gtk/css2.1/t0905-c414-flt-wrap-00-e-expected.txt:
* platform/gtk/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt:
* platform/gtk/css2.1/t100801-c544-valgn-00-a-ag-expected.txt:
* platform/gtk/css2.1/t100801-c544-valgn-02-d-agi-expected.txt:
* platform/gtk/css2.1/t100801-c544-valgn-03-d-agi-expected.txt:
* platform/gtk/css2.1/t100801-c544-valgn-04-d-agi-expected.txt:
* platform/gtk/css2.1/t1601-c547-indent-00-b-a-expected.txt:
* platform/gtk/fast/block/float/026-expected.txt:
* platform/gtk/fast/block/float/028-expected.txt:
* platform/gtk/fast/css/empty-pseudo-class-expected.txt:
* platform/gtk/fast/css/first-child-pseudo-class-expected.txt:
* platform/gtk/fast/css/first-of-type-pseudo-class-expected.txt:
* platform/gtk/fast/css/last-child-pseudo-class-expected.txt:
* platform/gtk/fast/css/last-of-type-pseudo-class-expected.txt:
* platform/gtk/fast/css/only-child-pseudo-class-expected.txt:
* platform/gtk/fast/css/only-of-type-pseudo-class-expected.txt:
* platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/gtk/fast/line-grid/line-align-left-edges-expected.txt:
* platform/gtk/fast/multicol/column-count-with-rules-expected.txt:
* platform/gtk/fast/multicol/float-multicol-expected.txt:
* platform/gtk/fast/multicol/layers-in-multicol-expected.txt:
* platform/gtk/fast/multicol/vertical-lr/float-multicol-expected.txt:
* platform/gtk/fast/multicol/vertical-rl/float-multicol-expected.txt:
* platform/gtk/fast/regions/multiple-directionality-changes-in-variable-width-regions-expected.txt:
* platform/gtk/fast/regions/repaint/line-flow-with-floats-in-regions-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-1-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-10-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-2-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-3-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-4-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-5-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-6-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-7-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-8-expected.txt:
* platform/gtk/fast/repaint/line-flow-with-floats-9-expected.txt:
* platform/gtk/fast/text/whitespace/024-expected.txt:
* platform/gtk/svg/wicd/rightsizing-grid-expected.txt:
* platform/gtk/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Crash while painting block selection gaps in regions
https://bugs.webkit.org/show_bug.cgi?id=132720

Reviewed by David Hyatt.

Source/WebCore:
The fix for WebKit bug https://bugs.webkit.org/show_bug.cgi?id=131511
allowed selection highlight to match the DOM selection when the start
and end point of the selection were in different flow threads. In order
to enable that, the selection was performed separately on view and
render flow threads, considered selection subtrees.

However, the start and end points for each selection subtree were computed
by means of Range class but it is not always possible to construct a valid
Range from two pairs of RenderObjects and offsets.

This patch keeps the substrees approach but instead of storing the endpoints
for each subtree in a Range and continuously extending the Range, it stores them
using the already available SelectionSubtreeRoot class. After the end points are
computed for each subtree and before processing the subtree selection, the end points
are adjusted in a similar fashion as the one used in FrameSelection::updateAppearance(),
to make sure we are passing the same expected information to the method implementing
the visible selection processing.

Test: fast/regions/selection-gaps-paint-crash.html

* rendering/RenderView.cpp:
(WebCore::RenderView::splitSelectionBetweenSubtrees):
* rendering/SelectionSubtreeRoot.cpp:
(WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
* rendering/SelectionSubtreeRoot.h:
(WebCore::SelectionSubtreeRoot::selectionClear):

LayoutTests:
* TestExpectations: Unskip a test that was crashing
* fast/regions/selection-gaps-paint-crash-expected.txt: Added.
* fast/regions/selection-gaps-paint-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(CMAKE): [GTK] Several WebKit2GTK+ unit tests are no longer built
https://bugs.webkit.org/show_bug.cgi?id=133117

Reviewed by Philippe Normand.

Bring back missing tests to the build.

* TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Add polygon tests for shapes on regions and shapes on the content flow
https://bugs.webkit.org/show_bug.cgi?id=133107

Reviewed by Mihnea Ovidenie.

* fast/regions/shape-outside-floats/regions-shape-outside-region-polygon-floats-expected.html: Added.
* fast/regions/shape-outside-floats/regions-shape-outside-region-polygon-floats.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Rename translation domain as WebKit2GTK-3.0
https://bugs.webkit.org/show_bug.cgi?id=132953

Reviewed by Gustavo Noronha Silva.

.:
* Source/cmake/OptionsGTK.cmake:

Source/WebCore/platform/gtk/po:
* CMakeLists.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Double-tap zoom does not take obscuring insets into account
https://bugs.webkit.org/show_bug.cgi?id=133116
<rdar://problem/16765604>

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
        
    Compute the zoom target taking insets into account.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Block incorrectly sized when containing an unsplittable box
https://bugs.webkit.org/show_bug.cgi?id=132601

Reviewed by Antti Koivisto.

Source/WebCore:
When laying out elements in a region, when an inline element is encountered
the size of its parent must not be increased beyond the bottom of the current region,
unless if its the last region. This will ensure that the next sibling of the
inline element is correctly laid out at the top of the next region, instead
of leaving an empty space equal to the height of the overflow, as it did until now.

Tests: fast/regions/inline-block-inside-anonymous-overflow.html
       fast/regions/inline-block-overflow.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustLinePositionForPagination):
(WebCore::RenderBlockFlow::hasNextPage):
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
(WebCore::RenderBlockFlow::determineStartPosition):
(WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):

LayoutTests:
Added tests for the layout of elements following inline-block elements
that overflow their region, with and without anonymous blocks.

* fast/regions/inline-block-inside-anonymous-overflow-expected.html: Added.
* fast/regions/inline-block-inside-anonymous-overflow.html: Added.
* fast/regions/inline-block-overflow-expected.html: Added.
* fast/regions/inline-block-overflow.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make fast/dom/remove-element-with-{id|name}-that-was-inserted-on-DOMNodeRemoved.html reliable
<http://webkit.org/b/133088>

Reviewed by Alexey Proskuryakov.

* fast/dom/remove-element-with-id-that-was-inserted-on-DOMNodeRemoved.html:
* fast/dom/remove-element-with-name-that-was-inserted-on-DOMNodeRemoved.html:
- Use waitUntilDone()/notifyDone() to make the tests reliable
  since they use setTimeout().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] WebKitWebPage::send-request always pass a valid pointer for redirected response
https://bugs.webkit.org/show_bug.cgi?id=133119

Reviewed by Sergio Villar Senin.

Source/WebKit2:
The problem is that we were checking whether the passed in
WKURLResponseRef is NULL or not, but it's always a valid object
that can contain a NULL WebCore::ResourceResponse.

* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(willSendRequestForFrame): Pass NULL as redirect-response
parameter of WebKitWebPage::send-request signal when the
WebCore::ResourceResponse of the passed in WKURLResponseRef is NULL.

Tools:
Check that redirect response parameter of
WebKitWebPage::send-request signal is NULL when not redirecting
and a valid WebKitURIResponse object when redirecting.

* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
(testWebResourceSendRequest):
(serverCallback):
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(sendRequestCallback):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move WebKitTestRunner to std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=133081

Reviewed by Daniel Bates.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didCreatePage):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::runTest):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/WorkQueueManager.cpp:
(WTR::WorkQueueManager::processWorkQueue):
(WTR::WorkQueueManager::enqueue):
* WebKitTestRunner/WorkQueueManager.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a header comment
https://bugs.webkit.org/show_bug.cgi?id=133123
<rdar://problem/16973783>

Reviewed by Geoffrey Garen.

* UIProcess/API/Cocoa/WKUserContentController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Curl] Invalid content in cache file, causes broken rendering.
https://bugs.webkit.org/show_bug.cgi?id=133069

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-05-20
Reviewed by Brent Fulgham.

When data for a url is received as multiple parts, the cache file for the url is truncated when opened for writing,
and will only contain the last part of data received.
This is fixed by only opening the file once, and close it after all data has been received.

* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::CurlCacheEntry): Initialize cache file handle member.
(WebCore::CurlCacheEntry::~CurlCacheEntry): Close cache file.
(WebCore::CurlCacheEntry::saveCachedData): Only open cache file once to avoid truncating.
(WebCore::CurlCacheEntry::didFail): Close cache file.
(WebCore::CurlCacheEntry::didFinishLoading): Ditto.
(WebCore::CurlCacheEntry::openContentFile): Added method to open cache file.
(WebCore::CurlCacheEntry::closeContentFile): Added method to close cache file.
* platform/network/curl/CurlCacheEntry.h: Added file handle member, and methods to open and close cache file.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip http/tests/inspector/replay/document-last-modified-fallback-value.html since it asserts.

* TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r169105): fast/regions/cssom/region-range-for-box-crash.html is more crashy than before
https://bugs.webkit.org/show_bug.cgi?id=133124

* TestExpectations: Skip it.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Only set title on SVG documents
https://bugs.webkit.org/show_bug.cgi?id=133068

Patch by Prashant Hiremath <hiremathprashants@gmail.com> on 2014-05-20
Reviewed by Dirk Schulze.

Source/WebCore:
Test: svg/custom/html_document_set_title.html

* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::insertedInto):
(WebCore::SVGTitleElement::removedFrom):
(WebCore::SVGTitleElement::childrenChanged):

LayoutTests:
* svg/custom/html_document_set_title-expected.txt: Added.
* svg/custom/html_document_set_title.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix web timing assertion failure.
https://bugs.webkit.org/show_bug.cgi?id=133094
<rdar://problem/16966032>

Patch by Alex Christensen <achristensen@webkit.org> on 2014-05-20
Reviewed by Alexey Proskuryakov.

* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::getConnectionTimingData):
Set requestStart and responseStart to 0 instead of -1 to match the
ResourceLoadTiming constructor and prevent the assertion failure in
PerformanceTiming::responseStart.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted
https://bugs.webkit.org/show_bug.cgi?id=133111

Reviewed by David Hyatt.

Source/WebCore:
When computing the repaint rect of an element flowed into a flow thread, if the element is flowed directly into
the flow thread (meaning its containing block is the flow thread itself), the region's position within the flow
must no longer be taken into consideration, because its already included in the element's |topLeft|.

Test: fast/regions/hover-element-flowed-second-region.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):

LayoutTests:
Added test for the correct repaint of an element flowed directly into the second region of a flow thread.

* fast/regions/hover-element-flowed-second-region-expected.html: Added.
* fast/regions/hover-element-flowed-second-region.html: Added.


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