Replace INT_MIN/MAX / kFixedPointDenominator with intMin/MaxForLayoutUnit.
https://bugs.webkit.org/show_bug.cgi?id=138047

Reviewed by Andreas Kling.

No change in functionality.

* css/CSSPrimitiveValue.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac][WebKit2] Move action menu code into its own file
https://bugs.webkit.org/show_bug.cgi?id=138034
<rdar://problem/18758758>

Reviewed by Dan Bernstein.

* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:context:configuration:webView:]):
Make a WKActionMenuController if needed.

(-[WKView prepareForMenu:withEvent:]):
(-[WKView willOpenMenu:withEvent:]):
(-[WKView didCloseMenu:withEvent:]):
(-[WKView _didPerformActionMenuHitTest:]):
Forward these to WKActionMenuController.

(-[WKView _openURLFromActionMenu:]): Deleted.
(-[WKView _addToReadingListFromActionMenu:]): Deleted.
(-[WKView _quickLookURLFromActionMenu:]): Deleted.
(-[WKView _createActionMenuItemForTag:]): Deleted.
(webKitBundleImageNamed): Deleted.
(-[WKView _copyImage:]): Deleted.
(-[WKView _saveImageToDownloads:]): Deleted.
(temporaryPhotosDirectoryPath): Deleted.
(pathToPhotoOnDisk): Deleted.
(-[WKView _addImageToPhotos:]): Deleted.
(-[WKView _defaultMenuItemsForImage]): Deleted.
(-[WKView _defaultMenuItems]): Deleted.
(-[WKView _updateActionMenu]): Deleted.
Moved to WKActionMenuController.

* UIProcess/mac/WKActionMenuController.h: Added.
* UIProcess/mac/WKActionMenuController.mm: Added.
(-[WKActionMenuController initWithPage:view:]):
(-[WKActionMenuController prepareForMenu:withEvent:]):
(-[WKActionMenuController willOpenMenu:withEvent:]):
(-[WKActionMenuController didCloseMenu:withEvent:]):
(-[WKActionMenuController didPerformActionMenuHitTest:]):
(-[WKActionMenuController _defaultMenuItemsForLink]):
(-[WKActionMenuController _openURLFromActionMenu:]):
(-[WKActionMenuController _addToReadingListFromActionMenu:]):
(-[WKActionMenuController _quickLookURLFromActionMenu:]):
(-[WKActionMenuController _defaultMenuItemsForImage]):
(-[WKActionMenuController _copyImage:]):
(-[WKActionMenuController _saveImageToDownloads:]):
(temporaryPhotosDirectoryPath):
(pathToPhotoOnDisk):
(-[WKActionMenuController _addImageToPhotos:]):
(-[WKActionMenuController _createActionMenuItemForTag:]):
(webKitBundleImageNamed):
(imageForResource:name::if):
(-[WKActionMenuController _updateActionMenuItems]):
Moved from WKView.

* WebKit2.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac][WebKit2] Move action menu code into its own file
https://bugs.webkit.org/show_bug.cgi?id=138034
<rdar://problem/18758758>

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController prepareForMenu:withEvent:]):
(-[WKActionMenuController _addImageToPhotos:]):
Review comments that were not previously addressed.


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

* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Blindly try to fix all the builds.

* UIProcess/mac/WKActionMenuController.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit1 should support action menus
https://bugs.webkit.org/show_bug.cgi?id=138032

Reviewed by Tim Horton.

This patch adds basic support for action menus and adds actions for links.

Helper class takes care of all of the action menu work. WebView will forward the 
prepareForMenu: message, and then the helper class takes it from there.
* WebView/WebActionMenuController.h: Added.
* WebView/WebActionMenuController.mm: Added.
(-[WebActionMenuController webViewClosed]):
(-[WebActionMenuController prepareForMenu:withEvent:]):

Selectors for link actions.
(-[WebActionMenuController _openURLFromActionMenu:]):
(-[WebActionMenuController _addToReadingListFromActionMenu:]):
(-[WebActionMenuController _elementBoundingBoxFromDOMElement:]):
(-[WebActionMenuController _quickLookURLFromActionMenu:]):
(-[WebActionMenuController _createActionMenuItemForTag:withHitTestResult:]):
(webKitBundleImageNamed):
(-[WebActionMenuController _defaultMenuItemsForLink:]):
(-[WebActionMenuController _defaultMenuItemsForHitTestResult:]):

Tags for the action menu items.
* WebView/WebUIDelegatePrivate.h:
* WebView/WebView.mm:

Set the action menu if possible and create the controller.
(-[WebView _initWithFrame:frameName:groupName:]):
(-[WebView _close]):
(-[WebView prepareForMenu:withEvent:]):

WebViewData stores the WebActionMenuHelper
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
(-[WebViewPrivate dealloc]):



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

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _openURLFromActionMenu:]):
(-[WebActionMenuController _addToReadingListFromActionMenu:]):
(-[WebActionMenuController _quickLookURLFromActionMenu:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Blindly try to fix all the builds.

* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:


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

* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Use modern loops in ResourceRequestCocoa.mm
https://bugs.webkit.org/show_bug.cgi?id=138052

Reviewed by Darin Adler.

Use modern loops in ResourceRequestCocoa.mm and leverage Objective-C's
fast enumeration.

No new tests, no behavior change.

* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest):
- Use NSDictionary's block-based enumeration as we enumerate both keys
  and values and this is faster than using fast enumeration of the keys
  then calling [NSDictionary objectForKey:]
- Use Objective C's fast enumeration for
  contentDispositionEncodingFallbackArray as this is faster and shorter
  than index based access. Also use reserveCapacity() /
  uncheckedAppend() for m_responseContentDispositionEncodingFallbackArray
  as we know how many elements were are going to append in the common
  case.

(WebCore::ResourceRequest::doUpdatePlatformRequest):
- Use fast enumeration for [nsRequest allHTTPHeaderFields] dictionary
  keys instead of calling [NSDictionary allKeys] and then doing
  index-based iteration, to avoid copying the keys to a new array.
  Also do a forward enumeration instead of a reverse one. I don't see
  why a backward enumeration would be necessary here. We are not
  modifying the NSDictionary we are iterating over as
  [nsRequest allHTTPHeaderFields] makes a copy.
- Use a modern C++ loop for
  m_responseContentDispositionEncodingFallbackArray.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Very large images crash in action menu code
https://bugs.webkit.org/show_bug.cgi?id=138059
-and corresponding-
rdar://problem/18767859

Reviewed by Tim Horton.

If the HitTestResult failed to create and image, then don’t go for the image 
action menu.
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItems]):

ShareableBitmap::createShareable() can fail. The result needs to be null-checked.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performActionMenuHitTestAtLocation):



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