Implement new flex property and deprecate flex function
https://bugs.webkit.org/show_bug.cgi?id=82128

Reviewed by Ojan Vafai.

Source/WebCore:

No new tests. Tests were updated to use the new syntax and they should
all pass.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::preferredFlexLengthForChild): Grab the
preferred size and if it's auto, fall back to width or height.
(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
(WebCore::RenderFlexibleBox::positiveFlexForChild): Use the value from the flex property.
(WebCore::RenderFlexibleBox::negativeFlexForChild): Use the value from the flex property.
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
* rendering/RenderFlexibleBox.h:

LayoutTests:

Update tests to use the -webkit-flex: propery instead of the function.
In most cases this was just a simple find & replace, but in a few cases
we had to clear the flex value.

* css3/flexbox/auto-height-dynamic.html:
* css3/flexbox/child-overflow.html:
* css3/flexbox/columns-auto-size.html:
* css3/flexbox/cross-axis-scrollbar.html:
* css3/flexbox/flex-algorithm-min-max.html:
* css3/flexbox/flex-algorithm-with-margins.html:
* css3/flexbox/flex-algorithm.html:
* css3/flexbox/flex-align-column.html:
* css3/flexbox/flex-align-max.html:
* css3/flexbox/flex-align-percent-height.html:
* css3/flexbox/flex-align-stretch.html:
* css3/flexbox/flex-align-vertical-writing-mode.html:
* css3/flexbox/flex-align.html:
* css3/flexbox/flex-flow-border.html:
* css3/flexbox/flex-flow-margins-auto-size-expected.txt: This test had expected failures that needed to be updated.
* css3/flexbox/flex-flow-margins-auto-size.html:
* css3/flexbox/flex-flow-margins.html:
* css3/flexbox/flex-flow-overflow.html:
* css3/flexbox/flex-flow-padding.html:
* css3/flexbox/flex-flow.html:
* css3/flexbox/flex-no-flex.html:
* css3/flexbox/flex-order.html:
* css3/flexbox/flex-pack.html:
* css3/flexbox/line-wrapping.html:
* css3/flexbox/multiline-align.html:
* css3/flexbox/multiline-line-pack-horizontal-column.html:
* css3/flexbox/multiline-reverse-wrap-baseline.html:
* css3/flexbox/multiline-reverse-wrap-overflow.html:
* css3/flexbox/multiline.html:
* css3/flexbox/orthogonal-flex-directions.html:
* css3/flexbox/position-absolute-child.html:
* css3/flexbox/repaint-rtl-column.html:
* css3/flexbox/repaint.html:
* css3/flexbox/writing-modes.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
presentationAttributeCacheMaximumSize is set too low
https://bugs.webkit.org/show_bug.cgi?id=82816

Reviewed by Antti Koivisto.

Performance change, no side effects anticipated.

Prior to r106740, the presentation attribute style cache used to grow unbounded. As part of r110316,
a different version of the cache was introduced with a maximum size of 128. This size gave a 75% hit rate.

However this is bad as the previous cache had a 85% hit rate** and each miss propagate down to the matched
properties cache as we use pointer comparisons.

This change bumps the size to 4096. This size was chosen to bring us back to the previous hit rate while
being a power of 2 (it is the HashMap maximum size). The steep increase is due to the combinational compexity
of the new cache model: we need to match all our attributes' name, value and tag name to get a hit vs
one attribute name, value and a category in the previous cache. To avoid blowing up the memory, we introduced
a timer to clear the cache if the hit rate is too low.

The measured hit rate is actually better now - in the 90% range on most page cyclers. This ups the matched
properties hit rate by 1 percent point on presentation attributes.

** This is not a true apple-to-apple comparison as the cache model was changed.

* dom/StyledElement.cpp:
(PresentationAttributeCacheCleaner):
(WebCore::PresentationAttributeCacheCleaner::PresentationAttributeCacheCleaner):
(WebCore::PresentationAttributeCacheCleaner::didHitPresentationAttributeCache):
(WebCore::PresentationAttributeCacheCleaner::cleanCache):
(WebCore):
(WebCore::presentationAttributeCacheCleaner):
(WebCore::StyledElement::updateAttributeStyle):
Added the logic to clean the presentation attribute cache if we drop below 100 hits per minutes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in SelectorChecker::checkOneSelector.
https://bugs.webkit.org/show_bug.cgi?id=83040

Reviewed by Antti Koivisto.

Source/WebCore:

Test: fast/css/css-set-selector-text-crash.html

Removing the early bail when we detect that our selector text
hasn't changed, and we don't notify the styleSelectorChanged.
In fact, when we adopt the new selector list, the old one will
get destroyed and the styleSelectorChanged call needs to be made.

* css/CSSStyleRule.cpp:
(WebCore::CSSStyleRule::setSelectorText):

LayoutTests:

* fast/css/css-set-selector-text-crash-expected.txt: Added.
* fast/css/css-set-selector-text-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Temporary fix to allow people on Ubuntu 11.10 or on GCC 4.6 to compile webkit
and ignore the nullptr keyword warning. This change can be reverted once our upstream
fix gets accepted for WebKit.
[Qt][WK2] Remove #if !USE(TILED_BACKING_STORE) from WebFrameLoaderClient::transitionToCommittedForNewPage()
https://bugs.webkit.org/show_bug.cgi?id=83070

Patch by Zalan Bujtas <zbujtas@gmail.com> on 2012-04-03
Reviewed by Andreas Kling.

It is preventing m_frameHasCustomRepresentation to be set properly and not in sync with
WebFrameLoaderClient::transitionToCommittedFromCachedFrame()

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix large leak in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=83084

Reviewed by Beth Dakin.

Fix a leak of the bimap backing store created when doing pixel and
ref tests. This leak was causing serious thrash on the test bots.

We don't need to allocate memory for CGBitmapContextCreate(); if we
pass NULL, it will allocate and manage its own backing store.

* WebKitTestRunner/cg/TestInvocationCG.cpp:
(WTR::createCGContextFromImage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a Media watchlist.
https://bugs.webkit.org/show_bug.cgi?id=83071

Reviewed by David Levin.

* Scripts/webkitpy/common/config/watchlist:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r113087.
http://trac.webkit.org/changeset/113087
https://bugs.webkit.org/show_bug.cgi?id=83068

Breaks Windows builds in other unpredictable ways.

* WebKit.gyp: Removed the hack.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
run the same test steps on test only bots as on build-and-test bots
https://bugs.webkit.org/show_bug.cgi?id=83090

Reviewed by Ryosuke Niwa.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(TestFactory.__init__):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. This patch adds an ugly, ugly hack to bandaid over the
Windows component build. See comments in the code for details.

Source/Platform: 

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

Source/WebCore: 

* platform/chromium/support/WebMediaStreamSourcesRequest.cpp:
(WebKit::WebMediaStreamSourcesRequest::dummy):
(WebKit):

Source/WebKit/chromium: 

* src/WebKit.cpp:
(WebKit::shutdown):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Manual submission for bug 82942.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Makes sure m_showingByDefault is set to false when TextTrack.mode is set from JS.
https://bugs.webkit.org/show_bug.cgi?id=79791

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/track/track-mode.html

* html/track/TextTrack.cpp:
(WebCore::TextTrack::setMode): setMode should always setShowingByDefault to false.

LayoutTests:

* media/track/track-mode-expected.txt: Added.
* media/track/track-mode.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use V8 completion callback API to assert that V8RecursionScope is on the stack whenever invoking script
https://bugs.webkit.org/show_bug.cgi?id=79131

Reviewed by Adam Barth.

Source/WebCore:

End-of-microtask work (cancelling outstanding IDB transactions,
delivering DOM mutations) depend on V8RecursionScope being on the
stack whenever a call is made into script. V8 provides a completion
callback API that could be used to hook these "end-of-microtask"
events, but it turns out that WebKit calls into script for various
reasons besides running script from the page. For example, constructing
wrapper objects from function templates counts as "running script",
yet it's not appropriate to run this callback every time a JS wrapper
is constructed.

Instead, this patch makes use of the V8 completion callback mechanism
only in debug mode, to assert that either a V8RecursionScope (when
calling author script) or a V8RecursionScope::MicrotaskSuppression
(when calling non-author script) is on the stack when V8 thinks it's
finished executing script. This requires dropping MicrotaskSuppression
objects in a bunch of places, most notably the Inspector.
Note that in release mode, this class does nothing and thus should be
optimized away.

No new tests. Existing tests have appropriate coverage.

* Target.pri:
* WebCore.gypi:
* bindings/v8/DateExtension.cpp:
(WebCore::DateExtension::setAllowSleep):
* bindings/v8/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::addListener):
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::callFunctionEvenIfScriptDisabled):
(WebCore):
(WebCore::ScriptController::collectGarbage):
* bindings/v8/ScriptController.h:
(ScriptController):
* bindings/v8/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::callDebuggerMethod):
(WebCore):
(WebCore::ScriptDebugServer::pauseOnExceptionsState):
(WebCore::ScriptDebugServer::setPauseOnExceptionsState):
(WebCore::ScriptDebugServer::stepIntoStatement):
(WebCore::ScriptDebugServer::stepOverStatement):
(WebCore::ScriptDebugServer::stepOutOfFunction):
(WebCore::ScriptDebugServer::setScriptSource):
(WebCore::ScriptDebugServer::currentCallFrame):
(WebCore::ScriptDebugServer::handleV8DebugEvent):
(WebCore::ScriptDebugServer::ensureDebuggerScriptCompiled):
* bindings/v8/ScriptDebugServer.h:
(ScriptDebugServer):
* bindings/v8/ScriptFunctionCall.cpp:
(WebCore::ScriptFunctionCall::call):
* bindings/v8/V8Binding.cpp:
(WebCore::V8BindingPerIsolateData::V8BindingPerIsolateData):
* bindings/v8/V8Binding.h:
(V8BindingPerIsolateData):
(WebCore::V8BindingPerIsolateData::internalScriptRecursionLevel):
(WebCore::V8BindingPerIsolateData::incrementInternalScriptRecursionLevel):
(WebCore::V8BindingPerIsolateData::decrementInternalScriptRecursionLevel):
* bindings/v8/V8DOMWindowShell.cpp:
* bindings/v8/V8DOMWrapper.cpp:
* bindings/v8/V8LazyEventListener.cpp:
(WebCore::V8LazyEventListener::prepareListenerObject):
* bindings/v8/V8NPObject.cpp:
* bindings/v8/V8RecursionScope.h:
(WebCore):
(WebCore::V8RecursionScope::recursionLevel):
(V8RecursionScope):
(WebCore::V8RecursionScope::properlyUsed):
(MicrotaskSuppression):
(WebCore::V8RecursionScope::MicrotaskSuppression::MicrotaskSuppression):
(WebCore::V8RecursionScope::MicrotaskSuppression::~MicrotaskSuppression):
* bindings/v8/WorkerContextExecutionProxy.cpp:
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::V8HTMLDocument::WrapInShadowObject):
* bindings/v8/custom/V8InjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::createInjectedScript):
* bindings/v8/custom/V8ScriptProfileCustom.cpp:
* bindings/v8/custom/V8ScriptProfileNodeCustom.cpp:

