WebKit/win/WebKitGraphics.h:void WebDrawText(WebTextRenderInfo*); is never called
https://bugs.webkit.org/show_bug.cgi?id=123485

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-10-30
Reviewed by Brent Fulgham.

Source/WebCore:

WebDrawText is the only caller of WebCoreDrawTextAtPoint, so we can
delete that as well.

Because there is no behavior difference, no new tests are necessary.

* platform/win/WebCoreTextRenderer.cpp:
* platform/win/WebCoreTextRenderer.h:

Source/WebKit:

Deleting the function

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

Source/WebKit/win:

Removed unused WebDrawText implementation.

* WebKitGraphics.cpp:
* WebKitGraphics.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Let Page::renderTreeSize() be the number of renderers.
<https://webkit.org/b/123518>
<rdar://problem/15348679>

The old metric was "number of bytes allocated in RenderArena" and
that was heading towards obsolescence, fast.

Instead, keep a count of RenderObjects instantiated on RenderView.
While a bit ugly, this lets us move forward with rendering memory
model improvements without breaking features.

Reviewed by Beth Dakin.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Update NEWS and Versions.m4 for 2.3.1 release.

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-10-29

* Source/autotools/Versions.m4: Bump version numbers.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a failing test expectation on media/media-can-play-mpeg4-video.html after r158288.
The failure is tracked by the bug 123530.

Also rebaseline Mountain Lion results.

* TestExpectations:
* platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix Mac.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::RegisterAllocationOffset::checkOffsets):
(JSC::AbstractMacroAssembler::checkRegisterAllocationAgainstBranchRange):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158313 268f45cc-cd09-0410-ab3c-d52691b4dbfc
contentEditable deleting lists when list items are block level
https://bugs.webkit.org/show_bug.cgi?id=122602

Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-10-30
Reviewed by Ryosuke Niwa.

Source/WebCore:

When listitems are styled with display:block/float then inserting paragraph
twice at end of listitem delete entire list. Generally when listitem is empty
then we delete the listitem on inserting paragraph. In this issue, on inserting
first paragraph one empty listitem is created, and on inserting second paragraph
we try to delete that empty listitem. but it misbehave becasue of incomplete
definition of htmlediting::isLisItem() and entire list is deleted.

htmlediting::isListItem() check only render object to decide whether it is
list or not, so if any LI element is block level then isListItem return false.
Now after this patch if parent of current node is list element then node is
treated as listItem.

Test: editing/execCommand/hit-enter-twice-atendof-block-styled-listitem.html

* editing/htmlediting.cpp:
(WebCore::isListItem): Modified condition to check if parent node is list;

LayoutTests:

Testcase: When listitem is styled with display:block then inserting
paragraph twice at the end of listitem should not remove entire list.

* editing/execCommand/hit-enter-twice-atendof-block-styled-listitem-expected.txt: Added.
* editing/execCommand/hit-enter-twice-atendof-block-styled-listitem.html: Added.

TestCase: When listitem is made of custom tag(<item>) and css(display:list-item)
then inserting paragraph twice at the end of listitem should not remove entire list.

* editing/execCommand/hit-enter-twice-atendof-custom-listitem-expected.txt: Added.
* editing/execCommand/hit-enter-twice-atendof-custom-listitem.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adjust CallFrameHeader's ReturnPC and CallFrame locations to match the native ABI .
https://bugs.webkit.org/show_bug.cgi?id=123444.

Reviewed by Geoffrey Garen.

- Introduced an explicit CallerFrameAndPC struct.
- A CallFrame is expected to start with a CallerFrameAndPC struct. 
- The Register class no longer supports CallFrame* and Instruction*.

  These hides the differences between JSVALUE32_64 and JSVALUE64 in
  terms of managing the callerFrame() and returnPC() values.

- Convert all uses of JSStack::CallerFrame and JSStack::ReturnPC to
  go through CallFrame to access the appropriate values and offsets.
  CallFrame, in turn, will access the callerFrame and returnPC via
  the CallerFrameAndPC struct.

- InlineCallFrame will provide offsets for its callerFrame and
  returnPC. It will make use of CallFrame::callerFrameOffset() and
  CallerFrame::returnPCOffset() to compute these.

