HTMLAnchorElement now returns "" instead of "0" for unset port
Fixed KURLGoogle.cpp to have same behavior as KURL.cpp when setting port 0
Fixed Location.cpp to have same behavior as KURL.cpp when setting port 0

This patch makes the XMLHttpRequest method/header validation logic available as
static methods so URL loaders can perform the same checks for untrusted HTTP requests
coming from plugins.​https://bugs.webkit.org/show_bug.cgi?id=66909

dom/Range.h: Added a default ASSERT_NO_EXCEPTION to a few more member functions.

editing/Editor.cpp:

(WebCore::Editor::findString): Moved most of the logic into rangeOfString(), which this function
now calls, passing in the current selection as the reference range and setting the selection to
the returned range.
(WebCore::Editor::rangeOfString): Added. Contains the find logic from findString().

editing/Editor.h:

page/Page.cpp:

(WebCore::Page::rangeOfString): Added. This function is similar to findString(), but it takes an optional
reference range and returns a Range, rather than using the current selection as the reference range and setting the
selection to the next match.

(WebCore::HTMLMediaElement::HTMLMediaElement): Added initializers for new member variables.
(WebCore::HTMLMediaElement::prepareForLoad): Close the media source before starting a new load.
(WebCore::HTMLMediaElement::loadResource):

Fail loading if the media source url from another media element is used.

(WebCore::HTMLMediaElement::mediaEngineError):

Make sure the source is in the closed state before firing an emptied event.

(WebCore::HTMLMediaElement::mediaPlayerSourceOpened):

New method called by WebCore::MediaPlayer to signal when the source is open.

(WebCore::HTMLMediaElement::mediaPlayerSourceURL):

New method called by the WebCore::MediaPlayer to determine what the media source URL is for this
HTMLMediaElement instance.

(WebCore::HTMLMediaElement::seek):

Disabled noSeekRequired optimization if a media source is open and resets the source state to SOURCE_OPEN if
it was in the SOURCE_ENDED state when seek() was called.

(WebCore::HTMLMediaElement::webkitSourceAppend):

New method for passing media data from JavaScript to the WebCore::MediaPlayer.

(WebCore::HTMLMediaElement::webkitSourceEndOfStream):

New method that allows JavaScript to signal the end of the stream.

(WebCore::HTMLMediaElement::webkitSourceState): New method allowing JavaScript to read the current source state.
(WebCore::HTMLMediaElement::setSourceState): New method for updating the current source state.
(WebCore::HTMLMediaElement::userCancelledLoad):

Transitions an open source to the closed state before firing an emptied event.

html/HTMLMediaElement.h:

(WebCore::HTMLMediaElement::webkitMediaSourceURL):

New method providing the media source URL to JavaScript for this HTMLMediaElement instance.

html/HTMLMediaElement.idl: Added new methods, attributes, and constants for the media source api.

platform/graphics/MediaPlayer.cpp:

(WebCore::NullMediaPlayerPrivate::sourceAppend):

Stub implementation of new WebCore::MediaPlayerPrivateInterface::sourceAppend.

(WebCore::NullMediaPlayerPrivate::sourceEndOfStream):

Stub implementation of new WebCore::MediaPlayerPrivateInterface::sourceEndOfStream.

(WebCore::MediaPlayer::sourceAppend): New method for receiving media data from WebCore::HTMLMediaElement.
(WebCore::MediaPlayer::sourceEndOfStream): New method for receiving end of stream from WebCore::HTMLMediaElement.
(WebCore::MediaPlayer::sourceOpened):

New method called by the MediaPlayerPrivate object to notify the MediaPlayer when the source has opened.

(WebCore::MediaPlayer::sourceURL):

New method called by the MediaPlayerPrivate implementation to get the media source URL from the MediaPlayer.

platform/graphics/MediaPlayer.h:

(WebCore::MediaPlayerClient::mediaPlayerSourceOpened):

Interface method used by the MediaPlayer to tell the HTMLMediaElement when the media source has been opened.

(WebCore::MediaPlayerClient::mediaPlayerSourceURL):