Source/WebKit/chromium:

* WebKit.gyp:
* public/WebFrame.h:
(v8):
(WebFrame):
* src/WebFrameImpl.cpp:
(WebKit):
(WebKit::WebFrameImpl::callFunctionEvenIfScriptDisabled):
* src/WebFrameImpl.h:
(WebFrameImpl):
* src/WebKit.cpp:
(WebKit):
(WebKit::assertV8RecursionScope):
(WebKit::initialize):
(WebKit::shutdown):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Linux crashes during boot
https://bugs.webkit.org/show_bug.cgi?id=83096

Reviewed by Filip Pizlo.

The bug here is that we add empty JSValues to the sparse map, and then set them
- but a GC may occur before doing so (due to a call to reportExtraMemory cost).
We may want to consider making it safe to mark empty JSValues, but the simple &
contained fix to this specific bug is to just initialize these values to
something other than JSValue().

* runtime/JSArray.cpp:
(JSC::SparseArrayValueMap::add):
    - Initialize sparse map entries.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Offlineasm ARM backend uses the wrong mnemonic for multiply
https://bugs.webkit.org/show_bug.cgi?id=83098
<rdar://problem/11168744>

Reviewed by Gavin Barraclough.
        
Use "mul" instead of "muls" since we're passing three operands, not two.

