[EFL][DRT] Implement TextInputController.
https://bugs.webkit.org/show_bug.cgi?id=78559

Patch by Kangil Han <kangil.han@samsung.com> on 2012-05-08
Reviewed by Martin Robinson.

TextInputController has been created for an input emulation purpose in DRT.
However, not like other ports, EFL doesn't have it.
Therefore, this patch will enable EFL port to have an input emulation in DRT.

Source/WebKit/efl:

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::setComposition):
(DumpRenderTreeSupportEfl::hasComposition):
(DumpRenderTreeSupportEfl::compositionRange):
(DumpRenderTreeSupportEfl::confirmComposition):
(DumpRenderTreeSupportEfl::firstRectForCharacterRange):
(DumpRenderTreeSupportEfl::selectedRange):
* WebCoreSupport/DumpRenderTreeSupportEfl.h:

Tools:

* DumpRenderTree/efl/CMakeLists.txt:
* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::onWindowObjectCleared):
* DumpRenderTree/efl/TextInputController.cpp: Added.
(setMarkedTextCallback):
(hasMarkedTextCallback):
(markedRangeCallback):
(insertTextCallback):
(unmarkTextCallback):
(firstRectForCharacterRangeCallback):
(selectedRangeCallback):
(makeTextInputController):
* DumpRenderTree/efl/TextInputController.h: Added.

LayoutTests:

* platform/efl/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash due to owning renderer not removed from custom scrollbar.
https://bugs.webkit.org/show_bug.cgi?id=80610

Reviewed by Eric Seidel.

Source/WebCore:

Test: scrollbars/scrollbar-owning-renderer-crash.html

Changed RenderScrollbar to keep pointer to owning node, instead of the
renderer. Renderer can get destroyed without informing the scrollbar, causing
crashes later. Remove code from r94107 since it is not needed anymore and saves
times when RenderBox is getting destroyed.

* page/FrameView.cpp:
(WebCore::FrameView::createScrollbar): pass renderer's node.
* page/FrameView.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed): no longer need this. came originally from r94107.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar): pass renderer's node.
(WebCore::RenderLayer::destroyScrollbar): no longer need to clear owning renderer.
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar): pass renderer's node.
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::createScrollbar): pass renderer's node.
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::createCustomScrollbar): Store owner node instead of renderer.
(WebCore::RenderScrollbar::RenderScrollbar): Store owner node instead of renderer.
(WebCore::RenderScrollbar::owningRenderer): calculate owning renderer from owner node.
* rendering/RenderScrollbar.h:
(RenderScrollbar):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::createScrollbar): pass renderer's node.

LayoutTests:

* scrollbars/scrollbar-owning-renderer-crash-expected.txt: Added.
* scrollbars/scrollbar-owning-renderer-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Suppress failing test while the fix is being worked out.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DrawingAreaProxyImpl doesn't work with window server hosting
https://bugs.webkit.org/show_bug.cgi?id=85947
<rdar://problem/11213718>

Reviewed by Andreas Kling.

* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::updateAcceleratedCompositingMode):
Update the layer tree context and call WebPage::updateAcceleratedCompositingMode.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::setLayerHostingMode):
If setting the layer hosting mode changed the layer tree context, send back an UpdateAcceleratedCompositingMode message
with the new context.

* WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
(WebKit::LayerTreeHostCA::initialize):
platformInitialize no longer takes a context.

* WebProcess/WebPage/ca/LayerTreeHostCA.h:
(LayerTreeHostCA):
Make m_layerTreeContext protected instead.

* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
(WebKit::LayerTreeHostCAMac::platformInitialize):
Assign to m_layerTreeContext directly.

(WebKit::LayerTreeHostCAMac::setLayerHostingMode):
Set m_layerTreeContext.contextID.

* WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
(WebKit::LayerTreeHostCAWin::platformInitialize):
Assign to m_layerTreeContext directly.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixe Chromium build, and add a FIXME comment about a layering violation.

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116479 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move RenderLayers z-index lists dirtying to post style change
https://bugs.webkit.org/show_bug.cgi?id=85437

Reviewed by Darin Adler.

No expected change in behavior.