Interface method used by the MediaPlayer to get the media source URL from the HTMLMediaElement.

platform/graphics/MediaPlayerPrivate.h:

(WebCore::MediaPlayerPrivateInterface::sourceAppend):

Interface method used by the MediaPlayer to pass media data to the MediaPlayerPrivate object.

(WebCore::MediaPlayerPrivateInterface::sourceEndOfStream):

Interface method used by the MediaPlayer to pass end of stream information to the MediaPlayerPrivate object.

(WebCore::RenderFlexibleBox::layoutHorizontalBlock):
(WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithmHorizontal): Make childSizes a param so we can pass the results to layoutAndPlaceChildrenHorizontal.
(WebCore::hasPackingSpace): Move closer to where it's used.
(WebCore::RenderFlexibleBox::layoutAndPlaceChildrenHorizontal):

Pull this code out into its own function because it's not part of running the free space allocation algorithm.

The CoreGraphics implementation of Path::boundingRect() called
CGPathGetBoundingBox, which includes the path's control points in its
calculations. Snow Leopard added CGPathGetPathBoundingBox, which
finds the bounding box of only points within the path, and does not
include control points. On Snow Leopard and above, we now use the latter.

We previously were not transforming the pointer coordinates passed
to SVGDocument's panning implementation into the coordinate space of
the contents, so on different platforms, the drag direction was different.

The problem was that the tokenizer state was lost between each call to document.write.
This works around that bug by making all document.write()s in the same script block share
the same tokenizer state.

The old code walked from 1 to the last box-ordinal-group while
iterating over each flex item. The new code collects ordinals as
we do the first walk and sorts them. Each additional iteration
through the flex items gets the next oridnal from the sorted list.

This maintains the single pass for the common case of no
box-ordinal-groups specified. If there are ordinal groups,
the runtime is O(n*m + m lg m) where n is the # of flex items and
m is the number of unique box-ordinal-group values. The memory
usage is O(2m).

Implement dumpProgressFinishedCallback() in the layoutTestController for Qt,
Chromium and GTK ports. The first two were simple changes.

Some refactoring was needed in GTK port to assure that the dumps are emitted
correctly and the processing after the page load finished is in the right place.

To detect the load finished, we use the callback for the "load-status" notifier
signal of the top loading frame. And we use the deprecated "load-finished" signal
for dumping (if enabled) the progress finished expected output.

Adds support for the first value of -webkit-flex-flow.
Later we'll need to add support for the second "wrap" value,
but that can wait until we are ready to implement multiline
flex and the spec has stabilized a bit.

Added a new script, which allows for testing one, two, or more VMs
at once on SunSpider, V8, and Kraken benchmarks. Benchmark/VM runs
are interleaved at random to minimize systematics. The results
that bencher prints includes all possible relevant information about
how bencher was invoked. Bencher can be easily used to measure
performance changes down to fractions of a percent.

Bencher also includes experimental support for running benchmarks in
a DumpRenderTree release build. This works in SunSpider and V8, but
not yet in Kraken. Running benchmarks in DumpRenderTree more
closely mimics the performance when running in browser.

Document::loader can return 0 for a number of reasons. Call sites need
to null check the result, like we do for Document::frame. I suspect
some of these are real crashes, along the lines of​http://trac.webkit.org/changeset/93692, but null checking this function
is just good practice.

platform/network/ResourceHandle.h: Exposed default session support on Mac, too. Made
privateBrowsingStorageSession() private, as callers shouldn't be concerned about where the
current sssion came from.

platform/network/cf/CookieStorageCFNet.cpp:
(WebCore::cookieStorageOverride): Make it clear that this override is only for a Windows API.
(WebCore::overrideCookieStorage): Ditto.
(WebCore::currentCFHTTPCookieStorage): We no longer store a cookie storage in a static variable,
unless it has been overridden on Windows. We can always get it from a session.
(WebCore::setCookieStoragePrivateBrowsingEnabled): There is nothing to do here - we'll just
use private session's storage. Note that Mac has a separate code path for OS versions that
don't support sessions.
(WebCore::startObservingCookieChanges): Updated to use currentCFHTTPCookieStorage().
(WebCore::stopObservingCookieChanges): Ditto.

platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::makeFinalRequest): Updated for currentCookieStorage->currentCFHTTPCookieStorage change.
(WebCore::ResourceHandle::createPrivateBrowsingStorageSession): Moved out of USE(CFNETWORK),
as this function is also used with NSURLConnection when sessions are enabled.
(WebCore::ResourceHandle::currentStorageSession): Ditto. Removed an #if since default session
is now supported on Mac, too.
(WebCore::defaultCFURLStorageSession): Moved out of USE(CFNETWORK).
(WebCore::ResourceHandle::setDefaultStorageSession): Moved out of USE(CFNETWORK). No longer
adopt the session, because nothing in method name says that it will steal a reference from
the caller.
(WebCore::ResourceHandle::defaultStorageSession): Moved out of USE(CFNETWORK).
(WebCore::privateStorageSession): Moved from ResourceHandle.cpp.
(WebCore::privateBrowsingStorageSessionIdentifierBase): Moved from ResourceHandle.cpp.
(WebCore::ResourceHandle::setPrivateBrowsingEnabled): Moved from ResourceHandle.cpp.
(WebCore::ResourceHandle::privateBrowsingStorageSession): Moved from ResourceHandle.cpp.
(WebCore::ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase): Moved from ResourceHandle.cpp.
(WebCore::ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase): Moved from ResourceHandle.cpp.

platform/network/mac/CookieStorageMac.mm: (WebCore::setCookieStoragePrivateBrowsingEnabled):
We no longer store a reference to cookie storage in a static variable, so nothing to do here.
On older OS versiosn, we still need to enable legacy private browsing mode.

platform/network/mac/ResourceHandleMac.mm:
(WebCore::shouldRelaxThirdPartyCookiePolicy): Updated to use the new currentCFHTTPCookieStorage function.
(WebCore::ResourceHandle::createNSURLConnection): Updated to use currentStorageSession()
instead of privateBrowsingStorageSession().
(WebCore::ResourceHandle::willSendRequest): Ditto.

Revise our overflow:auto pagination behavior. If the overflow block doesn't specify any logical height
information, then we'll just assume the plan is for it to enclose its contents, and we will be willing
to paginate in those circumstances.

Technically we should paginate lines based solely off their line top and line bottom with
leading included. However there are two issues with always doing so. The first is that overflow
can cause lines to overlap, and the second is that negative leading can cause lines to overlap.

Since we're incapable of dealing with overlap until we stop clipping column boxes and allow them
to have a form of specialized overflow, we still have to at least factor in overflow and ignore
negative leading for now. However we can at least honor positive leading when the lines don't
overlap. This patch provides basic support for paginating when positive leading is involved.

Reviewed by Dan Bernstein.

Added fast/multicol/positive-leading.html.

Source/WebCore:

rendering/RenderBlock.cpp:

(WebCore::RenderBlock::markLinesDirtyInBlockRange):
Renamed blockLogicalHeight() to lineBottomWithLeading(). The value is the same.

(WebCore::RenderBlock::adjustLinePositionForPagination):
Grow the top and extent of the line to include our leading when deciding how to paginate
the line.

(WebCore::RootInlineBox::lineTopWithLeading):
(WebCore::RootInlineBox::lineBottomWithLeading):
(WebCore::RootInlineBox::setLineTopBottomPositions):
Instead of one member variable, blockLogicalHeight(), RootInlineBoxes now know both their top and
bottom including leading. These values are obtainable using lineTopWithLeading() and lineBottomWithLeading().
Add these two values to the setLineTopBottomPositions setter and remove setBlockLogicalHeight.

rendering/svg/SVGRootInlineBox.cpp:

(WebCore::SVGRootInlineBox::layoutRootBox):
Renamed blockLogicalHeight() to lineBottomWithLeading(). The value is the same.

