Reviewed by David Kilzer.

        http://bugs.webkit.org/show_bug.cgi?id=17201
        Bug 17201: Use RefPtr in CSSParser::parseFont() to get rid of goto silliness

        Gets rid of goto usage in parseFont.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Fix for bug 17286, crash accessing a null RenderStyle.  Add a simple null check.

        Reviewed by aroben

        Added fast/css/empty-generated-content.html

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::checkOneSelector):



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

        <rdar://problem/5733069> Many m_quotaMap uses do not hold the m_quotaMapGuard

        * storage/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::hasEntryForOrigin): Hold m_quotaMapGuard when using m_quotaMap.
        (WebCore::DatabaseTracker::origins): Ditto.
        (WebCore::DatabaseTracker::setQuota): Ditto.
        (WebCore::DatabaseTracker::deleteAllDatabases): Call origins() and itterate over the
        origins to call deleteOrigin().
        (WebCore::DatabaseTracker::deleteOrigin): Hold m_quotaMapGuard when using m_quotaMap.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30154 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2008-02-11  Pierre-Luc Beaudoin  <pierre-luc.beaudoin@collabora.co.uk>

        Reviewed by Alp Toker.

        Add my blog's WebKit category, English only posts.

        * config.ini:


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

        Reviewed by Mitz.

        - fix <rdar://problem/5726016> REGRESSION: Xcode News window renders
          incorrectly due to visibility fix

        Added an Xcode-specific quirk.

        * WebCore.base.exp: Added export for new Settings function.
        * css/CSSMutableStyleDeclaration.cpp:
        (WebCore::CSSMutableStyleDeclaration::setProperty): Here's the crazy quirk.
        If you try to change the visibilty on a node with the class name tab_content,
        instead it will use display:none.
        * page/Settings.cpp:
        (WebCore::Settings::Settings): Initialize m_needsXcodeVisibilityQuirk. Also
        initialize m_fontRenderingMode! This seems like it was a bug before, but we
        probably were getting lucky and always getting 0 on Windows, which is the
        only place the setting matters.
        (WebCore::Settings::setNeedsXcodeVisibilityQuirk): Added.
        * page/Settings.h:
        (WebCore::Settings::needsXcodeVisibilityQuirk): Added.

WebKit/mac:

        Reviewed by Mitz.

        - fix <rdar://problem/5726016> REGRESSION: Xcode News window renders
          incorrectly due to visibility fix

        Added an Xcode-specific quirk.

        * Misc/WebKitVersionChecks.h: Added a constant for the "linked on or after"
        part of the check.

        * WebView/WebView.mm:
        (-[WebView _needsXcodeVisibilityQuirk]): Added.
        (-[WebView _preferencesChangedNotification:]): Added a call to
        setNeedsXcodeVisibilityQuirk based on _needsXcodeVisibilityQuirk.



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

        Reviewed by Darin Adler.

        Make the cross-domain security model more closely match Firefox by always returning the
        native built-in functions when accessing functions cross-domain.

        Fixes for:
        <rdar://problem/5735497> Match Firefox's cross-domain model more accurately by return the built-in version of functions even if they have been overridden
        <rdar://problem/5735443> Crash when setting the Window objects prototype to a custom Object and then calling a method on it

        Tests: fast/dom/Window/window-custom-prototype-crash.html
               fast/dom/Window/window-function-frame-getter-precedence.html
               http/tests/security/cross-frame-access-get-override.html
               http/tests/security/cross-frame-access-location-get-override.html
               http/tests/security/cross-frame-access-location-get.html
               http/tests/security/cross-frame-access-location-put.html

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::customGetOwnPropertySlot):
        - Return the native-built in version of an cross-domain allowed function (eg. window.focus) whether or
          not it has been overridden, instead of undefined.
        - When doing findEntry lookup, use the the tables directly (JSDOMWindowPrototype::info.propHashTable) 
          instead of calling the virtual classInfo() method to avoid the unnecessary overhead.
        - Allow access to the native toString function cross-domain.  It always returns "[object Window]".
        - Use the new nonCachingStaticFunctionGetter when return allowed functions cross-frame so that
          the function an overridden function is not inadvertantly returned from the PropertyMap.\

        * bindings/js/JSHistoryCustom.cpp:
        (WebCore::JSHistory::customGetOwnPropertySlot):
        - Implement the same model as described above for the History object, always returning the
          native built-in function cross-domain.
        - Allow access to the native toString function cross-domain.
        - Clean up the code to make it clear that the custom functionality is only there for cross-domain
          access.

        * bindings/js/JSLocation.cpp:
        (WebCore::JSLocation::getOwnPropertySlot):
        - Match the generated classes by moving all the custom logic into a separate customGetOwnPropertySlot
          function.  This will help moving to a generated class in the future.
        (WebCore::JSLocation::customGetOwnPropertySlot):
        - Implement the same model as described above for the Location object, always returning the
          native built-in function cross-domain.
        - Clean up the code to make it clear that the custom functionality is only there for cross-domain
          access.
        (WebCore::JSLocation::put):
        (WebCore::JSLocation::deleteProperty):
        (WebCore::JSLocation::getPropertyNames):
        * bindings/js/JSLocation.h:
        - Clean up to match the rest of the file a little better.

        * bindings/js/kjs_binding.cpp:
        (WebCore::allowsAccessFromFrame):
        (WebCore::printErrorMessageForFrame):
        (WebCore::nonCachingStaticFunctionGetter):
        (WebCore::objectToStringFunctionGetter):
        * bindings/js/kjs_binding.h:
        - Put common functionality related to cross-domain access here to serve as a central shared point.
          This includes moving and augmenting the allowsAccessFromFrame method that was in both JSHistoryCustom.cpp
          and JSLocation.cpp.

        * bindings/js/kjs_dom.cpp:
        (WebCore::checkNodeSecurity):
        - Use the new allowsAccessFromFrame method.

        * bindings/js/kjs_window.cpp:
        (KJS::Window::childFrameGetter): Cleanup.
        (KJS::Window::namedItemGetter): Cleanup.
        (KJS::Window::getOwnPropertySlot):
        - Do the prototype lookup early to match Firefox in having function lookup have a higher precedence
          than the index or shortcut name getters.
        - Cleanup function to make it more understandable and slightly more efficient.
        (KJS::Window::allowsAccessFrom):
        - Add a new variant of this method that takes a reference to a String, which, on failure, will
          contain the error message to print out.  The caller can then pass this to printErrorMessage.
          This allows for code to check allowsAccessFrom and act on the result without printing out the
          error message. For convenience, a version with out the String parameter has been left which 
          prints out the message automatically.
        (KJS::Window::printErrorMessage):
        * bindings/js/kjs_window.h:

LayoutTests:

        Reviewed by Darin Adler.

        Tests for:
        <rdar://problem/5735497> Match Firefox's cross-domain model more accurately by return the built-in version of functions even if they have been overridden
        <rdar://problem/5735443> Crash when setting the Window objects prototype to a custom Object and then calling a method on it

        * fast/dom/Window/resources/WindowProperties.js: Added.
        * fast/dom/Window/window-custom-prototype-crash-expected.txt: Added.
        * fast/dom/Window/window-custom-prototype-crash.html: Added.
        * fast/dom/Window/window-function-frame-getter-precedence-expected.txt: Added.
        * fast/dom/Window/window-function-frame-getter-precedence.html: Added.
        * fast/dom/Window/window-function-name-getter-precedence-expected.txt:
        * fast/dom/Window/window-function-name-getter-precedence.html:
        * http/tests/security/cross-frame-access-custom-expected.txt:
        * http/tests/security/cross-frame-access-custom.html:
        * http/tests/security/cross-frame-access-get-override-expected.txt: Added.
        * http/tests/security/cross-frame-access-get-override.html: Added.
        * http/tests/security/cross-frame-access-history-get-override-expected.txt:
        * http/tests/security/cross-frame-access-history-get-override.html:
        * http/tests/security/cross-frame-access-history-put-expected.txt:
        * http/tests/security/cross-frame-access-history-put.html:
        * http/tests/security/cross-frame-access-location-expected.txt: Removed.
        * http/tests/security/cross-frame-access-location-get-expected.txt: Added.
        * http/tests/security/cross-frame-access-location-get-override-expected.txt: Added.
        * http/tests/security/cross-frame-access-location-get-override.html: Added.
        * http/tests/security/cross-frame-access-location-get.html: Copied from http/tests/security/cross-frame-access-location.html.
        * http/tests/security/cross-frame-access-location-put-expected.txt: Added.
        * http/tests/security/cross-frame-access-location-put.html: Added.
        * http/tests/security/cross-frame-access-location.html: Removed.
        * http/tests/security/resources/cross-frame-iframe-for-get-override-test.html: Added.
        * http/tests/security/resources/cross-frame-iframe-for-get-test.html:
        * http/tests/security/resources/cross-frame-iframe-for-history-put-test.html:
        * http/tests/security/resources/cross-frame-iframe-for-location-get-override-test.html: Added.
        * http/tests/security/resources/cross-frame-iframe-for-location-get-test.html: Added.
        * http/tests/security/resources/cross-frame-iframe-for-location-put-test.html: Added.



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

        Fixes for:
        <rdar://problem/5735497> Match Firefox's cross-domain model more accurately by return the built-in version of functions even if they have been overridden
        <rdar://problem/5735443> Crash when setting the Window objects prototype to a custom Object and then calling a method on it

        - Expose the native Object.prototype.toString implementation so that it can be used for cross-domain
          toString calling.

        * JavaScriptCore.exp:
        * kjs/object_object.cpp:
        * kjs/object_object.h:



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

        Reviewed by Dave Hyatt.

        - fix http://bugs.webkit.org/show_bug.cgi?id=17320
          <rdar://problem/5736953> :last-child does not set the "uses sibling rules" flag

        Test: fast/css/last-child-style-sharing.html

        * css/CSSGrammar.y: Changed to call setUsesSiblingRules(true) for all
        CSS3 selectors that require it.

