2010-08-20 16:24:41 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: sw=2 ts=8 et :
|
|
|
|
*/
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
#include "base/basictypes.h"
|
2010-08-20 16:24:41 -07:00
|
|
|
|
|
|
|
#include "BasicLayers.h"
|
2015-01-11 17:39:36 -08:00
|
|
|
#include "gfxPrefs.h"
|
2011-07-04 06:15:05 -07:00
|
|
|
#ifdef MOZ_ENABLE_D3D9_LAYER
|
2012-07-17 16:59:45 -07:00
|
|
|
# include "LayerManagerD3D9.h"
|
2011-07-04 06:15:05 -07:00
|
|
|
#endif //MOZ_ENABLE_D3D9_LAYER
|
2012-12-24 22:09:34 -08:00
|
|
|
#include "mozilla/BrowserElementParent.h"
|
2015-03-02 13:38:07 -08:00
|
|
|
#include "mozilla/EventForwards.h" // for Modifiers
|
2014-06-10 22:44:39 -07:00
|
|
|
#include "mozilla/dom/ContentChild.h"
|
2012-07-19 23:48:27 -07:00
|
|
|
#include "mozilla/dom/TabParent.h"
|
2013-07-30 11:03:40 -07:00
|
|
|
#include "mozilla/layers/APZCTreeManager.h"
|
2015-02-10 05:24:23 -08:00
|
|
|
#include "mozilla/layers/APZThreadUtils.h"
|
2012-07-17 16:59:45 -07:00
|
|
|
#include "mozilla/layers/CompositorParent.h"
|
2013-04-24 11:42:40 -07:00
|
|
|
#include "mozilla/layers/LayerTransactionParent.h"
|
2012-07-17 16:59:45 -07:00
|
|
|
#include "nsContentUtils.h"
|
2015-02-05 11:41:50 -08:00
|
|
|
#include "nsFocusManager.h"
|
2010-08-20 16:24:41 -07:00
|
|
|
#include "nsFrameLoader.h"
|
2011-05-19 03:53:02 -07:00
|
|
|
#include "nsIObserver.h"
|
2015-02-16 18:30:02 -08:00
|
|
|
#include "nsStyleStructInlines.h"
|
2012-07-17 16:59:45 -07:00
|
|
|
#include "nsSubDocumentFrame.h"
|
2013-06-10 14:00:00 -07:00
|
|
|
#include "nsView.h"
|
2012-07-17 16:59:45 -07:00
|
|
|
#include "nsViewportFrame.h"
|
|
|
|
#include "RenderFrameParent.h"
|
2013-04-27 23:46:30 -07:00
|
|
|
#include "mozilla/layers/LayerManagerComposite.h"
|
2013-07-11 19:32:09 -07:00
|
|
|
#include "mozilla/layers/CompositorChild.h"
|
|
|
|
#include "ClientLayerManager.h"
|
2014-08-05 22:19:25 -07:00
|
|
|
#include "FrameLayerBuilder.h"
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2012-07-19 23:48:27 -07:00
|
|
|
using namespace mozilla::dom;
|
2014-08-01 05:31:47 -07:00
|
|
|
using namespace mozilla::gfx;
|
2010-08-20 16:24:41 -07:00
|
|
|
using namespace mozilla::layers;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layout {
|
|
|
|
|
2011-01-13 09:45:14 -08:00
|
|
|
typedef FrameMetrics::ViewID ViewID;
|
2011-01-13 09:45:14 -08:00
|
|
|
|
2012-11-04 22:11:25 -08:00
|
|
|
/**
|
|
|
|
* Gets the layer-pixel offset of aContainerFrame's content rect top-left
|
|
|
|
* from the nearest display item reference frame (which we assume will be inducing
|
|
|
|
* a ContainerLayer).
|
|
|
|
*/
|
2011-01-13 09:45:14 -08:00
|
|
|
static nsIntPoint
|
2012-11-04 22:11:25 -08:00
|
|
|
GetContentRectLayerOffset(nsIFrame* aContainerFrame, nsDisplayListBuilder* aBuilder)
|
2011-01-13 09:45:14 -08:00
|
|
|
{
|
|
|
|
nscoord auPerDevPixel = aContainerFrame->PresContext()->AppUnitsPerDevPixel();
|
|
|
|
|
|
|
|
// Offset to the content rect in case we have borders or padding
|
2012-11-04 22:11:25 -08:00
|
|
|
// Note that aContainerFrame could be a reference frame itself, so
|
|
|
|
// we need to be careful here to ensure that we call ToReferenceFrame
|
|
|
|
// on aContainerFrame and not its parent.
|
|
|
|
nsPoint frameOffset = aBuilder->ToReferenceFrame(aContainerFrame) +
|
2014-09-11 14:29:59 -07:00
|
|
|
aContainerFrame->GetContentRectRelativeToSelf().TopLeft();
|
2011-01-13 09:45:14 -08:00
|
|
|
|
|
|
|
return frameOffset.ToNearestPixels(auPerDevPixel);
|
|
|
|
}
|
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
// Return true iff |aManager| is a "temporary layer manager". They're
|
|
|
|
// used for small software rendering tasks, like drawWindow. That's
|
|
|
|
// currently implemented by a BasicLayerManager without a backing
|
|
|
|
// widget, and hence in non-retained mode.
|
2012-07-26 21:02:05 -07:00
|
|
|
inline static bool
|
2010-08-20 16:24:41 -07:00
|
|
|
IsTempLayerManager(LayerManager* aManager)
|
|
|
|
{
|
2014-01-23 10:26:41 -08:00
|
|
|
return (mozilla::layers::LayersBackend::LAYERS_BASIC == aManager->GetBackendType() &&
|
2010-08-20 16:24:41 -07:00
|
|
|
!static_cast<BasicLayerManager*>(aManager)->IsRetained());
|
|
|
|
}
|
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
already_AddRefed<LayerManager>
|
|
|
|
GetFrom(nsFrameLoader* aFrameLoader)
|
|
|
|
{
|
|
|
|
nsIDocument* doc = aFrameLoader->GetOwnerDoc();
|
2014-10-14 15:11:38 -07:00
|
|
|
if (!doc) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2012-07-17 16:59:45 -07:00
|
|
|
return nsContentUtils::LayerManagerForDocument(doc);
|
|
|
|
}
|
|
|
|
|
2012-07-19 23:48:27 -07:00
|
|
|
class RemoteContentController : public GeckoContentController {
|
|
|
|
public:
|
2014-08-31 20:36:37 -07:00
|
|
|
explicit RemoteContentController(RenderFrameParent* aRenderFrame)
|
2012-07-19 23:48:27 -07:00
|
|
|
: mUILoop(MessageLoop::current())
|
|
|
|
, mRenderFrame(aRenderFrame)
|
|
|
|
{ }
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) override
|
2012-07-19 23:48:27 -07:00
|
|
|
{
|
2014-10-03 10:39:37 -07:00
|
|
|
MOZ_ASSERT(NS_IsMainThread());
|
|
|
|
if (mRenderFrame) {
|
2015-01-25 21:49:13 -08:00
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
2014-10-03 10:39:37 -07:00
|
|
|
browser->UpdateFrame(aFrameMetrics);
|
|
|
|
}
|
2012-07-19 23:48:27 -07:00
|
|
|
}
|
|
|
|
|
2015-02-19 15:53:30 -08:00
|
|
|
virtual void RequestFlingSnap(const FrameMetrics::ViewID& aScrollId,
|
2015-03-21 09:28:04 -07:00
|
|
|
const mozilla::CSSPoint& aDestination) override
|
2015-02-19 15:53:30 -08:00
|
|
|
{
|
|
|
|
if (MessageLoop::current() != mUILoop) {
|
|
|
|
// We have to send this message from the "UI thread" (main
|
|
|
|
// thread).
|
|
|
|
mUILoop->PostTask(
|
|
|
|
FROM_HERE,
|
|
|
|
NewRunnableMethod(this, &RemoteContentController::RequestFlingSnap,
|
|
|
|
aScrollId, aDestination));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (mRenderFrame) {
|
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
|
|
|
browser->RequestFlingSnap(aScrollId, aDestination);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-05 14:43:20 -08:00
|
|
|
virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId,
|
2015-03-21 09:28:04 -07:00
|
|
|
const uint32_t& aScrollGeneration) override
|
2014-02-05 14:43:20 -08:00
|
|
|
{
|
|
|
|
if (MessageLoop::current() != mUILoop) {
|
|
|
|
// We have to send this message from the "UI thread" (main
|
|
|
|
// thread).
|
|
|
|
mUILoop->PostTask(
|
|
|
|
FROM_HERE,
|
|
|
|
NewRunnableMethod(this, &RemoteContentController::AcknowledgeScrollUpdate,
|
|
|
|
aScrollId, aScrollGeneration));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (mRenderFrame) {
|
2015-01-25 21:49:13 -08:00
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
2014-02-05 14:43:20 -08:00
|
|
|
browser->AcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual void HandleDoubleTap(const CSSPoint& aPoint,
|
2015-03-02 13:38:07 -08:00
|
|
|
Modifiers aModifiers,
|
2015-03-21 09:28:04 -07:00
|
|
|
const ScrollableLayerGuid& aGuid) override
|
2012-08-08 21:39:02 -07:00
|
|
|
{
|
|
|
|
if (MessageLoop::current() != mUILoop) {
|
|
|
|
// We have to send this message from the "UI thread" (main
|
|
|
|
// thread).
|
|
|
|
mUILoop->PostTask(
|
|
|
|
FROM_HERE,
|
|
|
|
NewRunnableMethod(this, &RemoteContentController::HandleDoubleTap,
|
2014-02-07 09:13:50 -08:00
|
|
|
aPoint, aModifiers, aGuid));
|
2012-08-08 21:39:02 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (mRenderFrame) {
|
2015-01-25 21:49:13 -08:00
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
2014-02-07 09:13:50 -08:00
|
|
|
browser->HandleDoubleTap(aPoint, aModifiers, aGuid);
|
2012-08-08 21:39:02 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual void HandleSingleTap(const CSSPoint& aPoint,
|
2015-03-02 13:38:07 -08:00
|
|
|
Modifiers aModifiers,
|
2015-03-21 09:28:04 -07:00
|
|
|
const ScrollableLayerGuid& aGuid) override
|
2012-09-14 18:16:32 -07:00
|
|
|
{
|
|
|
|
if (MessageLoop::current() != mUILoop) {
|
|
|
|
// We have to send this message from the "UI thread" (main
|
|
|
|
// thread).
|
|
|
|
mUILoop->PostTask(
|
|
|
|
FROM_HERE,
|
|
|
|
NewRunnableMethod(this, &RemoteContentController::HandleSingleTap,
|
2014-02-07 09:13:50 -08:00
|
|
|
aPoint, aModifiers, aGuid));
|
2012-09-14 18:16:32 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (mRenderFrame) {
|
2015-02-05 11:41:50 -08:00
|
|
|
mRenderFrame->TakeFocusForClick();
|
2015-01-25 21:49:13 -08:00
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
2014-02-07 09:13:50 -08:00
|
|
|
browser->HandleSingleTap(aPoint, aModifiers, aGuid);
|
2012-09-14 18:16:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-12 12:27:45 -07:00
|
|
|
virtual void HandleLongTap(const CSSPoint& aPoint,
|
2015-03-02 13:38:07 -08:00
|
|
|
Modifiers aModifiers,
|
2014-10-24 10:29:30 -07:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
2015-03-21 09:28:04 -07:00
|
|
|
uint64_t aInputBlockId) override
|
2012-11-08 11:35:02 -08:00
|
|
|
{
|
|
|
|
if (MessageLoop::current() != mUILoop) {
|
|
|
|
// We have to send this message from the "UI thread" (main
|
|
|
|
// thread).
|
|
|
|
mUILoop->PostTask(
|
|
|
|
FROM_HERE,
|
|
|
|
NewRunnableMethod(this, &RemoteContentController::HandleLongTap,
|
2014-10-24 10:29:30 -07:00
|
|
|
aPoint, aModifiers, aGuid, aInputBlockId));
|
2012-11-08 11:35:02 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (mRenderFrame) {
|
2015-01-25 21:49:13 -08:00
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
2014-10-24 10:29:30 -07:00
|
|
|
browser->HandleLongTap(aPoint, aModifiers, aGuid, aInputBlockId);
|
2012-11-08 11:35:02 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-30 07:20:58 -07:00
|
|
|
void ClearRenderFrame() { mRenderFrame = nullptr; }
|
2012-07-19 23:48:27 -07:00
|
|
|
|
2015-06-08 13:01:26 -07:00
|
|
|
virtual void SendAsyncScrollDOMEvent(bool aIsRootContent,
|
2013-07-30 11:03:42 -07:00
|
|
|
const CSSRect& aContentRect,
|
2015-03-21 09:28:04 -07:00
|
|
|
const CSSSize& aContentSize) override
|
2012-12-24 22:09:34 -08:00
|
|
|
{
|
|
|
|
if (MessageLoop::current() != mUILoop) {
|
|
|
|
mUILoop->PostTask(
|
|
|
|
FROM_HERE,
|
|
|
|
NewRunnableMethod(this,
|
|
|
|
&RemoteContentController::SendAsyncScrollDOMEvent,
|
2015-06-08 13:01:26 -07:00
|
|
|
aIsRootContent, aContentRect, aContentSize));
|
2012-12-24 22:09:34 -08:00
|
|
|
return;
|
|
|
|
}
|
2015-06-08 13:01:26 -07:00
|
|
|
if (mRenderFrame && aIsRootContent) {
|
2015-01-25 21:49:13 -08:00
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
2012-12-24 22:09:34 -08:00
|
|
|
BrowserElementParent::DispatchAsyncScrollEvent(browser, aContentRect,
|
|
|
|
aContentSize);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void PostDelayedTask(Task* aTask, int aDelayMs) override
|
2013-02-25 12:50:49 -08:00
|
|
|
{
|
2015-07-06 04:18:20 -07:00
|
|
|
(MessageLoop::current() ? MessageLoop::current() : mUILoop)->
|
|
|
|
PostDelayedTask(FROM_HERE, aTask, aDelayMs);
|
2013-02-25 12:50:49 -08:00
|
|
|
}
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool GetTouchSensitiveRegion(CSSRect* aOutRegion) override
|
2014-01-16 12:19:59 -08:00
|
|
|
{
|
|
|
|
if (mTouchSensitiveRegion.IsEmpty())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
*aOutRegion = CSSRect::FromAppUnits(mTouchSensitiveRegion.GetBounds());
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-04-15 10:39:20 -07:00
|
|
|
virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
|
|
|
|
APZStateChange aChange,
|
2015-03-21 09:28:04 -07:00
|
|
|
int aArg) override
|
2013-12-09 19:14:55 -08:00
|
|
|
{
|
|
|
|
if (MessageLoop::current() != mUILoop) {
|
|
|
|
mUILoop->PostTask(
|
|
|
|
FROM_HERE,
|
2014-04-15 10:39:20 -07:00
|
|
|
NewRunnableMethod(this, &RemoteContentController::NotifyAPZStateChange,
|
|
|
|
aGuid, aChange, aArg));
|
2013-12-09 19:14:55 -08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (mRenderFrame) {
|
2015-01-25 21:49:13 -08:00
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
2014-04-15 10:39:20 -07:00
|
|
|
browser->NotifyAPZStateChange(aGuid.mScrollId, aChange, aArg);
|
2013-12-09 19:14:55 -08:00
|
|
|
}
|
2015-03-22 00:42:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void NotifyMozMouseScrollEvent(const FrameMetrics::ViewID& aScrollId, const nsString& aEvent) override {
|
|
|
|
if (MessageLoop::current() != mUILoop) {
|
|
|
|
mUILoop->PostTask(
|
|
|
|
FROM_HERE,
|
|
|
|
NewRunnableMethod(this, &RemoteContentController::NotifyMozMouseScrollEvent, aScrollId, aEvent));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mRenderFrame) {
|
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
|
|
|
browser->NotifyMouseScrollTestEvent(aScrollId, aEvent);
|
|
|
|
}
|
2013-12-09 19:14:55 -08:00
|
|
|
}
|
|
|
|
|
2015-06-19 05:25:41 -07:00
|
|
|
void NotifyFlushComplete() override {
|
|
|
|
MOZ_ASSERT(NS_IsMainThread());
|
|
|
|
if (mRenderFrame) {
|
|
|
|
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
|
|
|
|
browser->NotifyFlushComplete();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-16 12:19:59 -08:00
|
|
|
// Methods used by RenderFrameParent to set fields stored here.
|
|
|
|
|
|
|
|
void SetTouchSensitiveRegion(const nsRegion& aRegion)
|
|
|
|
{
|
|
|
|
mTouchSensitiveRegion = aRegion;
|
|
|
|
}
|
2012-07-19 23:48:27 -07:00
|
|
|
private:
|
|
|
|
MessageLoop* mUILoop;
|
|
|
|
RenderFrameParent* mRenderFrame;
|
2013-09-13 07:18:33 -07:00
|
|
|
|
2014-01-16 12:19:59 -08:00
|
|
|
nsRegion mTouchSensitiveRegion;
|
2012-07-19 23:48:27 -07:00
|
|
|
};
|
|
|
|
|
2014-05-08 07:04:00 -07:00
|
|
|
RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader,
|
|
|
|
TextureFactoryIdentifier* aTextureFactoryIdentifier,
|
|
|
|
uint64_t* aId,
|
|
|
|
bool* aSuccess)
|
2012-07-17 16:59:45 -07:00
|
|
|
: mLayersId(0)
|
2014-05-08 07:04:00 -07:00
|
|
|
, mFrameLoader(aFrameLoader)
|
2011-09-27 11:35:23 -07:00
|
|
|
, mFrameLoaderDestroyed(false)
|
2011-10-20 15:17:09 -07:00
|
|
|
, mBackgroundColor(gfxRGBA(1, 1, 1))
|
2015-06-04 13:51:10 -07:00
|
|
|
, mAsyncPanZoomEnabled(false)
|
2010-10-26 10:51:08 -07:00
|
|
|
{
|
2015-07-21 14:34:36 -07:00
|
|
|
*aId = 0;
|
2014-05-08 07:04:00 -07:00
|
|
|
*aSuccess = false;
|
|
|
|
if (!mFrameLoader) {
|
|
|
|
return;
|
|
|
|
}
|
2014-01-15 13:10:39 -08:00
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
|
2015-06-04 13:51:10 -07:00
|
|
|
|
|
|
|
mAsyncPanZoomEnabled = lm && lm->AsyncPanZoomEnabled();
|
|
|
|
|
2013-01-10 02:02:21 -08:00
|
|
|
// Perhaps the document containing this frame currently has no presentation?
|
2014-01-23 10:26:41 -08:00
|
|
|
if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
|
2013-12-08 17:40:59 -08:00
|
|
|
*aTextureFactoryIdentifier =
|
|
|
|
static_cast<ClientLayerManager*>(lm.get())->GetTextureFactoryIdentifier();
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 02:20:52 -07:00
|
|
|
} else {
|
|
|
|
*aTextureFactoryIdentifier = TextureFactoryIdentifier();
|
2013-01-10 02:02:21 -08:00
|
|
|
}
|
2012-07-17 16:59:45 -07:00
|
|
|
|
2015-07-03 18:29:00 -07:00
|
|
|
if (XRE_IsParentProcess()) {
|
2012-07-17 16:59:45 -07:00
|
|
|
// Our remote frame will push layers updates to the compositor,
|
|
|
|
// and we'll keep an indirect reference to that tree.
|
|
|
|
*aId = mLayersId = CompositorParent::AllocateLayerTreeId();
|
2014-01-23 10:26:41 -08:00
|
|
|
if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
|
2014-06-14 00:25:02 -07:00
|
|
|
ClientLayerManager *clientManager =
|
|
|
|
static_cast<ClientLayerManager*>(lm.get());
|
2013-07-11 19:32:09 -07:00
|
|
|
clientManager->GetRemoteRenderer()->SendNotifyChildCreated(mLayersId);
|
|
|
|
}
|
2015-06-04 13:51:10 -07:00
|
|
|
if (mAsyncPanZoomEnabled) {
|
2012-07-19 23:48:27 -07:00
|
|
|
mContentController = new RemoteContentController(this);
|
2013-07-30 11:03:40 -07:00
|
|
|
CompositorParent::SetControllerForLayerTree(mLayersId, mContentController);
|
2012-07-19 23:48:27 -07:00
|
|
|
}
|
2015-07-03 18:29:00 -07:00
|
|
|
} else if (XRE_IsContentProcess()) {
|
2014-06-10 22:44:39 -07:00
|
|
|
ContentChild::GetSingleton()->SendAllocateLayerTreeId(aId);
|
|
|
|
mLayersId = *aId;
|
2014-06-14 00:25:02 -07:00
|
|
|
CompositorChild::Get()->SendNotifyChildCreated(mLayersId);
|
2011-08-09 12:38:26 -07:00
|
|
|
}
|
2014-05-08 07:04:00 -07:00
|
|
|
*aSuccess = true;
|
2010-10-26 10:51:08 -07:00
|
|
|
}
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2013-07-30 11:03:40 -07:00
|
|
|
APZCTreeManager*
|
|
|
|
RenderFrameParent::GetApzcTreeManager()
|
|
|
|
{
|
|
|
|
// We can't get a ref to the APZCTreeManager until after the child is
|
|
|
|
// created and the static getter knows which CompositorParent is
|
|
|
|
// instantiated with this layers ID. That's why try to fetch it when
|
|
|
|
// we first need it and cache the result.
|
2015-06-04 13:51:10 -07:00
|
|
|
if (!mApzcTreeManager && mAsyncPanZoomEnabled) {
|
2013-07-30 11:03:40 -07:00
|
|
|
mApzcTreeManager = CompositorParent::GetAPZCTreeManager(mLayersId);
|
|
|
|
}
|
|
|
|
return mApzcTreeManager.get();
|
|
|
|
}
|
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
RenderFrameParent::~RenderFrameParent()
|
|
|
|
{}
|
|
|
|
|
2011-01-05 20:54:47 -08:00
|
|
|
void
|
|
|
|
RenderFrameParent::Destroy()
|
|
|
|
{
|
2011-09-27 11:35:23 -07:00
|
|
|
mFrameLoaderDestroyed = true;
|
2011-01-05 20:54:47 -08:00
|
|
|
}
|
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
already_AddRefed<Layer>
|
|
|
|
RenderFrameParent::BuildLayer(nsDisplayListBuilder* aBuilder,
|
|
|
|
nsIFrame* aFrame,
|
2010-10-13 15:55:45 -07:00
|
|
|
LayerManager* aManager,
|
2012-08-06 20:00:41 -07:00
|
|
|
const nsIntRect& aVisibleRect,
|
2012-09-16 15:25:33 -07:00
|
|
|
nsDisplayItem* aItem,
|
2013-09-26 23:01:16 -07:00
|
|
|
const ContainerLayerParameters& aContainerParameters)
|
2010-08-20 16:24:41 -07:00
|
|
|
{
|
2015-02-09 14:34:50 -08:00
|
|
|
MOZ_ASSERT(aFrame,
|
|
|
|
"makes no sense to have a shadow tree without a frame");
|
|
|
|
MOZ_ASSERT(!mContainer ||
|
|
|
|
IsTempLayerManager(aManager) ||
|
|
|
|
mContainer->Manager() == aManager,
|
|
|
|
"retaining manager changed out from under us ... HELP!");
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2012-11-13 11:55:52 -08:00
|
|
|
if (IsTempLayerManager(aManager) ||
|
|
|
|
(mContainer && mContainer->Manager() != aManager)) {
|
2010-08-20 16:24:41 -07:00
|
|
|
// This can happen if aManager is a "temporary" manager, or if the
|
|
|
|
// widget's layer manager changed out from under us. We need to
|
|
|
|
// FIXME handle the former case somehow, probably with an API to
|
2015-02-09 14:34:50 -08:00
|
|
|
// draw a manager's subtree. The latter is bad bad bad, but the the
|
|
|
|
// MOZ_ASSERT() above will flag it. Returning nullptr here will just
|
|
|
|
// cause the shadow subtree not to be rendered.
|
2012-11-13 11:55:52 -08:00
|
|
|
NS_WARNING("Remote iframe not rendered");
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2010-08-20 16:24:41 -07:00
|
|
|
}
|
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
uint64_t id = GetLayerTreeId();
|
2014-08-21 17:16:44 -07:00
|
|
|
if (!id) {
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2011-01-25 22:26:37 -08:00
|
|
|
}
|
|
|
|
|
2014-08-21 17:16:44 -07:00
|
|
|
nsRefPtr<Layer> layer =
|
|
|
|
(aManager->GetLayerBuilder()->GetLeafLayerFor(aBuilder, aItem));
|
|
|
|
if (!layer) {
|
|
|
|
layer = aManager->CreateRefLayer();
|
2010-08-20 16:24:41 -07:00
|
|
|
}
|
2014-08-21 17:16:44 -07:00
|
|
|
if (!layer) {
|
|
|
|
// Probably a temporary layer manager that doesn't know how to
|
|
|
|
// use ref layers.
|
|
|
|
return nullptr;
|
2011-02-23 09:45:09 -08:00
|
|
|
}
|
2014-08-21 17:16:44 -07:00
|
|
|
static_cast<RefLayer*>(layer.get())->SetReferentId(id);
|
|
|
|
nsIntPoint offset = GetContentRectLayerOffset(aFrame, aBuilder);
|
|
|
|
// We can only have an offset if we're a child of an inactive
|
|
|
|
// container, but our display item is LAYER_ACTIVE_FORCE which
|
|
|
|
// forces all layers above to be active.
|
|
|
|
MOZ_ASSERT(aContainerParameters.mOffset == nsIntPoint());
|
2014-10-16 02:51:12 -07:00
|
|
|
gfx::Matrix4x4 m = gfx::Matrix4x4::Translation(offset.x, offset.y, 0.0);
|
2014-08-21 17:16:44 -07:00
|
|
|
// Remote content can't be repainted by us, so we multiply down
|
|
|
|
// the resolution that our container expects onto our container.
|
2014-10-16 02:51:12 -07:00
|
|
|
m.PreScale(aContainerParameters.mXScale, aContainerParameters.mYScale, 1.0);
|
2014-08-21 17:16:44 -07:00
|
|
|
layer->SetBaseTransform(m);
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2014-08-21 17:16:44 -07:00
|
|
|
return layer.forget();
|
2010-08-20 16:24:41 -07:00
|
|
|
}
|
|
|
|
|
2011-01-13 09:45:14 -08:00
|
|
|
void
|
|
|
|
RenderFrameParent::OwnerContentChanged(nsIContent* aContent)
|
|
|
|
{
|
2015-09-10 01:43:04 -07:00
|
|
|
MOZ_ASSERT(!mFrameLoader || mFrameLoader->GetOwnerContent() == aContent,
|
2015-02-09 14:34:50 -08:00
|
|
|
"Don't build new map if owner is same!");
|
2014-10-14 15:11:38 -07:00
|
|
|
|
2015-09-04 03:11:33 -07:00
|
|
|
nsRefPtr<LayerManager> lm = mFrameLoader ? GetFrom(mFrameLoader) : nullptr;
|
2014-10-14 15:11:38 -07:00
|
|
|
// Perhaps the document containing this frame currently has no presentation?
|
|
|
|
if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
|
|
|
|
ClientLayerManager *clientManager =
|
|
|
|
static_cast<ClientLayerManager*>(lm.get());
|
|
|
|
clientManager->GetRemoteRenderer()->SendAdoptChild(mLayersId);
|
|
|
|
}
|
2015-09-15 13:09:35 -07:00
|
|
|
// The APZCTreeManager associated with this RenderFrameParent may have changed
|
|
|
|
// so reset it and let GetApzcTreeManager() pick it up again.
|
|
|
|
mApzcTreeManager = nullptr;
|
2011-01-13 09:45:14 -08:00
|
|
|
}
|
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
void
|
|
|
|
RenderFrameParent::ActorDestroy(ActorDestroyReason why)
|
|
|
|
{
|
2012-07-19 23:48:27 -07:00
|
|
|
if (mLayersId != 0) {
|
2015-07-03 18:29:00 -07:00
|
|
|
if (XRE_IsContentProcess()) {
|
2014-06-10 22:44:39 -07:00
|
|
|
ContentChild::GetSingleton()->SendDeallocateLayerTreeId(mLayersId);
|
|
|
|
} else {
|
|
|
|
CompositorParent::DeallocateLayerTreeId(mLayersId);
|
|
|
|
}
|
2012-07-19 23:48:27 -07:00
|
|
|
if (mContentController) {
|
|
|
|
// Stop our content controller from requesting repaints of our
|
|
|
|
// content.
|
|
|
|
mContentController->ClearRenderFrame();
|
2013-07-30 11:03:40 -07:00
|
|
|
// TODO: notify the compositor?
|
2012-07-19 23:48:27 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-30 07:20:58 -07:00
|
|
|
mFrameLoader = nullptr;
|
2010-08-20 16:24:41 -07:00
|
|
|
}
|
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
bool
|
|
|
|
RenderFrameParent::RecvNotifyCompositorTransaction()
|
2010-08-20 16:24:41 -07:00
|
|
|
{
|
2012-07-17 16:59:45 -07:00
|
|
|
TriggerRepaint();
|
|
|
|
return true;
|
|
|
|
}
|
2012-07-17 16:59:45 -07:00
|
|
|
|
2013-08-13 00:56:57 -07:00
|
|
|
bool
|
|
|
|
RenderFrameParent::RecvUpdateHitRegion(const nsRegion& aRegion)
|
|
|
|
{
|
|
|
|
mTouchRegion = aRegion;
|
2014-01-16 12:19:59 -08:00
|
|
|
if (mContentController) {
|
|
|
|
// Tell the content controller about the touch-sensitive region, so
|
|
|
|
// that it can provide it to APZ. This is required for APZ to do
|
|
|
|
// correct hit testing for a remote 'mozpasspointerevents' iframe
|
|
|
|
// until bug 928833 is fixed.
|
|
|
|
mContentController->SetTouchSensitiveRegion(aRegion);
|
|
|
|
}
|
2013-08-13 00:56:57 -07:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
void
|
|
|
|
RenderFrameParent::TriggerRepaint()
|
|
|
|
{
|
|
|
|
nsIFrame* docFrame = mFrameLoader->GetPrimaryFrameOfOwningContent();
|
|
|
|
if (!docFrame) {
|
|
|
|
// Bad, but nothing we can do about it (XXX/cjones: or is there?
|
|
|
|
// maybe bug 589337?). When the new frame is created, we'll
|
|
|
|
// probably still be the current render frame and will get to draw
|
|
|
|
// our content then. Or, we're shutting down and this update goes
|
|
|
|
// to /dev/null.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-04-30 17:42:05 -07:00
|
|
|
docFrame->InvalidateLayer(nsDisplayItem::TYPE_REMOTE);
|
2012-07-17 16:59:45 -07:00
|
|
|
}
|
|
|
|
|
2012-07-17 16:59:45 -07:00
|
|
|
uint64_t
|
|
|
|
RenderFrameParent::GetLayerTreeId() const
|
|
|
|
{
|
2012-07-17 16:59:45 -07:00
|
|
|
return mLayersId;
|
2012-07-17 16:59:45 -07:00
|
|
|
}
|
|
|
|
|
2013-02-14 03:12:27 -08:00
|
|
|
void
|
2011-01-13 09:45:14 -08:00
|
|
|
RenderFrameParent::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
nsSubDocumentFrame* aFrame,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists)
|
|
|
|
{
|
|
|
|
// We're the subdoc for <browser remote="true"> and it has
|
|
|
|
// painted content. Display its shadow layer tree.
|
2013-04-04 04:36:45 -07:00
|
|
|
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
|
2013-03-04 01:56:02 -08:00
|
|
|
|
|
|
|
nsPoint offset = aBuilder->ToReferenceFrame(aFrame);
|
|
|
|
nsRect bounds = aFrame->EnsureInnerView()->GetBounds() + offset;
|
2013-04-04 04:36:45 -07:00
|
|
|
clipState.ClipContentDescendants(bounds);
|
2013-03-04 01:56:02 -08:00
|
|
|
|
2014-08-21 17:16:44 -07:00
|
|
|
aLists.Content()->AppendToTop(
|
|
|
|
new (aBuilder) nsDisplayRemote(aBuilder, aFrame, this));
|
2011-01-13 09:45:14 -08:00
|
|
|
}
|
|
|
|
|
2012-08-08 21:39:02 -07:00
|
|
|
void
|
2013-11-13 10:20:30 -08:00
|
|
|
RenderFrameParent::ZoomToRect(uint32_t aPresShellId, ViewID aViewId,
|
|
|
|
const CSSRect& aRect)
|
2012-08-08 21:39:02 -07:00
|
|
|
{
|
2013-07-30 11:03:40 -07:00
|
|
|
if (GetApzcTreeManager()) {
|
2013-11-13 10:20:30 -08:00
|
|
|
GetApzcTreeManager()->ZoomToRect(ScrollableLayerGuid(mLayersId, aPresShellId, aViewId),
|
2013-07-30 11:03:40 -07:00
|
|
|
aRect);
|
2012-08-08 21:39:02 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-21 21:37:06 -07:00
|
|
|
void
|
2014-12-09 02:35:12 -08:00
|
|
|
RenderFrameParent::ContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
|
|
|
|
uint64_t aInputBlockId,
|
|
|
|
bool aPreventDefault)
|
2012-08-21 21:37:06 -07:00
|
|
|
{
|
2014-02-21 14:58:30 -08:00
|
|
|
if (aGuid.mLayersId != mLayersId) {
|
|
|
|
// Guard against bad data from hijacked child processes
|
2014-12-09 02:35:12 -08:00
|
|
|
NS_ERROR("Unexpected layers id in ContentReceivedInputBlock; dropping message...");
|
2014-02-21 14:58:30 -08:00
|
|
|
return;
|
|
|
|
}
|
2013-07-30 11:03:40 -07:00
|
|
|
if (GetApzcTreeManager()) {
|
2015-02-10 05:24:23 -08:00
|
|
|
APZThreadUtils::RunOnControllerThread(NewRunnableMethod(
|
|
|
|
GetApzcTreeManager(), &APZCTreeManager::ContentReceivedInputBlock,
|
|
|
|
aInputBlockId, aPreventDefault));
|
2012-08-21 21:37:06 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-21 18:36:25 -08:00
|
|
|
void
|
|
|
|
RenderFrameParent::SetTargetAPZC(uint64_t aInputBlockId,
|
|
|
|
const nsTArray<ScrollableLayerGuid>& aTargets)
|
|
|
|
{
|
|
|
|
for (size_t i = 0; i < aTargets.Length(); i++) {
|
|
|
|
if (aTargets[i].mLayersId != mLayersId) {
|
|
|
|
// Guard against bad data from hijacked child processes
|
|
|
|
NS_ERROR("Unexpected layers id in SetTargetAPZC; dropping message...");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (GetApzcTreeManager()) {
|
2015-02-10 05:24:23 -08:00
|
|
|
// need a local var to disambiguate between the SetTargetAPZC overloads.
|
|
|
|
void (APZCTreeManager::*setTargetApzcFunc)(uint64_t, const nsTArray<ScrollableLayerGuid>&)
|
|
|
|
= &APZCTreeManager::SetTargetAPZC;
|
|
|
|
APZThreadUtils::RunOnControllerThread(NewRunnableMethod(
|
|
|
|
GetApzcTreeManager(), setTargetApzcFunc,
|
|
|
|
aInputBlockId, aTargets));
|
2014-11-21 18:36:25 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-19 03:33:33 -07:00
|
|
|
void
|
|
|
|
RenderFrameParent::SetAllowedTouchBehavior(uint64_t aInputBlockId,
|
|
|
|
const nsTArray<TouchBehaviorFlags>& aFlags)
|
|
|
|
{
|
|
|
|
if (GetApzcTreeManager()) {
|
|
|
|
APZThreadUtils::RunOnControllerThread(NewRunnableMethod(
|
|
|
|
GetApzcTreeManager(), &APZCTreeManager::SetAllowedTouchBehavior,
|
|
|
|
aInputBlockId, aFlags));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-28 19:18:18 -07:00
|
|
|
void
|
2013-11-14 09:35:41 -08:00
|
|
|
RenderFrameParent::UpdateZoomConstraints(uint32_t aPresShellId,
|
|
|
|
ViewID aViewId,
|
2015-06-17 09:32:41 -07:00
|
|
|
const Maybe<ZoomConstraints>& aConstraints)
|
2012-09-28 19:18:18 -07:00
|
|
|
{
|
2013-07-30 11:03:40 -07:00
|
|
|
if (GetApzcTreeManager()) {
|
2013-11-14 09:35:41 -08:00
|
|
|
GetApzcTreeManager()->UpdateZoomConstraints(ScrollableLayerGuid(mLayersId, aPresShellId, aViewId),
|
2014-01-06 10:26:44 -08:00
|
|
|
aConstraints);
|
2012-09-28 19:18:18 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-13 00:56:57 -07:00
|
|
|
bool
|
|
|
|
RenderFrameParent::HitTest(const nsRect& aRect)
|
|
|
|
{
|
|
|
|
return mTouchRegion.Contains(aRect);
|
|
|
|
}
|
|
|
|
|
2014-11-16 10:23:22 -08:00
|
|
|
void
|
|
|
|
RenderFrameParent::GetTextureFactoryIdentifier(TextureFactoryIdentifier* aTextureFactoryIdentifier)
|
|
|
|
{
|
2015-09-10 01:43:04 -07:00
|
|
|
nsRefPtr<LayerManager> lm = mFrameLoader ? GetFrom(mFrameLoader) : nullptr;
|
2014-11-16 10:23:22 -08:00
|
|
|
// Perhaps the document containing this frame currently has no presentation?
|
|
|
|
if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
|
|
|
|
*aTextureFactoryIdentifier =
|
|
|
|
static_cast<ClientLayerManager*>(lm.get())->GetTextureFactoryIdentifier();
|
|
|
|
} else {
|
|
|
|
*aTextureFactoryIdentifier = TextureFactoryIdentifier();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-05 11:41:50 -08:00
|
|
|
void
|
|
|
|
RenderFrameParent::TakeFocusForClick()
|
|
|
|
{
|
|
|
|
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
|
|
|
if (!fm) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
nsCOMPtr<nsIContent> owner = mFrameLoader->GetOwnerContent();
|
|
|
|
if (!owner) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(owner);
|
|
|
|
if (!element) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
fm->SetFocus(element, nsIFocusManager::FLAG_BYMOUSE |
|
|
|
|
nsIFocusManager::FLAG_NOSCROLL);
|
|
|
|
}
|
|
|
|
|
2015-07-13 08:25:42 -07:00
|
|
|
} // namespace layout
|
|
|
|
} // namespace mozilla
|
2010-08-20 16:24:41 -07:00
|
|
|
|
2015-02-10 13:28:07 -08:00
|
|
|
nsDisplayRemote::nsDisplayRemote(nsDisplayListBuilder* aBuilder,
|
2015-02-25 10:36:19 -08:00
|
|
|
nsSubDocumentFrame* aFrame,
|
2015-02-10 13:28:07 -08:00
|
|
|
RenderFrameParent* aRemoteFrame)
|
|
|
|
: nsDisplayItem(aBuilder, aFrame)
|
|
|
|
, mRemoteFrame(aRemoteFrame)
|
2015-02-16 18:30:02 -08:00
|
|
|
, mEventRegionsOverride(EventRegionsOverride::NoOverride)
|
2015-02-10 13:28:07 -08:00
|
|
|
{
|
2015-02-16 18:30:02 -08:00
|
|
|
if (aBuilder->IsBuildingLayerEventRegions()) {
|
2015-02-25 10:36:19 -08:00
|
|
|
bool frameIsPointerEventsNone = !aFrame->PassPointerEventsToChildren()
|
|
|
|
&& (aFrame->StyleVisibility()->GetEffectivePointerEvents(aFrame) == NS_STYLE_POINTER_EVENTS_NONE);
|
|
|
|
if (aBuilder->IsInsidePointerEventsNoneDoc() || frameIsPointerEventsNone) {
|
2015-02-16 18:30:02 -08:00
|
|
|
mEventRegionsOverride |= EventRegionsOverride::ForceEmptyHitRegion;
|
|
|
|
}
|
|
|
|
if (nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(aFrame->PresContext()->PresShell())) {
|
|
|
|
mEventRegionsOverride |= EventRegionsOverride::ForceDispatchToContent;
|
|
|
|
}
|
2015-02-16 18:30:02 -08:00
|
|
|
}
|
2015-02-10 13:28:07 -08:00
|
|
|
}
|
|
|
|
|
2010-08-20 16:24:41 -07:00
|
|
|
already_AddRefed<Layer>
|
|
|
|
nsDisplayRemote::BuildLayer(nsDisplayListBuilder* aBuilder,
|
2011-06-22 05:11:27 -07:00
|
|
|
LayerManager* aManager,
|
2013-09-26 23:01:16 -07:00
|
|
|
const ContainerLayerParameters& aContainerParameters)
|
2010-08-20 16:24:41 -07:00
|
|
|
{
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
|
2010-10-13 15:55:45 -07:00
|
|
|
nsIntRect visibleRect = GetVisibleRect().ToNearestPixels(appUnitsPerDevPixel);
|
2012-09-16 15:25:33 -07:00
|
|
|
visibleRect += aContainerParameters.mOffset;
|
|
|
|
nsRefPtr<Layer> layer = mRemoteFrame->BuildLayer(aBuilder, mFrame, aManager, visibleRect, this, aContainerParameters);
|
2015-02-10 13:28:07 -08:00
|
|
|
if (layer && layer->AsContainerLayer()) {
|
2015-02-16 18:30:02 -08:00
|
|
|
layer->AsContainerLayer()->SetEventRegionsOverride(mEventRegionsOverride);
|
2015-02-10 13:28:07 -08:00
|
|
|
}
|
2010-08-20 16:24:41 -07:00
|
|
|
return layer.forget();
|
|
|
|
}
|
2011-01-13 09:45:14 -08:00
|
|
|
|
2013-08-13 00:56:57 -07:00
|
|
|
void
|
|
|
|
nsDisplayRemote::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
|
|
|
HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames)
|
|
|
|
{
|
|
|
|
if (mRemoteFrame->HitTest(aRect)) {
|
|
|
|
aOutFrames->AppendElement(mFrame);
|
|
|
|
}
|
|
|
|
}
|
2011-01-13 09:45:14 -08:00
|
|
|
|