[iOS] Fix incorrect interface orientation that can be caused by fullscreen video dismissal.
https://bugs.webkit.org/show_bug.cgi?id=137930.

Patch by Reza Abbasian <rabbasian@apple.com> on 2014-11-04
Reviewed by Jer Noble.

When a fullscreen video gets dismissed programmatically, for instance for removing
a webview from the view hierarchy, it can put the device in an incorrect orientation.
Make sure we retain the window of parentView when we attempt to go to fullscreen and use
the retained window for putting the device in correct orientation after dismissal.

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setupFullscreen):
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
(WebVideoFullscreenInterfaceAVKit::invalidate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable flakey dfg-int8array.js and dfg-int16array.js tests for ARM64
https://bugs.webkit.org/show_bug.cgi?id=138379

Reviewed by Mark Lam.

Disabled these test for ARM64.  Will address the failures and then re-enable.

* js/script-tests/dfg-int16array.js:
* js/script-tests/dfg-int8array.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable flakey float32-repeat-out-of-bounds.js and int8-repeat-out-of-bounds.js tests for ARM64
https://bugs.webkit.org/show_bug.cgi?id=138381

Reviewed by Mark Lam.

Disabled these test for ARM64.  Will address the failures and then re-enable.

* tests/stress/float32-repeat-out-of-bounds.js:
* tests/stress/int8-repeat-out-of-bounds.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Pause on exceptions should show the actual exception
https://bugs.webkit.org/show_bug.cgi?id=63096

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* debugger/Debugger.h:
Expose accessor for the pause reason to subclasses.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::type):
New "error" subtype for error objects.

* inspector/InjectedScriptSource.js:
When an object is an error object, use toString to provide a richer description.

* inspector/protocol/Runtime.json:
Expose a new "error" subtype for Error types (TypeError, ReferenceError, EvalError, etc).

* inspector/protocol/Debugger.json:
Provide type checked objects for different Debugger.pause pause reasons.
An exception provides the thrown object, but assert / CSP pauses provide
a richer typed object as the auxiliary data.

* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::dispatchDidPause):
When paused because of an exception, pass the exception on.

* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::handleConsoleAssert):
(Inspector::InspectorDebuggerAgent::scriptExecutionBlockedByCSP):
Provide richer data in pause events.

* inspector/scripts/codegen/generate_backend_commands.py:
(BackendCommandsGenerator.generate_domain.is_anonymous_enum_param):
(BackendCommandsGenerator.generate_domain):
* inspector/scripts/tests/expected/enum-values.json-result:
Generate frontend enums for anonymous enum event parameters.

Source/WebCore:

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
Pass assertion message on.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New strings / files.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.get pauseReason):
(WebInspector.DebuggerManager.prototype.get pauseData):
(WebInspector.DebuggerManager.prototype.reset):
(WebInspector.DebuggerManager.prototype.debuggerDidPause):
(WebInspector.DebuggerManager.prototype._pauseReasonFromPayload):
Maintain the current pause reason and auxiliary data in the manager.

* UserInterface/Protocol/DebuggerObserver.js:
(WebInspector.DebuggerObserver.prototype.paused):
Pass previously unused event parameters on to the manager.

* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl):
Style error objects in the console like Objects. The new description
string provides a richer message if you console.log(exception).

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause):
(WebInspector.DebuggerSidebarPanel.prototype._debuggerDidResume):
(WebInspector.DebuggerSidebarPanel.prototype._updatePauseReason):
Update the UI when we pause / resume to show / hide a pause reason section.

* UserInterface/Views/DetailsSectionRow.js:
(WebInspector.DetailsSectionRow.prototype.set emptyMessage):
Fix a latent bug that would have thrown an exception if the setter was ever used.

* UserInterface/Views/DetailsSectionTextRow.js: Added.
(WebInspector.DetailsSectionTextRow):
(WebInspector.DetailsSectionTextRow.prototype.get text):
(WebInspector.DetailsSectionTextRow.prototype.set text):
* UserInterface/Views/DetailsSection.css:
(.details-section > .content > .group > .row.simple.data > .value):
(.details-section > .content > .group > .row.text):
Simple class for a section of centered text. This is modelled after
the empty message text style in other sections.

* UserInterface/Views/LogContentView.css:
(.console-formatted-object, .console-formatted-node, .console-formatted-error):
(.console-formatted-object .section, .console-formatted-node .section, .console-formatted-error .section):
(.console-formatted-object .properties, .console-formatted-node .properties, .console-formatted-error .properties):
Style "error" objects like regular objects. We may wish to treat differently later.

