Remove dead code in Node.idl
https://bugs.webkit.org/show_bug.cgi?id=99237

Reviewed by Maciej Stachowiak.

We don't implement this feature. This code is dead and should be
removed.

* dom/Node.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Fetch blit rects from a viewport accessor
https://bugs.webkit.org/show_bug.cgi?id=98581
RIM PR 173292

Reviewed by George Staikos.
Internally reviewed by Arvid Nilsson.

Source/WebKit:

Add new ViewportAccessor files to the build.
See Source/WebKit/blackberry/ChangeLog for the
verbose commit message.

* PlatformBlackBerry.cmake:

Source/WebKit/blackberry:

The long-standing userInterfaceBlittedVisibleContentsRect()
method in WebPageClient has long been a major annoyance,
as it returns the source rect for WebKit contents but in
backingstore pixel coordinates. This makes it not only
unwieldy but also terribly fragile, especially when
both pinch zoom and a backingstore re-render both deal
with the same rectangle. On different threads, even.

BlackBerry::Platform now exposes a ViewportAccessor
interface, which can be used to get the various rects
in document coordinates or target pixel coordinates,
both being a better choice than the ones dependent
on an implentation detail.

This commit makes use of this new functionality.
Instead of relying on the passed rectangle to contain
implicit information about the scale factor, we now
track the scale of each backingstore geometry by making
a snapshot of the current WebKit-thread scale when the
geometry is generated. Once the geometry is swapped to
the front, we can then calculate the remaining
backingstore-to-viewport transformation in a threadsafe
way. We now only calculate this if we actually blit from
backingstore tiles and don't go through a configuration
of pure accelerated compositing.

As a result, we are now a lot more robust against
synchonization issues related to backingstore
geometry changes. As an additional gimmick, the scale
is also stored with each tile buffer to doubly secure
that a tile rendered in one scale is not transferred
to a different geometry and then rendered there without
being rerendered at the new scale, even if the rendered
pixel coordinates are still the same.

Having per-geometry scale information also opens up
opportunities to further improve backingstore rendering
later. For instance, we could pre-render a low-res
version of the page onto one buffer and combine that one
with a higher-res array of tiles covering a smaller area.
Or we could steal some tiles from the front geometry to
render them at a new scale while a pinch-zoom operation
is in progress.

No such thing is implemented in this patch though.

