Fix a buffer overrun and a leak introduced in r29098

         Reviewed by Mark.

         * platform/text/StringImpl.cpp:
         (WebCore::StringImpl::StringImpl): Only allocate one buffer, and make
         it be big enough to hold the string contents plus the null terminator.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Reviewed by Darin.
        
        Fixed: <rdar://problem/5660603> QuickDraw plug-ins can cause a 100% reproducible assertion failure in AppKit (breaks Safari UI)

        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView updateAndSetWindow]): Simplified an early return for non-QuickDraw plug-ins and switched
        to using the more NSView friendly version of lockFocus, lockFocusIfCanDraw.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
         Fix Bug 15663: update-webkit re-downloads WebKitAuxiliaryLibrary unnecessarily

         http://bugs.webkit.org/show_bug.cgi?id=15663

         Added a fuzz factor into the Last-Modified comparison for downloading
         WebKitAuxiliaryLibrary.zip.

         The zip file is served from a set of mirrors who give Last-Modified
         times that are off by 1-3 seconds from each other. This was causing
         the build bots to redownload WebKitAuxiliaryLibrary for every build,
         which would then cause all of WebCore to rebuild each time.

         Reviewed by Mark.

         * Scripts/update-webkit-auxiliary-libs: Check if the new zip file is
         at least 30 seconds newer than the old one -- otherwise we assume that
         the difference in time is due to the mirrors being slightly offset
         from each other.
         (sub lastModifiedToUnixTime): Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Rubber-stamped by Adam Roben.

        - update the project hierarchy to match the on-disk organization of
          the platform directory.

        * WebCore.vcproj/WebCore.vcproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Use HTTP::Date instead of Date::Parse because it's installed by Cygwin by default

        Rubberstamped by Mark.

        * Scripts/update-webkit-auxiliary-libs:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-01-03  Holger Hans Peter Freyther  <zecke@selfish.org>

        Reviewed by Alp.

        -This is from http://bugs.webkit.org/show_bug.cgi?id=16115

        Change the Gtk ContextMenuItem code to generate the GtkMenuItem
        or GtkCheckMenuItem on the fly. Currently we will create a
        GtkCheckMenuItem if the ContextMenuItem has been checked. What needs
        to be done is to change WebCore to tell the platform code if an item
        is checkable or not.

        * platform/ContextMenuItem.h:
        (WebCore::PlatformMenuItemDescription::PlatformMenuItemDescription):
        * platform/gtk/ContextMenuGtk.cpp:
        (WebCore::ContextMenu::appendItem):
        * platform/gtk/ContextMenuItemGtk.cpp:
        (WebCore::ContextMenuItem::ContextMenuItem):
        (WebCore::ContextMenuItem::~ContextMenuItem):
        (WebCore::ContextMenuItem::createNativeMenuItem):
        (WebCore::ContextMenuItem::releasePlatformDescription):
        (WebCore::ContextMenuItem::type):
        (WebCore::ContextMenuItem::setType):
        (WebCore::ContextMenuItem::action):
        (WebCore::ContextMenuItem::setAction):
        (WebCore::ContextMenuItem::platformSubMenu):
        (WebCore::ContextMenuItem::setSubMenu):
        (WebCore::ContextMenuItem::setChecked):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Regression: backspace stopped working on text inputs
        - Replaced the use of editor command "BackwardDelete" with "DeleteBackward" since it's no longer supported.

        Reviewed by Adam.

        * WebEditorClient.cpp:
        (WebEditorClient::textWillBeDeletedInTextField):
        * WebView.cpp:



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

        This fixes pageup/down in iframes.  test for this is fast/frames/iframe-scroll-page-up-down.html

        * WebView/WebHTMLView.mm:
        (-[WebHTMLView doCommandBySelector:]):
        Have the editor handle all the commands it supports instead of just text commands.
        If not handled by the editor, the webview will handle the command. 



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

        http://bugs.webkit.org/show_bug.cgi?id=10909
        Hixie's XMLHttpRequest/018.html test fails

        This was fixed earlier, just adding a test case.

        * http/tests/xmlhttprequest/web-apps/018-expected.txt: Added.
        * http/tests/xmlhttprequest/web-apps/018.html: Added.
        * http/tests/xmlhttprequest/web-apps/resources: Added.
        * http/tests/xmlhttprequest/web-apps/resources/018-test.xml: Added.



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

        Pass the prototype of WebCore JS objects up the constructor chain
        rather than explicitly setting using setPrototype.  This removes many
        redundant settings of the prototype on construction.  To avoid a CG 
        hazard, the prototype must be constructed before before calling the
        constructor of the JS object.

        - JS objects that inherit from DOMObject, which all bindings objects
          (except Window) do, now can't implicitly have a jsNull prototype, but
          must explicitly pass it up the construction chain.

        * bindings/js/JSCSSRuleCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSCSSValueCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSEventCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSEventTargetNode.cpp:
        (WebCore::JSEventTargetNode::JSEventTargetNode):
        * bindings/js/JSEventTargetNode.h:
        * bindings/js/JSHTMLAllCollection.h:
        (WebCore::JSHTMLAllCollection::JSHTMLAllCollection):
        * bindings/js/JSHTMLAudioElementConstructor.cpp:
        (WebCore::JSHTMLAudioElementConstructor::JSHTMLAudioElementConstructor):
        * bindings/js/JSHTMLCollectionCustom.cpp:
        (WebCore::getNamedItems):
        (WebCore::toJS):
        * bindings/js/JSHTMLElementWrapperFactory.cpp:
        (WebCore::createJSHTMLWrapper):
        * bindings/js/JSHTMLFormElementCustom.cpp:
        (WebCore::JSHTMLFormElement::nameGetter):
        * bindings/js/JSHTMLInputElementBase.cpp:
        (WebCore::JSHTMLInputElementBase::JSHTMLInputElementBase):
        * bindings/js/JSHTMLInputElementBase.h:
        * bindings/js/JSHTMLOptionElementConstructor.cpp:
        (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
        * bindings/js/JSLocation.cpp:
        (WebCore::JSLocation::JSLocation):
        * bindings/js/JSLocation.h:
        * bindings/js/JSNamedNodesCollection.cpp:
        (WebCore::JSNamedNodesCollection::JSNamedNodesCollection):
        * bindings/js/JSNamedNodesCollection.h:
        * bindings/js/JSNodeCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSSVGElementWrapperFactory.cpp:
        (WebCore::createJSSVGWrapper):
        * bindings/js/JSSVGPathSegCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSStyleSheetCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSXMLHttpRequest.cpp:
        (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
        (KJS::JSXMLHttpRequestConstructorImp::construct):
        (KJS::JSXMLHttpRequest::JSXMLHttpRequest):
        * bindings/js/JSXMLHttpRequest.h:
        * bindings/js/JSXSLTProcessor.cpp:
        (KJS::JSXSLTProcessor::JSXSLTProcessor):
        (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
        (KJS::XSLTProcessorConstructorImp::implementsConstruct):
        (KJS::XSLTProcessorConstructorImp::construct):
        * bindings/js/JSXSLTProcessor.h:
        * bindings/js/kjs_binding.h:
        (KJS::DOMObject::DOMObject):
        (KJS::cacheDOMObject):
        (KJS::cacheSVGDOMObject):
        * bindings/js/kjs_css.cpp:
        (WebCore::JSRGBColor::JSRGBColor):
        (WebCore::getJSRGBColor):
        * bindings/js/kjs_css.h:
        * bindings/js/kjs_events.cpp:
        (WebCore::JSClipboard::JSClipboard):
        (WebCore::toJS):
        * bindings/js/kjs_events.h:
        * bindings/js/kjs_html.cpp:
        (WebCore::ImageConstructorImp::ImageConstructorImp):
        * bindings/js/kjs_navigator.cpp:
        (KJS::Navigator::Navigator):
        (KJS::PluginBase::PluginBase):
        * bindings/js/kjs_navigator.h:
        * bindings/js/kjs_window.cpp:
        (KJS::Window::Window):
        (KJS::Window::location):
        (KJS::Window::getValueProperty):
        * bindings/js/kjs_window.h:
        * bindings/scripts/CodeGeneratorJS.pm:



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

        Fixed: <rdar://problem/4106190> Include "Where from" metadata in drag-and-dropped images
        
        * Misc/WebNSFileManagerExtras.h:
        * Misc/WebNSFileManagerExtras.m:
        (-[NSFileManager _webkit_setMetadataURL:referrer:atPath:]): Added new method. Uses WebKitSystemInterface to set
        "Where from:" metadata information.
        * WebView/WebHTMLView.mm:
        (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Added "Where from:" metadata for drag and dropped images.


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

        * Scripts/update-webkit: Make this work a little better for the people at Apple
        who have a directory named Internal.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Replaced the use of editor command "ForwardDelete" with "DeleteForward" to be consistent
        with our use of "DeleteBackward".

        Rubber-stamped by Jon.

        * WebView.cpp:



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

        Reviewed by Mitz.

        - fix http://bugs.webkit.org/show_bug.cgi?id=16723
          tables/mozilla/bugs/bug30418.html test failing due to problems updating dynamic border rules

        Test: fast/table/border-changes.html

        * html/HTMLTableElement.h:
        * html/HTMLTableElement.cpp:
        (WebCore::HTMLTableElement::parseMappedAttribute): Check the border type before and after
        parsing attributes, rather than doing this only for the rules attribute.
        (WebCore::HTMLTableElement::cellBorders): Added.
        (WebCore::HTMLTableElement::getSharedCellDecl): Changed to use cellBorders to factor out the
        rule about what type of borders to use.

LayoutTests:

        Reviewed by Mitz.

        - test for http://bugs.webkit.org/show_bug.cgi?id=16723
          tables/mozilla/bugs/bug30418.html test failing due to problems updating dynamic border rules

        * fast/table/border-changes-expected.txt: Added.
        * fast/table/border-changes.html: Added.
        * fast/table/resources: Added.
        * fast/table/resources/TEMPLATE.html: Added.
        * fast/table/resources/border-changes.js: Added.



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

        Reviewed by Darin, Mitz.

        fixed <rdar://5130762> mousedowns in different locations increase the clickcount incorrectly

        the clickcount should not increase if the last click was at a different location.  it's a new click.

        * DumpRenderTree/mac/DumpRenderTree.mm:
        (runTest):
        * DumpRenderTree/mac/EventSendingController.h:
        * DumpRenderTree/mac/EventSendingController.mm:
        (-[EventSendingController mouseDown]):
        (-[EventSendingController mouseUp]):

LayoutTests:

        Reviewed by Darin, Mitz.

        updating expected results after fixing clickcount for 
        <rdar://5130762> mousedowns in different locations increase the clickcount incorrectly

        * fast/forms/focus-selection-input-expected.txt:
        * fast/forms/focus-selection-textarea-expected.txt:
        * platform/mac/fast/events/objc-event-api-expected.txt:
        * platform/mac/fast/inline/dirtyLinesForInline-expected.txt:
        * platform/mac/fast/text/textIteratorNilRenderer-expected.txt:
        * platform/mac/svg/custom/pointer-events-image-expected.txt:
        * platform/mac/svg/custom/pointer-events-path-expected.txt:
        * platform/mac/svg/custom/pointer-events-text-expected.txt:
        * platform/mac/svg/custom/text-hit-test-expected.txt:



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

        - fix http://bugs.webkit.org/show_bug.cgi?id=16548
          <rdar://problem/5659452> REGRESSION(r28810): Font style and sizes are weird for Japanese text

        * platform/graphics/win/FontCacheWin.cpp:
        (WebCore::linkedFontEnumProc): Added. This callback is used to fetch
        a valid LOGFONT for a given family.
        (WebCore::getLinkedFonts): Added. Returns a vector of font families
        linked to the given font family by the Windows registry key
        HKLM\Software\...\FontLink\SystemLink. The registry values typically
        differ based on the installed language version of Windows.
        (WebCore::FontCache::getFontDataForCharacters): Changed to not use MLang
        font mapping, which is Windows code page based, except for characters in
        the range U+2000..U+200F. Instead, this function gets the font Uniscribe
        would use for the character. However, that font might not actually
        contain the character, in which case GDI font linking would substitute a
        different font. Therefore, this function walks the linked font list
        until it finds a font that actually contains the character.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Update libraries for <rdar://problem/4106190> Include "Where from" metadata in drag-and-dropped images

        * WebKitSystemInterface.h:
        * libWebKitSystemInterfaceLeopard.a:
        * libWebKitSystemInterfaceTiger.a:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-01-03  Jon Honeycutt  <jhoneycutt@apple.com>

        Reviewed by Darin.

        <rdar://problem/5504775> PDF page will not load first time after Adobe
        Reader install, unless browser is relaunched

        Refresh and re-search the plugin database if the MIME type is not
        registered.

        * plugins/win/PluginDatabaseWin.cpp:
        (WebCore::PluginDatabaseWin::isMIMETypeRegistered):
        * plugins/win/PluginDatabaseWin.h:




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

        - skip tests that are failing because font fallback results in a
          different font being used on Windows than on Mac.

        * platform/win/Skipped:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update Tiger library to a G3-friendly version.


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