webcore_bindings_sources generates various files (e.g., CSSPropertyNames,
DerivedSources, HTMLNames, etc). webcore_bindings depends on webcore_bindings_sources
and compiles these files. Previously, the other webcore libs (webcore_svg,
webcore_html, webcore_remaining, etc) depended on webcore_bindings. This changes the
dependency on webocre_bindings_sources so the build can parallelize the compile of
webcore_bindings and the other webcore_* libs.

No new tests, just changing the build dependencies. Manually copy over the
include dirs that we used to get from webcore_bindings' direct_dependent_settings.

(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::parseMappedAttribute): Most of the logic
for "ismap" and "usemap" moved into isServerMap().
(WebCore::HTMLImageElement::isServerMap): Out-of-lined and implemented
using fast*Attribute().

(WebCore::HTMLTextFormControlElement::defaultEventHandler): Merged subtreeHasChanged.
(WebCore::HTMLTextFormControlElement::setInnerTextValue): No longer set m_lastChangeWasUserEdit to false
since this is now done when renderers are set dirty.

Some layout tests for WebSocket raised Exception to prevent unnecessary
pywebsocket warning. But it doesn't work any more on pywebsocket 0.6b4.
Now pywebsocket support AbortedByUserException to prevent warning.
This change make raise AbortedByUserException instead of Exception.

handshake-fail-by-prepended-null_wsh.py didn't use Exception, but
expected abnormal closure on sending response could raise unexpected
Exception by chance. This change also takes care of it.

hanging-handshake_wsh.py read socket to hang in opening handshake.
Then client initiated closing handshakes or abnormal closures caused
exception or resulted in http error response on hybi-10 compliant new
pywebsocket. Because tests finished at closure, it depends on timing
whether tests detects the error response. Actually, two tests failed on
Qt port by chance.
Essentially, hangings is unnecessary because open event must be queued
and WebSocket's readyState could not be changed to OPEN until the next
event loop is executed. That's why we can use echo_wsh.py instead of
hanging-handshake_wsh.py safely.

close-unref-websocket tests call close() before GC. These tests expect
GC cause close event. But close() itself also queues close event.
These close() are redandant. If GC doesn't cause close event, these
tests can pass by close event that close() queues. This change also
remove these redandant close() calls.

Moved setInnerTextValue from RenderTextControl to HTMLTextFormControlElement.

Also moved m_lastChangeWasUserEdit from RenderTextControl to HTMLTextFormControlElement
and related inline functions from RenderTextControl to HTMLTextFormControlElement.
Because m_lastChangeWasUserEdit is no longer reset when RenderTextControl is recreated,
added explicit calls to setLastChangeWasNotUserEdit in setValue functions of HTMLInputElement
and HTMLTextAreaElement.

This patch also fixes the bug that lastChangeWasUserEdit() incorrectly returns false
when input or textarea don't have renderer (e.g. invisible).

Unfortunately, there is no way to test this behavioral change from layout tests.

(WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
(WebCore::HTMLTextFormControlElement::subtreeHasChanged): Sets m_lastChangeWasUserEdit true
as it used to do via respondToChangeByUser.
(WebCore::HTMLTextFormControlElement::lastChangeWasUserEdit): Moved from HTMLInputElement
and HTMLTextAreaElement.
(WebCore::HTMLTextFormControlElement::setInnerTextValue): Moved from RenderTextControl.

platform/chromium/test_expectations.txt: Changes due to expectation
update for media-document-audio-repaint.html leading to only an image mismatch
and a test that is a slow on OS X as well as Linux and Windows.

(WebCore::WebSocket::didReceiveBinaryData):
If binaryType attribute is "blob", construct a Blob using BlobData filled with the given
binary message.

websockets/WebSocket.h:

websockets/WebSocketChannel.cpp:

(WebCore::WebSocketChannel::processFrame):
Create continuousFrameData as OwnPtr<> rather than stack-allocated value so we can easily
pass it to didReceiveBinaryData() callback.
Save the content of a fragmented message even if it is a binary opcode.

Added. It is a bit complicated to validate the content of a Blob, because a Blob must be read
asynchronously. FileReader is used to read a blob as an ArrayBuffer, each byte of which is
compared with the expected result.

Exposed HTMLInputElement::lastChangeWasUserEdit and HTMLTextAreaElement::lastChangeWasUserEdit
via internals.wasLastChangeUserEdit(Element*, ExceptionCode&). The first argument must be
an input element or a textarea element lastChangeWasUserEdit is called upon.

Test: fast/forms/textfield-lastchange-was-useredit.html

testing/Internals.cpp:

(WebCore::Internals::wasLastChangeUserEdit):

testing/Internals.h:

testing/Internals.idl:

LayoutTests:

Added some basic test for HTMLInputElement::lastChangeWasUserEdit and
HTMLTextAreaElement::lastChangeWasUserEdit.

Completed the third level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the second level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one. Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

(JSC::EvalExecutable::EvalExecutable):
(JSC::ProgramExecutable::ProgramExecutable):
(JSC::FunctionExecutable::FunctionExecutable):
Moved the assignment of m_firstLine and m_lastLine into the
FunctionExecutable::finishCreation() method in Executable.h

Completed the third level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the second level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one. Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

UserObjectImp.cpp:

(UserObjectImp::UserObjectImp):

Source/WebCore:

No new tests.

Completed the third level of the refactoring to add finishCreation()
methods to all classes within the JSCell hierarchy with non-trivial
constructor bodies.

This primarily consists of pushing the calls to finishCreation() down
into the constructors of the subclasses of the second level of the hierarchy
as well as pulling the finishCreation() calls out into the class's corresponding
create() method if it has one. Doing both simultaneously allows us to
maintain the invariant that the finishCreation() method chain is called exactly
once during the creation of an object, since calling it any other number of
times (0, 2, or more) will cause an assertion failure.

(WebCore::RenderLayer::updateLayerPositionsAfterScroll): Tweaked the code
to bail early if our layer has no visible content. This avoids the ASSERT
and also makes sense as we shouldn't repaint / update empty layers.

LayoutTests:

This test checks that a fixed element with no visible content does not ASSERT and
renders properly.

With support for extended attributes on constants we can
replace some preprocessor lines from the IDL files with
the corresponding [Conditional=XXX] later.
Using the preprocessor causes much pain on native windows.

JSValueToNative and NativeToJSValue add additional include statements
to the implementation and need to handle the Conditional attribute from
the IDL file. The Conditional attribute adds appropriate #if ENABLE()
lines for the preprocessor around the include statements to remove
some unneeded build dependencies.

WebView.cpp:
(updateSharedSettingsFromPreferencesIfNeeded):
Updated for new function name and signature: currentCFHTTPCookieStorage().

WebKit2:

WebProcess/Cookies/cf/WebCookieManagerCFNet.cpp:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
Updated for new function name and signature: currentCFHTTPCookieStorage().

Specialize the HashMap used to store registered listeners on an EventTarget
to have a minimum size of 32 (rather than the default 64.)
It's very rare for pages to register listeners for so many different events
and this cuts memory consumption in half for the common case.

As an example, for a typical post on the reddit.com front page,
this reduces memory used by ~700kB on 64-bit.

(WebCore::Canvas2DLayerChromium::create):
(WebCore::Canvas2DLayerChromium::Canvas2DLayerChromium):
(WebCore::Canvas2DLayerChromium::drawsContent):
Construct Canvas2DLayerChromium with a GraphicsContext3D, not a
DrawingBuffer.
(WebCore::Canvas2DLayerChromium::updateCompositorResources):
Flush the GrContext and GraphicsContext3D on compositor update.

platform/graphics/chromium/Canvas2DLayerChromium.h:

platform/graphics/chromium/CanvasLayerChromium.cpp:

(WebCore::CanvasLayerChromium::CanvasLayerChromium):

platform/graphics/chromium/CanvasLayerChromium.h:

Put textureId() back on the base class (CanvasLayerChromium) and
de-virtualize it.
(WebCore::CanvasLayerChromium::textureId):
(WebCore::CanvasLayerChromium::setTextureId):
Move m_textureId from WebGLLayerChromium, since canvas2D now uses
it too. Provide getters and setters.

platform/graphics/chromium/DrawingBufferChromium.cpp:

(WebCore::DrawingBuffer::DrawingBuffer):
(WebCore::DrawingBuffer::~DrawingBuffer):
Remove all Canvas2D-related calls from DrawingBuffer.
(WebCore::DrawingBuffer::publishToPlatformLayer):
Remove GrContext::flush call, since it's now handled by the platform layer.
(WebCore::DrawingBuffer::platformLayer):
Return NULL for now (WebGL may rescussitate this later).

platform/graphics/chromium/GraphicsLayerChromium.cpp:

Remove a useless #include.

platform/graphics/chromium/ImageBufferDataSkia.h:

Add ownership of the Canvas2DLayerChromium.

platform/graphics/chromium/WebGLLayerChromium.cpp:

(WebCore::WebGLLayerChromium::WebGLLayerChromium):

platform/graphics/chromium/WebGLLayerChromium.h:

Remove all texture ID stuff (now on base class).

platform/graphics/gpu/DrawingBuffer.h:

Remove Canvas2DLayerChromium and all Ganesh datatypes from
DrawingBuffer, since it's no longer used by canvas2D.

platform/graphics/skia/ImageBufferSkia.cpp:

(WebCore::ImageBuffer::ImageBuffer):
On accelerated ImageBuffer creation, create a GrTexture instead of a
DrawingBuffer. If all is cool, create and set the SkGpuDevice here,
and create a Canvas2DLayerChromium platform layer.
(WebCore::ImageBuffer::platformLayer):

platform/graphics/skia/PlatformContextSkia.cpp:

(WebCore::PlatformContextSkia::setGraphicsContext3D):

platform/graphics/skia/PlatformContextSkia.h:

Remove all GrContext creation and DrawingBuffer "scraping" from
PlatformContextSkia::setGraphicsContext3D(). This is handled in
the ImageBuffer constructor instead.

platform/network/ResourceHandle.cpp: Moved CFNetwork specific code to ResourceHandleCFNet.cpp.
This file contains cross platform functionality, and we no longer need to put code in it to
share it between Mac and Windows.

platform/network/cf/CookieStorageCFNet.cpp:
(WebCore::cookieStorageOverride): Make it clear that this override is only for a Windows API.
(WebCore::overrideCookieStorage): Ditto.
(WebCore::currentCFHTTPCookieStorage): We no longer store a cookie storage in a static variable,
unless it has been overridden on Windows. We can always get it from a session.
(WebCore::setCookieStoragePrivateBrowsingEnabled): There is nothing to do here - we'll just
use private session's storage. Note that Mac has a separate code path for OS versions that
don't support sessions.

platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::makeFinalRequest): Updated for currentCookieStorage->currentCFHTTPCookieStorage change.
(WebCore::ResourceHandle::createPrivateBrowsingStorageSession): Moved out of USE(CFNETWORK),
as this function is also used with NSURLConnection when sessions are enabled.
(WebCore::ResourceHandle::currentStorageSession): Ditto. Removed an #if since default session
is now supported on Mac, too.
(WebCore::defaultCFURLStorageSession): Moved out of USE(CFNETWORK).
(WebCore::ResourceHandle::setDefaultStorageSession): Moved out of USE(CFNETWORK). No longer
adopt the session, because nothing in method name says that it will steal a reference from
the caller.
(WebCore::ResourceHandle::defaultStorageSession): Moved out of USE(CFNETWORK).
(WebCore::privateStorageSession): Moved from ResourceHandle.cpp.
(WebCore::privateBrowsingStorageSessionIdentifierBase): Moved from ResourceHandle.cpp.
(WebCore::ResourceHandle::setPrivateBrowsingEnabled): Moved from ResourceHandle.cpp.
(WebCore::ResourceHandle::privateBrowsingStorageSession): Moved from ResourceHandle.cpp.
(WebCore::ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase): Moved from ResourceHandle.cpp.
(WebCore::ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase): Moved from ResourceHandle.cpp.

