2011-09-09 23:50:21 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: set ts=2 sw=2 et tw=78:
|
2012-05-21 15:12:37 +04: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/.
|
2011-09-09 23:50:21 +04:00
|
|
|
*
|
|
|
|
* This Original Code has been modified by IBM Corporation.
|
|
|
|
* Modifications made by IBM described herein are
|
|
|
|
* Copyright (c) International Business Machines
|
|
|
|
* Corporation, 2000
|
|
|
|
*
|
|
|
|
* Modifications to Mozilla code or documentation
|
|
|
|
* identified per MPL Section 3.3
|
|
|
|
*
|
|
|
|
* Date Modified by Description of modification
|
|
|
|
* 05/03/2000 IBM Corp. Observer events for reflow states
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* a presentation of a document, part 2 */
|
|
|
|
|
|
|
|
#ifndef nsPresShell_h_
|
|
|
|
#define nsPresShell_h_
|
|
|
|
|
|
|
|
#include "nsIPresShell.h"
|
|
|
|
#include "nsStubDocumentObserver.h"
|
|
|
|
#include "nsISelectionController.h"
|
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsWeakReference.h"
|
|
|
|
#include "nsCRT.h"
|
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsIWidget.h"
|
2013-01-23 23:37:17 +04:00
|
|
|
#include "nsContentUtils.h" // For AddScriptBlocker().
|
2011-09-14 01:32:07 +04:00
|
|
|
#include "nsRefreshDriver.h"
|
2015-02-20 10:12:00 +03:00
|
|
|
#include "TouchManager.h"
|
2012-06-19 07:26:34 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-10-22 17:27:34 +04:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-06-23 16:03:39 +04:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2016-02-24 10:01:11 +03:00
|
|
|
#include "mozilla/StyleSetHandle.h"
|
2016-01-21 00:24:28 +03:00
|
|
|
#include "mozilla/UniquePtr.h"
|
2015-07-21 17:51:55 +03:00
|
|
|
#include "MobileViewportManager.h"
|
2016-04-21 11:21:58 +03:00
|
|
|
#include "Visibility.h"
|
2015-06-17 19:32:42 +03:00
|
|
|
#include "ZoomConstraintsClient.h"
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2012-01-10 18:19:54 +04:00
|
|
|
class nsRange;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
struct RangePaintInfo;
|
|
|
|
struct nsCallbackEventRequest;
|
|
|
|
#ifdef MOZ_REFLOW_PERF
|
|
|
|
class ReflowCountMgr;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class nsPresShellEventCB;
|
|
|
|
class nsAutoCauseReflowNotifier;
|
|
|
|
|
2014-06-20 14:32:49 +04:00
|
|
|
namespace mozilla {
|
2016-03-19 04:38:57 +03:00
|
|
|
|
2014-11-03 10:05:38 +03:00
|
|
|
class EventDispatchingCallback;
|
2016-03-19 04:38:57 +03:00
|
|
|
|
2016-03-26 00:49:43 +03:00
|
|
|
// A set type for tracking visible frames, for use by the visibility code in
|
|
|
|
// PresShell. The set contains nsIFrame* pointers.
|
|
|
|
typedef nsTHashtable<nsPtrHashKey<nsIFrame>> VisibleFrames;
|
|
|
|
|
2016-03-19 04:38:57 +03:00
|
|
|
// A hash table type for tracking visible regions, for use by the visibility
|
|
|
|
// code in PresShell. The mapping is from view IDs to regions in the
|
|
|
|
// coordinate system of that view's scrolled frame.
|
|
|
|
typedef nsClassHashtable<nsUint64HashKey, mozilla::CSSIntRegion> VisibleRegions;
|
|
|
|
|
2014-06-20 14:32:49 +04:00
|
|
|
} // namespace mozilla
|
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
// 250ms. This is actually pref-controlled, but we use this value if we fail
|
|
|
|
// to get the pref for any reason.
|
|
|
|
#define PAINTLOCK_EVENT_DELAY 250
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class PresShell final : public nsIPresShell,
|
2015-03-27 21:52:19 +03:00
|
|
|
public nsStubDocumentObserver,
|
|
|
|
public nsISelectionController,
|
|
|
|
public nsIObserver,
|
|
|
|
public nsSupportsWeakReference
|
2011-09-09 23:50:21 +04:00
|
|
|
{
|
2016-03-19 04:38:57 +03:00
|
|
|
template <typename T> using Maybe = mozilla::Maybe<T>;
|
2016-03-26 00:49:43 +03:00
|
|
|
using Nothing = mozilla::Nothing;
|
|
|
|
using OnNonvisible = mozilla::OnNonvisible;
|
2016-04-21 11:21:58 +03:00
|
|
|
template <typename T> using UniquePtr = mozilla::UniquePtr<T>;
|
|
|
|
using VisibilityCounter = mozilla::VisibilityCounter;
|
2016-03-26 00:49:43 +03:00
|
|
|
using VisibleFrames = mozilla::VisibleFrames;
|
2016-03-19 04:38:57 +03:00
|
|
|
using VisibleRegions = mozilla::VisibleRegions;
|
|
|
|
|
2011-09-09 23:50:21 +04:00
|
|
|
public:
|
|
|
|
PresShell();
|
|
|
|
|
|
|
|
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
|
|
|
|
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2015-04-24 03:08:00 +03:00
|
|
|
static bool AccessibleCaretEnabled();
|
|
|
|
|
2014-11-03 10:05:38 +03:00
|
|
|
// BeforeAfterKeyboardEvent preference
|
|
|
|
static bool BeforeAfterKeyboardEventEnabled();
|
|
|
|
|
2016-03-21 09:20:59 +03:00
|
|
|
static bool IsTargetIframe(nsINode* aTarget);
|
|
|
|
|
2013-05-02 17:22:59 +04:00
|
|
|
void Init(nsIDocument* aDocument, nsPresContext* aPresContext,
|
2016-02-24 10:01:11 +03:00
|
|
|
nsViewManager* aViewManager, mozilla::StyleSetHandle aStyleSet);
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Destroy() override;
|
|
|
|
virtual void MakeZombie() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-06-16 04:34:48 +03:00
|
|
|
virtual void UpdatePreferenceStyles() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD GetSelection(SelectionType aType, nsISelection** aSelection) override;
|
|
|
|
virtual mozilla::dom::Selection* GetCurrentSelection(SelectionType aType) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD SetDisplaySelection(int16_t aToggle) override;
|
|
|
|
NS_IMETHOD GetDisplaySelection(int16_t *aToggle) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
NS_IMETHOD ScrollSelectionIntoView(SelectionType aType, SelectionRegion aRegion,
|
2015-03-21 19:28:04 +03:00
|
|
|
int16_t aFlags) override;
|
|
|
|
NS_IMETHOD RepaintSelection(SelectionType aType) override;
|
|
|
|
|
|
|
|
virtual void BeginObservingDocument() override;
|
|
|
|
virtual void EndObservingDocument() override;
|
|
|
|
virtual nsresult Initialize(nscoord aWidth, nscoord aHeight) override;
|
2016-05-12 03:06:11 +03:00
|
|
|
virtual nsresult ResizeReflow(nscoord aWidth, nscoord aHeight, bool aHeightChanging = true) override;
|
|
|
|
virtual nsresult ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight, bool aHeightChanging) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIPageSequenceFrame* GetPageSequenceFrame() const override;
|
|
|
|
virtual nsCanvasFrame* GetCanvasFrame() const override;
|
|
|
|
|
|
|
|
virtual nsIFrame* GetPlaceholderFrameFor(nsIFrame* aFrame) const override;
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual void FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
|
2015-06-21 07:54:15 +03:00
|
|
|
nsFrameState aBitToAdd,
|
|
|
|
ReflowRootHandling aRootHandling =
|
|
|
|
eInferFromBitToAdd) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void FrameNeedsToContinueReflow(nsIFrame *aFrame) override;
|
|
|
|
virtual void CancelAllPendingReflows() override;
|
|
|
|
virtual bool IsSafeToFlush() const override;
|
|
|
|
virtual void FlushPendingNotifications(mozFlushType aType) override;
|
|
|
|
virtual void FlushPendingNotifications(mozilla::ChangesToFlush aType) override;
|
2014-10-23 17:19:25 +04:00
|
|
|
virtual void DestroyFramesFor(nsIContent* aContent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIContent** aDestroyedFramesFor) override;
|
|
|
|
virtual void CreateFramesFor(nsIContent* aContent) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Recreates the frames for a node
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult RecreateFramesFor(nsIContent* aContent) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Post a callback that should be handled after reflow has finished.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult PostReflowCallback(nsIReflowCallback* aCallback) override;
|
|
|
|
virtual void CancelReflowCallback(nsIReflowCallback* aCallback) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ClearFrameRefs(nsIFrame* aFrame) override;
|
|
|
|
virtual already_AddRefed<gfxContext> CreateReferenceRenderingContext() override;
|
2014-09-16 02:54:42 +04:00
|
|
|
virtual nsresult GoToAnchor(const nsAString& aAnchorName, bool aScroll,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aAdditionalScrollFlags = 0) override;
|
|
|
|
virtual nsresult ScrollToAnchor() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsresult ScrollContentIntoView(nsIContent* aContent,
|
2012-03-20 06:09:50 +04:00
|
|
|
ScrollAxis aVertical,
|
|
|
|
ScrollAxis aHorizontal,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aFlags) override;
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool ScrollFrameRectIntoView(nsIFrame* aFrame,
|
2012-03-20 06:09:50 +04:00
|
|
|
const nsRect& aRect,
|
|
|
|
ScrollAxis aVertical,
|
|
|
|
ScrollAxis aHorizontal,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aFlags) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
virtual nsRectVisibility GetRectVisibility(nsIFrame *aFrame,
|
|
|
|
const nsRect &aRect,
|
2015-03-21 19:28:04 +03:00
|
|
|
nscoord aMinTwips) const override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetIgnoreFrameDestruction(bool aIgnore) override;
|
|
|
|
virtual void NotifyDestroyingFrame(nsIFrame* aFrame) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult CaptureHistoryState(nsILayoutHistoryState** aLayoutHistoryState) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void UnsuppressPainting() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-11-17 09:04:09 +03:00
|
|
|
virtual nsresult GetAgentStyleSheets(
|
2016-02-24 10:01:12 +03:00
|
|
|
nsTArray<mozilla::StyleSheetHandle::RefPtr>& aSheets) override;
|
2015-11-17 09:04:09 +03:00
|
|
|
virtual nsresult SetAgentStyleSheets(
|
2016-02-24 10:01:12 +03:00
|
|
|
const nsTArray<mozilla::StyleSheetHandle::RefPtr>& aSheets) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2016-02-24 10:01:12 +03:00
|
|
|
virtual nsresult AddOverrideStyleSheet(mozilla::StyleSheetHandle aSheet) override;
|
|
|
|
virtual nsresult RemoveOverrideStyleSheet(mozilla::StyleSheetHandle aSheet) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsresult HandleEventWithTarget(
|
2013-10-02 07:46:04 +04:00
|
|
|
mozilla::WidgetEvent* aEvent,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
nsIContent* aContent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsEventStatus* aStatus) override;
|
|
|
|
virtual nsIFrame* GetEventTargetFrame() override;
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual already_AddRefed<nsIContent> GetEventTargetContent(
|
2015-03-21 19:28:04 +03:00
|
|
|
mozilla::WidgetEvent* aEvent) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void NotifyCounterStylesAreDirty() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult ReconstructFrames(void) override;
|
|
|
|
virtual void Freeze() override;
|
|
|
|
virtual void Thaw() override;
|
|
|
|
virtual void FireOrClearDelayedEvents(bool aFireEvents) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsresult RenderDocument(const nsRect& aRect, uint32_t aFlags,
|
2011-09-09 23:50:21 +04:00
|
|
|
nscolor aBackgroundColor,
|
2015-03-21 19:28:04 +03:00
|
|
|
gfxContext* aThebesContext) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-06-17 17:00:52 +03:00
|
|
|
virtual already_AddRefed<SourceSurface>
|
2014-01-29 04:10:33 +04:00
|
|
|
RenderNode(nsIDOMNode* aNode,
|
|
|
|
nsIntRegion* aRegion,
|
|
|
|
nsIntPoint& aPoint,
|
2015-07-11 19:15:19 +03:00
|
|
|
nsIntRect* aScreenRect,
|
|
|
|
uint32_t aFlags) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-06-17 17:00:52 +03:00
|
|
|
virtual already_AddRefed<SourceSurface>
|
2014-01-29 04:10:33 +04:00
|
|
|
RenderSelection(nsISelection* aSelection,
|
|
|
|
nsIntPoint& aPoint,
|
2015-07-11 19:15:19 +03:00
|
|
|
nsIntRect* aScreenRect,
|
|
|
|
uint32_t aFlags) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
virtual already_AddRefed<nsPIDOMWindowOuter> GetRootWindow() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual LayerManager* GetLayerManager() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-06-04 23:51:10 +03:00
|
|
|
virtual bool AsyncPanZoomEnabled() override;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void SetIgnoreViewportScrolling(bool aIgnore) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult SetResolution(float aResolution) override {
|
2015-03-07 02:07:59 +03:00
|
|
|
return SetResolutionImpl(aResolution, /* aScaleToResolution = */ false);
|
2015-01-03 04:06:14 +03:00
|
|
|
}
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult SetResolutionAndScaleTo(float aResolution) override {
|
2015-03-07 02:07:59 +03:00
|
|
|
return SetResolutionImpl(aResolution, /* aScaleToResolution = */ true);
|
2015-01-03 04:06:14 +03:00
|
|
|
}
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool ScaleToResolution() const override;
|
|
|
|
virtual float GetCumulativeResolution() override;
|
2015-12-01 03:13:20 +03:00
|
|
|
virtual float GetCumulativeNonRootScaleResolution() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
//nsIViewObserver interface
|
|
|
|
|
2013-01-03 17:23:11 +04:00
|
|
|
virtual void Paint(nsView* aViewToPaint, const nsRegion& aDirtyRegion,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aFlags) override;
|
2013-10-02 07:46:03 +04:00
|
|
|
virtual nsresult HandleEvent(nsIFrame* aFrame,
|
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
bool aDontRetargetEvents,
|
2015-04-14 18:46:39 +03:00
|
|
|
nsEventStatus* aEventStatus,
|
|
|
|
nsIContent** aTargetContent) override;
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsresult HandleDOMEventWithTarget(
|
2013-10-02 07:46:04 +04:00
|
|
|
nsIContent* aTargetContent,
|
|
|
|
mozilla::WidgetEvent* aEvent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsEventStatus* aStatus) override;
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual nsresult HandleDOMEventWithTarget(nsIContent* aTargetContent,
|
2011-09-09 23:50:21 +04:00
|
|
|
nsIDOMEvent* aEvent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsEventStatus* aStatus) override;
|
|
|
|
virtual bool ShouldIgnoreInvalidation() override;
|
|
|
|
virtual void WillPaint() override;
|
|
|
|
virtual void WillPaintWindow() override;
|
|
|
|
virtual void DidPaintWindow() override;
|
|
|
|
virtual void ScheduleViewManagerFlush(PaintType aType = PAINT_DEFAULT) override;
|
2013-10-02 07:46:03 +04:00
|
|
|
virtual void DispatchSynthMouseMove(mozilla::WidgetGUIEvent* aEvent,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aFlushOnHoverChange) override;
|
|
|
|
virtual void ClearMouseCaptureOnView(nsView* aView) override;
|
|
|
|
virtual bool IsVisible() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-04-24 03:08:00 +03:00
|
|
|
virtual already_AddRefed<mozilla::AccessibleCaretEventHub> GetAccessibleCaretEventHub() const override;
|
|
|
|
|
2011-09-09 23:50:21 +04:00
|
|
|
// caret handling
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual already_AddRefed<nsCaret> GetCaret() const override;
|
|
|
|
NS_IMETHOD SetCaretEnabled(bool aInEnable) override;
|
|
|
|
NS_IMETHOD SetCaretReadOnly(bool aReadOnly) override;
|
|
|
|
NS_IMETHOD GetCaretEnabled(bool *aOutEnabled) override;
|
|
|
|
NS_IMETHOD SetCaretVisibilityDuringSelection(bool aVisibility) override;
|
|
|
|
NS_IMETHOD GetCaretVisible(bool *_retval) override;
|
|
|
|
virtual void SetCaret(nsCaret *aNewCaret) override;
|
|
|
|
virtual void RestoreCaret() override;
|
|
|
|
|
|
|
|
NS_IMETHOD SetSelectionFlags(int16_t aInEnable) override;
|
|
|
|
NS_IMETHOD GetSelectionFlags(int16_t *aOutEnable) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
// nsISelectionController
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD PhysicalMove(int16_t aDirection, int16_t aAmount, bool aExtend) override;
|
|
|
|
NS_IMETHOD CharacterMove(bool aForward, bool aExtend) override;
|
|
|
|
NS_IMETHOD CharacterExtendForDelete() override;
|
|
|
|
NS_IMETHOD CharacterExtendForBackspace() override;
|
|
|
|
NS_IMETHOD WordMove(bool aForward, bool aExtend) override;
|
|
|
|
NS_IMETHOD WordExtendForDelete(bool aForward) override;
|
|
|
|
NS_IMETHOD LineMove(bool aForward, bool aExtend) override;
|
|
|
|
NS_IMETHOD IntraLineMove(bool aForward, bool aExtend) override;
|
|
|
|
NS_IMETHOD PageMove(bool aForward, bool aExtend) override;
|
|
|
|
NS_IMETHOD ScrollPage(bool aForward) override;
|
|
|
|
NS_IMETHOD ScrollLine(bool aForward) override;
|
|
|
|
NS_IMETHOD ScrollCharacter(bool aRight) override;
|
|
|
|
NS_IMETHOD CompleteScroll(bool aForward) override;
|
|
|
|
NS_IMETHOD CompleteMove(bool aForward, bool aExtend) override;
|
|
|
|
NS_IMETHOD SelectAll() override;
|
|
|
|
NS_IMETHOD CheckVisibility(nsIDOMNode *node, int16_t startOffset, int16_t EndOffset, bool *_retval) override;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult CheckVisibilityContent(nsIContent* aNode, int16_t aStartOffset,
|
2015-03-21 19:28:04 +03:00
|
|
|
int16_t aEndOffset, bool* aRetval) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
// nsIDocumentObserver
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_BEGINLOAD
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_CONTENTSTATECHANGED
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_DOCUMENTSTATESCHANGED
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETADDED
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETREMOVED
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETAPPLICABLESTATECHANGED
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLERULECHANGED
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLERULEADDED
|
|
|
|
NS_DECL_NSIDOCUMENTOBSERVER_STYLERULEREMOVED
|
|
|
|
|
|
|
|
// nsIMutationObserver
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
|
|
|
|
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
|
|
|
#ifdef MOZ_REFLOW_PERF
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void DumpReflows() override;
|
|
|
|
virtual void CountReflows(const char * aName, nsIFrame * aFrame) override;
|
2014-06-02 16:08:21 +04:00
|
|
|
virtual void PaintCount(const char * aName,
|
2011-09-09 23:50:21 +04:00
|
|
|
nsRenderingContext* aRenderingContext,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
nsIFrame * aFrame,
|
|
|
|
const nsPoint& aOffset,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aColor) override;
|
|
|
|
virtual void SetPaintFrameCount(bool aOn) override;
|
|
|
|
virtual bool IsPaintingFrameCounts() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
virtual void ListStyleContexts(nsIFrame *aRootFrame, FILE *out,
|
2015-03-21 19:28:04 +03:00
|
|
|
int32_t aIndent = 0) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ListStyleSheets(FILE *out, int32_t aIndent = 0) override;
|
|
|
|
virtual void VerifyStyleTree() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
#endif
|
|
|
|
|
2015-11-06 01:35:03 +03:00
|
|
|
static mozilla::LazyLogModule gLog;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void DisableNonTestMouseEvents(bool aDisable) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void UpdateCanvasBackground() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2013-02-14 15:12:27 +04:00
|
|
|
virtual void AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
|
|
|
|
nsDisplayList& aList,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
const nsRect& aBounds,
|
|
|
|
nscolor aBackstopColor,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aFlags) override;
|
2013-02-14 15:12:27 +04:00
|
|
|
|
|
|
|
virtual void AddPrintPreviewBackgroundItem(nsDisplayListBuilder& aBuilder,
|
|
|
|
nsDisplayList& aList,
|
|
|
|
nsIFrame* aFrame,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsRect& aBounds) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nscolor ComputeBackstopColor(nsView* aDisplayRoot) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-11-10 05:38:21 +03:00
|
|
|
virtual nsresult SetIsActive(bool aIsActive, bool aIsHidden = true) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-07-21 17:51:55 +03:00
|
|
|
virtual bool GetIsViewportOverridden() override {
|
2015-09-01 23:47:52 +03:00
|
|
|
return (mMobileViewportManager != nullptr);
|
2015-07-21 17:51:55 +03:00
|
|
|
}
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsLayoutFlushObserver() override
|
2011-09-09 23:50:21 +04:00
|
|
|
{
|
|
|
|
return GetPresContext()->RefreshDriver()->
|
|
|
|
IsLayoutFlushObserver(this);
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void LoadComplete() override;
|
2013-11-25 09:00:00 +04:00
|
|
|
|
2013-10-01 03:20:23 +04:00
|
|
|
void AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf,
|
|
|
|
nsArenaMemoryStats *aArenaObjectsSize,
|
|
|
|
size_t *aPresShellSize,
|
|
|
|
size_t *aStyleSetsSize,
|
|
|
|
size_t *aTextRunsSize,
|
2015-03-21 19:28:04 +03:00
|
|
|
size_t *aPresContextSize) override;
|
2013-06-23 16:03:39 +04:00
|
|
|
size_t SizeOfTextRuns(mozilla::MallocSizeOf aMallocSizeOf) const;
|
2012-05-16 21:32:40 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void AddInvalidateHiddenPresShellObserver(nsRefreshDriver *aDriver) override;
|
2012-08-29 09:48:44 +04:00
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
// This data is stored as a content property (nsGkAtoms::scrolling) on
|
|
|
|
// mContentToScrollTo when we have a pending ScrollIntoView.
|
|
|
|
struct ScrollIntoViewData {
|
|
|
|
ScrollAxis mContentScrollVAxis;
|
|
|
|
ScrollAxis mContentScrollHAxis;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mContentToScrollToFlags;
|
2012-05-16 21:32:40 +04:00
|
|
|
};
|
|
|
|
|
2013-02-25 04:59:22 +04:00
|
|
|
|
2016-03-26 00:49:43 +03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Approximate frame visibility tracking public API.
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void ScheduleApproximateFrameVisibilityUpdateSoon() override;
|
|
|
|
void ScheduleApproximateFrameVisibilityUpdateNow() override;
|
2013-02-25 04:59:22 +04:00
|
|
|
|
2016-03-26 00:49:43 +03:00
|
|
|
void RebuildApproximateFrameVisibilityDisplayList(const nsDisplayList& aList) override;
|
|
|
|
void RebuildApproximateFrameVisibility(nsRect* aRect = nullptr,
|
|
|
|
bool aRemoveOnly = false) override;
|
2013-02-25 04:59:22 +04:00
|
|
|
|
2016-04-21 11:21:58 +03:00
|
|
|
void MarkFrameVisibleInDisplayPort(nsIFrame* aFrame) override;
|
|
|
|
void MarkFrameNonvisible(nsIFrame* aFrame) override;
|
2016-03-26 00:49:43 +03:00
|
|
|
|
|
|
|
bool AssumeAllFramesVisible() override;
|
2013-09-15 04:05:04 +04:00
|
|
|
|
2013-09-15 04:05:05 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void RecordShadowStyleChange(mozilla::dom::ShadowRoot* aShadowRoot) override;
|
2013-12-02 14:26:12 +04:00
|
|
|
|
2014-11-03 10:05:38 +03:00
|
|
|
virtual void DispatchAfterKeyboardEvent(nsINode* aTarget,
|
|
|
|
const mozilla::WidgetKeyboardEvent& aEvent,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aEmbeddedCancelled) override;
|
2014-11-03 10:05:38 +03:00
|
|
|
|
2016-03-21 09:20:59 +03:00
|
|
|
virtual bool CanDispatchEvent(
|
|
|
|
const mozilla::WidgetGUIEvent* aEvent = nullptr) const override;
|
|
|
|
|
2014-08-08 20:05:40 +04:00
|
|
|
void SetNextPaintCompressed() { mNextPaintCompressed = true; }
|
|
|
|
|
2011-09-09 23:50:21 +04:00
|
|
|
protected:
|
|
|
|
virtual ~PresShell();
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
void HandlePostedReflowCallbacks(bool aInterruptible);
|
2011-09-09 23:50:21 +04:00
|
|
|
void CancelPostedReflowCallbacks();
|
|
|
|
|
2015-07-24 00:53:32 +03:00
|
|
|
void ScheduleBeforeFirstPaint();
|
2011-09-09 23:50:21 +04:00
|
|
|
void UnsuppressAndInvalidate();
|
|
|
|
|
|
|
|
void WillCauseReflow() {
|
|
|
|
nsContentUtils::AddScriptBlocker();
|
|
|
|
++mChangeNestCount;
|
|
|
|
}
|
|
|
|
nsresult DidCauseReflow();
|
|
|
|
friend class nsAutoCauseReflowNotifier;
|
|
|
|
|
2015-02-04 07:19:00 +03:00
|
|
|
nsresult DispatchEventToDOM(mozilla::WidgetEvent* aEvent,
|
|
|
|
nsEventStatus* aStatus,
|
|
|
|
nsPresShellEventCB* aEventCB);
|
|
|
|
void DispatchTouchEventToDOM(mozilla::WidgetEvent* aEvent,
|
|
|
|
nsEventStatus* aStatus,
|
|
|
|
nsPresShellEventCB* aEventCB,
|
|
|
|
bool aTouchIsNew);
|
2011-12-17 04:24:11 +04:00
|
|
|
|
2011-09-09 23:50:21 +04:00
|
|
|
void WillDoReflow();
|
2013-05-14 23:24:14 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback handler for whether reflow happened.
|
|
|
|
*
|
|
|
|
* @param aInterruptible Whether or not reflow interruption is allowed.
|
|
|
|
*/
|
2015-11-05 07:55:16 +03:00
|
|
|
void DidDoReflow(bool aInterruptible);
|
2011-09-09 23:50:21 +04:00
|
|
|
// ProcessReflowCommands returns whether we processed all our dirty roots
|
|
|
|
// without interruptions.
|
2011-09-29 10:19:26 +04:00
|
|
|
bool ProcessReflowCommands(bool aInterruptible);
|
2011-09-09 23:50:21 +04:00
|
|
|
// MaybeScheduleReflow checks if posting a reflow is needed, then checks if
|
|
|
|
// the last reflow was interrupted. In the interrupted case ScheduleReflow is
|
|
|
|
// called off a timer, otherwise it is called directly.
|
|
|
|
void MaybeScheduleReflow();
|
|
|
|
// Actually schedules a reflow. This should only be called by
|
|
|
|
// MaybeScheduleReflow and the reflow timer ScheduleReflowOffTimer
|
|
|
|
// sets up.
|
|
|
|
void ScheduleReflow();
|
|
|
|
|
|
|
|
// DoReflow returns whether the reflow finished without interruption
|
2011-09-29 10:19:26 +04:00
|
|
|
bool DoReflow(nsIFrame* aFrame, bool aInterruptible);
|
2011-09-09 23:50:21 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
void DoVerifyReflow();
|
|
|
|
void VerifyHasDirtyRootAncestor(nsIFrame* aFrame);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Helper for ScrollContentIntoView
|
2012-05-16 21:32:40 +04:00
|
|
|
void DoScrollContentIntoView();
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2012-06-06 07:47:33 +04:00
|
|
|
/**
|
2013-05-16 19:06:03 +04:00
|
|
|
* Initialize cached font inflation preference values and do an initial
|
|
|
|
* computation to determine if font inflation is enabled.
|
2012-06-06 07:47:33 +04:00
|
|
|
*
|
|
|
|
* @see nsLayoutUtils::sFontSizeInflationEmPerLine
|
|
|
|
* @see nsLayoutUtils::sFontSizeInflationMinTwips
|
|
|
|
* @see nsLayoutUtils::sFontSizeInflationLineThreshold
|
|
|
|
*/
|
|
|
|
void SetupFontInflation();
|
|
|
|
|
2011-09-09 23:50:21 +04:00
|
|
|
friend struct AutoRenderingStateSaveRestore;
|
|
|
|
friend struct RenderingState;
|
|
|
|
|
|
|
|
struct RenderingState {
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit RenderingState(PresShell* aPresShell)
|
2015-03-07 02:07:59 +03:00
|
|
|
: mResolution(aPresShell->mResolution)
|
2012-05-16 21:32:40 +04:00
|
|
|
, mRenderFlags(aPresShell->mRenderFlags)
|
2011-09-09 23:50:21 +04:00
|
|
|
{ }
|
2016-03-19 04:38:57 +03:00
|
|
|
Maybe<float> mResolution;
|
2012-05-16 21:32:40 +04:00
|
|
|
RenderFlags mRenderFlags;
|
2011-09-09 23:50:21 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct AutoSaveRestoreRenderingState {
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit AutoSaveRestoreRenderingState(PresShell* aPresShell)
|
2011-09-09 23:50:21 +04:00
|
|
|
: mPresShell(aPresShell)
|
|
|
|
, mOldState(aPresShell)
|
|
|
|
{}
|
|
|
|
|
|
|
|
~AutoSaveRestoreRenderingState()
|
|
|
|
{
|
|
|
|
mPresShell->mRenderFlags = mOldState.mRenderFlags;
|
2015-03-07 02:07:59 +03:00
|
|
|
mPresShell->mResolution = mOldState.mResolution;
|
2011-09-09 23:50:21 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
PresShell* mPresShell;
|
|
|
|
RenderingState mOldState;
|
|
|
|
};
|
2012-05-16 21:32:40 +04:00
|
|
|
static RenderFlags ChangeFlag(RenderFlags aFlags, bool aOnOff,
|
|
|
|
eRenderFlag aFlag)
|
|
|
|
{
|
|
|
|
return aOnOff ? (aFlags | aFlag) : (aFlag & ~aFlag);
|
|
|
|
}
|
|
|
|
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
void SetRenderingState(const RenderingState& aState);
|
|
|
|
|
|
|
|
friend class nsPresShellEventCB;
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mCaretEnabled;
|
2016-01-14 01:00:15 +03:00
|
|
|
|
|
|
|
bool mIsHidden;
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
2011-09-09 23:50:21 +04:00
|
|
|
nsStyleSet* CloneStyleSet(nsStyleSet* aSet);
|
2011-09-29 10:19:26 +04:00
|
|
|
bool VerifyIncrementalReflow();
|
|
|
|
bool mInVerifyReflow;
|
2011-09-09 23:50:21 +04:00
|
|
|
void ShowEventTargetDebug();
|
|
|
|
#endif
|
|
|
|
|
2016-02-24 10:01:12 +03:00
|
|
|
void RecordStyleSheetChange(mozilla::StyleSheetHandle aStyleSheet);
|
2013-01-09 03:25:48 +04:00
|
|
|
|
2015-06-16 04:34:48 +03:00
|
|
|
void RemovePreferenceStyles();
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
// methods for painting a range to an offscreen buffer
|
|
|
|
|
|
|
|
// given a display list, clip the items within the list to
|
|
|
|
// the range
|
|
|
|
nsRect ClipListToRange(nsDisplayListBuilder *aBuilder,
|
|
|
|
nsDisplayList* aList,
|
2012-01-10 18:19:54 +04:00
|
|
|
nsRange* aRange);
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
// create a RangePaintInfo for the range aRange containing the
|
|
|
|
// display list needed to paint the range to a surface
|
2016-01-21 00:24:28 +03:00
|
|
|
mozilla::UniquePtr<RangePaintInfo>
|
|
|
|
CreateRangePaintInfo(nsIDOMRange* aRange,
|
|
|
|
nsRect& aSurfaceRect,
|
|
|
|
bool aForPrimarySelection);
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Paint the items to a new surface and return it.
|
|
|
|
*
|
|
|
|
* aSelection - selection being painted, if any
|
|
|
|
* aRegion - clip region, if any
|
|
|
|
* aArea - area that the surface occupies, relative to the root frame
|
|
|
|
* aPoint - reference point, typically the mouse position
|
|
|
|
* aScreenRect - [out] set to the area of the screen the painted area should
|
|
|
|
* be displayed at
|
2015-07-11 19:15:19 +03:00
|
|
|
* aFlags - set RENDER_AUTO_SCALE to scale down large images, but it must not
|
|
|
|
* be set if a custom image was specified
|
2011-09-09 23:50:21 +04:00
|
|
|
*/
|
2015-06-17 17:00:52 +03:00
|
|
|
already_AddRefed<SourceSurface>
|
2016-03-03 00:40:24 +03:00
|
|
|
PaintRangePaintInfo(const nsTArray<mozilla::UniquePtr<RangePaintInfo>>& aItems,
|
2011-09-09 23:50:21 +04:00
|
|
|
nsISelection* aSelection,
|
|
|
|
nsIntRegion* aRegion,
|
|
|
|
nsRect aArea,
|
|
|
|
nsIntPoint& aPoint,
|
2015-07-11 19:15:19 +03:00
|
|
|
nsIntRect* aScreenRect,
|
|
|
|
uint32_t aFlags);
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Methods to handle changes to user and UA sheet lists that we get
|
|
|
|
* notified about.
|
|
|
|
*/
|
|
|
|
void AddUserSheet(nsISupports* aSheet);
|
|
|
|
void AddAgentSheet(nsISupports* aSheet);
|
2012-10-16 23:45:50 +04:00
|
|
|
void AddAuthorSheet(nsISupports* aSheet);
|
2015-10-20 02:16:20 +03:00
|
|
|
void RemoveSheet(mozilla::SheetType aType, nsISupports* aSheet);
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
// Hide a view if it is a popup
|
2013-01-03 17:23:11 +04:00
|
|
|
void HideViewIfPopup(nsView* aView);
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
// Utility method to restore the root scrollframe state
|
|
|
|
void RestoreRootScrollPosition();
|
|
|
|
|
2014-08-06 09:19:27 +04:00
|
|
|
void MaybeReleaseCapturingContent();
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2013-10-02 07:46:04 +04:00
|
|
|
nsresult HandleRetargetedEvent(mozilla::WidgetEvent* aEvent,
|
|
|
|
nsEventStatus* aStatus,
|
|
|
|
nsIContent* aTarget)
|
2011-09-09 23:50:21 +04:00
|
|
|
{
|
2012-07-30 18:20:58 +04:00
|
|
|
PushCurrentEventInfo(nullptr, nullptr);
|
2011-09-09 23:50:21 +04:00
|
|
|
mCurrentEventContent = aTarget;
|
|
|
|
nsresult rv = NS_OK;
|
|
|
|
if (GetCurrentEventFrame()) {
|
2015-11-10 05:49:05 +03:00
|
|
|
rv = HandleEventInternal(aEvent, aStatus, true);
|
2011-09-09 23:50:21 +04:00
|
|
|
}
|
|
|
|
PopCurrentEventInfo();
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2013-10-22 17:27:34 +04:00
|
|
|
class DelayedEvent
|
2011-09-09 23:50:21 +04:00
|
|
|
{
|
|
|
|
public:
|
2013-10-22 17:27:34 +04:00
|
|
|
virtual ~DelayedEvent() { }
|
|
|
|
virtual void Dispatch() { }
|
2011-09-09 23:50:21 +04:00
|
|
|
};
|
|
|
|
|
2013-10-22 17:27:34 +04:00
|
|
|
class DelayedInputEvent : public DelayedEvent
|
2011-09-09 23:50:21 +04:00
|
|
|
{
|
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Dispatch() override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
protected:
|
2013-10-22 17:27:34 +04:00
|
|
|
DelayedInputEvent();
|
|
|
|
virtual ~DelayedInputEvent();
|
2013-10-18 10:10:21 +04:00
|
|
|
|
2013-10-01 11:23:02 +04:00
|
|
|
mozilla::WidgetInputEvent* mEvent;
|
2011-09-09 23:50:21 +04:00
|
|
|
};
|
|
|
|
|
2013-10-22 17:27:34 +04:00
|
|
|
class DelayedMouseEvent : public DelayedInputEvent
|
2011-09-09 23:50:21 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit DelayedMouseEvent(mozilla::WidgetMouseEvent* aEvent);
|
2011-09-09 23:50:21 +04:00
|
|
|
};
|
|
|
|
|
2013-10-22 17:27:34 +04:00
|
|
|
class DelayedKeyEvent : public DelayedInputEvent
|
2011-09-09 23:50:21 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit DelayedKeyEvent(mozilla::WidgetKeyboardEvent* aEvent);
|
2011-09-09 23:50:21 +04:00
|
|
|
};
|
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
// Check if aEvent is a mouse event and record the mouse location for later
|
|
|
|
// synth mouse moves.
|
2013-10-02 07:46:03 +04:00
|
|
|
void RecordMouseLocation(mozilla::WidgetGUIEvent* aEvent);
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsSynthMouseMoveEvent final : public nsARefreshObserver {
|
2012-05-16 21:32:40 +04:00
|
|
|
public:
|
2015-04-06 18:22:00 +03:00
|
|
|
nsSynthMouseMoveEvent(PresShell* aPresShell, bool aFromScroll)
|
|
|
|
: mPresShell(aPresShell), mFromScroll(aFromScroll) {
|
2012-05-16 21:32:40 +04:00
|
|
|
NS_ASSERTION(mPresShell, "null parameter");
|
|
|
|
}
|
2014-03-21 05:16:20 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Private destructor, to discourage deletion outside of Release():
|
2012-05-16 21:32:40 +04:00
|
|
|
~nsSynthMouseMoveEvent() {
|
|
|
|
Revoke();
|
|
|
|
}
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2014-03-21 05:16:20 +04:00
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(nsSynthMouseMoveEvent, override)
|
2014-03-20 10:49:25 +04:00
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
void Revoke() {
|
|
|
|
if (mPresShell) {
|
|
|
|
mPresShell->GetPresContext()->RefreshDriver()->
|
|
|
|
RemoveRefreshObserver(this, Flush_Display);
|
2012-07-30 18:20:58 +04:00
|
|
|
mPresShell = nullptr;
|
2012-05-16 21:32:40 +04:00
|
|
|
}
|
|
|
|
}
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void WillRefresh(mozilla::TimeStamp aTime) override {
|
2013-11-12 16:54:10 +04:00
|
|
|
if (mPresShell) {
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<PresShell> shell = mPresShell;
|
2015-04-06 18:22:00 +03:00
|
|
|
shell->ProcessSynthMouseMoveEvent(mFromScroll);
|
2013-11-12 16:54:10 +04:00
|
|
|
}
|
2012-05-16 21:32:40 +04:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
PresShell* mPresShell;
|
|
|
|
bool mFromScroll;
|
|
|
|
};
|
2015-04-06 18:22:00 +03:00
|
|
|
void ProcessSynthMouseMoveEvent(bool aFromScroll);
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
void QueryIsActive();
|
|
|
|
nsresult UpdateImageLockingState();
|
2012-04-27 01:40:05 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool InZombieDocument(nsIContent *aContent);
|
2014-04-08 04:00:52 +04:00
|
|
|
already_AddRefed<nsIPresShell> GetParentPresShellForEventHandling();
|
2013-03-08 15:04:53 +04:00
|
|
|
nsIContent* GetCurrentEventContent();
|
2012-05-16 21:32:40 +04:00
|
|
|
nsIFrame* GetCurrentEventFrame();
|
2013-10-02 07:46:03 +04:00
|
|
|
nsresult RetargetEventToParent(mozilla::WidgetGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
2011-09-09 23:50:21 +04:00
|
|
|
void PushCurrentEventInfo(nsIFrame* aFrame, nsIContent* aContent);
|
|
|
|
void PopCurrentEventInfo();
|
2015-11-10 05:49:05 +03:00
|
|
|
/**
|
|
|
|
* @param aIsHandlingNativeEvent true when the caller (perhaps) handles
|
|
|
|
* an event which is caused by native
|
|
|
|
* event. Otherwise, false.
|
|
|
|
*/
|
2013-10-02 07:46:04 +04:00
|
|
|
nsresult HandleEventInternal(mozilla::WidgetEvent* aEvent,
|
2015-11-10 05:49:05 +03:00
|
|
|
nsEventStatus* aStatus,
|
|
|
|
bool aIsHandlingNativeEvent);
|
2013-10-02 07:46:03 +04:00
|
|
|
nsresult HandlePositionedEvent(nsIFrame* aTargetFrame,
|
|
|
|
mozilla::WidgetGUIEvent* aEvent,
|
2011-09-09 23:50:21 +04:00
|
|
|
nsEventStatus* aEventStatus);
|
|
|
|
// This returns the focused DOM window under our top level window.
|
|
|
|
// I.e., when we are deactive, this returns the *last* focused DOM window.
|
2016-01-30 20:05:36 +03:00
|
|
|
already_AddRefed<nsPIDOMWindowOuter> GetFocusedDOMWindowInOurWindow();
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This and the next two helper methods are used to target and position the
|
|
|
|
* context menu when the keyboard shortcut is used to open it.
|
|
|
|
*
|
|
|
|
* If another menu is open, the context menu is opened relative to the
|
|
|
|
* active menuitem within the menu, or the menu itself if no item is active.
|
|
|
|
* Otherwise, if the caret is visible, the menu is opened near the caret.
|
|
|
|
* Otherwise, if a selectable list such as a listbox is focused, the
|
|
|
|
* current item within the menu is opened relative to this item.
|
|
|
|
* Otherwise, the context menu is opened at the topleft corner of the
|
|
|
|
* view.
|
|
|
|
*
|
|
|
|
* Returns true if the context menu event should fire and false if it should
|
|
|
|
* not.
|
|
|
|
*/
|
2013-10-02 10:38:27 +04:00
|
|
|
bool AdjustContextMenuKeyEvent(mozilla::WidgetMouseEvent* aEvent);
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2014-03-20 10:49:25 +04:00
|
|
|
//
|
2015-02-02 01:27:31 +03:00
|
|
|
bool PrepareToUseCaretPosition(nsIWidget* aEventWidget,
|
|
|
|
mozilla::LayoutDeviceIntPoint& aTargetPt);
|
2011-09-09 23:50:21 +04:00
|
|
|
|
|
|
|
// Get the selected item and coordinates in device pixels relative to root
|
|
|
|
// document's root view for element, first ensuring the element is onscreen
|
|
|
|
void GetCurrentItemAndPositionForElement(nsIDOMElement *aCurrentEl,
|
|
|
|
nsIContent **aTargetToUse,
|
2013-08-02 11:05:16 +04:00
|
|
|
mozilla::LayoutDeviceIntPoint& aTargetPt,
|
2011-09-09 23:50:21 +04:00
|
|
|
nsIWidget *aRootWidget);
|
|
|
|
|
2015-05-08 20:12:41 +03:00
|
|
|
void FireResizeEvent();
|
|
|
|
static void AsyncResizeEventCallback(nsITimer* aTimer, void* aPresShell);
|
|
|
|
|
2015-04-06 18:22:00 +03:00
|
|
|
virtual void SynthesizeMouseMove(bool aFromScroll) override;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
PresShell* GetRootPresShell();
|
|
|
|
|
|
|
|
nscolor GetDefaultBackgroundColorToDraw();
|
|
|
|
|
2013-06-01 14:00:12 +04:00
|
|
|
DOMHighResTimeStamp GetPerformanceNow();
|
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
// The callback for the mPaintSuppressionTimer timer.
|
|
|
|
static void sPaintSuppressionCallback(nsITimer* aTimer, void* aPresShell);
|
|
|
|
|
|
|
|
// The callback for the mReflowContinueTimer timer.
|
|
|
|
static void sReflowContinueCallback(nsITimer* aTimer, void* aPresShell);
|
|
|
|
bool ScheduleReflowOffTimer();
|
2012-08-15 22:52:35 +04:00
|
|
|
|
|
|
|
// Widget notificiations
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void WindowSizeMoveDone() override;
|
|
|
|
virtual void SysColorChanged() override { mPresContext->SysColorChanged(); }
|
|
|
|
virtual void ThemeChanged() override { mPresContext->ThemeChanged(); }
|
|
|
|
virtual void BackingScaleFactorChanged() override { mPresContext->UIResolutionChanged(); }
|
2016-01-08 22:18:11 +03:00
|
|
|
#ifdef ANDROID
|
|
|
|
virtual nsIDocument* GetTouchEventTargetDocument();
|
|
|
|
#endif
|
2016-01-21 09:55:37 +03:00
|
|
|
|
|
|
|
virtual void PausePainting() override;
|
|
|
|
virtual void ResumePainting() override;
|
|
|
|
|
2014-04-04 21:09:10 +04:00
|
|
|
void UpdateActivePointerState(mozilla::WidgetGUIEvent* aEvent);
|
2013-02-25 04:59:22 +04:00
|
|
|
|
|
|
|
|
2016-03-26 00:49:43 +03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Approximate frame visibility tracking implementation.
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void UpdateApproximateFrameVisibility();
|
|
|
|
void DoUpdateApproximateFrameVisibility(bool aRemoveOnly);
|
|
|
|
|
2016-04-21 11:21:58 +03:00
|
|
|
void ClearVisibleFramesSets(Maybe<OnNonvisible> aNonvisibleAction = Nothing());
|
|
|
|
static void ClearVisibleFramesForUnvisitedPresShells(nsView* aView, bool aClear);
|
|
|
|
static void MarkFramesInListApproximatelyVisible(const nsDisplayList& aList);
|
2016-03-26 00:49:43 +03:00
|
|
|
void MarkFramesInSubtreeApproximatelyVisible(nsIFrame* aFrame,
|
|
|
|
const nsRect& aRect,
|
|
|
|
bool aRemoveOnly = false);
|
2013-02-25 04:59:22 +04:00
|
|
|
|
2016-04-21 11:21:58 +03:00
|
|
|
void DecVisibleCount(const VisibleFrames& aFrames,
|
|
|
|
VisibilityCounter aCounter,
|
|
|
|
Maybe<OnNonvisible> aNonvisibleAction = Nothing());
|
2016-03-26 00:49:43 +03:00
|
|
|
|
2016-04-21 11:21:58 +03:00
|
|
|
void InitVisibleRegionsIfVisualizationEnabled(VisibilityCounter aForCounter);
|
|
|
|
void AddFrameToVisibleRegions(nsIFrame* aFrame, VisibilityCounter aForCounter);
|
|
|
|
void NotifyCompositorOfVisibleRegionsChange();
|
|
|
|
|
2016-03-26 00:49:43 +03:00
|
|
|
nsRevocableEventPtr<nsRunnableMethod<PresShell>> mUpdateApproximateFrameVisibilityEvent;
|
2016-04-21 11:21:58 +03:00
|
|
|
nsRevocableEventPtr<nsRunnableMethod<PresShell>> mNotifyCompositorOfVisibleRegionsChangeEvent;
|
2016-03-26 00:49:43 +03:00
|
|
|
|
|
|
|
// A set of frames that were visible or could be visible soon at the time
|
|
|
|
// that we last did an approximate frame visibility update.
|
|
|
|
VisibleFrames mApproximatelyVisibleFrames;
|
|
|
|
|
2016-04-21 11:21:58 +03:00
|
|
|
// A set of frames that were visible in the displayport the last time we painted.
|
|
|
|
VisibleFrames mInDisplayPortFrames;
|
|
|
|
|
|
|
|
struct VisibleRegionsContainer
|
|
|
|
{
|
|
|
|
// The approximately visible regions calculated during the last update to
|
|
|
|
// approximate frame visibility.
|
|
|
|
VisibleRegions mApproximate;
|
|
|
|
|
|
|
|
// The in-displayport visible regions calculated during the last paint.
|
|
|
|
VisibleRegions mInDisplayPort;
|
|
|
|
};
|
|
|
|
|
|
|
|
// The most recent visible regions we've computed. Only non-null if the APZ
|
|
|
|
// minimap visibility visualization was enabled during the last visibility
|
|
|
|
// update.
|
|
|
|
UniquePtr<VisibleRegionsContainer> mVisibleRegions;
|
|
|
|
|
2016-03-26 00:49:43 +03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2014-11-03 10:05:38 +03:00
|
|
|
// Methods for dispatching KeyboardEvent and BeforeAfterKeyboardEvent.
|
2016-03-26 00:49:43 +03:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-11-03 10:05:38 +03:00
|
|
|
void HandleKeyboardEvent(nsINode* aTarget,
|
|
|
|
mozilla::WidgetKeyboardEvent& aEvent,
|
|
|
|
bool aEmbeddedCancelled,
|
|
|
|
nsEventStatus* aStatus,
|
|
|
|
mozilla::EventDispatchingCallback* aEventCB);
|
|
|
|
void DispatchBeforeKeyboardEventInternal(
|
|
|
|
const nsTArray<nsCOMPtr<mozilla::dom::Element> >& aChain,
|
|
|
|
const mozilla::WidgetKeyboardEvent& aEvent,
|
|
|
|
size_t& aChainIndex,
|
|
|
|
bool& aDefaultPrevented);
|
|
|
|
void DispatchAfterKeyboardEventInternal(
|
|
|
|
const nsTArray<nsCOMPtr<mozilla::dom::Element> >& aChain,
|
|
|
|
const mozilla::WidgetKeyboardEvent& aEvent,
|
|
|
|
bool aEmbeddedCancelled,
|
|
|
|
size_t aChainIndex = 0);
|
2016-03-21 09:20:59 +03:00
|
|
|
|
|
|
|
#ifdef MOZ_B2G
|
|
|
|
// This method is used to forward the keyboard event to the input-method-app
|
|
|
|
// before the event is dispatched to its event target.
|
|
|
|
// Return true if it's successfully forwarded. Otherwise, return false.
|
|
|
|
bool ForwardKeyToInputMethodApp(nsINode* aTarget,
|
|
|
|
mozilla::WidgetKeyboardEvent& aEvent,
|
|
|
|
nsEventStatus* aStatus);
|
|
|
|
#endif // MOZ_B2G
|
|
|
|
|
|
|
|
// This method tries forwarding key events to the input-method-editor(IME).
|
|
|
|
// If the event isn't be forwarded, then it will be dispathed to its target.
|
|
|
|
// Return true when event is successfully forwarded to the input-method-editor.
|
|
|
|
// Otherwise, return false.
|
|
|
|
bool ForwardKeyToInputMethodAppOrDispatch(bool aIsTargetRemote,
|
|
|
|
nsINode* aTarget,
|
|
|
|
mozilla::WidgetKeyboardEvent& aEvent,
|
|
|
|
nsEventStatus* aStatus,
|
|
|
|
mozilla::EventDispatchingCallback* aEventCB);
|
2014-11-03 10:05:38 +03:00
|
|
|
|
2015-03-07 02:07:59 +03:00
|
|
|
nsresult SetResolutionImpl(float aResolution, bool aScaleToResolution);
|
2015-01-03 04:06:14 +03:00
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
// The reflow root under which we're currently reflowing. Null when
|
|
|
|
// not in reflow.
|
|
|
|
nsIFrame* mCurrentReflowRoot;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mUpdateCount;
|
2012-05-16 21:32:40 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MOZ_REFLOW_PERF
|
|
|
|
ReflowCountMgr* mReflowCountMgr;
|
|
|
|
#endif
|
|
|
|
|
2011-09-09 23:50:21 +04:00
|
|
|
// This is used for synthetic mouse events that are sent when what is under
|
|
|
|
// the mouse pointer may have changed without the mouse moving (eg scrolling,
|
|
|
|
// change to the document contents).
|
|
|
|
// It is set only on a presshell for a root document, this value represents
|
|
|
|
// the last observed location of the mouse relative to that root document. It
|
|
|
|
// is set to (NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE) if the mouse isn't
|
|
|
|
// over our window or there is no last observed mouse location for some
|
|
|
|
// reason.
|
2012-05-16 21:32:40 +04:00
|
|
|
nsPoint mMouseLocation;
|
2016-03-11 02:25:49 +03:00
|
|
|
// This is an APZ state variable that tracks the target guid for the last
|
|
|
|
// mouse event that was processed (corresponding to mMouseLocation). This is
|
|
|
|
// needed for the synthetic mouse events.
|
|
|
|
mozilla::layers::ScrollableLayerGuid mMouseEventTargetGuid;
|
2012-01-10 09:23:29 +04:00
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
// mStyleSet owns it but we maintain a ref, may be null
|
2016-02-24 10:01:12 +03:00
|
|
|
mozilla::StyleSheetHandle::RefPtr mPrefStyleSheet;
|
2012-05-16 21:32:40 +04:00
|
|
|
|
|
|
|
// Set of frames that we should mark with NS_FRAME_HAS_DIRTY_CHILDREN after
|
|
|
|
// we finish reflowing mCurrentReflowRoot.
|
|
|
|
nsTHashtable<nsPtrHashKey<nsIFrame> > mFramesToDirty;
|
|
|
|
|
|
|
|
// Reflow roots that need to be reflowed.
|
|
|
|
nsTArray<nsIFrame*> mDirtyRoots;
|
|
|
|
|
2013-10-22 17:27:34 +04:00
|
|
|
nsTArray<nsAutoPtr<DelayedEvent> > mDelayedEvents;
|
2015-05-08 20:12:41 +03:00
|
|
|
nsRevocableEventPtr<nsRunnableMethod<PresShell> > mResizeEvent;
|
|
|
|
nsCOMPtr<nsITimer> mAsyncResizeEventTimer;
|
2013-03-08 15:04:53 +04:00
|
|
|
private:
|
2012-05-16 21:32:40 +04:00
|
|
|
nsIFrame* mCurrentEventFrame;
|
|
|
|
nsCOMPtr<nsIContent> mCurrentEventContent;
|
|
|
|
nsTArray<nsIFrame*> mCurrentEventFrameStack;
|
|
|
|
nsCOMArray<nsIContent> mCurrentEventContentStack;
|
2013-03-08 15:04:53 +04:00
|
|
|
protected:
|
2011-09-09 23:50:21 +04:00
|
|
|
nsRevocableEventPtr<nsSynthMouseMoveEvent> mSynthMouseMoveEvent;
|
2012-05-16 21:32:40 +04:00
|
|
|
nsCOMPtr<nsIContent> mLastAnchorScrolledTo;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsCaret> mCaret;
|
|
|
|
RefPtr<nsCaret> mOriginalCaret;
|
2012-05-16 21:32:40 +04:00
|
|
|
nsCallbackEventRequest* mFirstCallbackEventRequest;
|
|
|
|
nsCallbackEventRequest* mLastCallbackEventRequest;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-12-22 09:14:12 +03:00
|
|
|
mozilla::TouchManager mTouchManager;
|
2015-02-20 10:12:00 +03:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<ZoomConstraintsClient> mZoomConstraintsClient;
|
|
|
|
RefPtr<MobileViewportManager> mMobileViewportManager;
|
2015-06-17 19:32:42 +03:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::AccessibleCaretEventHub> mAccessibleCaretEventHub;
|
2014-06-03 11:08:54 +04:00
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
// This timer controls painting suppression. Until it fires
|
|
|
|
// or all frames are constructed, we won't paint anything but
|
|
|
|
// our <body> background and scrollbars.
|
|
|
|
nsCOMPtr<nsITimer> mPaintSuppressionTimer;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2014-01-30 09:41:17 +04:00
|
|
|
nsCOMPtr<nsITimer> mDelayedPaintTimer;
|
|
|
|
|
2013-06-01 14:00:12 +04:00
|
|
|
// The `performance.now()` value when we last started to process reflows.
|
|
|
|
DOMHighResTimeStamp mLastReflowStart;
|
|
|
|
|
2013-11-05 05:03:22 +04:00
|
|
|
mozilla::TimeStamp mLoadBegin; // used to time loads
|
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
// Information needed to properly handle scrolling content into view if the
|
|
|
|
// pre-scroll reflow flush can be interrupted. mContentToScrollTo is
|
|
|
|
// non-null between the initial scroll attempt and the first time we finish
|
2012-05-16 21:32:40 +04:00
|
|
|
// processing all our dirty roots. mContentToScrollTo has a content property
|
|
|
|
// storing the details for the scroll operation, see ScrollIntoViewData above.
|
2012-05-16 21:32:40 +04:00
|
|
|
nsCOMPtr<nsIContent> mContentToScrollTo;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
nscoord mLastAnchorScrollPositionY;
|
2011-09-09 23:50:21 +04:00
|
|
|
|
2015-04-14 18:46:39 +03:00
|
|
|
// Information about live content (which still stay in DOM tree).
|
|
|
|
// Used in case we need re-dispatch event after sending pointer event,
|
|
|
|
// when target of pointer event was deleted during executing user handlers.
|
|
|
|
nsCOMPtr<nsIContent> mPointerEventTarget;
|
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
// This is used to protect ourselves from triggering reflow while in the
|
|
|
|
// middle of frame construction and the like... it really shouldn't be
|
|
|
|
// needed, one hopes, but it is for now.
|
2012-08-22 19:56:38 +04:00
|
|
|
uint16_t mChangeNestCount;
|
2014-03-20 10:49:25 +04:00
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
bool mDocumentLoading : 1;
|
|
|
|
bool mIgnoreFrameDestruction : 1;
|
|
|
|
bool mHaveShutDown : 1;
|
2014-07-24 12:28:46 +04:00
|
|
|
bool mLastRootReflowHadUnconstrainedBSize : 1;
|
2012-05-16 21:32:40 +04:00
|
|
|
bool mNoDelayedMouseEvents : 1;
|
|
|
|
bool mNoDelayedKeyEvents : 1;
|
|
|
|
|
|
|
|
// We've been disconnected from the document. We will refuse to paint the
|
|
|
|
// document until either our timer fires or all frames are constructed.
|
|
|
|
bool mIsDocumentGone : 1;
|
|
|
|
|
|
|
|
// Indicates that it is safe to unlock painting once all pending reflows
|
|
|
|
// have been processed.
|
|
|
|
bool mShouldUnsuppressPainting : 1;
|
|
|
|
|
2015-05-08 20:12:41 +03:00
|
|
|
bool mAsyncResizeTimerIsActive : 1;
|
|
|
|
bool mInResize : 1;
|
2012-05-16 21:32:40 +04:00
|
|
|
|
2016-03-26 00:49:43 +03:00
|
|
|
bool mApproximateFrameVisibilityVisited : 1;
|
2013-02-25 04:59:22 +04:00
|
|
|
|
2014-01-30 09:41:17 +04:00
|
|
|
bool mNextPaintCompressed : 1;
|
|
|
|
|
2014-09-23 21:50:00 +04:00
|
|
|
bool mHasCSSBackgroundColor : 1;
|
|
|
|
|
2015-01-03 04:06:14 +03:00
|
|
|
// Whether content should be scaled by the resolution amount. If this is
|
|
|
|
// not set, a transform that scales by the inverse of the resolution is
|
|
|
|
// applied to rendered layers.
|
|
|
|
bool mScaleToResolution : 1;
|
|
|
|
|
2015-01-21 04:16:04 +03:00
|
|
|
// Whether the last chrome-only escape key event is consumed.
|
|
|
|
bool mIsLastChromeOnlyEscapeKeyConsumed : 1;
|
|
|
|
|
2015-06-18 23:42:39 +03:00
|
|
|
// Whether the widget has received a paint message yet.
|
|
|
|
bool mHasReceivedPaintMessage : 1;
|
|
|
|
|
2012-05-16 21:32:40 +04:00
|
|
|
static bool sDisableNonTestMouseEvents;
|
2011-09-09 23:50:21 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* !defined(nsPresShell_h_) */
|