[chromium] Use WEBKIT_IMPLEMENTATION == 1 for webkit_unit_tests
https://bugs.webkit.org/show_bug.cgi?id=90094

Reviewed by Adam Barth.

This patch adds the WEBKIT_IMPLEMENTATION = 1 define to
WebKitUnitTests.gyp. To get it to compile correctly, some string
and URL code was refactored, and GURL types were replaced with KURL types.

* WebKit.gypi:
* WebKitUnitTests.gyp:
* public/WebDOMMessageEvent.h:
(WebKit::WebDOMMessageEvent::WebDOMMessageEvent):
* tests/AssociatedURLLoaderTest.cpp:
* tests/EventListenerTest.cpp:
* tests/FrameTestHelpers.cpp:
(WebKit::FrameTestHelpers::loadFrame):
* tests/FrameTestHelpers.h:
* tests/ListenerLeakTest.cpp:
(WebKit::ListenerLeakTest::RunTest):
* tests/PopupMenuTest.cpp:
* tests/RunAllTests.cpp:
* tests/URLTestHelpers.cpp: Added.
(URLTestHelpers):
(WebKit::URLTestHelpers::registerMockedURLFromBaseURL):
(WebKit::URLTestHelpers::registerMockedURLLoad):
* tests/URLTestHelpers.h: Copied from Source/WebKit/chromium/public/WebDOMMessageEvent.h.
(WebKit):
(URLTestHelpers):
(WebKit::URLTestHelpers::toKURL):
* tests/WebFrameTest.cpp:
* tests/WebPageNewSerializerTest.cpp:
* tests/WebPageSerializerTest.cpp:
* tests/WebViewTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] PagePopupBlackBerry::closePopup() should always clear the pointer in WebPagePrivate
https://bugs.webkit.org/show_bug.cgi?id=90817

Patch by Yong Li <yoli@rim.com> on 2012-07-09
Reviewed by Rob Buis.

PR# 174085.
PagePopupBlackBerry::closePopup() should always clear the pointer in WebPagePrivate to avoid crashes.
This patch also removes unused variable m_parentPopup and its setter.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate): Remove m_parentPopup.
* Api/WebPage_p.h:
(WebPagePrivate):
* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::closePagePopup):
* WebCoreSupport/PagePopupBlackBerry.cpp:
(WebCore::PagePopupBlackBerry::init): Remove the setParentPopup() call.
(WebCore::PagePopupBlackBerry::closePopup): Clear the reference in WebPagePrivate.
* WebCoreSupport/SelectPopupClient.cpp:
(WebCore::SelectPopupClient::setValueAndClosePopup): Add an assert for valid m_element.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Microdata tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=90830

Reviewed by Antti Koivisto.

The bug was caused by SpaceSplitString's not copying on write properly.
Even if there was exactly one owner of the SpaceSplitString, we should still not modify
m_data since m_data is associated with a particular m_keyString in sharedDataMap().

The only situation in which we can safely modify m_data is when m_data's m_keyString is null
meaning that it had been unique'ed. Furthermore, this optimization had not been used for
class lists because class list's refCount is always zero as its ref and deref are forwarded
to the associated Element's ref and deref. This fix re-enables the optimization for class lists.

This behavior change is tested by existing microdata API tests. Without this patch,
some tests such as properties-collection-add-remove-property.html fail on the first run
when several tests were ran in the same WebKit instance.

* dom/SpaceSplitString.h:
(WebCore::SpaceSplitStringData::isUnique):
(WebCore::SpaceSplitString::ensureUnique):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Marked webgl/glsl-conformance tests failing after dependency roll in chromium.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/js/global-constructors.html is flaky and mostly useless
https://bugs.webkit.org/show_bug.cgi?id=90833

Unreviewed, skip flaky and useless test.

* platform/mac/Skipped:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
It should be possible to jettison JIT stub routines even if they are currently running
https://bugs.webkit.org/show_bug.cgi?id=90731

Reviewed by Gavin Barraclough.
        
