Fix the Mac build sans ENABLE(CSS_FILTERS)

Reviewed by Darin Adler.

Include FloatRect in RemoteGraphicsLayer.mm; it's included by chance currently,
via something that must be compiled out without CSS_FILTERS (or SVG, or shaders, or something).

* WebProcess/WebPage/mac/RemoteGraphicsLayer.mm:

Move an export from a USE(ACCELERATED_COMPOSITING) block to a ENABLE(CSS_FILTERS)
block, to match the code that backs it.

* WebCore.exp.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] TiledCoreAnimationDrawingArea should unparent its layer tree when requested
https://bugs.webkit.org/show_bug.cgi?id=107108
<rdar://problem/12549879>

Reviewed by Darin Adler and Simon Fraser.

Currently, TiledCoreAnimationDrawingArea returns early if asked to unparent
its layer tree, to prevent flashing when switching tabs. We have new plans
to alleviate the flashing, but first, we should reinstate unparenting the root layer,
to allow underlying libraries to better manage the memory backing all compositing layers.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140002 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Network] Remove boilerplate CSS selectors.
https://bugs.webkit.org/show_bug.cgi?id=107121

Patch by Eugene Klyuchnikov <eustas@chromium.org> on 2013-01-17
Reviewed by Vsevolod Vlasov.

There are rules that are used for filtration and styling
whose selectors should be autogenerated.

* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkPanel.prototype._injectStyles):
* inspector/front-end/networkLogView.css:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Fix misuse of ASSERT on ecore_evas_init()
https://bugs.webkit.org/show_bug.cgi?id=107119

Patch by Sudarsana Nagineni <sudarsana.nagineni@intel.com> on 2013-01-17
Reviewed by Laszlo Gombos.

Do not use ASSERT on ecore_evas_init(), since the expression inside
the macro compiles out of release builds.

* TestWebKitAPI/PlatformEfl.cmake: Enable API test UserMessage.
* TestWebKitAPI/efl/PlatformWebView.cpp:
(TestWebKitAPI::initEcoreEvas): Remove ASSERT on ecore_evas_init().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
.: Enable reuse of cached main resources
https://bugs.webkit.org/show_bug.cgi?id=105667

Reviewed by Antti Koivisto.

* Source/autotools/symbols.filter: Expose MemoryCache::resourceForURL().

Source/WebCore: Enable reuse of cached main resources
https://bugs.webkit.org/show_bug.cgi?id=105667

Reviewed by Antti Koivisto.

Test: http/tests/cache/cached-main-resource.html

* WebCore.exp.in:
* dom/Document.cpp:
(WebCore::Document::hasManifest): Returns true if the <html> element has a non-empty manifest attribute.
* dom/Document.h:
(Document):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadedResourceFromMemoryCache): Don't send delegate callbacks for cache hit here, since
    MainResourceLoader will take care of it.
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::MainResourceLoader):
(WebCore::MainResourceLoader::receivedError):
(WebCore::MainResourceLoader::willSendRequest):
(WebCore::MainResourceLoader::responseReceived): Don't try to cache loads from the application cache.
(WebCore::MainResourceLoader::didFinishLoading): Don't try to cache loads from the application cache.
(WebCore::MainResourceLoader::load): Ensure we create a resource load identifier for cache hits. Also,
    ensure we correctly popualate fragment identifiers in the ResourceRequest reported to DocumentLoader.
(WebCore::MainResourceLoader::identifier):
* loader/MainResourceLoader.h: Rename m_substituteDataLoadIdentifier to m_identifierForLoadWithoutResourceLoader
    to better describe when it is used.
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient): Synthesize redirect notifications for cache hits if necessary.
(WebCore::CachedRawResource::willSendRequest): Note the redirects we received.
(WebCore::CachedRawResource::canReuse): Don't reuse a resource if the redirect chain included a "Cache-control: no-store".
* loader/cache/CachedRawResource.h:
(CachedRawResource):
(RedirectPair):
(WebCore::CachedRawResource::RedirectPair::RedirectPair):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::addClientToSet):: Don't return cached data for a main resource synchronously
* loader/cache/CachedResource.h:
(WebCore::CachedResource::canReuse):
(CachedResource):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy): Permit cache reuse for main resources.
* testing/Internals.cpp:
(WebCore::Internals::isLoadingFromMemoryCache):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

Source/WebKit/win: Enable reuse of cached main resources
https://bugs.webkit.org/show_bug.cgi?id=105667

Reviewed by Antti Koivisto.

* WebKit.vcproj/WebKitExports.def.in: Expose some MemoryCache symbols for use in Internals.

LayoutTests: Enable reuse of cached main resources
https://bugs.webkit.org/show_bug.cgi?id=105667.

