Disable pluginDocumentView-deallocated-dataSource.html as it has not tested
what it was designed to test for some time, and is failing on some machines.
Fixing the test is tracked by <​https://bugs.webkit.org/show_bug.cgi?id=24690>.

If the m_pluginView member was zeroed out as a result of making a call into the plug-in, the pluginFunctionCallDepth would be off
causing the plug-in never to be stopped. Simplify the code by using a RAII object.

WebView/WebHTMLView.mm:
(responderChainRespondsToSelector): Added.
(-[WebHTMLView doCommandBySelector:]): Set eventWasHandled based on whether we
can find a responder that responds to this selector rather than always assuming
the selector will not be handled.

Put the padding inside the scrollbars on textareas. This is done by moving the
overflow from the shadowNode to the RenderTextControlMultiline. As a result,
all of the scroll handing methods that RenderTextControl overrides can be moved
down into RenderTextControlSingleLine since RenderTextControlMultiline can now
just use RenderBlock's versions. This also allows RenderTextControlMultiLine to
no longer need a custom layout method since the shadowNode can now just size
like a regular DIV.

editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::enable): Added a call to updateRendering, since
determining whether to display the delete button involves style and updateRendering
also updates style (should probably be named updateStyle, in fact). Not needed to fix
this bug, but would have prevented the crash that led to this bug in the first place.

editing/markup.cpp:
(WebCore::appendStartMarkup): Changed a "&" to a "&&" so that generating markup
doesn't depend on renderers at all when the convertBlocksToInlines boolean is false.
This allows us to omit the call to updateLayoutIgnorePendingStylesheets in the
createMarkup function that's called by innerHTML.
(WebCore::MarkupAccumulator::appendMarkup): Turned this into a class with a member
function. Added a feature where the accumulator will skip a node. Moved arguments
that don't change during recursion into an object. This function still is a bit
inefficient, since it creates a new HashMap at every level as it recurses, but for now
I did not tackle that. Also replaced the onlyIncludeChildren boolean with EChildrenOnly
for consistency and clarity.
(WebCore::createMarkup): Removed the call to updateLayoutIgnorePendingStylesheets.
Instead of calling disable/enable on the delete button controller's container element,
pass it in to the markup accumulator as a node to skip.

Changes Skia's font rendering to only render gradient/pattern if current
color space indicates the gradient/pattern should be used.
This is covered by LayoutTests/fast/canvas/canvas-text-alignment.html .

WebKit r30323 added -_webcore_MIMEType to fix issues with
incorrect MIME types in NS[HTTP]URLResponse objects. However,
uses of -[NSURLResponse MIMEType] still persist in WebKit that
should be switched to use -_webcore_MIMEType. Note that
-[WebDataSource _responseMIMEType] calls back into WebCore to
get the MIME type from the ResourceResponse object, which has
already retrieved it via -_webcore_MIMEType.

Move what used to be the 'forceCompositingLayer' flag from RenderLayerBacking
to RenderLayer, because we don't want the side-effects of creating RenderLayerBacking
when setting this flag.

rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateLayerCompositingState):
When a RenderLayer flips into or out of compositing mode, compute a repaint
rect relative to the containerForRepaint, and repaint it.

(WebCore::RenderLayerCompositor::computeCompositingRequirements):
Call layer->setMustOverlayCompositedLayers() rather than setForcedCompositingLayer().

Rename requiresCompositingLayerForTransform() to requiresCompositingForTransform()
and make it a class static method to match requiresCompositingForAnimation(). Both
now take RenderObjects, rathern than RenderLayers.

Bug 24304: REGRESSION (r39864): Hitting the space bar to select an <input type=radio>
or push an <input type=button> or <button> causes the page to scroll down.

Would be best to add a regression test for Windows eventually; tested that this has
no effect on the Mac OS X platform.

html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultEventHandler): Added FIXMEs and tweaked formatting.
Use the code that calls the base class's defaultEventHandler early only in the cases
where it's needed: keydown and keypress events in text fields. In other cases, do the
more typical thing and call the default handler only at the end of the function.
This function already had code to make sure the keypress event for space never gets
through, but it was running too late since the scrolling code was moved into the
base class default event handler.

rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateLayerTransform):
If 3d rendering is not supported, convert the matrix to an affine matrix
which can be rendered, and used for hit testing.

rendering/RenderLayerCompositor.cpp:
Change the name of the exported symbol that webkitdirs.pm uses to know if
3d rendering is supported. There is no other 3d-rendering-specific symbol we can sniff.