This change moves the z-order lists to RenderLayer::styleChanged. As part of this
change, also added proper handling of stacking context transition. This enabled
us to tighten more of the dirtyZOrderLists / clearZOrderLists code.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::styleWillChange):
Removed this code, moved to updateStackingContextsAfterStyleChange.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
Only stacking contexts start with dirty z-order lists.

(WebCore::RenderLayer::dirtyZOrderLists):
Added an ASSERT.

(WebCore::RenderLayer::updateStackingContextsAfterStyleChange):
Refactored the code to handle the transition between stacking context status.

(WebCore::RenderLayer::styleChanged):
Added a call to updateStackingContextsAfterStyleChange.

* rendering/RenderLayer.h:
(WebCore::RenderLayer::isStackingContext):
Added a call to the next function.

(WebCore::RenderLayer::layerWithStyleIsStackingContext):
Factored the isStackingContext logic here so that we can reuse it inside
updateStackingContextsAfterStyleChange.

(WebCore::RenderLayer::clearZOrderLists):
Added an ASSERT.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Show borders for partial-draw-culled quads to visualize culling behaviour
https://bugs.webkit.org/show_bug.cgi?id=85414

Reviewed by Adrienne Walker.

Source/WebCore:

The borders are brown, and are only shown when the quad's visible rect
is non-empty and is different from the quad's original rect.

Adds a flag to CCQuadCuller constructor, to enable showing debug borders
around what it leaves after culling (when it culls anything in a quad
at all).

* platform/graphics/chromium/cc/CCDrawQuad.h:
(WebCore::CCDrawQuad::isDebugQuad):
(WebCore::CCDrawQuad::sharedQuadState):
(CCDrawQuad):
* platform/graphics/chromium/cc/CCQuadCuller.cpp:
(WebCore):
(WebCore::CCQuadCuller::CCQuadCuller):
(WebCore::appendQuadInternal):
(WebCore::CCQuadCuller::append):
(WebCore::CCQuadCuller::appendSurface):
(WebCore::CCQuadCuller::appendReplica):
* platform/graphics/chromium/cc/CCQuadCuller.h:
(CCQuadCuller):
* platform/graphics/chromium/cc/CCRenderPass.cpp:
(WebCore::CCRenderPass::appendQuadsForLayer):
(WebCore::CCRenderPass::appendQuadsForRenderSurfaceLayer):

Source/WebKit/chromium:

* tests/CCQuadCullerTest.cpp:
(WebCore::appendQuads):
* tests/MockCCQuadCuller.h:
(WebCore::MockCCQuadCuller::MockCCQuadCuller):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Gardening, unskip test after r116475.

* platform/efl/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Show the chromium non-layout test bots in garden-o-matic
https://bugs.webkit.org/show_bug.cgi?id=85903

Reviewed by Eric Seidel.

