[chromium] Remove BufferDrag from WebClipboard::Buffer enum.
https://bugs.webkit.org/show_bug.cgi?id=74227

Reviewed by Tony Chang.

This enum value was intended for asynchronous data retrieval during drop operations; since
that was never implemented, I'm removing this enum value.

* public/platform/WebClipboard.h:
* src/AssertMatchingEnums.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Remove assumption that empty surface is always at end of list
https://bugs.webkit.org/show_bug.cgi?id=74037

Patch by Shawn Singh <shawnsingh@chromium.org> on 2011-12-12
Reviewed by James Robinson.

Source/WebCore:

Test case added to CCLayerTreeHostCommonTest.cpp, which reproduces
a crash reported in http://code.google.com/p/chromium/issues/detail?id=106734

This patch fixes the crash in a less risky way to be merged into
m17, but the root of the issue needs to be addressed in a
follow-up patch.

* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateDrawTransformsAndVisibilityInternal):

Source/WebKit/chromium:

* tests/CCLayerTreeHostCommonTest.cpp:
(WebCore::TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename webkitCancelRequestAnimationFrame to webkitCancelAnimationFrame to match spec change
https://bugs.webkit.org/show_bug.cgi?id=74231

Patch by James Robinson <jamesr@chromium.org> on 2011-12-12
Reviewed by Simon Fraser.

Source/WebCore:

The RequestAnimationFrame spec has renamed cancelRequestAnimationFrame to cancelAnimationFrame in response to
feedback from Mozilla and Microsoft that the old name was too long and didn't parallel setTimeout/clearTimeout
and setInterval/clearInterval very well. This updates our IDL to match, while preserving the old name as an
alias to be compatible with current content.

* dom/Document.cpp:
(WebCore::Document::webkitCancelAnimationFrame):
* dom/Document.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::webkitCancelAnimationFrame):
* page/DOMWindow.h:
(WebCore::DOMWindow::webkitCancelRequestAnimationFrame):
* page/DOMWindow.idl:

LayoutTests:

Update requestAnimationFrame tests to refer to the new function name.

* fast/animation/request-animation-frame-missing-arguments.html:
* fast/animation/script-tests/request-animation-frame-cancel.js:
(window):
* fast/animation/script-tests/request-animation-frame-cancel2.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
r102234 caused RuleData to use 33 bits in its bitmask
https://bugs.webkit.org/show_bug.cgi?id=74314

Reviewed by Antti Koivisto.

Lower m_position to something more reasonable. A million
should be plenty. Current large sites (e.g. gmail) seem to use
tens of thousands.

Added a COMPILE_ASSERT to ensure this doesn't regress.

No new tests.

* css/CSSStyleSelector.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename QueueClient::willProcessMessageOnClientRunLoop
https://bugs.webkit.org/show_bug.cgi?id=74325

Reviewed by Sam Weinig.

Rename the QueueClient willProcessMessageOnClientRunLoop function to didReceiveMessageOnConnectionWorkQueue
and give it an out parameter to indicate whether the message was handled or not. This makes it more clear that
the function is expected to handle the message.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::processIncomingMessage):
* Platform/CoreIPC/Connection.h:
* Scripts/webkit2/messages.py:
(async_case_statement):
* Scripts/webkit2/messages_unittest.py:
* WebProcess/WebConnectionToUIProcess.cpp:
(WebKit::WebConnectionToUIProcess::didReceiveMessageOnConnectionWorkQueue):
* WebProcess/WebConnectionToUIProcess.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessageOnConnectionWorkQueue):
* WebProcess/WebProcess.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add WKConnection objective-c wrapper around WKConnectionRef
<rdar://problem/10446092>
https://bugs.webkit.org/show_bug.cgi?id=74324

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKConnection.h: Added.
* UIProcess/API/mac/WKConnection.mm: Added.
(-[WKConnection dealloc]):
(-[WKConnection connectionRef]):
(-[WKConnection delegate]):
(-[WKConnection setDelegate:]):
(didReceiveMessage):
(didClose):
(setUpClient):
(-[WKConnection initWithConnectionRef:]):
* UIProcess/API/mac/WKConnectionInternal.h: Added.
Added new class.

* UIProcess/API/mac/WKProcessGroup.h:
* UIProcess/API/mac/WKProcessGroup.mm:
(didCreateConnection):
(setUpConnectionClient):
(-[WKProcessGroup initWithInjectedBundleURL:]):
(-[WKProcessGroup delegate]):
(-[WKProcessGroup setDelegate:]):
Add WKProcessGroupDelegate to inform the user of when connections are established.

* WebKit2.xcodeproj/project.pbxproj:
Add new files.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Page cache should support pages with plugins.
<rdar://problem/5190122> and https://bugs.webkit.org/show_bug.cgi?id=13634

Source/WebCore: 

Reviewed by Anders Carlsson.

By making plugin elements renderers go display:none when entering the page cache,
we destroy the plug-in in a cross platform way as well as handle invalidating script
objects created by that plugin.