platform/network/mac/CookieStorageMac.mm: (WebCore::setCookieStoragePrivateBrowsingEnabled):
We no longer store a reference to cookie storage in a static variable, so nothing to do here.
On older OS versiosn, we still need to enable legacy private browsing mode.

platform/network/mac/ResourceHandleMac.mm: (WebCore::shouldRelaxThirdPartyCookiePolicy):
Updated to use the new currentCFHTTPCookieStorage function.

Implement requestAnimationFrame for WebKit. Add a
CFRunLoopObserver to WebView, which runs just before
the syncCompositingState RLO and calls into the
ScriptedAnimationController if scheduleAnimation() has
been called.

Implement requestAnimationFrame for WebKit2. Add a
CFRunLoopObserver to WebPage, which runs just before
the syncCompositingState RLO and calls into the
ScriptedAnimationController if scheduleAnimation() has
been called.

Enable requestAnimationFrame tests for Mac. Tests were also
modified to work on Mac. Before the tests would assume the
requestAnimationFrame callbacks would be called by calling
LayoutTestController.display(). This is not a valid assumption
for Mac, since it skips display() if nothing was dirty.

Tests were changed to use timeouts to wait for callbacks and
ensure they get called. Also added more positive indications
that test failed or succeeded, rather than relying on the lack
of an error message to indicate success.