Reviewed by Antti Koivisto.

* http/tests/cache/cached-main-resource-expected.txt: Added.
* http/tests/cache/cached-main-resource.html: Added.
* http/tests/cache/resources/cacheable-iframe.php: Added.
* http/tests/inspector/resource-har-pages-expected.txt:
* http/tests/loading/redirect-methods-expected.txt:
* http/tests/misc/favicon-loads-with-images-disabled-expected.txt:
* http/tests/misc/link-rel-icon-beforeload-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r137487): Crashes in editing/execCommand/indent-paragraphs.html on GTK, EFL
https://bugs.webkit.org/show_bug.cgi?id=105042

Reviewed by Gustavo Noronha Silva.

Source/WebCore:

Explicitly handle the situation where the creation of a SoupURI fails. This
can happen if the URI is invalid. In that case the constructor returns null.

No new tests. This patch unskips a failing test.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::createSoupRequestAndMessageForHandle): Handle a null Soup URI.

LayoutTests:

Unskip a test which is now passing.

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Widows and orphans test4 fails if isolated
https://bugs.webkit.org/show_bug.cgi?id=106006

Patch by Andrei Bucur <abucur@adobe.com> on 2013-01-17
Reviewed by Dean Jackson.

Source/WebCore:

To determine if the orphans condition is not respected, every time a fragmentation break is encountered adjustLinePositionForPagination() is called for the current line.
If the index on the line in the block is smaller than the number of orphans specified in the style object, the block is shifted in the next fragmentainer. The index of
the line is obtained by calling RenderBlock::lineCount. However, this only works in a full layout when lineCount() will coincidentally return the index of the line.
In subsequent layouts, during the determineStartPosition() phase, lineCount() returns all the lines in the block so the orphans condition is never triggered.
The patch modifies the lineCount() function to have two optional parameters. The first parameter is the line where lineCount should stop counting lines. The second
is an output boolean parameter indicating if the line was found or not. This change makes the lineCount() more flexible and allows retreiving the index of a
specific line (e.g. the index of the current line inside adjustLinePositionForPagination()).

Tests: fast/multicol/orphans-relayout.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::lineCount): See the detailed description.
(WebCore::RenderBlock::adjustLinePositionForPagination): Make use of the modified lineCount() function.
* rendering/RenderBlock.h:
(RenderBlock):

LayoutTests:

This is the "Basic Orphans" test extracted from fast/multicol/widows-and-orphans.html. It was minimized and modified to include a relayout step.

* fast/multicol/orphans-relayout-expected.txt: Added.
* fast/multicol/orphans-relayout.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add ontransitionend attribute on HTML elements.
https://bugs.webkit.org/show_bug.cgi?id=107134

Reviewed by Simon Fraser.

Source/WebCore:

Add ontransitionend attribute on HTML elements to match the prefixed
attribute onwebkittransitionend. As it uses the same plumbing as a
regular event listener, it behaves the same which means that if
ontransitionend only is defined then only the code attached to this
attribute will be called, if only onwebkittransitionend is defined then
only the code attached to this attribute will be called and finally if
both attributes are defined then only the code attached to the
unprefixed attribute will be called.

Tests: transitions/transition-end-event-unprefixed-03.html
       transitions/transition-end-event-unprefixed-04.html

* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseAttribute):
* page/DOMWindow.h:
(DOMWindow):
* page/DOMWindow.idl: only define the property if the unprefixing is
turn on.

LayoutTests:

Add tests to cover the new attribute. It also make sure that event if
we use the old attribute and the new one at the same time only the new
event handler will be called.

* transitions/transition-end-event-unprefixed-03-expected.txt: Added.
* transitions/transition-end-event-unprefixed-03.html: Added.
* transitions/transition-end-event-unprefixed-04-expected.txt: Added.
* transitions/transition-end-event-unprefixed-04.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled Chromium DEPS to r177369.  Requested by
ajuma via sheriffbot.

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-17

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Open resource dialog has poor performance.
https://bugs.webkit.org/show_bug.cgi?id=107122

Reviewed by Pavel Feldman.

Open resource dialog does not make linear number of relayouts on highlight anymore.
Replaced localeCompare with string compare since it is significantly faster.

* inspector/front-end/FilteredItemSelectionDialog.js:
(WebInspector.FilteredItemSelectionDialog.prototype._highlightItems):
(WebInspector.OpenResourceDialog.compareFunction):
(WebInspector.OpenResourceDialog):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Content flows incorrectly in autoheight regions with min/max-height set
https://bugs.webkit.org/show_bug.cgi?id=102099

Patch by Andrei Bucur <abucur@adobe.com> on 2013-01-17
Reviewed by David Hyatt.