This gives the GC awareness of all JIT-generated stubs for inline caches. That
means that if you want to delete a JIT-generated stub, you don't have to worry
about whether or not it is currently running: if there is a chance that it might
be, the GC will kindly defer deletion until non-running-ness is proved.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* bytecode/Instruction.h:
(JSC):
(PolymorphicStubInfo):
(JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
(JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
* bytecode/PolymorphicPutByIdList.cpp:
(JSC::PutByIdAccess::fromStructureStubInfo):
* bytecode/PolymorphicPutByIdList.h:
(JSC::PutByIdAccess::transition):
(JSC::PutByIdAccess::replace):
(JSC::PutByIdAccess::stubRoutine):
(PutByIdAccess):
(JSC::PolymorphicPutByIdList::currentSlowPathTarget):
* bytecode/StructureStubInfo.h:
(JSC::StructureStubInfo::reset):
* dfg/DFGRepatch.cpp:
(JSC::DFG::generateProtoChainAccessStub):
(JSC::DFG::tryCacheGetByID):
(JSC::DFG::tryBuildGetByIDList):
(JSC::DFG::tryBuildGetByIDProtoList):
(JSC::DFG::emitPutReplaceStub):
(JSC::DFG::emitPutTransitionStub):
(JSC::DFG::tryCachePutByID):
(JSC::DFG::tryBuildPutByIdList):
* heap/ConservativeRoots.cpp:
(JSC):
(DummyMarkHook):
(JSC::DummyMarkHook::mark):
(JSC::ConservativeRoots::add):
(CompositeMarkHook):
(JSC::CompositeMarkHook::CompositeMarkHook):
(JSC::CompositeMarkHook::mark):
* heap/ConservativeRoots.h:
(JSC):
(ConservativeRoots):
* heap/Heap.cpp:
(JSC::Heap::markRoots):
(JSC::Heap::deleteUnmarkedCompiledCode):
* heap/Heap.h:
(JSC):
(Heap):
* heap/JITStubRoutineSet.cpp: Added.
(JSC):
(JSC::JITStubRoutineSet::JITStubRoutineSet):
(JSC::JITStubRoutineSet::~JITStubRoutineSet):
(JSC::JITStubRoutineSet::add):
(JSC::JITStubRoutineSet::clearMarks):
(JSC::JITStubRoutineSet::markSlow):
(JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
(JSC::JITStubRoutineSet::traceMarkedStubRoutines):
* heap/JITStubRoutineSet.h: Added.
(JSC):
(JITStubRoutineSet):
(JSC::JITStubRoutineSet::mark):
* heap/MachineStackMarker.h:
(JSC):
* interpreter/RegisterFile.cpp:
(JSC::RegisterFile::gatherConservativeRoots):
* interpreter/RegisterFile.h:
(JSC):
* jit/ExecutableAllocator.cpp:
(JSC::DemandExecutableAllocator::DemandExecutableAllocator):
* jit/ExecutableAllocator.h:
(JSC):
* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC):
(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
* jit/GCAwareJITStubRoutine.cpp: Added.
(JSC):
(JSC::GCAwareJITStubRoutine::GCAwareJITStubRoutine):
(JSC::GCAwareJITStubRoutine::~GCAwareJITStubRoutine):
(JSC::GCAwareJITStubRoutine::observeZeroRefCount):
(JSC::GCAwareJITStubRoutine::deleteFromGC):
(JSC::GCAwareJITStubRoutine::markRequiredObjectsInternal):
(JSC::MarkingGCAwareJITStubRoutineWithOneObject::MarkingGCAwareJITStubRoutineWithOneObject):
(JSC::MarkingGCAwareJITStubRoutineWithOneObject::~MarkingGCAwareJITStubRoutineWithOneObject):
(JSC::MarkingGCAwareJITStubRoutineWithOneObject::markRequiredObjectsInternal):
(JSC::createJITStubRoutine):
* jit/GCAwareJITStubRoutine.h: Added.
(JSC):
(GCAwareJITStubRoutine):
(JSC::GCAwareJITStubRoutine::markRequiredObjects):
(MarkingGCAwareJITStubRoutineWithOneObject):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompilePatchGetArrayLength):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompilePatchGetArrayLength):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdSelfList):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):
* jit/JITStubRoutine.cpp: Added.
(JSC):
(JSC::JITStubRoutine::~JITStubRoutine):
(JSC::JITStubRoutine::observeZeroRefCount):
* jit/JITStubRoutine.h: Added.
(JSC):
(JITStubRoutine):
(JSC::JITStubRoutine::JITStubRoutine):
(JSC::JITStubRoutine::createSelfManagedRoutine):
(JSC::JITStubRoutine::code):
(JSC::JITStubRoutine::asCodePtr):
(JSC::JITStubRoutine::ref):
(JSC::JITStubRoutine::deref):
(JSC::JITStubRoutine::startAddress):
(JSC::JITStubRoutine::endAddress):
(JSC::JITStubRoutine::addressStep):
(JSC::JITStubRoutine::canPerformRangeFilter):
(JSC::JITStubRoutine::filteringStartAddress):
(JSC::JITStubRoutine::filteringExtentSize):
(JSC::JITStubRoutine::passesFilter):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
(JSC::getPolymorphicAccessStructureListSlot):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore: DFG may get stuck in an infinite fix point if it constant folds a mispredicted node
https://bugs.webkit.org/show_bug.cgi?id=90829
<rdar://problem/11823843>

