Meant to land this ages ago.  Make radio buttons work dynamically
	when name and type change (make them pick up the correct new
	group).

	Also fix a bug in the tokenizer where trailing spaces/newlines at
	the end of a document were getting lost.  Messed up .innerHTML
	on DHTML sites.

        Reviewed by darin

        * khtml/css/html4.css:
        * khtml/html/html_formimpl.cpp:
        (DOM::HTMLFormElementImpl::radioButtonChecked):
        (DOM::HTMLGenericFormElementImpl::name):
        (DOM::HTMLInputElementImpl::name):
        (DOM::HTMLInputElementImpl::setInputType):
        (DOM::HTMLInputElementImpl::parseMappedAttribute):
        (DOM::HTMLInputElementImpl::attach):
        (DOM::HTMLInputElementImpl::preDispatchEventHandler):
        (DOM::HTMLInputElementImpl::postDispatchEventHandler):
        (DOM::HTMLIsIndexElementImpl::HTMLIsIndexElementImpl):
        * khtml/html/html_formimpl.h:
        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::finish):
        * khtml/xml/dom_nodeimpl.cpp:
        (DOM::NodeImpl::dispatchGenericEvent):
        * khtml/xml/dom_nodeimpl.h:
        (DOM::NodeImpl::preDispatchEventHandler):
        (DOM::NodeImpl::postDispatchEventHandler):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update layout tests to deal with trailing whitespace at the end of a document properly.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug #:
