mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
f3297ff565
- Bug 1161802 part 1 - Add FullscreenChanged callback in WidgetListener. r=roc (caee485f4) - Bug 1058712, e10s, support for copy image command, r=ehsan,mconley (42d1bcc2c) - Bug 1122090 - Make ContentHelper take a LayoutDeviceIntPoint instead of an nsIntPoint. r=botond (21588cadb) - Bug 1122090 - Send the allowed behaviour notification to APZ for touch blocks when touch-action is enabled. r=botond (5bb0aad4a) - remove unneeded include (b77797920) - Add wheel transaction support to APZ. (bug 1142866 part 1, r=kats) (a4ed2150a) - End APZ wheel transactions when the mouse moves out of frame. (bug 1142866 part 2, r=kats,botond) (b26b0eb89) - Add APZ support for test.mousescroll callbacks. (bug 1142866 part 3, r=kats) (424ef3ad7) - Add helper for applying async transforms to widget input events. (bug 1143567 part 1, r=kats) (221cf7b02) - Ensure input events account for APZ transforms on Gtk. (bug 1143567 part 2, r=kats) (a62991076) - Allow synthetic input events to be dispatched asynchronously. (bug 1146243, r=kats) (0878aac4e) - Bug 1120300 - Export WritingModes.h as mozilla/WritingModes.h. r=jfkthame (67838dec2) - Bug 1075670 - Make event.screen[XY] work in content processes (r=smaug,kats,tn,joshmoz) (7c800e2a1) - Bug 1150563 - Intermittent test_compartments.js | test_measure - [test_measure : 125] At least 10ms counted for built-in statistics (0) - false == true;r=yoric (72ce9c7fc) - Bug 1143847 - Fix bogus asserts in x64 Assembler::finish(). r=sunfish (36aecaf48) - pointer style (a1a5a7b0f) - Bug 1148232 - OdinMonkey: Mark x86 disassembler code as MOZ_COLD and use MOZ_RELEASE_ASSERT r=luke (346cf1fdd) - Bug 1148232 - OdinMonkey: Update an asm.js error message r=luke (98c72b0b1) - Bug 1148232 - OdinMonkey: Update tests to avoid using legacy syntax. r=luke (d212510f3) - Bug 1148232 - OdinMonkey: Misc CheckArrayAccess cleanups r=luke (e5cda1cf0) - pointer style (23135ba24) - Bug 1148232 - OdinMonkey: Always put asm.js heap alignment masks just before their accesses r=luke (d604adf5d) - pointer style (9a5d58741) - Bug 1148232 - IonMonkey: Delete unused code r=luke (ea5bc5edc) - pointer style (73be379e1) - Bug 1143704 part 1 - Make Emit1/Emit2 return bool instead of ptrdiff_t. r=luke (2ca42caa9) - pointer style (eb30078f0) - Bug 1143704 part 2 - Make Emit3/EmitCall/EmitBackPatchOp return bool instead of ptrdiff_t. r=jorendorff (7275c56af) - Bug 1143704 part 3 - Make EmitLoopHead return bool instead of ptrdiff_t. r=shu (aff098096) - Bug 1143704 part 4 - Turn Emit1 into a BytecodeEmitter method. r=bhackett (5ca0356ba) - Bug 1143704 part 5 - Add a cx member to BytecodeEmitter. r=Waldo (8ce42c388) - Bug 1143704 part 6 - Move more functions into BytecodeEmitter. r=efaust (b26f60b2f) - pointer style (39e0e76ab) - Bug 1143704 part 7 - Move more functions into BytecodeEmitter. r=bhackett (7397bc2e5) - pointer style (f08664ab1) - Bug 1143704 part 8 - Move more functions into BytecodeEmitter. r=luke (2b0411545) - pointer style (5042217ea) - Bug 1143704 part 9 - Move more functions into BytecodeEmitter. r=shu (97501236a) - pointer style (4248e54fa) - Bug 1143704 part 10 - Move more functions into BytecodeEmitter. r=efaust (cd1fcb6a4) - pointer style (06026238e) - Bug 1143704 part 11 - Move more functions into BytecodeEmitter. r=jorendorff (300cdd416) - Bug 1145491 part 1. Only do the fast path for JSOP_BINDGNAME when the script doesn't have a polluted global. r=luke,jandem (75d663d20) - Bug 1145491 part 2. Only do the fast path for JSOP_GETGNAME when the script doesn't have a polluted global. r=luke,jandem (776bb0b37) - Bug 1145491 part 3. Only do the fast path for JSOP_SETGNAME and JSOP_STRICTSETGNAME when the script doesn't have a polluted global. r=luke,jandem (dfc5781e2) - Bug 537013 - Make the find bar exist on a per-tab basis. r=dao (cf361fd57) - Bug 1145491 part 4. Emit JSOP_IMPLICITTHIS for JSOP_GETGNAME as well, because otherwise bareword calls in polluted-global scripts won't work right. r=luk (2a4c829e2) - Bug 1145491 part 5. Fix up various other places that check for JSOP_GET/SETNAME without checking for the GNAME versions too. r=luke (08ebda6b5) - pointer style (dbdd1393a) - Bug 1145491 part 6. Fix script cloning to propagate the polluted-global-scope state to the lambda templates in the script. r=luke (a0c85b629) - pointer style (906b885ff) - Bug 1145491 part 7. Stop checking compileAndGo before emitting GNAME ops. r=luke (33e64a432)
229 lines
6.9 KiB
C++
229 lines
6.9 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* 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/. */
|
|
|
|
#include "ChromeProcessController.h"
|
|
|
|
#include "MainThreadUtils.h" // for NS_IsMainThread()
|
|
#include "base/message_loop.h" // for MessageLoop
|
|
#include "mozilla/dom/Element.h"
|
|
#include "mozilla/layers/CompositorParent.h"
|
|
#include "mozilla/layers/APZCCallbackHelper.h"
|
|
#include "mozilla/layers/APZEventState.h"
|
|
#include "nsIDocument.h"
|
|
#include "nsIInterfaceRequestorUtils.h"
|
|
#include "nsIPresShell.h"
|
|
#include "nsLayoutUtils.h"
|
|
#include "nsView.h"
|
|
|
|
using namespace mozilla;
|
|
using namespace mozilla::layers;
|
|
using namespace mozilla::widget;
|
|
|
|
ChromeProcessController::ChromeProcessController(nsIWidget* aWidget,
|
|
APZEventState* aAPZEventState)
|
|
: mWidget(aWidget)
|
|
, mAPZEventState(aAPZEventState)
|
|
, mUILoop(MessageLoop::current())
|
|
{
|
|
// Otherwise we're initializing mUILoop incorrectly.
|
|
MOZ_ASSERT(NS_IsMainThread());
|
|
|
|
mUILoop->PostTask(
|
|
FROM_HERE,
|
|
NewRunnableMethod(this, &ChromeProcessController::InitializeRoot));
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::InitializeRoot()
|
|
{
|
|
// Create a view-id and set a zero-margin displayport for the root element
|
|
// of the root document in the chrome process. This ensures that the scroll
|
|
// frame for this element gets an APZC, which in turn ensures that all content
|
|
// in the chrome processes is covered by an APZC.
|
|
// The displayport is zero-margin because this element is generally not
|
|
// actually scrollable (if it is, APZC will set proper margins when it's
|
|
// scrolled).
|
|
nsIPresShell* presShell = GetPresShell();
|
|
if (!presShell) {
|
|
return;
|
|
}
|
|
|
|
MOZ_ASSERT(presShell->GetDocument());
|
|
nsIContent* content = presShell->GetDocument()->GetDocumentElement();
|
|
if (!content) {
|
|
return;
|
|
}
|
|
|
|
uint32_t presShellId;
|
|
FrameMetrics::ViewID viewId;
|
|
if (APZCCallbackHelper::GetOrCreateScrollIdentifiers(content, &presShellId, &viewId)) {
|
|
nsLayoutUtils::SetDisplayPortMargins(content, presShell, ScreenMargin(), 0,
|
|
nsLayoutUtils::RepaintMode::DoNotRepaint);
|
|
}
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::RequestContentRepaint(const FrameMetrics& aFrameMetrics)
|
|
{
|
|
MOZ_ASSERT(NS_IsMainThread());
|
|
|
|
if (aFrameMetrics.GetScrollId() == FrameMetrics::NULL_SCROLL_ID) {
|
|
return;
|
|
}
|
|
|
|
nsCOMPtr<nsIContent> targetContent = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId());
|
|
if (targetContent) {
|
|
FrameMetrics metrics = aFrameMetrics;
|
|
APZCCallbackHelper::UpdateSubFrame(targetContent, metrics);
|
|
}
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::PostDelayedTask(Task* aTask, int aDelayMs)
|
|
{
|
|
MessageLoop::current()->PostDelayedTask(FROM_HERE, aTask, aDelayMs);
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::RequestFlingSnap(const FrameMetrics::ViewID& aScrollId,
|
|
const mozilla::CSSPoint& aDestination)
|
|
{
|
|
APZCCallbackHelper::RequestFlingSnap(aScrollId, aDestination);
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId,
|
|
const uint32_t& aScrollGeneration)
|
|
{
|
|
APZCCallbackHelper::AcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::Destroy()
|
|
{
|
|
if (MessageLoop::current() != mUILoop) {
|
|
mUILoop->PostTask(
|
|
FROM_HERE,
|
|
NewRunnableMethod(this, &ChromeProcessController::Destroy));
|
|
return;
|
|
}
|
|
|
|
MOZ_ASSERT(MessageLoop::current() == mUILoop);
|
|
mWidget = nullptr;
|
|
}
|
|
|
|
float
|
|
ChromeProcessController::GetPresShellResolution() const
|
|
{
|
|
// The document in the chrome process cannot be zoomed, so its pres shell
|
|
// resolution is 1.
|
|
return 1.0f;
|
|
}
|
|
|
|
nsIPresShell*
|
|
ChromeProcessController::GetPresShell() const
|
|
{
|
|
if (nsView* view = nsView::GetViewFor(mWidget)) {
|
|
return view->GetPresShell();
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
nsIDocument*
|
|
ChromeProcessController::GetDocument() const
|
|
{
|
|
if (nsIPresShell* presShell = GetPresShell()) {
|
|
return presShell->GetDocument();
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
already_AddRefed<nsIDOMWindowUtils>
|
|
ChromeProcessController::GetDOMWindowUtils() const
|
|
{
|
|
if (nsIDocument* doc = GetDocument()) {
|
|
nsCOMPtr<nsIDOMWindowUtils> result = do_GetInterface(doc->GetWindow());
|
|
return result.forget();
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::HandleSingleTap(const CSSPoint& aPoint,
|
|
Modifiers aModifiers,
|
|
const ScrollableLayerGuid& aGuid)
|
|
{
|
|
if (MessageLoop::current() != mUILoop) {
|
|
mUILoop->PostTask(
|
|
FROM_HERE,
|
|
NewRunnableMethod(this, &ChromeProcessController::HandleSingleTap,
|
|
aPoint, aModifiers, aGuid));
|
|
return;
|
|
}
|
|
|
|
mAPZEventState->ProcessSingleTap(aPoint, aModifiers, aGuid, GetPresShellResolution());
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::HandleLongTap(const mozilla::CSSPoint& aPoint, Modifiers aModifiers,
|
|
const ScrollableLayerGuid& aGuid,
|
|
uint64_t aInputBlockId)
|
|
{
|
|
if (MessageLoop::current() != mUILoop) {
|
|
mUILoop->PostTask(
|
|
FROM_HERE,
|
|
NewRunnableMethod(this, &ChromeProcessController::HandleLongTap,
|
|
aPoint, aModifiers, aGuid, aInputBlockId));
|
|
return;
|
|
}
|
|
|
|
mAPZEventState->ProcessLongTap(GetDOMWindowUtils(), aPoint, aModifiers, aGuid,
|
|
aInputBlockId, GetPresShellResolution());
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::HandleLongTapUp(const CSSPoint& aPoint, Modifiers aModifiers,
|
|
const ScrollableLayerGuid& aGuid)
|
|
{
|
|
if (MessageLoop::current() != mUILoop) {
|
|
mUILoop->PostTask(
|
|
FROM_HERE,
|
|
NewRunnableMethod(this, &ChromeProcessController::HandleLongTapUp,
|
|
aPoint, aModifiers, aGuid));
|
|
return;
|
|
}
|
|
|
|
mAPZEventState->ProcessLongTapUp(aPoint, aModifiers, aGuid, GetPresShellResolution());
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
|
|
APZStateChange aChange,
|
|
int aArg)
|
|
{
|
|
if (MessageLoop::current() != mUILoop) {
|
|
mUILoop->PostTask(
|
|
FROM_HERE,
|
|
NewRunnableMethod(this, &ChromeProcessController::NotifyAPZStateChange,
|
|
aGuid, aChange, aArg));
|
|
return;
|
|
}
|
|
|
|
mAPZEventState->ProcessAPZStateChange(GetDocument(), aGuid.mScrollId, aChange, aArg);
|
|
}
|
|
|
|
void
|
|
ChromeProcessController::NotifyMozMouseScrollEvent(const FrameMetrics::ViewID& aScrollId, const nsString& aEvent)
|
|
{
|
|
if (MessageLoop::current() != mUILoop) {
|
|
mUILoop->PostTask(
|
|
FROM_HERE,
|
|
NewRunnableMethod(this, &ChromeProcessController::NotifyMozMouseScrollEvent, aScrollId, aEvent));
|
|
return;
|
|
}
|
|
|
|
APZCCallbackHelper::NotifyMozMouseScrollEvent(aScrollId, aEvent);
|
|
}
|