Change how the form element pointer affects parsing template elements, to reduce weirdness in templates
https://bugs.webkit.org/show_bug.cgi?id=125279

Reviewed by Antti Koivisto.

Source/WebCore: 

Faithfully update the HTML5 parser after http://html5.org/tools/web-apps-tracker?from=8330&to=8331.

Test: fast/dom/HTMLTemplateElement/no-form-association-2.html

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertHTMLFormElement): Don't the form element pointer if the context
element or its ancestor is a template element.
(WebCore::HTMLConstructionSite::insideTemplateElement): Added.
(WebCore::HTMLConstructionSite::createHTMLElement): Renamed openElementsContainTemplateElement to
insideTemplateElement to reflect the true semantics of the boolean.

* html/parser/HTMLConstructionSite.h:

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processIsindexStartTagForInBody): Ignore the form element pointer if there
is a template element on the stack of open elements. This faithfully reflects what's being said in the
specification. We should probably make isParsingTemplateContents more efficient by storing a boolean
and then wrap from() in some helper function but that should probbaly happen in a separate patch.
(WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto.
(WebCore::HTMLTreeBuilder::processStartTagForInTable): Ditto.
(WebCore::HTMLTreeBuilder::processEndTagForInBody): Don't unset or rely on the form element pointer
when there is a template element on the stack of open elements.

* html/parser/HTMLTreeBuilder.h:
(WebCore::HTMLTreeBuilder::isParsingTemplateContents): Added a trivial implementation for when
TEMPLATE_ELEMENT is disabled.
(WebCore::HTMLTreeBuilder::isParsingFragmentOrTemplateContents): Merged two implementations.

LayoutTests: 

Added a regression test. Someone should port this test into web-platform-tests once the latest spec.
change has been refelcted to a working draft version of the HTML5 specification.

* fast/dom/HTMLTemplateElement/no-form-association-2-expected.txt: Added.
* fast/dom/HTMLTemplateElement/no-form-association-2.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove stale ScriptGlobalObject methods
https://bugs.webkit.org/show_bug.cgi?id=125276

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-12-05
Reviewed by Sam Weinig.

* bindings/js/ScriptObject.cpp:
(WebCore::ScriptGlobalObject::set):
* bindings/js/ScriptObject.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Exiting from Media Full Screen mode via 'escape' key does not work properly
https://bugs.webkit.org/show_bug.cgi?id=125272

Reviewed by Jer Noble.

* WebView.cpp:
(WebView::fullScreenClientWillExitFullScreen): Change to webkitCancelFullScreen method call
to more closely match Media Control behavior.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Update negative-arguments inset parsing test to test for the argument not for the commas
https://bugs.webkit.org/show_bug.cgi?id=125310

Reviewed by Rob Buis.

Fix typo in the negative-arguments inset tests, remove commas.

* fast/shapes/parsing/parsing-shape-lengths-expected.txt:
* fast/shapes/parsing/parsing-shape-lengths.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make the C Loop LLINT work with callToJavaScript.
https://bugs.webkit.org/show_bug.cgi?id=125294.

Reviewed by Michael Saboff.

1. Changed the C Loop LLINT to dispatch to an Executable via its JITCode
   instance which is consistent with how the ASM LLINT works.
2. Changed CLoop::execute() to take an Opcode instead of an OpcodeID.
   This makes it play nice with the use of JITCode for dispatching.
3. Introduce a callToJavaScript and callToNativeFunction for the C Loop
   LLINT. These will call JSStack::pushFrame() and popFrame() to setup
   and teardown the CallFrame.
4. Also introduced a C Loop returnFromJavaScript which is just a
   replacement for ctiOpThrowNotCaught which had the same function.
5. Remove a lot of #if ENABLE(LLINT_C_LOOP) code now that the dispatch
   mechanism is consistent.

This patch has been tested with both configurations of COMPUTED_GOTOs
on and off.

* interpreter/CachedCall.h:
(JSC::CachedCall::CachedCall):
(JSC::CachedCall::call):
(JSC::CachedCall::setArgument):
* interpreter/CallFrameClosure.h:
(JSC::CallFrameClosure::setThis):
(JSC::CallFrameClosure::setArgument):
(JSC::CallFrameClosure::resetCallFrame):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
* interpreter/Interpreter.h:
* interpreter/JSStack.h:
* interpreter/JSStackInlines.h:
(JSC::JSStack::pushFrame):
* interpreter/ProtoCallFrame.h:
(JSC::ProtoCallFrame::scope):
(JSC::ProtoCallFrame::callee):
(JSC::ProtoCallFrame::thisValue):
(JSC::ProtoCallFrame::argument):
(JSC::ProtoCallFrame::setArgument):
* jit/JITCode.cpp:
(JSC::JITCode::execute):
* jit/JITCode.h:
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* llint/LLIntCLoop.cpp:
(JSC::LLInt::CLoop::initialize):
* llint/LLIntCLoop.h:
* llint/LLIntEntrypoint.cpp:
(JSC::LLInt::setFunctionEntrypoint):
(JSC::LLInt::setEvalEntrypoint):
(JSC::LLInt::setProgramEntrypoint):
- Inverted the check for vm.canUseJIT(). This allows the JIT case to be
  #if'd out nicely when building the C Loop LLINT.
* llint/LLIntOpcode.h:
* llint/LLIntThunks.cpp:
(JSC::doCallToJavaScript):
(JSC::executeJS):
(JSC::callToJavaScript):
(JSC::executeNative):
(JSC::callToNativeFunction):
* llint/LLIntThunks.h:
* llint/LowLevelInterpreter.cpp:
(JSC::CLoop::execute):
* runtime/Executable.h:
(JSC::ExecutableBase::offsetOfNumParametersFor):
(JSC::ExecutableBase::hostCodeEntryFor):
(JSC::ExecutableBase::jsCodeEntryFor):
(JSC::ExecutableBase::jsCodeWithArityCheckEntryFor):
(JSC::NativeExecutable::create):
(JSC::NativeExecutable::finishCreation):
(JSC::ProgramExecutable::generatedJITCode):
* runtime/JSArray.cpp:
(JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):
* runtime/VM.cpp:
(JSC::VM::getHostFunction):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tweak WeakObjCPtr
https://bugs.webkit.org/show_bug.cgi?id=125311

Reviewed by Darin Adler.

Source/WebKit2:

Make it possible to use WeakObjCPtr with pointer types such as id. Also,
add a getAutoreleased() member that will load the weak pointer and retain + autorelease it.

* Shared/mac/WeakObjCPtr.h:
(WebKit::WeakObjCPtr::WeakObjCPtr):
(WebKit::WeakObjCPtr::operator=):
(WebKit::WeakObjCPtr::get):
(WebKit::WeakObjCPtr::getAutoreleased):

Tools:

Split up tests into more logical groups. Add new tests for new functionality.

* TestWebKitAPI/Tests/WebKit2/mac/WeakObjCPtr.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Avoid copying compiled-in resources to DSTROOT
https://bugs.webkit.org/show_bug.cgi?id=125309

Reviewed by Jer Noble.

* WebKit.vcxproj/WebKit/WebKitPostBuild.cmd: Only copy Info.plist to the final WebKit.resource bundle.
The PNG and RC files are compiled into the WebKit.dll library.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cropping and drawing ImageBuffers results in uninitialized data being shown
https://bugs.webkit.org/show_bug.cgi?id=125271

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

createCroppedImageIfNecessary() crops to the bottom left of the ImageBuffer
backing store instead of the top left. In addition, ImageBuffer::draw()
draws the entire ImageBuffer's backing store instead of just the relevant
portion of it.

No new tests are necessary because the existing tests already test this
functionality

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::createCroppedImageIfNecessary): Crop to the top left of the
backing store
(WebCore::ImageBuffer::draw): Draw only the logical portion of the
backing store

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit2 API should use weak ownership for delegate properties rather than assign
https://bugs.webkit.org/show_bug.cgi?id=125316
<rdar://problem/15560614>