LayoutTests:

        Reviewed by Dave Hyatt.

        - test for http://bugs.webkit.org/show_bug.cgi?id=17320
          <rdar://problem/5736953> :last-child does not set the "uses sibling rules" flag

        * fast/css/last-child-style-sharing.html: Added.
        * platform/mac/fast/css/last-child-style-sharing-expected.checksum: Added.
        * platform/mac/fast/css/last-child-style-sharing-expected.png: Added.
        * platform/mac/fast/css/last-child-style-sharing-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make canvas use an ImageBuffer for its backing store

Reviewed by Alp Toker.

In order to make the canvas implementation less platform dependent
(and thus reduce the current quagmire of ifdefs) we now use an
ImageBuffer to provide the backing buffer, an immediate consequence
of this is to remove multiple ifdefs in the construction of the
buffer.  This patch allows us to further reduce the platform
dependencies in later patches.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to fix qt build


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Yet another attempt to fix Qt


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
more Qt fixes


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Not reviewed, adding missing layout test results (that have been r+ already, but not commited)


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

        Reviewed by Mitz.

        Make the code that sets the image title cross platform.

        * WebCore.xcodeproj/project.pbxproj:
        Remove ImageDocumentMac.
        
        * loader/ImageDocument.cpp:
        (WebCore::ImageTokenizer::finish):

        * loader/mac/ImageDocumentMac.h: Removed.
        * loader/mac/ImageDocumentMac.mm: Removed.
        
        * page/mac/WebCoreFrameBridge.h:
        * page/mac/WebCoreViewFactory.h:
        Move imageTitleForFilename:size from the bridge to
        the view factory.
        
        * platform/LocalizedStrings.h:
        Add imageTitle.
        
        * platform/mac/LocalizedStringsMac.mm:
        (WebCore::imageTitle):
        Have imageTitle call the view factory.
        
        * platform/qt/Localizations.cpp:
        (WebCore::imageTitle):
        * platform/wx/LocalizedStringsWx.cpp:
        (WebCore::imageTitle):
        * platform/gtk/LocalizedStringsGtk.cpp:
        (WebCore::imageTitle):
        Add stubs.

WebKit/mac:

        Reviewed by Mitz.

        * WebCoreSupport/WebFrameBridge.mm:
        * WebCoreSupport/WebViewFactory.mm:
        (-[WebViewFactory imageTitleForFilename:size:]):
        Move implementatino from WebFrameBridge to WebViewFactory.

