REGRESSION (r146540?): Crashes in storage/indexeddb/factory-basics-workers.html, storage/indexeddb/transaction-error.html
https://bugs.webkit.org/show_bug.cgi?id=113019

Reviewed by Tony Chang.

Also manifesting flakily under Chromium's content_shell. It's an ASSERT being hit in
the IDBTransaction destructor. The cause was r146540 which allows a stopped context
to reclaim script wrappers. This allows the IDBTransaction to be deref'd at times where
it previously would have just leaked. Modulate the destructor assertions to account
for this case.

No new tests; failures already manifest as flaky crashes in some ports.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::~IDBTransaction): If context is stopped, expected state
transitions/cleanup may not have occurred before destructor runs.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] New fast/text/word-space-with-kerning-3.html fails on Qt.
https://bugs.webkit.org/show_bug.cgi?id=112668

Reviewed by Jocelyn Turcotte.

Source/WebCore:

Qt adds word-spacing to leading spaces, but WebCore only expects
us to add for trailing spaces. We only corrected for this in width
calculation but do need to also do it for drawing.

Instead of subtracting the extra word-spacing we now configure the
FormatRange not to apply to leading spaces. This means this behavior
will be applied everywhere reliably.

* platform/graphics/Font.h:
(Font):
* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::drawComplexText):
(WebCore::Font::floatWidthForComplexText):
(WebCore::Font::offsetForPositionForComplexText):
(WebCore::Font::selectionRectForComplexText):
(WebCore::Font::initFormatForTextLayout):

LayoutTests:

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a failure test expectation to media/track/track-user-preferences.html after r146380.
The failure is tracked by the webkit.org/b/113083.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Support Quota API in Worker
https://bugs.webkit.org/show_bug.cgi?id=112713

Hook up WebKit side of queryUsageAndQuota. Tests
and WebCore code will come in https://bugs.webkit.org/show_bug.cgi?id=112972

Reviewed by David Levin.

* WebKit.gyp:
* public/WebCommonWorkerClient.h:
(WebKit::WebCommonWorkerClient::queryUsageAndQuota):
* src/StorageQuotaChromium.cpp:
(WebCore::StorageQuota::queryUsageAndQuota):
(WebCore::StorageQuota::requestQuota):
* src/WebWorkerClientImpl.cpp:
(WebKit::WebWorkerClientImpl::queryUsageAndQuota):
(WebKit):
* src/WebWorkerClientImpl.h:
* src/WorkerStorageQuotaCallbacksBridge.cpp: Added.
(WebKit):
(MainThreadStorageQuotaCallbacks):
(WebKit::MainThreadStorageQuotaCallbacks::createLeakedPtr):
(WebKit::MainThreadStorageQuotaCallbacks::~MainThreadStorageQuotaCallbacks):
(WebKit::MainThreadStorageQuotaCallbacks::didQueryStorageUsageAndQuota):
(WebKit::MainThreadStorageQuotaCallbacks::didFail):
(WebKit::MainThreadStorageQuotaCallbacks::didGrantStorageQuota):
(WebKit::MainThreadStorageQuotaCallbacks::MainThreadStorageQuotaCallbacks):
(WorkerStorageQuotaContextObserver):
(WebKit::WorkerStorageQuotaContextObserver::create):
(WebKit::WorkerStorageQuotaContextObserver::notifyStop):
(WebKit::WorkerStorageQuotaContextObserver::WorkerStorageQuotaContextObserver):
(WebKit::WorkerStorageQuotaCallbacksBridge::stop):
(WebKit::WorkerStorageQuotaCallbacksBridge::cleanUpAfterCallback):
(WebKit::WorkerStorageQuotaCallbacksBridge::WorkerStorageQuotaCallbacksBridge):
(WebKit::WorkerStorageQuotaCallbacksBridge::~WorkerStorageQuotaCallbacksBridge):
(WebKit::WorkerStorageQuotaCallbacksBridge::postQueryUsageAndQuotaToMainThread):
(WebKit::WorkerStorageQuotaCallbacksBridge::queryUsageAndQuotaOnMainThread):
(WebKit::WorkerStorageQuotaCallbacksBridge::didFailOnMainThread):
(WebKit::WorkerStorageQuotaCallbacksBridge::didQueryStorageUsageAndQuotaOnMainThread):
(WebKit::WorkerStorageQuotaCallbacksBridge::didFailOnWorkerThread):
(WebKit::WorkerStorageQuotaCallbacksBridge::didQueryStorageUsageAndQuotaOnWorkerThread):
(WebKit::WorkerStorageQuotaCallbacksBridge::runTaskOnMainThread):
(WebKit::WorkerStorageQuotaCallbacksBridge::runTaskOnWorkerThread):
(WebKit::WorkerStorageQuotaCallbacksBridge::dispatchTaskToMainThread):
(WebKit::WorkerStorageQuotaCallbacksBridge::mayPostTaskToWorker):
* src/WorkerStorageQuotaCallbacksBridge.h: Added.
(WebCore):
(WebKit):
(WorkerStorageQuotaCallbacksBridge):
(WebKit::WorkerStorageQuotaCallbacksBridge::create):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Hit Test doesn't need to be active
https://bugs.webkit.org/show_bug.cgi?id=113072

