[Chromium] Fix the find-in-page implementation for detaching frames.
https://bugs.webkit.org/show_bug.cgi?id=97807

Reviewed by Adam Barth.

Follow-up of 97688. Introduces proper test coverage for the find-in-page
feature in detaching/detached frame situations, fixing a few crashes and
ensuring that a final reply is always sent.

* public/WebNode.h:
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::find):
(WebKit::WebFrameImpl::scopeStringMatches):
(WebKit::WebFrameImpl::flushCurrentScopingEffort):
(WebKit):
(WebKit::WebFrameImpl::finishCurrentScopingEffort):
(WebKit::WebFrameImpl::cancelPendingScopingEffort):
(WebKit::WebFrameImpl::WebFrameImpl):
(WebKit::WebFrameImpl::setWebCoreFrame):
(WebKit::WebFrameImpl::initializeAsMainFrame):
(WebKit::WebFrameImpl::createChildFrame):
(WebKit::WebFrameImpl::shouldScopeMatches):
(WebKit::WebFrameImpl::willDetachPage):
* src/WebFrameImpl.h:
(WebFrameImpl):
* src/WebNode.cpp:
(WebKit::WebNode::remove):
(WebKit):
* tests/WebFrameTest.cpp:
* tests/data/find_in_page.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Run multiple tasks per transaction tick
https://bugs.webkit.org/show_bug.cgi?id=97738

Reviewed by Tony Chang.

Process multiple tasks from the pending queue(s) when the timer fires. The
task may initiate new tasks that change which queue is active (e.g. indexing
operations) so the loop must re-check each tick which queue to use.

In DumpRenderTree, time to make 20k puts/20k gets dropped from 3.2s to 2.0s (-37%);
in Chromium's content_shell, the time dropped from 8.1s to 4.6s (-42%).

No new tests - just perf improvements, covered by (nearly) all existing IDB tests.

* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::abort): Use takeFirst() to clean up code.
(WebCore::IDBTransactionBackendImpl::taskTimerFired): Process as many tasks as are available.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add parseDateTime, formatDateTime, and dateFormatText to Localizer
https://bugs.webkit.org/show_bug.cgi?id=97885

Reviewed by Kentaro Hara.

Source/WebCore:

This is a preparation to remove LocalizedData.h.

Add the following pure virtual member functions to Localizer.
  parseDateTime
  formatDateTime
  dateFormatText.

We rename existing parse/format functions for type=date in Locale*
classes, and extend their functionality so that they support other
date/time types. They override the new functions of Localizer.

No new tests. This should not change any behavior.

* platform/text/Localizer.h:
(Localizer): Add parseDateTime, formatDateTime, and dateFormatText.

* platform/text/LocaleICU.h:
(LocaleICU):
- Rename parseLocalizedDate to parseDateTime
- Add type argument to parseDateTime
- Rename formatLocalizedDate to formatDateTime
- Rename localizedDateFormatText to dateFormatText
- Make parseDateTime/formatDateTime/dateFormatText virtual.
* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::parseDateTime):
Renamed. Reject non-date types.
(WebCore::LocaleICU::formatDateTime): ditto.
(WebCore::LocaleICU::dateFormatText): Renamed.
* platform/text/LocalizedDateICU.cpp: Moved some code to LocaleICU.cpp.
(WebCore::parseLocalizedDate):
(WebCore::formatLocalizedDate):

* platform/text/LocaleNone.cpp:
Add empty implementations of parseDateTime, formatDateTime, and
dateFormatText.
(LocaleNone):
(WebCore::LocaleNone::parseDateTime):
(WebCore::LocaleNone::formatDateTime):
(WebCore::LocaleNone::dateFormatText):

* platform/text/LocaleWin.h:
(LocaleWin):
- Rename parseDate to parseDateTime
- Add type argument to parseDateTime
- Rename formatDate to formatDateTime
- Make parseDateTime/formatDateTime/dateFormatText virtual.
* platform/text/LocaleWin.cpp:
(WebCore::LocaleWin::parseDateTime):
Renamed. Reject non-date types.
(WebCore::LocaleWin::formatDateTime): ditto.
* platform/text/LocalizedDateWin.cpp: Moved some code to LocaleWin.cpp.
(WebCore::parseLocalizedDate):
(WebCore::formatLocalizedDate):

* platform/text/mac/LocaleMac.h:
(LocaleMac):
- Rename parseDate to parseDateTime
- Add type argument to parseDateTime
- Rename formatDate to formatDateTime
- Make parseDateTime/formatDateTime/dateFormatText virtual.
* platform/text/mac/LocaleMac.mm:
(WebCore::LocaleMac::parseDateTime):
Renamed. Reject non-date types.
(WebCore::LocaleMac::formatDateTime): ditto.
* platform/text/mac/LocalizedDateMac.cpp: Moved some code to LocaleMac.mm.
(WebCore::parseLocalizedDate):
(WebCore::formatLocalizedDate):

Source/WebKit/chromium:

* tests/LocaleMacTest.cpp: Follow renaming of LocaleMac functions.
(LocaleMacTest::formatDate):
(LocaleMacTest::parseDate):
* tests/LocaleWinTest.cpp: Follow renaming of LocaleWin functions.
(LocaleWinTest::formatDate):
(LocaleWinTest::parseDate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r129751.
http://trac.webkit.org/changeset/129751
https://bugs.webkit.org/show_bug.cgi?id=97921

Causes crashes on mac and win (Requested by vsevik on
#webkit).

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

* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::getContext):
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::instrumentFunctionCall):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
* bindings/js/ScriptCallStackFactory.cpp:
(WebCore::createScriptCallStackForInspector):
* bindings/js/ScriptCallStackFactory.h:
(WebCore):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateCallWith):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
(WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
(WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrGetter):
(WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrSetter):
(WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackCallback):
* bindings/v8/ScriptCallStackFactory.cpp:
(WebCore::createScriptCallStackForInspector):
* bindings/v8/ScriptCallStackFactory.h:
(WebCore):
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::callFunctionWithInstrumentation):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::setIsolatedWorldSecurityOrigin):
* bindings/v8/V8WorkerContextEventListener.cpp:
(WebCore::V8WorkerContextEventListener::callListenerFunction):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::WindowSetTimeoutImpl):
* bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
(WebCore::V8HTMLCanvasElement::getContextCallback):
* bindings/v8/custom/V8WorkerContextCustom.cpp:
(WebCore::SetTimeoutOrInterval):
* inspector/Inspector.json:
* inspector/InspectorConsoleAgent.cpp:
(WebCore::InspectorConsoleAgent::InspectorConsoleAgent):
(WebCore::InspectorConsoleAgent::enable):
(WebCore::InspectorConsoleAgent::disable):
(WebCore::InspectorConsoleAgent::clearMessages):
(WebCore::InspectorConsoleAgent::clearFrontend):
(WebCore::InspectorConsoleAgent::addConsoleMessage):
* inspector/InspectorConsoleAgent.h:
(InspectorConsoleAgent):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::hasFrontendForScriptContext):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::hasFrontendForScriptContext):
* inspector/InspectorRuntimeAgent.cpp:
(WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
* inspector/InspectorRuntimeAgent.h:
(InspectorRuntimeAgent):
* inspector/PageRuntimeAgent.cpp:
(PageRuntimeAgentState):
(WebCore::PageRuntimeAgent::clearFrontend):
(WebCore::PageRuntimeAgent::restore):
(WebCore::PageRuntimeAgent::setReportExecutionContextCreation):
(WebCore::PageRuntimeAgent::didClearWindowObject):
(WebCore::PageRuntimeAgent::didCreateIsolatedContext):
* inspector/PageRuntimeAgent.h:
(PageRuntimeAgent):
* inspector/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::setReportExecutionContextCreation):
(WebCore):
* inspector/WorkerRuntimeAgent.h:
(WorkerRuntimeAgent):
* inspector/front-end/RuntimeModel.js:
(WebInspector.RuntimeModel.prototype._didLoadCachedResources):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
flexbox assert fails with auto-sized item with padding
https://bugs.webkit.org/show_bug.cgi?id=97606

Reviewed by Ojan Vafai.

Source/WebCore:

Depending on the denominator of FractionalLayoutUnit, we can lose precision when
converting to a float.  This would cause a rounding error in flex-shrink to trigger an ASSERT.
To avoid this problem in the future, switch to using doubles for flex-shrink and flex-grow
at layout time.  The CSS values themselves are still floats.

Test: css3/flexbox/negative-flex-rounding-assert.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutFlexItems): Use doubles for local variables.
(WebCore::RenderFlexibleBox::computeNextFlexLine): Pass in doubles.
(WebCore::RenderFlexibleBox::freezeViolations): Pass in doubles.
(WebCore::RenderFlexibleBox::resolveFlexibleLengths): Pass in doubles.
* rendering/RenderFlexibleBox.h:

LayoutTests:

Add a test that hits an ASSERT when FractionalLayoutUnit denominator is 60.

* css3/flexbox/negative-flex-rounding-assert-expected.txt: Added.
* css3/flexbox/negative-flex-rounding-assert.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Extend composited  in-region scrolling to iframes/frames
https://bugs.webkit.org/show_bug.cgi?id=97922
PR #197093

Reviewed by Yong Li.
Patch by Antonio Gomes <agomes@rim.com>
Internaly reviewed by Arvid Nilsson.

Add support for composited scrolling in a inner frame level:

1) When creating an InRegionScrollableArea, for a inner scrollable frame,
cache and camouflag the appropriated scroll layer (i.e. RenderLayerCompositor::scrollLayer);

2) Differentiate what type of scroll target we are at: BlockElement or
InnerFrame;

3) Change the signature of the public methods to support and newly passed
in ScrollTarget parameter;
As a side note, this parameter is needed in order to know what class to static_cast
the GraphicsLayer::client to: in the case of a composited scrollable inner frame, the client
is a RenderLayerCompositor; in case of a composited scrollable block element, the client
is a RenderLayerBacking.

* Api/InRegionScroller.cpp:
(BlackBerry::WebKit::InRegionScroller::setScrollPositionWebKitThread):
(BlackBerry::WebKit::InRegionScrollerPrivate::setScrollPositionWebKitThread):
* Api/InRegionScroller.h:
* Api/InRegionScroller_p.h:
(InRegionScrollerPrivate):
* WebCoreSupport/ChromeClientBlackBerry.h:
(WebCore::ChromeClientBlackBerry::allowedCompositingTriggers):
* WebKitSupport/InRegionScrollableArea.cpp:
(BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow ports to override text track rendering style
<rdar://problem/12044964>

Reviewed by Jessie Berlin.

Update WKSI libraries.

* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceMountainLion.a:
* libWebKitSystemInterfaceSnowLeopard.a:


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