By restoring the original style when leaving the page cache and forcing a style recalc
on the plugin element, the plugin is gracefully reinstantiated when the user goes back.

Test: plugins/netscape-plugin-page-cache-works.html

* dom/Document.cpp:
(WebCore::Document::documentDidBecomeActive): Copy this collection before iterating over
  it, as the callbacks might result in mutating the set.

* dom/Node.h:
(WebCore::Node::setHasCustomStyleForRenderer):
(WebCore::Node::clearHasCustomStyleForRenderer): Expose the ability to stop using a 
  custom renderer and go back to the default renderer.

* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame): Move the document inactivation call to the same place
  we suspend active DOM objects. It is important this call be *after* the beforeunload event
  is dispatched, and was coincidental non of the elements that using Document activation
  had run in to this problem yet.

* history/PageCache.cpp:
(WebCore::logCanCacheFrameDecision):
(WebCore::PageCache::canCachePageContainingThisFrame): If the page contains plugins but
  the PageCacheSupportsPlugins setting is true, allow this page.

Kill and recreate the plugin by listening for Document activation callbacks and setting a custom
display:none render style:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
(WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement): Unregister for document activation
  callbacks.
(WebCore::HTMLPlugInImageElement::createRenderer): Once a renderer (ie. plugin instance) is
  created, this element needs Document (in)activation callbacks.
(WebCore::HTMLPlugInImageElement::willMoveToNewOwnerDocument): Manage Document activation 
  callback registration.
(WebCore::HTMLPlugInImageElement::didMoveToNewOwnerDocument): Ditto.
(WebCore::HTMLPlugInImageElement::documentWillBecomeInactive): Clone the element's current style
  and set the clone's display value to None. Start using this custom style and force a style
  recall. This destroys the renderer and therefore the plugin instance.
(WebCore::HTMLPlugInImageElement::documentDidBecomeActive): Stop using the custom style and
  force a style recall to reinstantiate the plugin.
(WebCore::HTMLPlugInImageElement::customStyleForRenderer): Return the stand-in style that has
  display:none set.
* html/HTMLPlugInImageElement.h:

Add a setting that allows runtime configuration of whether or not the page cache supports plugins:
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setPageCacheSupportsPlugins):
(WebCore::Settings::pageCacheSupportsPlugins):

Source/WebKit/mac: 

Expose a WebKit preference for the page cache supporting plugins (on by default).

Reviewed by Anders Carlsson.

* WebView/WebPreferenceKeysPrivate.h:

* WebView/WebPreferences.mm:
(-[WebPreferences pageCacheSupportsPlugins]):
(-[WebPreferences setPageCacheSupportsPlugins:]):
* WebView/WebPreferencesPrivate.h:

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2: 

Expose a WebKit2 preference for the page cache supporting plugins (on by default).

Reviewed by Anders Carlsson.

* Shared/WebPreferencesStore.h:

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPageCacheSupportsPlugins):
(WKPreferencesGetPageCacheSupportsPlugins):
* UIProcess/API/C/WKPreferencesPrivate.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests: 

Reviewed by Anders Carlsson.

* plugins/netscape-plugin-page-cache-works-expected.txt: Added.
* plugins/netscape-plugin-page-cache-works.html: Added.
* plugins/resources/go-back.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix compilation error when !ENABLE(WORKERS)
https://bugs.webkit.org/show_bug.cgi?id=74029

Reviewed by Yury Semikhatsky.

Source/WebCore:

* storage/IDBFactory.cpp:
(WebCore::IDBFactory::open): add #if ENABLE(WORKERS) guard

Source/WebKit/chromium:

* features.gypi:
* src/IDBFactoryBackendProxy.cpp:
(WebKit::IDBFactoryBackendProxy::openFromWorker):
* src/PlatformSupport.cpp:
* src/WebDevToolsAgentImpl.cpp:
(WebKit::WebDevToolsAgent::disconnectEventAsText):
* src/WebWorkerRunLoop.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
COMPILE_ASSERT in CSSStyleSelector.cpp doesn't compile on Windows
https://bugs.webkit.org/show_bug.cgi?id=74327

Unreviewed build fix. True fix should follow under above bug.

* css/CSSStyleSelector.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove platform/audio/fftw
https://bugs.webkit.org/show_bug.cgi?id=73163

Reviewed by Eric Seidel.

The FFTW library is GPL, not LGPL, like WebKit.  This patch removes the
integration with the library so folks who use WebAudio don't
accidentially violate the GPL by linking in FFTW.

* GNUmakefile.am:
* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* platform/audio/FFTFrame.h:
* platform/audio/FFTFrameStub.cpp:
* platform/audio/fftw: Removed.
* platform/audio/fftw/FFTFrameFFTW.cpp: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG GetByVal CSE incorrectly assumes that a non-matching PutByVal cannot clobber
https://bugs.webkit.org/show_bug.cgi?id=74329

Reviewed by Gavin Barraclough.

Source/JavaScriptCore: 

* dfg/DFGPropagator.cpp:
(JSC::DFG::Propagator::getByValLoadElimination):

LayoutTests: 

