REGRESSION (r137607): Cannot download files, stuck in “Preparing to download”
https://bugs.webkit.org/show_bug.cgi?id=105044

Reviewed by Antti Koivisto.

The work done by DocumentLoader::mainReceivedError() changed subtly in r137607,
such that it cancels the ResourceHandle. We want to treat switching to a download
like a failure, where WebCore assumes that the load is finished, and no
cancellation is required.

No new tests, tested manually by verifying that downloading files works in
Safari Mac.

* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::continueAfterContentPolicy):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::cancel): Remove the workaround added in r137763.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r138011.
http://trac.webkit.org/changeset/138011
https://bugs.webkit.org/show_bug.cgi?id=105272

WebInspector: Broke request selection in the Network panel

* inspector/front-end/CookiesTable.js:
(WebInspector.CookiesTable):
* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkPanel.prototype._toggleGridMode):
(WebInspector.NetworkPanel.prototype._toggleViewingRequestMode):
(WebInspector.NetworkDataGridNode.prototype.createCells):
(WebInspector.NetworkDataGridNode.prototype.get selectable):

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

Fixed malformed entry on the WK2 expectations file.

* platform/wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] When creating new windows, use the opener's context
https://bugs.webkit.org/show_bug.cgi?id=105283

Reviewed by Laszlo Gombos.

Use the context of the opener if exists.

* MiniBrowser/efl/main.c:
(on_key_down):
(on_window_create):
(window_create):
(elm_main):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Network] Ordering of cookies displayed is nondeterministic.
https://bugs.webkit.org/show_bug.cgi?id=105272

Patch by Eugene Klyuchnikov <eustas@chromium.org> on 2012-12-18
Reviewed by Vsevolod Vlasov.

This patch fixes double-selection of request and sets default ordering
of cookies.

* inspector/front-end/CookiesTable.js: By default sort by name.
* inspector/front-end/NetworkPanel.js: Do not fire "select" on
mouse-click in viewing-request mode.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add in-band text track cues only once
https://bugs.webkit.org/show_bug.cgi?id=104593

Reviewed by Dean Jackson.

Source/WebCore:

Test: media/track/track-in-band-cues-added-once.html

* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::hasCue): New.
* html/track/InbandTextTrack.h:

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::setCueSettings): Remember the raw cue settings so they can be accessed later.
* html/track/TextTrackCue.h:

* platform/graphics/InbandTextTrackPrivateClient.h: Declare hasCue.

* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processCue): Early return if m_player has been cleared.
(WebCore::InbandTextTrackPrivateAVF::setMode): Ditto.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::seek): Clear the partially accumulated cue when the seek
    starts, not when it completes.
(WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::flushCurrentCue): Don't add a cue if it is already in the
    text track cue list.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::clearTextTracks): Drive-by cleanup, clear the track list completely.

LayoutTests:

Test to ensure that in-band text track cues are not added to the the cue list more than once.

* media/track/track-in-band-cues-added-once-expected.txt: Added.
* media/track/track-in-band-cues-added-once.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] ImageDiff does not build on WebKit2 only builds
https://bugs.webkit.org/show_bug.cgi?id=105288

Reviewed by Kenneth Rohde Christiansen.

Moved ImageDiff to the efl/ folder inside Tools/ (so we don't pollute
the folder with things which are EFL-specific.

ImageDiff will be built by default now regardless of WebKit API flavor
you choose.

* CMakeLists.txt:
* DumpRenderTree/efl/CMakeLists.txt:
* efl/ImageDiff/CMakeLists.txt: Added.
* efl/ImageDiff/ImageDiff.cpp: Renamed from Tools/DumpRenderTree/efl/ImageDiff.cpp.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Styles] Selector matches are not marked after property editing
https://bugs.webkit.org/show_bug.cgi?id=105284

Reviewed by Vsevolod Vlasov.

Once a property edit is committed, the selector markup is reset and needs to be re-applied.

* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylePropertiesSection.prototype.update):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed gardening: marking test as flaky on Linux Dbg bot.
http://webkit.org/b/86114

Unreviewed gardening.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Restructure the render queue to process multiple tiles at once.
https://bugs.webkit.org/show_bug.cgi?id=105199
RIM PR 260232

Reviewed by George Staikos.
Internally reviewed by Arvid Nilsson.

Since my last big commit, r136442, the BackingStore's render()
function is able to fetch multiple back buffers and swap them
into the user interface thread in one go. However, it turns out
that this is not enough to actually render to all of the
available back buffers at once. The RenderQueue class was still
working with a model based on processing one rectangle after
another.

This commit rewrites large parts of RenderQueue to issue
render() calls for multiple tiles at once. As WebCore painting
gets cheaper and blocking becomes more of an issue, this commit
does away with paints smaller than tile size and always renders
whole tiles at once. This means the demise of RenderRect.
As an additional benefit, this means we can remove the
copyPreviousContentsToTileBuffer() function which caused
potential threading issues as it was accessing a buffer
now owned by the UI thread from the WebKit thread.

RenderQueue is also smarter than before in assigning batches,
it now takes into account the number of available back buffers
for rendering as well as excludes tiles outside contents
boundaries. Regular render jobs continue being tracked as
regions (and are being issued to didRenderContent()) with only
the changed content regions. Everything else switches over to
tile index lists from previously lists of rectangles.
By default, we render as many tiles at once as we can grab
back buffers, or until a given set of jobs is done.
For high-priority jobs, render() will be called in a loop.