Patch by Genevieve Mak <gmak@rim.com> on 2013-03-22
Reviewed by Rob Buis.

Reviewed Internally By Mike Lattanzio.
PR #306074

* WebKitSupport/ProximityDetector.cpp:
(BlackBerry::WebKit::ProximityDetector::findBestPoint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Include the right GL header for GLES2
https://bugs.webkit.org/show_bug.cgi?id=113034

Reviewed by Martin Robinson.

Include GLES2/gl2.h when using GLES2.

Source/WebKit/gtk:

* WebCoreSupport/AcceleratedCompositingContextGL.cpp:

Source/WebKit2:

* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement isEnabledFormControl() for SliderThumbElement and SpinButtonElement in terms of disabled()
https://bugs.webkit.org/show_bug.cgi?id=112993

Reviewed by Kent Tamura.

This is an intermediate step for refactoring Node::disabled and
Element::isEnabledFormControl. All classes that override
isEnabledFormControl just return !disabled(), except for
SliderThumbElement and SpinButtonElement. This patch changes those two
classes to do so, which shows that the two functions are redundant and
easy to refactor into a single function in a subsequent patch.

No new tests, there should be no behavior change.

* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::disabled):
(WebCore):
(WebCore::SliderThumbElement::isEnabledFormControl):
* html/shadow/SliderThumbElement.h:
(SliderThumbElement):
* html/shadow/SpinButtonElement.h: The check of shadowHost() is
necessary because it can be detached by JavaScript that runs during
event handling (see r76566)


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146638 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Remove Android platform expectations from Chromium TestExpectations.
(Too many bug URLs to list)

Unreivewed, test expectations update.

* platform/chromium/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Fix build issues to enable CSS Filter and Shaders support.
https://bugs.webkit.org/show_bug.cgi?id=111274

Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2013-03-22
Reviewed by Noam Rosenthal.

This is in preperation to enable CSS Filter and Shaders support.
This patch fixes related build issues to enable the support.

* platform/graphics/surfaces/efl/GLTransportSurface.cpp:
* platform/graphics/texmap/TextureMapper.cpp:
* platform/graphics/texmap/TextureMapper.h:
(WebCore):
* platform/graphics/texmap/TextureMapperGL.cpp:
* platform/graphics/texmap/TextureMapperGL.h:
(WebCore):
* platform/graphics/texmap/TextureMapperShaderProgram.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Check focused node reference when traversing through history
https://bugs.webkit.org/show_bug.cgi?id=113082

Patch by Nima Ghanavatian <nghanavatian@blackberry.com> on 2013-03-22
Reviewed by Rob Buis.

PR312101
Check if we have a valid node and document before attempting to access its frame and
frame selection. This is causing issues when going back to a page after a redirect
where a stale pointer is used.
Further, the focused node should be changed after the frame is fully loaded.

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDidFinishLoad):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::setElementUnfocused):
(BlackBerry::WebKit::InputHandler::restoreViewState):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146641 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Remove pushLayoutState(RenderFlowThread*) from RenderView
https://bugs.webkit.org/show_bug.cgi?id=113084

Reviewed by Dirk Schulze.

Remove void pushLayoutState(RenderFlowThread*, bool regionsChanged) from RenderView.h because it's not used.

Tests: Code cleanup. No tests needed.

* rendering/RenderView.h:
(RenderView):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Test expectation after Skia changes

Unreviewed expectations update.

Only the things failing on the bots, not already accounted for.

* platform/chromium-linux/fast/text/international/danda-space-expected.png:
* platform/chromium-mac-lion/fast/multicol/vertical-rl/nested-columns-expected.png:
* platform/chromium-mac-lion/fast/ruby/base-shorter-than-text-expected.png:
* platform/chromium-mac-lion/fast/text/emphasis-combined-text-expected.png:
* platform/chromium-mac-lion/fast/text/international/text-combine-image-test-expected.png:
* platform/chromium-mac-lion/fast/writing-mode/Kusa-Makura-background-canvas-expected.png:
* platform/chromium-mac-snowleopard/fast/multicol/vertical-rl/nested-columns-expected.png:
* platform/chromium-mac-snowleopard/fast/writing-mode/Kusa-Makura-background-canvas-expected.png:
* platform/chromium-mac/fast/multicol/vertical-rl/nested-columns-expected.png:
* platform/chromium-mac/fast/repaint/japanese-rl-selection-clear-expected.png:
* platform/chromium-mac/fast/repaint/japanese-rl-selection-clear-expected.txt: Added.
* platform/chromium-mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png:
* platform/chromium-mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.txt:
* platform/chromium-mac/fast/text/international/text-combine-image-test-expected.png:
* platform/chromium-mac/fast/writing-mode/Kusa-Makura-background-canvas-expected.png:
* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Data store should be readable in dragstart/copy/cut events
https://bugs.webkit.org/show_bug.cgi?id=23695