Reviewed by Oliver Hunt.
        
If a node is shown to have been mispredicted during CFA, then don't allow constant
folding to make the graph even more degenerate. Instead, pull back on constant folding
and allow the normal OSR machinery to fix our profiling so that a future recompilation
doesn't see the same mistake.

* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::execute):
* dfg/DFGAbstractState.h:
(JSC::DFG::AbstractState::trySetConstant):
(AbstractState):
* dfg/DFGPhase.h:
(JSC::DFG::Phase::name):
(Phase):
(JSC::DFG::runAndLog):
(DFG):
(JSC::DFG::runPhase):

LayoutTests: DFG may get stuck in an infinite fix point if it constant folds a mispredicted node
https://bugs.webkit.org/show_bug.cgi?id=90829

Reviewed by Oliver Hunt.

* fast/js/dfg-constant-fold-misprediction-expected.txt: Added.
* fast/js/dfg-constant-fold-misprediction.html: Added.
* fast/js/script-tests/dfg-constant-fold-misprediction.js: Added.
(foo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
document.write of scripts that also document.write sometimes writes async
https://bugs.webkit.org/show_bug.cgi?id=89102

Reviewed by Adam Barth.

Source/WebCore:

When a script tag is first encountered, the TreeBuilder holds the element and returns
out to the outer HTMLDocumentParser parse loop.  The HTMLDocumentParser then takes
the script element and passes it to the HTMLScriptRunner for execution. However, if the
script is an "external script" the HTMLScriptRunner may have to wait for that parser
blocking script to load, and may store the script in its own m_parserBlockingScript member.

While the HTMLScriptRunner has this not-yet-loaded-script the parser is also blocked.
Because the "paused" state of the parser was held as a separate bool on the TreeBuilder
we'd have to be careful to update it to reflect the current state of this pending script
on the HTMLScriptRunner.

This patch removes this separate "paused" bool and makes the HTMLDocumentParser responsible
for the "paused" state of the parser through the isWaitingForScripts() function which
knows how to check both the TreeBuilder and the ScriptRunner for possible parser-blocking scripts.

I suspect this change may actually fix a bunch of edge cases where we were not
checking for the HTMLScriptRunner's parser blocking script and thus incorrectly ending
the parser, or not starting the pre-load scanner, etc.

As part of this change I also renamed m_haveParsingBlockingScript in HTMLScriptRunner to match
the naming style used elsewhere in the parser, as well as removed all the "bool" return values
for these parse/execute functions as they are no longer useful (or correct). The correct way
is always to check HTMLDocumentParser::isWaitingForScripts().

Test: fast/parser/cached-script-document-write.html

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::pumpTokenizerIfPossible):
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
(WebCore::HTMLDocumentParser::canTakeNextToken):
(WebCore::HTMLDocumentParser::isWaitingForScripts):
(WebCore::HTMLDocumentParser::resumeParsingAfterScriptExecution):
(WebCore::HTMLDocumentParser::notifyFinished):
(WebCore::HTMLDocumentParser::executeScriptsWaitingForStylesheets):
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::~HTMLScriptRunner):
(WebCore::HTMLScriptRunner::executeParsingBlockingScript):
(WebCore::HTMLScriptRunner::execute):
(WebCore::HTMLScriptRunner::hasParserBlockingScript):
(WebCore::HTMLScriptRunner::executeParsingBlockingScripts):
(WebCore::HTMLScriptRunner::executeScriptsWaitingForLoad):
(WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
(WebCore::HTMLScriptRunner::requestParsingBlockingScript):
(WebCore::HTMLScriptRunner::runScript):
* html/parser/HTMLScriptRunner.h:
(HTMLScriptRunner):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::takeScriptToProcess):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processTokenInForeignContent):
* html/parser/HTMLTreeBuilder.h:
(HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::hasParserBlockingScript):