In adapting/fixing the backingstore visualization
debug mode and the default background painting in
renderDirectToWindow(), we also introduce new
ViewportAccessor subclasses that can subsequently
be used to replace methods from WebPage and elsewhere.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::slowScroll):
(BlackBerry::WebKit::BackingStorePrivate::scroll):
(BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect):
(BlackBerry::WebKit::BackingStorePrivate::scrollBackingStore):
(BlackBerry::WebKit::BackingStorePrivate::renderDirectToWindow):
(BlackBerry::WebKit::BackingStorePrivate::render):
(BlackBerry::WebKit::BackingStorePrivate::paintDefaultBackground):
(BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):
(BlackBerry::WebKit::BackingStorePrivate::blitHorizontalScrollbar):
(BlackBerry::WebKit::BackingStorePrivate::blitVerticalScrollbar):
(BlackBerry::WebKit::BackingStorePrivate::updateTilesForScrollOrNotRenderedRegion):
(BlackBerry::WebKit::BackingStorePrivate::updateTileMatrixIfNeeded):
(BlackBerry::WebKit::BackingStorePrivate::orientationChanged):
(BlackBerry::WebKit::BackingStorePrivate::createSurfaces):
(BlackBerry::WebKit::BackingStorePrivate::invalidateWindow):
* Api/BackingStore_p.h:
(BlackBerry):
(Platform):
(BlackBerry::WebKit::BackingStoreGeometry::BackingStoreGeometry):
(BlackBerry::WebKit::BackingStoreGeometry::scale):
(BlackBerry::WebKit::BackingStoreGeometry::setScale):
(BackingStoreGeometry):
(BackingStorePrivate):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::~WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::init):
(BlackBerry::WebKit::WebPage::webkitThreadViewportAccessor):
(WebKit):
* Api/WebPage.h:
(Platform):
* Api/WebPageClient.h:
(Platform):
* Api/WebPageCompositor.cpp:
(BlackBerry::WebKit::WebPageCompositorPrivate::animationFrameChanged):
* Api/WebPage_p.h:
(WebKit):
(WebPagePrivate):
* WebKitSupport/BackingStoreTile.cpp:
(BlackBerry::WebKit::TileBuffer::TileBuffer):
(BlackBerry::WebKit::TileBuffer::isRendered):
* WebKitSupport/BackingStoreTile.h:
(TileBuffer):
(BlackBerry::WebKit::TileBuffer::scale):
(BlackBerry::WebKit::TileBuffer::setScale):
* WebKitSupport/BackingStoreVisualizationViewportAccessor.cpp: Added.
(WebKit):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::BackingStoreVisualizationViewportAccessor):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::pixelContentsSize):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::documentContentsSize):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::pixelScrollPosition):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::documentScrollPosition):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::pixelViewportSize):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::documentViewportSize):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::destinationSurfaceOffset):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::scale):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::state):
* WebKitSupport/BackingStoreVisualizationViewportAccessor.h: Added.
(BlackBerry):
(Platform):
(WebKit):
(BackingStoreVisualizationViewportAccessor):
(BlackBerry::WebKit::BackingStoreVisualizationViewportAccessor::~BackingStoreVisualizationViewportAccessor):
* WebKitSupport/WebKitThreadViewportAccessor.cpp: Added.
(WebKit):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::WebKitThreadViewportAccessor):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::pixelContentsSize):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::documentContentsSize):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::pixelScrollPosition):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::documentScrollPosition):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::pixelViewportSize):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::documentViewportSize):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::destinationSurfaceOffset):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::scale):
* WebKitSupport/WebKitThreadViewportAccessor.h: Added.
(BlackBerry):
(Platform):
(WebKit):
(WebKitThreadViewportAccessor):
(BlackBerry::WebKit::WebKitThreadViewportAccessor::~WebKitThreadViewportAccessor):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
I pity da foo' who's converting numbers to strings
https://bugs.webkit.org/show_bug.cgi?id=99197

Reviewed by Gavin Barraclough.

40% speedup on PerformanceTests/Dromaeo/dom-traverse.html. Probably speeds
some other things up too.

Credit to Eric Seidel for spotting this.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): getOwnPropertySlotByIndex doesn't need to prefer
string lookup in the static table because our static tables don't contain
properties that are numbers.

I believe this is low-hanging fruit left behind by Phil's
getOwnPropertySlotByIndex optimization, but it's also possible that this was a
regression at some point. I didn't check.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[TestResultServer] Unit tests require an update after r131239
https://bugs.webkit.org/show_bug.cgi?id=99236

Reviewed by Ojan Vafai.

Replacing 'Webkit' with 'WebKit' in builder names througout the unit tests
after the Chromium builders have been renamed recently.

* TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:


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

Updated bindings test results.

* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add warning for unrenderable textures
https://bugs.webkit.org/show_bug.cgi?id=99235

Patch by Gregg Tavares <gman@google.com> on 2012-10-13
Reviewed by Kenneth Russell.

Unrenderable textures are often hard to debug. Adds a message to that
appears in the JavaScript console to help developers find the issue.

No new tests as no new functionality.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::drawArrays):
(WebCore::WebGLRenderingContext::drawElements):
(WebCore::WebGLRenderingContext::handleNPOTTextures):
* html/canvas/WebGLRenderingContext.h:
(WebGLRenderingContext):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebAudioBus needs support for resizing bus to a smaller size
https://bugs.webkit.org/show_bug.cgi?id=99215

Reviewed by Dimitri Glazkov.

Upgrade AudioBus and WebAudioBus to support resizing to a smaller size, once it has been created.
This is useful, for example, when decoding VBR formats and the actual length can't be exactly determined
until the entire file is decoded.

Source/Platform:

* chromium/public/WebAudioBus.h:
(WebAudioBus):

Source/WebCore:

* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::resizeSmaller):
(WebCore):
* platform/audio/AudioBus.h:
(AudioBus):
* platform/audio/AudioChannel.cpp:
(WebCore::AudioChannel::resizeSmaller):
(WebCore):
* platform/audio/AudioChannel.h:
(AudioChannel):
* platform/chromium/support/WebAudioBus.cpp:
(WebKit::WebAudioBus::resizeSmaller):
(WebKit):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a private header for WKWebProcessPlugInBrowserContextController that defines a property for getting the WKBundlePageRef
https://bugs.webkit.org/show_bug.cgi?id=99252

