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
Fix the 32-bit build.

* WebCore.exp.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a test to obtain offsetWidth of expanded table cell
https://bugs.webkit.org/show_bug.cgi?id=123843

Reviewed by Tim Horton.

Merge the test from https://chromium.googlesource.com/chromium/blink/+/58a5fac292a5b3f79b00cdc71074fbf8be2ebc2b
so that we'll never introduce the regression they had.

* fast/table/table-cell-offset-width-expected.txt: Added.
* fast/table/table-cell-offset-width.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a test to obtain offsetWidth of expanded table cell
https://bugs.webkit.org/show_bug.cgi?id=123843

Reviewed by Tim Horton.

Merge the test fix in https://chromium.googlesource.com/chromium/blink/+/b249d552497c0939d8277360b99dd3c56b0c9659.

* fast/table/table-cell-offset-width-expected.txt:
* fast/table/table-cell-offset-width.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158711 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move some plugin-specific code from RenderWidget to RenderEmbeddedObject.
<https://webkit.org/b/123845>

All RenderWidgets representing plugins will be RenderEmbeddedObjects.
Move some of the plugin-specific logic to RenderEmbeddedObject since it
doesn't make sense for all RenderWidgets (frames, embedded documents)
to care about this.

Reviewed by Anders Carlsson.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: media controls accessibility needs more work
https://bugs.webkit.org/show_bug.cgi?id=123749

Patch by James Craig <jcraig@apple.com> on 2013-11-05
Reviewed by Jer Noble.

Updated some of the control labels/roles to improve accessibility.
  - Volume slider is now keyboard/screenreader accessible.
  - muteButton was a checkbox toggling checked state, now a button that toggles label "mute/unmute"
  - fullscreenButton was a checkbox toggling checked state, now a button that toggles label "display/exit full screen"
  - captionButton was a checkbox, now a popup button that launches the newly accessible menu.
Subtitles menu is now keyboard/screenreader accessible (uses roaming tabindex).
Render dump expectations changed because volume slider is now hidden via...
...opacity/size (to make accessible without hover) instead of display:none.

Updated existing test coverage.

Source/WebCore:

* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-panel .volume-box):
(audio::-webkit-media-controls-panel .volume-box:active):
(audio::-webkit-media-controls-toggle-closed-captions-button):
(audio::-webkit-media-controls-closed-captions-container .list):
(audio::-webkit-media-controls-closed-captions-container li:focus):
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.createControls):
(Controller.prototype.handleFullscreenChange):
(Controller.prototype.handleMuteButtonClicked):
(Controller.prototype.handleMinButtonClicked):
(Controller.prototype.handleMaxButtonClicked):
(Controller.prototype.handleVolumeSliderChange):
(Controller.prototype.buildCaptionMenu):
(Controller.prototype.focusSiblingCaptionItem):
(Controller.prototype.handleCaptionItemKeyUp):

LayoutTests:

* platform/mac/accessibility/media-element-expected.txt:
* platform/mac/media/audio-controls-rendering-expected.txt:
* platform/mac/media/controls-after-reload-expected.txt:
* platform/mac/media/controls-strict-expected.txt:
* platform/mac/media/controls-styling-strict-expected.txt:
* platform/mac/media/controls-without-preload-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
getComputedStyle(x).lineHeight is affected by zooming
https://bugs.webkit.org/show_bug.cgi?id=123847

Reviewed by Benjamin Poulain.

Source/WebCore: 

Merge https://chromium.googlesource.com/chromium/blink/+/7957097afbab2899ababd0d9c8acbf6e3eddb870

Test: fast/css/line-height-zoom-get-computed-style.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::lineHeightFromStyle): Don't round line-height values.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyLineHeight::applyValue): Use the computed value instead of the used value.

LayoutTests: 

Cleaned up the test.

* fast/css/line-height-zoom-get-computed-style-expected.txt: Added.
* fast/css/line-height-zoom-get-computed-style.html: Added.
* platform/mac-mountainlion/fast/forms/textAreaLineHeight-expected.txt: Rebaselined.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Windows build fix attempt after r158704.

* FullscreenVideoController.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should support StringCharAt
https://bugs.webkit.org/show_bug.cgi?id=123855

Reviewed by Oliver Hunt.
        
This is just like GetByVal for String, so we reuse that code.

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileGetByVal):
(JSC::FTL::LowerDFGToLLVM::compileStringCharAt):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should support NewObject
https://bugs.webkit.org/show_bug.cgi?id=123849

Reviewed by Oliver Hunt.

* ftl/FTLAbstractHeapRepository.cpp:
(JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileNewObject):
(JSC::FTL::LowerDFGToLLVM::allocate):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Apply more unique_ptr to line box management.
<https://webkit.org/b/123857>

Make all of the functions that return newly-created line boxes
return them packed up in std::unique_ptrs.

There is one exception in RenderBlockLineLayout where the function
createInlineBoxForRenderer() is inconsistent about the ownership of
the returned object. This will be addressed by a subsequent patch.

We now "release" the line boxes into their various home structures,
so the pointer smartness doesn't go end-to-end just yet.

Reviewed by Anders Carlsson.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Protect DOM nodes in IndentOutdentCommand::tryIndentingAsListItem()
https://bugs.webkit.org/show_bug.cgi?id=123861

Reviewed by Benjamin Poulain.

Merge https://chromium.googlesource.com/chromium/blink/+/297442eb539a2b764fdad323de79099a70179186 partially.

* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::tryIndentingAsListItem): Make selectedListItem, previousList, and nextList
RefPtr since they're are used after calling insertNodeBefore.


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