2008-08-06  Cameron Zwarich  <cwzwarich@webkit.org>

        Reviewed by Maciej.

        Bug 20286: Load constants all at once instead of using op_load
        <https://bugs.webkit.org/show_bug.cgi?id=20286>

        Load constants all at once into temporary registers instead of using
        individual instances of op_load.

        This is a 2.6% speedup on SunSpider.

        JavaScriptCore:

        * JavaScriptCore.exp:
        * VM/CodeBlock.cpp:
        (KJS::CodeBlock::dump):
        (KJS::CodeBlock::mark):
        * VM/CodeBlock.h:
        * VM/CodeGenerator.cpp:
        (KJS::CodeGenerator::CodeGenerator):
        (KJS::CodeGenerator::newTemporary):
        (KJS::CodeGenerator::addConstant):
        (KJS::CodeGenerator::addUnexpectedConstant):
        (KJS::CodeGenerator::emitLoad):
        (KJS::CodeGenerator::emitUnexpectedLoad):
        (KJS::CodeGenerator::emitNewError):
        * VM/CodeGenerator.h:
        * VM/Machine.cpp:
        (KJS::slideRegisterWindowForCall):
        (KJS::Machine::unwindCallFrame):
        (KJS::Machine::throwException):
        (KJS::Machine::execute):
        (KJS::Machine::privateExecute):
        * VM/Machine.h:
        * VM/Opcode.h:
        * VM/RegisterID.h:
        (KJS::RegisterID::RegisterID):
        (KJS::RegisterID::makeConstant):
        (KJS::RegisterID::isTemporary):
        * kjs/NodeInfo.h:
        * kjs/Parser.cpp:
        (KJS::Parser::didFinishParsing):
        * kjs/Parser.h:
        (KJS::Parser::parse):
        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::NullNode::emitCode):
        (KJS::BooleanNode::emitCode):
        (KJS::NumberNode::emitCode):
        (KJS::StringNode::emitCode):
        (KJS::ArrayNode::emitCode):
        (KJS::DeleteResolveNode::emitCode):
        (KJS::DeleteValueNode::emitCode):
        (KJS::VoidNode::emitCode):
        (KJS::ConstDeclNode::emitCodeSingle):
        (KJS::ReturnNode::emitCode):
        (KJS::ScopeNode::ScopeNode):
        (KJS::ProgramNode::ProgramNode):
        (KJS::ProgramNode::create):
        (KJS::EvalNode::EvalNode):
        (KJS::EvalNode::create):
        (KJS::FunctionBodyNode::FunctionBodyNode):
        (KJS::FunctionBodyNode::create):
        (KJS::FunctionBodyNode::emitCode):
        * kjs/nodes.h:
        (KJS::ScopeNode::neededConstants):

        LayoutTests:

        * fast/js/constant-count-expected.txt: Added.
        * fast/js/constant-count.html: Added.
        * fast/js/deep-recursion-test.html:
        * fast/js/resources/constant-count.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-08-06  Csaba Osztrogonac  <oszi@inf.u-szeged.hu>

        Reviewed by Darin. Landed by Cameron.

        Bug 20272: typo in JavaScriptCore
        <https://bugs.webkit.org/show_bug.cgi?id=20272>

        Correct the documentation for op_not. (typo)
        Fix #undef. (typo)

        * VM/Machine.cpp:
        (KJS::Machine::privateExecute):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-08-06  Ariya Hidayat  <ariya.hidayat@trolltech.com>

       Fix non-Mac build.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35595 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix non-Mac build.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-08-06  Ariya Hidayat  <ariya.hidayat@trolltech.com>

        Fix the Qt build due to recent ScriptController refactoring.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Reviewed by Cameron Zwarich.

        Fix warnings and errors seen on Qt bot.
        Including one correctness fix for ThreadingQt.
        According to the Qt 4.4 docs, we were always passing
        seconds to "wait()" when we should have been passing
        milliseconds.

        Lots of float <-> int conversion warnings.

        * css/CSSCursorImageValue.cpp:
        (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
        * dom/Element.cpp:
        (WebCore::adjustForLocalZoom):
        (WebCore::adjustForAbsoluteZoom):
        (WebCore::Element::setScrollLeft):
        (WebCore::Element::setScrollTop):
        * dom/EventTargetNode.cpp:
        (WebCore::EventTargetNode::dispatchMouseEvent):
        * loader/CachedImage.cpp:
        (WebCore::CachedImage::imageRect):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::innerHeight):
        (WebCore::DOMWindow::innerWidth):
        (WebCore::DOMWindow::scrollX):
        (WebCore::DOMWindow::scrollY):
        (WebCore::DOMWindow::scrollTo):
        * page/EventHandler.cpp:
        (WebCore::scrollAndAcceptEvent):
        * plugins/npapi.cpp:
        * plugins/qt/PluginViewQt.cpp:
        (WebCore::PluginView::getValue):
        (WebCore::PluginView::~PluginView):
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::intrinsicSizeChanged):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-08-06  Jan Michael Alonzo  <jmalonzo@webkit.org>

        Gtk build fix only

        * bindings/js/ScriptControllerGtk.cpp:
        * plugins/gtk/PluginViewGtk.cpp:
        (WebCore::PluginView::getValue):
        (WebCore::PluginView::~PluginView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-08-06  Marco Barisione  <marco.barisione@collabora.co.uk>

        Reviewed by Eric Seidel.

        http://bugs.webkit.org/show_bug.cgi?id=20276
        [GTK] Makefile rules for the enum GTypes files depend on Makefile
        instead of GNUmakefile

        The patch committed in revision 34649 added the code needed to
        generate GTypes for enums but the makefile rules for
        stamp-webkitenumtypes.h and webkitenumtypes.cpp were depending on
        Makefile (used by other ports) instead of GNUmakefile.

        * GNUmakefile.am: Depend on GNUmakefile instead of Makefile.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-08-06  Marco Barisione  <marco.barisione@collabora.co.uk>

        Reviewed by Eric Seidel.

        http://bugs.webkit.org/show_bug.cgi?id=20295
        RegularExpression::match should not crash when a null string is passed

        RegularExpression::match used to pass null subject strings to
        jsRegExpExecute causing an ASSERT failure and then a crash.
        There is no need to fix also RegularExpression:search and
        RegularExpression::searchRev as they just call
        RegularExpression::match.

        * platform/text/RegularExpression.cpp:
        (WebCore::RegularExpression::match): Return -1 if the string is null.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Revert change 35595.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-08-06  Benjamin C Meyer  <ben@meyerhome.net>

        Reviewed by Simon.

        During the drag operation only accept the event if the action is not ignore action.


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

        * API/JSBase.cpp: Touch this to force JSC to rebuild and re-copy the
        WTF headers.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix an accessibility layout test that was failing on different platforms


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

        Images using QT plugin do not display correctly

        <https://bugs.webkit.org/show_bug.cgi?id=9214>
        <rdar://problem/5683413>

        Reviewed by Darin.

        Tests: fast/images/embed-image.html
               fast/images/object-image.html

        Use RenderImage instead of RenderPartObject for a renderer when
        the <embed> tag references an image.  Extract common code from
        HTMLEmbedElement and HTMLObjectElement into HTMLPlugInImageElement.

        * WebCore.xcodeproj/project.pbxproj: Added new source files.

        * html/HTMLEmbedElement.cpp: Cleaned up #include statements.
        (WebCore::HTMLEmbedElement::HTMLEmbedElement): Extend
        HTMLPlugInImageElement which extends HTMLPlugInElement.
        (WebCore::HTMLEmbedElement::parseMappedAttribute): Split codeAttr
        and srcAttr cases.  Create or clear HTMLImageLoader as needed for
        srcAttr.
        (WebCore::HTMLEmbedElement::rendererIsNeeded): Use
        HTMLPlugInElement::rendererIsNeeded() for images.
        (WebCore::HTMLEmbedElement::createRenderer): Create a
        RenderImage instead of a RenderPartObject for images.
        (WebCore::HTMLEmbedElement::attach): Create HTMLImageLoader,
        load image and populate RenderImage for images.
        (WebCore::HTMLEmbedElement::updateWidget): Don't call
        RenderPartObject::updateWidget() for images.
        (WebCore::HTMLEmbedElement::imageSourceAttributeName): Added.
        * html/HTMLEmbedElement.h: Removed unneeded namespace and class
        declarations.  Extend HTMLPlugInImageElement which extends
        HTMLPlugInElement.
        (WebCore::HTMLEmbedElement::imageSourceAttributeName): Added.
        (WebCore::HTMLEmbedElement::serviceType): Moved to
        HTMLPlugInImageElement.
        (WebCore::HTMLEmbedElement::url): Ditto.

        * html/HTMLObjectElement.cpp: Cleaned up #include statements.
        (WebCore::HTMLObjectElement::attach): Removed local variable.
        (WebCore::HTMLObjectElement::isImageType): Moved to
        HTMLPlugInImageElement.
        * html/HTMLObjectElement.h: Extend HTMLPlugInImageElement which
        extends HTMLPlugInElement.
        (WebCore::HTMLObjectElement::isImageType): Moved to
        HTMLPlugInImageElement.
        (WebCore::HTMLObjectElement::serviceType): Ditto.
        (WebCore::HTMLObjectElement::url): Ditto.

        * html/HTMLPlugInImageElement.cpp: Added.
        (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Added.
        (WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement): Added.
        (WebCore::HTMLPlugInImageElement::isImageType): Moved from
        HTMLObjectElement.
        * html/HTMLPlugInImageElement.h: Added.
        (WebCore::HTMLPlugInImageElement::isImageType): Added from
        HTMLObjectElement.
        (WebCore::HTMLPlugInImageElement::serviceType): Ditto.
        (WebCore::HTMLPlugInImageElement::url): Ditto.

        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::absoluteImageURL): Return urlString
        for embed elements with images.

LayoutTests:

        Images using QT plugin do not display correctly

        <https://bugs.webkit.org/show_bug.cgi?id=9214>
        <rdar://problem/5683413>

        Reviewed by Darin.

        Test images rendered by both embed and object elements.

        * fast/images/embed-image.html: Added.
        * fast/images/object-image.html: Added.
        * platform/mac/fast/images/embed-image-expected.checksum: Added.
        * platform/mac/fast/images/embed-image-expected.png: Added.
        * platform/mac/fast/images/embed-image-expected.txt: Added.
        * platform/mac/fast/images/object-image-expected.checksum: Added.
        * platform/mac/fast/images/object-image-expected.png: Added.
        * platform/mac/fast/images/object-image-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-08-06  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Tim and Darin.

        <rdar://problem/6126160> URLs in the console should be clickable.
        - Implemented and now use linkifyString() to parse console messages for
        URLs.

        * page/inspector/Console.js:
        * page/inspector/inspector.js:
        * page/inspector/utilities.js:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Reviewed by darin.

        Fix leaks seen on build-bot by fixing memory management of AccessibilityUIElement.

        I've made AccessibilityUIElement a stack object for now.  It could be
        made RefCounted, but I figured that might be overkill for the moment.
        Essentially it's just a RefPtr itself. :)

        I also fixed a few typos, such as AccessibilityUIElement() instead of ~AccessibilityUIElement()
        which was causing additional leaks. :)

        I added toAXElement to remove a bunch of copy/paste code.

        * DumpRenderTree/AccessibilityController.h:
        * DumpRenderTree/AccessibilityUIElement.cpp:
        (toAXElement):
        (allAttributesCallback):
        (attributesOfLinkedUIElementsCallback):
        (attributesOfChildrenCallback):
        (lineForIndexCallback):
        (boundsForRangeCallback):
        (childAtIndexCallback):
        (getRoleCallback):
        (getTitleCallback):
        (getDescriptionCallback):
        (getWidthCallback):
        (getHeightCallback):
        (getIntValueCallback):
        (getMinValueCallback):
        (getMaxValueCallback):
        (getInsertionPointLineNumberCallback):
        (finalize):
        * DumpRenderTree/AccessibilityUIElement.h:
        (AccessibilityUIElement::platformUIElement):
        * DumpRenderTree/mac/AccessibilityControllerMac.mm:
        (AccessibilityController::focusedElement):
        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
        (AccessibilityUIElement::AccessibilityUIElement):
        (AccessibilityUIElement::getLinkedUIElements):
        (AccessibilityUIElement::getChildren):
        (AccessibilityUIElement::getChildAtIndex):
        (AccessibilityUIElement::attributesOfLinkedUIElements):
        (AccessibilityUIElement::attributesOfChildren):


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

        * WebCore.vcproj/WebCore.vcproj: Added PlugInImageElement.*



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        BUILD FIX: Add HTMLPlugInImageElement.cpp to all other build systems

        * GNUmakefile.am:
        * WebCore.pro:
        * WebCoreSources.bkl:


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

        Bug 20038: REGRESSION (r35151): Can't post comments on flickr.com

        <https://bugs.webkit.org/show_bug.cgi?id=20038>
        <rdar://problem/6092270>

        Reviewed by Eric Seidel.

        Test: fast/forms/submit-to-url-fragment.html

        The problem was that isFormSubmission was not being set to true in
        FrameLoader::loadWithDocumentLoader() when we were actually
        submitting a form, causing the page to scroll instead of the form to
        be submitted.

        The isFormSubmission variable wasn't set to true because a FormState
        object was not being created in
        FrameLoader::loadFrameRequestWithFormAndValues().

        The FormState object was not being created because
        HTMLFormElement::submit(Event*, bool activateSubmitButton) would
        only set FrameLoader::m_formAboutToBeSubmitted to the current form
        if there was a "text field" element in the form (type = text,
        password, search or isindex).

        Thus when FrameLoader::submitForm(const FrameLoadRequest&, Event*)
        called FrameLoader::loadFrameRequestWithFormAndValues(), a null
        HTMLFormElement pointer would be sent and cause the above failures.

        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::submit): Call new
        FrameLoader::setFormAboutToBeSubmitted() method outside the for
        loop so we always set FrameLoader::m_formAboutToBeSubmitted exactly
        once for any form submission.  The FrameLoader::recordFormValue()
        method is only called with the name/value pair of each text field.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::setFormAboutToBeSubmitted): Added method that
        only sets m_formAboutToBeSubmitted.
        (WebCore::FrameLoader::recordFormValue): Removed
        PassRefPtr<HTMLFormElement> argument since this method only sets
        name/value pairs on m_formValuesAboutToBeSubmitted now.
        (WebCore::FrameLoader::loadFrameRequestWithFormAndValues): Create a
        FormState object as long as submitForm is not null so that other
        FrameLoader methods know when a form is being submitted.
        * loader/FrameLoader.h:

LayoutTests:

        Bug 20038: REGRESSION (r35151): Can't post comments on flickr.com

        <https://bugs.webkit.org/show_bug.cgi?id=20038>
        <rdar://problem/6092270>

        Reviewed by Eric Seidel.

        * fast/forms/submit-to-url-fragment-expected.txt: Added.
        * fast/forms/submit-to-url-fragment.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Added bug URLs

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