* fast/js/dfg-get-by-val-clobber-expected.txt: Added.
* fast/js/dfg-get-by-val-clobber.html: Added.
* fast/js/script-tests/dfg-get-by-val-clobber.js: Added.
(doAccesses):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simplify autotools configure.ac
https://bugs.webkit.org/show_bug.cgi?id=74312

Patch by Andy Wingo <wingo@igalia.com> on 2011-12-12
Reviewed by Martin Robinson.

.:

* configure.ac: Don't AC_DEFINE so many things.  Many of the
defines were stale (ENABLE_YARR, ENABLE_JIT_OPTIMIZE_CALL, etc),
and with Platform.h we don't need to make an explicit decision
here.  If the user does pass --enable-jit or --disable-jit, effect
that choice via setting JSC_CPPFLAGS.

Source/JavaScriptCore:

* GNUmakefile.am: Add JSC_CPPFLAGS to javascriptcore_cppflags.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused getter on WKConnection.

Reviewed by Dan Bernstein.

* UIProcess/API/mac/WKConnection.mm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update html5lib test data to latest version
https://bugs.webkit.org/show_bug.cgi?id=74343

Reviewed by Eric Seidel.

This patch imports the latest version of the "dat" files from
http://code.google.com/p/html5lib/

* html5lib/resources/pending-spec-changes.dat:
* html5lib/resources/plain-text-unsafe.dat:
* html5lib/resources/tables01.dat:
* html5lib/resources/tests16.dat:
* html5lib/resources/tests19.dat:
* html5lib/resources/tests26.dat:
* html5lib/resources/tests_innerHTML_1.dat:
* html5lib/resources/webkit01.dat:
* html5lib/runner-expected.txt:
* html5lib/webkit-resumer-expected.txt:
* platform/chromium/html5lib/runner-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit code shouldn't be calling applyCommand directly
https://bugs.webkit.org/show_bug.cgi?id=74337

Reviewed by Darin Adler.

Source/WebCore: 

Make WebKit-layer code call Editor::replaceSelectionWithFragment and Editor::replaceSelectionWithText
instead of manually creating and applying ReplaceSelectionCommand.

The only behavioral difference is that new code will end up checking for spell checks. However, this
difference appears to be unintentional since the code predates http://trac.webkit.org/changeset/73886,
which introduced an invocation of spellcheck code.

Unfortunately no tests since there doesn't seem to be anyway to test this change.

* WebCore.exp.in:
* editing/EditCommand.cpp:
(WebCore::applyCommand):
* editing/EditCommand.h:
* editing/Editor.h:

Source/WebKit/chromium: 

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::replaceSelection):

Source/WebKit/gtk: 

* webkit/webkitwebframe.cpp:
(webkit_web_frame_replace_selection):

Source/WebKit/mac: 

* WebView/WebFrame.mm:
(-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):

Source/WebKit2: 

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::replaceSelectionWithText):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Windows build fix after http://trac.webkit.org/changeset/102619 .
Remove OVERRIDE specifier from virtual destructor.

* html/HTMLPlugInImageElement.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102628 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ARMv7 version of DFG soft modulo does register allocation inside of control flow
https://bugs.webkit.org/show_bug.cgi?id=74354

Reviewed by Gavin Barraclough.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileSoftModulo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Chromium expectations update; skip
plugins/netscape-plugin-page-cache-works.html.

* platform/chromium/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Eliminate Duplicate word at a time equal code in StringImpl.cpp and StringHash.h
https://bugs.webkit.org/show_bug.cgi?id=73622

Reviewed by Oliver Hunt.

Moved equal(charType1 *, charType2, unsigned) template methods
from static StringImpl.cpp to StringImpl.h and then replaced the
processor specific character comparison code in StringHash::equal
with calls to these methods.

This change is worth 3% on SunSpider string-unpack-code as reported
by the SunSpider command line harness.  No other tests appear to
have measurable performance changes.

* wtf/text/AtomicString.h:
(WTF::operator==):
* wtf/text/StringHash.h:
(WTF::StringHash::equal):
* wtf/text/StringImpl.cpp:
* wtf/text/StringImpl.h:
(WTF::LChar):
(WTF::UChar):
(WTF::equal):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
When the mouse is dragged out of an :active element, it should lose :hover.
https://bugs.webkit.org/show_bug.cgi?id=57206

Patch by Jeremy Apthorp <jeremya@chromium.org> on 2011-12-12
Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: fast/css/hover-active-drag.html

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseMoveEvent): Don't mark mouse-drag hit tests read-only, since they no longer are.
(WebCore::EventHandler::dragSourceEndedAt): Send a hit test request when the mouse goes up after a drag, so
RenderLayer has a chance to update the hover/active status.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateHoverActiveState): Only allow the :active state to change on mouse down or mouse up.

LayoutTests:

* fast/css/hover-active-drag-expected.txt: Added.
* fast/css/hover-active-drag.html: Added.
* platform/mac/fast/css/hover-active-drag-expected.txt: Removed.
* platform/chromium/fast/css/hover-active-drag-expected.txt: Removed.

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