To allow for the necessary changes in render() and improve
reliability in the same go, we now call render() almost
exclusively through RenderQueue. Other places would often
call renderVisibleContents() in situations where rendering
is not possible, geometries don't get updated, or content
rendered notifications would not get issued to the client.
By replacing renderVisibleContents() with a scheduled
high-priority queue that's immediately being processed
(but only if possible), these problems go away.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::resumeScreenUpdates):
(BlackBerry::WebKit::BackingStorePrivate::repaint):
(BlackBerry::WebKit::BackingStorePrivate::slowScroll):
(BlackBerry::WebKit::BackingStorePrivate::renderJob):
(BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect):
(BlackBerry::WebKit::BackingStorePrivate::updateTilesAfterBackingStoreRectChange):
(BlackBerry::WebKit::BackingStorePrivate::indexesForBackingStoreRect):
(BlackBerry::WebKit::BackingStorePrivate::clearAndUpdateTileOfNotRenderedRegion):
(BlackBerry::WebKit::BackingStorePrivate::isCurrentVisibleJob):
(BlackBerry::WebKit::BackingStorePrivate::renderDirectToWindow):
(BlackBerry::WebKit::BackingStorePrivate::render):
(BlackBerry::WebKit::BackingStorePrivate::renderAndBlitVisibleContentsImmediately):
(BlackBerry::WebKit::BackingStorePrivate::renderAndBlitImmediately):
(BlackBerry::WebKit::BackingStorePrivate::paintDefaultBackground):
(BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):
(BlackBerry::WebKit::BackingStorePrivate::compositeContents):
(BlackBerry::WebKit::BackingStorePrivate::visibleTileIndexes):
(BlackBerry::WebKit::BackingStorePrivate::resetTiles):
(BlackBerry::WebKit::BackingStorePrivate::updateTilesForScrollOrNotRenderedRegion):
(BlackBerry::WebKit::BackingStorePrivate::updateTile):
(BlackBerry::WebKit::BackingStorePrivate::transformChanged):
(BlackBerry::WebKit::BackingStorePrivate::didRenderContent):
* Api/BackingStore_p.h:
(BackingStorePrivate):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setLoadState):
(BlackBerry::WebKit::WebPagePrivate::zoomAboutPoint):
(BlackBerry::WebKit::WebPagePrivate::resumeBackingStore):
* Api/WebPageCompositor.cpp:
(BlackBerry::WebKit::WebPageCompositorPrivate::animationFrameChanged):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDidLayout):
* WebKitSupport/RenderQueue.cpp:
(BlackBerry::WebKit::compareRectOneDirection):
(BlackBerry::WebKit::tileIndexIsLessThan):
(WebKit):
(BlackBerry::WebKit::tileIndexLessThanFunction):
(BlackBerry::WebKit::TileIndexLessThan::TileIndexLessThan):
(BlackBerry::WebKit::TileIndexLessThan::operator()):
(TileIndexLessThan):
(BlackBerry::WebKit::RenderQueue::reset):
(BlackBerry::WebKit::RenderQueue::isEmpty):
(BlackBerry::WebKit::RenderQueue::hasCurrentRegularRenderJob):
(BlackBerry::WebKit::RenderQueue::hasCurrentVisibleZoomJob):
(BlackBerry::WebKit::RenderQueue::hasCurrentVisibleScrollJob):
(BlackBerry::WebKit::RenderQueue::isCurrentVisibleZoomJob):
(BlackBerry::WebKit::RenderQueue::isCurrentVisibleZoomJobCompleted):
(BlackBerry::WebKit::RenderQueue::isCurrentVisibleScrollJob):
(BlackBerry::WebKit::RenderQueue::isCurrentVisibleScrollJobCompleted):
(BlackBerry::WebKit::RenderQueue::isCurrentRegularRenderJob):
(BlackBerry::WebKit::RenderQueue::tileIndexesIntersectingRegion):
(BlackBerry::WebKit::RenderQueue::tileIndexesFullyContainedInRegion):
(BlackBerry::WebKit::RenderQueue::tileRegion):
(BlackBerry::WebKit::RenderQueue::addToQueue):
(BlackBerry::WebKit::RenderQueue::addToRegularQueue):
(BlackBerry::WebKit::RenderQueue::addToScrollZoomQueue):
(BlackBerry::WebKit::RenderQueue::quickSort):
(BlackBerry::WebKit::RenderQueue::visibleContentChanged):
(BlackBerry::WebKit::RenderQueue::backingStoreRectChanging):
(BlackBerry::WebKit::RenderQueue::clear):
(BlackBerry::WebKit::RenderQueue::clearRegions):
(BlackBerry::WebKit::RenderQueue::clearTileIndexes):
(BlackBerry::WebKit::RenderQueue::render):
(BlackBerry::WebKit::RenderQueue::renderRegularRenderJobs):
(BlackBerry::WebKit::RenderQueue::renderScrollZoomJobs):
(BlackBerry::WebKit::RenderQueue::scrollZoomJobsCompleted):
* WebKitSupport/RenderQueue.h:
(WebKit):
(RenderQueue):
* WebKitSupport/SurfacePool.cpp:
(BlackBerry::WebKit::SurfacePool::numberOfAvailableBackBuffers):
(BlackBerry::WebKit::SurfacePool::takeBackBuffer):
* WebKitSupport/SurfacePool.h:
(SurfacePool):
* WebKitSupport/TileIndex.h:
(WebKit):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r137979.
http://trac.webkit.org/changeset/137979
https://bugs.webkit.org/show_bug.cgi?id=105311

nodeName returned by the inspector protocol commands should
match one accessible fro JS (Requested by yurys_ on #webkit).

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

Source/WebCore:

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):

LayoutTests:

* inspector/elements/shadow-dom-modify-chardata-expected.txt:
* inspector/elements/shadow-root-expected.txt:
* inspector/elements/shadow-root.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Have kFixedPointDenominator be constant across ports
https://bugs.webkit.org/show_bug.cgi?id=104843

Source/WebCore:

Reviewed by Julien Chaffraix.

Currently the kFixedPointDenominator constant is set to either
64 or 1 depending on the SUBPIXEL_LAYOUT flag. As this constant
is used to limit the range of supported values this results in
inconsistencies across ports.

Change kFixedPointDenominator to always be 64 and introduce a
new constant (kEffectiveFixedPointDenominator) that varies.
This ensures that the same range of values are supported across
ports regardless of the SUBPIXEL_LAYOUT flag.