LayoutTests:

* fast/parser/cached-script-document-write-expected.txt: Added.
* fast/parser/cached-script-document-write.html: Added.
* fast/parser/resources/cached-script-document-write.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pointer Lock requestPointerLock rejects locking an element not in a document.
https://bugs.webkit.org/show_bug.cgi?id=90821

Reviewed by Adrienne Walker.

Source/WebCore:

Test: pointer-lock/lock-element-not-in-dom.html

* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):

LayoutTests:

* pointer-lock/lock-element-not-in-dom-expected.txt: Added.
* pointer-lock/lock-element-not-in-dom.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Remove HashMap workaround for layers with id=0 in CCDamageTracker
https://bugs.webkit.org/show_bug.cgi?id=90825

Reviewed by Adrienne Walker.

Layer ids are no longer allowed to be 0, and the behaviour is guarded
with asserts, so this workaround is not needed any longer.

* platform/graphics/chromium/cc/CCDamageTracker.h:
(CCDamageTracker):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r122161.
http://trac.webkit.org/changeset/122161
https://bugs.webkit.org/show_bug.cgi?id=90837

failed to compile on chromium webkit linux bot (Requested by
shawnsingh on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-07-09

* WebKit.gypi:
* WebKitUnitTests.gyp:
* public/WebDOMMessageEvent.h:
* tests/AssociatedURLLoaderTest.cpp:
(WebKit::AssociatedURLLoaderTest::AssociatedURLLoaderTest):
(WebKit::AssociatedURLLoaderTest::SetUp):
(WebKit::AssociatedURLLoaderTest::CheckMethodFails):
(WebKit::AssociatedURLLoaderTest::CheckHeaderFails):
(WebKit::AssociatedURLLoaderTest::CheckAccessControlHeaders):
(WebKit::TEST_F):
* tests/EventListenerTest.cpp:
* tests/FrameTestHelpers.cpp:
(WebKit::FrameTestHelpers::registerMockedURLLoad):
(FrameTestHelpers):
(WebKit::FrameTestHelpers::loadFrame):
* tests/FrameTestHelpers.h:
(FrameTestHelpers):
* tests/ListenerLeakTest.cpp:
(WebKit::ListenerLeakTest::RunTest):
* tests/PopupMenuTest.cpp:
(WebKit::SelectPopupMenuTest::registerMockedURLLoad):
(WebKit::SelectPopupMenuTest::loadFrame):
(WebKit::TEST_F):
* tests/RunAllTests.cpp:
* tests/URLTestHelpers.cpp: Removed.
* tests/URLTestHelpers.h: Removed.
* tests/WebFrameTest.cpp:
(WebKit::WebFrameTest::registerMockedHttpURLLoad):
(WebKit::WebFrameTest::registerMockedChromeURLLoad):
(WebKit::TEST_F):
* tests/WebPageNewSerializerTest.cpp:
(WebKit::WebPageNewSerializeTest::registerMockedURLLoad):
(WebPageNewSerializeTest):
(WebKit::WebPageNewSerializeTest::setUpCSSTestPage):
(WebKit::WebPageNewSerializeTest::loadURLInTopFrame):
(WebKit::WebPageNewSerializeTest::resourceVectorContains):
(WebKit::TEST_F):
* tests/WebPageSerializerTest.cpp:
(WebKit::WebPageSerializerTest::registerMockedURLLoad):
(WebKit::WebPageSerializerTest::loadURLInTopFrame):
(WebKit::WebPageSerializerTest::webVectorContains):
(WebKit::TEST_F):
* tests/WebViewTest.cpp:
(WebKit::TEST_F):
(WebKit::WebViewTest::testAutoResize):
(WebKit::WebViewTest::testTextInputType):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122171 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Remove obsolete accessor plumbing
https://bugs.webkit.org/show_bug.cgi?id=90812

Reviewed by Tony Chang.

Source/WebCore:

No new tests - just deleting code.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction): Since backend mode() is disconnected, can no
longer assert that front-end/back-end modes match; not worth it to keeping the plumbing.