(QtWebPageProxy::init): Initialize the WKPageUIClient with memset
to avoid missing initializer warning. The missing initializer is the
result of using a version 0 WKPageUIClient while it has newer version (1).
We have nothing to do with the callbacks in the new version so I voted
for memset.

WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp: Include ResourceError.h.

Moved more of the destruction of Executable state into the finalizer,
which also resulted in an opportunity to mostly combine this with
discardCode(). This also means that the finalizer is now enabled even
when the JIT is turned off. This is performance neutral on SunSpider,
V8, and Kraken.

Appending a positioned child node to an inline flow should dirty the lines in the flow, just as
inserting a positioned child node does. Treating an appended and inserted node differently meant that updating the display type
from 'none' to 'block' for the following markup would result in the div getting positioned correctly under
the line block:

This problem is specific to cases where an object is appended to a line block whose last child is a <br>. When the line is relaid out after appending
the positioned object the last line in the line block is always considered dirty unless it broke cleanly (ie. with a <br>, see RenderBlock::determineStartPosition),
So in the second case above, the clean break and failing to dirty any lines in the block when appending the object means that the line block doesn't get relaid out
to position the new positioned object relative to its containing line block.

So the change could special-case appending a node when the previous sibling isBR(), but it seems just as well to behave the same way as insertChildNode().

rendering/RenderObjectChildList.cpp:

(WebCore::RenderObjectChildList::appendChildNode):

Call dirtyLinesFromChangedChild() if the child is positioned, just like insertChildNode().

The --chromium-android switch is needed when running
update-webkit-chromium and build-webkit, as it'll tell the
scripts to pull in the right dependencies and cross-compile
WebKit using the Android NDK.

calculateAnimationPercentAndRepeat() is returning 1, which means 100%, whenever
elapsed >= m_intervalEnd, but this is wrong because m_intervalEnd can be in the middle
of the animation duration. (e.g. begin="0s" end="2s" dur="3s")

This change makes the function return the animations's true progress instead of 100%
when the animation ends.

This is more like (but not exactly) a revert of r91788.
It does not search for previous or next root inline box in different
render object, which completely eliminates the cause of this issue.
And it removes createPositionAvoidingIgnoredNode(), changed its caller
to use createLegacyEditingPosition(). createPositionAvoidingIgnoredNode
is not correct when node is a replaced element whose caretMaxOffset
could be greater than 1.

MockWebGraphicsContext3D is a no-op implementation of the pure virtual
interface WebGraphicsContext3D. I've included a test with a couple of
example usages: subclassing it manually, and using it with GMock.