Covered by fast/css/large-numbers.html and fast/css/large-number-round-trip.html

* platform/LayoutUnit.h:
Add kEffectiveFixedPointDenominator constant and change
LayoutUnit code to use it instead of kFixedPointDenominator
which is now set to 64 regardless of the SUBPIXEL_LAYOUT flag.

LayoutTests:

Reviewed by Julien Chaffraix.

Unskip the following tests on efl, qt and gtk:
fast/css/large-number-round-trip.html
fast/css/large-numbers.html

Remove platform specific results for large-number-round-trip.html.

* fast/css/large-number-round-trip-expected.txt:
* platform/chromium/fast/css/large-number-round-trip-expected.txt: Removed.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/fast/css/large-number-round-trip-expected.txt: Removed.
* platform/qt/TestExpectations:


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

Added new baselines marked tests flaky due to Accessibility code
crashes.

* platform/efl-wk2/TestExpectations:
* platform/efl-wk2/editing/selection/move-by-character-6-expected.png: Added.
* platform/efl-wk2/editing/selection/move-by-character-6-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Remove the visible tile buffer from the BackingStore.
https://bugs.webkit.org/show_bug.cgi?id=105302
RIM PR 260232

Reviewed by George Staikos.

The visible tile buffer was introduced as an additional
buffering solution that was necessary because other
buffers would only cover part of the screen and could
only be swapped one by one, with long blocking calls
between each newly rendered tile. By carrying an old copy
of all tiles at once, we were avoiding checkerboard and
visual artifacts during load time when much zoom-to-fit
action is going on.

These days, the visual tile buffer hurts more than it helps,
not only taking up lots of memory but also requiring
complexity that we'd rather get rid of. Now that multiple
buffers are being swapped into the user interface thread
at once, the need for the visible tile buffer is no longer
there and can be exchanged for standard geometry behavior.

This patch simply deletes the visible tile buffer to use
existing other code instead. Differences in behavior are
non-existent or negligible.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):
(BlackBerry::WebKit::BackingStorePrivate::transformChanged):
(BlackBerry::WebKit::BackingStorePrivate::orientationChanged):
(BlackBerry::WebKit::BackingStorePrivate::createSurfaces):
* Api/BackingStore_p.h:
(BackingStorePrivate):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):
* WebKitSupport/SurfacePool.cpp:
(BlackBerry::WebKit::SurfacePool::SurfacePool):
(BlackBerry::WebKit::SurfacePool::initialize):
(BlackBerry::WebKit::SurfacePool::createBuffers):
(BlackBerry::WebKit::SurfacePool::releaseBuffers):
* WebKitSupport/SurfacePool.h:
(SurfacePool):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, promoting myself to committer's list

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138029 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=105175

Patch by peavo@outlook.com <peavo@outlook.com> on 2012-12-18
Reviewed by Simon Fraser.

* rendering/RenderLayer.h: Compile fixes for USE(ACCELERATED_COMPOSITING) mismatch.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, adding secondary email.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix the ARMv7 build after r137976
https://bugs.webkit.org/show_bug.cgi?id=105270

Reviewed by Csaba Osztrogonác.

Add default value for Jump parameter to fix build.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::Jump::Jump):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Allow the build system to detect EGL support.
https://bugs.webkit.org/show_bug.cgi?id=105287

Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2012-12-18
Reviewed by Laszlo Gombos.

Currently, we don't have any way to determine if EGL is supported by the build.
This patch adds support for this. The patch doesn't make any changes to take this into
use. This will be done in another patch.

* Source/cmake/FindEGL.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Inspector] Add frameId for frame owner nodes.
https://bugs.webkit.org/show_bug.cgi?id=105317

Patch by Ken Kania <kkania@chromium.org> on 2012-12-18
Reviewed by Pavel Feldman.

This is needed to translate from a node ID to the execution context ID for
evaluating scripts in the associated frame.

* inspector/Inspector.json:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):

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