Coordinated Graphics: Remove an invisible TiledBackingStore of CoordinatedGraphicsLayer.
https://bugs.webkit.org/show_bug.cgi?id=101424

Patch by Huang Dongsung <luxtella@company100.net> on 2012-11-08
Reviewed by Noam Rosenthal.

Source/WebCore:

This patch adds ASSERT to TextureMapperLayer while fixing this bug in
WebKit2.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):

Source/WebKit2:

We must remove an invisible TiledBackingStore of CoordinatedGraphicsLayer.
Currently, CoordinatedGraphicsLayer only removes a TiledBackingStore if
!drawsContent() while TextureMapperLayer::updateBackingStore() removes a backing
store if (!m_state.drawsContent || !m_state.contentsVisible || m_size.isEmpty()).
CoordinatedGraphicsLayer must have the same behavior.

In addition, this patch makes LayerTreeRenderer remove a backing store from
GraphicsLayerTextureMapper when CoordinatedBackingStore does not have any tiles.

Test: compositing/nested-direct-image-compositing.html

* UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStore::removeTile):
(WebKit::CoordinatedBackingStore::isEmpty):
(WebKit):
(WebKit::CoordinatedBackingStore::commitTileOperations):
* UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h:
(CoordinatedBackingStore):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::removeBackingStoreIfNeeded):
(WebKit):
(WebKit::LayerTreeRenderer::removeTile):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(LayerTreeRenderer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::adjustContentsScale):

LayoutTests:

Coordinated Graphics had a bug when a compositing div has a compositing
img with an absolute position property. This test is added to prevent from
a regression.

* compositing/nested-direct-image-compositing-expected.png: Added.
* compositing/nested-direct-image-compositing-expected.txt: Added.
* compositing/nested-direct-image-compositing.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG should not assume that something is a double just because it might be undefined
https://bugs.webkit.org/show_bug.cgi?id=101438

Reviewed by Oliver Hunt.

This changes all non-bitop arithmetic to (a) statically expect that variables are
defined prior to use in arithmetic and (b) not fall off into double paths just
because a value may not be a number. This is accomplished with two new notions of
speculation:
        
shouldSpeculateIntegerExpectingDefined: Should we speculate that the value is an
integer if we ignore undefined (i.e. SpecOther) predictions?
        
shouldSpeculateIntegerForArithmetic: Should we speculate that the value is an
integer if we ignore non-numeric predictions?
        
This is a ~2x speed-up on programs that seem to our prediction propagator to have
paths in which otherwise numeric variables are undefined.

* bytecode/SpeculatedType.h:
(JSC::isInt32SpeculationForArithmetic):
(JSC):
(JSC::isInt32SpeculationExpectingDefined):
(JSC::isDoubleSpeculationForArithmetic):
(JSC::isNumberSpeculationExpectingDefined):
* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::execute):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::addShouldSpeculateInteger):
(JSC::DFG::Graph::mulShouldSpeculateInteger):
(JSC::DFG::Graph::negateShouldSpeculateInteger):
(JSC::DFG::Graph::addImmediateShouldSpeculateInteger):
(JSC::DFG::Graph::mulImmediateShouldSpeculateInteger):
* dfg/DFGNode.h:
(JSC::DFG::Node::shouldSpeculateIntegerForArithmetic):
(Node):
(JSC::DFG::Node::shouldSpeculateIntegerExpectingDefined):
(JSC::DFG::Node::shouldSpeculateDoubleForArithmetic):
(JSC::DFG::Node::shouldSpeculateNumberExpectingDefined):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
(JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileAdd):
(JSC::DFG::SpeculativeJIT::compileArithMod):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_div):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Have NetworkProcess do the actual loading of subresources.
https://bugs.webkit.org/show_bug.cgi?id=101640

Reviewed by Alexey Proskuryakov.

Source/WebCore:

No new tests (No change in behavior in any configuration we test.)

* WebCore.exp.in:
* loader/ResourceBuffer.h: Virtualize a few methods for ports to override.

Source/WebKit2:

This adds actual loading of subresources in the NetworkProcess.

Currently a resource just gets its entire buffer of data built up and then delivered to the WebProcess in one chunk.

Many FIXMEs point the path towards much better behavior.

Project file stuff:
* WebKit2.xcodeproj/project.pbxproj:

Add a new Logging channel for scheduling so the one for loading can be separate:
* Platform/Logging.cpp:
* Platform/Logging.h:

Add an enhancement FIXME:
* NetworkProcess/HostRecord.cpp:
(WebKit::HostRecord::remove):

NetworkRequest now derives from ResourceHandleClient and does actual loading, messaging WebProcess as it does:
* NetworkProcess/NetworkRequest.cpp:
(WebKit::NetworkRequest::NetworkRequest):
(WebKit::NetworkRequest::~NetworkRequest):
(WebKit::NetworkRequest::start):
(WebKit::requestsToStopMutex):
(WebKit::requestsToStop):
(WebKit::NetworkRequest::scheduleStopOnMainThread): Stop
(WebKit::NetworkRequest::performStops):
(WebKit::NetworkRequest::stop): Does NetworkRequest cleanup that happens no matter the state of the network load.
(WebKit::NetworkRequest::didReceiveResponse):
(WebKit::NetworkRequest::didReceiveData):
(WebKit::NetworkRequest::didFinishLoading):
(WebKit::NetworkRequest::didFail):
* NetworkProcess/NetworkRequest.h:

Change some logging and now invalid asserts, as well as starting requests in-process instead of relying on WebProcess:
* NetworkProcess/NetworkResourceLoadScheduler.cpp:
(WebKit::NetworkResourceLoadScheduler::scheduleNetworkRequest):
(WebKit::NetworkResourceLoadScheduler::addLoadInProgress):
(WebKit::NetworkResourceLoadScheduler::removeLoadIdentifier):
(WebKit::NetworkResourceLoadScheduler::crossOriginRedirectReceived):
(WebKit::NetworkResourceLoadScheduler::servePendingRequests):
(WebKit::NetworkResourceLoadScheduler::servePendingRequestsForHost):
(WebKit::NetworkResourceLoadScheduler::removeScheduledLoadIdentifiers):
(WebKit::NetworkResourceLoadScheduler::scheduleRemoveLoadIdentifier):
* NetworkProcess/NetworkResourceLoadScheduler.h:
(NetworkResourceLoadScheduler):

Add a "ShareableResource" which includes a SharedMemory block, an offset into that block, and a size:
* Shared/ShareableResource.cpp: Added.
(WebKit::ShareableResource::Handle::Handle):
(WebKit::ShareableResource::Handle::encode):
(WebKit::ShareableResource::Handle::decode):
(WebKit::ShareableResource::create):
(WebKit::ShareableResource::ShareableResource):
(WebKit::ShareableResource::~ShareableResource):
(WebKit::ShareableResource::createHandle):
(WebKit::ShareableResource::data):
(WebKit::ShareableResource::size):
* Shared/ShareableResource.h:
(WebKit::ShareableResource::Handle::isNull):
(WebKit::ShareableResource::Handle::size):

Add an implementation of WebCore::ResourceBuffer that wraps a ShareableResource instead of a SharedBuffer:
* Shared/WebResourceBuffer.cpp:
(WebKit::WebResourceBuffer::WebResourceBuffer):
(WebKit::WebResourceBuffer::~WebResourceBuffer):
(WebKit::WebResourceBuffer::data):
(WebKit::WebResourceBuffer::size):
* Shared/WebResourceBuffer.h:
(WebResourceBuffer):
(WebKit::WebResourceBuffer::create):

Add messaging that responds to resource load events from the NetworkProcess and passes them to the scheduler:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didReceiveResponse):
(WebKit::NetworkProcessConnection::didReceiveResource):
(WebKit::NetworkProcessConnection::didFailResourceLoad):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:

Takes resource load events passed from the NetworkProcess and hands them off directly to WebCore ResourceLoaders:
* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad): Update some logging.
(WebKit::WebResourceLoadScheduler::addMainResourceLoad): Ditto.
(WebKit::WebResourceLoadScheduler::remove): Ditto.
(WebKit::WebResourceLoadScheduler::crossOriginRedirectReceived): Ditto.
(WebKit::WebResourceLoadScheduler::servePendingRequests): Ditto.
(WebKit::WebResourceLoadScheduler::didReceiveResponse): Call through to ResourceLoader.
(WebKit::WebResourceLoadScheduler::didReceiveResource): Ditto.
(WebKit::WebResourceLoadScheduler::didFailResourceLoad): Ditto.
* WebProcess/Network/WebResourceLoadScheduler.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HeapStatistics::s_pauseTimeStarts and s_pauseTimeEnds should be Vectors
https://bugs.webkit.org/show_bug.cgi?id=101651

Reviewed by Andreas Kling.

HeapStatistics uses Deques when Vectors would work just as good.

* heap/HeapStatistics.cpp:
* heap/HeapStatistics.h:
(HeapStatistics):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening - rebaseline a couple of tests for lion.

* platform/chromium-mac-lion/fast/css/text-overflow-ellipsis-text-align-center-expected.png: Added.
* platform/chromium-mac-lion/fast/forms/basic-textareas-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add proper support for fullscreen API to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=101615

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-11-08
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::enterFullScreen):
* UIProcess/API/efl/ewk_security_origin.cpp:
(EwkSecurityOrigin::EwkSecurityOrigin):
* UIProcess/API/efl/ewk_security_origin_private.h:
(EwkSecurityOrigin::create): Add factory method to construct a
EwkSecurityOrigin from a KURL.
(EwkSecurityOrigin):
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_fullscreen_exit): Add public API function to exit
fullscreen mode.
* UIProcess/API/efl/ewk_view.h: Add security origin parameter
to fullscreen_enter smart function since this information is
useful to the user agent.
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(fullScreenCallback):
(fullScreenExitCallback):
(TEST_F):

Tools:

Implement fullscreen API support in MiniBrowser. When entering
fullscreen a popup is shown to notify the user that something
is displayed in fullscreen and to advertise that the Escape
key can be used to exit fullscreen. This behavior is according
to specification.

* MiniBrowser/efl/main.c:
(on_key_down):
(on_fullscreen_accept):
(on_fullscreen_deny):
(on_fullscreen_enter):
(on_fullscreen_exit):
(window_create):

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