Reviewed by Sam Weinig.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _bundlePageRef]):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use class extension rather than a void* member for new Objective-C WebProcessPlugIn SPI
https://bugs.webkit.org/show_bug.cgi?id=99256

Reviewed by Dan Bernstein.

A bit of good old fashion cleanup.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
Remove the void* member.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
Move members from the WKWebProcessPlugInControllerData struct to a class extension.

(didCreatePage):
(willDestroyPage):
(-[WKWebProcessPlugInController _initWithPrincipalClassInstance:bundleRef:]):
Directly access the members instead of using properties, now that it is not inconvenient.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
Remove the void* member.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
Move members from the WKWebProcessPlugInBrowserContextControllerData struct to a class extension.

(-[WKWebProcessPlugInBrowserContextController _initWithBundlePageRef:]):
(-[WKWebProcessPlugInBrowserContextController _bundlePageRef]):
Remove unnecessary casts..

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
Add space before the parenthesis of a category to be consistent.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h:
Remove unnecessary forward declare.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
InspectorPageAgent should expose a method to control the compositing debug settings.
https://bugs.webkit.org/show_bug.cgi?id=99253

Patch by Antoine Quint <graouts@apple.com> on 2012-10-14
Reviewed by Timothy Hatcher.

* inspector/Inspector.json:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setCompositingBordersVisible):
* inspector/InspectorPageAgent.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r130656.
http://trac.webkit.org/changeset/130656
https://bugs.webkit.org/show_bug.cgi?id=97592

Broke CMake build on Windows

* CMakeLists.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for WinCE after r131089.

WinCE does not support getenv().

* runtime/Options.cpp:
(JSC::overrideOptionWithHeuristic):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Array length array profiling is broken in the baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=99258

Reviewed by Oliver Hunt.

The code generator for array length stubs calls into
emitArrayProfilingSiteForBytecodeIndex(), which emits profiling only if
canBeOptimized() returns true. But m_canBeOptimized is only initialized during
full method compiles, so in a stub compile it may (or may not) be false, meaning
that we may, or may not, get meaningful profiling info.
        
This appeared to not affect too many programs since the LLInt has good array
length array profiling.

* jit/JIT.h:
(JSC::JIT::compilePatchGetArrayLength):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131268 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build of universal binary with ARMv7s of JavaScriptCore

* llint/LLIntOfflineAsmConfig.h:
* llint/LowLevelInterpreter.asm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG structure check hoisting should attempt to ignore side effects and make transformations that are sound even in their presence
https://bugs.webkit.org/show_bug.cgi?id=99262

Reviewed by Oliver Hunt.

This hugely simplifies the structure check hoisting phase. It will no longer be necessary
to modify it when the effectfulness of operations changes. This also enables the hoister
to hoist effectful things in the future.
        
The downside is that the hoister may end up adding strictly more checks than were present
in the original code, if the code truly has a lot of side-effects. I don't see evidence
of this happening. This patch does have some speed-ups and some slow-downs, but is
neutral in the average, and the slow-downs do not appear to have more structure checks
than ToT.

* dfg/DFGStructureCheckHoistingPhase.cpp:
(JSC::DFG::StructureCheckHoistingPhase::run):
(JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck):
(StructureCheckHoistingPhase):
(CheckData):
(JSC::DFG::StructureCheckHoistingPhase::CheckData::CheckData):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] Implement PDFPlugin
https://bugs.webkit.org/show_bug.cgi?id=99206

Reviewed by Dan Bernstein.

Add PDFPlugin, which uses PDFKit to display PDFs, instead of using PDFKit in the
UIProcess for full-page PDFs. This new plugin will also be used for inline PDFs
in place of SimplePDFPlugin (née BuiltInPDFView).

* Configurations/FeatureDefines.xcconfig: Add ENABLE_PDF_PLUGIN.

