Read tag names and attributes from the saved tokens in HTMLTreeBuilder::callTheAdoptionAgency(AtomicHTMLToken*)
https://bugs.webkit.org/show_bug.cgi?id=93047

Reviewed by Adam Barth.

This is a follow-up patch for r123577.
Changed to retrieve the stack item of commonAncestor and read the local name from the saved token.

No new tests, covered by existing tests.

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move causesFosterParenting() to HTMLStackItem
https://bugs.webkit.org/show_bug.cgi?id=93048

Reviewed by Adam Barth.

Changed to share causesFosterParenting() between HTMLTreeBuilder and HTMLConstructionSite
by moving this function to HTMLStackItem.

No functional change, so no new tests.

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::shouldFosterParent):
* html/parser/HTMLStackItem.h:
(WebCore::HTMLStackItem::causesFosterParenting):
(HTMLStackItem):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVG text selection doesn't work with hyperlinked text
https://bugs.webkit.org/show_bug.cgi?id=29166

Reviewed by Eric Seidel.

Cleanup SVGAElement. There is no need to test for middle mouse button here, this
is handled elsewhere, so remove isMiddleMouseButtonEvent. Similarly handleLinkClick
is not used anymore by HTMLAnchorElement, remove it. Finally, _self indeed is not needed.

No new tests, since no change in behaviour.

* WebCore.order:
* html/HTMLAnchorElement.cpp:
* html/HTMLAnchorElement.h:
(WebCore):
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124538 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Core upgradeneeded logic
https://bugs.webkit.org/show_bug.cgi?id=92558

Reviewed by Ojan Vafai.

Source/WebCore:

This is the backend webkit logic needed for integer versions. The rest
is in https://bugs.webkit.org/show_bug.cgi?id=89505.

I tried to make use of the existing processPendingCalls and added two
more queues, pendingOpenWithVersionCalls and
pendingSecondHalfOpenWithVersionCalls. The "second half" refers to
how there are two events that need to be fired in response to an
open-with-version call. The "second half" queue holds the open
requests that should immediately follow the caller's upgradeneeded
handler.

No new tests, there are so many they are in their own patch:
https://bugs.webkit.org/show_bug.cgi?id=92560

Though this patch doesn't change any expected behavior anyway, lack of
regressions is what we're hoping for here.

* Modules/indexeddb/IDBBackingStore.h:
(IDBBackingStore):
* Modules/indexeddb/IDBCallbacks.h:
(WebCore::IDBCallbacks::onBlocked):
(WebCore::IDBCallbacks::onUpgradeNeeded):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(IDBDatabaseBackendImpl::PendingOpenCall):
(IDBDatabaseBackendImpl::PendingOpenWithVersionCall):
(WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::create):
(WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::callbacks):
(WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::version):
(WebCore::IDBDatabaseBackendImpl::PendingOpenWithVersionCall::PendingOpenWithVersionCall):
(WebCore):
(WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
(WebCore::IDBDatabaseBackendImpl::openInternal):
(WebCore::IDBDatabaseBackendImpl::metadata):
(WebCore::IDBDatabaseBackendImpl::setVersion):
(WebCore::IDBDatabaseBackendImpl::setIntVersionInternal):
(WebCore::IDBDatabaseBackendImpl::transactionFinished):
(WebCore::IDBDatabaseBackendImpl::transactionFinishedAndEventsFired):
When an upgradeneeded event is fired in response to an
open-with-version call, the version change transaction must receive its
complete event before processPendingCalls fires a success event at
IDBOpenDBRequest. In the future this should probably be changed
instead to transactionFinishedAndAbortFired and
transactionFinishedAndCompleteFired so that we'll know to fire a
success or error event at IDBOpenDBRequest. Currently, instead of
firing error when there's an abort, we don't fire anything.

(WebCore::IDBDatabaseBackendImpl::processPendingCalls):
Now that this is called after a connection is opened, we unfortunately
lose the invariant that there is only one existing connection when this
is called, but nothing inside this function actually relied on that.
Additionally, the secondHalfOpen calls only ever need to be serviced
in one place: right after a version change transaction completes, so
it could be moved out of here.

(WebCore::IDBDatabaseBackendImpl::registerFrontendCallbacks):
Now that setVersion and deleteDatabase calls are queued up behind
secondHalfOpen calls, we have to service those queues when
secondHalfOpen calls complete, which is here.  So call
processPendingCalls().

(WebCore::IDBDatabaseBackendImpl::runIntVersionChangeTransaction):
(WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
(WebCore::IDBDatabaseBackendImpl::deleteDatabase):
(WebCore::IDBDatabaseBackendImpl::close):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBDatabaseCallbacks.h:
(WebCore::IDBDatabaseCallbacks::onVersionChange):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::open):
This is refactored some so that the call to openConection{WithVersion}
happens once, at the end.

* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::getIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::createIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::updateIDBDatabaseIntVersion):
(WebCore):
(WebCore::IDBLevelDBBackingStore::deleteDatabase):
* Modules/indexeddb/IDBLevelDBBackingStore.h:
(IDBLevelDBBackingStore):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::commit):
See above comments about transactionFinishedAndEventsFired. I tried
moving the call to transactionFinished after the events were fired but
that failed some asserts. But changing those asserts is still an
alternative to splitting up transactionFinished as is done here.