Submitted by:
Reviewed by:
Bug #:
Submitted by:
Reviewed by:
Bug #:
Submitted by:
Reviewed by:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug #:
Submitted by:
Reviewed by:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug #: none
Submitted by: eseidel
Reviewed by: none needed, svg build fix only.
        Fix the SVG build buy linking EcmaInterface.cpp
        from derived sources into the source root and
        adding to the compiled sources.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        - Fixed <rdar://problem/4263434> <rdar://problem/4263434> Denver 8F29 Regression:
          KJS::InterpreterImp::mark() crash

        Fix by mjs, review by me.

        * kjs/internal.cpp:
        (KJS::InterpreterImp::mark): Added a null check on globExec in case a
        garbage collection occurs inside InterpreterImp::globalInit (called
        from InterpreterImp::InterpreterImp), at which point globExec has not yet been initialized.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        - More changes needed to fix <rdar://problem/4214783> 8F29 REGRESSION(Denver/Chardonnay):
          kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in
          the installer)

        Added InterpreterLocks in some places in the bindings we missed before.

        Reviewed by john.

        * bindings/runtime_root.cpp:
        (KJS::Bindings::addNativeReference):
        (KJS::Bindings::removeNativeReference):
        (RootObject::removeAllNativeReferences):
        * bindings/runtime_root.h:
        (KJS::Bindings::RootObject::~RootObject):
        (KJS::Bindings::RootObject::setRootObjectImp):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        - Oops. The 4263434 change was only appropriate on the branch. Rolling out.

        Reviewed by eric.

        * kjs/internal.cpp:
        (KJS::InterpreterImp::mark):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add results for new replaceChild test.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Reviewed by Geoff and partly by Darin.

	- fixed http://bugzilla.opendarwin.org/post_bug.cgi
	(Reduce conflicts in JavaScriptCore grammar)

	This change gets us down from over 200 shift/reduce and 45 reduce/reduce to
	9 shift/reduce and 45 reduce/reduce.

        * kjs/grammar.y:
        * kjs/grammar_types.h: Removed.
        * kjs/lexer.cpp:
        * kjs/nodes.h:
        (KJS::Node::isGroupNode):
        (KJS::Node::isLocation):
        (KJS::Node::isResolveNode):
        (KJS::Node::isBracketAccessorNode):
        (KJS::Node::isDotAccessorNode):
        (KJS::ResolveNode::isLocation):
        (KJS::ResolveNode::isResolveNode):
        (KJS::ResolveNode::identifier):
        (KJS::GroupNode::isGroupNode):
        (KJS::GroupNode::leafNode):
        (KJS::BracketAccessorNode::isLocation):
        (KJS::BracketAccessorNode::isBracketAccessorNode):
        (KJS::BracketAccessorNode::base):
        (KJS::BracketAccessorNode::subscript):
        (KJS::DotAccessorNode::isLocation):
        (KJS::DotAccessorNode::isDotAccessorNode):
        (KJS::DotAccessorNode::base):
        (KJS::DotAccessorNode::identifier):
        (KJS::FuncExprNode::FuncExprNode):
        (KJS::FuncExprNode::identifier):
        (KJS::FuncDeclNode::FuncDeclNode):
        (KJS::FuncDeclNode::execute):


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

	- fix these bugs
	<rdar://problem/3579812> HTMLTableElement.insertRow(n) inserts row at the beginning of the table (4043)
	<rdar://problem/3711188> HTMLTableElement.insertRow() doesn't respect passed index

        * khtml/html/html_tableimpl.cpp:
        (DOM::HTMLTableElementImpl::insertRow):
	if the index is the same as the number of rows in the section, we should append

	Update test results for /fast/dynamic/013.html. In the old version the the rows
	and cells were children of the first table section, a tfoot.  They are now children
	of the second table section, a tbody.  Our rendering now matches Gecko and Win IE
	(according to yusufg on #webkit, comparing with 013-expected.png) for this case.

        * layout-tests/fast/dynamic/013-expected.checksum:
        * layout-tests/fast/dynamic/013-expected.png:
        * layout-tests/fast/dynamic/013-expected.txt:

        Test cases added:

        * layout-tests/fast/dynamic/014-expected.checksum: Added.
        * layout-tests/fast/dynamic/014-expected.png: Added.
        * layout-tests/fast/dynamic/014-expected.txt: Added.
        * layout-tests/fast/dynamic/014.html: Added.
        * layout-tests/fast/dynamic/015-expected.checksum: Added.
        * layout-tests/fast/dynamic/015-expected.png: Added.
        * layout-tests/fast/dynamic/015-expected.txt: Added.
        * layout-tests/fast/dynamic/015.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Changes by Romain Brestac, reviewed by Darin.

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3418
        (unicode characters not preserved after a xslt transformation)

        * khtml/misc/loader.cpp:
        (CachedXSLStyleSheet::CachedXSLStyleSheet):
        (CachedXSLStyleSheet::data):
        * khtml/misc/loader.h:
        * khtml/xsl/xslt_processorimpl.cpp:
        (DOM::XSLTProcessorImpl::addToResult):
        (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):

	Test cases added:

        * layout-tests/fast/xsl/resources/unicode.xsl: Added.
        * layout-tests/fast/xsl/resources/xslt-enc-cyr.xsl: Added.
        * layout-tests/fast/xsl/resources/xslt-enc.xsl: Added.
        * layout-tests/fast/xsl/resources/xslt-enc16.xsl: Added.
        * layout-tests/fast/xsl/xslt-enc-cyr-expected.checksum: Added.
        * layout-tests/fast/xsl/xslt-enc-cyr-expected.png: Added.
        * layout-tests/fast/xsl/xslt-enc-cyr-expected.txt: Added.
        * layout-tests/fast/xsl/xslt-enc-cyr.xml: Added.
        * layout-tests/fast/xsl/xslt-enc-expected.checksum: Added.
        * layout-tests/fast/xsl/xslt-enc-expected.png: Added.
        * layout-tests/fast/xsl/xslt-enc-expected.txt: Added.
        * layout-tests/fast/xsl/xslt-enc.xml: Added.
        * layout-tests/fast/xsl/xslt-enc16-expected.checksum: Added.
        * layout-tests/fast/xsl/xslt-enc16-expected.png: Added.
        * layout-tests/fast/xsl/xslt-enc16-expected.txt: Added.
        * layout-tests/fast/xsl/xslt-enc16.xml: Added.
        * layout-tests/fast/xsl/xslt-enc16to16-expected.checksum: Added.
        * layout-tests/fast/xsl/xslt-enc16to16-expected.png: Added.
        * layout-tests/fast/xsl/xslt-enc16to16-expected.txt: Added.
        * layout-tests/fast/xsl/xslt-enc16to16.xml: Added.
        * layout-tests/fast/xsl/xslt_unicode-expected.checksum: Added.
        * layout-tests/fast/xsl/xslt_unicode-expected.png: Added.
        * layout-tests/fast/xsl/xslt_unicode-expected.txt: Added.
        * layout-tests/fast/xsl/xslt_unicode.xml: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update editing tests to fix failures.


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

        * khtml/ecma/kjs_dom.cpp: (KJS::getDOMDocumentNode): Don't use a static (global)
        identifier for the string "document" -- instead just create one each time.
        This eliminates the kjs_fast_malloc assertion on quit and does not create a
        significant performance regression because this is done at most once per JavaScript
        window object.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5053
        Need to restore int/long changes to simple_number.h

        Reviewed by darin and mjs.

        * kjs/simple_number.h: changed enums to indenpendent constants to clarify types
        (KJS::isNegativeZero): changed to static function - no reason to export
        (KJS::SimpleNumber::rightShiftSignExtended): new function for clarity
        (KJS::SimpleNumber::make): specified cast as reinterpret_cast
        (KJS::SimpleNumber::is): changed to use uintptr_t for portability
        (KJS::SimpleNumber::value): changed to use uintptr_t and rightShiftSignExtended
        (KJS::SimpleNumber::fits): inverted tests - probably only a performance win for double
        (KJS::SimpleNumber::integerFits): ditto


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug #: 5003
Submitted by: eseidel
Reviewed by: hyatt
        Added KDOM and KCanvas wrapper objects for the WebCore DOM
        and WebCore render tree.  This allows using SVG in any
        WebKit app, including Safari.
        Also added extensions to QPainter to return a
        KRenderingDeviceContext object to be passed into KCanvas.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5003

        * WebCore+SVG/dom_kdomdocumentwrapper.cpp: Added.
        (KDOMDocumentWrapperImpl::renderingDevice):
        (KDOMDocumentWrapperImpl::KDOMDocumentWrapperImpl):
        (KDOMDocumentWrapperImpl::~KDOMDocumentWrapperImpl):
        (DOM::KDOMDocumentWrapperImpl::createTokenizer):
        (KDOMDocumentWrapperImpl::svgView):
        * WebCore+SVG/dom_kdomdocumentwrapper.h: Added.
        * WebCore+SVG/dom_kdomnodetreewrapper.cpp: Added.
        (DOM::KDOMNodeTreeWrapperImpl::KDOMNodeTreeWrapperImpl):
        (KDOMNodeTreeWrapperImpl::~KDOMNodeTreeWrapperImpl):
        (KDOMNodeTreeWrapperImpl::attach):
        (KDOMNodeTreeWrapperImpl::createRenderer):
        * WebCore+SVG/dom_kdomnodetreewrapper.h: Added.
        * WebCore+SVG/render_kcanvaswrapper.cpp: Added.
        (RenderKCanvasWrapper::RenderKCanvasWrapper):
        (RenderKCanvasWrapper::~RenderKCanvasWrapper):
        (RenderKCanvasWrapper::layout):
        (RenderKCanvasWrapper::paint):
        (RenderKCanvasWrapper::intrinsicWidth):
        (RenderKCanvasWrapper::intrinsicHeight):
        * WebCore+SVG/render_kcanvaswrapper.h: Added.
        (khtml::RenderKCanvasWrapper::renderName):
        (khtml::RenderKCanvasWrapper::setCanvas):
        * WebCore+SVG/xml_kdomtokenizer.cpp: Added.
        (KDOMTokenizer::KDOMTokenizer):
        (KDOMTokenizer::~KDOMTokenizer):
        (KDOMTokenizer::documentWrapper):
        (KDOMTokenizer::write):
        (KDOMTokenizer::setOnHold):
        (KDOMTokenizer::finish):
        (KDOMTokenizer::isWaitingForScripts):
        (khtml::newKDOMTokenizer):
        * WebCore+SVG/xml_kdomtokenizer.h: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * khtml/khtml_part.cpp:
        (KHTMLPart::begin):
        * khtml/xml/dom_docimpl.cpp:
        (DOMImplementationImpl::createKDOMDocument):
        * khtml/xml/dom_docimpl.h:
        * kwq/KWQPainter.h:
        * kwq/KWQPainter.mm:
        (QPainterPrivate::QPainterPrivate):
        (QPainterPrivate::~QPainterPrivate):
        (QPainter::renderingDeviceContext):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug #: 5003
Submitted by: eseidel
Reviewed by: mjs
        Update tools for WebCore+SVG -> WebCore rename.
        Also fold several SVG specific tools into their original
        WebCore counterparts.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5003

        * DrawTest/DrawTest.xcodeproj/project.pbxproj:
        * DumpKCanvasTree/DumpKCanvasTree.xcodeproj/project.pbxproj:
        * Scripts/build-drawtest:
        * Scripts/build-dumpkcanvastree:
        * Scripts/build-webcore-svg: Removed.
        * Scripts/build-webkit: added --svg option
        * Scripts/run-drawtest:
        * Scripts/run-webkit-tests:
        * Scripts/webkitdirs.pm: various additions.
        * checkout: added --svg option
        * checkout-svg: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug #: 4649
Submitted by: Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>
Reviewed by: eseidel
        * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
        Deployment build fix.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Reviewed by Maciej.
        Tested, landed, and tweaked a tiny bit by Darin.

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=5092
          Random crashes when running the layout tests

        Fix was to remove the "pending" concept from the tokenizer, which streamlined the
        code and also fixed one minor bug seen in one of the layout tests where we discarded
        too much after the <pre>.

        * khtml/html/htmltokenizer.h: Removed the addPending function and the pending
        field. Also removed SpaceDiscard and AllDiscard since we don't use them any more.
        We still use LFDiscard to discard the first LF after a <pre>.

        * khtml/html/htmltokenizer.cpp:
        (khtml::HTMLTokenizer::begin): Don't initialize pending.
        (khtml::HTMLTokenizer::processListing): Tweaked formatting to match guidelines.
        Removed calls to addPending. Write "\n" right away instead of using LFPending.
        Write " " right away instead of using SpacePending by removing separate code for space.
        (khtml::HTMLTokenizer::write): Ditto.
        (khtml::HTMLTokenizer::finish): Remove the call to addPending we just added a few
        days ago. This is what was causing the crash.

        * layout-tests/fast/text/whitespace/013-expected.txt: Updated results. Old results
        incorrectly expected spaces *and* a newline to be discarded after a <pre> tag, which
        was happening by accident. I tested Firefox and it matches what we do now -- only
        discards a newline just after a <pre>, not a run of spaces and a subsequent newline.


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

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4309
          CSSStyleSheet objects don't get Obj-C DOMCSSStyleSheet wrappers

        * kwq/DOM-CSS.mm:
        (-[DOMStyleSheet _initWithStyleSheetImpl:]): Changed the name of this method to be consistent
        with other method names in the DOM wrappers. The old name had an extraneous "DOM" in it.
        (+[DOMStyleSheet _DOMStyleSheetWithImpl:]): Create a wrapper of an appropriate class
        that matches the actual style sheet. This is analogous to what +[DOMNode _nodeWithImpl:] does.
        (+[DOMCSSStyleSheet _CSSStyleSheetWithImpl:]): Call through to the base class. The only difference
        here is the static type of the parameter, which ensures a compile-time error if you pass the
        wrong type of pointer.


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