Support three new Plugin methods:
    - handleEditingCommand, which hands editing commands to the Plugin
    - isEditingCommandEnabled, which validates editing commands via the Plugin
    - handlesPageScaleFactor, which asks the plugin whether it wants to
    opt into a mode where the WebPage doesn't scale in the ordinary fashion,
    but instead proxies the Plugin's scale factor, so full-page plugins
    can handle scale factor changes however they need to.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::handleEditingCommand): Proxy handleEditingCommand to the Plugin.
(WebKit::PluginControllerProxy::isEditingCommandEnabled): Proxy isEditingCommandEnabled to the Plugin.
(WebKit::PluginControllerProxy::handlesPageScaleFactor): Proxy handlesPageScaleFactor to the Plugin.
* PluginProcess/PluginControllerProxy.h:
(PluginControllerProxy): Add handleEditingCommand, isEditingCommandEnabled, and handlesPageScaleFactor.
* PluginProcess/PluginControllerProxy.messages.in: Add HandleEditingCommand, IsEditingCommandEnabled, and HandlesPageScaleFactor.
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::handleEditingCommand): NPAPI plugins support no editing commands by default.
(WebKit::NetscapePlugin::isEditingCommandEnabled): NPAPI plugins enable no editing commands by default.
(WebKit::NetscapePlugin::handlesPageScaleFactor): NPAPI plugins do not handle page scale factor changes themselves by default.
* WebProcess/Plugins/Netscape/NetscapePlugin.h: Add handleEditingCommand, isEditingCommandEnabled, and handlesPageScaleFactor.

Add PDFPluginEnabled preference. If it is not enabled, or the plugin is
not built, behavior will be the same as before (the UIProcess PDFView will
handle full-page PDFs, and SimplePDFPlugin will handle inline ones).

* Shared/WebPreferencesStore.h: Add PDFPluginEnabled preference.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPDFPluginEnabled): Setter for PDFPluginEnabled preference.
(WKPreferencesGetPDFPluginEnabled): Getter for PDFPluginEnabled preference.
* UIProcess/API/C/WKPreferencesPrivate.h: Expose WKPreferences(Set|Get)PDFPluginEnabled as a private preference.

Move support for MIME types with custom representations onto WebPage instead of WebProcess.
This allows us to use preferences to control the use of custom representations (for example,
it allows us to have a preference to toggle between UIProcess's PDFView and PDFPlugin).

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode): Don't pass mimeTypesWithCustomRepresentation
into the WebProcess, as we can compute it later.
(WebKit::WebProcessCreationParameters::decode): Same, on the decode side.
* Shared/WebProcessCreationParameters.h: Remove mimeTypesWithCustomRepresentation.
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitializeWebProcess): Don't add pdfAndPostScriptMIMETypes to mimeTypesWithCustomRepresentation here, as we're now computing it on WebPage instead.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::canPluginHandleResponse): Move to WebPage from WebProcess so we can use WebPage's new notion of mimeTypesWithCustomRepresentation.
(WebKit::WebPage::shouldUseCustomRepresentationForResponse): Move to WebPage from WebProcess so we can use WebPage's new notion of mimeTypesWithCustomRepresentation.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::pdfAndPostScriptMIMETypes): Return the set of MIME types used for PDF and PostScript, which are handled with PDFView if PDFPlugin is not available or enabled.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess): Don't keep m_mimeTypesWithCustomRepresentations on WebProcess, it's owned by WebPage now.
* WebProcess/WebProcess.h: Move canPluginHandleResponse and shouldUseCustomRepresentationForResponse to WebPage.

Add PDFLayerController to the set of classes returned by PDFKitImports.

* Shared/mac/PDFKitImports.h: Add pdfLayerControllerClass.
* Shared/mac/PDFKitImports.mm:
(WebKit::pdfLayerControllerClass): Find and return the PDFLayerController class.

Add PDFPlugin, which inherits from SimplePDFPlugin, but uses PDFKit instead
of CoreGraphics, to provide additional interactive functionality.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sendDidGetPlugins): Add PDFPlugin to the set of supported plugins.
* WebKit2.xcodeproj/project.pbxproj: Add PDFPlugin, rename BuiltInPDFView to SimplePDFPlugin.
* WebProcess/Plugins/PDF/PDFPlugin.h: Added.
* WebProcess/Plugins/PDF/PDFPlugin.mm: Added.