Source/WebKit/chromium:

* public/WebIDBCursor.h: Remove direction.
* public/WebIDBDatabase.h: Remove name, version, objectStoreNames;
(WebKit::WebIDBDatabase::metadata):
* public/WebIDBIndex.h: Remove name, keyPath, unique, multiEntry;
* public/WebIDBObjectStore.h: Remove name, keyPath, indexNames, autoIncrement;
* src/IDBDatabaseBackendProxy.cpp: Remove plumbing.
* src/IDBDatabaseBackendProxy.h: Remove plumbing.
(IDBDatabaseBackendProxy):
* src/IDBIndexBackendProxy.cpp: Remove plumbing.
* src/IDBIndexBackendProxy.h: Remove plumbing.
(IDBIndexBackendProxy):
* src/IDBObjectStoreBackendProxy.cpp: Remove plumbing.
* src/IDBObjectStoreBackendProxy.h: Remove plumbing.
(IDBObjectStoreBackendProxy):
* src/IDBTransactionBackendProxy.cpp: Remove plumbing.
* src/IDBTransactionBackendProxy.h: Assert stub is not used - only needed
by real IDBTransactionBackendImpl
(WebKit::IDBTransactionBackendProxy::mode):
* src/WebIDBTransactionImpl.cpp: Remove plumbing.
* src/WebIDBTransactionImpl.h: Remove plumbing.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122172 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: A null or undefined storeNames argument to IDBDatabase::transaction() should be coerced to string
https://bugs.webkit.org/show_bug.cgi?id=90474

Reviewed by Tony Chang.

Source/WebCore:

Test: storage/indexeddb/transaction-basics.html

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBDatabase.idl:

LayoutTests:

* storage/indexeddb/resources/transaction-basics.js:
(testInvalidMode):
(testDegenerateNames.request.onsuccess):
(testDegenerateNames.verifyDegenerateNames):
(testDegenerateNames):
* storage/indexeddb/transaction-basics-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Consider closing unused localStorage database after a timeout.
https://bugs.webkit.org/show_bug.cgi?id=90713

For a localStorage, if there is no active document referencing to it for certain amount of time (300 seconds),
we can close the underlying sqlite database.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2012-07-09
Reviewed by Brady Eidson.

Source/WebCore:

Test: storage/domstorage/storage-close-database-on-idle.html

* storage/Storage.cpp:
(WebCore::Storage::Storage): increment storageArea access count when a DOMWindow is referencing it.
(WebCore::Storage::~Storage): decrement storageArea access count when DOMWindow is done with it.
* storage/StorageArea.h:
(StorageArea):
* storage/StorageAreaImpl.cpp:
(WebCore::StorageAreaImpl::StorageAreaImpl):
(WebCore::StorageAreaImpl::incrementAccessCount):
(WebCore):
(WebCore::StorageAreaImpl::decrementAccessCount): schedule closeDatabaseTimer if there is no active document
    referencing to this storageArea.