Source/WebKit/chromium:

Update overridden methods to match new signatures.

* tests/IDBAbortOnCorruptTest.cpp:
(WebCore::FailingBackingStore::createIDBDatabaseMetaData):
* tests/IDBFakeBackingStore.h:


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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124541 268f45cc-cd09-0410-ab3c-d52691b4dbfc
V8Proxy::currentContext() doesn't do anything and should be removed
https://bugs.webkit.org/show_bug.cgi?id=93041

Reviewed by Eric Seidel.

Source/WebCore:

It's just a wrapper for GetCurrent().

* bindings/v8/DateExtension.cpp:
(WebCore::DateExtension::setAllowSleep):
* bindings/v8/V8NPUtils.cpp:
(WebCore::convertV8ObjectToNPVariant):
* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::retrieve):
(WebCore::V8Proxy::mainWorldContext):
* bindings/v8/V8Proxy.h:
(V8Proxy):
* bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
(WebCore::getJSListenerFunctions):

Source/WebKit/chromium:

* src/WebBindings.cpp:
(WebKit::makeIntArrayImpl):
(WebKit::makeStringArrayImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] deviceViewportSize cleanup
https://bugs.webkit.org/show_bug.cgi?id=92794

Patch by Alexandre Elias <aelias@google.com> on 2012-08-02
Reviewed by Adrienne Walker.

In the future, CSS layout size will become increasingly disassociated
from physical device size, and it will become impossible to infer one
from the other inside the compositor.  Therefore, this patch allows
deviceViewportSize to be explicitly passed in by the outside client.

I also renamed the existing viewportSize field to "layoutViewportSize"
for clarity, and converted its uses to deviceViewportSize since
that is more appropriate.

I had to add some default-value scaffolding to WebLayerTreeView in
order to avoid breaking ui/compositor.  We can delete it once that's
updated.

Source/Platform:

* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):

Source/WebCore:

No new tests (covered by existing tests).

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::finishCommitOnImplThread):
(WebCore::CCLayerTreeHost::setViewportSize):
(WebCore::CCLayerTreeHost::updateLayers):
(WebCore::CCLayerTreeHost::setDeviceScaleFactor):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
(WebCore::CCLayerTreeHost::layoutViewportSize):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::canDraw):
(WebCore::CCLayerTreeHostImpl::startPageScaleAnimation):
(WebCore::CCLayerTreeHostImpl::setViewportSize):
(WebCore::CCLayerTreeHostImpl::setDeviceScaleFactor):
(WebCore::CCLayerTreeHostImpl::updateMaxScrollPosition):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):
(WebCore::CCLayerTreeHostImpl::layoutViewportSize):

Source/WebKit/chromium:

* src/WebLayerTreeView.cpp:
(WebKit::WebLayerTreeView::setViewportSize):
(WebKit::WebLayerTreeView::layoutViewportSize):
(WebKit):
(WebKit::WebLayerTreeView::deviceViewportSize):
(WebKit::WebLayerTreeView::setDeviceScaleFactor):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::paint):
(WebKit::WebViewImpl::updateLayerTreeViewport):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Upstream GraphicsLayerClient::contentsVisible()
https://bugs.webkit.org/show_bug.cgi?id=93040

Patch by Arvid Nilsson <anilsson@rim.com> on 2012-08-02
Reviewed by George Staikos.

Our LayerTiler uses both proactive and reactive rendering to populate
tiles. If contentsVisible() is accurate, it will cause the right tiles
to be rendered. Failing that, when a dirty tile is found to be visible
on the compositing thread, a render job is scheduled.