PDFPlugin uses layers for scrollbars.

(-[WKPDFPluginScrollbarLayer initWithPDFPlugin:WebKit::]): Initialize our CALayer subclass,
storing its parent PDFPlugin so it can delegate drawing there.
(-[WKPDFPluginScrollbarLayer actionForKey:]): Disable CoreAnimation implicit actions.
(-[WKPDFPluginScrollbarLayer drawInContext:]): Delegate scrollbar drawing to PDFPlugin.

Implement the PDFLayerController delegate, eventually forwarding calls back to PDFPlugin.

(-[WKPDFLayerControllerDelegate initWithPDFPlugin:WebKit::]): Initialize our delegate,
storing its parent PDFPlugin so it can forward delegate calls there.
(-[WKPDFLayerControllerDelegate updateScrollPosition:]): Update PDFPlugin's notion of the
current scroll position, when PDFKit changes the scroll position itself.
(-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]): Write the given
array of NSData objects to the pasteboard with the given types.

The following PDFLayerController delegate methods will be implemented in the future.

(-[WKPDFLayerControllerDelegate showDefinitionForAttributedString:atPoint:]):
(-[WKPDFLayerControllerDelegate performWebSearch:]):
(-[WKPDFLayerControllerDelegate openWithPreview]):
(-[WKPDFLayerControllerDelegate saveToPDF]):

(WebKit::PDFPlugin::PDFPlugin): Set up the requisite layer hierarchy, and create a PDFLayerController (and its delegate proxy).
(WebKit::PDFPlugin::updateScrollbars): Update the frame of the layers hosting our scrollbars.
(WebKit::PDFPlugin::createScrollbar): Create a scrollbar and hosting layer, attaching its layer
to PDFPlugin's container layer.
(WebKit::PDFPlugin::destroyScrollbar): Destroy a scrollbar, detaching and destroying its hosting layer in the process.
(WebKit::PDFPlugin::pdfDocumentDidLoad): Called when the document finishes loading; hand
the loaded document to PDFKit, update all of our state (cached document size, scrollbars, etc.), and then execute any scripts in the document (to allow for automatic printing).
(WebKit::PDFPlugin::calculateSizes): Determine the size of the PDF and its pages.
(WebKit::PDFPlugin::destroy): Tear down the layer hierarchy.
(WebKit::PDFPlugin::paint): PDFPlugin is layer-based, so we paint nothing into the tiles.
(WebKit::PDFPlugin::paintControlForLayerInContext): Scrollbar controls are drawn into layers, but their painting is delegated here from WKPDFPluginScrollbarLayer.
(WebKit::PDFPlugin::snapshot): Perform a paint into a bitmap context.
(WebKit::PDFPlugin::pluginLayer): Return PDFPlugin's root layer.
(WebKit::PDFPlugin::geometryDidChange): The size or scale of the plugin changed; update
PDFLayerController's notion of the size and page scale, and invalidate the scrollbars.

Mouse and keyboard events are converted back into NSEvents, but with
locationInWindow actually in terms of the PDFPlugin's layer, not
the window (since there is no window).

(WebKit::modifierFlagsFromWebEvent): Construct an AppKit-style modifier bitmask from WebEvent's modifier key getters.
(WebKit::eventTypeFromWebEvent): Return the NSEventType equivalent to the given WebEvent. Only supports keyboard and mouse events, and only the left and right mouse button.
(WebKit::PDFPlugin::handleMouseEvent): Construct an NSEvent from the given WebMouseEvent and hand it to PDFLayerController. Mouse coordinates are in terms of m_contentLayer's origin.
(WebKit::PDFPlugin::handleKeyboardEvent): Construct an NSEvent from the given WebKeyboardEvent and hand it to PDFLayerController. PDFLayerController currently only handles keyDown events.

(WebKit::PDFPlugin::handleEditingCommand): Handle copy and select-all commands, and forward them to PDFLayerController.
(WebKit::PDFPlugin::isEditingCommandEnabled): The 'copy' command should be enabled if
the user has selected a part of the PDF. The 'select all' command should always be enabled.

