Full-page PDFPlugin should support inline form editing
https://bugs.webkit.org/show_bug.cgi?id=100155

Reviewed by Dan Bernstein.

Add form controls corresponding to Text and Choice PDF annotations,
allowing for single- and multi-line text input, and <select>-like input.

Currently, forms are only implemented for full-page PDF documents.

* Shared/mac/PDFKitImports.h:
(WebKit): Add pdfAnnotationTextWidgetClass and pdfAnnotationChoiceWidgetClass.
* Shared/mac/PDFKitImports.mm:
(WebKit::pdfAnnotationTextWidgetClass): Add pdfAnnotationTextWidgetClass.
(WebKit::pdfAnnotationChoiceWidgetClass): Add pdfAnnotationChoiceWidgetClass.
* WebKit2.xcodeproj/project.pbxproj: Add PDFLayerControllerDetails, PDFPluginTextAnnotation, PDFPluginChoiceAnnotation,
and PDFPluginAnnotation.
* WebProcess/Plugins/PDF/PDFLayerControllerDetails.h: Added. Extract PDFLayerController details category into a header.
* WebProcess/Plugins/PDF/PDFPlugin.h:
(PDFPlugin): Add m_activeAnnotation, to keep track of the active PDFPluginAnnotation, and m_annotationContainer,
the <div> that form controls are inserted into.
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate pdfLayerController:didChangeActiveAnnotation:]): Forward active annotation changes to PDFPlugin.
(WebKit::PDFPlugin::PDFPlugin): Add a <div> to the PluginDocument <body>, which will contain <input>, <select>, and <textarea> elements
corresponding to the active annotation. This div is made to fit to the body, and is "overflow: hidden" so that form elements scrolled
out of the viewport do not cause the Document to expand to be larger than the Plugin.
(WebKit::PDFPlugin::pdfDocumentDidLoad): Update PDFPlugin's notion of the scroll position immediately after the document loads, in case
the scroll position is constrained by PDFKit.
(WebKit::PDFPlugin::destroy): Tear down any forms for the active annotation.
(WebKit::PDFPlugin::geometryDidChange): Notify the current annotation that it should update its geometry when the Plugin's geometry changes.
(WebKit::PDFPlugin::setScrollOffset): Notify the current annotation that it should update its geometry when we scroll.
(WebKit::PDFPlugin::setActiveAnnotation): Commit changes to the current annotation, if there is one, then make a new PDFPluginAnnotation
corresponding to the newly active annotation, and attach it to our document.
* WebProcess/Plugins/PDF/PDFPluginAnnotation.h: Added.
(WebKit::PDFPluginAnnotation::element): Return the Element corresponding to this object.
(WebKit::PDFPluginAnnotation::annotation): Return the PDFAnnotation corresponding to this object.
(WebKit::PDFPluginAnnotation::plugin): Return the Plugin that created this object.
(WebKit::PDFPluginAnnotation::commit): Commit changes from the form to the PDFAnnotation. This is implemented in subclasses.
(WebKit::PDFPluginAnnotation::attach): Attach a PDFPluginAnnotation to its parent Element.
(WebKit::PDFPluginAnnotation::parent): Return the parent Element that we're attach()ed to.
(WebKit::PDFPluginAnnotation::pdfLayerController): Return the pdfLayerController that the PDFAnnotation comes from.
(PDFPluginAnnotationEventListener): Add an event listener to respond to "change" and "blur" events from m_element.
* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Added.
(WebKit::PDFPluginAnnotation::create): Create the appropriate PDFPluginAnnotation subclass (PDFPluginTextAnnotation or
PDFPluginChoiceAnnotation based on the class of the PDFAnnotation).
(WebKit::PDFPluginAnnotation::attach): Lazily create the HTML form element corresponding to this annotation. Add it to its parent
element. Add event listeners for "change" and "blur".
(WebKit::PDFPluginAnnotation::~PDFPluginAnnotation): Tear down the annotation, by removing event listeners and removing
the form element from its parent element.
(WebKit::PDFPluginAnnotation::updateGeometry): Update the size and position of the form element, given the current PDF scale and scrolling position.
(WebKit::PDFPluginAnnotation::PDFPluginAnnotationEventListener::handleEvent): If we get a blur or change event, we should remove the
form control to match the behavior of PDFKit.
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h: Added.
(WebKit::PDFPluginChoiceAnnotation::choiceAnnotation): Return annotation() with the appropriate cast.
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Added.
(WebKit::PDFPluginChoiceAnnotation::updateGeometry): Update the font size of the choice widget given the current PDF scale.
(WebKit::PDFPluginChoiceAnnotation::commit): Save the value of the currently selected <option> into the PDFAnnotationChoiceWidget.
(WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Create a <select> element, populated with <option> elements
for the PDFAnnotationChoiceWidget's available choices. Select the correct <option> initially.
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h: Added.
(WebKit::PDFPluginTextAnnotation::textAnnotation): Return annotation() with the appropriate cast.
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Added.
(WebKit::cssAlignmentValueForNSTextAlignment): Return the CSS alignment value for a given NSTextAlignment.
(WebKit::PDFPluginTextAnnotation::createAnnotationElement): Create a <textarea> or <input> element, depending on whether the
PDFAnnotationTextWidget supports multiline editing or not.
(WebKit::PDFPluginTextAnnotation::updateGeometry): Update the font size of the text widget given the current PDF scale.
(WebKit::PDFPluginTextAnnotation::commit): Save the current string in the form element into the PDFAnnotationTextWidget.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::focusedPluginViewForFrame): Return the PluginView for a Frame only if the Plugin's element is focused.
(WebKit::WebPage::executeEditingCommand): Only forward editing commands to PluginView if the plugin itself is focused.
(WebKit::WebPage::isEditingCommandEnabled): Ditto.
(WebKit::WebPage::validateCommand): Ditto.