(WebCore::StorageAreaImpl::closeDatabaseTimerFired): close the underlying sqlite database.
* storage/StorageAreaImpl.h:
(StorageAreaImpl):
* storage/StorageAreaSync.cpp:
(WebCore::StorageAreaSync::sync): if m_syncCloseDatabase flag is set and the database is not opened, bail out.
* storage/StorageTracker.cpp:
(WebCore):
(WebCore::StorageTracker::StorageTracker):
* storage/StorageTracker.h:
(WebCore::StorageTracker::storageDatabaseIdleInterval):
(WebCore::StorageTracker::setStorageDatabaseIdleInterval):  set the timeout value that we will wait before closing the
    database.  This is currently used by DumpRenderTree only.
(StorageTracker):

Source/WebKit/mac:

* Storage/WebStorageManager.mm:
(+[WebStorageManager setStorageDatabaseIdleInterval:]): add a new method for DumpRenderTree to set the timeout
    that we will wait before closing database.
(initializeLocalStoragePath):
* Storage/WebStorageManagerPrivate.h:

Tools:

* DumpRenderTree/LayoutTestController.cpp: add a JS method setStorageDatabaseIdleInterval to testRunner
    to set a different timeout value for closing localStorage database.
(setStorageDatabaseIdleIntervalCallback):
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
(LayoutTestController):
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::setStorageDatabaseIdleInterval): add empty method.
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::setStorageDatabaseIdleInterval): ditto.
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::setStorageDatabaseIdleInterval): ditto.
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::setStorageDatabaseIdleInterval): ditto.

LayoutTests:

* platform/chromium/TestExpectations: the test needs setCacheModel implementation, skip it in chromium.
* storage/domstorage/storage-close-database-on-idle-expected.txt: Added.
* storage/domstorage/storage-close-database-on-idle.html: Added.
* storage/resources/storage-close-data-on-idle-switch.html: Added.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Editing: Autocorrection in blockquotes causes text to break out of quote
https://bugs.webkit.org/show_bug.cgi?id=90487
<rdar://problem/11769020>

Patch by Alice Cheng <alice_cheng@apple.com> on 2012-07-09
Reviewed by Enrica Casucci.

Source/WebCore:

Test: platform/mac/editing/spelling/autocorrection-blockquote-crash.html

SpellingCorrectionCommand uses ReplaceSelectionCommand to replace the misspelled word with the auto-corrected word. Specifically, ReplaceSelectionCommand does a smart copy, where it breaks out of blockquotes. Thus, the fix is to substitute ReplaceSelectionCommand with InserTextCommand.

* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::doApply):

LayoutTests:

* platform/mac/editing/spelling/autocorrection-blockquote-crash-expected.txt:
* platform/mac/editing/spelling/autocorrection-blockquote-crash.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gcc build fix after r122174.

* storage/StorageAreaImpl.cpp:
(WebCore::StorageAreaImpl::decrementAccessCount):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
.: Expose an export for the iconUrl list so Internals can use it
https://bugs.webkit.org/show_bug.cgi?id=88665

Patch by Pete Williamson <petewil@google.com> on 2012-07-09
Reviewed by Kent Tamura.

* Source/autotools/symbols.filter: export iconURLs

Source/WebCore: Changed the behavior of iconURLs to always recalculate the list.
https://bugs.webkit.org/show_bug.cgi?id=88665

Patch by Pete Williamson <petewil@google.com> on 2012-07-09
Reviewed by Kent Tamura..

As it turns out, it can contain stale URLs in the case that some script
manipulates the DOM, which breaks scripts trying to reset the favicon
URL. Also added a method in Internals to allow tests to get the list of
icon

Tests: fast/dom/icon-url-change.html
       fast/dom/icon-url-list.html

* WebCore.exp.in: export Document::iconURLs on the mac for the Internals class
* dom/Document.cpp:
(WebCore::Document::iconURLs): Changed the method to recalculate the iconURL list every time
(WebCore::Document::addIconURL): we no longer need to add to the internal list since we recalculate it
(WebCore::Document::setUseSecureKeyboardEntryWhenActive): removed extra whitespace
* dom/Document.h:
(Document): removed the addIconURL method which is no longer used
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::iconType): exposed the icon type with an accessor
(WebCore):
(WebCore::HTMLLinkElement::iconSizes): exposed the icon sizes with an accessor
* html/HTMLLinkElement.h:
(HTMLLinkElement): declared the icon type and size accessors
* testing/Internals.cpp:
(WebCore::Internals::iconURLs): made a method to be used by unit tests for inspecting the icon URL list
(WebCore):
* testing/Internals.h:
(Internals): declared the method for unit testing the icon URL list
* testing/Internals.idl: exported the Document::iconURLs function

