Mark svg/custom/xlink-prefix-in-attributes.html as failing on Mac
https://bugs.webkit.org/show_bug.cgi?id=118701

Unreviewed, changing test expectations

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Add Gwang Yoon Hwang to contributor list.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update blocked/missing plug-in UI
https://bugs.webkit.org/show_bug.cgi?id=118347
<rdar://problem/14209318>

Reviewed by Sam Weinig.
Patch by Anders Carlsson, Antoine Quint, Sam Weinig, and myself.

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.am:
* WebCore.exp.in:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSDefaultStyleSheets.cpp:
* css/unavailablePlugIns.css: Added.
Add new Source/WebCore/css/unavailablePlugIns.css stylesheet.

* dom/EventListener.h:
New event listener type to support the creation of an event listener
for the label and icon for missing / blocked plug-in UI.

* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::defaultEventHandler):
Remove explicit event handling since we're now using a DOM event handler
on the label and icon in the shadow root.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
Don't populate the shadow root with plugin snapshotting elements
if we're not planning on showing a snapshot, because this means that
the shadow root was created for the unavailable plugin indicator instead.

* page/ChromeClient.h:
(WebCore::ChromeClient::shouldUnavailablePluginMessageIncludeButton):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::RenderEmbeddedObject):
(WebCore::shouldUnavailablePluginMessageIncludeButton):
Rename from shouldUnavailablePluginMessageBeButton to
shouldUnavailablePluginMessageIncludeButton for accuracy.

(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReasonDescription):
Set custom text to be displayed in the unavailability indicator.

(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason):
(WebCore::RenderEmbeddedObject::handleUnavailablePluginButtonClickEvent):
(WebCore::RenderEmbeddedObject::willBeDestroyed):
(WebCore::RenderEmbeddedObject::isReplacementObscured):
(WebCore::RenderEmbeddedObjectEventListener::handleEvent):
(WebCore::RenderEmbeddedObjectEventListener::operator==):
Remove the old code used to render the missing / blocked plug-in UI in C++ in favor
of populating a shadow root in setPluginUnavailabilityReason(). We add a DOM event
listener in the shadow root to eventually call into unavailablePluginButtonClicked()
on the ChromeClient.

(WebCore::RenderEmbeddedObject::paint):
(WebCore::RenderEmbeddedObject::layout):
Paint and lay out UA shadow root children.

(WebCore::RenderEmbeddedObject::canHaveChildren):
canHaveChildren can use the existence of a UA shadow root to decide
whether a RenderEmbeddedObject can have children.

* rendering/RenderEmbeddedObject.h:
(WebCore::RenderEmbeddedObjectEventListener::create):
(WebCore::RenderEmbeddedObjectEventListener::cast):
(WebCore::RenderEmbeddedObjectEventListener::RenderEmbeddedObjectEventListener):
Create the new event listener class necessary to handle events in the shadow root.

(WebCore::RenderEmbeddedObject::pluginUnavailabilityReasonDescription): Added.

* rendering/RenderWidget.h:
Promote willBeDestroyed() to be public so we may override it in the RenderEmbeddedObject subclass.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::shouldUnavailablePluginMessageIncludeButton):
Rename from shouldUnavailablePluginMessageBeButton to
shouldUnavailablePluginMessageIncludeButton for accuracy.

* Platform/CoreIPC/HandleMessage.h:
(CoreIPC::callMemberFunction):
Add a 6 argument -> 4 reply message handler.
(It seems that FindPlugin is getting a little out of hand.)

* Shared/APIClientTraits.cpp:
* Shared/APIClientTraits.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::pluginLoadPolicy):
* UIProcess/WebLoaderClient.h:
Add an unavailability description out-argument to a new version of
pluginLoadPolicy, so clients can override the text of the unavailable
plugin indicator. Bump the WKPageLoaderClient version and update APIClientTraits.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::findPlugin):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Plumb the unavailability description through to the WebProcess via
the FindPlugin message.

* WebProcess/Plugins/PluginProcessConnection.cpp:
(WebKit::PluginProcessConnection::didClose):
Make a strongly referencing copy of the list of PluginProxies, so we can
throw them away without the HashMap being mutated underneath us (see the comment).

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::pluginProcessCrashed):
Invalidate the plug-in's widget before setting the plugin unavailability reason,
because doing so would cause the plug-in's renderer to be torn down, making
invalidate() crash.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::shouldUnavailablePluginMessageIncludeButton):
* WebProcess/WebCoreSupport/WebChromeClient.h:
Rename from shouldUnavailablePluginMessageBeButton to
shouldUnavailablePluginMessageIncludeButton for accuracy.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
Acquire the unavailability description from the client
(via FindPlugin) and hand it to the RenderEmbeddedObject.
(WebKit::WebPage::canPluginHandleResponse):
Re-acquire the plugin's renderer, in case setPluginUnavailabilityReason destroyed it.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):
Match new WKPageLoaderClient entry.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for WaveShaperNode.oversample
https://bugs.webkit.org/show_bug.cgi?id=117435