(WebKit::PDFPlugin::setScrollOffset): Update both PDFPlugin and PDFLayerController's notion
of the current scroll position.
(WebKit::PDFPlugin::invalidateScrollbarRect): Invalidate the whole scrollbar layer.
(WebKit::PDFPlugin::invalidateScrollCornerRect): Invalidate the whole scroll corner layer.

Rename BuiltInPDFView to SimplePDFPlugin, to differentiate it from PDFPlugin
and to better denote its inheritance from Plugin.

* WebProcess/Plugins/PDF/SimplePDFPlugin.h: Renamed from WebProcess/Plugins/PDF/BuiltInPDFView.h.
(WebKit::SimplePDFPlugin): Make methods protected so PDFPlugin can override them. Rename m_pluginSize -> m_size, and m_dataBuffer->m_data.
(WebKit::SimplePDFPlugin::size): Retrieve the size of the plugin.
(WebKit::SimplePDFPlugin::setSize): Set the size of the plugin.
(WebKit::SimplePDFPlugin::pdfDocument): Retrieve the currently represented PDF document.
(WebKit::SimplePDFPlugin::setPDFDocument): Set the currently represented PDF document.
(WebKit::SimplePDFPlugin::pdfDocumentSize): Retrieve the current size of the PDF.
(WebKit::SimplePDFPlugin::setPDFDocumentSize): Set the current size of the PDF.
(WebKit::SimplePDFPlugin::data): Retrieve the accumulated document data.
* WebProcess/Plugins/PDF/SimplePDFPlugin.mm: Renamed from WebProcess/Plugins/PDF/BuiltInPDFView.mm.
(WebKit::SimplePDFPlugin::computePageBoxes): Copied out of calculateSizes() so PDFPlugin can use it too.
(WebKit::SimplePDFPlugin::runScriptsInPDFDocument): Factored out of pdfDocumentDidLoad() so PDFPlugin can use it too.
(WebKit::SimplePDFPlugin::convertFromScrollbarToContainingView): Implement the remaining scrollbar point conversion functions.
(WebKit::SimplePDFPlugin::convertFromContainingViewToScrollbar): Implement the remaining scrollbar point conversion functions.

* WebProcess/Plugins/Plugin.h:
(Plugin): Add handleEditingCommand, isEditingCommandEnabled, and handlesPageScaleFactor.
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::handleEditingCommand): Proxy handleEditingCommand to the PluginProcess.
(WebKit::PluginProxy::isEditingCommandEnabled): Proxy isEditingCommandEnabled
to the PluginProcess.
(WebKit::PluginProxy::handlesPageScaleFactor): Proxy handlesPageScaleFactor
to the PluginProcess.
* WebProcess/Plugins/PluginProxy.h: Add handleEditingCommand, isEditingCommandEnabled,
and handlesPageScaleFactor.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::setPageScaleFactor): Set the plugin's current page scale factor. Also,
update WebPageProxy's notion of the current pageScaleFactor when this is called.
(WebKit::PluginView::pageScaleFactor): Return the plugin's current page scale factor.
(WebKit::PluginView::handleEditingCommand): Proxy handleEditingCommand to the plugin.
(WebKit::PluginView::isEditingCommandEnabled): Proxy isEditingCommandEnabled to the plugin.
* WebProcess/Plugins/PluginView.h:
(PluginView): Add handleEditingCommand, isEditingCommandEnabled,
setPageScaleFactor/pageScaleFactor, and handlesPageScaleFactor. Add m_pageScaleFactor.
(WebKit::PluginView::handlesPageScaleFactor): Proxy handlesPageScaleFactor to the plugin.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::restoreViewState): Don't update WebPageProxy's notion of the scale factor if it should be the default.
(WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): Make use of shouldUseCustomRepresentationForResponse on WebPage instead of WebProcess.
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Make use of shouldUseCustomRepresentationForResponse on WebPage instead of WebProcess.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin): Create a PDFPlugin if appropriate (if it is built and the setting is enabled).
(WebKit::pluginViewForFrame): Return the PluginView for the given frame if its document is a PluginDocument.
(WebKit::WebPage::executeEditingCommand): Attempt to execute editing commands on the
currently focused (or main-frame) plugin.
(WebKit::WebPage::isEditingCommandEnabled): Validate editing commands against the
currently focused (or main-frame) plugin.
(WebKit::WebPage::scalePage): If the plugin reports that it handles page scale factor
itself, hand it the new scale instead of WebCore.
(WebKit::WebPage::pageScaleFactor): If the plugin reports that it handles page scale
factor itself, return its notion of the current scale instead of WebCore's.
(WebKit::WebPage::validateCommand): Validate editing commands against the
currently focused (or main-frame) plugin.
(WebKit::WebPage::updatePreferences): Update m_pdfPluginEnabled given the relevant WebPreference.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::pdfPluginEnabled): Return whether or not PDFPlugin should be used.
(WebKit::WebPage::setPDFPluginEnabled): Set whether or not PDFPlugin should be used.