Reviewed by Dan Bernstein.

Use WeakObjCPtr for the delegates.

* UIProcess/API/Cocoa/WKBrowsingContextController.h:
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(didStartProvisionalLoadForFrame):
(didReceiveServerRedirectForProvisionalLoadForFrame):
(didFailProvisionalLoadWithErrorForFrame):
(didCommitLoadForFrame):
(didFinishLoadForFrame):
(didFailLoadWithErrorForFrame):
(didStartProgress):
(didChangeProgress):
(didFinishProgress):
(didChangeBackForwardList):
(setUpPagePolicyClient):
(-[WKBrowsingContextController loadDelegate]):
(-[WKBrowsingContextController setLoadDelegate:]):
(-[WKBrowsingContextController policyDelegate]):
(-[WKBrowsingContextController setPolicyDelegate:]):
(-[WKBrowsingContextController historyDelegate]):
(-[WKBrowsingContextController setHistoryDelegate:]):
* UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
* UIProcess/API/Cocoa/WKConnection.mm:
(didReceiveMessage):
(didClose):
(-[WKConnection delegate]):
(-[WKConnection setDelegate:]):
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(didCreateConnection):
(getInjectedBundleInitializationUserData):
(didNavigateWithNavigationData):
(didPerformClientRedirect):
(didPerformServerRedirect):
(didUpdateHistoryTitle):
(-[WKProcessGroup delegate]):
(-[WKProcessGroup setDelegate:]):

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