Reviewed by Tony Chang.

Source/WebCore:

There were several events where data could be written but not read back due to the fact that
different Clipboard method implementations checked permissions inconsistently. This patch
adds helper methods to check if an operation is permitted on a Clipboard and refactors all
direct comparisons against Clipboard::m_policy to use the new helpers instead. This fixes
several bugs where Clipboard::types and Clipboard::getData are not usable inside the
aforementioned events.

Tests: editing/pasteboard/can-read-in-copy-and-cut-events.html
       editing/pasteboard/can-read-in-dragstart-event.html

* dom/Clipboard.cpp:
(WebCore::Clipboard::canReadTypes): Formerly restricted to ClipboardReadable and
                                    ClipboardTypesReadable; now allows ClipboardWritable as
                                    well.
(WebCore::Clipboard::canReadData): Formerly restricted to ClipboardReadable; now allows
                                   ClipboardWritable as well.
(WebCore::Clipboard::canWriteData):
(WebCore::Clipboard::canSetDragImage):
(WebCore::Clipboard::hasFileOfType):
(WebCore::Clipboard::hasStringOfType):
(WebCore::Clipboard::setDropEffect):
(WebCore::Clipboard::setEffectAllowed):
* dom/Clipboard.h:
(Clipboard):
* platform/blackberry/ClipboardBlackBerry.cpp:
(WebCore::ClipboardBlackBerry::clearData):
(WebCore::ClipboardBlackBerry::clearAllData):
(WebCore::ClipboardBlackBerry::getData):
(WebCore::ClipboardBlackBerry::setData):
(WebCore::ClipboardBlackBerry::types):
* platform/chromium/ClipboardChromium.cpp:
(WebCore::DataTransferItemPolicyWrapper::kind):
(WebCore::DataTransferItemPolicyWrapper::type):
(WebCore::DataTransferItemPolicyWrapper::getAsString):
(WebCore::DataTransferItemPolicyWrapper::getAsFile):
(WebCore::ClipboardChromium::clearData):
(WebCore::ClipboardChromium::clearAllData):
(WebCore::ClipboardChromium::getData):
(WebCore::ClipboardChromium::setData):
(WebCore::ClipboardChromium::types):
(WebCore::ClipboardChromium::files):
(WebCore::ClipboardChromium::setDragImage):
* platform/gtk/ClipboardGtk.cpp:
(WebCore::ClipboardGtk::clearData):
(WebCore::ClipboardGtk::clearAllData):
(WebCore::ClipboardGtk::getData):
(WebCore::ClipboardGtk::setData):
(WebCore::ClipboardGtk::types):
(WebCore::ClipboardGtk::files):
(WebCore::ClipboardGtk::setDragImage):
* platform/mac/ClipboardMac.mm:
(WebCore::ClipboardMac::clearData):
(WebCore::ClipboardMac::clearAllData):
(WebCore::ClipboardMac::getData):
(WebCore::ClipboardMac::setData):
(WebCore::ClipboardMac::types):
(WebCore::ClipboardMac::files):
(WebCore::ClipboardMac::setDragImage):
* platform/qt/ClipboardQt.cpp:
(WebCore::ClipboardQt::clearData):
(WebCore::ClipboardQt::clearAllData):
(WebCore::ClipboardQt::getData):
(WebCore::ClipboardQt::setData):
(WebCore::ClipboardQt::types):
(WebCore::ClipboardQt::files):
(WebCore::ClipboardQt::setDragImage):
(WebCore::ClipboardQt::items):
* platform/qt/DataTransferItemListQt.cpp:
(WebCore::DataTransferItemListQt::length):
(WebCore::DataTransferItemListQt::item):
(WebCore::DataTransferItemListQt::deleteItem):
(WebCore::DataTransferItemListQt::clear):
(WebCore::DataTransferItemListQt::add):
* platform/qt/DataTransferItemQt.cpp:
(WebCore::DataTransferItemQt::getAsString):
* platform/win/ClipboardWin.cpp:
(WebCore::ClipboardWin::clearData):
(WebCore::ClipboardWin::clearAllData):
(WebCore::ClipboardWin::getData):
(WebCore::ClipboardWin::setData):
(WebCore::ClipboardWin::types):
(WebCore::ClipboardWin::files):
(WebCore::ClipboardWin::setDragImage):