* WebCore.exp.in: Expose a variety of additional WebCore functionality to WebKit2.
* WebCore.xcodeproj/project.pbxproj: Expose some more WebCore headers as private headers for use in WebKit2.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Spatialized panning renders incorrectly with USE_CONCATENATED_IMPULSE_RESPONSES
https://bugs.webkit.org/show_bug.cgi?id=98294

Reviewed by Chris Rogers.

Regenerated the concatenated impulse responses file with
elevations in increasing order per azimuth. In the previous
version of this file the elevations for 315, 330 and 345 were
concatenated at the wrong indexes.

* platform/audio/resources/Composite.wav:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix 32bit build breakage.

* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
(WebKit::PDFPluginAnnotation::updateGeometry):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add non-virtual firstChild/lastChild overrides to RenderBlock and RenderTableCol for a > 30% speedup on table from bug 100304
https://bugs.webkit.org/show_bug.cgi?id=100306

Reviewed by Abhishek Arya.

Presumably this is a speedup for other rendering tests as well.  We use firstChild() all over
the rendering code w/o considering that it makes a virtual function call.
Originally I just fixed the one callsite which was showing up on the sample to
use children()->firstChild() directly.  However after further thought, this
broader solution seemed the better way to go.  The first patch was a 15% win for
this large table, this broader solution was a 30%!? win.

The elephant in the room for this table is that we're walking the whole table
for many nextColumn calls.  But that I will solve in a later bug.

* rendering/RenderBlock.h:
(WebCore::RenderBlock::firstChild):
(WebCore::RenderBlock::lastChild):
(RenderBlock):
* rendering/RenderObject.h:
(RenderObject):
* rendering/RenderTableCol.h:
(WebCore::RenderTableCol::firstChild):
(WebCore::RenderTableCol::lastChild):
(RenderTableCol):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix header sorting in r132992.

* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, attempt to fix the build by exporting NoExceptionAssertionChecker symbols.

* WebCore.exp.in:


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