This is just a single-line high-level overview of the chromium non-layout test bots.
This means that Chromium WebKit gardeners only need to keep garden-o-matic open in
order to do their job.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/garden-o-matic.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui_unittests.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/onebar.css:
(#chromium-gtests iframe):
(#chromium-gtests):
(#gtest-label):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Heap should not continually allocate new pages in steady state
https://bugs.webkit.org/show_bug.cgi?id=85936

Reviewed by Geoff Garen.

Currently, in steady state (i.e. a constant amount of live GC 
memory with a constant rate of allocation) assuming we've just 
finished a collection with X live blocks in CopiedSpace, we 
increase our working set by X blocks in CopiedSpace with each 
collection we perform. This is due to the fact that we allocate 
until we run out of free blocks to use in the Heap before we 
consider whether we should run a collection. 

In the longer term, this issue will be mostly resolved by 
implementing quick release for the CopiedSpace. In the shorter 
term, we should change our policy to check whether we should 
allocate before trying to use a free block from the Heap. We 
can change our policy to something more appropriate once we 
have implemented quick release.

This change should also have the convenient side effect of 
reducing the variance in GC-heavy tests (e.g. v8-splay) due 
to fact that we are doing less VM allocation during copying 
collection. Overall, this patch is performance neutral across 
the benchmarks we track.

* heap/CopiedSpace.cpp: 
(JSC::CopiedSpace::getFreshBlock): Shuffle the request from the BlockAllocator
around so that we only do it if the block request must succeed 
i.e. after we've already checked whether we should do a collection.
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::allocateSlowCase): Ditto.
(JSC::MarkedAllocator::allocateBlock): We no longer have a failure mode in this 
function because by the time we've called it, we've already checked whether we 
should run a collection so there's no point in returning null.
* heap/MarkedAllocator.h: Removing old arguments from function declaration.
(MarkedAllocator):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AudioParam should directly be given context in create() method
https://bugs.webkit.org/show_bug.cgi?id=85905

Reviewed by James Robinson.

No new tests.  This is a low-level re-factoring and is covered by existing tests.

* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::AudioBufferSourceNode):
* Modules/webaudio/AudioGain.h:
(WebCore::AudioGain::create):
(WebCore::AudioGain::AudioGain):
* Modules/webaudio/AudioGainNode.cpp:
(WebCore::AudioGainNode::AudioGainNode):
* Modules/webaudio/AudioPannerNode.cpp:
(WebCore::AudioPannerNode::AudioPannerNode):
* Modules/webaudio/AudioParam.h:
(WebCore::AudioParam::create):
(AudioParam):
(WebCore::AudioParam::AudioParam):
* Modules/webaudio/BiquadFilterNode.cpp:
(WebCore::BiquadFilterNode::BiquadFilterNode):
* Modules/webaudio/BiquadProcessor.cpp:
(WebCore::BiquadProcessor::BiquadProcessor):
* Modules/webaudio/BiquadProcessor.h:
* Modules/webaudio/DelayNode.cpp:
(WebCore::DelayNode::DelayNode):
* Modules/webaudio/DelayProcessor.cpp:
(WebCore::DelayProcessor::DelayProcessor):
* Modules/webaudio/DelayProcessor.h:
(DelayProcessor):
* Modules/webaudio/DynamicsCompressorNode.cpp:
(WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
* Modules/webaudio/Oscillator.cpp:
(WebCore::Oscillator::Oscillator):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[JSC] Regression: addEventListener() and removeEventListener() raise an exception on missing args
https://bugs.webkit.org/show_bug.cgi?id=85928

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-05-08
Reviewed by Geoffrey Garen.

Source/WebCore: 

The functions addEventListener() and removeEventListener() raise an exception if there are missin arguments.
This behavior breaks existing content.

This patch change the code generator of JavaScript core to have an exception for addEventListener() and removeEventListener().
For those function, we do not raise an exception on missin argument.

This patch does not modify the V8 code generator because such exceptions are already in place there.

Tests: fast/dom/Window/window-legacy-event-listener.html
       fast/dom/XMLHttpRequest-legacy-event-listener.html
       fast/dom/node-legacy-event-listener.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

LayoutTests: 

* fast/dom/Window/window-legacy-event-listener-expected.txt: Added.
* fast/dom/Window/window-legacy-event-listener.html: Added.
* fast/dom/XMLHttpRequest-legacy-event-listener-expected.txt: Added.
* fast/dom/XMLHttpRequest-legacy-event-listener.html: Added.
* fast/dom/node-legacy-event-listener-expected.txt: Added.
* fast/dom/node-legacy-event-listener.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RadioNodeList support in HTMLFormElement::elements
https://bugs.webkit.org/show_bug.cgi?id=81854

Patch by Rakesh KN <rakesh.kn@motorola.com> on 2012-05-08
Reviewed by Ryosuke Niwa.

Source/WebCore:

Implement RadioNodeList support spec'ed at
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#radionodelist

Test: fast/forms/form-collection-radio-node-list.html

* CMakeLists.txt:
Added entries for new files.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Ditto.
* DerivedSources.pri: Ditto.
* GNUmakefile.list.am: Ditto.
* Target.pri: Ditto.
* WebCore.gypi: Ditto.
* WebCore.vcproj/WebCore.vcproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::getNamedItems):
Modified to create RadioNodeList object when FormControlCollection has more than
one element of same name/id.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
Added code to include Node.h and JSNode.h in JSRadioNodeElement.cpp.
* bindings/v8/custom/V8HTMLCollectionCustom.cpp:
(WebCore::getNamedItems):
Modified to create RadioNodeList object when FormControlCollection has more than
one element of same name/id.
* dom/Node.cpp:
(WebCore::Node::invalidateNodeListsCacheAfterAttributeChanged):
Invalidate lists even for change in id, type, checked attributes.
(WebCore::NodeListsNodeData::invalidateCachesThatDependOnAttributes):
Invalidate radioNodeList cache.
(WebCore::NodeListsNodeData::isEmpty):
Changes for radioNodeList.
(WebCore::Node::radioNodeList):
Creates if needed a RadioNodeList and adds it to the cache.
(WebCore::Node::removeCachedRadioNodeList):
Removes a cached radioNodeList.
* dom/Node.h: Ditto
* dom/NodeRareData.h:
(WebCore):
(NodeListsNodeData):
Added radioNodeList list.
* html/CollectionType.h:
Added new FormControls type.
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::shouldIncludeChildren):
(WebCore::HTMLCollection::isAcceptableElement):
Handle FormControls collection type.
* html/HTMLFormCollection.cpp:
(WebCore::HTMLFormCollection::HTMLFormCollection):
Contruct collection of FormControls type.
* html/RadioNodeList.cpp: Added.
(WebCore):
(WebCore::RadioNodeList::RadioNodeList):
(WebCore::RadioNodeList::~RadioNodeList):
(WebCore::toRadioButtonInputElement):
(WebCore::RadioNodeList::value):
(WebCore::RadioNodeList::setValue):
(WebCore::RadioNodeList::nodeMatches):
* html/RadioNodeList.h: Added.
(WebCore):
(RadioNodeList):
(WebCore::RadioNodeList::create):
RadioNodeList implementation.
* html/RadioNodeList.idl: Added.
Idl for generating RadioNodeList JS/V8 bindings.