* UserInterface/Protocol/Legacy/6.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
Regenerate legacy backend commands to get the new enum.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use a web view for Quick Look in action menus
https://bugs.webkit.org/show_bug.cgi?id=138370

Patch by Conrad Shultz <conrad_shultz@apple.com> on 2014-11-04
Reviewed by Anders Carlsson.

Instead of using the QLPreviewBubble SPI, show a popover containing a web view. This currently
does not inherit any configuration from the presenting WKView and does not expose any
customization options.

* UIProcess/mac/WKActionMenuController.mm:
Declare new internal NSViewController subclass, WKPagePreviewViewController.
(-[WKPagePreviewViewController initWithPageURL:]):
Store the passed-in URL and set a somewhat arbitrary (iPhone 5 screen size) default preferred size.
(-[WKPagePreviewViewController loadView]):
Create a WKWebView and load the URL passed into the initializer.
(-[WKActionMenuController _previewURLFromActionMenu:]):
Renamed from -_quickLookURLFromActionMenu:; present the popover returned by -_createPreviewPopoverForURL:.
(-[WKActionMenuController _createPreviewPopoverForURL:]):
New helper method; return a popover that owns a _WKPagePreviewViewController configured to show a scaled-down web page.
(-[WKActionMenuController _createActionMenuItemForTag:]):
Update to reflect method rename.
(-[WKActionMenuController _quickLookURLFromActionMenu:]): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable failing v8-deltablue.js for ARM
https://bugs.webkit.org/show_bug.cgi?id=138382

Reviewed by Geoffrey Garen.

This test is failing on ARM 32 bit.

* tests/v8-v6/v8-deltablue.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix the 32-bit build.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItemsForLink]):
(-[WKActionMenuController _createActionMenuItemForTag:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename checkMarkByte() to jumpIfIsRememberedOrInEden().
<https://webkit.org/b/138369>

Reviewed by Geoffrey Garen.

Write barriers are needed for GC Eden collections so that we can scan pointers
pointing from old generation objects to eden generation objects.  The barrier
currently checks the mark byte in a cell to see if we should skip adding the
cell to the GC remembered set.  The addition should be skipped if:

1. The cell is in the young generation.  It has no old to eden pointers by
   definition.
2. The cell is already in the remembered set.  While it is ok to add the cell
   to the GC remembered set more than once, it would be redundant.  Hence,
   we skip this as an optimization to avoid doing unnecessary work.

The barrier currently names this check as checkMarkByte().  We should rename it
to jumpIfIsRememberedOrInEden() to be clearer about its intent.

Similarly, Jump results of this check are currently named
ownerNotMarkedOrAlreadyRemembered.  This can be misinterpreted as the owner is
not marked or not already remembered.  We should rename it to
ownerIsRememberedOrInEden which is clearer about the intent of the
check.  What we are really checking for is that the cell is in the eden gen,
which is implied by it being "not marked".

* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::osrWriteBarrier):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::writeBarrier):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::writeBarrier):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::writeBarrier):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::jumpIfIsRememberedOrInEden):
(JSC::AssemblyHelpers::checkMarkByte): Deleted.
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitWriteBarrier):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSCell.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Add long press support for links in WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=138357

Reviewed by Dan Bernstein.

Use WKActionSheetAssistant to show a link action sheet in response to long-pressing on a link. Have WKPDFView
conform to WKActionSheetAssistantDelegate in order to respond to the open and copy actions as well as to
provide the link's URL and position information to WKActionSheetAssistant. The long-pressed link is highlighted
for .75 seconds before the sheet is displayed in order to match UIWebPDFView.