Source/WebCore:

The current layout algorithm for auto-height regions is gives wrong results when the max-height property is set on them. The reason is we
consider the max-height restriction too late in the layout, when applying a forced break. This is what happens when content is laid out
in an auto-height region.
1. The content flows without a limit until a forced break appears. If there's no forced break in the content, one is forced anyway at the end
of the layout.
2. The region where the forced break is placed is not always the one where content is laid out because of max-height restrictions.
3. All the regions with max-height are iterated and their height accumulated until the break offset is reached and the region at that point is ended.
This gives wrong results because the forced break position in the content was computed assuming there's only one region where the content is laid out.
The regions with max-height could have generated unforced breaks at their height and the forced break actually should have a different position.

This patch changes the algorithm in this way:
1. From the flow thread perspective all the regions start with a height: max-height for auto-height regions (or LayoutSize.max()/2 if not defined)
or the fixed height value when specified.
2. When the content is laid out, if there's no forced break, the height of the content is correctly estimated because the layout sees unforced breaks
at the max-height values.
3. If a forced break appears, the affected region can be obtained only by looking at the break offset in the region chain. If the region has auto-height,
its height is updated by the forced break.
4. At the end of the layout, there's the additional task to clear the height of all the regions that didn't receive content. This can be done optimally
without adding a new iteration through the regions by attaching to the RegionOverset computation loop.

Tests:  fast/regions/autoheight-maxheight-mixed-break.html
        fast/regions/autoheight-maxheight-simple-break.html
        fast/regions/autoheight-maxheight-simple-nobreak.html
        fast/regions/autoheight-minmaxheight-mixed-break-hbt.html
        fast/regions/autoheight-minmaxheight-mixed-break-vlr.html
        fast/regions/autoheight-minmaxheight-mixed-break-vrl.html
        fast/regions/autoheight-minmaxheight-mixed-break.html
        fast/regions/autoheight-minmaxheight-simple-break.html
        fast/regions/autoheight-minmaxheight-simple-nobreak.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::layout):
(WebCore::RenderFlowThread::computeLogicalHeight):
(WebCore::RenderFlowThread::regionAtBlockOffset):
(WebCore::RenderFlowThread::pageLogicalHeightForOffset):
(WebCore::RenderFlowThread::pageRemainingLogicalHeightForOffset):
(WebCore::RenderFlowThread::computeOverflowStateForRegions): Attach to the loop in this function to clear the overrideLogicalHeight on empty regions.
(WebCore):
(WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect): Add an ASSERT that a region always has overrideLogicalHeight or a fixed height.
(WebCore::RenderFlowThread::initializeRegionsOverrideLogicalContentHeight): A new function that updates the region chain height to use the max-height value
for auto-height regions.
(WebCore::RenderFlowThread::addForcedRegionBreak):
* rendering/RenderFlowThread.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::pageLogicalHeight): the decorations size is incorrectly considered in the page height.
(WebCore):
(WebCore::RenderRegion::maxPageLogicalHeight): new function that returns the max page size for a region. It shouldn't be called too often
or the returned value can be cached
(WebCore::RenderRegion::logicalHeightOfAllFlowThreadContent): the decorations size is incorrectly considered in the logical height of
the flow thread content.
* rendering/RenderRegion.h:
(RenderRegion):

LayoutTests:

All the tests have a description about how the breaking should happen. They pass if the height of the region chain is
correctly computed by using the max-height, min-height, height and writing mode conditions.

* fast/regions/autoheight-maxheight-mixed-break-expected.txt: Added.
* fast/regions/autoheight-maxheight-mixed-break.html: Added.
* fast/regions/autoheight-maxheight-simple-break-expected.txt: Added.
* fast/regions/autoheight-maxheight-simple-break.html: Added.
* fast/regions/autoheight-maxheight-simple-nobreak-expected.txt: Added.
* fast/regions/autoheight-maxheight-simple-nobreak.html: Added.
* fast/regions/autoheight-minmaxheight-mixed-break-expected.txt: Added.
* fast/regions/autoheight-minmaxheight-mixed-break-hbt-expected.txt: Added.
* fast/regions/autoheight-minmaxheight-mixed-break-hbt.html: Added.
* fast/regions/autoheight-minmaxheight-mixed-break-vlr-expected.txt: Added.
* fast/regions/autoheight-minmaxheight-mixed-break-vlr.html: Added.
* fast/regions/autoheight-minmaxheight-mixed-break-vrl-expected.txt: Added.
* fast/regions/autoheight-minmaxheight-mixed-break-vrl.html: Added.
* fast/regions/autoheight-minmaxheight-mixed-break.html: Added.
* fast/regions/autoheight-minmaxheight-simple-break-expected.txt: Added.
* fast/regions/autoheight-minmaxheight-simple-break.html: Added.
* fast/regions/autoheight-minmaxheight-simple-nobreak-expected.txt: Added.
* fast/regions/autoheight-minmaxheight-simple-nobreak.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: InstrumentingAgents should be registered in InspectorInstrumentation only when there is a front-end
https://bugs.webkit.org/show_bug.cgi?id=107127