LayoutTests:

* fast/forms/form-collection-radio-node-list-expected.txt: Added.
* fast/forms/form-collection-radio-node-list.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Auth credentials set in private mode are reused in public mode.
https://bugs.webkit.org/show_bug.cgi?id=84697

Patch by Jason Liu <jason.liu@torchmobile.com.cn> on 2012-05-08
Reviewed by Rob Buis.

Add setPrivateMode function for CredentialStorage.

Source/WebCore:

Now, we only save credentials in memory and CredentialBackingStore isn't enabled.
When we set private mode from on to off, we clear all these temporary credentials.

We have to change Private Browsing to test, so have to write a manual test case.
Test: ManualTests/blackberry/http-auth-private-mode-changed.html

* network/CredentialStorage.cpp:
(WebCore::CredentialStorage::setPrivateMode):
(WebCore):
* platform/network/CredentialStorage.h:
(CredentialStorage):

Source/WebKit/blackberry:

We have to change Private Browsing to test, so have to write a manual test case.
Test: ManualTests/blackberry/http-auth-private-mode-changed.html

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::didChangeSettings):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Update test expectations.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Test expectation update
Skip post-in-iframe-with-back-navigation.html because it might cause a
failure of the next test, preload-append-scan.php

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, a trivial test fix to remove a platform-dependency.
https://bugs.webkit.org/show_bug.cgi?id=81854

* fast/forms/form-collection-radio-node-list-expected.txt:
* fast/forms/form-collection-radio-node-list.html:
Remove form controls from the document before completing the test.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix.

* WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h:
(LayerTreeHostCAWin):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116492 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix.

* platform/mac/WebCoreSystemInterface.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ROLLING OUT r114255
        
GC in the middle of JSObject::allocatePropertyStorage can cause badness
https://bugs.webkit.org/show_bug.cgi?id=83839

Reviewed by nobody.

This breaks the world, with COLLECT_ON_EVERY_ALLOCATION enabled.

* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/JSObject.cpp:
(JSC::JSObject::allocatePropertyStorage):
* runtime/JSObject.h:
(JSObject):
(JSC::JSObject::isUsingInlineStorage):
(JSC):
(JSC::JSObject::putDirectInternal):
(JSC::JSObject::putDirectWithoutTransition):
(JSC::JSObject::transitionTo):
* runtime/Structure.cpp:
(JSC):
* runtime/Structure.h:
(JSC::Structure::didTransition):



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