* UIProcess/ios/WKActionSheetAssistant.h: Made protocol methods that WKPDFView doesn't implement optional.
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant updatePositionInformation]): Checked if delegate responds to
updatePositionInformationForActionSheetAssistant: before calling.
(-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Checked if delegate responds to
actionSheetAssistant:willStartInteractionWithElement: before calling.
(-[WKActionSheetAssistant cleanupSheet]): Checked if delegate responds to actionSheetAssistantDidStopInteraction:
before calling.
* UIProcess/ios/WKPDFView.h: Conformed to WKActionSheetAssistantDelegate.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_initWithFrame:webView:]): Instantiated a WKActionSheetAssistant and set self as its delegate.
(-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]): Moved highlight drawing to here from
annotation:wasTouchedAtPoint:controller: in order to be reused for long-press.
(-[WKPDFView _URLForLinkAnnotation:]): Moved URL creation to here from annotation:wasTouchedAtPoint:controller:
in order to be reused for long-press. Generated an absolute URL since this URL might go into the pasteboard.
(-[WKPDFView annotation:wasTouchedAtPoint:controller:]): Changed to call
_highlightLinkAnnotation:forDuration:completionHandler: and _URLForLinkAnnotation:.
(-[WKPDFView annotation:isBeingPressedAtPoint:controller:]): Set values on _positionInformation and called
-[WKActionSheetAssistant showLinkSheet] after showing a highlight for .75 seconds.
(-[WKPDFView positionInformation]): Returned _positionInformation.
(-[WKPDFView performAction:]): Added a UTF-8 text and URL representation of the pressed URL to the pasteboard.
(-[WKPDFView openElementAtLocation:]): Called WebPage::navigateToURLWithSimulatedClick().
(-[WKPDFView actionsForElement:defaultActions:]): Returned actions from UIClient::actionsForElement().
(-[WKPDFView _createHighlightViewWithFrame:]): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175595 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add button and enable optimized fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=138351

Reviewed by Eric Carlson.

Added optimizedFullscreenButton to js media element controls. Remove #if conditional
and use optimizedFullscreenSupported to enable feature at runtime

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::enterFullscreenOptimized): enable
(WebCore::MediaControlsHost::optimizedFullscreenSupported): added
* Modules/mediacontrols/MediaControlsHost.h: add optimizedFullscreenSupported
* Modules/mediacontrols/MediaControlsHost.idl: ditto
* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-optimized-fullscreen-button): added
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.createControls): add button
(Controller.prototype.handleReadyStateChange): update button
(Controller.prototype.updateOptimizedFullscreenButton): added
* Modules/mediacontrols/mediaControlsiOS.css:
(audio::-webkit-media-controls-optimized-fullscreen-button): added
(video::-webkit-media-controls-optimized-fullscreen-button): added
(video::-webkit-media-controls-optimized-fullscreen-button:active): added
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.createControls): listen for events from optimizedFullscreenButton
(ControllerIOS.prototype.configureInlineControls): add button for non-audio when supported.
(ControllerIOS.prototype.handleBaseGestureChange): 2-finger double-tap gesture for optimized fullscreen
(ControllerIOS.prototype.handleWrapperTouchStart): ditto
(ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked): added
(ControllerIOS.prototype.handleOptimizedFullscreenTouchStart): added
(ControllerIOS.prototype.handleOptimizedFullscreenTouchEnd): added
(ControllerIOS.prototype.handleOptimizedFullscreenTouchCancel): added
(ControllerIOS.prototype.handleStartPlaybackButtonTouchStart): fix typo
(ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd): fix typo
(ControllerIOS.prototype.handleStartPlaybackButtonTouchCancel): fix typo
* WebCore.exp.in:
* platform/ios/WebCoreSystemInterfaceIOS.h: added wkIsOptimizedFullscreenSupported
* platform/ios/WebCoreSystemInterfaceIOS.mm: added wkIsOptimizedFullscreenSupported
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::enterFullscreen): enable feature
(WebVideoFullscreenInterfaceAVKit::exitFullscreen): enable feature
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): only request exit when entered and not requested exit
(WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): ditto
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): added
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): add IsOptimizedFullscreenSupported

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add bundle SPI allowing PageOverlay to customize the action menu
https://bugs.webkit.org/show_bug.cgi?id=138388
<rdar://problem/18875579>

Reviewed by Anders Carlsson.

* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
Bump the BundlePageOverlay client version.

(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Don't return if we have a version; the version check happens later anyway,
and now it is valid to have a version >0.

* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
Bump the BundlePageOverlay client version.
Add prepareForActionMenu callback.

* WebProcess/WebPage/WebPageOverlay.h:
(WebKit::WebPageOverlay::Client::prepareForActionMenu):
* WebProcess/WebPage/WebPageOverlay.cpp:
(WebKit::overlayMap):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::fromCoreOverlay):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
Keep track of a map of PageOverlay to WebPageOverlay.

(WebKit::WebPageOverlay::prepareForActionMenu):
Forward prepareForActionMenu to the client.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
Iterate through the overlays and let them prepareForActionMenu;
the first overlay that returns true wins. If no overlays want to
do anything, hand preparation along to the context menu client.

* page/PageOverlayController.h:
Expose the list of all overlays.


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