Begin work on decoding invocations
https://bugs.webkit.org/show_bug.cgi?id=123838

Reviewed by Dan Bernstein.

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(encodeInvocation):
Declare the type string and selector keys as constants.

(encodeObject):
Make sure to encode the class name for NSInvocations as well.

(decodeInvocation):
Figure out the local and remove method signatures and make sure that they are equal.

* Shared/API/Cocoa/WKRemoteObjectInterface.mm:
(methodArgumentTypeEncodingForSelector):
Helper function that returns the type encoding for a given selector.

(-[WKRemoteObjectInterface _methodSignatureForSelector:]):
Helper function that returns a method signature for the method with the name referred to by selector.

* Shared/API/Cocoa/WKRemoteObjectInterfaceInternal.h: Added.
Add internal header.

* Shared/API/Cocoa/WKRemoteObjectRegistry.mm:
(-[WKRemoteObjectRegistry _invokeMessageWithInterfaceIdentifier:encodedInvocation:]):
Pass the right object to the WKRemoteObjectDecoder initializer and decode the invocation.

* WebKit2.xcodeproj/project.pbxproj:
Add internal header.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[mac] PDFDocumentImage is too big if PDF has a crop box smaller than the media box
https://bugs.webkit.org/show_bug.cgi?id=123840
<rdar://problem/15308765>

Reviewed by Alexey Proskuryakov.

Test: fast/images/pdf-as-image-crop-box.html

* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::size):
Use the crop box when determining the size of the image.

(WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
* platform/graphics/cg/PDFDocumentImage.h:
* platform/graphics/mac/PDFDocumentImageMac.mm:
(WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
Get rid of m_mediaBox, since we don't need it anymore.

(WebCore::PDFDocumentImage::drawPDFPage):
PDFKit does the translation by the crop box origin for us;
if we do it additionally, we'll be painting the wrong part of the image.
So, don't do the translation here.

* fast/images/pdf-as-image-crop-box-expected.html: Added.
* fast/images/pdf-as-image-crop-box.html: Added.
* fast/images/resources/green-1x1.pdf: Added.
* fast/images/resources/red-green-2x2-cropped-to-1x1.pdf: Added.
Add a test that ensures that PDFDocumentImage respects the PDF's crop box.
red-green-2x2-cropped-to-1x1 has a 2"x2" red square with a 1"x1" green
square centered in it, a media box of 2"x2", and a crop box of 1"x1"
offset by 0.5", 0.5". green-1x1 has a 1"x1" green square. The two images
should render the same if the crop box is being respected correctly.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subresource loads should not prevent page throttling
https://bugs.webkit.org/show_bug.cgi?id=123757

Reviewed by Alexey Proskuryakov.

The page-is-loading test for inhibiting process supression is currently
too conservative, preventing supression of pages with infinitely loading
resources (commonly XHRs). Instead, just rely on the FrameLoader being
active (with hysteresis).

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::init):
(WebCore::SubresourceLoader::checkForHTTPStatusCodeError):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::willCancel):
* loader/SubresourceLoader.h:
    - remove m_activityAssertion from SubresourceLoader.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
text-decoration-skip: ink isn't tested with underlines that don't intersect the underlined text
https://bugs.webkit.org/show_bug.cgi?id=123839

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-11-05
Reviewed by Simon Fraser.

text-decoration-skip: ink uses a mask to determine where the underline can be drawn. Right now,
there is not a test that makes sure that the mask always gets applied to the location
where the underline will get drawn.

* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-non-intersecting-underline-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-non-intersecting-underline.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
platformCALayerDeviceScaleFactor should be const
https://bugs.webkit.org/show_bug.cgi?id=123842

Reviewed by Simon Fraser.

* WebCore.exp.in:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::LayerClient::platformCALayerDeviceScaleFactor):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerDeviceScaleFactor):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayerClient.h:
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::platformCALayerDeviceScaleFactor):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerDeviceScaleFactor):
Constify PlatformCALayerClient::platformCALayerDeviceScaleFactor.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix on CMake based ports with GLES.

* CMakeLists.txt:
Added OPENGLES2_LIBRARIES and OPENGLES2_INCLUDE_DIR into the includes and
libraries list.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should support String character access operations
https://bugs.webkit.org/show_bug.cgi?id=123783

Reviewed by Oliver Hunt.
        
Implements:
        
- string.length
        
- string[index]

* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileGetIndexedPropertyStorage):
(JSC::FTL::LowerDFGToLLVM::compileGetArrayLength):
(JSC::FTL::LowerDFGToLLVM::compileGetByVal):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove old unused code for hypothetical LLVM intrinsics
https://bugs.webkit.org/show_bug.cgi?id=123824

Reviewed by Oliver Hunt.

* ftl/FTLIntrinsicRepository.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Moving an element while in the DOMNodeRemoved handler will hide it in the inspector
https://bugs.webkit.org/show_bug.cgi?id=123516

Reviewed by Timothy Hatcher.

Source/WebCore:

InspectorInstrumentation::willRemoveDOMNode was actually calling both willRemoveDOMNodeImpl and
didRemoveDOMNodeImpl, making the DOMAgent unbind the element even if it was still part of the DOM.

Because of that the DOMAgent was sending two events:
1. When the element was about to be removed, just before JS "DOMNodeRemoved" was triggered.
2. When the element was actually removed.

Note that inspector's event #2 will not know about the node, as it just removed it from the
internal hashmap, so it will just use a nodeID == 0 for it.

This patch adds a separate call to InspectorInstrumentation::didRemoveDOMNode, just before the
element is about to be removed. The InspectorInstrumentation::willRemoveDOMNode call is now only used
by the DOMDebugger to trigger the DOM breakpoints in the Web Inspector. That feature is not exposed
in the new Inspector UI, but can be used/tested using the protocol directly.

Tests: inspector-protocol/dom-debugger/node-removed.html
       inspector-protocol/dom/dom-remove-events.html
       inspector-protocol/dom/remove-multiple-nodes.html

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeBetween):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willRemoveDOMNode):
(WebCore::InspectorInstrumentation::didRemoveDOMNode):

LayoutTests:

Added tests to check that the DOM.childNodeRemoved inspector-protocol message is dispatched
correctly when DOM nodes are moved while inside the "DOMNodeRemoved" event handler.

* inspector-protocol/dom-debugger/node-removed-expected.txt: Added.
* inspector-protocol/dom-debugger/node-removed.html: Added. Checking that the DOMDebugger agent
is still sending the node-removed events.
* inspector-protocol/dom/dom-remove-events-expected.txt: Added.
* inspector-protocol/dom/dom-remove-events.html: Added. Test with a single DOM remove event.
* inspector-protocol/dom/remove-multiple-nodes-expected.txt: Added.
* inspector-protocol/dom/remove-multiple-nodes.html: Added. Test case when multiple children
are removed at once with parentNode.textContent = "String".


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