* offlineasm/armv7.rb:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
kill-old-processes should kill apache2 and httpd
https://bugs.webkit.org/show_bug.cgi?id=83065

Reviewed by Tony Chang.

Kill apache2 and httpd on Mac and Linux (Windows uses lighttpd) to free up port 8000.

* BuildSlaveSupport/kill-old-processes:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Another build fix. Don't use old-run-webkit-tests on Chromium Windows bots.

* Scripts/run-webkit-tests:
(useNewRunWebKitTests):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Include Image.h in TextFieldDecoratorImpl.cpp
https://bugs.webkit.org/show_bug.cgi?id=83066

Patch by Ian Vollick <vollick@chromium.org> on 2012-04-03
Reviewed by James Robinson.

* src/TextFieldDecoratorImpl.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKitTestRunner's EventSender is leaky
https://bugs.webkit.org/show_bug.cgi?id=83099

Reviewed by Beth Dakin.

Fix leaks of WKNumbers by using the adoptWK idiom, and make
all the code consistent.

* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseDown):
(WTR::EventSendingController::mouseUp):
(WTR::EventSendingController::mouseMoveTo):
(WTR::EventSendingController::leapForward):
(WTR::EventSendingController::keyDown):
(WTR::EventSendingController::mouseScrollBy):
(WTR::EventSendingController::addTouchPoint):
(WTR::EventSendingController::updateTouchPoint):
(WTR::EventSendingController::setTouchModifier):
(WTR::EventSendingController::releaseTouchPoint):
(WTR::EventSendingController::cancelTouchPoint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test media/video-source-error.html is flaky on cr-win
https://bugs.webkit.org/show_bug.cgi?id=80068

Unreviewed; test is no longer showing up on flakiness dashboard.


* platform/chromium/test_expectations.txt:


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