rendering/RenderObject.cpp:
(WebCore::RenderObject::transformFromContainer):
Only take perspective into account if 3d rendering is supported.

rendering/RenderObject.h:
(WebCore::makeMatrixRenderable):
Utility method that flattens a matrix if 3d rendering is not supported.

platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::willCacheResponse): Added a call to
ResourceHandleClient::shouldCacheResponse(). If the client returns
false, return 0, which will prevent CFNetwork from caching the response.

WebKit/win:

Reviewed by Adam Roben.

WebKit part of adding a mechanism for controlling the caching of
responses through WebFrameLoaderClient

WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::shouldCacheResponse): Implemented this new
FrameLoaderDelegate method by calling through to the resource load
delegate, if it implements shouldCacheResponse(), and returning true
otherwise.

dom/ContainerNode.cpp:
(WebCore::dispatchChildInsertionEvents): Increment DOM tree version. This will happen when
dispatching DOMSubtreeModified again, but the version should be incremented for event
listeners to have an up to date view of the DOM.
(WebCore::dispatchChildRemovalEvents): Ditto.

html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::insertedIntoTree):
Make sure that the select element knows about its new selected option.

html/HTMLOptionElement.h: Use insertedIntoTree() instead of insertedIntoDocument(),
because DOM also needs to be updated for forms that are not in document yet. Similar
problems exist for node removing, but removedFromTree() is called at a wrong time, so
those problems cannot be fixed without deeper refactoring.

html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setRecalcListItems): Reset m_activeSelectionAnchorIndex - it
doesn't make sense to keep the anchor after programmatically changing the selection, and
keeping it was causing a failure in fast/forms/listbox-selection.html.

html/HTMLSelectElement.h: Removed overrides for ContainerNode methods that only called
base class versions.

Make sure that the initial shouldPaint check that looks at enclosingLayers properly skips over
layers that don't paint themselves. This is done by adding a new boolean parameter to enclosingLayer
so that RenderObjects can walk up the enclosing layer chain and skip any layers that don't paint
themselves.

Make sure that the initial shouldPaint check that looks at enclosingLayers properly skips over
layers that don't paint themselves. This is done by adding a new enclosingSelfPaintingLayer method
so that RenderObjects can walk up the enclosing layer chain and skip any layers that don't paint
themselves.

Release memory allocated by FontPlatformDataPango in its own
destructor instead of doing it from other classes, and add copy
constructor and '=' operator to be able to track referenced
objects properly.

loader/ImageLoader.cpp:
(WebCore::loadEventSender): Added. Returns the single global ImageLoadEventSender
object used privately as the target of the load event timer.
(WebCore::ImageLoader::~ImageLoader): Call ImageLoadEventSender::cancelLoadEvent
rather than Document::removeImage.
(WebCore::ImageLoader::setImage): Use m_element directly, not element().
(WebCore::ImageLoader::updateFromElement): Ditto. Also name the local variable
document instead of doc.
(WebCore::ImageLoader::notifyFinished): Call ImageLoadEventSender::dispatchLoadEventSoon
rather than Document::dispatchImageLoadEventSoon.
(WebCore::ImageLoader::dispatchPendingLoadEvent): Added. Handles the common logic
about when load events can be dispatched so that dispatchLoadEvent only has to
have the specific part for each derived class. This includes a check that the
document is attached, which used to be handled by having documents empty out the
image load event vectors in the detach function.
(WebCore::ImageLoader::dispatchPendingLoadEvents): Added. Calls the appropriate
function on the ImageLoadEventSender, which avoids the need to have that class be
public in the ImageLoader header.
(WebCore::ImageLoadEventSender::ImageLoadEventSender): Added. Has the code that
was previously in the Document constructor.
(WebCore::ImageLoadEventSender::dispatchLoadEventSoon): Added. Has the code that
was previously in Document::dispatchImageLoadEventSoon.
(WebCore::ImageLoadEventSender::cancelLoadEvent): Added. Has the code that was
previously in Document::removeImage.
(WebCore::ImageLoadEventSender::dispatchPendingLoadEvents): Added. Has the code
that was previously in Document::dispatchImageLoadEventsNow.
(WebCore::ImageLoadEventSender::timerFired): Added. Calls dispatchPendingLoadEvents.