* WebCore.exp.in:
Export a few more methods to WebKit(2).

* WebCore.xcodeproj/project.pbxproj:
Expose Pasteboard.h as a private header so PDFPlugin can use it.

* platform/ScrollableArea.h:
Make invalidateScrollbar/invalidateScrollCorner virtual.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] Implement PDFPlugin
https://bugs.webkit.org/show_bug.cgi?id=99206

Unreviewed, attempt to manipuate SVN to retain the history of SimplePDFPlugin.

* WebProcess/Plugins/PDF/SimplePDFPlugin.h: Replaced with Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h.
* WebProcess/Plugins/PDF/SimplePDFPlugin.mm: Replaced with Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] Implement PDFPlugin
https://bugs.webkit.org/show_bug.cgi?id=99206

Unreviewed build fix, hand ivar name to @synthesize since it doesn't match the property name.

* WebProcess/Plugins/PDF/PDFPlugin.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131273 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] Implement PDFPlugin
https://bugs.webkit.org/show_bug.cgi?id=99206

Unreviewed build fix, export __ZN7WebCore8IntPointC1ERK7CGPoint.

* WebCore.exp.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make UserScript and UserStyleSheet value objects that are copyable
https://bugs.webkit.org/show_bug.cgi?id=99275

Reviewed by Tim Horton.

Source/WebCore:

Simplify UserScript and UserStyleSheet and make them more easily usable
without sticking them in an OwnPtr.

* WebCore.exp.in:
Update exports.

* page/PageGroup.cpp:
(WebCore::PageGroup::addUserScriptToWorld):
(WebCore::PageGroup::addUserStyleSheetToWorld):
* page/PageGroup.h:
(PageGroup):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::matchesPatterns):
* page/UserContentURLPattern.h:
(UserContentURLPattern):
Update to not assume whitelist and blacklist are in Vector<String>*.

* page/UserScript.h:
(UserScript):
(WebCore::UserScript::UserScript):
(WebCore::UserScript::whitelist):
(WebCore::UserScript::blacklist):
* page/UserStyleSheet.h:
(UserStyleSheet):
(WebCore::UserStyleSheet::UserStyleSheet):
(WebCore::UserStyleSheet::whitelist):
(WebCore::UserStyleSheet::blacklist):
Switch OwnPtr<Vector<String> > to Vector<String> and remove Noncopyable restriction.

Source/WebKit/chromium:

* src/WebViewImpl.cpp:
(WebKit::WebView::addUserScript):
(WebKit::WebView::addUserStyleSheet):
Update for new PageGroup function signatures.

Source/WebKit/efl:

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::addUserScript):
(DumpRenderTreeSupportEfl::addUserStyleSheet):
Update for new PageGroup function signatures.

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _injectMailQuirksScript]):
(-[WebView _injectOutlookQuirksScript]):
Update for new PageGroup function signatures.

Source/WebKit2:

* Shared/UserContentContainer.cpp:
(WebKit::toStringVector):
(WebKit::UserContentContainer::Item::Item):
(WebKit::UserContentContainer::Item::encode):
(WebKit::UserContentContainer::Item::decode):
* Shared/UserContentContainer.h:
(WebKit::UserContentContainer::Item::whitelist):
(WebKit::UserContentContainer::Item::blacklist):
Switch UserContentContainer::Item to store Vector<String> instead of ImmutableArray, easing
transition to new PageGroup function signatures.

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::toStringVector):
* WebProcess/WebPage/qt/WebPageQt.cpp:
(WebKit::WebPage::setUserScripts):
Update for new PageGroup function signatures.

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