LayoutTests:

* editing/pasteboard/can-read-in-copy-and-cut-events-expected.txt: Added.
* editing/pasteboard/can-read-in-copy-and-cut-events.html: Added.
* editing/pasteboard/can-read-in-dragstart-event-expected.txt: Added.
* editing/pasteboard/can-read-in-dragstart-event.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinates.idl lacks Conditional=GEOLOCATION
https://bugs.webkit.org/show_bug.cgi?id=112949

Patch by Steve Block <steveblock@chromium.org> on 2013-03-22
Reviewed by Steve Block.

No new tests, build optimization only.

* page/Coordinates.idl: Added GEOLOCATION conditional guard.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for TransformationMatrix
https://bugs.webkit.org/show_bug.cgi?id=113087

Patch by ChangSeok Oh <changseok.oh@collabora.com> on 2013-03-22
Reviewed by Martin Robinson.

This is a trivial build fix for clutter ac backend. Clutter AC backend doesn't use
TextureMapper so there is nowhere including TransformationMatrix.h.
For the reason, we include it explicitly.

No new tests because of no functionality change.

* platform/graphics/clutter/GraphicsContext3DPrivate.cpp:
* platform/graphics/clutter/GraphicsContext3DPrivate.h:
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup text track selection logic
https://bugs.webkit.org/show_bug.cgi?id=113062

Reviewed by Jer Noble.

No new tests, covered by existing tests.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind): Remove.
(WebCore::HTMLMediaElement::configureTextTrackGroup): Don't look at track attributes directly,
    use captionPreferences->textTrackSelectionScore to calculate track rank.
(WebCore::HTMLMediaElement::setClosedCaptionsVisible): Set m_processingPreferenceChange here
    instead of in captionPreferencesChanged.
(WebCore::HTMLMediaElement::captionPreferencesChanged): Don't suppress calls to setClosedCaptionsVisible,
    existing code already makes sure we don't do unnecessary work.
* html/HTMLMediaElement.h:

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay): Drive by cleanup, don't
    process inactive cues.

* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::changedClosedCaptionsVisibility): Call resetTrackListMenu instead
    of updateDisplay so we only mark the menu as needing a recalculation and do the work when
    it is displayed.

* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::shouldShowCaptions): When in testing mode, return true if
    the caption or subtitle preference has been set.
(WebCore::CaptionUserPreferences::setShouldShowCaptions): In testing mode, clear the caption
    and subtitle preference when passed false.
(WebCore::CaptionUserPreferences::textTrackSelectionScore): Calculate the track score based on
    track type preference and preferred language.
(WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Score a track according to
    the language presence and position in the preferred languages list.
* page/CaptionUserPreferences.h:

* page/CaptionUserPreferencesMac.h:
* page/CaptionUserPreferencesMac.mm:
(WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Calculate track language score 
    according to user preferences.

* platform/Language.cpp:
(WebCore::indexOfBestMatchingLanguageInList): Repurposed the static bestMatchingLanguage
    function to return the location of a language in a Vector.
(WebCore::preferredLanguageFromList): Removed.
* platform/Language.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make it possible to run layout tests on Retina MBP
https://bugs.webkit.org/show_bug.cgi?id=93673

Reviewed by Ryosuke Niwa.

Use NSWindow SPI and override -backingScaleFactor so that WKTR and DRT
windows on 2x machines still run at 1x.

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):
Reset the window resolution to 1x on creation.
* DumpRenderTree/mac/DumpRenderTreeWindow.h: Add NSWindow details.
* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
(-[DumpRenderTreeWindow backingScaleFactor]): Override, always return 1.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(-[WebKitTestRunnerWindow backingScaleFactor]): Override, always return 1.
(WTR::PlatformWebView::PlatformWebView):
Add NSWindow details, reset the window resolution to 1x on creation.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Force kill gcc-3.exe during bindings generation tests to avoid process hangs.

This problem is occuring on the WinEWS bots where there are somehow multiple gcc-3 processes existing at the same time.
This is a speculative fix. There should only be 1 gcc-3.exe process running at a time ever.

* bindings/scripts/preprocessor.pm:
(applyPreprocessor):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146651 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add failing test expectations to the test added by r146644 on Mac.
The failure is tracked by http://webkit.org/b/113094.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG folding of PutById to SimpleReplace should consider the specialized function case
https://bugs.webkit.org/show_bug.cgi?id=113093

Reviewed by Geoffrey Garen and Mark Hahnenberg.

Source/JavaScriptCore: 

* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFor):

LayoutTests: 

* fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function-expected.txt: Added.
* fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.html: Added.
* fast/js/jsc-test-list:
* fast/js/script-tests/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.js: Added.
(foo):
(baz):
(fuzz):



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