loader/ImageLoader.h: Improved comments. Made the virtual functions private
or protected rather than public. Added static dispatchPendingLoadEvents function
for use by Document and private dispatchPendingLoadEvent function for use by
ImageLoadEventSender. Made setLoadingImage private and eliminated
setHaveFiredLoadEvent since that can all be done inside the class without any
member functions.

html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::dispatchLoadEvent): Removed logic to check whether a
load event already fired and whether image() is 0. These are now both base class
responsibilities.

This test has one significant disadvantage. When it fails, the crash typically
occurs during a subsequent test, not this one. It would be great if someone figured
out at some point how to improve that.

loader/CrossOriginAccessControl.cpp:
(WebCore::isOnAccessControlSimpleRequestMethodWhitelist): Factored out simple method
check for use in both cached and uncached cases. In cached case, an old definition that
omitted HEAD was still used.
(WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Check that content type has an
allowed value. This is needed in all call sites. Also changed to compare MIME type, not
content type.
(WebCore::isSimpleCrossOriginAccessRequest): Use the above methods.

loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod):
(WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders):
Use the new checks for simple method and header.

editing/visible_units.cpp:
(WebCore::previousParagraphPosition): Use the last result from
previousLinePosition rather than going all the way back to what was originally
passed in when we hit exception cases like null or not moving. This correctly
inherits the behavior of previousLinePosition when we are in a paragraph at the
edge of a document.
(WebCore::nextParagraphPosition): Ditto.

webkit/webkitwebview.h: Implement "title" and "uri" properties as well
as according functions. "uri" always reflects the current location
including navigation inside the same page. title-changed is deprecated.

When a plug-in instance is torn down, all plug-in objects will first be invalidated and then deallocated.
Since objects can be deallocated in any order, it is not safe to call NPN_ReleaseObject on member variables.

platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivate::createQTMovieView): QTMovieContentViewClass is only used when
rendering inline with old versions of QuickTime, so don't look for it when we are in a
media document.

inspector/InspectorController.cpp:
(WebCore::InspectorController::populateScriptObjects): Changed to use bind method.
(WebCore::InspectorController::resetScriptObjects): Changed to use unbind method.
(WebCore::InspectorController::didUseDOMStorage): Changed to use isSameHostAndType and bind methods.

rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setContent): Used new getters and setters
on ContentData class. Changed first argument from a StringImpl*
to a PassRefPtr<StrimgImpl>. Used isText() convenience method.

Fix default policy decision to be ignore, on MIME checks, if
WebKit doesn't know how to handle the MIME type. The documentation
is already correct, and this was an oversight when the policy
decision code was first committed. Since 1.1.2 will be the first
release to support download, there is no practical change in
behavior.

Reintroduce the URI into the soup message after having set it in
the KURL, on redirects, to make sure it is properly encoded. This
fixes bad request problems when servers give bad URIs on their
response's Location header.

Non-Apple Mac ports build fix. Move defines for the BUILDING_ON_ macros into
Platform.h so that they're defined for all ports building on Mac, and tweak
the definitions of those macros based on Mark Rowe's suggestions to accomodate
cases where the values may not be <= to the .0 release for that version.

page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::EventHandler::handleMousePressEvent):
Take normal code path for right clicks (we were taking it for Ctrl-clicks anyway).

fix <rdar://problem/6607773> WebKit should support the "Default"
paragraph writing direction -- or at least validate the menu item
appropriately

Made WebHTMLView validate user interface items with the selector
-makeBaseWritingDirectionNatural: by returning NO and, if the item is
a menu item, setting its state to "off".

Strictly speaking, since -makeBaseWritingDirectionNatural: is never
valid for WebViews, WebHTMLView should not need to respond to it and
validate it, however because other responders respond to all three
-makeBaseWritingDirection*: messages and set the menu item state, having
WebHTMLView do the same makes application developers' lives easier.

Change the layout test result search policy for Mac OS X to fit better with the idea of
newer OS versions improving on previous OS versions.

Reviewed by Dan Bernstein.

The results for the latest version of Mac OS X are placed in the "mac" directory. The
results for older versions of Mac OS X are structured as a series of overlays. When
running on Leopard, the results in "mac-leopard" are searched before those in "mac".
When running on Tiger, the results in "mac-tiger" are searched before those in
"mac-leopard" and "mac".

loader/CrossOriginAccessControl.cpp:
(WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Added Content-Language.
(WebCore::isSimpleCrossOriginAccessRequest): Added HEAD. Restricted content types to those
that could be sent via form submission.