- 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
        Reviewed by Eric.

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4310
          "sheet" method is unimplemented in Obj-C DOM API

        * kwq/DOM-CSS.mm: (-[DOMObject sheet]): Added.


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

        Reviewed and landed by Darin.

        - name changes to prepare for fixing bugzilla bug 4582

        Renamed khtml::Selection to khtml::SelectionController since it's far more
        than just the selection position itself. Also renamed WebSelectionDirection
        WebSelectionGranularity and their constants to have a WebBridge prefix so they
        don't collide with possible public enums with a similar purpose.

        * ForwardingHeaders/editing/SelectionController.h: Added.
        * ForwardingHeaders/editing/selection.h: Removed.
        * WebCore.xcodeproj/project.pbxproj: Added new files, removed old files.

        * khtml/editing/SelectionController.cpp: New name for selection.cpp, contents renamed.
        * khtml/editing/SelectionController.h: New name for selection.h, contents renamed.

        * khtml/editing/selection.cpp: Removed.
        * khtml/editing/selection.h: Removed.

        * khtml/ecma/kjs_window.cpp:
        * khtml/editing/apply_style_command.cpp:
        * khtml/editing/break_blockquote_command.cpp:
        * khtml/editing/composite_edit_command.cpp:
        * khtml/editing/composite_edit_command.h:
        * khtml/editing/delete_selection_command.cpp:
        * khtml/editing/delete_selection_command.h:
        * khtml/editing/edit_command.cpp:
        * khtml/editing/edit_command.h:
        * khtml/editing/htmlediting.h:
        * khtml/editing/insert_line_break_command.cpp:
        * khtml/editing/insert_paragraph_separator_command.cpp:
        * khtml/editing/insert_text_command.cpp:
        * khtml/editing/jsediting.cpp:
        * khtml/editing/move_selection_command.cpp:
        * khtml/editing/replace_selection_command.cpp:
        * khtml/editing/typing_command.cpp:
        * khtml/khtml_part.cpp:
        * khtml/khtml_part.h:
        * khtml/khtmlpart_p.h:
        * khtml/rendering/render_block.cpp:
        * khtml/xml/dom_docimpl.cpp:
        * khtml/xml/dom_nodeimpl.cpp:
        * kwq/KWQAccObject.mm:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        * kwq/KWQRenderTreeDebug.cpp:
        * kwq/WebCoreBridge.h:
        * kwq/WebCoreBridge.mm:
        Renaming.

WebKit:

        Reviewed and landed by Darin.

        - name changes to prepare for fixing bugzilla bug 4582

        * WebView.subproj/WebHTMLView.m: Changed names to match WebCore changes.


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

        - a Windows-specific file

        * os-win32/stdint.h: Added. We plan to remove dependency on the <stdint.h> types,
        and if we do so, we will remove this file.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug #: 5111
Submitted by: Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by: mjs
        * WebCore.xcodeproj/project.pbxproj:
	Build fix:  EcmaInterface.cpp paths.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5111


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug #: 5113
Submitted by: eseidel
Reviewed by: none, build fix only.
        * khtml/editing/SelectionController.cpp:
        (khtml::SelectionController::debugPosition):
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5113


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