2008-10-20  David Hyatt  <hyatt@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=21751

        Convert checkboxes and radio buttons on OS X over to the new Theme API.

        Reviewed by Adam Roben

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::mapFillSize):
        * platform/Length.h:
        (WebCore::LengthSize::LengthSize):
        (WebCore::LengthSize::operator==):
        (WebCore::LengthSize::width):
        (WebCore::LengthSize::height):
        (WebCore::LengthSize::setWidth):
        (WebCore::LengthSize::setHeight):
        * platform/Theme.h:
        (WebCore::Theme::controlSize):
        (WebCore::Theme::controlSupportsBorder):
        (WebCore::Theme::controlSupportsPadding):
        (WebCore::Theme::paint):
        (WebCore::Theme::inflateControlPaintRect):
        * platform/ThemeTypes.h:
        (WebCore::):
        * platform/mac/ThemeMac.h:
        * platform/mac/ThemeMac.mm:
        (WebCore::):
        (WebCore::controlSizeForFont):
        (WebCore::sizeFromFont):
        (WebCore::setControlSize):
        (WebCore::updateStates):
        (WebCore::inflateRect):
        (WebCore::checkboxSizes):
        (WebCore::checkboxMargins):
        (WebCore::checkboxSize):
        (WebCore::checkbox):
        (WebCore::paintCheckbox):
        (WebCore::radioSizes):
        (WebCore::radioMargins):
        (WebCore::radioSize):
        (WebCore::radio):
        (WebCore::paintRadio):
        (WebCore::ThemeMac::baselinePositionAdjustment):
        (WebCore::ThemeMac::controlSize):
        (WebCore::ThemeMac::controlSupportsBorder):
        (WebCore::ThemeMac::controlSupportsPadding):
        (WebCore::ThemeMac::inflateControlPaintRect):
        (WebCore::ThemeMac::paint):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::calculateBackgroundSize):
        * rendering/RenderObject.cpp:
        (WebCore::mustRepaintFillLayers):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustStyle):
        (WebCore::RenderTheme::paint):
        (WebCore::RenderTheme::baselinePosition):
        (WebCore::RenderTheme::adjustRepaintRect):
        (WebCore::RenderTheme::controlStatesForRenderer):
        (WebCore::RenderTheme::isFocused):
        * rendering/RenderTheme.h:
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::adjustRepaintRect):
        * rendering/style/FillLayer.cpp:
        (WebCore::FillLayer::operator==):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Alp Toker  <alp@nuanti.com>

        Reviewed by Mark Rowe.

        Use pthread instead of GThread where possible in the GTK+ port. This
        fixes issues with global initialisation, particularly on GTK+/Win32
        where a late g_thread_init() will cause hangs.

        Fix the pthread conditionals in the FTP code to correctly define
        threadsafe *_r functions on Windows. Partly fixes the GTK+/Win32
        build.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Alp Toker  <alp@nuanti.com>

        Rubber-stamped by Mark Rowe.

        Typo fix in function name: mimimum -> minimum.

        * kjs/DateMath.cpp:
        (JSC::minimumYearForDST):
        (JSC::equivalentYearForDST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Geoffrey Garen  <ggaren@apple.com>

        Not reviewed.
        
        Re-enable CTI, which I accidentally disabled while checking in fixes
        to bytecode.

        * wtf/Platform.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  David Hyatt  <hyatt@apple.com>

        Avoid some stderr spew from CG by checking if we have a decoder yet in ImageSourceCG.

        Reviewed by Darin Adler

        * platform/graphics/cg/ImageSourceCG.cpp:
        (WebCore::ImageSource::repetitionCount):
        (WebCore::ImageSource::frameDurationAtIndex):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Anders Carlsson.

        * VM/Machine.cpp:
        (JSC::Machine::tryCacheGetByID): Removed a redundant and sometimes
        incorrect cast, which started ASSERTing after Darin's last checkin.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bug 21721: 1 crash in Safari at com.apple.WebCore • WebCore::RenderTableSection::numColumns const + 12



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Alp Toker  <alp@nuanti.com>

        Partial GTK+/Win32 build fix. Lowercase library name to enable linking
        when cross-compiling Windows binaries from Linux: -lWs2_32 -> -lws2_32

        * configure.ac:


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

        - make hasARenderedDescendant() have internal linkage

        * editing/CompositeEditCommand.cpp:
        (WebCore::hasARenderedDescendant):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  David Hyatt  <hyatt@apple.com>

        https://bugs.webkit.org/show_bug.cgi?id=21733

        Make sure that the haveMetadata flag is set to true for generated images from image buffers, so that
        no attempt is made to re-cache the frame from a non-existent image source.

        Reviewed by Sam Weinig

        * platform/graphics/cairo/ImageCairo.cpp:
        (WebCore::BitmapImage::BitmapImage):
        * platform/graphics/cg/ImageCG.cpp:
        (WebCore::BitmapImage::BitmapImage):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Make the Resource panel perform graph updates atomically, so when resources
        are added the graph and summary graph update at the same time.

        https://bugs.webkit.org/show_bug.cgi?id=21755

        Reviewed by Kevin McCullough.

        * inspector/front-end/Resource.js:
        (WebInspector.Resource.prototype.get startTime): Return -1 if the _startTime
        property is undefined, null or 0. This allows callers to check for -1 and not
        the other values when there is no startTime yet.
        (WebInspector.Resource.prototype.get responseReceivedTime): Ditto.
        (WebInspector.Resource.prototype.get endTime): Ditto.
        (WebInspector.Resource.prototype.get duration): Remove an extra empty line.
        (WebInspector.Resource.prototype.get latency): Ditto.
        (WebInspector.Resource.prototype.get contentLength): Return 0 if the _duration
        property is undefined or null. This allows callers to always assume a number.
        (WebInspector.Resource.prototype.get expectedContentLength): Ditto.
        (WebInspector.Resource.prototype.get errors): Simplify the case where there is
        no _errors property yet.
        (WebInspector.Resource.prototype.set errors): Remove the check if the new value
        if the same as the previous value, since there is no work to guard.
        (WebInspector.Resource.prototype.get warnings): Simplify the case where there is
        no _warnings property yet.
        (WebInspector.Resource.prototype.set warnings): Remove the check if the new value
        if the same as the previous value, since there is no work to guard.
        (WebInspector.Resource.CompareByResponseReceivedTime): Add cases for when the
        responseReceivedTime is -1.
        (WebInspector.Resource.CompareByEndTime): Add cases for when the endTime is -1.
        * inspector/front-end/ResourcesPanel.js:
        (WebInspector.ResourcesPanel.prototype.get searchableViews): If a resource does not
        have a _resourcesTreeElement yet, exclude it from the searchable views.
        (WebInspector.ResourcesPanel.prototype.set calculator): Set _staleResource to _resources
        and call refresh to refresh the entire graph.
        (WebInspector.ResourcesPanel.prototype.set needsRefresh): Set a timeout if the panel
        is visible that calls refresh.
        (WebInspector.ResourcesPanel.prototype.refresh): Create the resource tree element and
        graph for a resource if it hasn't been created yet. If the boundaries changed during
        the first stale resource pass, do a full pass of all resources when updating the graphs.
        (WebInspector.ResourcesPanel.prototype.reset): Remove the legend items.
        (WebInspector.ResourcesPanel.prototype.addResource): Don't create the tree element and
        graph, these are now created during the first refresh.
        (WebInspector.ResourcesPanel.prototype.removeResource): Null check _resourcesTreeElement.
        (WebInspector.ResourcesPanel.prototype.addMessageToResource): Ditto.
        (WebInspector.ResourcesPanel.prototype.clearMessages): Ditto.
        (WebInspector.ResourcesPanel.prototype.refreshResource): Remove most of the work, just
        add the resource to the _staleResources and set needsRefresh.
        (WebInspector.ResourcesPanel.prototype.recreateViewForResourceIfNeeded): Null check
        _resourcesTreeElement.
        (WebInspector.ResourcesPanel.prototype._sortResourcesIfNeeded): Remove code to clear
        the timeout used by the deleted _sortResourcesSoonIfNeeded. Remove call to removeChild
        since the insertBefore call will do it if needed.
        (WebInspector.ResourcesPanel.prototype._updateGraphDividersIfNeeded): Remove code to
        clear the timeout used by the deleted _updateGraphDividersSoonIfNeeded.
        (WebInspector.ResourcesPanel.prototype._updateSummaryGraph): Remove code to clear the
        timeout used by the deleted _updateSummaryGraphSoon. No need to remove the totalLegendLabel,
        since all the legend items are removed in one pass right before.
        (WebInspector.ResourcesPanel.prototype._changeSortingFunction): Set the sortingFunction
        before the calculator so the correct sortingFunction is there when a refresh happens.
        (WebInspector.ResourceTimeCalculator.prototype.computeBarGraphPercentages): Set start to 0
        when the startTime is -1, since that looks best visually. Also set middle and end
        to the start and middle (respectfully) when startAtZero. This looks best visually.
        (WebInspector.ResourceGraph): Start the graph as hidden until the first refresh.
        (WebInspector.ResourceGraph.prototype.refresh): Remove the hidden class.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  David Hyatt  <hyatt@apple.com>

        Rename LengthBox's members to have m_ in front of them.

        Reviewed by Sam Weinig

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::valueForNinePieceImage):
        (WebCore::getPositionOffsetValue):
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::mapNinePieceImage):
        * platform/Length.h:
        (WebCore::LengthBox::LengthBox):
        (WebCore::LengthBox::left):
        (WebCore::LengthBox::right):
        (WebCore::LengthBox::top):
        (WebCore::LengthBox::bottom):
        (WebCore::LengthBox::operator==):
        (WebCore::LengthBox::nonZero):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::paintNinePieceImage):
        (WebCore::RenderObject::addDashboardRegions):
        * rendering/style/RenderStyle.cpp:
        (WebCore::positionedObjectMoved):
        (WebCore::RenderStyle::setClip):
        (WebCore::RenderStyle::noneDashboardRegions):
        * rendering/style/RenderStyle.h:
        (WebCore::InheritedFlags::left):
        (WebCore::InheritedFlags::right):
        (WebCore::InheritedFlags::top):
        (WebCore::InheritedFlags::bottom):
        (WebCore::InheritedFlags::clipLeft):
        (WebCore::InheritedFlags::clipRight):
        (WebCore::InheritedFlags::clipTop):
        (WebCore::InheritedFlags::clipBottom):
        (WebCore::InheritedFlags::marginTop):
        (WebCore::InheritedFlags::marginBottom):
        (WebCore::InheritedFlags::marginLeft):
        (WebCore::InheritedFlags::marginRight):
        (WebCore::InheritedFlags::paddingTop):
        (WebCore::InheritedFlags::paddingBottom):
        (WebCore::InheritedFlags::paddingLeft):
        (WebCore::InheritedFlags::paddingRight):
        (WebCore::InheritedFlags::setLeft):
        (WebCore::InheritedFlags::setRight):
        (WebCore::InheritedFlags::setTop):
        (WebCore::InheritedFlags::setBottom):
        (WebCore::InheritedFlags::setDashboardRegion):
        (WebCore::InheritedFlags::setClipLeft):
        (WebCore::InheritedFlags::setClipRight):
        (WebCore::InheritedFlags::setClipTop):
        (WebCore::InheritedFlags::setClipBottom):
        (WebCore::InheritedFlags::setMarginTop):
        (WebCore::InheritedFlags::setMarginBottom):
        (WebCore::InheritedFlags::setMarginLeft):
        (WebCore::InheritedFlags::setMarginRight):
        (WebCore::InheritedFlags::setPaddingTop):
        (WebCore::InheritedFlags::setPaddingBottom):
        (WebCore::InheritedFlags::setPaddingLeft):
        (WebCore::InheritedFlags::setPaddingRight):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  David Hyatt  <hyatt@apple.com>

        Clean up some USE(NEW_THEME) ifdefs (I botched one of them and have broken non-Mac platforms).  Also
        refactor some of the code that I put in ThemeMac to be cross-platform, since it was in RenderTheme.cpp
        originally.

        ifdef some methods in RenderTheme.cpp also that are no longer needed with the new Theme.

        Reviewed by Adam Roben

        * WebCore.xcodeproj/project.pbxproj:
        * platform/Theme.cpp: Added.
        (WebCore::Theme::controlSupportsBorder):
        (WebCore::Theme::controlSupportsPadding):
        * platform/Theme.h:
        * platform/mac/ThemeMac.h:
        * platform/mac/ThemeMac.mm:
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustStyle):
        * rendering/RenderTheme.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Alp Toker  <alp@nuanti.com>

        Fix autotools dist build target by listing recently added header
        files only. Not reviewed.


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

        * WebCore.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Sam Weinig  <sam@webkit.org>

        Rubber-stamped by David Hyatt.

        Split LengthBox and LengthSize into their own files.

        * GNUmakefile.am:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/Length.h:
        (WebCore::Length::blend):
        * platform/LengthBox.h: Copied from platform/Length.h.
        (WebCore::LengthBox::LengthBox):
        (WebCore::LengthBox::nonZero):
        * platform/LengthSize.h: Copied from platform/Length.h.
        (WebCore::LengthSize::LengthSize):
        (WebCore::LengthSize::setWidth):
        (WebCore::LengthSize::setHeight):
        (WebCore::LengthSize::height):
        * platform/Theme.h:
        * rendering/style/FillLayer.h:
        * rendering/style/NinePieceImage.h:
        (WebCore::NinePieceImage::NinePieceImage):
        * rendering/style/RenderStyle.h:
        * rendering/style/StyleDashboardRegion.h:
        * rendering/style/StyleSurroundData.h:
        * rendering/style/StyleVisualData.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-16  Sam Weinig  <sam@webkit.org>

        Reviewed by Cameron Zwarich.

        Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
        Don't create intermediate StructureIDs for builtin objects

        Second stage in reduce number of StructureIDs created when initializing the
        JSGlobalObject.

        - Use putDirectWithoutTransition for the remaining singleton objects to reduce
          the number of StructureIDs create for about:blank from 132 to 73.

        * kjs/ArrayConstructor.cpp:
        (JSC::ArrayConstructor::ArrayConstructor):
        * kjs/BooleanConstructor.cpp:
        (JSC::BooleanConstructor::BooleanConstructor):
        * kjs/BooleanPrototype.cpp:
        (JSC::BooleanPrototype::BooleanPrototype):
        * kjs/DateConstructor.cpp:
        (JSC::DateConstructor::DateConstructor):
        * kjs/ErrorConstructor.cpp:
        (JSC::ErrorConstructor::ErrorConstructor):
        * kjs/ErrorPrototype.cpp:
        (JSC::ErrorPrototype::ErrorPrototype):
        * kjs/FunctionConstructor.cpp:
        (JSC::FunctionConstructor::FunctionConstructor):
        * kjs/FunctionPrototype.cpp:
        (JSC::FunctionPrototype::FunctionPrototype):
        (JSC::FunctionPrototype::addFunctionProperties):
        * kjs/FunctionPrototype.h:
        (JSC::FunctionPrototype::createStructureID):
        * kjs/InternalFunction.cpp:
        * kjs/InternalFunction.h:
        (JSC::InternalFunction::InternalFunction):
        * kjs/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::reset):
        * kjs/JSObject.h:
        * kjs/MathObject.cpp:
        (JSC::MathObject::MathObject):
        * kjs/NumberConstructor.cpp:
        (JSC::NumberConstructor::NumberConstructor):
        * kjs/NumberPrototype.cpp:
        (JSC::NumberPrototype::NumberPrototype):
        * kjs/ObjectConstructor.cpp:
        (JSC::ObjectConstructor::ObjectConstructor):
        * kjs/RegExpConstructor.cpp:
        (JSC::RegExpConstructor::RegExpConstructor):
        * kjs/RegExpPrototype.cpp:
        (JSC::RegExpPrototype::RegExpPrototype):
        * kjs/StringConstructor.cpp:
        (JSC::StringConstructor::StringConstructor):
        * kjs/StringPrototype.cpp:
        (JSC::StringPrototype::StringPrototype):
        * kjs/StructureID.cpp:
        (JSC::StructureID::dumpStatistics):
        * kjs/StructureID.h:
        (JSC::StructureID::setPrototypeWithoutTransition):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Adele Peterson  <adele@apple.com>

        Reviewed by Darin Adler.

        * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::formData):
        Removed stray increment that would screw up any form with multiple files in it.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Beth Dakin  <bdakin@apple.com>

        Reviewed by Adele Peterson.

        Speculative fix for <rdar://problem/6242585> CrashTracer: [USER] 19 
        crashes in Safari at com.apple.WebCore
        WebCore::ScrollView::visibleContentRect const + 153

        d->m_view can be null and is null-checked at other points in the 
        code. The logs indicate that this crash occurs when closing a 
        window containing a PDF, so in case where we crash, the PDF's view 
        is probably already null. So the fix is to simply add a null-check.

        * page/Frame.cpp:
        (WebCore::Frame::selectionRect):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-10-20  Cameron Zwarich  <zwarich@apple.com>

        Rubber-stamped by Sam Weinig.

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


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