Reviewed by Vsevolod Vlasov.

InspectorInstrumentation::registerInstrumentingAgents is called when front-end
is connected to corresponding InspectorController. When the front-end disconnects
InspectorInstrumentation::unregisterInstrumentingAgents is called.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::inspectedPageDestroyed):
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStream API: Move all ExtraDataContainers into anonymous namespaces
https://bugs.webkit.org/show_bug.cgi?id=107128

Reviewed by Kentaro Hara.

Tests not needed.

* platform/chromium/support/WebMediaStreamDescriptor.cpp:
* platform/chromium/support/WebMediaStreamSource.cpp:
* platform/chromium/support/WebRTCSessionDescriptionRequest.cpp:
* platform/chromium/support/WebRTCVoidRequest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Wire BackgroundHTMLParser to HTMLDocumentParser
https://bugs.webkit.org/show_bug.cgi?id=107140

Reviewed by Adam Barth.

With this patch, we now pass the majority of html5lib and fast/parser tests with threaded HTML parsing enabled.

No new tests because covered by existing fast/parser tests.

* html/parser/BackgroundHTMLParser.cpp:
(WebCore::TokenDelivery::execute):
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::HTMLDocumentParser):
(WebCore::HTMLDocumentParser::~HTMLDocumentParser):
(WebCore::HTMLDocumentParser::processingData):
(WebCore::HTMLDocumentParser::resumeParsingAfterYield):
(WebCore::HTMLDocumentParser::canTakeNextToken):
(WebCore::HTMLDocumentParser::feedTokens):
(WebCore::HTMLDocumentParser::pumpTokenizer):
(WebCore):
(WebCore::HTMLDocumentParser::startBackgroundParser):
(WebCore::HTMLDocumentParser::stopBackgroundParser):
(WebCore::HTMLDocumentParser::append):
(WebCore::HTMLDocumentParser::end):
(WebCore::HTMLDocumentParser::finish):
(WebCore::HTMLDocumentParser::resumeParsingAfterScriptExecution):
* html/parser/HTMLDocumentParser.h:
(WebCore):
(HTMLDocumentParser):
(WebCore::HTMLDocumentParser::hasPreloadScanner):
(WebCore::HTMLDocumentParser::shouldUseThreading):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Build with LevelDB when IndexedDB is enabled
https://bugs.webkit.org/show_bug.cgi?id=103220

Patch by Martin Robinson <mrobinson@igalia.com> on 2013-01-17
Reviewed by Gustavo Noronha Silva.

.:

* configure.ac: Detect whether the IndexedDatabase feature is enabled. We cannot
use the typical approach for feature detection since we need to adjust the automake
file output based on whether or not IndexedDatabase is enabled.

Source/ThirdParty:

Add the leveldb 1.9.0 source code to the ThirdParty dependencies.
We cannot depend on leveldb provided by the distribution, because
it sometimes breaks API compatibility.

* leveldb: Imported from the 1.9.0 leveldb source tarball.

Source/WebCore:

No new tests. This is just a build change. IndexedDatabase support
is already covered by the suite of storage layout tests.

* GNUmakefile.am: Add the leveldb convenience library.
* GNUmakefile.list.am: Add the list of sources.

Source/WebKit/gtk:

* GNUmakefile.am: When IndexedDatabase is enabled add the leveldb convenience
library to the shared library link phase.

Source/WebKit2:

* GNUmakefile.am: When IndexedDatabase is enabled add the leveldb convenience
library to the shared library link phase.

Tools:

* Scripts/webkitpy/style/checker.py: Do not style check the leveldb source code
as it does not conform to WebKit style.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Update Authentication Type and Scheme implementation
https://bugs.webkit.org/show_bug.cgi?id=107045
PR #281292

Reviewed by Yong Li.

Reviewed internally by Joe Mason. A typo is also fixed by Joe Mason.

The BlackBerry platform layer has defined both authentication type and authentication scheme.
This patch is adapting the porting layer to the platform layer change.

No functionalities changed no new tests.

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::notifyAuthReceived):
* platform/network/blackberry/NetworkJob.h:
(NetworkJob):
* platform/network/blackberry/NetworkManager.cpp:
(WebCore::NetworkManager::startJob):


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