Reviewed by Kenneth Russell.

Source/WebCore:

Adapted from Blink:
https://codereview.chromium.org/15619003/

Please see specification for details:
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#WaveShaperNode

.oversample specifies what type of oversampling (if any) should be used when applying the shaping curve.
The default value is "none", meaning the curve will be applied directly to the input samples.
A value of "2x" or "4x" can improve the quality of the processing by avoiding some aliasing,
with the "4x" value yielding the highest quality.

Tests: webaudio/waveshaper-oversample-2x.html
       webaudio/waveshaper-oversample-4x.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* Modules/webaudio/WaveShaperDSPKernel.cpp:
(WebCore::WaveShaperDSPKernel::WaveShaperDSPKernel):
(WebCore::WaveShaperDSPKernel::lazyInitializeOversampling):
(WebCore::WaveShaperDSPKernel::process):
(WebCore::WaveShaperDSPKernel::processCurve):
(WebCore::WaveShaperDSPKernel::processCurve2x):
(WebCore::WaveShaperDSPKernel::processCurve4x):
(WebCore::WaveShaperDSPKernel::reset):
(WebCore::WaveShaperDSPKernel::latencyTime):
* Modules/webaudio/WaveShaperDSPKernel.h:
* Modules/webaudio/WaveShaperNode.cpp:
(WebCore::WaveShaperNode::WaveShaperNode):
(WebCore::WaveShaperNode::setOversample):
(WebCore::WaveShaperNode::oversample):
* Modules/webaudio/WaveShaperNode.h:
(WebCore::WaveShaperNode::latency):
* Modules/webaudio/WaveShaperNode.idl:
* Modules/webaudio/WaveShaperProcessor.cpp:
(WebCore::WaveShaperProcessor::WaveShaperProcessor):
(WebCore::WaveShaperProcessor::setOversample):
* Modules/webaudio/WaveShaperProcessor.h:
(WebCore::WaveShaperProcessor::oversample):
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/DownSampler.cpp: Added.
(WebCore::DownSampler::DownSampler):
(WebCore::DownSampler::initializeKernel):
(WebCore::DownSampler::process):
(WebCore::DownSampler::reset):
(WebCore::DownSampler::latencyFrames):
* platform/audio/DownSampler.h: Added.
* platform/audio/UpSampler.cpp: Added.
(WebCore::UpSampler::UpSampler):
(WebCore::UpSampler::initializeKernel):
(WebCore::UpSampler::process):
(WebCore::UpSampler::reset):
(WebCore::UpSampler::latencyFrames):
* platform/audio/UpSampler.h: Added.

LayoutTests:

* webaudio/resources/waveshaper-testing.js: Added.
(T0):
(T1):
(T2):
(T3):
(T4):
(generateWaveShapingCurve):
(checkShapedCurve):
(createImpulseBuffer):
(runWaveShaperOversamplingTest):
* webaudio/waveshaper-oversample-2x-expected.txt: Added.
* webaudio/waveshaper-oversample-2x.html: Added.
* webaudio/waveshaper-oversample-4x-expected.txt: Added.
* webaudio/waveshaper-oversample-4x.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed rebaselines after r152701.

* editing/pasteboard/paste-noplugin-expected.txt:
* http/tests/security/contentSecurityPolicy/object-src-url-blocked-expected.txt:
* platform/mac/accessibility/plugin-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce toHTMLIFrameElement
https://bugs.webkit.org/show_bug.cgi?id=118672

Reviewed by Ryosuke Niwa.

To avoid direct use of static_cast, this patch introduces toHTMLIFrameElement for code cleanup.

Source/WebCore:

* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* dom/Document.cpp:
(WebCore::Document::seamlessParentIFrame):
* html/HTMLIFrameElement.h:
(WebCore::toHTMLIFrameElement):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::viewCleared):
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::isSeamless):
(WebCore::RenderIFrame::flattenFrame):

Source/WebKit/win:

* DOMHTMLClasses.cpp:
(DOMHTMLIFrameElement::contentFrame):

Source/WebKit2:

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Input element that becomes visible during a simulated click event from an associated label element doesn't get focused
https://bugs.webkit.org/show_bug.cgi?id=118700

Reviewed by Kent Tamura.

Source/WebCore:

Inspired by https://chromium.googlesource.com/chromium/blink/+/6435f70d53403b250e261a914f30d55142f81476.

The bug was caused by isMouseFocusable() check in HTMLLabelElement::defaultEventHandler not updating the layout even
though the call to dispatchSimulatedClick may have dirtied the render tree.

Explicitly update the layout so that we have up-to-date render tree.

Test: fast/forms/label/label-becomes-visible-while-clicking-on-label.html

* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::defaultEventHandler):

LayoutTests:

Add a regression test.

* fast/forms/label/label-becomes-visible-while-clicking-on-label-expected.txt: Added.
* fast/forms/label/label-becomes-visible-while-clicking-on-label.html: Added.


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