* bytecode/CodeOrigin.h:
(JSC::InlineCallFrame::callerFrameOffset):
(JSC::InlineCallFrame::returnPCOffset):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileEntry):
(JSC::DFG::JITCompiler::compileExceptionHandlers):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::reifyInlinedCallFrames):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::calleeFrameSlot):
(JSC::DFG::SpeculativeJIT::calleeArgumentSlot):
(JSC::DFG::SpeculativeJIT::calleeFrameTagSlot):
(JSC::DFG::SpeculativeJIT::calleeFramePayloadSlot):
(JSC::DFG::SpeculativeJIT::calleeArgumentTagSlot):
(JSC::DFG::SpeculativeJIT::calleeArgumentPayloadSlot):
- Prefixed all the above with callee since they apply to the callee frame.
(JSC::DFG::SpeculativeJIT::calleeFrameCallerFrame):
- Added to set the callerFrame pointer in the callee frame.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLink.cpp:
(JSC::FTL::compileEntry):
(JSC::FTL::link):
* interpreter/CallFrame.h:
(JSC::ExecState::callerFrame):
(JSC::ExecState::callerFrameOffset):
(JSC::ExecState::returnPC):
(JSC::ExecState::hasReturnPC):
(JSC::ExecState::clearReturnPC):
(JSC::ExecState::returnPCOffset):
(JSC::ExecState::setCallerFrame):
(JSC::ExecState::setReturnPC):
(JSC::ExecState::callerFrameAndPC):
* interpreter/JSStack.h:
* interpreter/Register.h:
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitPutToCallFrameHeader):
- Convert to using storePtr() here and simplify the code.
(JSC::AssemblyHelpers::emitGetCallerFrameFromCallFrameHeaderPtr):
(JSC::AssemblyHelpers::emitPutCallerFrameToCallFrameHeader):
(JSC::AssemblyHelpers::emitGetReturnPCFromCallFrameHeaderPtr):
(JSC::AssemblyHelpers::emitPutReturnPCToCallFrameHeader):
- Helpers to emit gets/puts of the callerFrame and returnPC.
(JSC::AssemblyHelpers::addressForByteOffset):
* jit/JIT.cpp:
(JSC::JIT::JIT):
(JSC::JIT::privateCompile):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JITCall.cpp:
(JSC::JIT::compileCallEval):
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::emit_op_ret):
(JSC::JIT::emit_op_ret_object_or_this):
(JSC::JIT::compileCallEval):
(JSC::JIT::compileOpCall):
* jit/JITInlines.h:
(JSC::JIT::unmap):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_end):
(JSC::JIT::emit_op_ret):
(JSC::JIT::emit_op_ret_object_or_this):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::privateCompileCTINativeCall):
(JSC::JIT::emit_op_end):
* jit/JITOperations.cpp:
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::returnJSValue):
(JSC::SpecializedThunkJIT::returnDouble):
(JSC::SpecializedThunkJIT::returnInt32):
(JSC::SpecializedThunkJIT::returnJSCell):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::slowPathFor):
(JSC::nativeForGenerator):

* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:
- Updated offsets and asserts to match the new CallFrame layout.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Begin fleshing out an API test for WKRemoteObjectRegistry
https://bugs.webkit.org/show_bug.cgi?id=123531

Reviewed by Andreas Kling.

Source/WebKit2:

* Shared/API/Cocoa/WKRemoteObjectInterface.h:
Add WK_API_CLASS annotation.

* Shared/API/Cocoa/WKRemoteObjectRegistry.h:
Add WK_API_CLASS annotation.

* Shared/API/Cocoa/WKRemoteObjectRegistry.mm:
Add a WebConnection ivar.

(-[WKRemoteObjectRegistry _initWithConnectionRef:]):
Add SPI to create an WKRemoteObjectRegistry object with an existing WKConnectionRef.

(-[WKRemoteObjectRegistry _handleMessageWithName:body:]):
Add SPI that will be used to process incoming messages from an existing WKConnectionRef.

* Shared/API/Cocoa/WKRemoteObjectRegistryPrivate.h: Added.
Add SPI header.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.

Tools:

Add a very simple test that doesn't really test anything for now.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2ObjC/WKRemoteObjectRegistry.mm: Added.
* TestWebKitAPI/Tests/mac/WKRemoteObjectRegistry_Bundle.mm: Added.
* TestWebKitAPI/Tests/mac/WKRemoteObjectRegistry_Shared.h: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a way to fulfill promises from DOM code
https://bugs.webkit.org/show_bug.cgi?id=123466

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj: Make JSPromise.h and JSPromiseResolver.h
private headers for WebCore to use.

* runtime/JSPromise.h:
* runtime/JSPromiseResolver.h:
Export functions that JSDOMPromise will use.

Source/WebCore:

This is not perfect, as it strongly ties DOM code to JavaScript. In the future, we
can make it better e.g. by subclassing, so that only a base interface would be exposed.

* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* bindings/js/JSBindingsAllInOne.cpp:
* WebCore.xcodeproj/project.pbxproj:
Added JSDOMPromise.

* bindings/js/JSDOMPromise.cpp: Added.

* bindings/js/JSDOMPromise.h: Added.
(WebCore::PromiseWrapper::create):
(WebCore::PromiseWrapper::fulfill): A random set of specializations that I needed
in WebCrypto code so far.
(WebCore::PromiseWrapper::reject): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r158288): media/media-can-play-mpeg4-video.html fails
https://bugs.webkit.org/show_bug.cgi?id=123530

Reviewed by Eric Carlson.

Source/WebCore:

Lower case the mime type before passing it along to MediaPlayer.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType):
(WebCore::HTMLMediaElement::selectNextSourceChild):

LayoutTests:

* TestExpectations:

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

* TestWebKitAPI/Tests/WebKit2ObjC/WKRemoteObjectRegistry.mm:
* TestWebKitAPI/Tests/mac/WKRemoteObjectRegistry_Bundle.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Remove InspectorAgent::restore functionality
https://bugs.webkit.org/show_bug.cgi?id=123525

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-10-30
Reviewed by Timothy Hatcher.

Remove unused InspectorAgent restore functionality.

* inspector/InspectorApplicationCacheAgent.cpp:
* inspector/InspectorApplicationCacheAgent.h:
* inspector/InspectorBaseAgent.cpp:
* inspector/InspectorBaseAgent.h:
* inspector/InspectorCSSAgent.cpp:
* inspector/InspectorCSSAgent.h:
* inspector/InspectorCanvasAgent.cpp:
* inspector/InspectorCanvasAgent.h:
* inspector/InspectorConsoleAgent.cpp:
* inspector/InspectorConsoleAgent.h:
* inspector/InspectorController.cpp:
* inspector/InspectorController.h:
* inspector/InspectorDOMAgent.cpp:
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDatabaseAgent.cpp:
* inspector/InspectorDatabaseAgent.h:
* inspector/InspectorDebuggerAgent.cpp:
* inspector/InspectorDebuggerAgent.h:
* inspector/InspectorHeapProfilerAgent.cpp:
* inspector/InspectorHeapProfilerAgent.h:
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorIndexedDBAgent.h:
* inspector/InspectorLayerTreeAgent.cpp:
* inspector/InspectorLayerTreeAgent.h:
* inspector/InspectorPageAgent.cpp:
* inspector/InspectorPageAgent.h:
* inspector/InspectorProfilerAgent.cpp:
* inspector/InspectorProfilerAgent.h:
* inspector/InspectorResourceAgent.cpp:
* inspector/InspectorResourceAgent.h:
* inspector/InspectorTimelineAgent.cpp:
* inspector/InspectorTimelineAgent.h:
* inspector/InspectorWorkerAgent.cpp:
* inspector/InspectorWorkerAgent.h:
* inspector/PageRuntimeAgent.cpp:
* inspector/PageRuntimeAgent.h:
* inspector/WorkerInspectorController.cpp:
* inspector/WorkerInspectorController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158320 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Take line boxes out of the arena.
<https://webkit.org/b/123533>

Stop arena-allocating line boxes so we can move forward on improving
render tree memory management. This will also allow more rendering
code to take advantage of malloc optimizations.

This will likely regress performance on some micro-benchmarks, but
it's something we want to do sooner rather than later so we have time
to restabilize it. All improvements to the simple line layout's
coverage will help with recouping whatever is regressed.

BiDi runs are the only remaining user of the arena now.

Reviewed by Antti Koivisto


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