WebKit/win:

        Reviewed by Mitz.

        * WebCoreLocalizedStrings.cpp:
        (WebCore::imageTitle):
        Add stub.



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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Build fix.
        
        * loader/ImageDocument.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 Fix Bug 17328: REGRESSION (r30147): Inspector is unstyled on Windows

 WebCore:

         Fix Bug 17328: REGRESSION (r30147): Inspector is unstyled on Windows

         <http://bugs.webkit.org/show_bug.cgi?id=17328>
         <rdar://5737946>

         Reviewed by Mitz.

         Test: fast/loader/local-css-allowed-in-strict-mode.html

         * platform/network/cf/ResourceResponseCFNet.cpp:
         (WebCore::ResourceResponse::doUpdateResourceResponse): Add a case for
         .css files.

 LayoutTests:

         Add a test for Bug 17328: REGRESSION (r30147): Inspector is unstyled
         on Windows

         <http://bugs.webkit.org/show_bug.cgi?id=17328>
         <rdar://5737946>

         Reviewed by Mitz.

         * fast/loader/local-css-allowed-in-strict-mode-expected.txt: Added.
         * fast/loader/local-css-allowed-in-strict-mode.html: Added.
         * fast/loader/resources/stylesheet.css: Added.


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

        http://bugs.webkit.org/show_bug.cgi?id=17177
        <rdar://problem/5729619> Storage tasks are getting lost

        <rdar://problem/5729445> REGRESSION: Cannot schedule more than one transaction at a time

        <rdar://problem/5729446> Major thread safety issue in Database code

        * platform/MessageQueue.h: Added a thread-safe queue abstraction.

        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        Added MessageQueue.h.

        * dom/Document.cpp:
        (WebCore::Document::~Document): Fixed a race condition resulting in a hanging reference.

        * storage/Database.idl: Fixed parameter declarations to actually match implementation
        (which is custom, so it got out of sync).

        * storage/DatabaseTask.h:
        (WebCore::DatabaseTask::database):
        (WebCore::DatabaseTransactionTask::transaction):
        Changed tasks to hold more information internally. Added helpers for better debug logging.

        * storage/DatabaseTask.cpp:
        (WebCore::DatabaseTask::DatabaseTask):
        (WebCore::DatabaseTask::performTask):
        (WebCore::DatabaseOpenTask::DatabaseOpenTask):
        (WebCore::DatabaseOpenTask::doPerformTask):
        (WebCore::DatabaseOpenTask::debugTaskName):
        (WebCore::DatabaseTransactionTask::DatabaseTransactionTask):
        (WebCore::DatabaseTransactionTask::~DatabaseTransactionTask):
        (WebCore::DatabaseTransactionTask::doPerformTask):
        (WebCore::DatabaseTransactionTask::debugTaskName):
        (WebCore::DatabaseTableNamesTask::DatabaseTableNamesTask):
        (WebCore::DatabaseTableNamesTask::doPerformTask):
        (WebCore::DatabaseTableNamesTask::debugTaskName):
        Implementation for the above.

        (WebCore::DatabaseTask::lockForSynchronousScheduling):
        (WebCore::DatabaseTask::waitForSynchronousCompletion):
        Fixed a potential race condition: if the task completed before we entered a wait, we'd never
        wake up. There was an assertion guarding against this, but no actual guarantee that I could see.

        * storage/DatabaseThread.cpp:
        (WebCore::DatabaseThread::DatabaseThread):
        (WebCore::DatabaseThread::requestTermination):
        (WebCore::DatabaseThread::databaseThread):
        (WebCore::DatabaseThread::scheduleTask):
        (WebCore::DatabaseThread::scheduleImmediateTask):
        (WebCore::DatabaseThread::unscheduleDatabaseTasks):
        * storage/DatabaseThread.h:
        Changed to use MessageQueue.

        * storage/Database.cpp:
        (WebCore::guidMutex):
        (WebCore::guidToVersionMap):
        (WebCore::guidToDatabaseMap):
        (WebCore::Database::openDatabase):
        (WebCore::Database::Database):
        (WebCore::Database::~Database):
        (WebCore::Database::openAndVerifyVersion):
        (WebCore::guidForOriginAndName):
        (WebCore::Database::changeVersion):
        (WebCore::Database::transaction):
        (WebCore::Database::scheduleTransaction):
        (WebCore::Database::scheduleTransactionStep):
        (WebCore::Database::scheduleTransactionCallback):
        (WebCore::Database::version):
        (WebCore::Database::deliverPendingCallback):
        (WebCore::Database::tableNames):
        * storage/Database.h:
        Changed m_transactionQueue to a MessageQueue.
        Got rid of callback tracking - these can take care of themselves.
        Got rid of a DatabaseThread member, as the Document can be asked for it.
        Moved private static members and helpers out of the header.
        Lost CurrentThreadSetter debug helper on the way. We may need to re-add something like that later.

        * storage/SQLTransaction.h:
        * storage/SQLTransaction.cpp: Added a lot of debug logging.
        (WebCore::SQLTransaction::scheduleToRunStatements): Removed "m_currentStatement = 0" assignment,
        as it created a race condition. Everything seems to work better without it, although a real fix
        would be to get rid of this variable - it's evil shared data that isn't even protected in any way.

        * manual-tests/database-threading-stress-test-2.html: Added.
        * manual-tests/database-threading-stress-test.html: Added.



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

        * storage/DatabaseTask.cpp:



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

        - <rdar://problem/5738175> Remove workaround for <rdar://problem/5539388> from post-Tiger builds

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::setShadow):



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