This is not currently testable using BlackBerry testing infrastructure.

* platform/graphics/GraphicsLayerClient.h:
(GraphicsLayerClient): New BlackBerry-specific method "contentsVisible" added.
* rendering/RenderLayerBacking.cpp:
(WebCore):
(WebCore::RenderLayerBacking::contentsVisible): BlackBerry-specific implementation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r124540.
http://trac.webkit.org/changeset/124540
https://bugs.webkit.org/show_bug.cgi?id=93055

Broke compile on Chromium Win bot (Requested by dimich on
#webkit).

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

Source/WebCore:

* Modules/indexeddb/IDBBackingStore.h:
(IDBBackingStore):
* Modules/indexeddb/IDBCallbacks.h:
(IDBCallbacks):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::PendingOpenCall::PendingOpenCall):
(WebCore::IDBDatabaseBackendImpl::IDBDatabaseBackendImpl):
(WebCore::IDBDatabaseBackendImpl::openInternal):
(WebCore::IDBDatabaseBackendImpl::metadata):
(WebCore::IDBDatabaseBackendImpl::setVersion):
(WebCore::IDBDatabaseBackendImpl::transactionFinished):
(WebCore::IDBDatabaseBackendImpl::processPendingCalls):
(WebCore::IDBDatabaseBackendImpl::registerFrontendCallbacks):
(WebCore::IDBDatabaseBackendImpl::deleteDatabase):
(WebCore::IDBDatabaseBackendImpl::close):
* Modules/indexeddb/IDBDatabaseBackendImpl.h:
(IDBDatabaseBackendImpl):
* Modules/indexeddb/IDBDatabaseCallbacks.h:
(IDBDatabaseCallbacks):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::open):
* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::getIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::createIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::deleteDatabase):
* Modules/indexeddb/IDBLevelDBBackingStore.h:
(IDBLevelDBBackingStore):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::commit):

Source/WebKit/chromium:

* tests/IDBAbortOnCorruptTest.cpp:
(WebCore::FailingBackingStore::createIDBDatabaseMetaData):
* tests/IDBFakeBackingStore.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WINCE] Return 0 at calculateDSTOffset(double, double)
https://bugs.webkit.org/show_bug.cgi?id=92953

Reviewed by Ryosuke Niwa.

localtime() is implemented as a call to gmtime() in ce_time.c.
Since this will never return correct values, returning 0 instead
does not remove any existing functionality, but decreases the
dependency on the (external) ce_time implementation.

* wtf/DateMath.cpp:
(WTF::calculateDSTOffsetSimple):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
V8 bindings code that tries to find its context should use BindingState functions rather than V8Proxy
https://bugs.webkit.org/show_bug.cgi?id=93038

Reviewed by Eric Seidel.

After this patch, most code in the V8 bindings that tries to determine
it's "context" goes through BindingState.h rather than V8Proxy. This
patch is a step towards unifying all these code paths.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateNamedConstructorCallback):
* bindings/v8/BindingState.cpp:
(WebCore::currentFrame):
(WebCore):
* bindings/v8/BindingState.h:
(WebCore):
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::retrieveFrameForEnteredContext):
(WebCore::ScriptController::retrieveFrameForCurrentContext):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::v8UncaughtExceptionHandler):
* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::reportUnsafeAccessTo):
* bindings/v8/V8Proxy.h:
(V8Proxy):
* bindings/v8/V8Utilities.cpp:
(WebCore::getScriptExecutionContext):
* bindings/v8/custom/V8AudioContextCustom.cpp:
(WebCore::V8AudioContext::constructorCallback):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::handlePostMessageCallback):
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::V8HTMLDocument::writeCallback):
(WebCore::V8HTMLDocument::writelnCallback):
(WebCore::V8HTMLDocument::openCallback):
* bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
(WebCore::v8HTMLImageElementConstructorCallback):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124547 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Crash while loading plugin after r121467
https://bugs.webkit.org/show_bug.cgi?id=92943

Reviewed by Laszlo Gombos.

r121467 replaced POSIX dlopen to helpers in eina_module, but some codes
are not changed.

No new tests, behavior has not changed.

* plugins/efl/PluginPackageEfl.cpp:
(WebCore::PluginPackage::fetchInfo):
Changes dlsym to eina_module_symbol_get to follow changes of r121467.


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