Move allowCredentials from ThreadableLoaderOptions down
to ResourceLoaderOptions. This allows us to remove
getShouldUseCredentialStorage() from SubresourceLoaderClient
and check allowCredentials in ResourceLoader.​https://bugs.webkit.org/show_bug.cgi?id=65330

Destructor calls and object scans are now optionally counted, per
vtable. When the heap is destroyed and profiling is enabled, the
counts are dumped, with care taken to print the names of classes
(modulo C++ mangling) sorted in descending commonality.

MediaPlayer creation has now been put into createMediaPlayer() instead of it being created
separately in these various methods. It has been made thread-safe for use with the Web Audio API
in conjunction with an MediaElementAudioSourceNode.

The HTMLMediaElement now keeps track of an optional MediaElementAudioSourceNode if
the audio stream is being processed using the Web Audio API.

platform/graphics/MediaPlayer.cpp:

(WebCore::MediaPlayer::audioSourceProvider):

platform/graphics/MediaPlayer.h:

platform/graphics/MediaPlayerPrivate.h:

(WebCore::MediaPlayerPrivateInterface::audioSourceProvider):

MediaPlayer now has an audioSourceProvider() method with a default "empty" implementation.
audioSourceProvider() returns an AudioSourceProvider object which the Web Audio API's
MediaElementAudioSourceNode uses (indirectly through an HTMLMediaElement method) to get the rendered audio stream.

webaudio/AudioContext.cpp:

(WebCore::AudioContext::createMediaElementSource):

webaudio/AudioContext.h:

webaudio/AudioContext.idl:

AudioContext::createMediaElementSource() is now more careful to check that an HTMLMediaElement
doesn't already have a MediaElementAudioSourceNode attached to it.

(WebCore::HTMLCanvasElement::reset):
Call CanvasRenderingContext2D::reset() before resizing the canvas,
so that the GraphicsContext state stack can be unwound.

html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::unwindStateStack):
(WebCore::CanvasRenderingContext2D::~CanvasRenderingContext2D):
Refactor the state stack unwinding code from the destructor to
unwindStateStack() (new).
(WebCore::CanvasRenderingContext2D::reset):
Unwind the GraphicsContext state stack when the context is reset.

Don't try to make sure the WebContext is deleted, for now the leak
is intended and when multiple processes per context will be supported
this leak should be fixed. This was the cause of DRT crashing on the bot,
the context was deleted after the first test, letting other tests with nothing
but a bad context.

Removing the function altogether would break the nightlies.
This patch removes the code behind it so that it is clear that
WKPageCreateSnapshotOfVisibleContent should not be used, and so that the code isn't just
left rotting in the tree.

(WebCore::CanvasRenderingContext2D::stroke): Remove Qt-specific optimization
since calling Path::boundingRect() will now do exactly the same thing.

platform/graphics/qt/PathQt.cpp:

(WebCore::Path::boundingRect): Return QPainterPath::controlPointRect() since
that is much faster than computing the (precise) QPainterPath::boundingRect()
and Path::boundingRect() is not expected to be 100% precise anyway.

The http/tests/misc/object-embedding-svg-delayed-size-negotiation-2.htm testcase triggered
an assertion on a Qt debug build indicating that the HashSet updateLayoutAndStyleIfNeededRecursive()
operates on is mutated while its iterated, leading to an assertion/crash. Due the new forceLayoutParentViewIfNeeded()
logic it's no longer safe to directly use the children() HashSet in that method - we have to make a copy first.

The second part of the fix is to stop entering forceLayoutParentViewIfNeeded(), if the origin of that call
is forceLayoutParentViewIfNeeded() itself. Set m_inLayoutParentView to true before calling FrameView::layout()
on our parent frame view - this is only an optimization to avoid doing layout() twice.

The third part of the fix is to call updateWidgetPositions() on the parent FrameView, _before_ calling layout()
on the parent view itself, as the SVG document needs to report the correct intrinsic size (which can depend
on the host object/embed/iframe) when we're running RenderReplaced::layout() on the host renderer.