Source/WebKit2: Export the iconURL list to make it available to the Internals class for testing
https://bugs.webkit.org/show_bug.cgi?id=88665

Patch by Pete Williamson <petewil@google.com> on 2012-07-09
Reviewed by Kent Tamura.

* win/WebKit2.def: export the DocumentL::iconURLs function

LayoutTests: Add some new unit tests to test the favicon changing dynamically
https://bugs.webkit.org/show_bug.cgi?id=88665

Patch by Pete Williamson <petewil@google.com> on 2012-07-09
Reviewed by Kent Tamura.

* fast/dom/icon-url-change-expected.txt: Added.
* fast/dom/icon-url-change.html: Added a new test for changing the favicon dynamically
* fast/dom/icon-url-list-expected.txt: Added.
* fast/dom/icon-url-list.html: Added a new test for multiple favicons in the HTML header
* fast/dom/icon-url-property-expected.txt: update unit test expectations
* fast/dom/icon-url-property.html: update and enable existing favicon test
* platform/chromium/TestExpectations: reenable the url-property test

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: deleteDatabase fails if transaction running in other database
https://bugs.webkit.org/show_bug.cgi?id=90822

Reviewed by Tony Chang.

Source/WebCore:

The IDBLevelDBBackingStore was preventing a deleteDatabase() from running
if any other database was running a transaction. Fix by just creating a scratch
LevelDBTransaction for the delete steps.

Test: storage/indexeddb/deletedatabase-transaction.html

* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::deleteDatabase): Use a LevelDBTransaction
directly.

LayoutTests:

* storage/indexeddb/deletedatabase-transaction-expected.txt: Added.
* storage/indexeddb/deletedatabase-transaction.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Create CCScopedTexture class for creating/freeing textures
https://bugs.webkit.org/show_bug.cgi?id=89485

Reviewed by Adrienne Walker.

Source/WebCore:

This class provides a standard way to create texture ids in a way that
ensures they will be freed later.

Also includes a CCTexture base class that holds textureId, size, and
format together in a struct that can be used in place of storing an
unsigned textureId in other classes.

Unit tests: CCScopedTexureTest.NewScopedTexture
            CCScopedTexureTest.CreateScopedTexture
            CCScopedTexureTest.ScopedTextureIsDeleted
            CCScopedTexureTest.LoseScopedTexture

* WebCore.gypi:
* platform/graphics/chromium/cc/CCScopedTexture.cpp: Added.
(WebCore):
(WebCore::CCScopedTexture::CCScopedTexture):
(WebCore::CCScopedTexture::~CCScopedTexture):
(WebCore::CCScopedTexture::allocate):
(WebCore::CCScopedTexture::free):
(WebCore::CCScopedTexture::leak):
* platform/graphics/chromium/cc/CCScopedTexture.h: Added.
(WebCore):
(CCScopedTexture):
(WebCore::CCScopedTexture::create):
* platform/graphics/chromium/cc/CCTexture.cpp: Added.
(WebCore):
(WebCore::CCTexture::setDimensions):
(WebCore::CCTexture::bytes):
(WebCore::CCTexture::memorySizeBytes):
* platform/graphics/chromium/cc/CCTexture.h: Added.
(WebCore):
(CCTexture):
(WebCore::CCTexture::CCTexture):
(WebCore::CCTexture::id):
(WebCore::CCTexture::size):
(WebCore::CCTexture::format):
(WebCore::CCTexture::setId):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/CCScopedTextureTest.cpp: Added.
(WebKitTests):
(WebKitTests::TEST):
(TrackingTextureAllocator):
(WebKitTests::TrackingTextureAllocator::TrackingTextureAllocator):
(WebKitTests::TrackingTextureAllocator::numTextures):

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